Browse Source

Remove the HLSL4 directory.

Lasse Öörni 10 years ago
parent
commit
a3ae935de2

+ 0 - 70
Bin/CoreData/Shaders/HLSL4/Basic.hlsl

@@ -1,70 +0,0 @@
-#include "Uniforms.hlsl"
-#include "Samplers.hlsl"
-#include "Transform.hlsl"
-
-void VS(float4 iPos : POSITION,
-    #ifdef SKINNED
-        float4 iBlendWeights : BLENDWEIGHT,
-        int4 iBlendIndices : BLENDINDICES,
-    #endif
-    #ifdef INSTANCED
-        float4x3 iModelInstance : TEXCOORD2,
-    #endif
-    #ifdef BILLBOARD
-        float2 iSize : TEXCOORD1,
-    #endif
-    #ifdef DIFFMAP
-        float2 iTexCoord : TEXCOORD0,
-    #endif
-    #ifdef VERTEXCOLOR
-        float4 iColor : COLOR0,
-        out float4 oColor : COLOR0,
-    #endif
-    #ifdef DIFFMAP
-        out float2 oTexCoord : TEXCOORD0,
-    #endif
-    out float4 oPos : SV_POSITION)
-{
-    float4x3 modelMatrix = iModelMatrix;
-    float3 worldPos = GetWorldPos(modelMatrix);
-    oPos = GetClipPos(worldPos);
-
-    #ifdef VERTEXCOLOR
-        oColor = iColor;
-    #endif
-    #ifdef DIFFMAP
-        oTexCoord = iTexCoord;
-    #endif
-}
-
-void PS(
-    #ifdef VERTEXCOLOR
-        float4 iColor : COLOR0,
-    #endif
-    #if defined(DIFFMAP) || defined(ALPHAMAP)
-        float2 iTexCoord : TEXCOORD0,
-    #endif
-    out float4 oColor : SV_TARGET)
-{
-    float4 diffColor = cMatDiffColor;
-
-    #ifdef VERTEXCOLOR
-        diffColor *= iColor;
-    #endif
-
-    #if (!defined(DIFFMAP)) && (!defined(ALPHAMAP))
-        oColor = diffColor;
-    #endif
-    #ifdef DIFFMAP
-        float4 diffInput = tDiffMap.Sample(sDiffMap, iTexCoord);
-        #ifdef ALPHAMASK
-            if (diffInput.a < 0.5)
-                discard;
-        #endif
-        oColor = diffColor * diffInput;
-    #endif
-    #ifdef ALPHAMAP
-        float alphaInput = tDiffMap.Sample(sDiffMap, iTexCoord).a;
-        oColor = float4(diffColor.rgb, diffColor.a * alphaInput);
-    #endif
-}

+ 0 - 34
Bin/CoreData/Shaders/HLSL4/Depth.hlsl

@@ -1,34 +0,0 @@
-#include "Uniforms.hlsl"
-#include "Samplers.hlsl"
-#include "Transform.hlsl"
-
-void VS(float4 iPos : POSITION,
-    #ifdef SKINNED
-        float4 iBlendWeights : BLENDWEIGHT,
-        int4 iBlendIndices : BLENDINDICES,
-    #endif
-    #ifdef INSTANCED
-        float4x3 iModelInstance : TEXCOORD2,
-    #endif
-    float2 iTexCoord : TEXCOORD0,
-    out float3 oTexCoord : TEXCOORD0,
-    out float4 oPos : POSITION)
-{
-    float4x3 modelMatrix = iModelMatrix;
-    float3 worldPos = GetWorldPos(modelMatrix);
-    oPos = GetClipPos(worldPos);
-    oTexCoord = float3(GetTexCoord(iTexCoord), GetDepth(oPos));
-}
-
-void PS(
-    float3 iTexCoord : TEXCOORD0,
-    out float4 oColor : COLOR0)
-{
-    #ifdef ALPHAMASK
-        float alpha = tex2D(sDiffMap, iTexCoord.xy).a;
-        if (alpha < 0.5)
-            discard;
-    #endif
-
-    oColor = iTexCoord.z;
-}

+ 0 - 24
Bin/CoreData/Shaders/HLSL4/Fog.hlsl

@@ -1,24 +0,0 @@
-#ifdef COMPILEPS
-float3 GetFog(float3 color, float fogFactor)
-{
-    return lerp(cFogColor, color, fogFactor);
-}
-
-float3 GetLitFog(float3 color, float fogFactor)
-{
-    return color * fogFactor;
-}
-
-float GetFogFactor(float depth)
-{
-    return saturate((cFogParams.x - depth) * cFogParams.y);
-}
-
-float GetHeightFogFactor(float depth, float height)
-{
-    float fogFactor = GetFogFactor(depth);
-    float heightFogFactor = (height - cFogParams.z) * cFogParams.w;
-    heightFogFactor = 1.0 - saturate(exp(-(heightFogFactor * heightFogFactor)));
-    return min(heightFogFactor, fogFactor);
-}
-#endif

+ 0 - 259
Bin/CoreData/Shaders/HLSL4/Lighting.hlsl

