Browse Source

Continued shader refactoring.
- Removed heightfog techniques, which will be replaced with in-engine shader variations
- Fixed LitSolid shader and some basic techniques
- If Pass specifies its own shaders, the defines from Technique aren't used
- Technique can specify the alphamask property globally for passes to avoid repetition

Lasse Öörni 12 years ago
parent
commit
3004b08f66
69 changed files with 317 additions and 730 deletions
  1. 0 16
      Bin/CoreData/Shaders/GLSL/Basic.xml
  2. 0 15
      Bin/CoreData/Shaders/GLSL/Depth.frag
  3. 24 0
      Bin/CoreData/Shaders/GLSL/Depth.glsl
  4. 0 13
      Bin/CoreData/Shaders/GLSL/Depth.vert
  5. 0 10
      Bin/CoreData/Shaders/GLSL/Depth.xml
  6. 3 1
      Bin/CoreData/Shaders/GLSL/Fog.glsl
  7. 89 1
      Bin/CoreData/Shaders/GLSL/Lighting.glsl
  8. 0 83
      Bin/CoreData/Shaders/GLSL/Lighting.vert
  9. 93 5
      Bin/CoreData/Shaders/GLSL/LitSolid.glsl
  10. 0 127
      Bin/CoreData/Shaders/GLSL/LitSolid.vert
  11. 0 83
      Bin/CoreData/Shaders/GLSL/LitSolid.xml
  12. 2 1
      Bin/CoreData/Shaders/GLSL/ScreenPos.glsl
  13. 0 15
      Bin/CoreData/Shaders/GLSL/Shadow.frag
  14. 24 0
      Bin/CoreData/Shaders/GLSL/Shadow.glsl
  15. 0 13
      Bin/CoreData/Shaders/GLSL/Shadow.vert
  16. 0 10
      Bin/CoreData/Shaders/GLSL/Shadow.xml
  17. 7 7
      Bin/CoreData/Techniques/Diff.xml
  18. 6 6
      Bin/CoreData/Techniques/DiffAO.xml
  19. 3 3
      Bin/CoreData/Techniques/DiffAOAlpha.xml
  20. 8 8
      Bin/CoreData/Techniques/DiffAOAlphaMask.xml
  21. 2 2
      Bin/CoreData/Techniques/DiffAdd.xml
  22. 0 3
      Bin/CoreData/Techniques/DiffAddHeightFog.xml
  23. 3 3
      Bin/CoreData/Techniques/DiffAlpha.xml
  24. 0 5
      Bin/CoreData/Techniques/DiffAlphaHeightFog.xml
  25. 9 9
      Bin/CoreData/Techniques/DiffAlphaMask.xml
  26. 0 10
      Bin/CoreData/Techniques/DiffAlphaMaskHeightFog.xml
  27. 0 5
      Bin/CoreData/Techniques/DiffEnvCubeAlphaHeightFog.xml
  28. 0 9
      Bin/CoreData/Techniques/DiffEnvCubeHeightFog.xml
  29. 0 5
      Bin/CoreData/Techniques/DiffLightMapAlphaHeightFog.xml
  30. 0 9
      Bin/CoreData/Techniques/DiffLightMapHeightFog.xml
  31. 0 5
      Bin/CoreData/Techniques/DiffLitParticleAlphaHeightFog.xml
  32. 7 7
      Bin/CoreData/Techniques/DiffNormal.xml
  33. 0 5
      Bin/CoreData/Techniques/DiffNormalAlphaHeightFog.xml
  34. 0 10
      Bin/CoreData/Techniques/DiffNormalAlphaMaskHeightFog.xml
  35. 0 5
      Bin/CoreData/Techniques/DiffNormalEnvCubeAlphaHeightFog.xml
  36. 0 9
      Bin/CoreData/Techniques/DiffNormalEnvCubeHeightFog.xml
  37. 0 10
      Bin/CoreData/Techniques/DiffNormalHeightFog.xml
  38. 7 7
      Bin/CoreData/Techniques/DiffNormalPacked.xml
  39. 0 5
      Bin/CoreData/Techniques/DiffNormalPackedAlphaHeightFog.xml
  40. 0 10
      Bin/CoreData/Techniques/DiffNormalPackedAlphaMaskHeightFog.xml
  41. 0 9
      Bin/CoreData/Techniques/DiffNormalPackedEnvCubeHeightFog.xml
  42. 0 10
      Bin/CoreData/Techniques/DiffNormalPackedHeightFog.xml
  43. 0 5
      Bin/CoreData/Techniques/DiffNormalPackedSpecAlphaHeightFog.xml
  44. 0 10
      Bin/CoreData/Techniques/DiffNormalPackedSpecAlphaMaskHeightFog.xml
  45. 0 10
      Bin/CoreData/Techniques/DiffNormalPackedSpecHeightFog.xml
  46. 0 5
      Bin/CoreData/Techniques/DiffNormalSpecAlphaHeightFog.xml
  47. 0 10
      Bin/CoreData/Techniques/DiffNormalSpecAlphaMaskHeightFog.xml
  48. 0 5
      Bin/CoreData/Techniques/DiffSpecAlphaHeightFog.xml
  49. 0 10
      Bin/CoreData/Techniques/DiffSpecAlphaMaskHeightFog.xml
  50. 0 10
      Bin/CoreData/Techniques/DiffSpecHeightFog.xml
  51. 0 3
      Bin/CoreData/Techniques/DiffUnlitAlphaHeightFog.xml
  52. 0 3
      Bin/CoreData/Techniques/DiffUnlitHeightFog.xml
  53. 7 7
      Bin/CoreData/Techniques/NoTexture.xml
  54. 2 2
      Bin/CoreData/Techniques/NoTextureAdd.xml
  55. 0 3
      Bin/CoreData/Techniques/NoTextureAddHeightFog.xml
  56. 3 3
      Bin/CoreData/Techniques/NoTextureAlpha.xml
  57. 0 5
      Bin/CoreData/Techniques/NoTextureAlphaHeightFog.xml
  58. 0 5
      Bin/CoreData/Techniques/NoTextureEnvCubeAlphaHeightFog.xml
  59. 0 9
      Bin/CoreData/Techniques/NoTextureEnvCubeHeightFog.xml
  60. 0 3
      Bin/CoreData/Techniques/NoTextureUnlitAlphaHeightFog.xml
  61. 0 3
      Bin/CoreData/Techniques/NoTextureUnlitHeightFog.xml
  62. 0 3
      Bin/CoreData/Techniques/NoTextureVColAddHeightFog.xml
  63. 0 3
      Bin/CoreData/Techniques/NoTextureVColMultiplyHeightFog.xml
  64. 0 10
      Bin/CoreData/Techniques/TerrainBlendHeightFog.xml
  65. 0 10
      Bin/CoreData/Techniques/VegetationDiffAlphaMaskHeightFog.xml
  66. 0 10
      Bin/CoreData/Techniques/VegetationDiffHeightFog.xml
  67. 0 5
      Bin/CoreData/Techniques/VegetationDiffUnlitAlphaMaskHeightFog.xml
  68. 0 5
      Bin/CoreData/Techniques/VegetationDiffUnlitHeightFog.xml
  69. 18 4
      Source/Engine/Graphics/Technique.cpp

