1.1 --- a/src/pvr2/shaders.glsl Thu Feb 23 22:20:15 2012 +1000
1.2 +++ b/src/pvr2/shaders.glsl Tue Feb 28 17:31:26 2012 +1000
1.4 * float gl_FragDepth;
1.8 +#include "../config.h"
1.10 #vertex DEFAULT_VERTEX_SHADER
1.11 uniform mat4 view_matrix;
1.12 @@ -130,3 +130,36 @@
1.15 #program pvr2_shader = DEFAULT_VERTEX_SHADER DEFAULT_FRAGMENT_SHADER
1.17 +#ifndef HAVE_OPENGL_FIXEDFUNC
1.18 +/* In this case we also need a basic shader to actually display the output */
1.19 +#vertex BASIC_VERTEX_SHADER
1.20 +uniform mat4 view_matrix;
1.21 +attribute vec2 in_vertex;
1.22 +attribute vec4 in_colour;
1.23 +attribute vec2 in_texcoord; /* uv = coord, z = palette, w = mode */
1.25 +varying vec4 frag_colour;
1.26 +varying vec2 frag_texcoord;
1.29 + gl_Position = view_matrix * vec4(in_vertex.x,in_vertex.y,0,1);
1.30 + frag_colour = in_colour;
1.31 + frag_texcoord = in_texcoord;
1.34 +#fragment BASIC_FRAGMENT_SHADER
1.36 +uniform sampler2D primary_texture;
1.37 +varying vec4 frag_colour;
1.38 +varying vec2 frag_texcoord;
1.42 + vec4 tex = texture2D( primary_texture, frag_texcoord.xy );
1.43 + gl_FragColor.rgb = mix( frag_colour.rgb, tex.rgb, frag_colour.a );
1.44 + gl_FragDepth = gl_FragCoord.z;
1.47 +#program basic_shader = BASIC_VERTEX_SHADER BASIC_FRAGMENT_SHADER