Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/nodes.cpp
| Show First 20 Lines • Show All 2,354 Lines • ▼ Show 20 Lines | |||||
| void UVMapNode::compile(SVMCompiler& compiler) | void UVMapNode::compile(SVMCompiler& compiler) | ||||
| { | { | ||||
| ShaderOutput *out = output("UV"); | ShaderOutput *out = output("UV"); | ||||
| NodeType texco_node = NODE_TEX_COORD; | NodeType texco_node = NODE_TEX_COORD; | ||||
| NodeType attr_node = NODE_ATTR; | NodeType attr_node = NODE_ATTR; | ||||
| int attr; | int attr; | ||||
| if(bump == SHADER_BUMP_DX) { | |||||
| texco_node = NODE_TEX_COORD_BUMP_DX; | |||||
| attr_node = NODE_ATTR_BUMP_DX; | |||||
| } | |||||
| else if(bump == SHADER_BUMP_DY) { | |||||
| texco_node = NODE_TEX_COORD_BUMP_DY; | |||||
| attr_node = NODE_ATTR_BUMP_DY; | |||||
| } | |||||
| if(!out->links.empty()) { | if(!out->links.empty()) { | ||||
| if(from_dupli) { | if(from_dupli) { | ||||
| compiler.stack_assign(out); | compiler.stack_assign(out); | ||||
| compiler.add_node(texco_node, NODE_TEXCO_DUPLI_UV, out->stack_offset); | compiler.add_node(texco_node, NODE_TEXCO_DUPLI_UV, out->stack_offset); | ||||
| } | } | ||||
| else { | else { | ||||
| if (attribute != "") | if (attribute != "") | ||||
| attr = compiler.attribute(attribute); | attr = compiler.attribute(attribute); | ||||
| else | else | ||||
| attr = compiler.attribute(ATTR_STD_UV); | attr = compiler.attribute(ATTR_STD_UV); | ||||
| compiler.stack_assign(out); | compiler.stack_assign(out); | ||||
| compiler.add_node(attr_node, attr, out->stack_offset, NODE_ATTR_FLOAT3); | compiler.add_node(attr_node, attr, out->stack_offset, NODE_ATTR_FLOAT3); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void UVMapNode::compile(OSLCompiler& compiler) | void UVMapNode::compile(OSLCompiler& compiler) | ||||
| { | { | ||||
| if(bump == SHADER_BUMP_DX) | |||||
| compiler.parameter("bump_offset", "dx"); | |||||
| else if(bump == SHADER_BUMP_DY) | |||||
| compiler.parameter("bump_offset", "dy"); | |||||
| else | |||||
| compiler.parameter("bump_offset", "center"); | |||||
| compiler.parameter("from_dupli", from_dupli); | compiler.parameter("from_dupli", from_dupli); | ||||
| compiler.parameter("name", attribute.c_str()); | compiler.parameter("name", attribute.c_str()); | ||||
| compiler.add(this, "node_uv_map"); | compiler.add(this, "node_uv_map"); | ||||
| } | } | ||||
| /* Light Path */ | /* Light Path */ | ||||
| LightPathNode::LightPathNode() | LightPathNode::LightPathNode() | ||||
| ▲ Show 20 Lines • Show All 1,711 Lines • Show Last 20 Lines | |||||