filename | src/pvr2/shaders.glsl |
changeset | 1250:204dae47ab7a |
prev | 1240:190df8a791ca |
next | 1252:2fb29172ee79 |
author | nkeynes |
date | Sat Mar 03 16:08:48 2012 +1000 (8 years ago) |
permissions | -rw-r--r-- |
last change | Add explicit precision (required by ES SL) and remove unnecessary gl_FragDepth assignments |
file | annotate | diff | log | raw |
1.1 --- a/src/pvr2/shaders.glsl Tue Feb 28 17:25:26 2012 +10001.2 +++ b/src/pvr2/shaders.glsl Sat Mar 03 16:08:48 2012 +10001.3 @@ -86,7 +86,7 @@1.4 }1.6 #fragment DEFAULT_FRAGMENT_SHADER1.7 -1.8 +precision mediump float;1.9 uniform float alpha_ref;1.10 uniform sampler2D primary_texture;1.11 uniform sampler2D palette_texture;1.12 @@ -125,7 +125,6 @@1.13 } else {1.14 gl_FragColor.rgb = mix( main_colour, fog_colour2, -frag_colour2.a );1.15 }1.16 - gl_FragDepth = gl_FragCoord.z;1.17 }1.18 }1.20 @@ -143,13 +142,13 @@1.21 varying vec2 frag_texcoord;1.22 void main()1.23 {1.24 - gl_Position = view_matrix * vec4(in_vertex.x,in_vertex.y,0,1);1.25 + gl_Position = view_matrix * vec4(in_vertex.x,in_vertex.y,0.0,1.0);1.26 frag_colour = in_colour;1.27 frag_texcoord = in_texcoord;1.28 }1.30 #fragment BASIC_FRAGMENT_SHADER1.31 -1.32 +precision mediump float;1.33 uniform sampler2D primary_texture;1.34 varying vec4 frag_colour;1.35 varying vec2 frag_texcoord;1.36 @@ -158,7 +157,6 @@1.37 {1.38 vec4 tex = texture2D( primary_texture, frag_texcoord.xy );1.39 gl_FragColor.rgb = mix( frag_colour.rgb, tex.rgb, frag_colour.a );1.40 - gl_FragDepth = gl_FragCoord.z;1.41 }1.43 #program basic_shader = BASIC_VERTEX_SHADER BASIC_FRAGMENT_SHADER
.