source: trunk/tutorial/02_cube.lolfx @ 2270

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

lolfx: use square brackets to indicate shader sections.

File size: 791 bytes
Line 
1[vert.glsl]
2
3#version 120
4
5attribute vec3 in_Vertex;
6attribute vec3 in_Color;
7uniform mat4 in_Matrix;
8varying vec3 pass_Color;
9
10void main(void)
11{
12    gl_Position = in_Matrix * vec4(in_Vertex, 1.0);
13    pass_Color = in_Color;
14}
15
16[frag.glsl]
17
18#version 120
19
20varying vec3 pass_Color;
21
22void main(void)
23{
24    gl_FragColor = vec4(pass_Color, 1.0);
25}
26
27[vert.hlsl]
28
29void main(float3 in_Vertex : POSITION,
30          float3 in_Color : COLOR,
31          uniform float4x4 in_Matrix,
32          out float4 out_Position : POSITION,
33          out float3 pass_Color : COLOR)
34{
35    pass_Color = in_Color;
36    out_Position = mul(in_Matrix, float4(in_Vertex, 1.0));
37}
38
39[frag.hlsl]
40
41void main(float3 pass_Color : COLOR,
42          out float4 out_FragColor : COLOR)
43{
44    out_FragColor = float4(pass_Color, 1.0);
45}
46
Note: See TracBrowser for help on using the repository browser.