mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Add shininess shader input
This commit is contained in:
parent
c257ce624e
commit
4856804938
@ -370,6 +370,9 @@ issue_parameters(int altered) {
|
|||||||
GLfr(cgGLSetMatrixParameter)(p, upper3.get_data());
|
GLfr(cgGLSetMatrixParameter)(p, upper3.get_data());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
case Shader::SMP_cell15:
|
||||||
|
GLf(cgGLSetParameter1)(p, data[15]);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -374,6 +374,10 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext
|
|||||||
bind._piece = Shader::SMP_row3x3;
|
bind._piece = Shader::SMP_row3x3;
|
||||||
s->_mat_spec.push_back(bind);
|
s->_mat_spec.push_back(bind);
|
||||||
continue;
|
continue;
|
||||||
|
} else if (noprefix == "Material.shininess") {
|
||||||
|
bind._piece = Shader::SMP_cell15;
|
||||||
|
s->_mat_spec.push_back(bind);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (noprefix == "ColorScale") {
|
if (noprefix == "ColorScale") {
|
||||||
@ -938,6 +942,9 @@ issue_parameters(int altered) {
|
|||||||
_glgsg->_glUniformMatrix3fv(p, 1, true, upper3.get_data());
|
_glgsg->_glUniformMatrix3fv(p, 1, true, upper3.get_data());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
case Shader::SMP_cell15:
|
||||||
|
_glgsg->_glUniform1fv(p, 1, data+15);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -993,6 +1000,7 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) {
|
|||||||
Geom::NumericType numeric_type;
|
Geom::NumericType numeric_type;
|
||||||
int start, stride, num_values;
|
int start, stride, num_values;
|
||||||
int nvarying = _shader->_var_spec.size();
|
int nvarying = _shader->_var_spec.size();
|
||||||
|
|
||||||
for (int i = 0; i < nvarying; ++i) {
|
for (int i = 0; i < nvarying; ++i) {
|
||||||
InternalName *name = _shader->_var_spec[i]._name;
|
InternalName *name = _shader->_var_spec[i]._name;
|
||||||
int texslot = _shader->_var_spec[i]._append_uv;
|
int texslot = _shader->_var_spec[i]._append_uv;
|
||||||
@ -1024,6 +1032,8 @@ update_shader_vertex_arrays(ShaderContext *prev, bool force) {
|
|||||||
_glgsg->_glVertexAttribPointer(p, num_values, _glgsg->get_numeric_type(numeric_type),
|
_glgsg->_glVertexAttribPointer(p, num_values, _glgsg->get_numeric_type(numeric_type),
|
||||||
GL_TRUE, stride, client_pointer + start);
|
GL_TRUE, stride, client_pointer + start);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
_glgsg->_glDisableVertexAttribArray(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -234,6 +234,7 @@ public:
|
|||||||
SMP_row3x3,
|
SMP_row3x3,
|
||||||
SMP_upper3x3,
|
SMP_upper3x3,
|
||||||
SMP_transpose3x3,
|
SMP_transpose3x3,
|
||||||
|
SMP_cell15,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ShaderStateDep {
|
enum ShaderStateDep {
|
||||||
@ -362,6 +363,7 @@ public:
|
|||||||
int _dep[2];
|
int _dep[2];
|
||||||
PT(InternalName) _arg;
|
PT(InternalName) _arg;
|
||||||
ShaderArgInfo _info;
|
ShaderArgInfo _info;
|
||||||
|
ShaderPtrType _type;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ShaderCaps {
|
class ShaderCaps {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user