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

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

gpu: irrelevant tweaks to a test material file.

File size: 2.1 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 = ...
36        geometryshader = ...
37        pixelshader = ...
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 = ...
64    }
65}
66
67/* Defines GLSL shader "Prout" */
68
69#section GLSL.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
88#section GLSL.Zob
89
90void main(void)
91{
92    shit fuck fuck shit;
93}
94
95/* Defines HLSL shader "Prout" */
96
97#section HLSL.Prout
98
99void main(void)
100{
101    /* Blah */
102}
103
Note: See TracBrowser for help on using the repository browser.