/////////////////////////////////////////////////// // // used for rendering to the HUD // /////////////////////////////////////////////////// shader 0 "hud" [ attribute vec4 vvertex, vcolor; attribute vec2 vtexcoord0; uniform mat4 hudmatrix; varying vec2 texcoord0; varying vec4 colorscale; void main(void) { gl_Position = hudmatrix * vvertex; texcoord0 = vtexcoord0; colorscale = vcolor; } ] [ uniform sampler2D tex0; varying vec2 texcoord0; varying vec4 colorscale; fragdata(0) vec4 fragcolor; void main(void) { vec4 color = texture2D(tex0, texcoord0); fragcolor = colorscale * color; } ] shader 0 "hudtext" [ attribute vec4 vvertex, vcolor; attribute vec2 vtexcoord0; uniform mat4 hudmatrix; varying vec2 texcoord0; varying vec4 colorscale; void main(void) { gl_Position = hudmatrix * vvertex; texcoord0 = vtexcoord0; colorscale = vcolor; } ] [ uniform sampler2D tex0; uniform vec4 textparams; varying vec2 texcoord0; varying vec4 colorscale; fragdata(0) vec4 fragcolor; void main(void) { float dist = texture2D(tex0, texcoord0).r; float border = smoothstep(textparams.x, textparams.y, dist); float outline = smoothstep(textparams.z, textparams.w, dist); fragcolor = vec4(colorscale.rgb * outline, colorscale.a * border); } ] shader 0 "hudrgb" [ attribute vec4 vvertex, vcolor; attribute vec2 vtexcoord0; uniform mat4 hudmatrix; varying vec2 texcoord0; varying vec4 colorscale; void main(void) { gl_Position = hudmatrix * vvertex; texcoord0 = vtexcoord0; colorscale = vcolor; } ] [ uniform sampler2D tex0; varying vec2 texcoord0; varying vec4 colorscale; fragdata(0) vec4 fragcolor; void main(void) { vec4 color = texture2D(tex0, texcoord0); fragcolor.rgb = colorscale.rgb * color.rgb; fragcolor.a = colorscale.a; } ] shader 0 "hudnotexture" [ attribute vec4 vvertex, vcolor; uniform mat4 hudmatrix; varying vec4 color; void main(void) { gl_Position = hudmatrix * vvertex; color = vcolor; } ] [ varying vec4 color; fragdata(0) vec4 fragcolor; void main(void) { fragcolor = color; } ] shader 0 "hudrect" [ attribute vec4 vvertex, vcolor; attribute vec2 vtexcoord0; uniform mat4 hudmatrix; varying vec2 texcoord0; varying vec4 colorscale; void main(void) { gl_Position = hudmatrix * vvertex; texcoord0 = vtexcoord0; colorscale = vcolor; } ] [ uniform sampler2DRect tex0; varying vec2 texcoord0; varying vec4 colorscale; fragdata(0) vec4 fragcolor; void main(void) { fragcolor = colorscale * texture2DRect(tex0, texcoord0); } ] shader 0 "hud3d" [ attribute vec4 vvertex, vcolor; attribute vec3 vtexcoord0; uniform mat4 hudmatrix; varying vec3 texcoord0; varying vec4 color; void main(void) { gl_Position = hudmatrix * vvertex; texcoord0 = vtexcoord0; color = vcolor; } ] [ uniform sampler3D tex0; varying vec3 texcoord0; varying vec4 color; fragdata(0) vec4 fragcolor; void main(void) { fragcolor = color * texture3D(tex0, texcoord0); } ] shader 0 "hudcubemap" [ attribute vec4 vvertex, vcolor; attribute vec3 vtexcoord0; uniform mat4 hudmatrix; varying vec3 texcoord0; varying vec4 colorscale; void main(void) { gl_Position = hudmatrix * vvertex; texcoord0 = vtexcoord0; colorscale = vcolor; } ] [ uniform samplerCube tex0; varying vec3 texcoord0; varying vec4 colorscale; fragdata(0) vec4 fragcolor; void main(void) { fragcolor = colorscale * textureCube(tex0, texcoord0); } ]