@@ -1,259 +0,0 @@
-#pragma warning(disable:3571)
-
-#ifdef COMPILEVS
-float3 GetAmbient(float zonePos)
-{
-    return cAmbientStartColor + zonePos * cAmbientEndColor;
-}
-
-#ifdef NUMVERTEXLIGHTS
-float GetVertexLight(int index, float3 worldPos, float3 normal)
-{
-    float3 lightDir = cVertexLights[index * 3 + 1].xyz;
-    float3 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
-    {
-        float3 lightVec = (lightPos - worldPos) * invRange;
-        float lightDist = length(lightVec);
-        float3 localDir = lightVec / lightDist;
-        float NdotL = max(dot(normal, localDir), 0.0);
-        float atten = saturate(1.0 - lightDist * lightDist);
-        float spotEffect = dot(localDir, lightDir);
-        float spotAtten = saturate((spotEffect - cutoff) * invCutoff);
-        return NdotL * atten * spotAtten;
-    }
-}
-
-float GetVertexLightVolumetric(int index, float3 worldPos)
-{
-    float3 lightDir = cVertexLights[index * 3 + 1].xyz;
-    float3 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
-    {
-        float3 lightVec = (lightPos - worldPos) * invRange;
-        float lightDist = length(lightVec);
-        float3 localDir = lightVec / lightDist;
-        float atten = saturate(1.0 - lightDist * lightDist);
-        float spotEffect = dot(localDir, lightDir);
-        float spotAtten = saturate((spotEffect - cutoff) * invCutoff);
-        return atten * spotAtten;
-    }
-}
-#endif
-
-#ifdef SHADOW
-
-#ifdef DIRLIGHT
-    #define NUMCASCADES 4
-#else
-    #define NUMCASCADES 1
-#endif
-
-void GetShadowPos(float4 projWorldPos, out float4 shadowPos[NUMCASCADES])
-{
-    // Shadow projection: transform from world space to shadow space
-    #if defined(DIRLIGHT)
-        shadowPos[0] = mul(projWorldPos, cLightMatrices[0]);
-        shadowPos[1] = mul(projWorldPos, cLightMatrices[1]);
-        shadowPos[2] = mul(projWorldPos, cLightMatrices[2]);
-        shadowPos[3] = mul(projWorldPos, cLightMatrices[3]);
-    #elif defined(SPOTLIGHT)
-        shadowPos[0] = mul(projWorldPos, cLightMatrices[1]);
-    #else
-        shadowPos[0] = float4(projWorldPos.xyz - cLightPos.xyz, 0.0);
-    #endif
-}
-#endif
-#endif
-
-#ifdef COMPILEPS
-float GetDiffuse(float3 normal, float3 worldPos, out float3 lightDir)
-{
-    #ifdef DIRLIGHT
-        lightDir = cLightDirPS;
-        return saturate(dot(normal, lightDir));
-    #else
-        float3 lightVec = (cLightPosPS.xyz - worldPos) * cLightPosPS.w;
-        float lightDist = length(lightVec);
-        lightDir = lightVec / lightDist;
-        return saturate(dot(normal, lightDir)) * tLightRampMap.Sample(sLightRampMap, float2(lightDist, 0.0)).r;
-    #endif
-}
-
-float GetDiffuseVolumetric(float3 worldPos)
-{
-    #ifdef DIRLIGHT
-        return 1.0;
-    #else
-        float3 lightVec = (cLightPosPS.xyz - worldPos) * cLightPosPS.w;
-        float lightDist = length(lightVec);
-        return tLightRampMap.Sample(sLightRampMap, float2(lightDist, 0.0)).r;
-    #endif
-}
-
-float GetSpecular(float3 normal, float3 eyeVec, float3 lightDir, float specularPower)
-{
-    float3 halfVec = normalize(normalize(eyeVec) + lightDir);
-    return saturate(pow(dot(normal, halfVec), specularPower));
-}
-
-float GetIntensity(float3 color)
-{
-    return dot(color, float3(0.299, 0.587, 0.114));
-}
-
-#ifdef SHADOW
-
-#ifdef DIRLIGHT
-    #define NUMCASCADES 4
-#else
-    #define NUMCASCADES 1
-#endif
-
-float GetShadow(float4 shadowPos)
-{
-    #ifndef LQSHADOW
-        // Take four samples and average them
-        // Note: in case of sampling a point light cube shadow, we optimize out the w divide as it has already been performed
-        #ifndef POINTLIGHT
-            float2 offsets = cShadowMapInvSize * shadowPos.w;
-        #else
-            float2 offsets = cShadowMapInvSize;
-        #endif
-        float4 inLight = float4(
-            tShadowMap.Sample(sShadowMap, shadowPos).r,
-            tShadowMap.Sample(sShadowMap, float4(shadowPos.x + offsets.x, shadowPos.yzw)).r,
-            tShadowMap.Sample(sShadowMap, float4(shadowPos.x, shadowPos.y + offsets.y, shadowPos.zw)).r,
-            tShadowMap.Sample(sShadowMap, float4(shadowPos.xy + offsets.xy, shadowPos.zw)).r
-        );
-        #ifndef SHADOWCMP
-            return cShadowIntensity.y + dot(inLight, cShadowIntensity.x);
-        #else
-            #ifndef POINTLIGHT
-                return cShadowIntensity.y + dot(inLight * shadowPos.w > shadowPos.z, cShadowIntensity.x);
-            #else
-                return cShadowIntensity.y + dot(inLight > shadowPos.z, cShadowIntensity.x);
-            #endif
-        #endif
-    #else
-        // Take one sample
-        float inLight = tShadowMap.Sample(sShadowMap, shadowPos).r;
-        #ifndef SHADOWCMP
-            return cShadowIntensity.y + cShadowIntensity.x * inLight;
-        #else
-            #ifndef POINTLIGHT
-                return cShadowIntensity.y + cShadowIntensity.x * (inLight * shadowPos.w > shadowPos.z);
-            #else
-                return cShadowIntensity.y + cShadowIntensity.x * (inLight > shadowPos.z);
-            #endif
-        #endif
-    #endif
-}
-
-#ifdef POINTLIGHT
-float GetPointShadow(float3 lightVec)
-{
-    float3 axis = tFaceSelectCubeMap.Sample(sFaceSelectCubeMap, lightVec).rgb;
-    float depth = abs(dot(lightVec, axis));
-
-    // Expand the maximum component of the light vector to get full 0.0 - 1.0 UV range from the cube map,
-    // and to avoid sampling across faces. Some GPU's filter across faces, while others do not, and in this
-    // case filtering across faces is wrong
-    const float factor = 1.0 / 256.0;
-    lightVec += factor * axis * lightVec;
-
-    // Read the 2D UV coordinates, adjust according to shadow map size and add face offset
-    float4 indirectPos = tIndirectionCubeMap.Sample(sIndirectionCubeMap, lightVec);
-    indirectPos.xy *= cShadowCubeAdjust.xy;
-    indirectPos.xy += float2(cShadowCubeAdjust.z + indirectPos.z * 0.5, cShadowCubeAdjust.w + indirectPos.w);
-
-    float4 shadowPos = float4(indirectPos.xy, cShadowDepthFade.x + cShadowDepthFade.y / depth, 1.0);
-    return GetShadow(shadowPos);
-}
-#endif
-
-#ifdef DIRLIGHT
-float GetDirShadowFade(float inLight, float depth)
-{
-    return saturate(inLight + saturate((depth - cShadowDepthFade.z) * cShadowDepthFade.w));
-}
-
-float GetDirShadow(const float4 iShadowPos[NUMCASCADES], float depth)
-{
-    float4 shadowPos;
-
-    if (depth < cShadowSplits.x)
-        shadowPos = iShadowPos[0];
-    else if (depth < cShadowSplits.y)
-        shadowPos = iShadowPos[1];
-    else if (depth < cShadowSplits.z)
-        shadowPos = iShadowPos[2];
-    else
-        shadowPos = iShadowPos[3];
-
-    return GetDirShadowFade(GetShadow(shadowPos), depth);
-}
-
-float GetDirShadowDeferred(float4 projWorldPos, float depth)
-{
-    float4 shadowPos;
-
-    if (depth < cShadowSplits.x)
-        shadowPos = mul(projWorldPos, cLightMatricesPS[0]);
-    else if (depth < cShadowSplits.y)
-        shadowPos = mul(projWorldPos, cLightMatricesPS[1]);
-    else if (depth < cShadowSplits.z)
-        shadowPos = mul(projWorldPos, cLightMatricesPS[2]);
-    else
-        shadowPos = mul(projWorldPos, cLightMatricesPS[3]);
-
-    return GetDirShadowFade(GetShadow(shadowPos), depth);
-}
-#endif
-
-float GetShadow(float4 iShadowPos[NUMCASCADES], float depth)
-{
-    #if defined(DIRLIGHT)
-        return GetDirShadow(iShadowPos, depth);
-    #elif defined(SPOTLIGHT)
-        return GetShadow(iShadowPos[0]);
-    #else
-        return GetPointShadow(iShadowPos[0].xyz);
-    #endif
-}
-
-float GetShadowDeferred(float4 projWorldPos, float depth)
-{
-    #if defined(DIRLIGHT)
-        return GetDirShadowDeferred(projWorldPos, depth);
-    #elif defined(SPOTLIGHT)
-        float4 shadowPos = mul(projWorldPos, cLightMatricesPS[1]);
-        return GetShadow(shadowPos);
-    #else
-        float3 shadowPos = projWorldPos.xyz - cLightPosPS.xyz;
-        return GetPointShadow(shadowPos);
-    #endif
-}
-#endif
-#endif

+ 0 - 150
Bin/CoreData/Shaders/HLSL4/LitParticle.hlsl

