Cleanup: Remove unused total power Emission code in Cycles, that was never exposed...
authorThomas Dinges <blender@dingto.org>
Fri, 30 May 2014 12:32:32 +0000 (14:32 +0200)
committerThomas Dinges <blender@dingto.org>
Fri, 30 May 2014 12:32:59 +0000 (14:32 +0200)
Differential Revision: https://developer.blender.org/D562

intern/cycles/app/cycles_xml.cpp
intern/cycles/kernel/shaders/node_emission.osl
intern/cycles/kernel/svm/svm.h
intern/cycles/kernel/svm/svm_closure.h
intern/cycles/kernel/svm/svm_types.h
intern/cycles/render/nodes.cpp
intern/cycles/render/nodes.h

index d5ef30e5c6fb15622930713f5d0a3c1e7a3f7b99..de554fba9544ed92d17993c9da54af2044812b5f 100644 (file)
@@ -550,9 +550,7 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
                        snode = hair;
                }
                else if(string_iequals(node.name(), "emission")) {
-                       EmissionNode *emission = new EmissionNode();
-                       xml_read_bool(&emission->total_power, node, "total_power");
-                       snode = emission;
+                       snode = new EmissionNode();
                }
                else if(string_iequals(node.name(), "ambient_occlusion")) {
                        snode = new AmbientOcclusionNode();
index 2428da5ef4e54b0695470833ce8ad7e10f9200bb..b28d731c19f9195fe081fcd98a2e637f26de1579 100644 (file)
 #include "stdosl.h"
 
 shader node_emission(
-       int TotalPower = 0,
        color Color = 0.8,
        float Strength = 1.0,
        output closure color Emission = 0)
 {
-       if (TotalPower)
-               Emission = ((Strength / surfacearea()) * Color) * emission();
-       else
-               Emission = (Strength * Color) * emission();
+       Emission = (Strength * Color) * emission();
 }
 
index dbf59c60cb05679899c839a6fc215db680d3fcf5..6d556a66afa65e3dcd132c4422d1b336df296bf5 100644 (file)
@@ -407,12 +407,7 @@ ccl_device_noinline void svm_eval_nodes(KernelGlobals *kg, ShaderData *sd, Shade
                                break;
                        case NODE_CLOSURE_SET_NORMAL:
                                svm_node_set_normal(kg, sd, stack, node.y, node.z );
-                               break;                  
-#endif
-                       case NODE_EMISSION_SET_WEIGHT_TOTAL:
-                               svm_node_emission_set_weight_total(kg, sd, node.y, node.z, node.w);
                                break;
-#ifdef __EXTRA_NODES__
                        case NODE_RGB_RAMP:
                                svm_node_rgb_ramp(kg, sd, stack, node, &offset);
                                break;
index a37708775448c794f89f125336aa5b6118a8a628..27c5a19a7a0769015b0f05f1ea3ff2e2310935be 100644 (file)
@@ -582,16 +582,6 @@ ccl_device void svm_node_closure_set_weight(ShaderData *sd, uint r, uint g, uint
        svm_node_closure_store_weight(sd, weight);
 }
 
-ccl_device void svm_node_emission_set_weight_total(KernelGlobals *kg, ShaderData *sd, uint r, uint g, uint b)
-{
-       float3 weight = make_float3(__uint_as_float(r), __uint_as_float(g), __uint_as_float(b));
-
-       if(sd->object != OBJECT_NONE)
-               weight /= object_surface_area(kg, sd->object);
-
-       svm_node_closure_store_weight(sd, weight);
-}
-
 ccl_device void svm_node_closure_weight(ShaderData *sd, float *stack, uint weight_offset)
 {
        float3 weight = stack_load_float3(stack, weight_offset);
@@ -603,14 +593,10 @@ ccl_device void svm_node_emission_weight(KernelGlobals *kg, ShaderData *sd, floa
 {
        uint color_offset = node.y;
        uint strength_offset = node.z;
-       uint total_power = node.w;
 
        float strength = stack_load_float(stack, strength_offset);
        float3 weight = stack_load_float3(stack, color_offset)*strength;
 
-       if(total_power && sd->object != OBJECT_NONE)
-               weight /= object_surface_area(kg, sd->object);
-
        svm_node_closure_store_weight(sd, weight);
 }
 
index 80972ec82bc778828826837236d284e85445e268..fda035fdbe08e4c84a571b7ff2e9af59990127da 100644 (file)
@@ -72,7 +72,6 @@ typedef enum NodeType {
        NODE_TEX_COORD,
        NODE_TEX_COORD_BUMP_DX,
        NODE_TEX_COORD_BUMP_DY,
-       NODE_EMISSION_SET_WEIGHT_TOTAL,
        NODE_ATTR_BUMP_DX,
        NODE_ATTR_BUMP_DY,
        NODE_TEX_ENVIRONMENT,
index a53e0b394353315d0ac682b97eb21290353b30be..1a1667ff1b30566fcc658ede9fa2ae7d9fd72826 100644 (file)
@@ -1850,8 +1850,6 @@ bool SubsurfaceScatteringNode::has_bssrdf_bump()
 EmissionNode::EmissionNode()
 : ShaderNode("emission")
 {
-       total_power = false;
-
        add_input("Color", SHADER_SOCKET_COLOR, make_float3(0.8f, 0.8f, 0.8f));
        add_input("Strength", SHADER_SOCKET_FLOAT, 10.0f);
        add_input("SurfaceMixWeight", SHADER_SOCKET_FLOAT, 0.0f, ShaderInput::USE_SVM);
@@ -1867,10 +1865,8 @@ void EmissionNode::compile(SVMCompiler& compiler)
        if(color_in->link || strength_in->link) {
                compiler.stack_assign(color_in);
                compiler.stack_assign(strength_in);
-               compiler.add_node(NODE_EMISSION_WEIGHT, color_in->stack_offset, strength_in->stack_offset, total_power? 1: 0);
+               compiler.add_node(NODE_EMISSION_WEIGHT, color_in->stack_offset, strength_in->stack_offset);
        }
-       else if(total_power)
-               compiler.add_node(NODE_EMISSION_SET_WEIGHT_TOTAL, color_in->value * strength_in->value.x);
        else
                compiler.add_node(NODE_CLOSURE_SET_WEIGHT, color_in->value * strength_in->value.x);
 
@@ -1879,7 +1875,6 @@ void EmissionNode::compile(SVMCompiler& compiler)
 
 void EmissionNode::compile(OSLCompiler& compiler)
 {
-       compiler.parameter("TotalPower", (total_power)? 1: 0);
        compiler.add(this, "node_emission");
 }
 
index d94d8ce6033ed6b6067f6f24071971b88c6483e0..8bdce9901b28142cb81e6d582344aaf4d896c3aa 100644 (file)
@@ -294,8 +294,6 @@ public:
 
        bool has_surface_emission() { return true; }
        bool has_spatial_varying() { return true; }
-
-       bool total_power;
 };
 
 class BackgroundNode : public ShaderNode {