Search
lxdream.org :: lxdream :: r1250:204dae47ab7a
lxdream 0.9.1
released Jun 29
Download Now
changeset1250:204dae47ab7a
parent1249:a81130f57df6
child1251:b8ab59d39756
authornkeynes
dateSat Mar 03 16:08:48 2012 +1000 (7 years ago)
Add explicit precision (required by ES SL) and remove unnecessary
gl_FragDepth assignments
src/pvr2/shaders.glsl
1.1 --- a/src/pvr2/shaders.glsl Sat Mar 03 16:06:58 2012 +1000
1.2 +++ b/src/pvr2/shaders.glsl Sat Mar 03 16:08:48 2012 +1000
1.3 @@ -86,7 +86,7 @@
1.4 }
1.5
1.6 #fragment DEFAULT_FRAGMENT_SHADER
1.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.19
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.29
1.30 #fragment BASIC_FRAGMENT_SHADER
1.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.42
1.43 #program basic_shader = BASIC_VERTEX_SHADER BASIC_FRAGMENT_SHADER
.