@@ -1,150 +0,0 @@
-#include "Uniforms.hlsl"
-#include "Samplers.hlsl"
-#include "Transform.hlsl"
-#include "Lighting.hlsl"
-#include "Fog.hlsl"
-
-void VS(float4 iPos : POSITION,
-    float2 iTexCoord : TEXCOORD0,
-    #ifdef VERTEXCOLOR
-        float4 iColor : COLOR0,
-    #endif
-    #ifdef SKINNED
-        float4 iBlendWeights : BLENDWEIGHT,
-        int4 iBlendIndices : BLENDINDICES,
-    #endif
-    #ifdef INSTANCED
-        float4x3 iModelInstance : TEXCOORD2,
-    #endif
-    #ifdef BILLBOARD
-        float2 iSize : TEXCOORD1,
-    #endif
-    out float2 oTexCoord : TEXCOORD0,
-    out float4 oWorldPos : TEXCOORD3,
-    #if PERPIXEL
-        #ifdef SHADOW
-            out float4 oShadowPos[NUMCASCADES] : TEXCOORD4,
-        #endif
-        #ifdef SPOTLIGHT
-            out float4 oSpotPos : TEXCOORD5,
-        #endif
-        #ifdef POINTLIGHT
-            out float3 oCubeMaskVec : TEXCOORD5,
-        #endif
-    #else
-        out float3 oVertexLight : TEXCOORD4,
-    #endif
-    #ifdef VERTEXCOLOR
-        out float4 oColor : COLOR0,
-    #endif
-    out float4 oPos : SV_POSITION)
-{
-    float4x3 modelMatrix = iModelMatrix;
-    float3 worldPos = GetWorldPos(modelMatrix);
-    oPos = GetClipPos(worldPos);
-    oTexCoord = GetTexCoord(iTexCoord);
-    oWorldPos = float4(worldPos, GetDepth(oPos));
-
-    #ifdef VERTEXCOLOR
-        oColor = iColor;
-    #endif
-
-    #ifdef PERPIXEL
-        // Per-pixel forward lighting
-        float4 projWorldPos = float4(worldPos.xyz, 1.0);
-
-        #ifdef SHADOW
-            // Shadow projection: transform from world space to shadow space
-            GetShadowPos(projWorldPos, oShadowPos);
-        #endif
-
-        #ifdef SPOTLIGHT
-            // Spotlight projection: transform from world space to projector texture coordinates
-            oSpotPos = mul(projWorldPos, cLightMatrices[0]);
-        #endif
-
-        #ifdef POINTLIGHT
-            oCubeMaskVec = mul(worldPos - cLightPos.xyz, (float3x3)cLightMatrices[0]);
-        #endif
-    #else
-        // Ambient & per-vertex lighting
-        oVertexLight = GetAmbient(GetZonePos(worldPos));
-
-        #ifdef NUMVERTEXLIGHTS
-            for (int i = 0; i < NUMVERTEXLIGHTS; ++i)
-                oVertexLight += GetVertexLightVolumetric(i, worldPos) * cVertexLights[i * 3].rgb;
-        #endif
-    #endif
-}
-
-void PS(float2 iTexCoord : TEXCOORD0,
-    float4 iWorldPos : TEXCOORD3,
-    #ifdef PERPIXEL
-        #ifdef SHADOW
-            float4 iShadowPos[NUMCASCADES] : TEXCOORD4,
-        #endif
-        #ifdef SPOTLIGHT
-            float4 iSpotPos : TEXCOORD5,
-        #endif
-        #ifdef CUBEMASK
-            float3 iCubeMaskVec : TEXCOORD5,
-        #endif
-    #else
-        float3 iVertexLight : TEXCOORD4,
-    #endif
-    #ifdef VERTEXCOLOR
-        float4 iColor : COLOR0,
-    #endif
-    out float4 oColor : SV_TARGET)
-{
-    // Get material diffuse albedo
-    #ifdef DIFFMAP
-        float4 diffInput = tDiffMap.Sample(sDiffMap, iTexCoord);
-        #ifdef ALPHAMASK
-            if (diffInput.a < 0.5)
-                discard;
-        #endif
-        float4 diffColor = cMatDiffColor * diffInput;
-    #else
-        float4 diffColor = cMatDiffColor;
-    #endif
-
-    #ifdef VERTEXCOLOR
-        diffColor *= iColor;
-    #endif
-
-    // Get fog factor
-    #ifdef HEIGHTFOG
-        float fogFactor = GetHeightFogFactor(iWorldPos.w, iWorldPos.y);
-    #else
-        float fogFactor = GetFogFactor(iWorldPos.w);
-    #endif
-
-    #ifdef PERPIXEL
-        // Per-pixel forward lighting
-        float3 lightColor;
-        float3 finalColor;
-        
-        float diff = GetDiffuseVolumetric(iWorldPos.xyz);
-
-        #ifdef SHADOW
-            diff *= GetShadow(iShadowPos, iWorldPos.w);
-        #endif
-
-        #if defined(SPOTLIGHT)
-            lightColor = iSpotPos.w > 0.0 ? tLightSpotMap.Sample(sLightSpotMap, iSpotPos.xy / iSpotPos.w).rrr * cLightColor.rgb : 0.0;
-        #elif defined(CUBEMASK)
-            lightColor = tLightCubeMap.Sample(sLightCubeMap, iCubeMaskVec).rgb * cLightColor.rgb;
-        #else
-            lightColor = cLightColor.rgb;
-        #endif
-
-        finalColor = diff * lightColor * diffColor.rgb;
-        oColor = float4(GetLitFog(finalColor, fogFactor), diffColor.a);
-    #else
-        // Ambient & per-vertex lighting
-        float3 finalColor = iVertexLight * diffColor.rgb;
-
-        oColor = float4(GetFog(finalColor, fogFactor), diffColor.a);
-    #endif
-}

+ 0 - 285
Bin/CoreData/Shaders/HLSL4/LitSolid.hlsl

