source: trunk/src/gpu/testmaterial.lolfx @ 1687

Last change on this file since 1687 was 1590, checked in by sam, 9 years ago

core: start working on a higher level LolFx compiler based on the latest
GLSL grammar and some personal attempts at writing an HLSL grammar.

File size: 2.3 KB
Line 
1/*
2 * LolFx Test Material
3 */
4
5// Can have lots of different techniques in a single lolfx file,
6// especially if they share common shader code.
7technique Foo
8{
9    // Multiple passes, with alpha on/off, with various blending methods,
10    // with depth test disabled...
11    pass p0
12    {
13        texture[0] = null;
14        texture[1] = null;
15        texture[2] = null;
16
17        cullmode = none; // ccw
18        lighting = false;
19        zenable = true; // false
20        alphablendenable = true; // false
21        srcblend = src_alpha; // one
22        destblend = inv_src_alpha;
23
24        colorop[0] = select_arg1;
25        colorarg1[0] = diffuse;
26
27        alphaop[0] = select_arg1;
28        alphaarg1[0] = diffuse;
29
30        colorop[1] = disable;
31
32        alphaop[1] = disable;
33
34        // Ye old way
35        vertexshader = blah;
36        geometryshader = blah;
37        pixelshader = blah;
38
39        // Ogre crap
40
41        // The D3D11 way, but we must make it work with GLSL too
42        //SetBlendState(AdditiveBlending, float4(0.0f, 0.0f, 0.0f, 0.0f), 0xFFFFFFFF);
43        //SetDepthStencilState(DisableDepth, 0);
44        //SetRasterizerState()
45
46        //SetVertexShader
47        //SetDomainShader
48        //SetHullShader
49        //SetGeometryShader
50        //SetPixelShader
51        //SetComputeShader /* WTF? */
52
53        //SetRenderTargets(RTV0, DSV);
54        //SetRenderTargets(RTV0, RTV1, DSV);
55        //...
56        //SetRenderTargets(RTV0, RTV1, RTV2, RTV3, RTV4, RTV5, RTV6, RTV7, DSV);
57    }
58
59    pass p1
60    {
61        // Autres vertex/pixel shaders avec éventuellement des
62        // dépendances sur le résultat des passes précédentes
63        vertexshader = something_else;
64    }
65}
66
67/* Defines GLSL shader "Prout" */
68
69#pragma lolfx vertexshader(lang=GLSL 1.20, name=prout)
70
71#version 120
72
73/* Valid with my GLSL compiler */
74//#pragma lolfx semantic(in_Vertex, POSITION)
75//#pragma lolfx semantic(in_Normal, NORMAL)
76//#pragma lolfx semantic(in_Color, COLOR)
77attribute vec3 in_Vertex;
78attribute vec3 in_Normal;
79attribute vec4 in_Color;
80
81void main(void)
82{
83    /* ... */
84}
85
86/* Defines GLSL shader "Zob" */
87#pragma lolfx vertexshader(lang=GLSL 1.20, name=zob)
88
89void main(void)
90{
91    shit(); fuck(); fuck(); shit();
92}
93
94/* Defines HLSL vertex shader "Prout" */
95
96#pragma lolfx vertexshader(lang=HLSL, name=prout)
97
98void main(void)
99{
100    /* Blah */
101}
102
Note: See TracBrowser for help on using the repository browser.