source: trunk/tutorial/01_triangle.lolfx @ 2270

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

lolfx: improve the LolFx compiler, including error reporting. We can now
successfully parse a few of our full GLSL/HLSL shaders.

File size: 628 bytes
RevLine 
[1928]1/*
2 * Awesome triangle shader
3 */
[1385]4
[1930]5technique FlatColor
[1928]6{
[1930]7    pass DefaultPass
[1928]8    {
9        vertexshader = vert;
10        pixelshader = frag;
11    }
12}
13
14[vert.glsl]
[1385]15#version 120
16
17attribute vec2 in_Position;
18
19void main(void)
20{
21    gl_Position = vec4(in_Position, 0.0, 1.0);
22}
23
[1928]24[frag.glsl]
[1385]25#version 120
26
27void main(void)
28{
29    gl_FragColor = vec4(0.7, 0.2, 0.5, 1.0);
30}
31
[1928]32[vert.hlsl]
[1385]33void main(float2 in_Position : POSITION,
34          out float4 out_Position : POSITION)
35{
36    out_Position = float4(in_Position, 0.0, 1.0);
37}
38
[1928]39[frag.hlsl]
[1385]40void main(out float4 out_FragColor : COLOR)
41{
42    out_FragColor = float4(0.7, 0.2, 0.5, 1.0);
43}
44
Note: See TracBrowser for help on using the repository browser.