From 83006b933b2337abac312bd133d4593608838792 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 28 Apr 2009 09:03:35 +0000 Subject: [PATCH] Add attr_colorscale --- panda/src/display/graphicsStateGuardian.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index 815098290c..c0302a3578 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -1001,6 +1001,15 @@ fetch_specified_part(Shader::ShaderMatInput part, InternalName *name, LMatrix4f t = LMatrix4f(0,0,0,0,0,0,0,0,0,0,0,0,c[0],c[1],c[2],c[3]); return &t; } + case Shader::SMO_attr_colorscale: { + const ColorScaleAttrib *target_color = DCAST(ColorScaleAttrib, _target_rs->get_attrib_def(ColorScaleAttrib::get_class_slot())); + if (target_color->is_identity()) { + return &LMatrix4f::ones_mat(); + } + LVecBase4f cs = target_color->get_scale(); + t = LMatrix4f(0,0,0,0,0,0,0,0,0,0,0,0,cs[0],cs[1],cs[2],cs[3]); + return &t; + } case Shader::SMO_alight_x: { const NodePath &np = _target_shader->get_shader_input_nodepath(name); nassertr(!np.is_empty(), &LMatrix4f::zeros_mat());