@@ -1,285 +0,0 @@
-#include "Uniforms.hlsl"
-#include "Samplers.hlsl"
-#include "Transform.hlsl"
-#include "ScreenPos.hlsl"
-#include "Lighting.hlsl"
-#include "Fog.hlsl"
-
-void VS(float4 iPos : POSITION,
-    #ifndef BILLBOARD
-        float3 iNormal : NORMAL,
-    #endif
-    float2 iTexCoord : TEXCOORD0,
-    #if defined(LIGHTMAP) || defined(AO)
-        float2 iTexCoord2 : TEXCOORD1,
-    #endif
-    #ifdef NORMALMAP
-        float4 iTangent : TANGENT,
-    #endif
-    #ifdef SKINNED
-        float4 iBlendWeights : BLENDWEIGHT,
-        int4 iBlendIndices : BLENDINDICES,
-    #endif
-    #ifdef INSTANCED
-        float4x3 iModelInstance : TEXCOORD2,
-    #endif
-    #ifdef BILLBOARD
-        float2 iSize : TEXCOORD1,
-    #endif
-    #ifndef NORMALMAP
-        out float2 oTexCoord : TEXCOORD0,
-    #else
-        out float4 oTexCoord : TEXCOORD0,
-        out float4 oTangent : TEXCOORD3,
-    #endif
-    out float3 oNormal : TEXCOORD1,
-    out float4 oWorldPos : TEXCOORD2,
-    #ifdef PERPIXEL
-        #ifdef SHADOW
-            out float4 oShadowPos[NUMCASCADES] : TEXCOORD4,
-        #endif
-        #ifdef SPOTLIGHT
-            out float4 oSpotPos : TEXCOORD5,
-        #endif
-        #ifdef POINTLIGHT
-            out float3 oCubeMaskVec : TEXCOORD5,
-        #endif
-    #else
-        out float3 oVertexLight : TEXCOORD4,
-        out float4 oScreenPos : TEXCOORD5,
-        #ifdef ENVCUBEMAP
-            out float3 oReflectionVec : TEXCOORD6,
-        #endif
-        #if defined(LIGHTMAP) || defined(AO)
-            out float2 oTexCoord2 : TEXCOORD7,
-        #endif
-    #endif
-    out float4 oPos : SV_POSITION)
-{
-    float4x3 modelMatrix = iModelMatrix;
-    float3 worldPos = GetWorldPos(modelMatrix);
-    oPos = GetClipPos(worldPos);
-    oNormal = GetWorldNormal(modelMatrix);
-    oWorldPos = float4(worldPos, GetDepth(oPos));
-
-    #ifdef NORMALMAP
-        float3 tangent = GetWorldTangent(modelMatrix);
-        float3 bitangent = cross(tangent, oNormal) * iTangent.w;
-        oTexCoord = float4(GetTexCoord(iTexCoord), bitangent.xy);
-        oTangent = float4(tangent, bitangent.z);
-    #else
-        oTexCoord = GetTexCoord(iTexCoord);
-    #endif
-
-    #ifdef PERPIXEL
-        // Per-pixel forward lighting
-        float4 projWorldPos = float4(worldPos.xyz, 1.0);
-
-        #ifdef SHADOW
-            // Shadow projection: transform from world space to shadow space
-            GetShadowPos(projWorldPos, oShadowPos);
-        #endif
-
-        #ifdef SPOTLIGHT
-            // Spotlight projection: transform from world space to projector texture coordinates
-            oSpotPos = mul(projWorldPos, cLightMatrices[0]);
-        #endif
-
-        #ifdef POINTLIGHT
-            oCubeMaskVec = mul(worldPos - cLightPos.xyz, (float3x3)cLightMatrices[0]);
-        #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
-            oVertexLight = float3(0.0, 0.0, 0.0);
-            oTexCoord2 = iTexCoord2;
-        #else
-            oVertexLight = GetAmbient(GetZonePos(worldPos));
-        #endif
-
-        #ifdef NUMVERTEXLIGHTS
-            for (int i = 0; i < NUMVERTEXLIGHTS; ++i)
-                oVertexLight += GetVertexLight(i, worldPos, oNormal) * cVertexLights[i * 3].rgb;
-        #endif
-        
-        oScreenPos = GetScreenPos(oPos);
-
-        #ifdef ENVCUBEMAP
-            oReflectionVec = worldPos - cCameraPos;
-        #endif
-    #endif
-}
-
-void PS(
-    #ifndef NORMALMAP
-        float2 iTexCoord : TEXCOORD0,
-    #else
-        float4 iTexCoord : TEXCOORD0,
-        float4 iTangent : TEXCOORD3,
-    #endif
-    float3 iNormal : TEXCOORD1,
-    float4 iWorldPos : TEXCOORD2,
-    #ifdef PERPIXEL
-        #ifdef SHADOW
-            float4 iShadowPos[NUMCASCADES] : TEXCOORD4,
-        #endif
-        #ifdef SPOTLIGHT
-            float4 iSpotPos : TEXCOORD5,
-        #endif
-        #ifdef CUBEMASK
-            float3 iCubeMaskVec : TEXCOORD5,
-        #endif
-    #else
-        float3 iVertexLight : TEXCOORD4,
-        float4 iScreenPos : TEXCOORD5,
-        #ifdef ENVCUBEMAP
-            float3 iReflectionVec : TEXCOORD6,
-        #endif
-        #if defined(LIGHTMAP) || defined(AO)
-            float2 iTexCoord2 : TEXCOORD7,
-        #endif
-    #endif
-    #ifdef PREPASS
-        out float4 oDepth : SV_TARGET1,
-    #endif
-    #ifdef DEFERRED
-        out float4 oAlbedo : SV_TARGET1,
-        out float4 oNormal : SV_TARGET2,
-        out float4 oDepth : SV_TARGET3,
-    #endif
-    out float4 oColor : SV_TARGET)
-{
-    // Get material diffuse albedo
-    #ifdef DIFFMAP
-        float4 diffInput = tDiffMap.Sample(sDiffMap, iTexCoord.xy);
-        #ifdef ALPHAMASK
-            if (diffInput.a < 0.5)
-                discard;
-        #endif
-        float4 diffColor = cMatDiffColor * diffInput;
-    #else
-        float4 diffColor = cMatDiffColor;
-    #endif
-
-    // Get material specular albedo
-    #ifdef SPECMAP
-        float3 specColor = cMatSpecColor.rgb * tSpecMap.Sample(sSpecMap, iTexCoord.xy).rgb;
-    #else
-        float3 specColor = cMatSpecColor.rgb;
-    #endif
-
-    // Get normal
-    #ifdef NORMALMAP
-        float3x3 tbn = float3x3(iTangent.xyz, float3(iTexCoord.zw, iTangent.w), iNormal);
-        float3 normal = normalize(mul(DecodeNormal(tNormalMap.Sample(sNormalMap, iTexCoord.xy)), tbn));
-    #else
-        float3 normal = normalize(iNormal);
-    #endif
-
-    // Get fog factor
-    #ifdef HEIGHTFOG
-        float fogFactor = GetHeightFogFactor(iWorldPos.w, iWorldPos.y);
-    #else
-        float fogFactor = GetFogFactor(iWorldPos.w);
-    #endif
-
-    #if defined(PERPIXEL)
-        // Per-pixel forward lighting
-        float3 lightDir;
-        float3 lightColor;
-        float3 finalColor;
-
-        float diff = GetDiffuse(normal, iWorldPos.xyz, lightDir);
-
-        #ifdef SHADOW
-            diff *= GetShadow(iShadowPos, iWorldPos.w);
-        #endif
-
-        #if defined(SPOTLIGHT)
-            lightColor = iSpotPos.w > 0.0 ? tLightSpotMap.Sample(sLightSpotMap, iSpotPos.xy / iSpotPos.w).rrr * cLightColor.rgb : 0.0;
-        #elif defined(CUBEMASK)
-            lightColor = tLightCubeMap.Sample(sLightCubeMap, iCubeMaskVec).rgb * cLightColor.rgb;
-        #else
-            lightColor = cLightColor.rgb;
-        #endif
-    
-        #ifdef SPECULAR
-            float spec = GetSpecular(normal, cCameraPosPS - iWorldPos.xyz, lightDir, cMatSpecColor.a);
-            finalColor = diff * lightColor * (diffColor.rgb + spec * specColor * cLightColor.a);
-        #else
-            finalColor = diff * lightColor * diffColor.rgb;
-        #endif
-
-        #ifdef AMBIENT
-            finalColor += cAmbientColor * diffColor.rgb;
-            finalColor += cMatEmissiveColor;
-            oColor = float4(GetFog(finalColor, fogFactor), diffColor.a);
-        #else
-            oColor = float4(GetLitFog(finalColor, fogFactor), diffColor.a);
-        #endif
-    #elif defined(PREPASS)
-        // Fill light pre-pass G-Buffer
-        float specPower = cMatSpecColor.a / 255.0;
-
-        oColor = float4(normal * 0.5 + 0.5, specPower);
-        oDepth = iWorldPos.w;
-    #elif defined(DEFERRED)
-        // Fill deferred G-buffer
-        float specIntensity = specColor.g;
-        float specPower = cMatSpecColor.a / 255.0;
-
-        float3 finalColor = iVertexLight * diffColor.rgb;
-        #ifdef AO
-            // If using AO, the vertex light ambient is black, calculate occluded ambient here
-            finalColor += tEmissiveMap.Sample(sEmissiveMap, iTexCoord2).rgb * cAmbientColor * diffColor.rgb;
-        #endif
-        #ifdef ENVCUBEMAP
-            finalColor += cMatEnvMapColor * tEnvCubeMap.Sample(sEnvCubeMap, reflect(iReflectionVec, normal)).rgb;
-        #endif
-        #ifdef LIGHTMAP
-            finalColor += tEmissiveMap.Sample(sEmissiveMap, iTexCoord2).rgb * diffColor.rgb;
-        #endif
-        #ifdef EMISSIVEMAP
-            finalColor += cMatEmissiveColor * tEmissiveMap.Sample(sEmissiveMap, iTexCoord.xy).rgb;
-        #else
-            finalColor += cMatEmissiveColor;
-        #endif
-
-        oColor = float4(GetFog(finalColor, fogFactor), 1.0);
-        oAlbedo = fogFactor * float4(diffColor.rgb, specIntensity);
-        oNormal = float4(normal * 0.5 + 0.5, specPower);
-        oDepth = iWorldPos.w;
-    #else
-        // Ambient & per-vertex lighting
-        float3 finalColor = iVertexLight * diffColor.rgb;
-        #ifdef AO
-            // If using AO, the vertex light ambient is black, calculate occluded ambient here
-            finalColor += tEmissiveMap.Sample(sEmissiveMap, iTexCoord2).rgb * cAmbientColor * diffColor.rgb;
-        #endif
-
-        #ifdef MATERIAL
-            // Add light pre-pass accumulation result
-            // Lights are accumulated at half intensity. Bring back to full intensity now
-            float4 lightInput = 2.0 * tLightBuffer.Sample(sLightBuffer, iScreenPos.xy / iScreenPos.w);
-            float3 lightSpecColor = lightInput.a * (lightInput.rgb / GetIntensity(lightInput.rgb));
-
-            finalColor += lightInput.rgb * diffColor.rgb + lightSpecColor * specColor;
-        #endif
-
-        #ifdef ENVCUBEMAP
-            finalColor += cMatEnvMapColor * tEnvCubeMap.Sample(sEnvCubeMap, reflect(iReflectionVec, normal)).rgb;
-        #endif
-        #ifdef LIGHTMAP
-            finalColor += tEmissiveMap.Sample(sEmissiveMap, iTexCoord2).rgb * diffColor.rgb;
-        #endif
-        #ifdef EMISSIVEMAP
-            finalColor += cMatEmissiveColor * tEmissiveMap.Sample(sEmissiveMap, iTexCoord.xy).rgb;
-        #else
-            finalColor += cMatEmissiveColor;
-        #endif
-
-        oColor = float4(GetFog(finalColor, fogFactor), diffColor.a);
-    #endif
-}

