diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-01-21 20:19:31 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-01-27 11:36:30 +0300 |
commit | df07a25d2811c43648af3e9bf4cc44d255218d65 (patch) | |
tree | 9d2aa5889b536f3e5c706b57f4fd2b551e3bb66d /intern/cycles/render/osl.cpp | |
parent | ddc0d280311a442bb90790e7421d64ed60136d0d (diff) |
Cycles: Support texture coordinate from another object
This is the same as blender internal's texture mapping from another object,
so this way it's possible to control texture space of one object by another.
Quite straightforward change apart from the workaround for the stupidness of
the dependency graph. Now shader has flag telling that it depends on object
transform. This is the simplest way to know which shaders needs to be tagged
for update when object changes. This might give some false-positive tags now
but reducing them should not be priority for Cycles and rather be a priority
to bring new dependency graph.
Also GLSL preview does not support using other object for mapping.
This is actually correct for BI shading as well and to be addressed as
a part of general GLSL viewport improvements since it's not really clear
how to support this in GLSL.
Reviewers: brecht, juicyfruit
Subscribers: eyecandy, venomgfx
Differential Revision: https://developer.blender.org/D1021
Diffstat (limited to 'intern/cycles/render/osl.cpp')
-rw-r--r-- | intern/cycles/render/osl.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/intern/cycles/render/osl.cpp b/intern/cycles/render/osl.cpp index 7ddfdaf6cc2..7b22d200a9e 100644 --- a/intern/cycles/render/osl.cpp +++ b/intern/cycles/render/osl.cpp @@ -567,6 +567,10 @@ void OSLCompiler::add(ShaderNode *node, const char *name, bool isfilepath) if(node->has_spatial_varying()) current_shader->has_heterogeneous_volume = true; } + + if(node->has_object_dependency()) { + current_shader->has_object_dependency = true; + } } void OSLCompiler::parameter(const char *name, float f) @@ -808,6 +812,7 @@ void OSLCompiler::compile(OSLGlobals *og, Shader *shader) shader->has_volume = false; shader->has_displacement = false; shader->has_heterogeneous_volume = false; + shader->has_object_dependency = false; /* generate surface shader */ if(shader->used && graph && output->input("Surface")->link) { |