+ 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>

+ 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>

+ 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

+ 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

+ 93 - 5
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

+ 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>

+ 2 - 1
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>

+ 7 - 7
Bin/CoreData/Techniques/Diff.xml

@@ -1,10 +1,10 @@
-<technique>
-    <pass name="base" vs="LitSolid" ps="LitSolid_Diff" />
-    <pass name="litbase" vs="LitSolid" ps="LitSolid_DiffAmbient" />
-    <pass name="light" vs="LitSolid" ps="LitSolid_Diff" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vs="LitSolid" ps="LitSolid_DiffPrepass" />
-    <pass name="material" vs="LitSolid" ps="LitSolid_DiffMaterial" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vs="LitSolid" ps="LitSolid_DiffDeferred" />
+<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
+    <pass name="base" />
+    <pass name="litbase" psdefines="AMBIENT" />
+    <pass name="light" depthtest="equal" depthwrite="false" blend="add" />
+    <pass name="prepass" psdefines="PREPASS" />
+    <pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
+    <pass name="deferred" psdefines="DEFERRED" />
     <pass name="depth" vs="Depth" ps="Depth" />
     <pass name="depth" vs="Depth" ps="Depth" />
     <pass name="shadow" vs="Shadow" ps="Shadow" />
     <pass name="shadow" vs="Shadow" ps="Shadow" />
 </technique>
 </technique>

+ 6 - 6
Bin/CoreData/Techniques/DiffAO.xml

@@ -1,9 +1,9 @@
-<technique>
-    <pass name="base" vs="LitSolid_AO" ps="LitSolid_DiffAO" />
-    <pass name="light" vs="LitSolid" ps="LitSolid_Diff" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vs="LitSolid" ps="LitSolid_DiffPrepass" />
-    <pass name="material" vs="LitSolid_AO" ps="LitSolid_DiffAOMaterial" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vs="LitSolid_AO" ps="LitSolid_DiffAODeferred" />
+<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
+    <pass name="base" vsdefines="AO" psdefines="AO" />
+    <pass name="light" depthtest="equal" depthwrite="false" blend="add" />
+    <pass name="prepass" psdefines="PREPASS" />
+    <pass name="material" vsdefines="AO" psdefines="MATERIAL AO" depthtest="equal" depthwrite="false" />
+    <pass name="deferred" vsdefines="AO" psdefines="DEFERRED AO" />
     <pass name="depth" vs="Depth" ps="Depth" />
     <pass name="depth" vs="Depth" ps="Depth" />
     <pass name="shadow" vs="Shadow" ps="Shadow" />
     <pass name="shadow" vs="Shadow" ps="Shadow" />
 </technique>
 </technique>

+ 3 - 3
Bin/CoreData/Techniques/DiffAOAlpha.xml

@@ -1,5 +1,5 @@
-<technique>
-    <pass name="alpha" vs="LitSolid_AO" ps="LitSolid_DiffAO" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vs="LitSolid" ps="LitSolid_Diff" depthwrite="false" blend="addalpha" />
+<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
+    <pass name="alpha" vsdefines="AO" psdefines="AO" depthwrite="false" blend="alpha" />
+    <pass name="litalpha"  depthwrite="false" blend="addalpha" />
     <pass name="shadow" vs="Shadow" ps="Shadow" />
     <pass name="shadow" vs="Shadow" ps="Shadow" />
 </technique>
 </technique>

+ 8 - 8
Bin/CoreData/Techniques/DiffAOAlphaMask.xml

