home *** CD-ROM | disk | FTP | other *** search
- #if FIREWALL
- #define FOG 1
- #endif
- #if ICEWALL
- #define DIR_LIGHT 1
- #endif
-
- #include "DX12Defines.fxh"
- #include "QSConstant.fxh"
- #include "FunctionLib.fxh"
- #include "QSLighting.fxh"
- #include "PostFx.fxh"
- #include "QSPhysicalLighting.fxh"
- #include "QSScreenSpaceDepth.fxh"
- #include "ZFade.fxh"
- #include "QSShaderAtmosphere.fxh"
-
-
- float4 BlockInfo;//x height, y refract index, zw uv tiling
- #ifndef PARTIAL_VIEW_PROJ
- #define PARTIAL_VIEW_PROJ
- float4x4 PartialViewProj;
- #endif
-
- #ifndef VIEW_PROJ
- #define VIEW_PROJ
- float4x4 view;
- #endif
-
- #if DEPTH
-
- struct VsIn
- {
- float3 pos :POSITION;
- float2 uv :TEXCOORD0;
-
- uint4 normal :NORMAL;
- uint4 binormal :BINORMAL;
- uint4 tangent :TANGENT;
- };
-
- struct VSOut
- {
- float4 pos : POSITION;
- float2 uv : TEXCOORD0; //xy texture uv, zw normal map uv
- float3 posWorld :TEXCOORD1;
- };
-
- VSOut MainVS(VsIn param)
- {
- //const
- float height = BlockInfo.x;
-
- VSOut result;
- float3 posWorld = param.pos;
- posWorld.z += param.uv.x*height;
-
- float4 screenPos = mul(float4(posWorld.xyz - cameraPos, 1), PartialViewProj);
- result.pos = screenPos;
- result.uv = param.uv;
-
- result.posWorld = posWorld;
-
- return result;
- }
- #else//icewall / firewall
-
-
- //common for icewall/firewall
- struct VsIn
- {
- float3 pos :POSITION;
- float2 uv :TEXCOORD0;
-
- int4 normal :NORMAL;
- int4 binormal :BINORMAL;
- int4 tangent :TANGENT;
- };
-
- struct VSOut
- {
- float4 pos : POSITION;
- float2 uv : TEXCOORD0; //xy texture uv, zw normal map uv
- float3 viewDir : TEXCOORD1;
- float3 tangent:TEXCOORD2;
- float3 binormal:TEXCOORD3;
- float3 normal:TEXCOORD4;
- float4 posWorld :TEXCOORD5;
- };
-
-
- VSOut MainVS(VsIn param)
- {
- //const
- float height = BlockInfo.x;
-
-
- VSOut result;
- float3 posWorld = param.pos;
- posWorld.z += param.uv.x*height;
-
- float4 screenPos = mul(float4(posWorld.xyz - cameraPos, 1), PartialViewProj);
- result.pos = screenPos;
- result.uv = param.uv;
-
- result.normal = DecompressCharToFloat(param.normal);
- result.tangent = DecompressCharToFloat(param.tangent);
- result.binormal = DecompressCharToFloat(param.binormal);
- result.normal = normalize(result.normal);
-
- float3 toCamera = posWorld.xyz - cameraPos.xyz;
- result.viewDir = normalize(toCamera);
-
- float4 posView = mul(float4(posWorld,1.0f), view);
- result.posWorld = float4(posWorld, posView.y);
-
- return result;
- }
-
- #endif
-