OSDN Git Service

Fix gles10 ambient
authorXoppa <contact@xoppa.nl>
Sat, 10 Aug 2013 17:15:41 +0000 (19:15 +0200)
committerXoppa <contact@xoppa.nl>
Sat, 10 Aug 2013 17:15:41 +0000 (19:15 +0200)
gdx/src/com/badlogic/gdx/graphics/g3d/shaders/GLES10Shader.java

index 26d90c4..4f1634f 100644 (file)
@@ -146,7 +146,7 @@ public class GLES10Shader implements Shader{
                                        Gdx.gl10.glColor4f(((ColorAttribute)attribute).color.r, ((ColorAttribute)attribute).color.g, ((ColorAttribute)attribute).color.b, ((ColorAttribute)attribute).color.a);
                                        if (renderable.lights != null) {
                                                Gdx.gl10.glEnable(GL10.GL_COLOR_MATERIAL);
-                                               Gdx.gl10.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_AMBIENT, zeroVal4, 0);
+                                               Gdx.gl10.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_AMBIENT, getValues(lightVal, ((ColorAttribute)attribute).color), 0);
                                                Gdx.gl10.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_DIFFUSE, getValues(lightVal, ((ColorAttribute)attribute).color), 0);
                                        }
                                } else if (attribute.type == TextureAttribute.Diffuse) {