summaryrefslogtreecommitdiff
path: root/shaders/tesseract/21.shader_test
blob: d6e3d5edffe321a35a02e396ff7da0c770d8bd11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
[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, vcolor;
    attribute vec2 vtexcoord0;
    uniform mat4 camprojmatrix;
    uniform float ldrscale;
    varying vec2 texcoord0;
    varying vec4 colorscale;
    void main(void)
    {
        gl_Position = camprojmatrix * vvertex;
        texcoord0 = vtexcoord0; 
        colorscale = vec4(ldrscale * vcolor.rgb, vcolor.a);
    }

[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 sampler2D tex0;
    varying vec2 texcoord0;
    varying vec4 colorscale;
    fragdata(0, fragcolor, vec4)
    void main(void)
    {
        vec4 color = texture2D(tex0, texcoord0);
        #pragma CUBE2_swizzle color
        fragcolor = colorscale * color;
    }