Cycles: Use Displacement type in OSL ShadingSystem.

Reviewed by: brecht
Differential Revision: https://developer.blender.org/D386
This commit is contained in:
Thomas Dinges
2014-03-06 21:02:41 +01:00
parent 1d01675833
commit 8a38d840e9

View File

@@ -513,16 +513,14 @@ void OSLCompiler::add(ShaderNode *node, const char *name, bool isfilepath)
} }
} }
/* create shader of the appropriate type. we pass "surface" to all shaders, /* create shader of the appropriate type. OSL only distinguishes between "surface"
* because "volume" and "displacement" don't work yet in OSL. the shaders * and "displacement" atm */
* work fine, but presumably these values would be used for more strict
* checking, so when that is fixed, we should update the code here too. */
if(current_type == SHADER_TYPE_SURFACE) if(current_type == SHADER_TYPE_SURFACE)
ss->Shader("surface", name, id(node).c_str()); ss->Shader("surface", name, id(node).c_str());
else if(current_type == SHADER_TYPE_VOLUME) else if(current_type == SHADER_TYPE_VOLUME)
ss->Shader("surface", name, id(node).c_str()); ss->Shader("surface", name, id(node).c_str());
else if(current_type == SHADER_TYPE_DISPLACEMENT) else if(current_type == SHADER_TYPE_DISPLACEMENT)
ss->Shader("surface", name, id(node).c_str()); ss->Shader("displacement", name, id(node).c_str());
else else
assert(0); assert(0);