From f4730179a4436dff7282bc42bc6aa58fb5fb63b5 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 28 Sep 2011 17:14:31 +0200 Subject: Fix ES2 shaders Add missing floating point precision qualifiers. '#extension OES_standard_derivatives : require' somehow doesn't pass the GLSL compiler, however '#extension GL_OES_standard_derivatives : enable' does. Currently works on ARM's Mali-400 MP, NV Tegra still don't show a picture. TODO: More in depth evaluation. --- .../com/jogamp/opengl/test/junit/jogl/demos/es2/shader/gears.fp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/test/com/jogamp') diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/gears.fp b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/gears.fp index be2ec6843..9a89381d1 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/gears.fp +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/gears.fp @@ -33,14 +33,14 @@ void main() MEDIUMP vec4 diffuse = color * lambertTerm * attenuation * matDiffuse; MEDIUMP vec4 specular = vec4(0.0); if (lambertTerm > 0.0) { - float NdotHV; + MEDIUMP float NdotHV; /* MEDIUMP vec3 halfDir; halfDir = normalize (lightDir + cameraDir); NdotHV = max(0.0, dot(normal, halfDir)); */ - vec3 E = normalize(-position.xyz); - vec3 R = reflect(-lightDir, normal); + MEDIUMP vec3 E = normalize(-position.xyz); + MEDIUMP vec3 R = reflect(-lightDir, normal); NdotHV = max(0.0, dot(R, E)); specular += color * pow(NdotHV, matShininess) * attenuation * matSpecular; -- cgit v1.2.3