@@ -1,9 +1,9 @@
-<technique>
-    <pass name="base" vs="LitSolid_AO" ps="LitSolid_DiffAOAlphaMask" alphamask="true" />
-    <pass name="light" vs="LitSolid" ps="LitSolid_DiffAlphaMask"  depthtest="equal" depthwrite="false" blend="add" alphamask="true" />
-    <pass name="prepass" vs="LitSolid" ps="LitSolid_DiffAlphaMaskPrepass" alphamask="true" />
-    <pass name="material" vs="LitSolid_AO" ps="LitSolid_DiffAOAlphaMaskMaterial" depthtest="equal" depthwrite="false" alphamask="true" />
-    <pass name="deferred" vs="LitSolid_AO" ps="LitSolid_DiffAOAlphaMaskDeferred" alphamask="true" />
-    <pass name="depth" vs="Depth" ps="Depth_AlphaMask" alphamask="true" />
-    <pass name="shadow" vs="Shadow" ps="Shadow_AlphaMask" alphamask="true" />
+<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP ALPHAMASK" alphamask="true">
+    <pass name="base" vsdefines="AO" psdefines="AO" />
+    <pass name="light" depthtest="equal" depthwrite="false" blend="add" />
+    <pass name="prepass" psdefines="PREPASS" />
+    <pass name="material" vsdefines="AO" psdefines="MATERIAL AO" depthtest="equal" depthwrite="false" />
+    <pass name="deferred" vsdefines="AO" psdefines="DEFERRED AO" />
+    <pass name="depth" vs="Depth" ps="Depth" psdefines="ALPHAMASK" />
+    <pass name="shadow" vs="Shadow" ps="Shadow" psdefines="ALPHAMASK" />
 </technique>
 </technique>

+ 2 - 2
Bin/CoreData/Techniques/DiffAdd.xml

@@ -1,3 +1,3 @@
-<technique>
-    <pass name="alpha" vs="Unlit" ps="Unlit_Diff" depthwrite="false" blend="add" />
+<technique vs="Unlit" ps="Unlit" psdefines="DIFFMAP">
+    <pass name="alpha" depthwrite="false" blend="add" />
 </technique>
 </technique>

+ 0 - 3
Bin/CoreData/Techniques/DiffAddHeightFog.xml

@@ -1,3 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="Unlit_HeightFog" ps="Unlit_DiffHeightFog" depthwrite="false" blend="add" />
-</technique>

+ 3 - 3
Bin/CoreData/Techniques/DiffAlpha.xml

@@ -1,5 +1,5 @@
-<technique>
-    <pass name="alpha" vs="LitSolid" ps="LitSolid_Diff" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vs="LitSolid" ps="LitSolid_Diff" depthwrite="false" blend="addalpha" />
+<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
+    <pass name="alpha"  depthwrite="false" blend="alpha" />
+    <pass name="litalpha" depthwrite="false" blend="addalpha" />
     <pass name="shadow" vs="Shadow" ps="Shadow" />
     <pass name="shadow" vs="Shadow" ps="Shadow" />
 </technique>
 </technique>

+ 0 - 5
Bin/CoreData/Techniques/DiffAlphaHeightFog.xml

@@ -1,5 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="LitSolid_HeightFog" ps="LitSolid_DiffHeightFog" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vs="LitSolid_HeightFog" ps="LitSolid_DiffHeightFog" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 9 - 9
Bin/CoreData/Techniques/DiffAlphaMask.xml

@@ -1,10 +1,10 @@
-<technique>
-    <pass name="base" vs="LitSolid" ps="LitSolid_DiffAlphaMask" alphamask="true" />
-    <pass name="litbase" vs="LitSolid" ps="LitSolid_DiffAlphaMaskAmbient" alphamask="true" />
-    <pass name="light" vs="LitSolid" ps="LitSolid_DiffAlphaMask"  depthtest="equal" depthwrite="false" blend="add" alphamask="true" />
-    <pass name="prepass" vs="LitSolid" ps="LitSolid_DiffAlphaMaskPrepass" alphamask="true" />
-    <pass name="material" vs="LitSolid" ps="LitSolid_DiffAlphaMaskMaterial" depthtest="equal" depthwrite="false" alphamask="true" />
-    <pass name="deferred" vs="LitSolid" ps="LitSolid_DiffAlphaMaskDeferred" alphamask="true" />
-    <pass name="depth" vs="Depth" ps="Depth_AlphaMask" alphamask="true" />
-    <pass name="shadow" vs="Shadow" ps="Shadow_AlphaMask" alphamask="true" />
+<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP ALPHAMASK" alphamask="true" >
+    <pass name="base" />
+    <pass name="litbase" psdefines="AMBIENT" />
+    <pass name="light" depthtest="equal" depthwrite="false" blend="add" />
+    <pass name="prepass" psdefines="PREPASS" />
+    <pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
+    <pass name="deferred" psdefines="DEFERRED" />
+    <pass name="depth" vs="Depth" ps="Depth" psdefines="ALPHAMASK" />
+    <pass name="shadow" vs="Shadow" ps="Shadow" psdefines="ALPHAMASK" />
 </technique>
 </technique>

+ 0 - 10
Bin/CoreData/Techniques/DiffAlphaMaskHeightFog.xml

@@ -1,10 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="LitSolid_HeightFog" ps="LitSolid_DiffAlphaMaskHeightFog" alphamask="true" />
-    <pass name="litbase" vs="LitSolid_HeightFog" ps="LitSolid_DiffAlphaMaskAmbientHeightFog" alphamask="true" />
-    <pass name="light" vs="LitSolid_HeightFog" ps="LitSolid_DiffAlphaMaskHeightFog"  depthtest="equal" depthwrite="false" blend="add" alphamask="true" />
-    <pass name="prepass" vs="LitSolid_HeightFog" ps="LitSolid_DiffAlphaMaskHeightFogPrepass" alphamask="true" />
-    <pass name="material" vs="LitSolid_HeightFog" ps="LitSolid_DiffAlphaMaskHeightFogMaterial" depthtest="equal" depthwrite="false" alphamask="true" />
-    <pass name="deferred" vs="LitSolid_HeightFog" ps="LitSolid_DiffAlphaMaskHeightFogDeferred" alphamask="true" />
-    <pass name="depth" vs="Depth" ps="Depth_AlphaMask" alphamask="true" />
-    <pass name="shadow" vs="Shadow" ps="Shadow_AlphaMask" alphamask="true" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/DiffEnvCubeAlphaHeightFog.xml

