Cleanup: Remove unused total power Emission code in Cycles, that was never exposed in the UI.

Differential Revision: https://developer.blender.org/D562
This commit is contained in:
Thomas Dinges 2014-05-30 14:32:32 +02:00
parent a26e41c0b9
commit 2c69f1e574
Notes: blender-bot 2023-02-14 10:33:02 +01:00
Referenced by issue #40491, grouping VSE strips can break translucency
Referenced by issue #40489, multi-spline curve with some closed and some non-closed elements only shows closed elements; and unclosed elements are invisible in the UI unless object is selected or active
7 changed files with 3 additions and 36 deletions

View 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();

View File

@ -17,14 +17,10 @@
#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();
}

View 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;

View 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);
}

View 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,

View 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");
}

View 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 {