+ 0 - 60
Bin/CoreData/Shaders/HLSL4/Samplers.hlsl

@@ -1,60 +0,0 @@
-#ifdef COMPILEPS
-Texture2D tDiffMap : register(t0);
-TextureCube tDiffCubeMap : register(t0);
-Texture2D tAlbedoBuffer : register(t0);
-Texture2D tNormalMap : register(t1);
-Texture2D tNormalBuffer : register(t1);
-Texture2D tSpecMap : register(t2);
-Texture2D tEmissiveMap : register(t3);
-Texture2D tEnvMap : register(t4);
-Texture3D tVolumeMap : register(t5);
-TextureCube tEnvCubeMap : register(t4);
-Texture2D tLightRampMap : register(t8);
-Texture2D tLightSpotMap : register(t9);
-TextureCube tLightCubeMap : register(t9);
-Texture2D tShadowMap : register(t10);
-TextureCube tFaceSelectCubeMap : register(t11);
-TextureCube tIndirectionCubeMap : register(t12);
-Texture2D tDepthBuffer : register(t13);
-Texture2D tLightBuffer : register(t14);
-TextureCube tZoneCubeMap : register(t15);
-Texture3D tZoneVolumeMap : register(t15);
-
-SamplerState sDiffMap : register(s0);
-SamplerState sDiffCubeMap : register(s0);
-SamplerState sAlbedoBuffer : register(s0);
-SamplerState sNormalMap : register(s1);
-SamplerState sNormalBuffer : register(s1);
-SamplerState sSpecMap : register(s2);
-SamplerState sEmissiveMap : register(s3);
-SamplerState sEnvMap : register(s4);
-SamplerState sVolumeMap : register(s5);
-SamplerState sEnvCubeMap : register(s4);
-SamplerState sLightRampMap : register(s8);
-SamplerState sLightSpotMap : register(s9);
-SamplerState sLightCubeMap : register(s9);
-SamplerState sShadowMap : register(s10);
-SamplerState sFaceSelectCubeMap : register(s11);
-SamplerState sIndirectionCubeMap : register(s12);
-SamplerState sDepthBuffer : register(s13);
-SamplerState sLightBuffer : register(s14);
-SamplerState sZoneCubeMap : register(s15);
-SamplerState sZoneVolumeMap : register(s15);
-
-float3 DecodeNormal(float4 normalInput)
-{
-    #ifdef PACKEDNORMAL
-        float3 normal;
-        normal.xy = normalInput.ag * 2.0 - 1.0;
-        normal.z = sqrt(max(1.0 - dot(normal.xy, normal.xy), 0.0));
-        return normal;
-    #else
-        return normalInput.rgb * 2.0 - 1.0;
-    #endif
-}
-
-float ReconstructDepth(float hwDepth)
-{
-    return dot(float2(hwDepth, cDepthReconstruct.y / (hwDepth - cDepthReconstruct.x)), cDepthReconstruct.zw);
-}
-#endif

+ 0 - 51
Bin/CoreData/Shaders/HLSL4/ScreenPos.hlsl

@@ -1,51 +0,0 @@
-#ifdef COMPILEVS
-float4 GetScreenPos(float4 clipPos)
-{
-    return float4(
-        clipPos.x * cGBufferOffsets.z + cGBufferOffsets.x * clipPos.w,
-        -clipPos.y * cGBufferOffsets.w + cGBufferOffsets.y * clipPos.w,
-        0.0,
-        clipPos.w);
-}
-
-float2 GetScreenPosPreDiv(float4 clipPos)
-{
-    return float2(
-        clipPos.x / clipPos.w * cGBufferOffsets.z + cGBufferOffsets.x,
-        -clipPos.y / clipPos.w * cGBufferOffsets.w + cGBufferOffsets.y);
-}
-
-float2 GetQuadTexCoord(float4 clipPos)
-{
-    return float2(
-        clipPos.x / clipPos.w * 0.5 + 0.5,
-        -clipPos.y / clipPos.w * 0.5 + 0.5);
-}
-
-float2 GetQuadTexCoordNoFlip(float3 worldPos)
-{
-    return float2(
-        worldPos.x * 0.5 + 0.5,
-        -worldPos.y * 0.5 + 0.5);
-}
-
-float3 GetFarRay(float4 clipPos)
-{
-    float3 viewRay = float3(
-        clipPos.x / clipPos.w * cFrustumSize.x,
-        clipPos.y / clipPos.w * cFrustumSize.y,
-        cFrustumSize.z);
-
-    return mul(viewRay, cCameraRot);
-}
-
-float3 GetNearRay(float4 clipPos)
-{
-    float3 viewRay = float3(
-        clipPos.x / clipPos.w * cFrustumSize.x,
-        clipPos.y / clipPos.w * cFrustumSize.y,
-        0.0);
-
-    return mul(viewRay, cCameraRot) * cDepthMode.z;
-}
-#endif

+ 0 - 34
Bin/CoreData/Shaders/HLSL4/Shadow.hlsl

@@ -1,34 +0,0 @@
-#include "Uniforms.hlsl"
-#include "Samplers.hlsl"
-#include "Transform.hlsl"
-
-void VS(float4 iPos : POSITION,
-    #ifdef SKINNED
-        float4 iBlendWeights : BLENDWEIGHT,
-        int4 iBlendIndices : BLENDINDICES,
-    #endif
-    #ifdef INSTANCED
-        float4x3 iModelInstance : TEXCOORD2,
-    #endif
-    float2 iTexCoord : TEXCOORD0,
-    out float2 oTexCoord : TEXCOORD0,
-    out float4 oPos : SV_POSITION)
-{
-    float4x3 modelMatrix = iModelMatrix;
-    float3 worldPos = GetWorldPos(modelMatrix);
-    oPos = GetClipPos(worldPos);
-    oTexCoord = GetTexCoord(iTexCoord);
-}
-
-void PS(
-    float2 iTexCoord : TEXCOORD0,
-    out float4 oColor : SV_TARGET)
-{
-    #ifdef ALPHAMASK
-        float alpha = tDiffMap.Sample(sDiffMap, iTexCoord).a;
-        if (alpha < 0.5)
-            discard;
-    #endif
-
-    oColor = 1.0;
-}

+ 0 - 21
Bin/CoreData/Shaders/HLSL4/Skybox.hlsl

@@ -1,21 +0,0 @@
-#include "Uniforms.hlsl"
-#include "Samplers.hlsl"
-#include "Transform.hlsl"
-
-void VS(float4 iPos : POSITION,
-    out float4 oPos : SV_POSITION,
-    out float3 oTexCoord : TEXCOORD0)
-{
-    float4x3 modelMatrix = iModelMatrix;
-    float3 worldPos = GetWorldPos(modelMatrix);
-    oPos = GetClipPos(worldPos);
-    
-    oPos.z = oPos.w;
-    oTexCoord = iPos.xyz;
-}
-
-void PS(float3 iTexCoord : TEXCOORD0,
-    out float4 oColor : SV_TARGET)
-{
-    oColor = cMatDiffColor * tDiffCubeMap.Sample(sDiffCubeMap, iTexCoord);
-}

+ 0 - 15
Bin/CoreData/Shaders/HLSL4/Stencil.hlsl

@@ -1,15 +0,0 @@
-#include "Uniforms.hlsl"
-#include "Transform.hlsl"
-
-void VS(float4 iPos : POSITION,
-    out float4 oPos : SV_POSITION)
-{
-    float4x3 modelMatrix = iModelMatrix;
-    float3 worldPos = GetWorldPos(modelMatrix);
-    oPos = GetClipPos(worldPos);
-}
-
-void PS(out float4 oColor : SV_TARGET)
-{
-    oColor = 1.0;
-}

+ 0 - 207
Bin/CoreData/Shaders/HLSL4/TerrainBlend.hlsl

@@ -1,207 +0,0 @@
-#include "Uniforms.hlsl"
-#include "Samplers.hlsl"
-#include "Transform.hlsl"
-#include "ScreenPos.hlsl"
-#include "Lighting.hlsl"
-#include "Fog.hlsl"
-
-Texture2D tWeightMap0 : register(t0);
-Texture2D tDetailMap1 : register(t1);
-Texture2D tDetailMap2 : register(t2);
-Texture2D tDetailMap3 : register(t3);
-SamplerState sWeightMap0 : register(s0);
-SamplerState sDetailMap1 : register(s1);
-SamplerState sDetailMap2 : register(s2);
-SamplerState sDetailMap3 : register(s3);
-
-uniform float2 cDetailTiling;
-
-void VS(float4 iPos : POSITION,
-    float3 iNormal : NORMAL,
-    float2 iTexCoord : TEXCOORD0,
-    #ifdef SKINNED
-        float4 iBlendWeights : BLENDWEIGHT,
-        int4 iBlendIndices : BLENDINDICES,
-    #endif
-    #ifdef INSTANCED
-        float4x3 iModelInstance : TEXCOORD2,
-    #endif
-    #ifdef BILLBOARD
-        float2 iSize : TEXCOORD1,
-    #endif
-    out float2 oTexCoord : TEXCOORD0,
-    out float3 oNormal : TEXCOORD1,
-    out float4 oWorldPos : TEXCOORD2,
-    out float2 oDetailTexCoord : TEXCOORD3,
-    #ifdef PERPIXEL
-        #ifdef SHADOW
-            out float4 oShadowPos[NUMCASCADES] : TEXCOORD4,
-        #endif
-        #ifdef SPOTLIGHT
-            out float4 oSpotPos : TEXCOORD5,
-        #endif
-        #ifdef POINTLIGHT
-            out float3 oCubeMaskVec : TEXCOORD5,
-        #endif
-    #else
-        out float3 oVertexLight : TEXCOORD4,
-        out float4 oScreenPos : TEXCOORD5,
-    #endif
-    out float4 oPos : SV_POSITION)
-{
-    float4x3 modelMatrix = iModelMatrix;
-    float3 worldPos = GetWorldPos(modelMatrix);
-    oPos = GetClipPos(worldPos);
-    oNormal = GetWorldNormal(modelMatrix);
-    oWorldPos = float4(worldPos, GetDepth(oPos));
-    oTexCoord = GetTexCoord(iTexCoord);
-    oDetailTexCoord = cDetailTiling * oTexCoord;
-
-    #ifdef PERPIXEL
-        // Per-pixel forward lighting
-        float4 projWorldPos = float4(worldPos.xyz, 1.0);
-
-        #ifdef SHADOW
-            // Shadow projection: transform from world space to shadow space
-            GetShadowPos(projWorldPos, oShadowPos);
-        #endif
-
-        #ifdef SPOTLIGHT
-            // Spotlight projection: transform from world space to projector texture coordinates
-            oSpotPos = mul(projWorldPos, cLightMatrices[0]);
-        #endif
-
-        #ifdef POINTLIGHT
-            oCubeMaskVec = mul(worldPos - cLightPos.xyz, (float3x3)cLightMatrices[0]);
-        #endif
-    #else
-        // Ambient & per-vertex lighting
-        oVertexLight = GetAmbient(GetZonePos(worldPos));
-
-        #ifdef NUMVERTEXLIGHTS
-            for (int i = 0; i < NUMVERTEXLIGHTS; ++i)
-                oVertexLight += GetVertexLight(i, worldPos, oNormal) * cVertexLights[i * 3].rgb;
-        #endif
-        
-        oScreenPos = GetScreenPos(oPos);
-    #endif
-}
-
-void PS(float2 iTexCoord : TEXCOORD0,
-    float3 iNormal : TEXCOORD1,
-    float4 iWorldPos : TEXCOORD2,
-    float2 iDetailTexCoord : TEXCOORD3,
-    #ifdef PERPIXEL
-        #ifdef SHADOW
-            float4 iShadowPos[NUMCASCADES] : TEXCOORD4,
-        #endif
-        #ifdef SPOTLIGHT
-            float4 iSpotPos : TEXCOORD5,
-        #endif
-        #ifdef CUBEMASK
-            float3 iCubeMaskVec : TEXCOORD5,
-        #endif
-    #else
-        float3 iVertexLight : TEXCOORD4,
-        float4 iScreenPos : TEXCOORD5,
-    #endif
-    #ifdef PREPASS
-        out float4 oDepth : SV_TARGET1,
-    #endif
-    #ifdef DEFERRED
-        out float4 oAlbedo : SV_TARGET1,
-        out float4 oNormal : SV_TARGET2,
-        out float4 oDepth : SV_TARGET3,
-    #endif
-    out float4 oColor : SV_TARGET)
-{
-    // Get material diffuse albedo
-    float3 weights = tWeightMap0.Sample(sWeightMap0, iTexCoord).rgb;
-    float sumWeights = weights.r + weights.g + weights.b;
-    weights /= sumWeights;
-    float4 diffColor = cMatDiffColor * (
-        weights.r * tDetailMap1.Sample(sDetailMap1, iDetailTexCoord) +
-        weights.g * tDetailMap2.Sample(sDetailMap2, iDetailTexCoord) +
-        weights.b * tDetailMap3.Sample(sDetailMap3, iDetailTexCoord)
-    );
-
-    // Get material specular albedo
-    float3 specColor = cMatSpecColor.rgb;
-
-    // Get normal
-    float3 normal = normalize(iNormal);
-
-    // Get fog factor
-    #ifdef HEIGHTFOG
-        float fogFactor = GetHeightFogFactor(iWorldPos.w, iWorldPos.y);
-    #else
-        float fogFactor = GetFogFactor(iWorldPos.w);
-    #endif
-
-    #if defined(PERPIXEL)
-        // Per-pixel forward lighting
-        float3 lightDir;
-        float3 lightColor;
-        float3 finalColor;
-        
-        float diff = GetDiffuse(normal, iWorldPos.xyz, lightDir);
-
-        #ifdef SHADOW
-            diff *= GetShadow(iShadowPos, iWorldPos.w);
-        #endif
-    
-        #if defined(SPOTLIGHT)
-            lightColor = iSpotPos.w > 0.0 ? tLightSpotMap.Sample(sLightSpotMap, iSpotPos.xy / iSpotPos.w).rrr * cLightColor.rgb : 0.0;
-        #elif defined(CUBEMASK)
-            lightColor = tLightCubeMap.Sample(sLightCubeMap, iCubeMaskVec).rgb * cLightColor.rgb;
-        #else
-            lightColor = cLightColor.rgb;
-        #endif
-    
-        #ifdef SPECULAR
-            float spec = GetSpecular(normal, cCameraPosPS - iWorldPos.xyz, lightDir, cMatSpecColor.a);
-            finalColor = diff * lightColor * (diffColor.rgb + spec * specColor * cLightColor.a);
-        #else
-            finalColor = diff * lightColor * diffColor.rgb;
-        #endif
-
-        #ifdef AMBIENT
-            finalColor += cAmbientColor * diffColor.rgb;
-            finalColor += cMatEmissiveColor;
-            oColor = float4(GetFog(finalColor, fogFactor), diffColor.a);
-        #else
-            oColor = float4(GetLitFog(finalColor, fogFactor), diffColor.a);
-        #endif
-    #elif defined(PREPASS)
-        // Fill light pre-pass G-Buffer
-        float specPower = cMatSpecColor.a / 255.0;
-
-        oColor = float4(normal * 0.5 + 0.5, specPower);
-        oDepth = iWorldPos.w;
-    #elif defined(DEFERRED)
-        // Fill deferred G-buffer
-        float specIntensity = specColor.g;
-        float specPower = cMatSpecColor.a / 255.0;
-
-        float3 finalColor = iVertexLight * diffColor.rgb;
-
-        oColor = float4(GetFog(finalColor, fogFactor), 1.0);
-        oAlbedo = fogFactor * float4(diffColor.rgb, specIntensity);
-        oNormal = float4(normal * 0.5 + 0.5, specPower);
-        oDepth = iWorldPos.w;
-    #else
-        // Ambient & per-vertex lighting
-        float3 finalColor = iVertexLight * diffColor.rgb;
-
-        #ifdef MATERIAL
-            // Add light pre-pass accumulation result
-            // Lights are accumulated at half intensity. Bring back to full intensity now
-            float4 lightInput = 2.0 * tLightBuffer.Sample(sLightBuffer, iScreenPos.xy / iScreenPos.w);
-            float3 lightSpecColor = lightInput.a * (lightInput.rgb / GetIntensity(lightInput.rgb));
-
-            finalColor += lightInput.rgb * diffColor.rgb + lightSpecColor * specColor;
-        #endif
-
-        oColor = float4(GetFog(finalColor, fogFactor), diffColor.a);
-    #endif
-}

+ 0 - 62
Bin/CoreData/Shaders/HLSL4/Text.hlsl

@@ -1,62 +0,0 @@
-#include "Uniforms.hlsl"
-#include "Samplers.hlsl"
-#include "Transform.hlsl"
-
-#ifdef TEXT_EFFECT_SHADOW
-uniform float2 cShadowOffset;
-uniform float4 cShadowColor;
-#endif
-
-#ifdef TEXT_EFFECT_STROKE
-uniform float4 cStrokeColor;
-#endif
-
-void VS(float4 iPos : POSITION,
-        float4 iColor : COLOR0,
-        float2 iTexCoord : TEXCOORD0,
-        out float4 oPos : SV_POSITION,
-        out float4 oColor : COLOR0,
-        out float2 oTexCoord : TEXCOORD0)
-{
-    float4x3 modelMatrix = iModelMatrix;
-    float3 worldPos = GetWorldPos(modelMatrix);
-    oPos = GetClipPos(worldPos);
-    oColor = iColor;
-    oTexCoord = iTexCoord;
-}
-
-void PS(float4 iColor : COLOR0,
-        float2 iTexCoord : TEXCOORD0,
-        out float4 oColor : SV_TARGET)
-{
-    oColor.rgb = iColor.rgb;
-
-#ifdef SIGNED_DISTANCE_FIELD
-    float distance = tDiffMap.Sample(sDiffMap, iTexCoord).a;
-    if (distance < 0.5f)
-    {
-    #ifdef TEXT_EFFECT_SHADOW
-        if (tDiffMap.Sample(sDiffMap, iTexCoord - cShadowOffset).a > 0.5f)
-            oColor = cShadowColor;
-        else
-    #endif
-        oColor.a = 0.0f;
-    }
-    else
-    {
-    #ifdef TEXT_EFFECT_STROKE
-        if (distance < 0.525f)
-            oColor.rgb = cStrokeColor.rgb;
-    #endif
-
-    #ifdef TEXT_EFFECT_SHADOW
-        if (tDiffMap.Sample(sDiffMap, iTexCoord + cShadowOffset).a < 0.5f)
-            oColor.a = iColor.a;
-        else
-    #endif
-        oColor.a = iColor.a * smoothstep(0.5f, 0.505f, distance);
-    }
-#else
-    oColor.a = iColor.a * tDiffMap.Sample(sDiffMap, iTexCoord).a;
-#endif
-}

+ 0 - 65
Bin/CoreData/Shaders/HLSL4/Transform.hlsl

@@ -1,65 +0,0 @@
-#ifdef COMPILEVS
-#ifdef SKINNED
-float4x3 GetSkinMatrix(float4 blendWeights, int4 blendIndices)
-{
-    return cSkinMatrices[blendIndices.x] * blendWeights.x +
-        cSkinMatrices[blendIndices.y] * blendWeights.y +
-        cSkinMatrices[blendIndices.z] * blendWeights.z +
-        cSkinMatrices[blendIndices.w] * blendWeights.w;
-}
-#endif
-
-float2 GetTexCoord(float2 iTexCoord)
-{
-    return float2(dot(iTexCoord, cUOffset.xy) + cUOffset.w, dot(iTexCoord, cVOffset.xy) + cVOffset.w);
-};
-
-float4 GetClipPos(float3 worldPos)
-{
-    return mul(float4(worldPos, 1.0), cViewProj);
-}
-
-float GetZonePos(float3 worldPos)
-{
-    return saturate(mul(float4(worldPos, 1.0), cZone).z);
-}
-
-float GetDepth(float4 clipPos)
-{
-    return dot(clipPos.zw, cDepthMode.zw);
-}
-
-#ifdef BILLBOARD
-float3 GetBillboardPos(float4 iPos, float2 iSize, float4x3 modelMatrix)
-{
-    return mul(iPos, modelMatrix) + mul(float3(iSize.x, iSize.y, 0.0), cBillboardRot);
-}
-
-float3 GetBillboardNormal()
-{
-    return float3(-cBillboardRot[2][0], -cBillboardRot[2][1], -cBillboardRot[2][2]);
-}
-#endif
-
-#if defined(SKINNED)
-    #define iModelMatrix GetSkinMatrix(iBlendWeights, iBlendIndices);
-#elif defined(INSTANCED)
-    #define iModelMatrix iModelInstance
-#else
-    #define iModelMatrix cModel
-#endif
-
-#ifdef BILLBOARD
-    #define GetWorldPos(modelMatrix) GetBillboardPos(iPos, iSize, modelMatrix)
-#else
-    #define GetWorldPos(modelMatrix) mul(iPos, modelMatrix)
-#endif
-
-#ifdef BILLBOARD
-    #define GetWorldNormal(modelMatrix) GetBillboardNormal()
-#else
-    #define GetWorldNormal(modelMatrix) normalize(mul(iNormal, (float3x3)modelMatrix))
-#endif
-
-#define GetWorldTangent(modelMatrix) normalize(mul(iTangent.xyz, (float3x3)modelMatrix))
-#endif