@@ -1,5 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="LitSolid_EnvCubeHeightFog" ps="LitSolid_DiffEnvCubeHeightFog" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vs="LitSolid_HeightFog" ps="LitSolid_DiffHeightFog" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 9
Bin/CoreData/Techniques/DiffEnvCubeHeightFog.xml

@@ -1,9 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="LitSolid_EnvCubeHeightFog" ps="LitSolid_DiffEnvCubeHeightFog" />
-    <pass name="light" vs="LitSolid_HeightFog" ps="LitSolid_Diff" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vs="LitSolid_HeightFog" ps="LitSolid_DiffHeightFogPrepass" />
-    <pass name="material" vs="LitSolid_EnvCubeHeightFog" ps="LitSolid_DiffEnvCubeHeightFogMaterial" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vs="LitSolid_EnvCubeHeightFog" ps="LitSolid_DiffEnvCubeHeightFogDeferred" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/DiffLightMapAlphaHeightFog.xml

@@ -1,5 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="LitSolid_LightMapHeightFog" ps="LitSolid_DiffLightMapHeightFog" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vs="LitSolid_HeightFog" ps="LitSolid_DiffHeightFog" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 9
Bin/CoreData/Techniques/DiffLightMapHeightFog.xml

@@ -1,9 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="LitSolid_LightMapHeightFog" ps="LitSolid_DiffLightMapHeightFog" />
-    <pass name="light" vs="LitSolid_HeightFog" ps="LitSolid_DiffHeightFog" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vs="LitSolid_HeightFog" ps="LitSolid_DiffHeightFogPrepass" />
-    <pass name="material" vs="LitSolid_LightMapHeightFog" ps="LitSolid_DiffLightMapHeightFogMaterial" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vs="LitSolid_LightMapHeightFog" ps="LitSolid_DiffLightMapHeightFogDeferred" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/DiffLitParticleAlphaHeightFog.xml

@@ -1,5 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="LitParticle_HeightFog" ps="LitParticle_DiffHeightFog" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vs="LitParticle_HeightFog" ps="LitParticle_DiffHeightFog" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 7 - 7
Bin/CoreData/Techniques/DiffNormal.xml

@@ -1,10 +1,10 @@
-<technique>
-    <pass name="base" vs="LitSolid" ps="LitSolid_Diff" />
-    <pass name="litbase" vs="LitSolid_Normal" ps="LitSolid_DiffNormalAmbient" />
-    <pass name="light" vs="LitSolid_Normal" ps="LitSolid_DiffNormal" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vs="LitSolid_Normal" ps="LitSolid_DiffNormalPrepass" />
-    <pass name="material" vs="LitSolid" ps="LitSolid_DiffMaterial" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vs="LitSolid_Normal" ps="LitSolid_DiffNormalDeferred" />
+<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
+    <pass name="base" />
+    <pass name="litbase" vsdefines="NORMALMAP" psdefines="AMBIENT NORMALMAP" />
+    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP" depthtest="equal" depthwrite="false" blend="add" />
+    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP" />
+    <pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
+    <pass name="deferred" vsdefines="NORMALMAP" psdefines="DEFERRED NORMALMAP" />
     <pass name="depth" vs="Depth" ps="Depth" />
     <pass name="depth" vs="Depth" ps="Depth" />
     <pass name="shadow" vs="Shadow" ps="Shadow" />
     <pass name="shadow" vs="Shadow" ps="Shadow" />
 </technique>
 </technique>

+ 0 - 5
Bin/CoreData/Techniques/DiffNormalAlphaHeightFog.xml

@@ -1,5 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="LitSolid_HeightFog" ps="LitSolid_DiffHeightFog" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalHeightFog" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/DiffNormalAlphaMaskHeightFog.xml

@@ -1,10 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="LitSolid_HeightFog" ps="LitSolid_DiffAlphaMaskHeightFog" alphamask="true" />
-    <pass name="litbase" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalAlphaMaskAmbientHeightFog" alphamask="true" />
-    <pass name="light" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalAlphaMask" depthtest="equal" depthwrite="false" blend="add" alphamask="true" />
-    <pass name="prepass" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalAlphaMaskHeightFogPrepass" alphamask="true" />
-    <pass name="material" vs="LitSolid_HeightFog" ps="LitSolid_DiffAlphaMaskHeightFogMaterial" depthtest="equal" depthwrite="false" alphamask="true" />
-    <pass name="deferred" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalAlphaMaskHeightFogDeferred" alphamask="true" />
-    <pass name="depth" vs="Depth" ps="Depth_AlphaMask" alphamask="true" />
-    <pass name="shadow" vs="Shadow" ps="Shadow_AlphaMask" alphamask="true" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/DiffNormalEnvCubeAlphaHeightFog.xml

@@ -1,5 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="LitSolid_NormalEnvCubeHeightFog" ps="LitSolid_DiffNormalEnvCubeHeightFog" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalHeightFog" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 9
Bin/CoreData/Techniques/DiffNormalEnvCubeHeightFog.xml

@@ -1,9 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="LitSolid_NormalEnvCubeHeightFog" ps="LitSolid_DiffNormalEnvCubeHeightFog" />
-    <pass name="light" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalHeightFog" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalHeightFogPrepass" />
-    <pass name="material" vs="LitSolid_NormalEnvCubeHeightFog" ps="LitSolid_DiffNormalEnvCubeHeightFogMaterial" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vs="LitSolid_NormalEnvCubeHeightFog" ps="LitSolid_DiffNormalEnvCubeHeightFogDeferred" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/DiffNormalHeightFog.xml

