1 | /* |
---|
2 | * LolFx Test Material |
---|
3 | */ |
---|
4 | |
---|
5 | technique Foo // can have lots of different techniques in a single lolfx file |
---|
6 | { |
---|
7 | pass p0 |
---|
8 | { |
---|
9 | texture[0] = null; |
---|
10 | texture[1] = null; |
---|
11 | texture[2] = null; |
---|
12 | |
---|
13 | cullmode = none; // ccw |
---|
14 | lighting = false; |
---|
15 | zenable = true; // false |
---|
16 | alphablendenable = true; // false |
---|
17 | srcblend = src_alpha; // one |
---|
18 | destblend = inv_src_alpha; |
---|
19 | |
---|
20 | colorop[0] = select_arg1; |
---|
21 | colorarg1[0] = diffuse; |
---|
22 | |
---|
23 | alphaop[0] = select_arg1; |
---|
24 | alphaarg1[0] = diffuse; |
---|
25 | |
---|
26 | colorop[1] = disable; |
---|
27 | |
---|
28 | alphaop[1] = disable; |
---|
29 | |
---|
30 | // Ye old way |
---|
31 | vertexshader = ... |
---|
32 | geometryshader = ... |
---|
33 | pixelshader = ... |
---|
34 | |
---|
35 | // Ogre crap |
---|
36 | SetBlendState(AdditiveBlending, float4(0.0f, 0.0f, 0.0f, 0.0f), 0xFFFFFFFF); |
---|
37 | SetDepthStencilState(DisableDepth, 0); |
---|
38 | |
---|
39 | // D3D11 way |
---|
40 | SetBlendState() |
---|
41 | SetDepthStencilState() |
---|
42 | SetRasterizerState() |
---|
43 | |
---|
44 | SetVertexShader |
---|
45 | SetDomainShader |
---|
46 | SetHullShader |
---|
47 | SetGeometryShader |
---|
48 | SetPixelShader |
---|
49 | SetComputeShader /* WTF? */ |
---|
50 | |
---|
51 | SetRenderTargets(RTV0, DSV); |
---|
52 | SetRenderTargets(RTV0, RTV1, DSV); |
---|
53 | ... |
---|
54 | SetRenderTargets(RTV0, RTV1, RTV2, RTV3, RTV4, RTV5, RTV6, RTV7, DSV); |
---|
55 | } |
---|
56 | |
---|
57 | pass p1 |
---|
58 | { |
---|
59 | // Autres vertex/pixel shaders avec éventuellement des |
---|
60 | // dépendances sur le résultat des passes précédentes |
---|
61 | vertexshader = ... |
---|
62 | } |
---|
63 | } |
---|
64 | |
---|
65 | -- GLSL.Vert -- |
---|
66 | |
---|
67 | #version 120 |
---|
68 | |
---|
69 | /* Valid with my GLSL compiler */ |
---|
70 | #pragma lolfx semantic(in_Vertex, POSITION) |
---|
71 | #pragma lolfx semantic(in_Normal, NORMAL) |
---|
72 | #pragma lolfx semantic(in_Color, COLOR) |
---|
73 | attribute vec3 in_Vertex; |
---|
74 | attribute vec3 in_Normal; |
---|
75 | attribute vec4 in_Color; |
---|
76 | |
---|
77 | void main(void) |
---|
78 | { |
---|
79 | ... |
---|
80 | } |
---|
81 | |
---|