Allow passing matrices to GLSL shaders either via NodePath or directly as a Mat4

This commit is contained in:
rdb 2014-07-03 21:59:22 +00:00
parent f8675fcd7b
commit 66e98f8c70

View File

@ -1156,9 +1156,7 @@ fetch_specified_part(Shader::ShaderMatInput part, InternalName *name, LMatrix4 &
return &t; return &t;
} }
case Shader::SMO_mat_constant_x: { case Shader::SMO_mat_constant_x: {
const NodePath &np = _target_shader->get_shader_input_nodepath(name); return &_target_shader->get_shader_input_matrix(name, t);
nassertr(!np.is_empty(), &LMatrix4::ident_mat());
return &(np.node()->get_transform()->get_mat());
} }
case Shader::SMO_vec_constant_x: { case Shader::SMO_vec_constant_x: {
const LVecBase4 &input = _target_shader->get_shader_input_vector(name); const LVecBase4 &input = _target_shader->get_shader_input_vector(name);