@@ -1,10 +0,0 @@
-<technique sm3="true">
-    <pass name="base" vs="LitSolid_HeightFog" ps="LitSolid_DiffHeightFog" />
-    <pass name="litbase" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalAmbientHeightFog" />
-    <pass name="light" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalHeightFog" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalHeightFogPrepass" />
-    <pass name="material" vs="LitSolid_HeightFog" ps="LitSolid_DiffHeightFogMaterial" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalHeightFogDeferred" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 7 - 7
Bin/CoreData/Techniques/DiffNormalPacked.xml

@@ -1,10 +1,10 @@
-<technique>
-    <pass name="base" vs="LitSolid" ps="LitSolid_Diff" />
-    <pass name="litbase" vs="LitSolid_Normal" ps="LitSolid_DiffNormalPackedAmbient" />
-    <pass name="light" vs="LitSolid_Normal" ps="LitSolid_DiffNormalPacked" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vs="LitSolid_Normal" ps="LitSolid_DiffNormalPackedPrepass" />
-    <pass name="material" vs="LitSolid" ps="LitSolid_DiffMaterial" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vs="LitSolid_Normal" ps="LitSolid_DiffNormalPackedDeferred" />
+<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP">
+    <pass name="base" />
+    <pass name="litbase" vsdefines="NORMALMAP" psdefines="AMBIENT NORMALMAP PACKEDNORMAL" />
+    <pass name="light" vsdefines="NORMALMAP" psdefines="NORMALMAP PACKEDNORMAL" depthtest="equal" depthwrite="false" blend="add" />
+    <pass name="prepass" vsdefines="NORMALMAP" psdefines="PREPASS NORMALMAP PACKEDNORMAL" />
+    <pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
+    <pass name="deferred" vsdefines="NORMALMAP" psdefines="DEFERRED NORMALMAP PACKEDNORMAL" />
     <pass name="depth" vs="Depth" ps="Depth" />
     <pass name="depth" vs="Depth" ps="Depth" />
     <pass name="shadow" vs="Shadow" ps="Shadow" />
     <pass name="shadow" vs="Shadow" ps="Shadow" />
 </technique>
 </technique>

+ 0 - 5
Bin/CoreData/Techniques/DiffNormalPackedAlphaHeightFog.xml

@@ -1,5 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="LitSolid_v" ps="LitSolid_DiffHeightFog" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedHeightFog" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/DiffNormalPackedAlphaMaskHeightFog.xml

@@ -1,10 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="LitSolid_HeightFog" ps="LitSolid_DiffAlphaMaskHeightFog" alphamask="true" />
-    <pass name="litbase" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedAlphaMaskAmbientHeightFog" alphamask="true" />
-    <pass name="light" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedAlphaMaskHeightFog" depthtest="equal" depthwrite="false" blend="add" alphamask="true" />
-    <pass name="prepass" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedAlphaMaskHeightFogPrepass" alphamask="true" />
-    <pass name="material" vs="LitSolid" ps="LitSolid_DiffAlphaMaskMaterial" depthtest="equal" depthwrite="false" alphamask="true" />
-    <pass name="deferred" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedAlphaMaskHeightFogDeferred" alphamask="true" />
-    <pass name="depth" vs="Depth" ps="Depth_AlphaMask" alphamask="true" />
-    <pass name="shadow" vs="Shadow" ps="Shadow_AlphaMask" alphamask="true" />
-</technique>

+ 0 - 9
Bin/CoreData/Techniques/DiffNormalPackedEnvCubeHeightFog.xml

@@ -1,9 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="LitSolid_NormalEnvCubeHeightFog" ps="LitSolid_DiffNormalPackedEnvCubeHeightFog" />
-    <pass name="light" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedHeightFog" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedHeightFogPrepass" />
-    <pass name="material" vs="LitSolid_NormalEnvCubeHeightFog" ps="LitSolid_DiffNormalPackedEnvCubeHeightFogMaterial" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vs="LitSolid_NormalEnvCubeHeightFog" ps="LitSolid_DiffNormalPackedEnvCubeHeightFogDeferred" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/DiffNormalPackedHeightFog.xml

@@ -1,10 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="LitSolid_HeightFog" ps="LitSolid_DiffHeightFog" />
-    <pass name="litbase" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedAmbientHeightFog" />
-    <pass name="light" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedHeightFog" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedHeightFogPrepass" />
-    <pass name="material" vs="LitSolid_HeightFog" ps="LitSolid_DiffHeightFogMaterial" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedHeightFogDeferred" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/DiffNormalPackedSpecAlphaHeightFog.xml

@@ -1,5 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="LitSolid_HeightFog" ps="LitSolid_DiffHeightFog" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedSpecMapHeightFog" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/DiffNormalPackedSpecAlphaMaskHeightFog.xml

@@ -1,10 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="LitSolid_HeightFog" ps="LitSolid_DiffAlphaMaskHeightFog" alphamask="true" />
-    <pass name="litbase" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedSpecMapAlphaMaskAmbientHeightFog" alphamask="true" />
-    <pass name="light" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedSpecMapAlphaMaskHeightFog" depthtest="equal" depthwrite="false" blend="add" alphamask="true" />
-    <pass name="prepass" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedSpecMapAlphaMaskHeightFogPrepass" alphamask="true" />
-    <pass name="material" vs="LitSolid_HeightFog" ps="LitSolid_DiffSpecMapAlphaMaskHeightFogMaterial" depthtest="equal" depthwrite="false" alphamask="true" />
-    <pass name="deferred" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedSpecMapAlphaMaskHeightFogDeferred" alphamask="true" />
-    <pass name="depth" vs="Depth" ps="Depth_AlphaMask" alphamask="true" />
-    <pass name="shadow" vs="Shadow" ps="Shadow_AlphaMask" alphamask="true" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/DiffNormalPackedSpecHeightFog.xml

