source: trunk/src/gpu/tile.lolfx @ 2614

Last change on this file since 2614 was 2614, checked in by sam, 8 years ago

gpu: remove mistakenly committed debug code.

File size: 1.4 KB
Line 
1[vert.glsl]
2
3#version 130
4
5attribute vec3 in_Position;
6attribute vec2 in_TexCoord;
7varying vec2 pass_TexCoord;
8
9uniform mat4 proj_matrix;
10uniform mat4 view_matrix;
11uniform mat4 model_matrix;
12
13void main()
14{
15    gl_Position = proj_matrix * view_matrix * model_matrix
16                * vec4(in_Position, 1.0);
17    pass_TexCoord = in_TexCoord;
18}
19
20[frag.glsl]
21
22#version 130
23
24#if defined GL_ES
25precision mediump float;
26#endif
27
28uniform sampler2D in_Texture;
29uniform vec2 in_TexSize;
30varying vec2 pass_TexCoord;
31
32void main()
33{
34    vec4 col = texture2D(in_Texture, pass_TexCoord);
35    gl_FragColor = col;
36}
37
38[vert.hlsl]
39
40void main(float4 in_Position : POSITION,
41          float2 in_TexCoord : TEXCOORD0,
42          uniform float4x4 proj_matrix,
43          uniform float4x4 view_matrix,
44          uniform float4x4 model_matrix,
45          uniform float2 in_TexSize,
46          out float2 out_TexCoord : TEXCOORD0,
47          out float4 out_Position : POSITION)
48{
49#if _XBOX
50    float2 delta = float2(-0.5, -0.5) / in_TexSize;
51#else
52    float2 delta = float2(0.0, 0.0);
53#endif
54    out_Position = mul(proj_matrix, mul(view_matrix, mul(model_matrix, in_Position)));
55    out_TexCoord = in_TexCoord + delta;
56}
57
58[frag.hlsl]
59
60void main(float2 in_TexCoord : TEXCOORD0,
61          uniform sampler2D in_Texture,
62          out float4 out_FragColor : COLOR)
63{
64    float4 col = tex2D(in_Texture, in_TexCoord);
65    out_FragColor = col;
66}
67
Note: See TracBrowser for help on using the repository browser.