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

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

base: break the main loop apart for the emscripten port.

File size: 677 bytes
Line 
1/*
2 * Awesome triangle shader
3 */
4
5technique FlatColor
6{
7    pass DefaultPass
8    {
9        vertexshader = vert;
10        pixelshader = frag;
11    }
12}
13
14[vert.glsl]
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
24[frag.glsl]
25#version 120
26
27#if defined GL_ES
28precision highp float;
29#endif
30
31void main(void)
32{
33    gl_FragColor = vec4(0.7, 0.2, 0.5, 1.0);
34}
35
36[vert.hlsl]
37void main(float2 in_Position : POSITION,
38          out float4 out_Position : POSITION)
39{
40    out_Position = float4(in_Position, 0.0, 1.0);
41}
42
43[frag.hlsl]
44void main(out float4 out_FragColor : COLOR)
45{
46    out_FragColor = float4(0.7, 0.2, 0.5, 1.0);
47}
48
Note: See TracBrowser for help on using the repository browser.