@@ -1,10 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="LitSolid_HeightFog" ps="LitSolid_DiffHeightFog" />
-    <pass name="litbase" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedSpecMapAmbientHeightFog" />
-    <pass name="light" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedSpecMapHeightFog" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedSpecMapHeightFogPrepass" />
-    <pass name="material" vs="LitSolid_HeightFog" ps="LitSolid_DiffSpecMapMaterial" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalPackedSpecMapHeightFogDeferred" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/DiffNormalSpecAlphaHeightFog.xml

@@ -1,5 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="LitSolid_HeightFog" ps="LitSolid_DiffHeightFog" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalSpecMapHeightFog" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/DiffNormalSpecAlphaMaskHeightFog.xml

@@ -1,10 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="LitSolid_HeightFog" ps="LitSolid_DiffAlphaMaskHeightFog" alphamask="true" />
-    <pass name="litbase" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalSpecMapAlphaMaskAmbientHeightFog" alphamask="true" />
-    <pass name="light" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalSpecMapAlphaMask" depthtest="equal" depthwrite="false" blend="add" alphamask="true" />
-    <pass name="prepass" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalSpecMapAlphaMaskHeightFogPrepass" alphamask="true" />
-    <pass name="material" vs="LitSolid_HeightFog" ps="LitSolid_DiffSpecMapAlphaMaskHeightFogMaterial" depthtest="equal" depthwrite="false" alphamask="true" />
-    <pass name="deferred" vs="LitSolid_NormalHeightFog" ps="LitSolid_DiffNormalSpecMapAlphaMaskHeightFogDeferred" alphamask="true" />
-    <pass name="depth" vs="Depth" ps="Depth_AlphaMask" alphamask="true" />
-    <pass name="shadow" vs="Shadow" ps="Shadow_AlphaMask" alphamask="true" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/DiffSpecAlphaHeightFog.xml

@@ -1,5 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="LitSolid_HeightFog" ps="LitSolid_DiffHeightFog" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vs="LitSolid_HeightFog" ps="LitSolid_DiffSpecMapHeightFog" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/DiffSpecAlphaMaskHeightFog.xml

@@ -1,10 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="LitSolid_HeightFog" ps="LitSolid_DiffAlphaMaskHeightFog" alphamask="true" />
-    <pass name="litbase" vs="LitSolid_HeightFog" ps="LitSolid_DiffSpecMapAlphaMaskAmbientHeightFog" alphamask="true" />
-    <pass name="light" vs="LitSolid_HeightFog" ps="LitSolid_DiffSpecMapAlphaMaskHeightFog"  depthtest="equal" depthwrite="false" blend="add" alphamask="true" />
-    <pass name="prepass" vs="LitSolid_HeightFog" ps="LitSolid_DiffSpecMapAlphaMaskHeightFogPrepass" alphamask="true" />
-    <pass name="material" vs="LitSolid_HeightFog" ps="LitSolid_DiffSpecMapAlphaMaskHeightFogMaterial" depthtest="equal" depthwrite="false" alphamask="true" />
-    <pass name="deferred" vs="LitSolid_HeightFog" ps="LitSolid_DiffSpecMapAlphaMaskHeightFogDeferred" alphamask="true" />
-    <pass name="depth" vs="Depth" ps="Depth_AlphaMask" alphamask="true" />
-    <pass name="shadow" vs="Shadow" ps="Shadow_AlphaMask" alphamask="true" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/DiffSpecHeightFog.xml

@@ -1,10 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="LitSolid_HeightFog" ps="LitSolid_DiffHeightFog" />
-    <pass name="litbase" vs="LitSolid_HeightFog" ps="LitSolid_DiffSpecMapAmbientHeightFog" />
-    <pass name="light" vs="LitSolid_HeightFog" ps="LitSolid_DiffSpecMapHeightFog" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vs="LitSolid_HeightFog" ps="LitSolid_DiffSpecMapHeightFogPrepass" />
-    <pass name="material" vs="LitSolid_HeightFog" ps="LitSolid_DiffSpecMapHeightFogMaterial" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vs="LitSolid_HeightFog" ps="LitSolid_DiffSpecMapHeightFogDeferred" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 3
Bin/CoreData/Techniques/DiffUnlitAlphaHeightFog.xml

@@ -1,3 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="Unli_HeightFog" ps="Unlit_DiffHeightFog" depthwrite="false" blend="alpha" />
-</technique>

+ 0 - 3
Bin/CoreData/Techniques/DiffUnlitHeightFog.xml

@@ -1,3 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="Unlit_HeightFog" ps="Unlit_DiffHeightFog" />
-</technique>

+ 7 - 7
Bin/CoreData/Techniques/NoTexture.xml

