Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-12-12 10:51:06 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-12-12 10:51:06 +0400
commit3759c10e5c832672920daf80b0f1018604cfb4b4 (patch)
tree1e7dc95b5a192213ea2f26927228e9fe173e5af4 /intern/cycles/render/osl.h
parentcf723e5e7c99cf653196b47afe131cb3cac24050 (diff)
Fix #33485: cycles OSL now autodetects the presence of emission and transparent
closures to enable multiple importance sampling and transparent shadows.
Diffstat (limited to 'intern/cycles/render/osl.h')
-rw-r--r--intern/cycles/render/osl.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/intern/cycles/render/osl.h b/intern/cycles/render/osl.h
index 9b58745bd46..3c599caa893 100644
--- a/intern/cycles/render/osl.h
+++ b/intern/cycles/render/osl.h
@@ -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