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:
Brecht Van Lommel
2012-12-12 06:51:06 +00:00
parent cf723e5e7c
commit 3759c10e5c
5 changed files with 58 additions and 15 deletions

View File

@@ -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