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

Last change on this file since 1518 was 1518, checked in by sam, 11 years ago

build: reorganise all the build stuff so that it lies in build/ and
make sure each .vcxproj file is with its corresponding source code.

File size: 807 bytes
Line 
1-- GLSL.Vert --
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-- GLSL.Frag --
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-- HLSL.Vert --
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-- HLSL.Frag --
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.