@@ -1,10 +1,10 @@
-<technique>
-    <pass name="base" vs="LitSolid" ps="LitSolid" />
-    <pass name="litbase" vs="LitSolid" ps="LitSolid_Ambient" />
-    <pass name="light" vs="LitSolid" ps="LitSolid" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vs="LitSolid" ps="LitSolid_Prepass" />
-    <pass name="material" vs="LitSolid" ps="LitSolid_Material" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vs="LitSolid" ps="LitSolid_Deferred" />
+<technique vs="LitSolid" ps="LitSolid">
+    <pass name="base" />
+    <pass name="litbase" psdefines="AMBIENT" />
+    <pass name="light" depthtest="equal" depthwrite="false" blend="add" />
+    <pass name="prepass" psdefines="PREPASS" />
+    <pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
+    <pass name="deferred" psdefines="DEFERRED" />
     <pass name="depth" vs="Depth" ps="Depth" />
     <pass name="depth" vs="Depth" ps="Depth" />
     <pass name="shadow" vs="Shadow" ps="Shadow" />
     <pass name="shadow" vs="Shadow" ps="Shadow" />
 </technique>
 </technique>

+ 2 - 2
Bin/CoreData/Techniques/NoTextureAdd.xml

@@ -1,3 +1,3 @@
-<technique>
-    <pass name="alpha" vs="Unlit" ps="Unlit" depthwrite="false" blend="add" />
+<technique vs="Unlit" ps="Unlit">
+    <pass name="alpha" depthwrite="false" blend="add" />
 </technique>
 </technique>

+ 0 - 3
Bin/CoreData/Techniques/NoTextureAddHeightFog.xml

@@ -1,3 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="Unlit_HeightFog" ps="Unlit_HeightFog" depthwrite="false" blend="add" />
-</technique>

+ 3 - 3
Bin/CoreData/Techniques/NoTextureAlpha.xml

@@ -1,5 +1,5 @@
-<technique>
-    <pass name="alpha" vs="LitSolid" ps="LitSolid" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vs="LitSolid" ps="LitSolid" depthwrite="false" blend="addalpha" />
+<technique vs="LitSolid" ps="LitSolid">
+    <pass name="alpha"  depthwrite="false" blend="alpha" />
+    <pass name="litalpha" depthwrite="false" blend="addalpha" />
     <pass name="shadow" vs="Shadow" ps="Shadow" />
     <pass name="shadow" vs="Shadow" ps="Shadow" />
 </technique>
 </technique>

+ 0 - 5
Bin/CoreData/Techniques/NoTextureAlphaHeightFog.xml

@@ -1,5 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="LitSolid_HeightFog" ps="LitSolid_HeightFog" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vs="LitSolid_HeightFog" ps="LitSolid_HeightFog" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/NoTextureEnvCubeAlphaHeightFog.xml

@@ -1,5 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="LitSolid_EnvCubeHeightFog" ps="LitSolid_EnvCubeHeightFog" depthwrite="false" blend="alpha" />
-    <pass name="litalpha" vs="LitSolid_HeightFog" ps="LitSolid_HeightFog" depthwrite="false" blend="addalpha" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 9
Bin/CoreData/Techniques/NoTextureEnvCubeHeightFog.xml

@@ -1,9 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="LitSolid_EnvCubeHeightFog" ps="LitSolid_EnvCubeHeightFog" />
-    <pass name="light" vs="LitSolid_HeightFog" ps="LitSolid_HeightFog" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vs="LitSolid_HeightFog" ps="LitSolid_HeightFogPrepass" />
-    <pass name="material" vs="LitSolid_EnvCubeHeightFog" ps="LitSolid_EnvCubeHeightFogMaterial" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vs="LitSolid_EnvCubeHeightFog" ps="LitSolid_EnvCubeHeightFogDeferred" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 3
Bin/CoreData/Techniques/NoTextureUnlitAlphaHeightFog.xml

@@ -1,3 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="Unlit_HeightFog" ps="Unlit_HeightFog" depthwrite="false" blend="alpha" />
-</technique>

+ 0 - 3
Bin/CoreData/Techniques/NoTextureUnlitHeightFog.xml

@@ -1,3 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="Unlit_HeightFog" ps="Unlit_HeightFog" />
-</technique>

+ 0 - 3
Bin/CoreData/Techniques/NoTextureVColAddHeightFog.xml

@@ -1,3 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="Unlit_VColHeightFog" ps="Unlit_VColHeightFog" depthwrite="false" blend="add" />
-</technique>

+ 0 - 3
Bin/CoreData/Techniques/NoTextureVColMultiplyHeightFog.xml

@@ -1,3 +0,0 @@
-<technique sm3="true" >
-    <pass name="alpha" vs="Unlit_VColHeightFog" ps="Unlit_VColHeightFog" depthwrite="false" blend="multiply" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/TerrainBlendHeightFog.xml

@@ -1,10 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="TerrainBlend_HeightFog" ps="TerrainBlend_HeightFog" />
-    <pass name="litbase" vs="TerrainBlend_HeightFog" ps="TerrainBlend_AmbientHeightFog" />
-    <pass name="light" vs="TerrainBlend_HeightFog" ps="TerrainBlend_HeightFog" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vs="TerrainBlend_HeightFog" ps="TerrainBlend_HeightFogPrepass" />
-    <pass name="material" vs="TerrainBlend_HeightFog" ps="TerrainBlend_HeightFogMaterial" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vs="TerrainBlend_HeightFog" ps="TerrainBlend_HeightFogDeferred" />
-    <pass name="depth" vs="Depth" ps="Depth" />
-    <pass name="shadow" vs="Shadow" ps="Shadow" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/VegetationDiffAlphaMaskHeightFog.xml

