2
0
Эх сурвалжийг харах

Merge branch 'shader-refactor'

Lasse Öörni 12 жил өмнө
parent
commit
381e9a04c3
100 өөрчлөгдсөн 825 нэмэгдсэн , 1469 устгасан
  1. 0 2
      Bin/CompileAllShaders.bat
  2. 20 7
      Bin/CoreData/Shaders/GLSL/AutoExposure.glsl
  3. 0 15
      Bin/CoreData/Shaders/GLSL/AutoExposure.vert
  4. 0 18
      Bin/CoreData/Shaders/GLSL/AutoExposure.xml
  5. 18 3
      Bin/CoreData/Shaders/GLSL/Basic.glsl
  6. 0 23
      Bin/CoreData/Shaders/GLSL/Basic.vert
  7. 0 16
      Bin/CoreData/Shaders/GLSL/Basic.xml
  8. 19 5
      Bin/CoreData/Shaders/GLSL/Bloom.glsl
  9. 0 15
      Bin/CoreData/Shaders/GLSL/Bloom.vert
  10. 0 9
      Bin/CoreData/Shaders/GLSL/Bloom.xml
  11. 20 7
      Bin/CoreData/Shaders/GLSL/BloomHDR.glsl
  12. 0 15
      Bin/CoreData/Shaders/GLSL/BloomHDR.vert
  13. 0 24
      Bin/CoreData/Shaders/GLSL/BloomHDR.xml
  14. 19 6
      Bin/CoreData/Shaders/GLSL/Blur.glsl
  15. 0 9
      Bin/CoreData/Shaders/GLSL/Blur.xml
  16. 0 11
      Bin/CoreData/Shaders/GLSL/ColorCorrection.frag
  17. 21 0
      Bin/CoreData/Shaders/GLSL/ColorCorrection.glsl
  18. 0 13
      Bin/CoreData/Shaders/GLSL/ColorCorrection.vert
  19. 0 3
      Bin/CoreData/Shaders/GLSL/ColorCorrection.xml
  20. 0 10
      Bin/CoreData/Shaders/GLSL/CopyFramebuffer.frag
  21. 20 15
      Bin/CoreData/Shaders/GLSL/CopyFramebuffer.glsl
  22. 0 13
      Bin/CoreData/Shaders/GLSL/CopyFramebuffer.vert
  23. 0 3
      Bin/CoreData/Shaders/GLSL/CopyFramebuffer.xml
  24. 27 4
      Bin/CoreData/Shaders/GLSL/DeferredLight.glsl
  25. 0 33
      Bin/CoreData/Shaders/GLSL/DeferredLight.vert
  26. 0 16
      Bin/CoreData/Shaders/GLSL/DeferredLight.xml
  27. 0 15
      Bin/CoreData/Shaders/GLSL/Depth.frag
  28. 24 0
      Bin/CoreData/Shaders/GLSL/Depth.glsl
  29. 0 13
      Bin/CoreData/Shaders/GLSL/Depth.vert
  30. 0 10
      Bin/CoreData/Shaders/GLSL/Depth.xml
  31. 18 4
      Bin/CoreData/Shaders/GLSL/EdgeFilter.glsl
  32. 0 13
      Bin/CoreData/Shaders/GLSL/EdgeFilter.vert
  33. 0 3
      Bin/CoreData/Shaders/GLSL/EdgeFilter.xml
  34. 3 1
      Bin/CoreData/Shaders/GLSL/Fog.glsl
  35. 0 13
      Bin/CoreData/Shaders/GLSL/GammaCorrection.frag
  36. 21 0
      Bin/CoreData/Shaders/GLSL/GammaCorrection.glsl
  37. 0 13
      Bin/CoreData/Shaders/GLSL/GammaCorrection.vert
  38. 0 3
      Bin/CoreData/Shaders/GLSL/GammaCorrection.xml
  39. 0 12
      Bin/CoreData/Shaders/GLSL/GreyScale.frag
  40. 22 0
      Bin/CoreData/Shaders/GLSL/GreyScale.glsl
  41. 0 13
      Bin/CoreData/Shaders/GLSL/GreyScale.vert
  42. 0 3
      Bin/CoreData/Shaders/GLSL/GreyScale.xml
  43. 89 1
      Bin/CoreData/Shaders/GLSL/Lighting.glsl
  44. 0 83
      Bin/CoreData/Shaders/GLSL/Lighting.vert
  45. 50 5
      Bin/CoreData/Shaders/GLSL/LitParticle.glsl
  46. 0 66
      Bin/CoreData/Shaders/GLSL/LitParticle.vert
  47. 0 48
      Bin/CoreData/Shaders/GLSL/LitParticle.xml
  48. 93 7
      Bin/CoreData/Shaders/GLSL/LitSolid.glsl
  49. 0 127
      Bin/CoreData/Shaders/GLSL/LitSolid.vert
  50. 0 83
      Bin/CoreData/Shaders/GLSL/LitSolid.xml
  51. 3 2
      Bin/CoreData/Shaders/GLSL/PostProcess.glsl
  52. 26 4
      Bin/CoreData/Shaders/GLSL/PrepassLight.glsl
  53. 0 33
      Bin/CoreData/Shaders/GLSL/PrepassLight.vert
  54. 0 16
      Bin/CoreData/Shaders/GLSL/PrepassLight.xml
  55. 11 9
      Bin/CoreData/Shaders/GLSL/Samplers.glsl
  56. 2 1
      Bin/CoreData/Shaders/GLSL/ScreenPos.glsl
  57. 0 15
      Bin/CoreData/Shaders/GLSL/Shadow.frag
  58. 24 0
      Bin/CoreData/Shaders/GLSL/Shadow.glsl
  59. 0 13
      Bin/CoreData/Shaders/GLSL/Shadow.vert
  60. 0 10
      Bin/CoreData/Shaders/GLSL/Shadow.xml
  61. 0 9
      Bin/CoreData/Shaders/GLSL/Skybox.frag
  62. 9 3
      Bin/CoreData/Shaders/GLSL/Skybox.glsl
  63. 0 3
      Bin/CoreData/Shaders/GLSL/Skybox.xml
  64. 0 6
      Bin/CoreData/Shaders/GLSL/Stencil.frag
  65. 9 3
      Bin/CoreData/Shaders/GLSL/Stencil.glsl
  66. 0 3
      Bin/CoreData/Shaders/GLSL/Stencil.xml
  67. 61 6
      Bin/CoreData/Shaders/GLSL/TerrainBlend.glsl
  68. 0 81
      Bin/CoreData/Shaders/GLSL/TerrainBlend.vert
  69. 0 50
      Bin/CoreData/Shaders/GLSL/TerrainBlend.xml
  70. 18 5
      Bin/CoreData/Shaders/GLSL/Tonemap.glsl
  71. 0 13
      Bin/CoreData/Shaders/GLSL/Tonemap.vert
  72. 0 8
      Bin/CoreData/Shaders/GLSL/Tonemap.xml
  73. 2 1
      Bin/CoreData/Shaders/GLSL/Transform.glsl
  74. 0 25
      Bin/CoreData/Shaders/GLSL/Uniforms.frag
  75. 30 0
      Bin/CoreData/Shaders/GLSL/Uniforms.glsl
  76. 0 38
      Bin/CoreData/Shaders/GLSL/Unlit.frag
  77. 67 0
      Bin/CoreData/Shaders/GLSL/Unlit.glsl
  78. 0 28
      Bin/CoreData/Shaders/GLSL/Unlit.vert
  79. 0 16
      Bin/CoreData/Shaders/GLSL/Unlit.xml
  80. 11 11
      Bin/CoreData/Shaders/GLSL/Vegetation.glsl
  81. 0 28
      Bin/CoreData/Shaders/GLSL/Vegetation.xml
  82. 3 3
      Bin/CoreData/Shaders/GLSL/VegetationDepth.glsl
  83. 0 6
      Bin/CoreData/Shaders/GLSL/VegetationDepth.xml
  84. 3 3
      Bin/CoreData/Shaders/GLSL/VegetationShadow.glsl
  85. 0 6
      Bin/CoreData/Shaders/GLSL/VegetationShadow.xml
  86. 0 33
      Bin/CoreData/Shaders/GLSL/Water.frag
  87. 59 0
      Bin/CoreData/Shaders/GLSL/Water.glsl
  88. 0 30
      Bin/CoreData/Shaders/GLSL/Water.vert
  89. 0 4
      Bin/CoreData/Shaders/GLSL/Water.xml
  90. 0 18
      Bin/CoreData/Shaders/HLSL/AutoExposure.xml
  91. 0 16
      Bin/CoreData/Shaders/HLSL/Basic.xml
  92. 0 9
      Bin/CoreData/Shaders/HLSL/Bloom.xml
  93. 0 24
      Bin/CoreData/Shaders/HLSL/BloomHDR.xml
  94. 0 9
      Bin/CoreData/Shaders/HLSL/Blur.xml
  95. 0 3
      Bin/CoreData/Shaders/HLSL/ColorCorrection.xml
  96. 0 3
      Bin/CoreData/Shaders/HLSL/CopyFrameBuffer.xml
  97. 0 17
      Bin/CoreData/Shaders/HLSL/DeferredLight.xml
  98. 0 10
      Bin/CoreData/Shaders/HLSL/Depth.xml
  99. 0 3
      Bin/CoreData/Shaders/HLSL/EdgeFilter.xml
  100. 3 1
      Bin/CoreData/Shaders/HLSL/Fog.hlsl

+ 0 - 2
Bin/CompileAllShaders.bat

