diff options
Diffstat (limited to 'shaders/tesseract/90.shader_test')
-rw-r--r-- | shaders/tesseract/90.shader_test | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/shaders/tesseract/90.shader_test b/shaders/tesseract/90.shader_test new file mode 100644 index 0000000..f366485 --- /dev/null +++ b/shaders/tesseract/90.shader_test @@ -0,0 +1,59 @@ +[require] +GLSL >= 1.10 + +[vertex shader] +#version 120 +#extension GL_ARB_texture_rectangle : enable +#define flat +#define texture2DRectOffset(sampler, coords, offset) texture2DRect(sampler, coords + vec2(offset)) +#define shadow2DRectOffset(sampler, coords, offset) shadow2DRect(sampler, coords + vec2(offset)) +#pragma CUBE2_fog + attribute vec4 vvertex, vcolor; + attribute vec2 vtexcoord0; + uniform mat4 camprojmatrix; + uniform float ldrscale; + varying vec4 color; + varying vec2 texcoord0; + +uniform vec2 lineardepthscale; +varying float lineardepth; + void main(void) + { + gl_Position = camprojmatrix * vvertex; + texcoord0 = vtexcoord0; + color = vec4(vcolor.rgb * ldrscale, vcolor.a); + +lineardepth = dot(lineardepthscale, gl_Position.zw); +} + +[fragment shader] +#version 120 +#extension GL_ARB_texture_rectangle : enable +#define flat +#define texture2DRectOffset(sampler, coords, offset) texture2DRect(sampler, coords + vec2(offset)) +#define shadow2DRectOffset(sampler, coords, offset) shadow2DRect(sampler, coords + vec2(offset)) +#define fragdata(loc, name, type) +#define fragcolor gl_FragData[0] +uniform vec4 textparams; + uniform sampler2D tex0; + varying vec4 color; + varying vec2 texcoord0; + fragdata(0, fragcolor, vec4) + +varying float lineardepth; + +uniform vec3 fogcolor; +uniform vec2 fogdensity; +uniform vec4 radialfogscale; +#define fogcoord lineardepth*length(vec3(gl_FragCoord.xy*radialfogscale.xy + radialfogscale.zw, 1.0)) + 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(color.rgb * outline, color.a * border); + +#define FOG_COLOR fogcolor +fragcolor.rgb = mix((FOG_COLOR).rgb, fragcolor.rgb, clamp(exp2(fogcoord*-fogdensity.x)*fogdensity.y, 0.0, 1.0)); +} + |