Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/nodes.cpp
| Show First 20 Lines • Show All 5,906 Lines • ▼ Show 20 Lines | NODE_DEFINE(OutputAOVNode) | ||||
| SOCKET_STRING(name, "AOV Name", ustring("")); | SOCKET_STRING(name, "AOV Name", ustring("")); | ||||
| return type; | return type; | ||||
| } | } | ||||
| OutputAOVNode::OutputAOVNode() : ShaderNode(get_node_type()) | OutputAOVNode::OutputAOVNode() : ShaderNode(get_node_type()) | ||||
| { | { | ||||
| special_type = SHADER_SPECIAL_TYPE_OUTPUT_AOV; | special_type = SHADER_SPECIAL_TYPE_OUTPUT_AOV; | ||||
| slot = -1; | offset = -1; | ||||
| } | } | ||||
| void OutputAOVNode::simplify_settings(Scene *scene) | void OutputAOVNode::simplify_settings(Scene *scene) | ||||
| { | { | ||||
| slot = scene->film->get_aov_offset(scene, name.string(), is_color); | offset = scene->film->get_aov_offset(scene, name.string(), is_color); | ||||
| if (slot == -1) { | if (offset == -1) { | ||||
| slot = scene->film->get_aov_offset(scene, name.string(), is_color); | offset = scene->film->get_aov_offset(scene, name.string(), is_color); | ||||
| } | } | ||||
| if (slot == -1 || is_color) { | if (offset == -1 || is_color) { | ||||
| input("Value")->disconnect(); | input("Value")->disconnect(); | ||||
| } | } | ||||
| if (slot == -1 || !is_color) { | if (offset == -1 || !is_color) { | ||||
| input("Color")->disconnect(); | input("Color")->disconnect(); | ||||
| } | } | ||||
| } | } | ||||
| void OutputAOVNode::compile(SVMCompiler &compiler) | void OutputAOVNode::compile(SVMCompiler &compiler) | ||||
| { | { | ||||
| assert(slot >= 0); | assert(offset >= 0); | ||||
| if (is_color) { | if (is_color) { | ||||
| compiler.add_node(NODE_AOV_COLOR, compiler.stack_assign(input("Color")), slot); | compiler.add_node(NODE_AOV_COLOR, compiler.stack_assign(input("Color")), offset); | ||||
| } | } | ||||
| else { | else { | ||||
| compiler.add_node(NODE_AOV_VALUE, compiler.stack_assign(input("Value")), slot); | compiler.add_node(NODE_AOV_VALUE, compiler.stack_assign(input("Value")), offset); | ||||
| } | } | ||||
| } | } | ||||
| void OutputAOVNode::compile(OSLCompiler & /*compiler*/) | void OutputAOVNode::compile(OSLCompiler & /*compiler*/) | ||||
| { | { | ||||
| /* TODO */ | /* TODO */ | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,126 Lines • Show Last 20 Lines | |||||