mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Clamp shininess to 0 to avoid a GL error when negative shininess was entered
This commit is contained in:
parent
8eab20a6c1
commit
6a2e1a438c
@ -6428,7 +6428,7 @@ do_issue_material() {
|
|||||||
|
|
||||||
call_glMaterialfv(face, GL_SPECULAR, material->get_specular());
|
call_glMaterialfv(face, GL_SPECULAR, material->get_specular());
|
||||||
call_glMaterialfv(face, GL_EMISSION, material->get_emission());
|
call_glMaterialfv(face, GL_EMISSION, material->get_emission());
|
||||||
glMaterialf(face, GL_SHININESS, min(material->get_shininess(), (PN_stdfloat)128.0));
|
glMaterialf(face, GL_SHININESS, max(min(material->get_shininess(), (PN_stdfloat)128), (PN_stdfloat)0));
|
||||||
|
|
||||||
if (material->has_ambient() && material->has_diffuse()) {
|
if (material->has_ambient() && material->has_diffuse()) {
|
||||||
// The material has both an ambient and diffuse specified. This
|
// The material has both an ambient and diffuse specified. This
|
||||||
|
Loading…
x
Reference in New Issue
Block a user