@@ -1,2 +0,0 @@
-shadercompiler CoreData/Shaders/HLSL/*.xml CoreData/Shaders/HLSL/SM3 -d SM3
-shadercompiler CoreData/Shaders/HLSL/*.xml CoreData/Shaders/HLSL/SM2

+ 20 - 7
Bin/CoreData/Shaders/GLSL/AutoExposure.frag → Bin/CoreData/Shaders/GLSL/AutoExposure.glsl

@@ -1,7 +1,13 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-#include "PostProcess.frag"
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+#include "ScreenPos.glsl"
+#include "PostProcess.glsl"
 
 
+varying vec2 vTexCoord;
+varying vec2 vScreenPos;
+
+#ifdef COMPILEPS
 uniform float cAutoExposureAdaptRate;
 uniform float cAutoExposureAdaptRate;
 uniform float cAutoExposureMiddleGrey;
 uniform float cAutoExposureMiddleGrey;
 uniform float cAutoExposureSensitivity;
 uniform float cAutoExposureSensitivity;
@@ -10,9 +16,6 @@ uniform vec2 cLum64InvSize;
 uniform vec2 cLum16InvSize;
 uniform vec2 cLum16InvSize;
 uniform vec2 cLum4InvSize;
 uniform vec2 cLum4InvSize;
 
 
-varying vec2 vTexCoord;
-varying vec2 vScreenPos;
-
 float GatherAvgLum(sampler2D texSampler, vec2 texCoord, vec2 texelSize)
 float GatherAvgLum(sampler2D texSampler, vec2 texCoord, vec2 texelSize)
 {
 {
     float lumAvg = 0.0;
     float lumAvg = 0.0;
@@ -22,8 +25,18 @@ float GatherAvgLum(sampler2D texSampler, vec2 texCoord, vec2 texelSize)
     lumAvg += texture2D(texSampler, texCoord + vec2(1.0, -1.0) * texelSize).r;
     lumAvg += texture2D(texSampler, texCoord + vec2(1.0, -1.0) * texelSize).r;
     return lumAvg / 4.0;
     return lumAvg / 4.0;
 }
 }
+#endif
+
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    vTexCoord = GetQuadTexCoord(gl_Position);
+    vScreenPos = GetScreenPosPreDiv(gl_Position);
+}
 
 
-void main()
+void PS()
 {
 {
     #ifdef LUMINANCE64
     #ifdef LUMINANCE64
     float logLumSum = 1e-5;
     float logLumSum = 1e-5;

+ 0 - 15
Bin/CoreData/Shaders/GLSL/AutoExposure.vert

@@ -1,15 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-#include "ScreenPos.vert"
-
-varying vec2 vTexCoord;
-varying vec2 vScreenPos;
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    vTexCoord = GetQuadTexCoord(gl_Position);
-    vScreenPos = GetScreenPosPreDiv(gl_Position);
-}

+ 0 - 18
Bin/CoreData/Shaders/GLSL/AutoExposure.xml

@@ -1,18 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <variation name="Luminance64" define="LUMINANCE64" />
-        <variation name="Luminance16" define="LUMINANCE16" />
-        <variation name="Luminance4" define="LUMINANCE4" />
-        <variation name="Luminance1" define="LUMINANCE1" />
-        <variation name="AdaptLuminance" define="ADAPTLUMINANCE" />
-        <variation name="Expose" define="EXPOSE" />
-    </shader>
-    <shader type="ps">
-        <variation name="Luminance64" define="LUMINANCE64" />
-        <variation name="Luminance16" define="LUMINANCE16" />
-        <variation name="Luminance4" define="LUMINANCE4" />
-        <variation name="Luminance1" define="LUMINANCE1" />
-        <variation name="AdaptLuminance" define="ADAPTLUMINANCE" />
-        <variation name="Expose" define="EXPOSE" />
-    </shader>
-</shaders>

+ 18 - 3
Bin/CoreData/Shaders/GLSL/Basic.frag → Bin/CoreData/Shaders/GLSL/Basic.glsl

@@ -1,5 +1,6 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
 
 
 #if defined(DIFFMAP) || defined(ALPHAMAP)
 #if defined(DIFFMAP) || defined(ALPHAMAP)
     varying vec2 vTexCoord;
     varying vec2 vTexCoord;
@@ -8,7 +9,21 @@
     varying vec4 vColor;
     varying vec4 vColor;
 #endif
 #endif
 
 
-void main()
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    
+    #ifdef DIFFMAP
+        vTexCoord = iTexCoord;
+    #endif
+    #ifdef VERTEXCOLOR
+        vColor = iColor;
+    #endif
+}
+
+void PS()
 {
 {
     vec4 diffColor = cMatDiffColor;
     vec4 diffColor = cMatDiffColor;
 
 

+ 0 - 23
Bin/CoreData/Shaders/GLSL/Basic.vert

@@ -1,23 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-
-#ifdef DIFFMAP
-    varying vec2 vTexCoord;
-#endif
-#ifdef VERTEXCOLOR
-    varying vec4 vColor;
-#endif
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    
-    #ifdef DIFFMAP
-        vTexCoord = iTexCoord;
-    #endif
-    #ifdef VERTEXCOLOR
-        vColor = iColor;
-    #endif
-}

+ 0 - 16
Bin/CoreData/Shaders/GLSL/Basic.xml

@@ -1,16 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <option name="Diff" define="DIFFMAP" />
-        <option name="VCol" define="VERTEXCOLOR" />
-        <variation name="" />
-        <variation name="Skinned" define="SKINNED" />
-        <variation name="Instanced" define="INSTANCED" />
-        <variation name="Billboard" define="BILLBOARD" />
-    </shader>
-    <shader type="ps">
-        <option name="Diff" define="DIFFMAP" exclude="Alpha" />
-        <option name="Alpha" define="ALPHAMAP" exclude="Diff" />
-        <option name="AlphaMask" define="ALPHAMASK" require="DIFFMAP" />
-        <option name="VCol" define="VERTEXCOLOR" />
-    </shader>
-</shaders>

+ 19 - 5
Bin/CoreData/Shaders/GLSL/Bloom.frag → Bin/CoreData/Shaders/GLSL/Bloom.glsl

@@ -1,14 +1,27 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+#include "ScreenPos.glsl"
 
 
+varying vec2 vTexCoord;
+varying vec2 vScreenPos;
+
+#ifdef COMPILEPS
 uniform float cBloomThreshold;
 uniform float cBloomThreshold;
 uniform vec2 cBloomMix;
 uniform vec2 cBloomMix;
 uniform vec2 cHBlurInvSize;
 uniform vec2 cHBlurInvSize;
+#endif
 
 
-varying vec2 vTexCoord;
-varying vec2 vScreenPos;
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    vTexCoord = GetQuadTexCoord(gl_Position);
+    vScreenPos = GetScreenPosPreDiv(gl_Position);
+}
 
 
-void main()
+void PS()
 {
 {
     #ifdef BRIGHT
     #ifdef BRIGHT
     vec3 rgb = texture2D(sDiffMap, vScreenPos).rgb;
     vec3 rgb = texture2D(sDiffMap, vScreenPos).rgb;
@@ -41,3 +54,4 @@ void main()
     gl_FragColor = vec4(original + bloom, 1.0);
     gl_FragColor = vec4(original + bloom, 1.0);
     #endif
     #endif
 }
 }
+

+ 0 - 15
Bin/CoreData/Shaders/GLSL/Bloom.vert

@@ -1,15 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-#include "ScreenPos.vert"
-
-varying vec2 vTexCoord;
-varying vec2 vScreenPos;
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    vTexCoord = GetQuadTexCoord(gl_Position);
-    vScreenPos = GetScreenPosPreDiv(gl_Position);
-}

+ 0 - 9
Bin/CoreData/Shaders/GLSL/Bloom.xml

@@ -1,9 +0,0 @@
-<shaders>
-    <shader type="vs" />
-    <shader type="ps">
-        <variation name="Bright" define="BRIGHT" />
-        <variation name="HBlur" define="HBLUR" />
-        <variation name="VBlur" define="VBLUR" />
-        <variation name="Combine" define="COMBINE" />
-    </shader>
-</shaders>

+ 20 - 7
Bin/CoreData/Shaders/GLSL/BloomHDR.frag → Bin/CoreData/Shaders/GLSL/BloomHDR.glsl

@@ -1,7 +1,13 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-#include "PostProcess.frag"
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+#include "ScreenPos.glsl"
+#include "PostProcess.glsl"
 
 
+varying vec2 vTexCoord;
+varying vec2 vScreenPos;
+
+#ifdef COMPILEPS
 uniform float cBloomHDRThreshold;
 uniform float cBloomHDRThreshold;
 uniform float cBloomHDRBlurSigma;
 uniform float cBloomHDRBlurSigma;
 uniform float cBloomHDRBlurRadius;
 uniform float cBloomHDRBlurRadius;
@@ -12,12 +18,19 @@ uniform vec2 cBright4InvSize;
 uniform vec2 cBright8InvSize;
 uniform vec2 cBright8InvSize;
 uniform vec2 cBright16InvSize;
 uniform vec2 cBright16InvSize;
 
 
-varying vec2 vTexCoord;
-varying vec2 vScreenPos;
-
 const int BlurKernelSize = 5;
 const int BlurKernelSize = 5;
+#endif
+
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    vTexCoord = GetQuadTexCoord(gl_Position);
+    vScreenPos = GetScreenPosPreDiv(gl_Position);
+}
 
 
-void main()
+void PS()
 {
 {
     #ifdef BRIGHT
     #ifdef BRIGHT
     vec3 color = texture2D(sDiffMap, vScreenPos).rgb;
     vec3 color = texture2D(sDiffMap, vScreenPos).rgb;

+ 0 - 15
Bin/CoreData/Shaders/GLSL/BloomHDR.vert

@@ -1,15 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-#include "ScreenPos.vert"
-
-varying vec2 vTexCoord;
-varying vec2 vScreenPos;
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    vTexCoord = GetQuadTexCoord(gl_Position);
-    vScreenPos = GetScreenPosPreDiv(gl_Position);
-}

+ 0 - 24
Bin/CoreData/Shaders/GLSL/BloomHDR.xml

@@ -1,24 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <variation name="Bright" define="BRIGHT" />
-        <variation name="Blur2" define="BLUR2" />
-        <variation name="Blur4" define="BLUR4" />
-        <variation name="Blur8" define="BLUR8" />
-        <variation name="Blur16" define="BLUR16" />
-        <variation name="Combine2" define="COMBINE2" />
-        <variation name="Combine4" define="COMBINE4" />
-        <variation name="Combine8" define="COMBINE8" />
-        <variation name="Combine16" define="COMBINE16" />
-    </shader>
-    <shader type="ps">
-        <variation name="Bright" define="BRIGHT" />
-        <variation name="Blur2" define="BLUR2" />
-        <variation name="Blur4" define="BLUR4" />
-        <variation name="Blur8" define="BLUR8" />
-        <variation name="Blur16" define="BLUR16" />
-        <variation name="Combine2" define="COMBINE2" />
-        <variation name="Combine4" define="COMBINE4" />
-        <variation name="Combine8" define="COMBINE8" />
-        <variation name="Combine16" define="COMBINE16" />
-    </shader>
-</shaders>

+ 19 - 6
Bin/CoreData/Shaders/GLSL/Blur.frag → Bin/CoreData/Shaders/GLSL/Blur.glsl

@@ -1,16 +1,29 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-#include "PostProcess.frag"
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+#include "ScreenPos.glsl"
+#include "PostProcess.glsl"
 
 
+varying vec2 vTexCoord;
+varying vec2 vScreenPos;
+
+#ifdef COMPILEPS
 uniform vec2 cBlurDir;
 uniform vec2 cBlurDir;
 uniform float cBlurRadius;
 uniform float cBlurRadius;
 uniform float cBlurSigma;
 uniform float cBlurSigma;
 uniform vec2 cBlurHInvSize;
 uniform vec2 cBlurHInvSize;
+#endif
 
 
-varying vec2 vTexCoord;
-varying vec2 vScreenPos;
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    vTexCoord = GetQuadTexCoord(gl_Position);
+    vScreenPos = GetScreenPosPreDiv(gl_Position);
+}
 
 
-void main()
+void PS()
 {
 {
     #ifdef BLUR3
     #ifdef BLUR3
         gl_FragColor = GaussianBlur(3, cBlurDir, cBlurHInvSize * cBlurRadius, cBlurSigma, sDiffMap, vTexCoord);
         gl_FragColor = GaussianBlur(3, cBlurDir, cBlurHInvSize * cBlurRadius, cBlurSigma, sDiffMap, vTexCoord);

+ 0 - 9
Bin/CoreData/Shaders/GLSL/Blur.xml

@@ -1,9 +0,0 @@
-<shaders>
-    <shader type="vs" />
-    <shader type="ps">
-    	<variation name="Blur3" define="BLUR3" />
-        <variation name="Blur5" define="BLUR5" />
-        <variation name="Blur7" define="BLUR7" />
-        <variation name="Blur9" define="BLUR9" />
-    </shader>
-</shaders>

+ 0 - 11
Bin/CoreData/Shaders/GLSL/ColorCorrection.frag

@@ -1,11 +0,0 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-#include "PostProcess.frag"
-
-varying vec2 vScreenPos;
-
-void main()
-{
-    vec3 color = texture2D(sDiffMap, vScreenPos).rgb;
-    gl_FragColor = vec4(ColorCorrection(color, sVolumeMap), 1.0);
-}

+ 21 - 0
Bin/CoreData/Shaders/GLSL/ColorCorrection.glsl

@@ -0,0 +1,21 @@
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+#include "ScreenPos.glsl"
+#include "PostProcess.glsl"
+
+varying vec2 vScreenPos;
+
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    vScreenPos = GetScreenPosPreDiv(gl_Position);
+}
+
+void PS()
+{
+    vec3 color = texture2D(sDiffMap, vScreenPos).rgb;
+    gl_FragColor = vec4(ColorCorrection(color, sVolumeMap), 1.0);
+}

+ 0 - 13
Bin/CoreData/Shaders/GLSL/ColorCorrection.vert

@@ -1,13 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-#include "ScreenPos.vert"
-
-varying vec2 vScreenPos;
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    vScreenPos = GetScreenPosPreDiv(gl_Position);
-}

+ 0 - 3
Bin/CoreData/Shaders/GLSL/ColorCorrection.xml

@@ -1,3 +0,0 @@
-<shaders>
-    <shader />
-</shaders>

+ 0 - 10
Bin/CoreData/Shaders/GLSL/CopyFramebuffer.frag

@@ -1,10 +0,0 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-
-varying vec2 vScreenPos;
-
-void main()
-{
-    gl_FragColor = texture2D(sDiffMap, vScreenPos);
-}
-

+ 20 - 15
Bin/CoreData/Shaders/GLSL/Blur.vert → Bin/CoreData/Shaders/GLSL/CopyFramebuffer.glsl

@@ -1,15 +1,20 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-#include "ScreenPos.vert"
-
-varying vec2 vTexCoord;
-varying vec2 vScreenPos;
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    vTexCoord = GetQuadTexCoord(gl_Position);
-    vScreenPos = GetScreenPosPreDiv(gl_Position);
-}
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+#include "ScreenPos.glsl"
+
+varying vec2 vScreenPos;
+
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    vScreenPos = GetScreenPosPreDiv(gl_Position);
+}
+
+void PS()
+{
+    gl_FragColor = texture2D(sDiffMap, vScreenPos);
+}
+

+ 0 - 13
Bin/CoreData/Shaders/GLSL/CopyFramebuffer.vert

@@ -1,13 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-#include "ScreenPos.vert"
-
-varying vec2 vScreenPos;
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    vScreenPos = GetScreenPosPreDiv(gl_Position);
-}

+ 0 - 3
Bin/CoreData/Shaders/GLSL/CopyFramebuffer.xml

@@ -1,3 +0,0 @@
-<shaders>
-    <shader />
-</shaders>

+ 27 - 4
Bin/CoreData/Shaders/GLSL/DeferredLight.frag → Bin/CoreData/Shaders/GLSL/DeferredLight.glsl

@@ -1,6 +1,8 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-#include "Lighting.frag"
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+#include "ScreenPos.glsl"
+#include "Lighting.glsl"
 
 
 #ifdef DIRLIGHT
 #ifdef DIRLIGHT
     varying vec2 vScreenPos;
     varying vec2 vScreenPos;
@@ -12,7 +14,28 @@ varying vec3 vFarRay;
     varying vec3 vNearRay;
     varying vec3 vNearRay;
 #endif
 #endif
 
 
-void main()
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    #ifdef DIRLIGHT
+        vScreenPos = GetScreenPosPreDiv(gl_Position);
+        vFarRay = GetFarRay(gl_Position);
+        #ifdef ORTHO
+            vNearRay = GetNearRay(gl_Position);
+        #endif
+    #else
+        vScreenPos = GetScreenPos(gl_Position);
+        vFarRay = GetFarRay(gl_Position) * gl_Position.w;
+        #ifdef ORTHO
+            vNearRay = GetNearRay(gl_Position) * gl_Position.w;
+        #endif
+    #endif
+}
+
+
+void PS()
 {
 {
     // If rendering a directional light quad, optimize out the w divide
     // If rendering a directional light quad, optimize out the w divide
     #ifdef DIRLIGHT
     #ifdef DIRLIGHT

+ 0 - 33
Bin/CoreData/Shaders/GLSL/DeferredLight.vert

@@ -1,33 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-#include "ScreenPos.vert"
-
-#ifdef DIRLIGHT
-    varying vec2 vScreenPos;
-#else
-    varying vec4 vScreenPos;
-#endif
-varying vec3 vFarRay;
-#ifdef ORTHO
-    varying vec3 vNearRay;
-#endif
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    #ifdef DIRLIGHT
-        vScreenPos = GetScreenPosPreDiv(gl_Position);
-        vFarRay = GetFarRay(gl_Position);
-        #ifdef ORTHO
-            vNearRay = GetNearRay(gl_Position);
-        #endif
-    #else
-        vScreenPos = GetScreenPos(gl_Position);
-        vFarRay = GetFarRay(gl_Position) * gl_Position.w;
-        #ifdef ORTHO
-            vNearRay = GetNearRay(gl_Position) * gl_Position.w;
-        #endif
-    #endif
-}

+ 0 - 16
Bin/CoreData/Shaders/GLSL/DeferredLight.xml

@@ -1,16 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <option name="Ortho" define="ORTHO" />
-        <option name="Dir" define="DIRLIGHT" />
-    </shader>
-    <shader type="ps">
-        <option name="Ortho" define="ORTHO" />
-        <variation name="Dir" define="DIRLIGHT" />
-        <variation name="Spot" define="SPOTLIGHT" />
-        <variation name="Point" define="POINTLIGHT" />
-        <option name="Mask" define="CUBEMASK" require="POINTLIGHT" />
-        <option name="Spec" define="SPECULAR" />
-        <option name="Shadow" define="SHADOW" />
-        <option name="LQ" define="LQSHADOW" />
-    </shader>
-</shaders>

+ 0 - 15
Bin/CoreData/Shaders/GLSL/Depth.frag

@@ -1,15 +0,0 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-
-varying vec3 vTexCoord;
-
-void main()
-{
-    #ifdef ALPHAMASK
-        float alpha = texture2D(sDiffMap, vTexCoord.xy).a;
-        if (alpha < 0.5)
-            discard;
-    #endif
-
-    gl_FragColor = vec4(EncodeDepth(vTexCoord.z), 1.0);
-}

+ 24 - 0
Bin/CoreData/Shaders/GLSL/Depth.glsl

@@ -0,0 +1,24 @@
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+
+varying vec3 vTexCoord;
+
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    vTexCoord = vec3(GetTexCoord(iTexCoord), GetDepth(gl_Position));
+}
+
+void PS()
+{
+    #ifdef ALPHAMASK
+        float alpha = texture2D(sDiffMap, vTexCoord.xy).a;
+        if (alpha < 0.5)
+            discard;
+    #endif
+
+    gl_FragColor = vec4(EncodeDepth(vTexCoord.z), 1.0);
+}

+ 0 - 13
Bin/CoreData/Shaders/GLSL/Depth.vert

@@ -1,13 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-
-varying vec3 vTexCoord;
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    vTexCoord = vec3(GetTexCoord(iTexCoord), GetDepth(gl_Position));
-}
-

+ 0 - 10
Bin/CoreData/Shaders/GLSL/Depth.xml

@@ -1,10 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <variation name="" />
-        <variation name="Skinned" define="SKINNED" />
-        <variation name="Instanced" define="INSTANCED" />
-    </shader>
-    <shader type="ps">
-        <option name="AlphaMask" define="ALPHAMASK" />
-    </shader>
-</shaders>

+ 18 - 4
Bin/CoreData/Shaders/GLSL/EdgeFilter.frag → Bin/CoreData/Shaders/GLSL/EdgeFilter.glsl

@@ -6,13 +6,26 @@
 
 
 // Adapted for Urho3D from http://timothylottes.blogspot.com/2011/04/nvidia-fxaa-ii-for-console.html
 // Adapted for Urho3D from http://timothylottes.blogspot.com/2011/04/nvidia-fxaa-ii-for-console.html
 
 
-#include "Uniforms.frag"
-#include "Samplers.frag"
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+#include "ScreenPos.glsl"
 
 
-uniform vec3 cEdgeFilterParams;
 varying vec2 vScreenPos;
 varying vec2 vScreenPos;
 
 
-void main()
+#ifdef COMPILEPS
+uniform vec3 cEdgeFilterParams;
+#endif
+
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    vScreenPos = GetScreenPosPreDiv(gl_Position);
+}
+
+void PS()
 {
 {
     float FXAA_SUBPIX_SHIFT = 1.0/4.0; // Not used
     float FXAA_SUBPIX_SHIFT = 1.0/4.0; // Not used
     float FXAA_SPAN_MAX = 8.0;
     float FXAA_SPAN_MAX = 8.0;
@@ -72,3 +85,4 @@ void main()
     else
     else
         gl_FragColor = vec4(rgbM, 1.0);
         gl_FragColor = vec4(rgbM, 1.0);
 }
 }
+

+ 0 - 13
Bin/CoreData/Shaders/GLSL/EdgeFilter.vert

@@ -1,13 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-#include "ScreenPos.vert"
-
-varying vec2 vScreenPos;
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    vScreenPos = GetScreenPosPreDiv(gl_Position);
-}

+ 0 - 3
Bin/CoreData/Shaders/GLSL/EdgeFilter.xml

@@ -1,3 +0,0 @@
-<shaders>
-    <shader />
-</shaders>

+ 3 - 1
Bin/CoreData/Shaders/GLSL/Fog.frag → Bin/CoreData/Shaders/GLSL/Fog.glsl

@@ -1,3 +1,4 @@
+#ifdef COMPILEPS
 vec3 GetFog(vec3 color, float fogFactor)
 vec3 GetFog(vec3 color, float fogFactor)
 {
 {
     return mix(cFogColor, color, fogFactor);
     return mix(cFogColor, color, fogFactor);
@@ -18,5 +19,6 @@ float GetHeightFogFactor(float depth, float height)
     float fogFactor = GetFogFactor(depth);
     float fogFactor = GetFogFactor(depth);
     float heightFogFactor = (height - cFogParams.z) * cFogParams.w;
     float heightFogFactor = (height - cFogParams.z) * cFogParams.w;
     heightFogFactor = 1.0 - clamp(exp(-(heightFogFactor * heightFogFactor)), 0.0, 1.0);
     heightFogFactor = 1.0 - clamp(exp(-(heightFogFactor * heightFogFactor)), 0.0, 1.0);
-	return min(heightFogFactor, fogFactor);
+    return min(heightFogFactor, fogFactor);
 }
 }
+#endif

+ 0 - 13
Bin/CoreData/Shaders/GLSL/GammaCorrection.frag

@@ -1,13 +0,0 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-#include "PostProcess.frag"
-
-uniform float cGamma;
-
-varying vec2 vScreenPos;
-
-void main()
-{
-    vec3 color = texture2D(sDiffMap, vScreenPos).rgb;
-    gl_FragColor = vec4(ToInverseGamma(color), 1.0);
-}

+ 21 - 0
Bin/CoreData/Shaders/GLSL/GammaCorrection.glsl

@@ -0,0 +1,21 @@
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+#include "ScreenPos.glsl"
+#include "PostProcess.glsl"
+
+varying vec2 vScreenPos;
+
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    vScreenPos = GetScreenPosPreDiv(gl_Position);
+}
+
+void PS()
+{
+    vec3 color = texture2D(sDiffMap, vScreenPos).rgb;
+    gl_FragColor = vec4(ToInverseGamma(color), 1.0);
+}

+ 0 - 13
Bin/CoreData/Shaders/GLSL/GammaCorrection.vert

@@ -1,13 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-#include "ScreenPos.vert"
-
-varying vec2 vScreenPos;
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    vScreenPos = GetScreenPosPreDiv(gl_Position);
-}

+ 0 - 3
Bin/CoreData/Shaders/GLSL/GammaCorrection.xml

@@ -1,3 +0,0 @@
-<shaders>
-    <shader />
-</shaders>

+ 0 - 12
Bin/CoreData/Shaders/GLSL/GreyScale.frag

@@ -1,12 +0,0 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-#include "Lighting.frag"
-
-varying vec2 vScreenPos;
-
-void main()
-{
-    vec3 rgb = texture2D(sDiffMap, vScreenPos).rgb;
-    float intensity = GetIntensity(rgb);
-    gl_FragColor = vec4(intensity, intensity, intensity, 1.0);
-}

+ 22 - 0
Bin/CoreData/Shaders/GLSL/GreyScale.glsl

@@ -0,0 +1,22 @@
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+#include "ScreenPos.glsl"
+#include "Lighting.glsl"
+
+varying vec2 vScreenPos;
+
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    vScreenPos = GetScreenPosPreDiv(gl_Position);
+}
+
+void PS()
+{
+    vec3 rgb = texture2D(sDiffMap, vScreenPos).rgb;
+    float intensity = GetIntensity(rgb);
+    gl_FragColor = vec4(intensity, intensity, intensity, 1.0);
+}

+ 0 - 13
Bin/CoreData/Shaders/GLSL/GreyScale.vert

@@ -1,13 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-#include "ScreenPos.vert"
-
-varying vec2 vScreenPos;
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    vScreenPos = GetScreenPosPreDiv(gl_Position);
-}

+ 0 - 3
Bin/CoreData/Shaders/GLSL/GreyScale.xml

@@ -1,3 +0,0 @@
-<shaders>
-    <shader />
-</shaders>

+ 89 - 1
Bin/CoreData/Shaders/GLSL/Lighting.frag → Bin/CoreData/Shaders/GLSL/Lighting.glsl

@@ -1,3 +1,90 @@
+#ifdef COMPILEVS
+vec3 GetAmbient(float zonePos)
+{
+    return cAmbientStartColor + zonePos * cAmbientEndColor;
+}
+
+#ifdef NUMVERTEXLIGHTS
+float GetVertexLight(int index, vec3 worldPos, vec3 normal)
+{
+    vec3 lightDir = cVertexLights[index * 3 + 1].xyz;
+    vec3 lightPos = cVertexLights[index * 3 + 2].xyz;
+    float invRange = cVertexLights[index * 3].w;
+    float cutoff = cVertexLights[index * 3 + 1].w;
+    float invCutoff = cVertexLights[index * 3 + 2].w;
+
+    // Directional light
+    if (invRange == 0.0)
+    {
+        float NdotL = max(dot(normal, lightDir), 0.0);
+        return NdotL;
+    }
+    // Point/spot light
+    else
+    {
+        vec3 lightVec = (lightPos - worldPos) * invRange;
+        float lightDist = length(lightVec);
+        vec3 localDir = lightVec / lightDist;
+        float NdotL = max(dot(normal, localDir), 0.0);
+        float atten = clamp(1.0 - lightDist * lightDist, 0.0, 1.0);
+        float spotEffect = dot(localDir, lightDir);
+        float spotAtten = clamp((spotEffect - cutoff) * invCutoff, 0.0, 1.0);
+        return NdotL * atten * spotAtten;
+    }
+}
+
+float GetVertexLightVolumetric(int index, vec3 worldPos)
+{
+    vec3 lightDir = cVertexLights[index * 3 + 1].xyz;
+    vec3 lightPos = cVertexLights[index * 3 + 2].xyz;
+    float invRange = cVertexLights[index * 3].w;
+    float cutoff = cVertexLights[index * 3 + 1].w;
+    float invCutoff = cVertexLights[index * 3 + 2].w;
+
+    // Directional light
+    if (invRange == 0.0)
+        return 1.0;
+    // Point/spot light
+    else
+    {
+        vec3 lightVec = (lightPos - worldPos) * invRange;
+        float lightDist = length(lightVec);
+        vec3 localDir = lightVec / lightDist;
+        float atten = clamp(1.0 - lightDist * lightDist, 0.0, 1.0);
+        float spotEffect = dot(localDir, lightDir);
+        float spotAtten = clamp((spotEffect - cutoff) * invCutoff, 0.0, 1.0);
+        return atten * spotAtten;
+    }
+}
+#endif
+
+#ifdef SHADOW
+
+#ifdef DIRLIGHT
+    #ifndef GL_ES
+        #define NUMCASCADES 4
+    #else
+        #define NUMCASCADES 2
+    #endif
+#else
+    #define NUMCASCADES 1
+#endif
+
+vec4 GetShadowPos(int index, vec4 projWorldPos)
+{
+    #if defined(DIRLIGHT)
+        return cLightMatrices[index] * projWorldPos;
+    #elif defined(SPOTLIGHT)
+        return cLightMatrices[1] * projWorldPos;
+    #else
+        return vec4(projWorldPos.xyz - cLightPos.xyz, 1.0);
+    #endif
+}
+
+#endif
+#endif
+
+#ifdef COMPILEPS
 float GetDiffuse(vec3 normal, vec3 lightVec, out vec3 lightDir)
 float GetDiffuse(vec3 normal, vec3 lightVec, out vec3 lightDir)
 {
 {
     #ifdef DIRLIGHT
     #ifdef DIRLIGHT
@@ -190,4 +277,5 @@ float GetShadowDeferred(vec4 projWorldPos, float depth)
     #endif
     #endif
 }
 }
 #endif
 #endif
-#endif
+#endif
+#endif

+ 0 - 83
Bin/CoreData/Shaders/GLSL/Lighting.vert

@@ -1,83 +0,0 @@
-vec3 GetAmbient(float zonePos)
-{
-    return cAmbientStartColor + zonePos * cAmbientEndColor;
-}
-
-#ifdef NUMVERTEXLIGHTS
-float GetVertexLight(int index, vec3 worldPos, vec3 normal)
-{
-    vec3 lightDir = cVertexLights[index * 3 + 1].xyz;
-    vec3 lightPos = cVertexLights[index * 3 + 2].xyz;
-    float invRange = cVertexLights[index * 3].w;
-    float cutoff = cVertexLights[index * 3 + 1].w;
-    float invCutoff = cVertexLights[index * 3 + 2].w;
-
-    // Directional light
-    if (invRange == 0.0)
-    {
-        float NdotL = max(dot(normal, lightDir), 0.0);
-        return NdotL;
-    }
-    // Point/spot light
-    else
-    {
-        vec3 lightVec = (lightPos - worldPos) * invRange;
-        float lightDist = length(lightVec);
-        vec3 localDir = lightVec / lightDist;
-        float NdotL = max(dot(normal, localDir), 0.0);
-        float atten = clamp(1.0 - lightDist * lightDist, 0.0, 1.0);
-        float spotEffect = dot(localDir, lightDir);
-        float spotAtten = clamp((spotEffect - cutoff) * invCutoff, 0.0, 1.0);
-        return NdotL * atten * spotAtten;
-    }
-}
-
-float GetVertexLightVolumetric(int index, vec3 worldPos)
-{
-    vec3 lightDir = cVertexLights[index * 3 + 1].xyz;
-    vec3 lightPos = cVertexLights[index * 3 + 2].xyz;
-    float invRange = cVertexLights[index * 3].w;
-    float cutoff = cVertexLights[index * 3 + 1].w;
-    float invCutoff = cVertexLights[index * 3 + 2].w;
-
-    // Directional light
-    if (invRange == 0.0)
-        return 1.0;
-    // Point/spot light
-    else
-    {
-        vec3 lightVec = (lightPos - worldPos) * invRange;
-        float lightDist = length(lightVec);
-        vec3 localDir = lightVec / lightDist;
-        float atten = clamp(1.0 - lightDist * lightDist, 0.0, 1.0);
-        float spotEffect = dot(localDir, lightDir);
-        float spotAtten = clamp((spotEffect - cutoff) * invCutoff, 0.0, 1.0);
-        return atten * spotAtten;
-    }
-}
-#endif
-
-#ifdef SHADOW
-
-#ifdef DIRLIGHT
-    #ifndef GL_ES
-        #define NUMCASCADES 4
-    #else
-        #define NUMCASCADES 2
-    #endif
-#else
-    #define NUMCASCADES 1
-#endif
-
-vec4 GetShadowPos(int index, vec4 projWorldPos)
-{
-    #if defined(DIRLIGHT)
-        return cLightMatrices[index] * projWorldPos;
-    #elif defined(SPOTLIGHT)
-        return cLightMatrices[1] * projWorldPos;
-    #else
-        return vec4(projWorldPos.xyz - cLightPos.xyz, 1.0);
-    #endif
-}
-
-#endif

+ 50 - 5
Bin/CoreData/Shaders/GLSL/LitParticle.frag → Bin/CoreData/Shaders/GLSL/LitParticle.glsl

@@ -1,7 +1,8 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-#include "Lighting.frag"
-#include "Fog.frag"
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+#include "Lighting.glsl"
+#include "Fog.glsl"
 
 
 varying vec2 vTexCoord;
 varying vec2 vTexCoord;
 #ifdef HEIGHTFOG
 #ifdef HEIGHTFOG
@@ -22,7 +23,51 @@ varying vec2 vTexCoord;
     varying vec4 vVertexLight;
     varying vec4 vVertexLight;
 #endif
 #endif
 
 
-void main()
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    vTexCoord = GetTexCoord(iTexCoord);
+    
+    #ifdef HEIGHTFOG
+        vWorldPos = worldPos;
+    #endif
+
+    #ifdef VERTEXCOLOR
+        vColor = iColor;
+    #endif
+
+    #ifdef PERPIXEL
+        // Per-pixel forward lighting
+        vec4 projWorldPos = vec4(worldPos, 1.0);
+    
+        #ifdef DIRLIGHT
+            vLightVec = vec4(cLightDir, GetDepth(gl_Position));
+        #else
+            vLightVec = vec4((cLightPos.xyz - worldPos) * cLightPos.w, GetDepth(gl_Position));
+        #endif
+    
+        #ifdef SPOTLIGHT
+            // Spotlight projection: transform from world space to projector texture coordinates
+            vSpotPos = cLightMatrices[0] * projWorldPos;
+        #endif
+    
+        #ifdef POINTLIGHT
+            vCubeMaskVec = mat3(cLightMatrices[0][0].xyz, cLightMatrices[0][1].xyz, cLightMatrices[0][2].xyz) * vLightVec.xyz;
+        #endif
+    #else
+        // Ambient & per-vertex lighting
+        vVertexLight = vec4(GetAmbient(GetZonePos(worldPos)), GetDepth(gl_Position));
+
+        #ifdef NUMVERTEXLIGHTS
+            for (int i = 0; i < NUMVERTEXLIGHTS; ++i)
+                vVertexLight.rgb += GetVertexLightVolumetric(i, worldPos) * cVertexLights[i * 3].rgb;
+        #endif
+    #endif
+}
+
+void PS()
 {
 {
     // Get material diffuse albedo
     // Get material diffuse albedo
     #ifdef DIFFMAP
     #ifdef DIFFMAP

+ 0 - 66
Bin/CoreData/Shaders/GLSL/LitParticle.vert

@@ -1,66 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-#include "Lighting.vert"
-
-varying vec2 vTexCoord;
-#ifdef HEIGHTFOG
-    varying vec3 vWorldPos;
-#endif
-#ifdef VERTEXCOLOR
-    varying vec4 vColor;
-#endif
-#ifdef PERPIXEL
-    varying vec4 vLightVec;
-    #ifdef SPOTLIGHT
-        varying vec4 vSpotPos;
-    #endif
-    #ifdef POINTLIGHT
-        varying vec3 vCubeMaskVec;
-    #endif
-#else
-    varying vec4 vVertexLight;
-#endif
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    vTexCoord = GetTexCoord(iTexCoord);
-    
-    #ifdef HEIGHTFOG
-        vWorldPos = worldPos;
-    #endif
-
-    #ifdef VERTEXCOLOR
-        vColor = iColor;
-    #endif
-
-    #ifdef PERPIXEL
-        // Per-pixel forward lighting
-        vec4 projWorldPos = vec4(worldPos, 1.0);
-    
-        #ifdef DIRLIGHT
-            vLightVec = vec4(cLightDir, GetDepth(gl_Position));
-        #else
-            vLightVec = vec4((cLightPos.xyz - worldPos) * cLightPos.w, GetDepth(gl_Position));
-        #endif
-    
-        #ifdef SPOTLIGHT
-            // Spotlight projection: transform from world space to projector texture coordinates
-            vSpotPos = cLightMatrices[0] * projWorldPos;
-        #endif
-    
-        #ifdef POINTLIGHT
-            vCubeMaskVec = mat3(cLightMatrices[0][0].xyz, cLightMatrices[0][1].xyz, cLightMatrices[0][2].xyz) * vLightVec.xyz;
-        #endif
-    #else
-        // Ambient & per-vertex lighting
-        vVertexLight = vec4(GetAmbient(GetZonePos(worldPos)), GetDepth(gl_Position));
-
-        #ifdef NUMVERTEXLIGHTS
-            for (int i = 0; i < NUMVERTEXLIGHTS; ++i)
-                vVertexLight.rgb += GetVertexLightVolumetric(i, worldPos) * cVertexLights[i * 3].rgb;
-        #endif
-    #endif
-}

+ 0 - 48
Bin/CoreData/Shaders/GLSL/LitParticle.xml

@@ -1,48 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <option name="VCol" define="VERTEXCOLOR" />
-        <option name="HeightFog" define="HEIGHTFOG" />
-        <variation name="" define="AMBIENT" />
-        <variation name="1VL" define="NUMVERTEXLIGHTS=1" />
-        <variation name="2VL" define="NUMVERTEXLIGHTS=2" />
-        <variation name="3VL" define="NUMVERTEXLIGHTS=3" />
-        <variation name="4VL" define="NUMVERTEXLIGHTS=4" />
-        <variation name="Dir">
-            <define name="DIRLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <variation name="Spot">
-            <define name="SPOTLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <variation name="Point">
-            <define name="POINTLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <option name="" /> <!-- Dummy option to separate the two variation groups -->
-        <variation name="" />
-        <variation name="Skinned" define="SKINNED" />
-        <variation name="Instanced" define="INSTANCED" />
-        <variation name="Billboard" define="BILLBOARD" />
-    </shader>
-    <shader type="ps">
-        <option name="Diff" define="DIFFMAP" />
-        <option name="AlphaMask" define="ALPHAMASK" require="DIFFMAP" />
-        <option name="VCol" define="VERTEXCOLOR" />
-        <option name="HeightFog" define="HEIGHTFOG" />
-        <variation name="" define="AMBIENT" />
-        <variation name="Dir">
-            <define name="DIRLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <variation name="Spot">
-            <define name="SPOTLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <variation name="Point">
-            <define name="POINTLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <option name="Mask" define="CUBEMASK" require="POINTLIGHT" />
-    </shader>
-</shaders>

+ 93 - 7
Bin/CoreData/Shaders/GLSL/LitSolid.frag → Bin/CoreData/Shaders/GLSL/LitSolid.glsl

@@ -1,7 +1,9 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-#include "Lighting.frag"
-#include "Fog.frag"
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+#include "ScreenPos.glsl"
+#include "Lighting.glsl"
+#include "Fog.glsl"
 
 
 varying vec2 vTexCoord;
 varying vec2 vTexCoord;
 #ifdef HEIGHTFOG
 #ifdef HEIGHTFOG
@@ -40,7 +42,93 @@ varying vec2 vTexCoord;
     #endif
     #endif
 #endif
 #endif
 
 
-void main()
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    vTexCoord = GetTexCoord(iTexCoord);
+    
+    #ifdef HEIGHTFOG
+        vWorldPos = worldPos;
+    #endif
+
+    #if defined(PERPIXEL) && defined(NORMALMAP)
+        vec3 vNormal;
+        vec3 vTangent;
+        vec3 vBitangent;
+    #endif
+
+    vNormal = GetWorldNormal(modelMatrix);
+    #ifdef NORMALMAP
+        vTangent = GetWorldTangent(modelMatrix);
+        vBitangent = cross(vTangent, vNormal) * iTangent.w;
+    #endif
+    
+    #ifdef PERPIXEL
+        // Per-pixel forward lighting
+        vec4 projWorldPos = vec4(worldPos, 1.0);
+
+        #ifdef SHADOW
+            // Shadow projection: transform from world space to shadow space
+            for (int i = 0; i < NUMCASCADES; i++)
+                vShadowPos[i] = GetShadowPos(i, projWorldPos);
+        #endif
+
+        #ifdef SPOTLIGHT
+            // Spotlight projection: transform from world space to projector texture coordinates
+            vSpotPos = cLightMatrices[0] * projWorldPos;
+        #endif
+    
+        #ifdef POINTLIGHT
+            vCubeMaskVec = mat3(cLightMatrices[0][0].xyz, cLightMatrices[0][1].xyz, cLightMatrices[0][2].xyz) * (cLightPos.xyz - worldPos);
+        #endif
+    
+        #ifdef NORMALMAP
+            mat3 tbn = mat3(vTangent, vBitangent, vNormal);
+            #ifdef DIRLIGHT
+                vLightVec = vec4(cLightDir * tbn, GetDepth(gl_Position));
+            #else
+                vLightVec = vec4((cLightPos.xyz - worldPos) * tbn * cLightPos.w, GetDepth(gl_Position));
+            #endif
+            #ifdef SPECULAR
+                vEyeVec = (cCameraPos - worldPos) * tbn;
+            #endif
+        #else
+            #ifdef DIRLIGHT
+                vLightVec = vec4(cLightDir, GetDepth(gl_Position));
+            #else
+                vLightVec = vec4((cLightPos.xyz - worldPos) * cLightPos.w, GetDepth(gl_Position));
+            #endif
+            #ifdef SPECULAR
+                vEyeVec = cCameraPos - worldPos;
+            #endif
+        #endif
+    #else
+        // Ambient & per-vertex lighting
+        #if defined(LIGHTMAP) || defined(AO)
+            // If using lightmap, disregard zone ambient light
+            // If using AO, calculate ambient in the PS
+            vVertexLight = vec4(0.0, 0.0, 0.0, GetDepth(gl_Position));
+            vTexCoord2 = iTexCoord2;
+        #else
+            vVertexLight = vec4(GetAmbient(GetZonePos(worldPos)), GetDepth(gl_Position));
+        #endif
+        
+        #ifdef NUMVERTEXLIGHTS
+            for (int i = 0; i < NUMVERTEXLIGHTS; ++i)
+                vVertexLight.rgb += GetVertexLight(i, worldPos, vNormal) * cVertexLights[i * 3].rgb;
+        #endif
+        
+        vScreenPos = GetScreenPos(gl_Position);
+
+        #ifdef ENVCUBEMAP
+            vReflectionVec = worldPos - cCameraPos;
+        #endif
+    #endif
+}
+
+void PS()
 {
 {
     // Get material diffuse albedo
     // Get material diffuse albedo
     #ifdef DIFFMAP
     #ifdef DIFFMAP
@@ -162,8 +250,6 @@ void main()
         gl_FragData[1] = fogFactor * vec4(diffColor.rgb, specIntensity);
         gl_FragData[1] = fogFactor * vec4(diffColor.rgb, specIntensity);
         gl_FragData[2] = vec4(normal * 0.5 + 0.5, specPower);
         gl_FragData[2] = vec4(normal * 0.5 + 0.5, specPower);
         gl_FragData[3] = vec4(EncodeDepth(vVertexLight.a), 0.0);
         gl_FragData[3] = vec4(EncodeDepth(vVertexLight.a), 0.0);
-
-
     #else
     #else
         // Ambient & per-vertex lighting
         // Ambient & per-vertex lighting
         vec3 finalColor = vVertexLight.rgb * diffColor.rgb;
         vec3 finalColor = vVertexLight.rgb * diffColor.rgb;

+ 0 - 127
Bin/CoreData/Shaders/GLSL/LitSolid.vert

@@ -1,127 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-#include "ScreenPos.vert"
-#include "Lighting.vert"
-
-varying vec2 vTexCoord;
-#ifdef HEIGHTFOG
-    varying vec3 vWorldPos;
-#endif
-#ifdef PERPIXEL
-    varying vec4 vLightVec;
-    #ifdef SPECULAR
-        varying vec3 vEyeVec;
-    #endif
-    #ifndef NORMALMAP
-        varying vec3 vNormal;
-    #endif
-    #ifdef SHADOW
-        varying vec4 vShadowPos[NUMCASCADES];
-    #endif
-    #ifdef SPOTLIGHT
-        varying vec4 vSpotPos;
-    #endif
-    #ifdef POINTLIGHT
-        varying vec3 vCubeMaskVec;
-    #endif
-#else
-    varying vec4 vVertexLight;
-    varying vec3 vNormal;
-    #ifdef NORMALMAP
-        varying vec3 vTangent;
-        varying vec3 vBitangent;
-    #endif
-    varying vec4 vScreenPos;
-    #ifdef ENVCUBEMAP
-        varying vec3 vReflectionVec;
-    #endif
-    #if defined(LIGHTMAP) || defined(AO)
-        varying vec2 vTexCoord2;
-    #endif
-#endif
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    vTexCoord = GetTexCoord(iTexCoord);
-    
-    #ifdef HEIGHTFOG
-        vWorldPos = worldPos;
-    #endif
-
-    #if defined(PERPIXEL) && defined(NORMALMAP)
-        vec3 vNormal;
-        vec3 vTangent;
-        vec3 vBitangent;
-    #endif
-
-    vNormal = GetWorldNormal(modelMatrix);
-    #ifdef NORMALMAP
-        vTangent = GetWorldTangent(modelMatrix);
-        vBitangent = cross(vTangent, vNormal) * iTangent.w;
-    #endif
-    
-    #ifdef PERPIXEL
-        // Per-pixel forward lighting
-        vec4 projWorldPos = vec4(worldPos, 1.0);
-
-        #ifdef SHADOW
-            // Shadow projection: transform from world space to shadow space
-            for (int i = 0; i < NUMCASCADES; i++)
-                vShadowPos[i] = GetShadowPos(i, projWorldPos);
-        #endif
-
-        #ifdef SPOTLIGHT
-            // Spotlight projection: transform from world space to projector texture coordinates
-            vSpotPos = cLightMatrices[0] * projWorldPos;
-        #endif
-    
-        #ifdef POINTLIGHT
-            vCubeMaskVec = mat3(cLightMatrices[0][0].xyz, cLightMatrices[0][1].xyz, cLightMatrices[0][2].xyz) * (cLightPos.xyz - worldPos);
-        #endif
-    
-        #ifdef NORMALMAP
-            mat3 tbn = mat3(vTangent, vBitangent, vNormal);
-            #ifdef DIRLIGHT
-                vLightVec = vec4(cLightDir * tbn, GetDepth(gl_Position));
-            #else
-                vLightVec = vec4((cLightPos.xyz - worldPos) * tbn * cLightPos.w, GetDepth(gl_Position));
-            #endif
-            #ifdef SPECULAR
-                vEyeVec = (cCameraPos - worldPos) * tbn;
-            #endif
-        #else
-            #ifdef DIRLIGHT
-                vLightVec = vec4(cLightDir, GetDepth(gl_Position));
-            #else
-                vLightVec = vec4((cLightPos.xyz - worldPos) * cLightPos.w, GetDepth(gl_Position));
-            #endif
-            #ifdef SPECULAR
-                vEyeVec = cCameraPos - worldPos;
-            #endif
-        #endif
-    #else
-        // Ambient & per-vertex lighting
-        #if defined(LIGHTMAP) || defined(AO)
-            // If using lightmap, disregard zone ambient light
-            // If using AO, calculate ambient in the PS
-            vVertexLight = vec4(0.0, 0.0, 0.0, GetDepth(gl_Position));
-            vTexCoord2 = iTexCoord2;
-        #else
-            vVertexLight = vec4(GetAmbient(GetZonePos(worldPos)), GetDepth(gl_Position));
-        #endif
-        
-        #ifdef NUMVERTEXLIGHTS
-            for (int i = 0; i < NUMVERTEXLIGHTS; ++i)
-                vVertexLight.rgb += GetVertexLight(i, worldPos, vNormal) * cVertexLights[i * 3].rgb;
-        #endif
-        
-        vScreenPos = GetScreenPos(gl_Position);
-
-        #ifdef ENVCUBEMAP
-            vReflectionVec = worldPos - cCameraPos;
-        #endif
-    #endif
-}

+ 0 - 83
Bin/CoreData/Shaders/GLSL/LitSolid.xml

@@ -1,83 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <option name="Normal" define="NORMALMAP" />
-        <option name="EnvCube" define="ENVCUBEMAP" />
-        <option name="LightMap" define="LIGHTMAP" exclude="AO" />
-        <option name="AO" define="AO" exclude="LightMap" />
-        <option name="HeightFog" define="HEIGHTFOG" />
-        <variation name="" define="AMBIENT" />
-        <variation name="1VL" define="NUMVERTEXLIGHTS=1" />
-        <variation name="2VL" define="NUMVERTEXLIGHTS=2" />
-        <variation name="3VL" define="NUMVERTEXLIGHTS=3" />
-        <variation name="4VL" define="NUMVERTEXLIGHTS=4" />
-        <variation name="Dir" exclude="EnvCube">
-            <define name="DIRLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <variation name="Spot" exclude="EnvCube">
-            <define name="SPOTLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <variation name="Point" exclude="EnvCube">
-            <define name="POINTLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <option name="Spec" define="SPECULAR" require="PERPIXEL" />
-        <option name="Shadow" define="SHADOW" require="PERPIXEL" />
-        <variation name="" />
-        <variation name="Skinned" define="SKINNED" />
-        <variation name="Instanced" define="INSTANCED" />
-        <variation name="Billboard" define="BILLBOARD" />
-    </shader>
-    <shader type="ps">
-        <option name="Diff" define="DIFFMAP" />
-        <option name="Normal" define="NORMALMAP" />
-        <option name="Packed" define="PACKEDNORMAL" require="NORMALMAP" />
-        <option name="SpecMap" define="SPECMAP" require="DIFFMAP" />
-        <option name="EnvCube" define="ENVCUBEMAP" />
-        <variation name="" />
-        <variation name="LightMap" define="LIGHTMAP" />
-        <variation name="AO" define="AO" />
-        <variation name="Emissive" define="EMISSIVEMAP" />
-        <option name="AlphaMask" define="ALPHAMASK" require="DIFFMAP" />
-        <option name="Ambient" define="AMBIENT" require="PERPIXEL" />
-        <option name="HeightFog" define="HEIGHTFOG" />
-        <variation name="" define="AMBIENT" />
-        <variation name="Dir">
-            <exclude name="EnvCube" />
-            <exclude name="LightMap" />
-            <exclude name="AO" />
-            <exclude name="Emissive" />
-            <define name="DIRLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <variation name="Spot">
-            <exclude name="EnvCube" />
-            <exclude name="LightMap" />
-            <exclude name="AO" />
-            <exclude name="Emissive" />
-            <define name="SPOTLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <variation name="Point">
-            <exclude name="EnvCube" />
-            <exclude name="LightMap" />
-            <exclude name="AO" />
-            <exclude name="Emissive" />
-            <define name="POINTLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <variation name="Prepass" define="PREPASS">
-            <exclude name="EnvCube" />
-            <exclude name="LightMap" />
-            <exclude name="AO" />
-            <exclude name="Emissive" />
-        </variation>
-        <variation name="Material" define="MATERIAL" />
-        <variation name="Deferred" define="DEFERRED" />
-        <option name="Mask" define="CUBEMASK" require="POINTLIGHT" />
-        <option name="Spec" define="SPECULAR" require="PERPIXEL" />
-        <option name="Shadow" define="SHADOW" require="PERPIXEL" />
-        <option name="LQ" define="LQSHADOW" require="SHADOW" />
-    </shader>
-</shaders>

+ 3 - 2
Bin/CoreData/Shaders/GLSL/PostProcess.frag → Bin/CoreData/Shaders/GLSL/PostProcess.glsl

@@ -1,4 +1,4 @@
-
+#ifdef COMPILEPS
 const float PI = 3.14159265;
 const float PI = 3.14159265;
 
 
 vec2 Noise(vec2 coord)
 vec2 Noise(vec2 coord)
@@ -11,7 +11,7 @@ vec2 Noise(vec2 coord)
 // Adapted: http://callumhay.blogspot.com/2010/09/gaussian-blur-shader-glsl.html
 // Adapted: http://callumhay.blogspot.com/2010/09/gaussian-blur-shader-glsl.html
 vec4 GaussianBlur(int blurKernelSize, vec2 blurDir, vec2 blurRadius, float sigma, sampler2D texSampler, vec2 texCoord)
 vec4 GaussianBlur(int blurKernelSize, vec2 blurDir, vec2 blurRadius, float sigma, sampler2D texSampler, vec2 texCoord)
 {
 {
-    const int blurKernelSizeHalfSize = blurKernelSize / 2;
+    int blurKernelSizeHalfSize = blurKernelSize / 2;
 
 
     // Incremental Gaussian Coefficent Calculation (See GPU Gems 3 pp. 877 - 889)
     // Incremental Gaussian Coefficent Calculation (See GPU Gems 3 pp. 877 - 889)
     vec3 gaussCoeff;
     vec3 gaussCoeff;
@@ -84,3 +84,4 @@ vec3 ToInverseGamma(vec3 color)
 {
 {
     return vec3(pow(color.r, InverseGamma), pow(color.g, InverseGamma), pow(color.b, InverseGamma));
     return vec3(pow(color.r, InverseGamma), pow(color.g, InverseGamma), pow(color.b, InverseGamma));
 }
 }
+#endif

+ 26 - 4
Bin/CoreData/Shaders/GLSL/PrepassLight.frag → Bin/CoreData/Shaders/GLSL/PrepassLight.glsl

@@ -1,6 +1,8 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-#include "Lighting.frag"
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+#include "ScreenPos.glsl"
+#include "Lighting.glsl"
 
 
 #ifdef DIRLIGHT
 #ifdef DIRLIGHT
     varying vec2 vScreenPos;
     varying vec2 vScreenPos;
@@ -12,7 +14,27 @@ varying vec3 vFarRay;
     varying vec3 vNearRay;
     varying vec3 vNearRay;
 #endif
 #endif
 
 
-void main()
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    #ifdef DIRLIGHT
+        vScreenPos = GetScreenPosPreDiv(gl_Position);
+        vFarRay = GetFarRay(gl_Position);
+        #ifdef ORTHO
+            vNearRay = GetNearRay(gl_Position);
+        #endif
+    #else
+        vScreenPos = GetScreenPos(gl_Position);
+        vFarRay = GetFarRay(gl_Position) * gl_Position.w;
+        #ifdef ORTHO
+            vNearRay = GetNearRay(gl_Position) * gl_Position.w;
+        #endif
+    #endif
+}
+
+void PS()
 {
 {
     // If rendering a directional light quad, optimize out the w divide
     // If rendering a directional light quad, optimize out the w divide
     #ifdef DIRLIGHT
     #ifdef DIRLIGHT

+ 0 - 33
Bin/CoreData/Shaders/GLSL/PrepassLight.vert

@@ -1,33 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-#include "ScreenPos.vert"
-
-#ifdef DIRLIGHT
-    varying vec2 vScreenPos;
-#else
-    varying vec4 vScreenPos;
-#endif
-varying vec3 vFarRay;
-#ifdef ORTHO
-    varying vec3 vNearRay;
-#endif
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    #ifdef DIRLIGHT
-        vScreenPos = GetScreenPosPreDiv(gl_Position);
-        vFarRay = GetFarRay(gl_Position);
-        #ifdef ORTHO
-            vNearRay = GetNearRay(gl_Position);
-        #endif
-    #else
-        vScreenPos = GetScreenPos(gl_Position);
-        vFarRay = GetFarRay(gl_Position) * gl_Position.w;
-        #ifdef ORTHO
-            vNearRay = GetNearRay(gl_Position) * gl_Position.w;
-        #endif
-    #endif
-}

+ 0 - 16
Bin/CoreData/Shaders/GLSL/PrepassLight.xml

@@ -1,16 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <option name="Ortho" define="ORTHO" />
-        <option name="Dir" define="DIRLIGHT" />
-    </shader>
-    <shader type="ps">
-        <option name="Ortho" define="ORTHO" />
-        <variation name="Dir" define="DIRLIGHT" />
-        <variation name="Spot" define="SPOTLIGHT" />
-        <variation name="Point" define="POINTLIGHT" />
-        <option name="Mask" define="CUBEMASK" require="POINTLIGHT" />
-        <option name="Spec" define="SPECULAR" />
-        <option name="Shadow" define="SHADOW" />
-        <option name="LQ" define="LQSHADOW" />
-    </shader>
-</shaders>

+ 11 - 9
Bin/CoreData/Shaders/GLSL/Samplers.frag → Bin/CoreData/Shaders/GLSL/Samplers.glsl

@@ -1,3 +1,4 @@
+#ifdef COMPILEPS
 uniform sampler2D sDiffMap;
 uniform sampler2D sDiffMap;
 uniform samplerCube sDiffCubeMap;
 uniform samplerCube sDiffCubeMap;
 uniform sampler2D sNormalMap;
 uniform sampler2D sNormalMap;
@@ -9,16 +10,16 @@ uniform sampler2D sLightRampMap;
 uniform sampler2D sLightSpotMap;
 uniform sampler2D sLightSpotMap;
 uniform samplerCube sLightCubeMap;
 uniform samplerCube sLightCubeMap;
 #ifndef GL_ES
 #ifndef GL_ES
-uniform sampler3D sVolumeMap;
-uniform sampler2D sAlbedoBuffer;
-uniform sampler2D sNormalBuffer;
-uniform sampler2D sDepthBuffer;
-uniform sampler2D sLightBuffer;
-uniform sampler2DShadow sShadowMap;
-uniform samplerCube sFaceSelectCubeMap;
-uniform samplerCube sIndirectionCubeMap;
+    uniform sampler3D sVolumeMap;
+    uniform sampler2D sAlbedoBuffer;
+    uniform sampler2D sNormalBuffer;
+    uniform sampler2D sDepthBuffer;
+    uniform sampler2D sLightBuffer;
+    uniform sampler2DShadow sShadowMap;
+    uniform samplerCube sFaceSelectCubeMap;
+    uniform samplerCube sIndirectionCubeMap;
 #else
 #else
-uniform sampler2D sShadowMap;
+    uniform sampler2D sShadowMap;
 #endif
 #endif
 
 
 vec3 DecodeNormal(vec4 normalInput)
 vec3 DecodeNormal(vec4 normalInput)
@@ -50,3 +51,4 @@ float DecodeDepth(vec3 depth)
     const vec3 dotValues = vec3(1.0, 1.0 / 255.0, 1.0 / (255.0 * 255.0));
     const vec3 dotValues = vec3(1.0, 1.0 / 255.0, 1.0 / (255.0 * 255.0));
     return dot(depth, dotValues);
     return dot(depth, dotValues);
 }
 }
+#endif

+ 2 - 1
Bin/CoreData/Shaders/GLSL/ScreenPos.vert → Bin/CoreData/Shaders/GLSL/ScreenPos.glsl

@@ -1,3 +1,4 @@
+#ifdef COMPILEVS
 vec4 GetScreenPos(vec4 clipPos)
 vec4 GetScreenPos(vec4 clipPos)
 {
 {
     return vec4(
     return vec4(
@@ -47,4 +48,4 @@ vec3 GetNearRay(vec4 clipPos)
     
     
     return (cCameraRot * viewRay) * cDepthMode.x;
     return (cCameraRot * viewRay) * cDepthMode.x;
 }
 }
-
+#endif

+ 0 - 15
Bin/CoreData/Shaders/GLSL/Shadow.frag

@@ -1,15 +0,0 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-
-varying vec2 vTexCoord;
-
-void main()
-{
-    #ifdef ALPHAMASK
-        float alpha = texture2D(sDiffMap, vTexCoord).a;
-        if (alpha < 0.5)
-            discard;
-    #endif
-
-    gl_FragColor = vec4(1.0);
-}

+ 24 - 0
Bin/CoreData/Shaders/GLSL/Shadow.glsl

@@ -0,0 +1,24 @@
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+
+varying vec2 vTexCoord;
+
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    vTexCoord = GetTexCoord(iTexCoord);
+}
+
+void PS()
+{
+    #ifdef ALPHAMASK
+        float alpha = texture2D(sDiffMap, vTexCoord).a;
+        if (alpha < 0.5)
+            discard;
+    #endif
+
+    gl_FragColor = vec4(1.0);
+}

+ 0 - 13
Bin/CoreData/Shaders/GLSL/Shadow.vert

@@ -1,13 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-
-varying vec2 vTexCoord;
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    vTexCoord = GetTexCoord(iTexCoord);
-}
-

+ 0 - 10
Bin/CoreData/Shaders/GLSL/Shadow.xml

@@ -1,10 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <variation name="" />
-        <variation name="Skinned" define="SKINNED" />
-        <variation name="Instanced" define="INSTANCED" />
-    </shader>
-    <shader type="ps">
-        <option name="AlphaMask" define="ALPHAMASK" />
-    </shader>
-</shaders>

+ 0 - 9
Bin/CoreData/Shaders/GLSL/Skybox.frag

@@ -1,9 +0,0 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-
-varying vec3 vTexCoord;
-
-void main()
-{
-    gl_FragColor = cMatDiffColor * textureCube(sDiffCubeMap, vTexCoord);
-}

+ 9 - 3
Bin/CoreData/Shaders/GLSL/Skybox.vert → Bin/CoreData/Shaders/GLSL/Skybox.glsl

@@ -1,9 +1,10 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
 
 
 varying vec3 vTexCoord;
 varying vec3 vTexCoord;
 
 
-void main()
+void VS()
 {
 {
     mat4 modelMatrix = iModelMatrix;
     mat4 modelMatrix = iModelMatrix;
     vec3 worldPos = GetWorldPos(modelMatrix);
     vec3 worldPos = GetWorldPos(modelMatrix);
@@ -12,3 +13,8 @@ void main()
     gl_Position.z = gl_Position.w;
     gl_Position.z = gl_Position.w;
     vTexCoord = iPos.xyz;
     vTexCoord = iPos.xyz;
 }
 }
+
+void PS()
+{
+    gl_FragColor = cMatDiffColor * textureCube(sDiffCubeMap, vTexCoord);
+}

+ 0 - 3
Bin/CoreData/Shaders/GLSL/Skybox.xml

@@ -1,3 +0,0 @@
-<shaders>
-    <shader />
-</shaders>

+ 0 - 6
Bin/CoreData/Shaders/GLSL/Stencil.frag

@@ -1,6 +0,0 @@
-#include "Uniforms.frag"
-
-void main()
-{
-    gl_FragColor = vec4(1.0);
-}

+ 9 - 3
Bin/CoreData/Shaders/GLSL/Stencil.vert → Bin/CoreData/Shaders/GLSL/Stencil.glsl

@@ -1,9 +1,15 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
+#include "Uniforms.glsl"
+#include "Transform.glsl"
 
 
-void main()
+void VS()
 {
 {
     mat4 modelMatrix = iModelMatrix;
     mat4 modelMatrix = iModelMatrix;
     vec3 worldPos = GetWorldPos(modelMatrix);
     vec3 worldPos = GetWorldPos(modelMatrix);
     gl_Position = GetClipPos(worldPos);
     gl_Position = GetClipPos(worldPos);
 }
 }
+
+void PS()
+{
+    gl_FragColor = vec4(1.0);
+}
+

+ 0 - 3
Bin/CoreData/Shaders/GLSL/Stencil.xml

@@ -1,3 +0,0 @@
-<shaders>
-    <shader />
-</shaders>

+ 61 - 6
Bin/CoreData/Shaders/GLSL/TerrainBlend.frag → Bin/CoreData/Shaders/GLSL/TerrainBlend.glsl

@@ -1,7 +1,9 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-#include "Lighting.frag"
-#include "Fog.frag"
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+#include "ScreenPos.glsl"
+#include "Lighting.glsl"
+#include "Fog.glsl"
 
 
 varying vec2 vTexCoord;
 varying vec2 vTexCoord;
 #ifdef HEIGHTFOG
 #ifdef HEIGHTFOG
@@ -28,14 +30,67 @@ varying vec2 vTexCoord;
     varying vec4 vScreenPos;
     varying vec4 vScreenPos;
 #endif
 #endif
 
 
+#ifdef COMPILEPS
 uniform sampler2D sWeightMap0;
 uniform sampler2D sWeightMap0;
 uniform sampler2D sDetailMap1;
 uniform sampler2D sDetailMap1;
 uniform sampler2D sDetailMap2;
 uniform sampler2D sDetailMap2;
 uniform sampler2D sDetailMap3;
 uniform sampler2D sDetailMap3;
-
 uniform vec2 cDetailTiling;
 uniform vec2 cDetailTiling;
+#endif
+
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    vTexCoord = GetTexCoord(iTexCoord);
+    vNormal = GetWorldNormal(modelMatrix);
+
+    #ifdef HEIGHTFOG
+        vWorldPos = worldPos;
+    #endif
+
+    #ifdef PERPIXEL
+        // Per-pixel forward lighting
+        vec4 projWorldPos = vec4(worldPos, 1.0);
+
+        #ifdef SHADOW
+            // Shadow projection: transform from world space to shadow space
+            for (int i = 0; i < NUMCASCADES; i++)
+                vShadowPos[i] = GetShadowPos(i, projWorldPos);
+        #endif
+
+        #ifdef SPOTLIGHT
+            // Spotlight projection: transform from world space to projector texture coordinates
+            vSpotPos = cLightMatrices[0] * projWorldPos;
+        #endif
+
+        #ifdef POINTLIGHT
+            vCubeMaskVec = mat3(cLightMatrices[0][0].xyz, cLightMatrices[0][1].xyz, cLightMatrices[0][2].xyz) * (cLightPos.xyz - worldPos);
+        #endif
+
+        #ifdef DIRLIGHT
+            vLightVec = vec4(cLightDir, GetDepth(gl_Position));
+        #else
+            vLightVec = vec4((cLightPos.xyz - worldPos) * cLightPos.w, GetDepth(gl_Position));
+        #endif
+        #ifdef SPECULAR
+            vEyeVec = cCameraPos - worldPos;
+        #endif
+    #else
+        // Ambient & per-vertex lighting
+        vVertexLight = vec4(GetAmbient(GetZonePos(worldPos)), GetDepth(gl_Position));
+
+        #ifdef NUMVERTEXLIGHTS
+            for (int i = 0; i < NUMVERTEXLIGHTS; ++i)
+                vVertexLight.rgb += GetVertexLight(i, worldPos, vNormal) * cVertexLights[i * 3].rgb;
+        #endif
+        
+        vScreenPos = GetScreenPos(gl_Position);
+    #endif
+}
 
 
-void main()
+void PS()
 {
 {
     // Get material diffuse albedo
     // Get material diffuse albedo
     vec3 weights = texture2D(sWeightMap0, vTexCoord).rgb;
     vec3 weights = texture2D(sWeightMap0, vTexCoord).rgb;

+ 0 - 81
Bin/CoreData/Shaders/GLSL/TerrainBlend.vert

@@ -1,81 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-#include "ScreenPos.vert"
-#include "Lighting.vert"
-
-varying vec2 vTexCoord;
-#ifdef HEIGHTFOG
-    varying vec3 vWorldPos;
-#endif
-#ifdef PERPIXEL
-    varying vec4 vLightVec;
-    #ifdef SPECULAR
-        varying vec3 vEyeVec;
-    #endif
-    varying vec3 vNormal;
-    #ifdef SHADOW
-        varying vec4 vShadowPos[NUMCASCADES];
-    #endif
-    #ifdef SPOTLIGHT
-        varying vec4 vSpotPos;
-    #endif
-    #ifdef POINTLIGHT
-        varying vec3 vCubeMaskVec;
-    #endif
-#else
-    varying vec4 vVertexLight;
-    varying vec3 vNormal;
-    varying vec4 vScreenPos;
-#endif
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    vTexCoord = GetTexCoord(iTexCoord);
-    vNormal = GetWorldNormal(modelMatrix);
-
-    #ifdef HEIGHTFOG
-        vWorldPos = worldPos;
-    #endif
-
-    #ifdef PERPIXEL
-        // Per-pixel forward lighting
-        vec4 projWorldPos = vec4(worldPos, 1.0);
-
-        #ifdef SHADOW
-            // Shadow projection: transform from world space to shadow space
-            for (int i = 0; i < NUMCASCADES; i++)
-                vShadowPos[i] = GetShadowPos(i, projWorldPos);
-        #endif
-
-        #ifdef SPOTLIGHT
-            // Spotlight projection: transform from world space to projector texture coordinates
-            vSpotPos = cLightMatrices[0] * projWorldPos;
-        #endif
-
-        #ifdef POINTLIGHT
-            vCubeMaskVec = mat3(cLightMatrices[0][0].xyz, cLightMatrices[0][1].xyz, cLightMatrices[0][2].xyz) * (cLightPos.xyz - worldPos);
-        #endif
-
-        #ifdef DIRLIGHT
-            vLightVec = vec4(cLightDir, GetDepth(gl_Position));
-        #else
-            vLightVec = vec4((cLightPos.xyz - worldPos) * cLightPos.w, GetDepth(gl_Position));
-        #endif
-        #ifdef SPECULAR
-            vEyeVec = cCameraPos - worldPos;
-        #endif
-    #else
-        // Ambient & per-vertex lighting
-        vVertexLight = vec4(GetAmbient(GetZonePos(worldPos)), GetDepth(gl_Position));
-
-        #ifdef NUMVERTEXLIGHTS
-            for (int i = 0; i < NUMVERTEXLIGHTS; ++i)
-                vVertexLight.rgb += GetVertexLight(i, worldPos, vNormal) * cVertexLights[i * 3].rgb;
-        #endif
-        
-        vScreenPos = GetScreenPos(gl_Position);
-    #endif
-}

+ 0 - 50
Bin/CoreData/Shaders/GLSL/TerrainBlend.xml

@@ -1,50 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <option name="HeightFog" define="HEIGHTFOG" />
-        <variation name="" define="AMBIENT" />
-        <variation name="1VL" define="NUMVERTEXLIGHTS=1" />
-        <variation name="2VL" define="NUMVERTEXLIGHTS=2" />
-        <variation name="3VL" define="NUMVERTEXLIGHTS=3" />
-        <variation name="4VL" define="NUMVERTEXLIGHTS=4" />
-        <variation name="Dir">
-            <define name="DIRLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <variation name="Spot">
-            <define name="SPOTLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <variation name="Point">
-            <define name="POINTLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <option name="Spec" define="SPECULAR" require="PERPIXEL" />
-        <option name="Shadow" define="SHADOW" require="PERPIXEL" />
-        <variation name="" />
-        <variation name="Instanced" define="INSTANCED" />
-    </shader>
-    <shader type="ps">
-        <option name="Ambient" define="AMBIENT" require="PERPIXEL" />
-        <option name="HeightFog" define="HEIGHTFOG" />
-        <variation name="" define="AMBIENT" />
-        <variation name="Dir">
-            <define name="DIRLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <variation name="Spot">
-            <define name="SPOTLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <variation name="Point">
-            <define name="POINTLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <variation name="Prepass" define="PREPASS" />
-        <variation name="Material" define="MATERIAL" />
-        <variation name="Deferred" define="DEFERRED" />
-        <option name="Mask" define="CUBEMASK" require="POINTLIGHT" />
-        <option name="Spec" define="SPECULAR" require="PERPIXEL" />
-        <option name="Shadow" define="SHADOW" require="PERPIXEL" />
-        <option name="LQ" define="LQSHADOW" require="SHADOW" />
-    </shader>
-</shaders>

+ 18 - 5
Bin/CoreData/Shaders/GLSL/Tonemap.frag → Bin/CoreData/Shaders/GLSL/Tonemap.glsl

@@ -1,13 +1,25 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-#include "PostProcess.frag"
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+#include "ScreenPos.glsl"
+#include "PostProcess.glsl"
 
 
+varying vec2 vScreenPos;
+
+#ifdef COMPILEPS
 uniform float cTonemapExposureBias;
 uniform float cTonemapExposureBias;
 uniform float cTonemapMaxWhite;
 uniform float cTonemapMaxWhite;
+#endif
 
 
-varying vec2 vScreenPos;
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    vScreenPos = GetScreenPosPreDiv(gl_Position);
+}
 
 
-void main()
+void PS()
 {
 {
     #ifdef REINHARDEQ3
     #ifdef REINHARDEQ3
     vec3 color = ReinhardEq3Tonemap(max(texture2D(sDiffMap, vScreenPos).rgb * cTonemapExposureBias, 0.0));
     vec3 color = ReinhardEq3Tonemap(max(texture2D(sDiffMap, vScreenPos).rgb * cTonemapExposureBias, 0.0));
@@ -25,3 +37,4 @@ void main()
     gl_FragColor = vec4(color, 1.0);
     gl_FragColor = vec4(color, 1.0);
     #endif
     #endif
 }
 }
+

+ 0 - 13
Bin/CoreData/Shaders/GLSL/Tonemap.vert

@@ -1,13 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-#include "ScreenPos.vert"
-
-varying vec2 vScreenPos;
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    vScreenPos = GetScreenPosPreDiv(gl_Position);
-}

+ 0 - 8
Bin/CoreData/Shaders/GLSL/Tonemap.xml

@@ -1,8 +0,0 @@
-<shaders>
-    <shader type="vs" />
-    <shader type="ps">
-        <variation name="ReinhardEq3" define="REINHARDEQ3" />
-        <variation name="ReinhardEq4" define="REINHARDEQ4" />
-        <variation name="Uncharted2" define="UNCHARTED2" />
-    </shader>
-</shaders>

+ 2 - 1
Bin/CoreData/Shaders/GLSL/Transform.vert → Bin/CoreData/Shaders/GLSL/Transform.glsl

@@ -1,3 +1,4 @@
+#ifdef COMPILEVS
 attribute vec4 iPos;
 attribute vec4 iPos;
 attribute vec3 iNormal;
 attribute vec3 iNormal;
 attribute vec4 iColor;
 attribute vec4 iColor;
@@ -115,4 +116,4 @@ vec3 GetWorldTangent(mat4 modelMatrix)
         return normalize(normalMatrix * iTangent.xyz);
         return normalize(normalMatrix * iTangent.xyz);
     #endif
     #endif
 }
 }
-
+#endif

+ 0 - 25
Bin/CoreData/Shaders/GLSL/Uniforms.frag

@@ -1,25 +0,0 @@
-#ifdef GL_ES
-    precision mediump float;
-#endif
-
-uniform vec3 cAmbientColor;
-uniform float cDeltaTimePS;
-uniform float cElapsedTimePS;
-uniform vec4 cFogParams;
-uniform vec3 cFogColor;
-uniform vec2 cGBufferInvSize;
-uniform vec4 cLightColor;
-uniform vec3 cLightDirPS;
-uniform vec4 cLightPosPS;
-uniform vec4 cMatDiffColor;
-uniform vec3 cMatEmissiveColor;
-uniform vec3 cMatEnvMapColor;
-uniform vec4 cMatSpecColor;
-uniform float cNearClipPS;
-uniform float cFarClipPS;
-uniform vec4 cShadowCubeAdjust;
-uniform vec4 cShadowDepthFade;
-uniform vec2 cShadowIntensity;
-uniform vec2 cShadowMapInvSize;
-uniform vec4 cShadowSplits;
-uniform mat4 cLightMatricesPS[4];

+ 30 - 0
Bin/CoreData/Shaders/GLSL/Uniforms.vert → Bin/CoreData/Shaders/GLSL/Uniforms.glsl

@@ -1,3 +1,4 @@
+#ifdef COMPILEVS
 uniform vec3 cAmbientStartColor;
 uniform vec3 cAmbientStartColor;
 uniform vec3 cAmbientEndColor;
 uniform vec3 cAmbientEndColor;
 uniform mat3 cBillboardRot;
 uniform mat3 cBillboardRot;
@@ -32,3 +33,32 @@ uniform mat4 cZone;
 #ifdef NUMVERTEXLIGHTS
 #ifdef NUMVERTEXLIGHTS
     uniform vec4 cVertexLights[4*3];
     uniform vec4 cVertexLights[4*3];
 #endif
 #endif
+#endif
+
+#ifdef COMPILEPS
+#ifdef GL_ES
+    precision mediump float;
+#endif
+
+uniform vec3 cAmbientColor;
+uniform float cDeltaTimePS;
+uniform float cElapsedTimePS;
+uniform vec4 cFogParams;
+uniform vec3 cFogColor;
+uniform vec2 cGBufferInvSize;
+uniform vec4 cLightColor;
+uniform vec3 cLightDirPS;
+uniform vec4 cLightPosPS;
+uniform vec4 cMatDiffColor;
+uniform vec3 cMatEmissiveColor;
+uniform vec3 cMatEnvMapColor;
+uniform vec4 cMatSpecColor;
+uniform float cNearClipPS;
+uniform float cFarClipPS;
+uniform vec4 cShadowCubeAdjust;
+uniform vec4 cShadowDepthFade;
+uniform vec2 cShadowIntensity;
+uniform vec2 cShadowMapInvSize;
+uniform vec4 cShadowSplits;
+uniform mat4 cLightMatricesPS[4];
+#endif

+ 0 - 38
Bin/CoreData/Shaders/GLSL/Unlit.frag

@@ -1,38 +0,0 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-#include "Fog.frag"
-
-varying vec2 vTexCoord;
-#ifdef VERTEXCOLOR
-    varying vec4 vColor;
-#endif
-#ifdef HEIGHTFOG
-    varying vec3 vWorldPos;
-#endif
-varying float vDepth;
-
-void main()
-{
-    #ifdef DIFFMAP
-        vec4 diffColor = cMatDiffColor * texture2D(sDiffMap, vTexCoord);
-        #ifdef ALPHAMASK
-            if (diffColor.a < 0.5)
-                discard;
-        #endif
-    #else
-        vec4 diffColor = cMatDiffColor;
-    #endif
-
-    #ifdef VERTEXCOLOR
-        diffColor *= vColor;
-    #endif
-
-    #ifdef HEIGHTFOG
-        float fogFactor = GetHeightFogFactor(vDepth, vWorldPos.y);
-    #else
-        float fogFactor = GetFogFactor(vDepth);
-    #endif
-
-    gl_FragColor = vec4(GetFog(diffColor.rgb, fogFactor), diffColor.a);
-}
-

+ 67 - 0
Bin/CoreData/Shaders/GLSL/Unlit.glsl

@@ -0,0 +1,67 @@
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+#include "ScreenPos.glsl"
+#include "Fog.glsl"
+
+varying vec2 vTexCoord;
+#ifdef VERTEXCOLOR
+    varying vec4 vColor;
+#endif
+#ifdef HEIGHTFOG
+    varying vec3 vWorldPos;
+#endif
+varying float vDepth;
+
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    vTexCoord = GetTexCoord(iTexCoord);
+    vDepth = GetDepth(gl_Position);
+
+    #ifdef HEIGHTFOG
+        vWorldPos = worldPos;
+    #endif
+
+    #ifdef VERTEXCOLOR
+        vColor = iColor;
+    #endif
+}
+
+void PS()
+{
+    #ifdef DIFFMAP
+        vec4 diffColor = cMatDiffColor * texture2D(sDiffMap, vTexCoord);
+        #ifdef ALPHAMASK
+            if (diffColor.a < 0.5)
+                discard;
+        #endif
+    #else
+        vec4 diffColor = cMatDiffColor;
+    #endif
+
+    #ifdef VERTEXCOLOR
+        diffColor *= vColor;
+    #endif
+
+    #ifdef HEIGHTFOG
+        float fogFactor = GetHeightFogFactor(vDepth, vWorldPos.y);
+    #else
+        float fogFactor = GetFogFactor(vDepth);
+    #endif
+
+    #if defined(PREPASS)
+        // Fill light pre-pass G-Buffer
+        gl_FragData[0] = vec4(0.5, 0.5, 0.5, 1.0);
+        gl_FragData[1] = vec4(EncodeDepth(vDepth), 0.0);
+    #elif defined(DEFERRED)
+        gl_FragData[0] = vec4(GetFog(diffColor.rgb, fogFactor), diffColor.a);
+        gl_FragData[1] = vec4(0.0, 0.0, 0.0, 0.0);
+        gl_FragData[2] = vec4(0.5, 0.5, 0.5, 1.0);
+        gl_FragData[3] = vec4(EncodeDepth(vDepth), 0.0);
+    #else
+        gl_FragColor = vec4(GetFog(diffColor.rgb, fogFactor), diffColor.a);
+    #endif
+}

+ 0 - 28
Bin/CoreData/Shaders/GLSL/Unlit.vert

@@ -1,28 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-
-varying vec2 vTexCoord;
-#ifdef VERTEXCOLOR
-    varying vec4 vColor;
-#endif
-#ifdef HEIGHTFOG
-    varying vec3 vWorldPos;
-#endif
-varying float vDepth;
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    vTexCoord = GetTexCoord(iTexCoord);
-    vDepth = GetDepth(gl_Position);
-
-    #ifdef HEIGHTFOG
-        vWorldPos = worldPos;
-    #endif
-
-    #ifdef VERTEXCOLOR
-        vColor = iColor;
-    #endif
-}

+ 0 - 16
Bin/CoreData/Shaders/GLSL/Unlit.xml

@@ -1,16 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <option name="VCol" define="VERTEXCOLOR" />
-        <option name="HeightFog" define="HEIGHTFOG" />
-        <variation name="" />
-        <variation name="Skinned" define="SKINNED" />
-        <variation name="Instanced" define="INSTANCED" />
-        <variation name="Billboard" define="BILLBOARD" />
-    </shader>
-    <shader type="ps">
-        <option name="Diff" define="DIFFMAP" />
-        <option name="VCol" define="VERTEXCOLOR" />
-        <option name="AlphaMask" define="ALPHAMASK" require="DIFFMAP" />
-        <option name="HeightFog" define="HEIGHTFOG" />
-    </shader>
-</shaders>

+ 11 - 11
Bin/CoreData/Shaders/GLSL/Vegetation.vert → Bin/CoreData/Shaders/GLSL/Vegetation.glsl

@@ -1,7 +1,7 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-#include "ScreenPos.vert"
-#include "Lighting.vert"
+#include "Uniforms.glsl"
+#include "Transform.glsl"
+#include "ScreenPos.glsl"
+#include "Lighting.glsl"
 
 
 uniform float cWindHeightFactor;
 uniform float cWindHeightFactor;
 uniform float cWindHeightPivot;
 uniform float cWindHeightPivot;
@@ -30,7 +30,7 @@ varying vec2 vTexCoord;
         varying vec3 vCubeMaskVec;
         varying vec3 vCubeMaskVec;
     #endif
     #endif
 #else
 #else
-    varying vec4 vVertexLight;
+    varying vec4 vglslexLight;
     varying vec3 vNormal;
     varying vec3 vNormal;
     #ifdef NORMALMAP
     #ifdef NORMALMAP
         varying vec3 vTangent;
         varying vec3 vTangent;
@@ -39,7 +39,7 @@ varying vec2 vTexCoord;
     varying vec4 vScreenPos;
     varying vec4 vScreenPos;
 #endif
 #endif
 
 
-void main()
+void VS()
 {
 {
     mat4 modelMatrix = iModelMatrix;
     mat4 modelMatrix = iModelMatrix;
     vec3 worldPos = GetWorldPos(modelMatrix);
     vec3 worldPos = GetWorldPos(modelMatrix);
@@ -109,12 +109,12 @@ void main()
             #endif
             #endif
         #endif
         #endif
     #else
     #else
-        // Ambient & per-vertex lighting
-        vVertexLight = vec4(GetAmbient(GetZonePos(worldPos)), GetDepth(gl_Position));
+        // Ambient & per-glslex lighting
+        vglslexLight = vec4(GetAmbient(GetZonePos(worldPos)), GetDepth(gl_Position));
 
 
-        #ifdef NUMVERTEXLIGHTS
-            for (int i = 0; i < NUMVERTEXLIGHTS; ++i)
-                vVertexLight.rgb += GetVertexLight(i, worldPos, vNormal) * cVertexLights[i * 3].rgb;
+        #ifdef NUMglslEXLIGHTS
+            for (int i = 0; i < NUMglslEXLIGHTS; ++i)
+                vglslexLight.rgb += GetglslexLight(i, worldPos, vNormal) * cglslexLights[i * 3].rgb;
         #endif
         #endif
         
         
         vScreenPos = GetScreenPos(gl_Position);
         vScreenPos = GetScreenPos(gl_Position);

+ 0 - 28
Bin/CoreData/Shaders/GLSL/Vegetation.xml

@@ -1,28 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <option name="Normal" define="NORMALMAP" />
-        <option name="HeightFog" define="HEIGHTFOG" />
-        <variation name="" define="AMBIENT" />
-        <variation name="1VL" define="NUMVERTEXLIGHTS=1" />
-        <variation name="2VL" define="NUMVERTEXLIGHTS=2" />
-        <variation name="3VL" define="NUMVERTEXLIGHTS=3" />
-        <variation name="4VL" define="NUMVERTEXLIGHTS=4" />
-        <variation name="Dir">
-            <define name="DIRLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <variation name="Spot">
-            <define name="SPOTLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <variation name="Point">
-            <define name="POINTLIGHT" />
-            <define name="PERPIXEL" />
-        </variation>
-        <option name="Spec" define="SPECULAR" require="PERPIXEL" />
-        <option name="Shadow" define="SHADOW" require="PERPIXEL" />
-        <variation name="" />
-        <variation name="Instanced" define="INSTANCED" />
-        <variation name="Billboard" define="BILLBOARD" />
-    </shader>
-</shaders>

+ 3 - 3
Bin/CoreData/Shaders/GLSL/VegetationDepth.vert → Bin/CoreData/Shaders/GLSL/VegetationDepth.glsl

@@ -1,5 +1,5 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
+#include "Uniforms.glsl"
+#include "Transform.glsl"
 
 
 uniform float cWindHeightFactor;
 uniform float cWindHeightFactor;
 uniform float cWindHeightPivot;
 uniform float cWindHeightPivot;
@@ -8,7 +8,7 @@ uniform vec2 cWindWorldSpacing;
 
 
 varying vec3 vTexCoord;
 varying vec3 vTexCoord;
 
 
-void main()
+void VS()
 {
 {
     mat4 modelMatrix = iModelMatrix;
     mat4 modelMatrix = iModelMatrix;
     vec3 worldPos = GetWorldPos(modelMatrix);
     vec3 worldPos = GetWorldPos(modelMatrix);

+ 0 - 6
Bin/CoreData/Shaders/GLSL/VegetationDepth.xml

@@ -1,6 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <variation name="" />
-        <variation name="Instanced" define="INSTANCED" />
-    </shader>
-</shaders>

+ 3 - 3
Bin/CoreData/Shaders/GLSL/VegetationShadow.vert → Bin/CoreData/Shaders/GLSL/VegetationShadow.glsl

@@ -1,5 +1,5 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
+#include "Uniforms.glsl"
+#include "Transform.glsl"
 
 
 uniform float cWindHeightFactor;
 uniform float cWindHeightFactor;
 uniform float cWindHeightPivot;
 uniform float cWindHeightPivot;
@@ -8,7 +8,7 @@ uniform vec2 cWindWorldSpacing;
 
 
 varying vec2 vTexCoord;
 varying vec2 vTexCoord;
 
 
-void main()
+void VS()
 {
 {
     mat4 modelMatrix = iModelMatrix;
     mat4 modelMatrix = iModelMatrix;
     vec3 worldPos = GetWorldPos(modelMatrix);
     vec3 worldPos = GetWorldPos(modelMatrix);

+ 0 - 6
Bin/CoreData/Shaders/GLSL/VegetationShadow.xml

@@ -1,6 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <variation name="" />
-        <variation name="Instanced" define="INSTANCED" />
-    </shader>
-</shaders>

+ 0 - 33
Bin/CoreData/Shaders/GLSL/Water.frag

@@ -1,33 +0,0 @@
-#include "Uniforms.frag"
-#include "Samplers.frag"
-#include "Fog.frag"
-
-varying vec4 vScreenPos;
-varying vec2 vReflectUV;
-varying vec2 vWaterUV;
-varying vec3 vNormal;
-varying vec4 vEyeVec;
-
-uniform float cNoiseStrength;
-uniform float cFresnelPower;
-uniform vec3 cWaterTint;
-
-void main()
-{
-    vec2 refractUV = vScreenPos.xy / vScreenPos.w;
-    vec2 reflectUV = vReflectUV.xy / vScreenPos.w;
-
-    vec2 noise = (texture2D(sNormalMap, vWaterUV).rg - 0.5) * cNoiseStrength;
-    refractUV += noise;
-    // Do not shift reflect UV coordinate upward, because it will reveal the clipping of geometry below water
-    if (noise.y < 0.0)
-        noise.y = 0.0;
-    reflectUV += noise;
-
-    float fresnel = pow(1.0 - clamp(dot(normalize(vEyeVec.xyz), vNormal), 0.0, 1.0), cFresnelPower);
-    vec3 refractColor = texture2D(sEnvMap, refractUV).rgb * cWaterTint;
-    vec3 reflectColor = texture2D(sDiffMap, reflectUV).rgb;
-    vec3 finalColor = mix(refractColor, reflectColor, fresnel);
-
-    gl_FragColor = vec4(GetFog(finalColor, GetFogFactor(vEyeVec.w)), 1.0);
-}

+ 59 - 0
Bin/CoreData/Shaders/GLSL/Water.glsl

@@ -0,0 +1,59 @@
+#include "Uniforms.glsl"
+#include "Samplers.glsl"
+#include "Transform.glsl"
+#include "ScreenPos.glsl"
+#include "Fog.glsl"
+
+varying vec4 vScreenPos;
+varying vec2 vReflectUV;
+varying vec2 vWaterUV;
+varying vec3 vNormal;
+varying vec4 vEyeVec;
+
+#ifdef COMPILEVS
+uniform vec2 cNoiseSpeed;
+uniform float cNoiseTiling;
+#endif
+#ifdef COMPILEPS
+uniform float cNoiseStrength;
+uniform float cFresnelPower;
+uniform vec3 cWaterTint;
+#endif
+
+void VS()
+{
+    mat4 modelMatrix = iModelMatrix;
+    vec3 worldPos = GetWorldPos(modelMatrix);
+    gl_Position = GetClipPos(worldPos);
+    vScreenPos = GetScreenPos(gl_Position);
+    // GetQuadTexCoord() returns a vec2 that is OK for quad rendering; multiply it with output W
+    // coordinate to make it work with arbitrary meshes such as the water plane (perform divide in pixel shader)
+    // Also because the quadTexCoord is based on the clip position, and Y is flipped when rendering to a texture
+    // on OpenGL, must flip again to cancel it out
+    vReflectUV = GetQuadTexCoord(gl_Position);
+    vReflectUV.y = 1.0 - vReflectUV.y;
+    vReflectUV *= gl_Position.w;
+    vWaterUV = iTexCoord * cNoiseTiling + cElapsedTime * cNoiseSpeed;
+    vNormal = GetWorldNormal(modelMatrix);
+    vEyeVec = vec4(cCameraPos - worldPos, GetDepth(gl_Position));
+}
+
+void PS()
+{
+    vec2 refractUV = vScreenPos.xy / vScreenPos.w;
+    vec2 reflectUV = vReflectUV.xy / vScreenPos.w;
+
+    vec2 noise = (texture2D(sNormalMap, vWaterUV).rg - 0.5) * cNoiseStrength;
+    refractUV += noise;
+    // Do not shift reflect UV coordinate upward, because it will reveal the clipping of geometry below water
+    if (noise.y < 0.0)
+        noise.y = 0.0;
+    reflectUV += noise;
+
+    float fresnel = pow(1.0 - clamp(dot(normalize(vEyeVec.xyz), vNormal), 0.0, 1.0), cFresnelPower);
+    vec3 refractColor = texture2D(sEnvMap, refractUV).rgb * cWaterTint;
+    vec3 reflectColor = texture2D(sDiffMap, reflectUV).rgb;
+    vec3 finalColor = mix(refractColor, reflectColor, fresnel);
+
+    gl_FragColor = vec4(GetFog(finalColor, GetFogFactor(vEyeVec.w)), 1.0);
+}

+ 0 - 30
Bin/CoreData/Shaders/GLSL/Water.vert

@@ -1,30 +0,0 @@
-#include "Uniforms.vert"
-#include "Transform.vert"
-#include "ScreenPos.vert"
-
-varying vec4 vScreenPos;
-varying vec2 vReflectUV;
-varying vec2 vWaterUV;
-varying vec3 vNormal;
-varying vec4 vEyeVec;
-
-uniform vec2 cNoiseSpeed;
-uniform float cNoiseTiling;
-
-void main()
-{
-    mat4 modelMatrix = iModelMatrix;
-    vec3 worldPos = GetWorldPos(modelMatrix);
-    gl_Position = GetClipPos(worldPos);
-    vScreenPos = GetScreenPos(gl_Position);
-    // GetQuadTexCoord() returns a vec2 that is OK for quad rendering; multiply it with output W
-    // coordinate to make it work with arbitrary meshes such as the water plane (perform divide in pixel shader)
-    // Also because the quadTexCoord is based on the clip position, and Y is flipped when rendering to a texture
-    // on OpenGL, must flip again to cancel it out
-    vReflectUV = GetQuadTexCoord(gl_Position);
-    vReflectUV.y = 1.0 - vReflectUV.y;
-    vReflectUV *= gl_Position.w;
-    vWaterUV = iTexCoord * cNoiseTiling + cElapsedTime * cNoiseSpeed;
-    vNormal = GetWorldNormal(modelMatrix);
-    vEyeVec = vec4(cCameraPos - worldPos, GetDepth(gl_Position));
-}

+ 0 - 4
Bin/CoreData/Shaders/GLSL/Water.xml

@@ -1,4 +0,0 @@
-<shaders>
-    <shader type="vs" />
-    <shader type="ps" />
-</shaders>

+ 0 - 18
Bin/CoreData/Shaders/HLSL/AutoExposure.xml

@@ -1,18 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <variation name="Luminance64" define="LUMINANCE64" />
-        <variation name="Luminance16" define="LUMINANCE16" />
-        <variation name="Luminance4" define="LUMINANCE4" />
-        <variation name="Luminance1" define="LUMINANCE1" />
-        <variation name="AdaptLuminance" define="ADAPTLUMINANCE" />
-        <variation name="Expose" define="EXPOSE" />
-    </shader>
-    <shader type="ps">
-        <variation name="Luminance64" define="LUMINANCE64" />
-        <variation name="Luminance16" define="LUMINANCE16" />
-        <variation name="Luminance4" define="LUMINANCE4" />
-        <variation name="Luminance1" define="LUMINANCE1" />
-        <variation name="AdaptLuminance" define="ADAPTLUMINANCE" />
-        <variation name="Expose" define="EXPOSE" />
-    </shader>
-</shaders>

+ 0 - 16
Bin/CoreData/Shaders/HLSL/Basic.xml

@@ -1,16 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <option name="Diff" define="DIFFMAP" />
-        <option name="VCol" define="VERTEXCOLOR" />
-        <variation name="" />
-        <variation name="Skinned" define="SKINNED" />
-        <variation name="Instanced" define="INSTANCED" require="SM3" />
-        <variation name="Billboard" define="BILLBOARD" />
-    </shader>
-    <shader type="ps">
-        <option name="Diff" define="DIFFMAP" exclude="Alpha" />
-        <option name="Alpha" define="ALPHAMAP" exclude="Diff" />
-        <option name="AlphaMask" define="ALPHAMASK" require="DIFFMAP" />
-        <option name="VCol" define="VERTEXCOLOR" />
-    </shader>
-</shaders>

+ 0 - 9
Bin/CoreData/Shaders/HLSL/Bloom.xml

@@ -1,9 +0,0 @@
-<shaders>
-    <shader type="vs" />
-    <shader type="ps">
-        <variation name="Bright" define="BRIGHT" />
-        <variation name="HBlur" define="HBLUR" />
-        <variation name="VBlur" define="VBLUR" />
-        <variation name="Combine" define="COMBINE" />
-    </shader>
-</shaders>

+ 0 - 24
Bin/CoreData/Shaders/HLSL/BloomHDR.xml

@@ -1,24 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <variation name="Bright" define="BRIGHT" />
-        <variation name="Blur2" define="BLUR2" />
-        <variation name="Blur4" define="BLUR4" />
-        <variation name="Blur8" define="BLUR8" />
-        <variation name="Blur16" define="BLUR16" />
-        <variation name="Combine2" define="COMBINE2" />
-        <variation name="Combine4" define="COMBINE4" />
-        <variation name="Combine8" define="COMBINE8" />
-        <variation name="Combine16" define="COMBINE16" />
-    </shader>
-    <shader type="ps">
-        <variation name="Bright" define="BRIGHT" />
-        <variation name="Blur2" define="BLUR2" />
-        <variation name="Blur4" define="BLUR4" />
-        <variation name="Blur8" define="BLUR8" />
-        <variation name="Blur16" define="BLUR16" />
-        <variation name="Combine2" define="COMBINE2" />
-        <variation name="Combine4" define="COMBINE4" />
-        <variation name="Combine8" define="COMBINE8" />
-        <variation name="Combine16" define="COMBINE16" />
-    </shader>
-</shaders>

+ 0 - 9
Bin/CoreData/Shaders/HLSL/Blur.xml

@@ -1,9 +0,0 @@
-<shaders>
-    <shader type="vs" />
-    <shader type="ps">
-    	<variation name="Blur3" define="BLUR3" />
-        <variation name="Blur5" define="BLUR5" />
-        <variation name="Blur7" define="BLUR7" />
-        <variation name="Blur9" define="BLUR9" />
-    </shader>
-</shaders>

+ 0 - 3
Bin/CoreData/Shaders/HLSL/ColorCorrection.xml

@@ -1,3 +0,0 @@
-<shaders>
-    <shader />
-</shaders>

+ 0 - 3
Bin/CoreData/Shaders/HLSL/CopyFrameBuffer.xml

@@ -1,3 +0,0 @@
-<shaders>
-    <shader />
-</shaders>

+ 0 - 17
Bin/CoreData/Shaders/HLSL/DeferredLight.xml

@@ -1,17 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <option name="Ortho" define="ORTHO" />
-        <option name="Dir" define="DIRLIGHT" />
-    </shader>
-    <shader type="ps">
-        <option name="Ortho" define="ORTHO" />
-        <variation name="Dir" define="DIRLIGHT" />
-        <variation name="Spot" define="SPOTLIGHT" />
-        <variation name="Point" define="POINTLIGHT" />
-        <option name="Mask" define="CUBEMASK" require="POINTLIGHT" />
-        <option name="Spec" define="SPECULAR" />
-        <option name="Shadow" define="SHADOW" />
-        <option name="LQ" define="LQSHADOW" require="HWSHADOW" />
-        <option name="HW" define="HWSHADOW" require="SHADOW" />
-    </shader>
-</shaders>

+ 0 - 10
Bin/CoreData/Shaders/HLSL/Depth.xml

@@ -1,10 +0,0 @@
-<shaders>
-    <shader type="vs">
-        <variation name="" />
-        <variation name="Skinned" define="SKINNED" />
-        <variation name="Instanced" define="INSTANCED" require="SM3" />
-    </shader>
-    <shader type="ps">
-        <option name="AlphaMask" define="ALPHAMASK" />
-    </shader>
-</shaders>

+ 0 - 3
Bin/CoreData/Shaders/HLSL/EdgeFilter.xml

@@ -1,3 +0,0 @@
-<shaders>
-    <shader />
-</shaders>

+ 3 - 1
Bin/CoreData/Shaders/HLSL/Fog.hlsl

@@ -1,3 +1,4 @@
+#ifdef COMPILEPS
 float3 GetFog(float3 color, float fogFactor)
 float3 GetFog(float3 color, float fogFactor)
 {
 {
     return lerp(cFogColor, color, fogFactor);
     return lerp(cFogColor, color, fogFactor);
@@ -18,5 +19,6 @@ float GetHeightFogFactor(float depth, float height)
     float fogFactor = GetFogFactor(depth);
     float fogFactor = GetFogFactor(depth);
     float heightFogFactor = (height - cFogParams.z) * cFogParams.w;
     float heightFogFactor = (height - cFogParams.z) * cFogParams.w;
     heightFogFactor = 1.0 - saturate(exp(-(heightFogFactor * heightFogFactor)));
     heightFogFactor = 1.0 - saturate(exp(-(heightFogFactor * heightFogFactor)));
-	return min(heightFogFactor, fogFactor);
+    return min(heightFogFactor, fogFactor);
 }
 }
+#endif

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно