Sfoglia il codice sorgente

Fixed unlit shaders possibly referring to nonexistent vertex normal, causing the D3D debug runtime to complain.
Set z = w in skybox vertex shader, instead of rewriting depth in the pixel shader.
Fixed GLSL shaders.

Lasse Öörni 14 anni fa
parent
commit
b7c32f5887

+ 1 - 1
Bin/CoreData/Techniques/DiffSkybox.xml

@@ -1,3 +1,3 @@
 <technique>
 <technique>
-    <pass name="extra" vs="Forward" ps="Forward_DiffUnlit" depthwrite="false" />
+    <pass name="extra" vs="Forward_Unlit" ps="Forward_DiffUnlit" depthwrite="false" />
 </technique>
 </technique>

+ 1 - 1
Bin/CoreData/Techniques/DiffUnlitAlpha.xml

@@ -1,3 +1,3 @@
 <technique>
 <technique>
-    <pass name="base" vs="Forward" ps="Forward_DiffUnlit" depthwrite="false" blend="alpha" />
+    <pass name="base" vs="Forward_Unlit" ps="Forward_DiffUnlit" depthwrite="false" blend="alpha" />
 </technique>
 </technique>

+ 25 - 23
SourceAssets/GLSLShaders/Forward.frag

@@ -4,30 +4,32 @@
 #include "Fog.frag"
 #include "Fog.frag"
 
 
 varying vec2 vTexCoord;
 varying vec2 vTexCoord;
-varying vec4 vLightVec;
-#ifdef SPECULAR
-varying vec3 vEyeVec;
-#endif
-#ifndef NORMALMAP
-varying vec3 vNormal;
-#endif
-#ifdef SHADOW
-#if defined(DIRLIGHT)
-varying vec4 vShadowPos[4];
-#elif defined(SPOTLIGHT)
-varying vec4 vShadowPos;
-#else
-varying vec3 vWorldLightVec;
-#endif
-#endif
-#ifdef SPOTLIGHT
-varying vec4 vSpotPos;
-#endif
-#ifdef CUBEMASK
-varying vec3 vCubeMaskVec;
-#endif
 #ifdef VERTEXCOLOR
 #ifdef VERTEXCOLOR
-varying vec4 vColor;
+    varying vec4 vColor;
+#endif
+varying vec4 vLightVec;
+#ifndef UNLIT
+    #ifdef SPECULAR
+        varying vec3 vEyeVec;
+    #endif
+    #ifndef NORMALMAP
+        varying vec3 vNormal;
+    #endif
+    #ifdef SHADOW
+        #if defined(DIRLIGHT)
+            varying vec4 vShadowPos[4];
+        #elif defined(SPOTLIGHT)
+            varying vec4 vShadowPos;
+        #else
+            varying vec3 vWorldLightVec;
+        #endif
+    #endif
+    #ifdef SPOTLIGHT
+        varying vec4 vSpotPos;
+    #endif
+    #ifdef POINTLIGHT
+        varying vec3 vCubeMaskVec;
+    #endif
 #endif
 #endif
 
 
 void main()
 void main()

+ 97 - 79
SourceAssets/GLSLShaders/Forward.vert

@@ -2,103 +2,121 @@
 #include "Transform.vert"
 #include "Transform.vert"
 
 
 varying vec2 vTexCoord;
 varying vec2 vTexCoord;
-varying vec4 vLightVec;
-#ifdef SPECULAR
-varying vec3 vEyeVec;
-#endif
-#ifndef NORMALMAP
-varying vec3 vNormal;
-#endif
-#ifdef SHADOW
-#if defined(DIRLIGHT)
-varying vec4 vShadowPos[4];
-#elif defined(SPOTLIGHT)
-varying vec4 vShadowPos;
-#else
-varying vec3 vWorldLightVec;
-#endif
-#endif
-#ifdef SPOTLIGHT
-varying vec4 vSpotPos;
-#endif
-#ifdef POINTLIGHT
-varying vec3 vCubeMaskVec;
-#endif
 #ifdef VERTEXCOLOR
 #ifdef VERTEXCOLOR
-varying vec4 vColor;
+    varying vec4 vColor;
+#endif
+varying vec4 vLightVec;
+#ifndef UNLIT
+    #ifdef SPECULAR
+        varying vec3 vEyeVec;
+    #endif
+    #ifndef NORMALMAP
+        varying vec3 vNormal;
+    #endif
+    #ifdef SHADOW
+        #if defined(DIRLIGHT)
+            varying vec4 vShadowPos[4];
+        #elif defined(SPOTLIGHT)
+            varying vec4 vShadowPos;
+        #else
+            varying vec3 vWorldLightVec;
+        #endif
+    #endif
+    #ifdef SPOTLIGHT
+        varying vec4 vSpotPos;
+    #endif
+    #ifdef POINTLIGHT
+        varying vec3 vCubeMaskVec;
+    #endif
 #endif
 #endif
 
 
 void main()
 void main()
 {
 {
     vec4 pos;
     vec4 pos;
 
 
-    #ifdef NORMALMAP
-        vec3 vNormal;
-        vec3 vTangent;
-        vec3 vBitangent;
-    #endif
+    #ifndef UNLIT
 
 
-    #if defined(SKINNED)
-        #ifndef NORMALMAP
-            pos = GetPositionNormalSkinned(iPosition, iNormal, iBlendWeights, iBlendIndices, gl_Position, vNormal);
+        #ifdef NORMALMAP
+            vec3 vNormal;
+            vec3 vTangent;
+            vec3 vBitangent;
+        #endif
+    
+        #if defined(SKINNED)
+            #ifndef NORMALMAP
+                pos = GetPositionNormalSkinned(iPosition, iNormal, iBlendWeights, iBlendIndices, gl_Position, vNormal);
+            #else
+                pos = GetPositionNormalTangentSkinned(iPosition, iNormal, iTangent, iBlendWeights, iBlendIndices, gl_Position, vNormal, vTangent);
+            #endif
+        #elif defined(BILLBOARD)
+            pos = GetPositionBillboard(iPosition, iTexCoord2, gl_Position);
+            vNormal = vec3(-cCameraRot[2][0], -cCameraRot[2][1], -cCameraRot[2][2]);
         #else
         #else
-            pos = GetPositionNormalTangentSkinned(iPosition, iNormal, iTangent, iBlendWeights, iBlendIndices, gl_Position, vNormal, vTangent);
+            #ifndef NORMALMAP
+                pos = GetPositionNormal(iPosition, iNormal, gl_Position, vNormal);
+            #else
+                pos = GetPositionNormalTangent(iPosition, iNormal, iTangent, gl_Position, vNormal, vTangent);
+            #endif
         #endif
         #endif
-    #elif defined(BILLBOARD)
-        pos = GetPositionBillboard(iPosition, iTexCoord2, gl_Position);
-        vNormal = vec3(-cCameraRot[2][0], -cCameraRot[2][1], -cCameraRot[2][2]);
-    #else
-        #ifndef NORMALMAP
-            pos = GetPositionNormal(iPosition, iNormal, gl_Position, vNormal);
+    
+        vec3 worldPos = pos.xyz - cCameraPos;
+    
+        #if defined(DIRLIGHT)
+            vLightVec = vec4(cLightDir, GetDepth(gl_Position));
+        #elif defined(LIGHT)
+            vLightVec = vec4((cLightPos - worldPos) * cLightAtten, GetDepth(gl_Position));
         #else
         #else
-            pos = GetPositionNormalTangent(iPosition, iNormal, iTangent, gl_Position, vNormal, vTangent);
+            vLightVec = vec4(0.0, 0.0, 0.0, GetDepth(gl_Position));
+        #endif
+    
+        #ifdef SHADOW
+            // Shadow projection: transform from world space to shadow space
+            #if defined(DIRLIGHT)
+                vShadowPos[0] = cShadowProj[0] * pos;
+                vShadowPos[1] = cShadowProj[1] * pos;
+                vShadowPos[2] = cShadowProj[2] * pos;
+                vShadowPos[3] = cShadowProj[3] * pos;
+            #elif defined(SPOTLIGHT)
+                vShadowPos = cShadowProj[0] * pos;
+            #else
+                vWorldLightVec = worldPos - cLightPos;
+            #endif
+        #endif
+    
+        #ifdef SPOTLIGHT
+            // Spotlight projection: transform from world space to projector texture coordinates
+            vSpotPos = cSpotProj * pos;
+        #endif
+    
+        #ifdef POINTLIGHT
+            vCubeMaskVec = cLightVecRot * vLightVec.xyz;
         #endif
         #endif
-    #endif
-
-    vec3 worldPos = pos.xyz - cCameraPos;
 
 
-    #if defined(DIRLIGHT)
-        vLightVec = vec4(cLightDir, GetDepth(gl_Position));
-    #elif defined(LIGHT)
-        vLightVec = vec4((cLightPos - worldPos) * cLightAtten, GetDepth(gl_Position));
+        #ifdef NORMALMAP
+            vBitangent = cross(vTangent, vNormal) * iTangent.w;
+            mat3 tbn = mat3(vTangent, vBitangent, vNormal);
+            #ifdef LIGHT
+                vLightVec.xyz = vLightVec.xyz * tbn;
+            #endif
+            #ifdef SPECULAR
+                vEyeVec = -worldPos * tbn;
+            #endif
+        #elif defined(SPECULAR)
+            vEyeVec = -worldPos;
+        #endif
+        
     #else
     #else
-        vLightVec = vec4(0.0, 0.0, 0.0, GetDepth(gl_Position));
-    #endif
-
-    #ifdef SHADOW
-        // Shadow projection: transform from world space to shadow space
-        #if defined(DIRLIGHT)
-            vShadowPos[0] = cShadowProj[0] * pos;
-            vShadowPos[1] = cShadowProj[1] * pos;
-            vShadowPos[2] = cShadowProj[2] * pos;
-            vShadowPos[3] = cShadowProj[3] * pos;
-        #elif defined(SPOTLIGHT)
-            vShadowPos = cShadowProj[0] * pos;
+    
+        #if defined(SKINNED)
+            pos = GetPositionSkinned(iPosition, iBlendWeights, iBlendIndices, gl_Position);
+        #elif defined(BILLBOARD)
+            pos = GetPositionBillboard(iPosition, iTexCoord2, gl_Position);
         #else
         #else
-            vWorldLightVec = worldPos - cLightPos;
+            pos = GetPosition(iPosition, gl_Position);
         #endif
         #endif
-    #endif
-
-    #ifdef SPOTLIGHT
-        // Spotlight projection: transform from world space to projector texture coordinates
-        vSpotPos = cSpotProj * pos;
-    #endif
 
 
-    #ifdef POINTLIGHT
-        vCubeMaskVec = cLightVecRot * vLightVec.xyz;
-    #endif
+        vLightVec = vec4(0.0, 0.0, 0.0, GetDepth(gl_Position));
 
 
-    #ifdef NORMALMAP
-        vBitangent = cross(vTangent, vNormal) * iTangent.w;
-        mat3 tbn = mat3(vTangent, vBitangent, vNormal);
-        #ifdef LIGHT
-            vLightVec.xyz = vLightVec.xyz * tbn;
-        #endif
-        #ifdef SPECULAR
-            vEyeVec = -worldPos * tbn;
-        #endif
-    #elif defined(SPECULAR)
-        vEyeVec = -worldPos;
     #endif
     #endif
 
 
     #ifdef VERTEXCOLOR
     #ifdef VERTEXCOLOR

+ 11 - 3
SourceAssets/GLSLShaders/Forward.xml

@@ -6,13 +6,13 @@
             <define name="LIGHT" />
             <define name="LIGHT" />
             <define name="DIRLIGHT" />
             <define name="DIRLIGHT" />
             <exclude name="Spot" />
             <exclude name="Spot" />
-            <exclude name="PointMask" />
+            <exclude name="Point" />
         </option>
         </option>
         <option name="Spot">
         <option name="Spot">
             <define name="LIGHT" />
             <define name="LIGHT" />
             <define name="SPOTLIGHT" />
             <define name="SPOTLIGHT" />
             <exclude name="Dir" />
             <exclude name="Dir" />
-            <exclude name="PointMask" />
+            <exclude name="Point" />
         </option>
         </option>
         <option name="Point">
         <option name="Point">
             <define name="LIGHT" />
             <define name="LIGHT" />
@@ -20,8 +20,16 @@
             <exclude name="Dir" />
             <exclude name="Dir" />
             <exclude name="Spot" />
             <exclude name="Spot" />
         </option>
         </option>
-        <option name="Spec" define="SPECULAR" />        
+        <option name="Spec" define="SPECULAR" />
         <option name="Shadow" define="SHADOW" />
         <option name="Shadow" define="SHADOW" />
+        <option name="Unlit" define="UNLIT">
+            <exclude name="Normal" />
+            <exclude name="Dir" />
+            <exclude name="Spot" />
+            <exclude name="Point" />
+            <exclude name="Spec" />
+            <exclude name="Shadow" />
+        </option>
         <variation name="" />
         <variation name="" />
         <variation name="Skinned" define="SKINNED" />
         <variation name="Skinned" define="SKINNED" />
         <variation name="Billboard" define="BILLBOARD">
         <variation name="Billboard" define="BILLBOARD">

+ 1 - 1
SourceAssets/GLSLShaders/Lighting.frag

@@ -3,7 +3,7 @@ float GetDiffuseDir(vec3 normal, vec3 lightDir)
     return max(dot(normal, lightDir), 0.0);
     return max(dot(normal, lightDir), 0.0);
 }
 }
 
 
