Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/nodes.cpp
| Show First 20 Lines • Show All 2,121 Lines • ▼ Show 20 Lines | |||||
| void TranslucentBsdfNode::compile(OSLCompiler& compiler) | void TranslucentBsdfNode::compile(OSLCompiler& compiler) | ||||
| { | { | ||||
| compiler.add(this, "node_translucent_bsdf"); | compiler.add(this, "node_translucent_bsdf"); | ||||
| } | } | ||||
| /* Transparent BSDF Closure */ | /* Transparent BSDF Closure */ | ||||
| TransparentBsdfNode::TransparentBsdfNode() | TransparentBsdfNode::TransparentBsdfNode() | ||||
| : ShaderNode("transparent") | |||||
| { | { | ||||
| name = "transparent"; | special_type = SHADER_SPECIAL_TYPE_CLOSURE; | ||||
| closure = CLOSURE_BSDF_TRANSPARENT_ID; | |||||
| add_input("Color", SHADER_SOCKET_COLOR, make_float3(0.8f, 0.8f, 0.8f)); | |||||
| add_input("SurfaceMixWeight", SHADER_SOCKET_FLOAT, 0.0f, ShaderInput::USE_SVM); | |||||
| add_output("BSDF", SHADER_SOCKET_CLOSURE); | |||||
| } | } | ||||
| void TransparentBsdfNode::compile(SVMCompiler& compiler) | void TransparentBsdfNode::compile(SVMCompiler& compiler) | ||||
| { | { | ||||
| BsdfNode::compile(compiler, NULL, NULL); | ShaderInput *color_in = input("Color"); | ||||
| if(color_in->link) | |||||
| compiler.add_node(NODE_CLOSURE_WEIGHT, compiler.stack_assign(color_in)); | |||||
| else | |||||
| compiler.add_node(NODE_CLOSURE_SET_WEIGHT, color_in->value); | |||||
| compiler.add_node(NODE_CLOSURE_TRANSPARENT, compiler.closure_mix_weight_offset()); | |||||
| } | } | ||||
| void TransparentBsdfNode::compile(OSLCompiler& compiler) | void TransparentBsdfNode::compile(OSLCompiler& compiler) | ||||
| { | { | ||||
| compiler.add(this, "node_transparent_bsdf"); | compiler.add(this, "node_transparent_bsdf"); | ||||
| } | } | ||||
| /* Subsurface Scattering Closure */ | /* Subsurface Scattering Closure */ | ||||
| ▲ Show 20 Lines • Show All 2,566 Lines • Show Last 20 Lines | |||||