Fix #33485: cycles OSL now autodetects the presence of emission and transparent
closures to enable multiple importance sampling and transparent shadows.
This commit is contained in:
@@ -45,6 +45,18 @@ class ShaderOutput;
|
||||
|
||||
#ifdef WITH_OSL
|
||||
|
||||
/* OSL Shader Info
|
||||
* to auto detect closures in the shader for MIS and transparent shadows */
|
||||
|
||||
struct OSLShaderInfo {
|
||||
OSLShaderInfo()
|
||||
: has_surface_emission(false), has_surface_transparent(false)
|
||||
{}
|
||||
|
||||
bool has_surface_emission;
|
||||
bool has_surface_transparent;
|
||||
};
|
||||
|
||||
/* Shader Manage */
|
||||
|
||||
class OSLShaderManager : public ShaderManager {
|
||||
@@ -65,6 +77,7 @@ public:
|
||||
const char *shader_test_loaded(const string& hash);
|
||||
const char *shader_load_bytecode(const string& hash, const string& bytecode);
|
||||
const char *shader_load_filepath(string filepath);
|
||||
OSLShaderInfo *shader_loaded_info(const string& hash);
|
||||
|
||||
protected:
|
||||
void texture_system_init();
|
||||
@@ -74,7 +87,7 @@ protected:
|
||||
OSL::TextureSystem *ts;
|
||||
OSLRenderServices *services;
|
||||
OSL::ErrorHandler errhandler;
|
||||
set<string> loaded_shaders;
|
||||
map<string, OSLShaderInfo> loaded_shaders;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user