|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- /*
- * LolFx Test Material
- */
-
- // Can have lots of different techniques in a single lolfx file,
- // especially if they share common shader code.
- technique Foo
- {
- // Multiple passes, with alpha on/off, with various blending methods,
- // with depth test disabled...
- pass p0
- {
- texture[0] = null;
- texture[1] = null;
- texture[2] = null;
-
- cullmode = none; // ccw
- lighting = false;
- zenable = true; // false
- alphablendenable = true; // false
- srcblend = src_alpha; // one
- destblend = inv_src_alpha;
-
- colorop[0] = select_arg1;
- colorarg1[0] = diffuse;
-
- alphaop[0] = select_arg1;
- alphaarg1[0] = diffuse;
-
- colorop[1] = disable;
-
- alphaop[1] = disable;
-
- // Ye old way
- vertexshader = blah;
- geometryshader = blah;
- pixelshader = blah;
-
- // Ogre crap
-
- // The D3D11 way, but we must make it work with GLSL too
- //SetBlendState(AdditiveBlending, float4(0.0f, 0.0f, 0.0f, 0.0f), 0xFFFFFFFF);
- //SetDepthStencilState(DisableDepth, 0);
- //SetRasterizerState()
-
- //SetVertexShader
- //SetDomainShader
- //SetHullShader
- //SetGeometryShader
- //SetPixelShader
- //SetComputeShader /* WTF? */
-
- //SetRenderTargets(RTV0, DSV);
- //SetRenderTargets(RTV0, RTV1, DSV);
- //...
- //SetRenderTargets(RTV0, RTV1, RTV2, RTV3, RTV4, RTV5, RTV6, RTV7, DSV);
- }
-
- pass p1
- {
- // Autres vertex/pixel shaders avec éventuellement des
- // dépendances sur le résultat des passes précédentes
- vertexshader = something_else;
- }
- }
-
- /* Defines GLSL shader "Prout" */
-
- #region GLSL.Prout
-
- #version 120
-
- /* Valid with my GLSL compiler */
- #pragma lolfx semantic(in_Vertex, POSITION)
- #pragma lolfx semantic(in_Normal, NORMAL)
- #pragma lolfx semantic(in_Color, COLOR)
- attribute vec3 in_Vertex;
- attribute vec3 in_Normal;
- attribute vec4 in_Color;
-
- void main(void)
- {
- /* ... */
- }
-
- /* Defines GLSL shader "Zob" */
-
- #region GLSL.Zob
-
- void main(void)
- {
- shit(); fuck(); fuck(); shit();
- }
-
- /* Defines HLSL shader "Prout" */
-
- #region HLSL.Prout
-
- void main(void)
- {
- /* Blah */
- }
-
|