diff options
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders')
3 files changed, 4 insertions, 5 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColorLight.vp b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColorLight.vp index ce203cfb9..7ce1eedcf 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColorLight.vp +++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/FixedFuncColorLight.vp @@ -19,7 +19,7 @@ void main(void) position = mgl_PMVMatrix[1] * mgl_Vertex; // vertex eye position - normal = normalize(mgl_NormalMatrix * mgl_Normal); + normal = normalize(mgl_PMVMatrix[3] * mgl_Normal).xyz; // cameraPosition: (mgl_PMVMatrix[2] * vec4(0,0,0,1.0)).xyz cameraDir = normalize( (mgl_PMVMatrix[2] * vec4(0,0,0,1.0)).xyz - mgl_Vertex.xyz ); @@ -50,7 +50,7 @@ void main(void) } } } - ambient += mgl_FrontMaterial.ambient; + ambient *= mgl_FrontMaterial.ambient; diffuse *= mgl_FrontMaterial.diffuse; specular *= mgl_FrontMaterial.specular; diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_attribute.glsl b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_attribute.glsl index b09bdb05a..09a11ec95 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_attribute.glsl +++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_attribute.glsl @@ -5,7 +5,7 @@ #include es_precision.glsl attribute HIGHP vec4 mgl_Vertex; -attribute HIGHP vec3 mgl_Normal; +attribute HIGHP vec4 mgl_Normal; attribute HIGHP vec4 mgl_Color; attribute HIGHP vec4 mgl_MultiTexCoord0; attribute HIGHP vec4 mgl_MultiTexCoord1; diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_uniform.glsl b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_uniform.glsl index d8b3c7f95..4c4000dfa 100644 --- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_uniform.glsl +++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/shaders/mgl_uniform.glsl @@ -6,8 +6,7 @@ #include mgl_const.glsl -uniform HIGHP mat4 mgl_PMVMatrix[3]; // P, Mv, and Mvi -uniform HIGHP mat3 mgl_NormalMatrix; // transpose(inverse(ModelView)).3x3 +uniform HIGHP mat4 mgl_PMVMatrix[4]; // P, Mv, Mvi and Mvit (transpose(inverse(ModelView)) == normalMatrix) uniform LOWP int mgl_ColorEnabled; uniform HIGHP vec4 mgl_ColorStatic; uniform LOWP int mgl_TexCoordEnabled[MAX_TEXTURE_UNITS]; |