diff options
Diffstat (limited to 'shaders/tesseract/121.shader_test')
-rw-r--r-- | shaders/tesseract/121.shader_test | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/shaders/tesseract/121.shader_test b/shaders/tesseract/121.shader_test new file mode 100644 index 0000000..a69ae6e --- /dev/null +++ b/shaders/tesseract/121.shader_test @@ -0,0 +1,35 @@ +[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; + attribute vec2 vtexcoord0; + varying vec2 texcoord0; + void main(void) + { + gl_Position = vvertex; + texcoord0 = vtexcoord0; + } + +[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 sampler2DRect tex0; + varying vec2 texcoord0; + fragdata(0, fragcolor, vec4) + void main(void) + { + fragcolor.rgb = 0.25*(texture2DRectOffset(tex0, texcoord0, ivec2(-1, -1)).rgb + texture2DRectOffset(tex0, texcoord0, ivec2(1, -1)).rgb + + texture2DRectOffset(tex0, texcoord0, ivec2(1, 1)).rgb + texture2DRectOffset(tex0, texcoord0, ivec2(-1, 1)).rgb); + } + |