diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-10-20 19:09:36 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-10-20 19:09:36 +0400 |
commit | 73b79a6763f762ff2999622edd7c70aee69c18e9 (patch) | |
tree | c5dfc838e0f61db9c22bddb5e6c3f171953d2453 /intern/cycles/render | |
parent | e287c97fea74debb88b73de695b155fb172fa7c6 (diff) |
Cycles OSL: light path, texture coordinate, bump and blended box mapping now up
to date and working.
Diffstat (limited to 'intern/cycles/render')
-rw-r--r-- | intern/cycles/render/nodes.cpp | 10 | ||||
-rw-r--r-- | intern/cycles/render/osl.cpp | 20 |
2 files changed, 27 insertions, 3 deletions
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index 76267e9d014..da0dbc12740 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -225,6 +225,8 @@ void ImageTextureNode::compile(OSLCompiler& compiler) compiler.parameter("color_space", "Linear"); else compiler.parameter("color_space", "sRGB"); + compiler.parameter("projection", projection); + compiler.parameter("projection_blend", projection_blend); compiler.add(this, "node_image_texture"); } @@ -1701,7 +1703,7 @@ void GeometryNode::compile(OSLCompiler& compiler) TextureCoordinateNode::TextureCoordinateNode() : ShaderNode("texture_coordinate") { - add_input("Normal", SHADER_SOCKET_NORMAL, ShaderInput::NORMAL, true); + add_input("NormalIn", SHADER_SOCKET_NORMAL, ShaderInput::NORMAL, true); add_output("Generated", SHADER_SOCKET_POINT); add_output("Normal", SHADER_SOCKET_NORMAL); add_output("UV", SHADER_SOCKET_POINT); @@ -1823,6 +1825,8 @@ void TextureCoordinateNode::compile(OSLCompiler& compiler) if(compiler.background) compiler.parameter("is_background", true); + + compiler.parameter("from_dupli", from_dupli); compiler.add(this, "node_texture_coordinate"); } @@ -2770,7 +2774,7 @@ BumpNode::BumpNode() { /* this input is used by the user, but after graph transform it is no longer * used and moved to sampler center/x/y instead */ - add_input("Height", SHADER_SOCKET_NORMAL); + add_input("Height", SHADER_SOCKET_FLOAT); add_input("SampleCenter", SHADER_SOCKET_FLOAT); add_input("SampleX", SHADER_SOCKET_FLOAT); @@ -2909,7 +2913,7 @@ void SetNormalNode::compile(SVMCompiler& compiler) void SetNormalNode::compile(OSLCompiler& compiler) { - compiler.add(this, "set_normal"); + compiler.add(this, "node_set_normal"); } CCL_NAMESPACE_END diff --git a/intern/cycles/render/osl.cpp b/intern/cycles/render/osl.cpp index 21e6c7749b8..638bfa8634e 100644 --- a/intern/cycles/render/osl.cpp +++ b/intern/cycles/render/osl.cpp @@ -59,6 +59,22 @@ OSLShaderManager::OSLShaderManager() //ss->attribute("statistics:level", 1); ss->attribute("searchpath:shader", path_get("shader").c_str()); + /* our own ray types */ + static const char *raytypes[] = { + "camera", /* PATH_RAY_CAMERA */ + "reflection", /* PATH_RAY_REFLECT */ + "refraction", /* PATH_RAY_TRANSMIT */ + "diffuse", /* PATH_RAY_DIFFUSE */ + "glossy", /* PATH_RAY_GLOSSY */ + "singular", /* PATH_RAY_SINGULAR */ + "transparent", /* PATH_RAY_TRANSPARENT */ + "shadow", /* PATH_RAY_SHADOW_OPAQUE */ + "shadow", /* PATH_RAY_SHADOW_TRANSPARENT */ + }; + + const int nraytypes = sizeof(raytypes)/sizeof(raytypes[0]); + ss->attribute("raytypes", TypeDesc(TypeDesc::STRING, nraytypes), raytypes); + OSLShader::register_closures(ss); } @@ -209,6 +225,10 @@ bool OSLCompiler::node_skip_input(ShaderNode *node, ShaderInput *input) if(strcmp(input->name, "Normal") == 0) return true; } + else if(node->name == ustring("bump")) { + if(strcmp(input->name, "Height") == 0) + return true; + } else if(current_type == SHADER_TYPE_DISPLACEMENT && input->link && input->link->parent->name == ustring("bump")) return true; |