You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

104 line
2.2 KiB

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