-float GetDiffusePointOrSpot(vec3 normal, vec3 lightVec, out vec3 lightDir, out float NdotL)
+float GetDiffusePointOrSpot(vec3 normal, vec3 lightVec, out vec3 lightDir)
 {
 {
     float lightDist = length(lightVec);
     float lightDist = length(lightVec);
     lightDir = lightVec / lightDist;
     lightDir = lightVec / lightDist;

+ 1 - 1
SourceAssets/GLSLShaders/Shadow.frag

@@ -2,7 +2,7 @@
 #include "Samplers.frag"
 #include "Samplers.frag"
 
 
 #ifdef ALPHAMASK
 #ifdef ALPHAMASK
-varying vec2 vTexCoord;
+    varying vec2 vTexCoord;
 #endif
 #endif
 
 
 void main()
 void main()

+ 1 - 1
SourceAssets/GLSLShaders/Shadow.vert

@@ -2,7 +2,7 @@
 #include "Transform.vert"
 #include "Transform.vert"
 
 
 #ifdef ALPHAMASK
 #ifdef ALPHAMASK
-varying vec2 vTexCoord;
+    varying vec2 vTexCoord;
 #endif
 #endif
 
 
 void main()
 void main()

+ 0 - 1
SourceAssets/GLSLShaders/Skybox.frag

@@ -6,5 +6,4 @@ varying vec3 vTexCoord;
 void main()
 void main()
 {
 {
     gl_FragColor = cMatDiffColor * textureCube(sDiffCubeMap, vTexCoord);
     gl_FragColor = cMatDiffColor * textureCube(sDiffCubeMap, vTexCoord);
-    gl_FragDepth = 1.0;
 }
 }

+ 1 - 0
SourceAssets/GLSLShaders/Skybox.vert

@@ -6,5 +6,6 @@ varying vec3 vTexCoord;
 void main()
 void main()
 {
 {
     GetPosition(iPosition, gl_Position);
     GetPosition(iPosition, gl_Position);
+    gl_Position.z = gl_Position.w;
     vTexCoord = iPosition.xyz;
     vTexCoord = iPosition.xyz;
 }
 }

+ 101 - 81
SourceAssets/HLSLShaders/Forward.hlsl

@@ -21,26 +21,28 @@ void VS(float4 iPos : POSITION,
         float2 iSize : TEXCOORD1,
         float2 iSize : TEXCOORD1,
     #endif
     #endif
     out float4 oLightVec : TEXCOORD1,
     out float4 oLightVec : TEXCOORD1,
-    #ifndef NORMALMAP
-        out float3 oNormal : TEXCOORD2,
-    #endif
-    #ifdef SPECULAR
-        out float3 oEyeVec : TEXCOORD3,
-    #endif
-    #ifdef SHADOW
-        #if defined(DIRLIGHT)
-            out float4 oShadowPos[4] : TEXCOORD4,
-        #elif defined(SPOTLIGHT)
-            out float4 oShadowPos : TEXCOORD4,
-        #else
-            out float3 oWorldLightVec : TEXCOORD4,
+    #ifndef UNLIT
+        #ifndef NORMALMAP
+            out float3 oNormal : TEXCOORD2,
+        #endif
+        #ifdef SPECULAR
+            out float3 oEyeVec : TEXCOORD3,
+        #endif
+        #ifdef SHADOW
+            #if defined(DIRLIGHT)
+                out float4 oShadowPos[4] : TEXCOORD4,
+            #elif defined(SPOTLIGHT)
+                out float4 oShadowPos : TEXCOORD4,
+            #else
+                out float3 oWorldLightVec : TEXCOORD4,
+            #endif
+        #endif
+        #ifdef SPOTLIGHT
+            out float4 oSpotPos : TEXCOORD5,
+        #endif
+        #ifdef POINTLIGHT
+            out float3 oCubeMaskVec : TEXCOORD5,
         #endif
         #endif
-    #endif
-    #ifdef SPOTLIGHT
-        out float4 oSpotPos : TEXCOORD5,
-    #endif
-    #ifdef POINTLIGHT
-        out float3 oCubeMaskVec : TEXCOORD5,
     #endif
     #endif
     #ifdef VERTEXCOLOR
     #ifdef VERTEXCOLOR
         float4 iColor : COLOR0,
         float4 iColor : COLOR0,
@@ -51,79 +53,97 @@ void VS(float4 iPos : POSITION,
 {
 {
     float4 pos;
     float4 pos;
 
 
-    #ifdef NORMALMAP
-        float3 oNormal;
-        float3 oTangent;
-        float3 oBitangent;
-    #endif
+    #ifndef UNLIT
 
 
-    #if defined(SKINNED)
-        #ifndef NORMALMAP
-            pos = GetPositionNormalSkinned(iPos, iNormal, iBlendWeights, iBlendIndices, oPos, oNormal);
-        #else
-            pos = GetPositionNormalTangentSkinned(iPos, iNormal, iTangent, iBlendWeights, iBlendIndices, oPos, oNormal, oTangent);
+        #ifdef NORMALMAP
+            float3 oNormal;
+            float3 oTangent;
+            float3 oBitangent;
         #endif
         #endif
-    #elif defined(INSTANCED)
-        #ifndef NORMALMAP
-            pos = GetPositionNormalInstanced(iPos, iNormal, iModelInstance, oPos, oNormal);
+    
+        #if defined(SKINNED)
+            #ifndef NORMALMAP
+                pos = GetPositionNormalSkinned(iPos, iNormal, iBlendWeights, iBlendIndices, oPos, oNormal);
+            #else
+                pos = GetPositionNormalTangentSkinned(iPos, iNormal, iTangent, iBlendWeights, iBlendIndices, oPos, oNormal, oTangent);
+            #endif
+        #elif defined(INSTANCED)
+            #ifndef NORMALMAP
+                pos = GetPositionNormalInstanced(iPos, iNormal, iModelInstance, oPos, oNormal);
+            #else
+                pos = GetPositionNormalTangentInstanced(iPos, iNormal, iTangent, iModelInstance, oPos, oNormal, oTangent);
+            #endif
+        #elif defined(BILLBOARD)
+            pos = GetPositionBillboard(iPos, iSize, oPos);
+            oNormal = float3(-cCameraRot[2][0], -cCameraRot[2][1], -cCameraRot[2][2]);
         #else
         #else
-            pos = GetPositionNormalTangentInstanced(iPos, iNormal, iTangent, iModelInstance, oPos, oNormal, oTangent);
+            #ifndef NORMALMAP
+                pos = GetPositionNormal(iPos, iNormal, oPos, oNormal);
+            #else
+                pos = GetPositionNormalTangent(iPos, iNormal, iTangent, oPos, oNormal, oTangent);
+            #endif
         #endif
         #endif
-    #elif defined(BILLBOARD)
-        pos = GetPositionBillboard(iPos, iSize, oPos);
-        oNormal = float3(-cCameraRot[2][0], -cCameraRot[2][1], -cCameraRot[2][2]);
-    #else
-        #ifndef NORMALMAP
-            pos = GetPositionNormal(iPos, iNormal, oPos, oNormal);
+    
+        float3 worldPos = pos.xyz - cCameraPos;
+    
+        #ifdef DIRLIGHT
+            oLightVec = float4(cLightDir, GetDepth(oPos));
+        #elif defined(LIGHT)
+            oLightVec = float4((cLightPos - worldPos) * cLightAtten, GetDepth(oPos));
         #else
         #else
-            pos = GetPositionNormalTangent(iPos, iNormal, iTangent, oPos, oNormal, oTangent);
+            oLightVec = float4(0.0, 0.0, 0.0, GetDepth(oPos));
+        #endif
+    
+        #ifdef SHADOW
+            // Shadow projection: transform from world space to shadow space
+            #if defined(DIRLIGHT)
+                oShadowPos[0] = mul(pos, cShadowProj[0]);
+                oShadowPos[1] = mul(pos, cShadowProj[1]);
+                oShadowPos[2] = mul(pos, cShadowProj[2]);
+                oShadowPos[3] = mul(pos, cShadowProj[3]);
+            #elif defined(SPOTLIGHT)
+                oShadowPos = mul(pos, cShadowProj[0]);
+            #else
+                oWorldLightVec = worldPos - cLightPos;
+            #endif
+        #endif
+    
+        #ifdef SPOTLIGHT
+            // Spotlight projection: transform from world space to projector texture coordinates
+            oSpotPos = mul(pos, cSpotProj);
+        #endif
+    
+        #ifdef POINTLIGHT
+            oCubeMaskVec = mul(oLightVec.xyz, cLightVecRot);
+        #endif
+    
+        #ifdef NORMALMAP
+            oBitangent = cross(oTangent, oNormal) * iTangent.w;
+            float3x3 tbn = float3x3(oTangent, oBitangent, oNormal);
+            #ifdef LIGHT
+                oLightVec.xyz = mul(tbn, oLightVec.xyz);
+            #endif
+            #ifdef SPECULAR
+                oEyeVec = mul(tbn, -worldPos);
+            #endif
+        #elif defined(SPECULAR)
+            oEyeVec = -worldPos;
         #endif
         #endif
-    #endif
-
-    float3 worldPos = pos.xyz - cCameraPos;
 
 
-    #ifdef DIRLIGHT
-        oLightVec = float4(cLightDir, GetDepth(oPos));
-    #elif defined(LIGHT)
-        oLightVec = float4((cLightPos - worldPos) * cLightAtten, GetDepth(oPos));
     #else
     #else
-        oLightVec = float4(0.0, 0.0, 0.0, GetDepth(oPos));
-    #endif
-
-    #ifdef SHADOW
-        // Shadow projection: transform from world space to shadow space
-        #if defined(DIRLIGHT)
-            oShadowPos[0] = mul(pos, cShadowProj[0]);
-            oShadowPos[1] = mul(pos, cShadowProj[1]);
-            oShadowPos[2] = mul(pos, cShadowProj[2]);
-            oShadowPos[3] = mul(pos, cShadowProj[3]);
-        #elif defined(SPOTLIGHT)
-            oShadowPos = mul(pos, cShadowProj[0]);
+    
+        #if defined(SKINNED)
+            pos = GetPositionSkinned(iPos, iBlendWeights, iBlendIndices, oPos);
+        #elif defined(INSTANCED)
+            pos = GetPositionInstanced(iPos, iModelInstance, oPos);
+        #elif defined(BILLBOARD)
+            pos = GetPositionBillboard(iPos, iSize, oPos);
         #else
         #else
-            oWorldLightVec = worldPos - cLightPos;
+            pos = GetPosition(iPos, oPos);
         #endif
         #endif
-    #endif
-
-    #ifdef SPOTLIGHT
-        // Spotlight projection: transform from world space to projector texture coordinates
-        oSpotPos = mul(pos, cSpotProj);
-    #endif
-
-    #ifdef POINTLIGHT
-        oCubeMaskVec = mul(oLightVec.xyz, cLightVecRot);
-    #endif
+        
+        oLightVec = float4(0.0, 0.0, 0.0, GetDepth(oPos));
 
 
-    #ifdef NORMALMAP
-        oBitangent = cross(oTangent, oNormal) * iTangent.w;
-        float3x3 tbn = float3x3(oTangent, oBitangent, oNormal);
-        #ifdef LIGHT
-            oLightVec.xyz = mul(tbn, oLightVec.xyz);
-        #endif
-        #ifdef SPECULAR
-            oEyeVec = mul(tbn, -worldPos);
-        #endif
-    #elif defined(SPECULAR)
-        oEyeVec = -worldPos;
     #endif
     #endif
 
 
     #ifdef VERTEXCOLOR
     #ifdef VERTEXCOLOR

+ 10 - 2
SourceAssets/HLSLShaders/Forward.xml

@@ -6,13 +6,13 @@
             <define name="LIGHT" />
             <define name="LIGHT" />
             <define name="DIRLIGHT" />
             <define name="DIRLIGHT" />
             <exclude name="Spot" />
             <exclude name="Spot" />
-            <exclude name="PointMask" />
+            <exclude name="Point" />
         </option>
         </option>
         <option name="Spot">
         <option name="Spot">
             <define name="LIGHT" />
             <define name="LIGHT" />
             <define name="SPOTLIGHT" />
             <define name="SPOTLIGHT" />
             <exclude name="Dir" />
             <exclude name="Dir" />
-            <exclude name="PointMask" />
+            <exclude name="Point" />
         </option>
         </option>
         <option name="Point">
         <option name="Point">
             <define name="LIGHT" />
             <define name="LIGHT" />
@@ -22,6 +22,14 @@
         </option>
         </option>
         <option name="Spec" define="SPECULAR" />
         <option name="Spec" define="SPECULAR" />
         <option name="Shadow" define="SHADOW" />
         <option name="Shadow" define="SHADOW" />
+        <option name="Unlit" define="UNLIT">
+            <exclude name="Normal" />
+            <exclude name="Dir" />
+            <exclude name="Spot" />
+            <exclude name="Point" />
+            <exclude name="Spec" />
+            <exclude name="Shadow" />
+        </option>
         <variation name="" />
         <variation name="" />
         <variation name="Skinned" define="SKINNED" />
         <variation name="Skinned" define="SKINNED" />
         <variation name="Instanced" define="INSTANCED" />
         <variation name="Instanced" define="INSTANCED" />

+ 2 - 3
SourceAssets/HLSLShaders/Skybox.hlsl

@@ -7,13 +7,12 @@ void VS(float4 iPos : POSITION,
     out float3 oTexCoord : TEXCOORD0)
     out float3 oTexCoord : TEXCOORD0)
 {
 {
     GetPosition(iPos, oPos);
     GetPosition(iPos, oPos);
+    oPos.z = oPos.w;
     oTexCoord = iPos.xyz;
     oTexCoord = iPos.xyz;
 }
 }
 
 
 void PS(float3 iTexCoord : TEXCOORD0,
 void PS(float3 iTexCoord : TEXCOORD0,
-    out float4 oColor : COLOR0,
-    out float oDepth : DEPTH0)
+    out float4 oColor : COLOR0)
 {
 {
     oColor = cMatDiffColor * texCUBE(sDiffCubeMap, iTexCoord);
     oColor = cMatDiffColor * texCUBE(sDiffCubeMap, iTexCoord);
-    oDepth = 1.0;
 }
 }