summaryrefslogtreecommitdiff
path: root/shaders/tesseract/467.shader_test
diff options
context:
space:
mode:
Diffstat (limited to 'shaders/tesseract/467.shader_test')
-rw-r--r--shaders/tesseract/467.shader_test151
1 files changed, 151 insertions, 0 deletions
diff --git a/shaders/tesseract/467.shader_test b/shaders/tesseract/467.shader_test
new file mode 100644
index 0000000..1fe5708
--- /dev/null
+++ b/shaders/tesseract/467.shader_test
@@ -0,0 +1,151 @@
+[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))
+attribute vec4 vvertex, vtangent;
+ attribute vec3 vnormal;
+ attribute vec2 vtexcoord0;
+ uniform mat4 camprojmatrix;
+ uniform vec2 texgenscroll;
+
+ uniform vec2 lineardepthscale;
+ uniform vec3 gdepthpackparams;
+ varying float lineardepth;
+
+
+ varying vec2 texcoord0;
+ varying mat3 world;
+
+
+
+
+
+
+uniform vec4 specscale;
+ void main(void)
+ {
+ gl_Position = camprojmatrix * vvertex;
+
+
+ lineardepth = dot(lineardepthscale, gl_Position.zw);
+
+
+
+ texcoord0 = vtexcoord0 + texgenscroll;
+
+ vec3 bitangent = cross(vnormal, vtangent.xyz) * vtangent.w;
+
+ world = mat3(vtangent.xyz, bitangent, vnormal);
+
+
+
+
+
+
+
+ }
+
+[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 gcolor gl_FragData[0]
+#define gnormal gl_FragData[1]
+#define gglow gl_FragData[2]
+uniform sampler2DRect refractlight, refractmask;
+ #define gfetch(sampler, coords) texture2DRect(sampler, coords)
+ #define gfetchoffset(sampler, coords, offset) texture2DRectOffset(sampler, coords, offset)
+ #define gfetchproj(sampler, coords) texture2DRectProj(sampler, coords)
+ #define gfetchclamp(sampler, coords) texture2DRect(sampler, coords)
+
+ uniform vec3 gdepthscale;
+ uniform vec3 gdepthunpackparams;
+
+
+ uniform vec4 refractparams;
+ uniform float refractdepth;
+
+ uniform vec4 colorparams;
+ uniform sampler2D diffusemap, normalmap;
+
+ varying mat3 world;
+
+ fragdata(0, gcolor, vec4)
+ fragdata(1, gnormal, vec4)
+ fragdata(2, gglow, vec4)
+
+
+ uniform vec2 lineardepthscale;
+ uniform vec3 gdepthpackparams;
+ varying float lineardepth;
+
+
+
+ varying vec2 texcoord0;
+
+
+
+
+
+
+
+
+uniform vec4 specscale;
+ void main(void)
+ {
+
+
+
+
+ #define dtc texcoord0
+
+
+ vec4 diffuse = texture2D(diffusemap, dtc);
+
+ vec3 bump = texture2D(normalmap, dtc).rgb*2.0 - 1.0;
+ vec3 bumpw = normalize(world * bump);
+
+
+ gcolor.rgb = diffuse.rgb*colorparams.rgb;
+
+ gcolor.a = diffuse.a*specscale.x * 0.5;
+
+
+
+
+
+ gglow.rgb = vec3(0.0);
+
+
+
+ vec2 rtc = bump.xy*refractparams.w;
+ float rmask = clamp(refractdepth*(lineardepth - dot(gfetch(refractmask, gl_FragCoord.xy + rtc).rgb, gdepthunpackparams)), 0.0, 1.0);
+ vec3 rlight = gfetch(refractlight, gl_FragCoord.xy + rtc*rmask).rgb;
+ gglow.rgb += rlight * refractparams.xyz;
+
+
+
+ gnormal.rgb = bumpw*0.5 + 0.5;
+ #ifdef packnorm
+ gnormal.a = (packnorm);
+ #else
+ gnormal.a = 1.0;
+ #endif
+
+
+
+
+
+
+
+
+ }
+