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

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

lolfx: use square brackets to indicate shader sections.

File size: 2.2 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[prout.glsl]
70#version 120
71
72/* Valid with my GLSL compiler */
73//#pragma lolfx semantic(in_Vertex, POSITION)
74//#pragma lolfx semantic(in_Normal, NORMAL)
75//#pragma lolfx semantic(in_Color, COLOR)
76attribute vec3 in_Vertex;
77attribute vec3 in_Normal;
78attribute vec4 in_Color;
79
80void main(void)
81{
82    /* ... */
83}
84
85/* Defines GLSL shader "Zob" */
86[zob.glsl]
87
88void main(void)
89{
90    shit(); fuck(); fuck(); shit();
91}
92
93/* Defines HLSL vertex shader "Prout" */
94
95[prout.hlsl]
96
97void main(void)
98{
99    /* Blah */
100}
101
Note: See TracBrowser for help on using the repository browser.