+ 0 - 101
Bin/CoreData/Shaders/HLSL4/Uniforms.hlsl

@@ -1,101 +0,0 @@
-#ifdef COMPILEVS
-// Vertex shader uniforms
-cbuffer FrameVS : register(b0)
-{
-    float cDeltaTime;
-    float cElapsedTime;
-}
-
-cbuffer CameraVS : register(b1)
-{
-    float3 cCameraPos;
-    float3x3 cCameraRot;
-    float cNearClip;
-    float cFarClip;
-    float4 cDepthMode;
-    float3 cFrustumSize;
-    float4 cGBufferOffsets;
-    float4x4 cViewProj;
-}
-
-cbuffer ZoneVS : register(b2)
-{
-    float3 cAmbientStartColor;
-    float3 cAmbientEndColor;
-    float4x3 cZone;
-}
-
-cbuffer LightVS : register(b3)
-{
-    float3 cLightDir;
-    float4 cLightPos;
-    #ifdef NUMVERTEXLIGHTS
-        float4 cVertexLights[4*3];
-    #else
-        float4x4 cLightMatrices[4];
-    #endif
-}
-
-cbuffer MaterialVS : register(b4)
-{
-    float4 cUOffset;
-    float4 cVOffset;
-}
-
-cbuffer ObjectVS : register(b5)
-{
-    float4x3 cModel;
-    #ifdef BILLBOARD
-        float3x3 cBillboardRot;
-    #endif
-    #ifdef SKINNED
-        uniform float4x3 cSkinMatrices[64];
-    #endif
-}
-#endif
-
-#ifdef COMPILEPS
-// Pixel shader uniforms
-cbuffer FramePS : register(b0)
-{
-    float cDeltaTimePS;
-    float cElapsedTimePS;
-}
-
-cbuffer CameraPS : register(b1)
-{
-    float3 cCameraPosPS;
-    float4 cDepthReconstruct;
-    float2 cGBufferInvSize;
-    float cNearClipPS;
-    float cFarClipPS;
-}
-
-cbuffer ZonePS : register(b2)
-{
-    float3 cAmbientColor;
-    float4 cFogParams;
-    float3 cFogColor;
-}
-
-cbuffer LightPS : register(b3)
-{
-    float4 cLightColor;
-    float4 cLightPosPS;
-    float3 cLightDirPS;
-    float4 cShadowCubeAdjust;
-    float4 cShadowDepthFade;
-    float2 cShadowIntensity;
-    float2 cShadowMapInvSize;
-    float4 cShadowSplits;
-    float4x4 cLightMatricesPS[4];
-}
-
-cbuffer MaterialPS : register(b4)
-{
-    float4 cMatDiffColor;
-    float3 cMatEmissiveColor;
-    float3 cMatEnvMapColor;
-    float4 cMatSpecColor;
-}
-#endif

+ 0 - 89
Bin/CoreData/Shaders/HLSL4/Unlit.hlsl

@@ -1,89 +0,0 @@
-#include "Uniforms.hlsl"
-#include "Samplers.hlsl"
-#include "Transform.hlsl"
-#include "Fog.hlsl"
-
-void VS(float4 iPos : POSITION,
-    float2 iTexCoord : TEXCOORD0,
-    #ifdef VERTEXCOLOR
-        float4 iColor : COLOR0,
-    #endif
-    #ifdef SKINNED
-        float4 iBlendWeights : BLENDWEIGHT,
-        int4 iBlendIndices : BLENDINDICES,
-    #endif
-    #ifdef INSTANCED
-        float4x3 iModelInstance : TEXCOORD2,
-    #endif
-    #ifdef BILLBOARD
-        float2 iSize : TEXCOORD1,
-    #endif
-    out float2 oTexCoord : TEXCOORD0,
-    out float4 oWorldPos : TEXCOORD2,
-    #ifdef VERTEXCOLOR
-        out float4 oColor : COLOR0,
-    #endif
-    out float4 oPos : SV_POSITION)
-{
-    float4x3 modelMatrix = iModelMatrix;
-    float3 worldPos = GetWorldPos(modelMatrix);
-    oPos = GetClipPos(worldPos);
-    oTexCoord = GetTexCoord(iTexCoord);
-    oWorldPos = float4(worldPos, GetDepth(oPos));
-
-    #ifdef VERTEXCOLOR
-        oColor = iColor;
-    #endif
-}
-
-void PS(float2 iTexCoord : TEXCOORD0,
-    float4 iWorldPos: TEXCOORD2,
-    #ifdef VERTEXCOLOR
-        float4 iColor : COLOR0,
-    #endif
-    #ifdef PREPASS
-        out float4 oDepth : SV_TARGET1,
-    #endif
-    #ifdef DEFERRED
-        out float4 oAlbedo : SV_TARGET1,
-        out float4 oNormal : SV_TARGET2,
-        out float4 oDepth : SV_TARGET3,
-    #endif
-    out float4 oColor : SV_TARGET)
-{
-    // Get material diffuse albedo
-    #ifdef DIFFMAP
-        float4 diffColor = cMatDiffColor * tDiffMap.Sample(sDiffMap, iTexCoord);
-        #ifdef ALPHAMASK
-            if (diffColor.a < 0.5)
-                discard;
-        #endif
-    #else
-        float4 diffColor = cMatDiffColor;
-    #endif
-
-    #ifdef VERTEXCOLOR
-        diffColor *= iColor;
-    #endif
-
-    // Get fog factor
-    #ifdef HEIGHTFOG
-        float fogFactor = GetHeightFogFactor(iWorldPos.w, iWorldPos.y);
-    #else
-        float fogFactor = GetFogFactor(iWorldPos.w);
-    #endif
-
-    #if defined(PREPASS)
-        // Fill light pre-pass G-Buffer
-        oColor = float4(0.5, 0.5, 0.5, 1.0);
-        oDepth = iWorldPos.w;
-    #elif defined(DEFERRED)
-        // Fill deferred G-buffer
-        oColor = float4(GetFog(diffColor.rgb, fogFactor), diffColor.a);
-        oAlbedo = float4(0.0, 0.0, 0.0, 0.0);
-        oNormal = float4(0.5, 0.5, 0.5, 1.0);
-        oDepth = iWorldPos.w;
-    #else
-        oColor = float4(GetFog(diffColor.rgb, fogFactor), diffColor.a);
-    #endif
-}

+ 0 - 27
Bin/CoreData/Shaders/HLSL4/Urho2D.hlsl

@@ -1,27 +0,0 @@
-#include "Uniforms.hlsl"
-#include "Samplers.hlsl"
-#include "Transform.hlsl"
-
-void VS(float4 iPos : POSITION,
-    float2 iTexCoord : TEXCOORD0,
-    float4 iColor : COLOR0,
-    out float4 oColor : COLOR0,
-    out float2 oTexCoord : TEXCOORD0,
-    out float4 oPos : SV_POSITION)
-{
-    float4x3 modelMatrix = iModelMatrix;
-    float3 worldPos = GetWorldPos(modelMatrix);
-    oPos = GetClipPos(worldPos);
-
-    oColor = iColor;
-    oTexCoord = iTexCoord;
-}
-
-void PS(float4 iColor : COLOR0,
-        float2 iTexCoord : TEXCOORD0,
-        out float4 oColor : SV_TARGET)
-{
-    float4 diffColor = cMatDiffColor * iColor;
-    float4 diffInput = tDiffMap.Sample(sDiffMap, iTexCoord);
-    oColor = diffColor * diffInput;
-}