@@ -1,10 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="Vegetation_HeightFog" ps="LitSolid_DiffAlphaMaskHeightFog" alphamask="true" />
-    <pass name="litbase" vs="Vegetation_HeightFog" ps="LitSolid_DiffAlphaMaskAmbientHeightFog" alphamask="true" />
-    <pass name="light" vs="Vegetation_HeightFog" ps="LitSolid_DiffAlphaMaskHeightFog"  depthtest="equal" depthwrite="false" blend="add" alphamask="true" />
-    <pass name="prepass" vs="Vegetation_HeightFog" ps="LitSolid_DiffAlphaMaskHeightFogPrepass" alphamask="true" />
-    <pass name="material" vs="Vegetation_HeightFog" ps="LitSolid_DiffAlphaMaskHeightFogMaterial" depthtest="equal" depthwrite="false" alphamask="true" />
-    <pass name="deferred" vs="Vegetation_HeightFog" ps="LitSolid_DiffAlphaMaskHeightFogDeferred" alphamask="true" />
-    <pass name="depth" vs="VegetationDepth" ps="Depth_AlphaMask" alphamask="true" />
-    <pass name="shadow" vs="VegetationShadow" ps="Shadow_AlphaMask" alphamask="true" />
-</technique>

+ 0 - 10
Bin/CoreData/Techniques/VegetationDiffHeightFog.xml

@@ -1,10 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="Vegetation_HeightFog" ps="LitSolid_DiffHeightFog" />
-    <pass name="litbase" vs="Vegetation_HeightFog" ps="LitSolid_DiffAmbientHeightFog" />
-    <pass name="light" vs="Vegetation_HeightFog" ps="LitSolid_DiffHeightFog" depthtest="equal" depthwrite="false" blend="add" />
-    <pass name="prepass" vs="Vegetation_HeightFog" ps="LitSolid_DiffHeightFogPrepass" />
-    <pass name="material" vs="Vegetation_HeightFog" ps="LitSolid_DiffHeightFogMaterial" depthtest="equal" depthwrite="false" />
-    <pass name="deferred" vs="Vegetation_HeightFog" ps="LitSolid_DiffHeightFogDeferred" />
-    <pass name="depth" vs="VegetationDepth" ps="Depth" />
-    <pass name="shadow" vs="VegetationShadow" ps="Shadow" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/VegetationDiffUnlitAlphaMaskHeightFog.xml

@@ -1,5 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="Vegetation_HeightFog" ps="Unlit_DiffAlphaMaskHeightFog" />
-    <pass name="depth" vs="VegetationDepth" ps="Depth" />
-    <pass name="shadow" vs="VegetationShadow" ps="Shadow" />
-</technique>

+ 0 - 5
Bin/CoreData/Techniques/VegetationDiffUnlitHeightFog.xml

@@ -1,5 +0,0 @@
-<technique sm3="true" >
-    <pass name="base" vs="Vegetation_HeightFog" ps="Unlit_DiffHeightFog" />
-    <pass name="depth" vs="VegetationDepth" ps="Depth" />
-    <pass name="shadow" vs="VegetationShadow" ps="Shadow" />
-</technique>

+ 18 - 4
Source/Engine/Graphics/Technique.cpp

@@ -182,6 +182,9 @@ bool Technique::Load(Deserializer& source)
         globalVSDefines += ' ';
         globalVSDefines += ' ';
     if (!globalPSDefines.Empty())
     if (!globalPSDefines.Empty())
         globalPSDefines += ' ';
         globalPSDefines += ' ';
+    bool globalAlphaMask = false;
+    if (rootElem.HasAttribute("alphamask"))
+        globalAlphaMask = rootElem.GetBool("alphamask");
     
     
     unsigned numPasses = 0;
     unsigned numPasses = 0;
     
     
@@ -194,18 +197,27 @@ bool Technique::Load(Deserializer& source)
             Pass* newPass = CreatePass(nameHash);
             Pass* newPass = CreatePass(nameHash);
             ++numPasses;
             ++numPasses;
             
             
+            // Append global defines only when pass does not redefine the shader
             if (passElem.HasAttribute("vs"))
             if (passElem.HasAttribute("vs"))
+            {
                 newPass->SetVertexShader(passElem.GetAttribute("vs"));
                 newPass->SetVertexShader(passElem.GetAttribute("vs"));
+                newPass->SetVertexShaderDefines(passElem.GetAttribute("vsdefines"));
+            }
             else
             else
+            {
                 newPass->SetVertexShader(globalVS);
                 newPass->SetVertexShader(globalVS);
-            
+                newPass->SetVertexShaderDefines(globalVSDefines + passElem.GetAttribute("vsdefines"));
+            }
             if (passElem.HasAttribute("ps"))
             if (passElem.HasAttribute("ps"))
+            {
                 newPass->SetPixelShader(passElem.GetAttribute("ps"));
                 newPass->SetPixelShader(passElem.GetAttribute("ps"));
+                newPass->SetPixelShaderDefines(passElem.GetAttribute("psdefines"));
+            }
             else
             else
+            {
                 newPass->SetPixelShader(globalPS);
                 newPass->SetPixelShader(globalPS);
-            
-            newPass->SetVertexShaderDefines(globalVSDefines + passElem.GetAttribute("psdefines"));
-            newPass->SetPixelShaderDefines(globalPSDefines + passElem.GetAttribute("vsdefines"));
+                newPass->SetPixelShaderDefines(globalPSDefines + passElem.GetAttribute("psdefines"));
+            }
             
             
             if (passElem.HasAttribute("lighting"))
             if (passElem.HasAttribute("lighting"))
             {
             {
@@ -234,6 +246,8 @@ bool Technique::Load(Deserializer& source)
             
             
             if (passElem.HasAttribute("alphamask"))
             if (passElem.HasAttribute("alphamask"))
                 newPass->SetAlphaMask(passElem.GetBool("alphamask"));
                 newPass->SetAlphaMask(passElem.GetBool("alphamask"));
+            else
+                newPass->SetAlphaMask(globalAlphaMask);
         }
         }
         else
         else
             LOGERROR("Missing pass name");
             LOGERROR("Missing pass name");