diff --git a/panda/src/pgraph/lightRampAttrib.cxx b/panda/src/pgraph/lightRampAttrib.cxx index 32df6a0f4b..399754a69c 100644 --- a/panda/src/pgraph/lightRampAttrib.cxx +++ b/panda/src/pgraph/lightRampAttrib.cxx @@ -96,7 +96,7 @@ make_single_threshold(PN_stdfloat thresh0, PN_stdfloat val0) { CPT(RenderAttrib) LightRampAttrib:: make_double_threshold(PN_stdfloat thresh0, PN_stdfloat val0, PN_stdfloat thresh1, PN_stdfloat val1) { LightRampAttrib *attrib = new LightRampAttrib(); - attrib->_mode = LRT_single_threshold; + attrib->_mode = LRT_double_threshold; attrib->_threshold[0] = thresh0; attrib->_level[0] = val0; attrib->_threshold[1] = thresh1; diff --git a/panda/src/pgraphnodes/shaderGenerator.cxx b/panda/src/pgraphnodes/shaderGenerator.cxx index 47c8aed5b8..27a90640fe 100644 --- a/panda/src/pgraphnodes/shaderGenerator.cxx +++ b/panda/src/pgraphnodes/shaderGenerator.cxx @@ -1178,12 +1178,11 @@ synthesize_shader(const RenderState *rs) { PN_stdfloat t1 = light_ramp->get_threshold(1); PN_stdfloat l0 = light_ramp->get_level(0); PN_stdfloat l1 = light_ramp->get_level(1); - PN_stdfloat l2 = light_ramp->get_level(2); text << "\t // Double-threshold light ramp\n"; text << "\t float lr_in = dot(tot_diffuse.rgb, float3(0.33,0.34,0.33));\n"; - text << "\t float lr_out = " << l0 << "\n"; - text << "\t if (lr_in > " << t0 << ") lr_out=" << l1 << ";\n"; - text << "\t if (lr_in > " << t1 << ") lr_out=" << l2 << ";\n"; + text << "\t float lr_out = 0.0;\n"; + text << "\t if (lr_in > " << t0 << ") lr_out=" << l0 << ";\n"; + text << "\t if (lr_in > " << t1 << ") lr_out=" << l1 << ";\n"; text << "\t tot_diffuse = tot_diffuse * (lr_out / lr_in);\n"; break; }