R26_dev8 - First public commit

This commit is contained in:
dexyfex
2017-09-21 20:33:05 +10:00
Unverified
commit a8243c3e0e
391 changed files with 157678 additions and 0 deletions
Binary file not shown.
+528
View File
@@ -0,0 +1,528 @@
#include "Shadowmap.hlsli"
Texture2D<float4> Colourmap : register(t0);
Texture2D<float4> Bumpmap : register(t2);
Texture2D<float4> Specmap : register(t3);
Texture2D<float4> Detailmap : register(t4);
SamplerState TextureSS : register(s0);
cbuffer PSSceneVars : register(b0)
{
ShaderGlobalLightParams GlobalLights;
uint EnableShadows;
uint RenderMode;//0=default, 1=normals, 2=tangents, 3=colours, 4=texcoords, 5=diffuse, 6=normalmap, 7=spec, 8=direct
uint RenderModeIndex;
uint RenderSamplerCoord;
}
cbuffer PSGeomVars : register(b2)
{
uint EnableTexture;
uint EnableTint;
uint EnableNormalMap;
uint EnableSpecMap;
uint EnableDetailMap;
uint IsDecal;
uint IsEmissive;
uint IsDistMap;
float bumpiness;
float AlphaScale;
float HardAlphaBlend;
float useTessellation;
float4 detailSettings;
float3 specMapIntMask;
float specularIntensityMult;
float specularFalloffMult;
float specularFresnel;
float wetnessMultiplier;
uint SpecOnly;
}
struct VS_OUTPUT
{
float4 Position : SV_POSITION;
float3 Normal : NORMAL;
float2 Texcoord0 : TEXCOORD0;
float2 Texcoord1 : TEXCOORD1;
float2 Texcoord2 : TEXCOORD2;
float4 Shadows : TEXCOORD3;
float4 LightShadow : TEXCOORD4;
float4 Colour0 : COLOR0;
float4 Colour1 : COLOR1;
float4 Tint : COLOR2;
float4 Tangent : TEXCOORD5;
float4 Bitangent : TEXCOORD6;
float3 CamRelPos : TEXCOORD7;
};
float4 main(VS_OUTPUT input) : SV_TARGET
{
float4 c = float4(0.5, 0.5, 0.5, 1);
if (RenderMode == 0) c = float4(1, 1, 1, 1);
if (EnableTexture == 1)
{
float2 texc = input.Texcoord0;
if (RenderMode >= 5)
{
if (RenderSamplerCoord == 2) texc = input.Texcoord1;
else if (RenderSamplerCoord == 3) texc = input.Texcoord2;
}
c = Colourmap.Sample(TextureSS, texc);
if (IsDistMap) c = float4(c.rgb*2, (c.r+c.g+c.b) - 1);
if ((IsDecal == 0) && (c.a <= 0.33)) discard;
if ((IsDecal == 1) && (c.a <= 0.0)) discard;
if(IsDecal==0) c.a = 1;
c.a = saturate(c.a*AlphaScale);
}
if (EnableTint > 0)
{
c.rgb *= input.Tint.rgb;
}
if (IsDecal == 1)
{
c.a *= input.Colour0.a;
}
float3 norm = normalize(input.Normal);
if (RenderMode == 1) //normals
{
c.rgb = norm*0.5+0.5;
}
else if (RenderMode == 2) //tangents
{
c.rgb = normalize(input.Tangent.rgb)*0.5+0.5;
}
else if (RenderMode == 3) //colours
{
c.rgb = input.Colour0.rgb;
if (RenderModeIndex == 2) c.rgb = input.Colour1.rgb;
}
else if (RenderMode == 4) //texcoords
{
c.rgb = float3(input.Texcoord0, 0);
if (RenderModeIndex == 2) c.rgb = float3(input.Texcoord1, 0);
if (RenderModeIndex == 3) c.rgb = float3(input.Texcoord2, 0);
}
float3 spec = 0;
if (RenderMode == 0)
{
float4 nv = Bumpmap.Sample(TextureSS, input.Texcoord0); //sample r1.xyzw, v2.xyxx, t3.xyzw, s3 (BumpSampler)
float4 sv = Specmap.Sample(TextureSS, input.Texcoord0); //sample r2.xyzw, v2.xyxx, t4.xyzw, s4 (SpecSampler)
float2 nmv = nv.xy;
float4 r0 = 0, r1, r2, r3;
if (EnableNormalMap)
{
if (EnableDetailMap)
{
//detail normalmapp
r0.xy = input.Texcoord0 * detailSettings.zw; //mul r0.xy, v2.xyxx, detailSettings.zwzz
r0.zw = r0.xy * 3.17; //mul r0.zw, r0.xxxy, l(0.000000, 0.000000, 3.170000, 3.170000)
r0.xy = Detailmap.Sample(TextureSS, r0.xy).xy - 0.5; //sample r1.xyzw, r0.xyxx, t2.xyzw, s2 (DetailSampler) //mad r0.xy, r1.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
r0.zw = Detailmap.Sample(TextureSS, r0.zw).xy - 0.5; //sample r1.xyzw, r0.zwzz, t2.xyzw, s2 (DetailSampler) //mad r0.zw, r1.xxxy, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000) //r0.zw = r0.zw*0.5; //mul r0.zw, r0.zzzw, l(0.000000, 0.000000, 0.500000, 0.500000)
r0.xy = r0.xy + r0.zw; //mad r0.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), r0.zwzz
r0.yz = r0.xy * detailSettings.y; //mul r0.yz, r0.xxyx, detailSettings.yyyy
//r0.x = -r0.x*detailSettings.x; //mul r0.x, -r0.x, detailSettings.x
nmv = r0.yz*sv.w + nv.xy; //mad r0.yz, r0.yyzy, r2.wwww, r1.xxyx //add detail to normal, using specmap(!)
}
norm = NormalMap(nmv, bumpiness, input.Normal.xyz, input.Tangent.xyz, input.Bitangent.xyz);
}
if (EnableSpecMap == 0)
{
sv = float4(0.1,0.1,0.1,0.1);
}
float r1y = norm.z - 0.35; ////r1.y = r0.w*r1.x - 0.35; //mad r1.y, r0.w, r1.x, l(-0.350000)
float3 globalScalars = float3(0.5, 0.5, 0.5);
float globalScalars2z = 1;// 0.65; //wet darkness?
float wetness = 0;// 10.0;
r0.x = 0;// .5;
r0.z = 1 - globalScalars2z; //add r0.z, -globalScalars2.z, l(1.000000)
r0.y = saturate(r1y*1.538462); //mul_sat r0.y, r1.y, l(1.538462)
r0.y = r0.y * wetness; //mul r0.y, r0.y, gDynamicBakesAndWetness.z
r0.y = r0.y * r0.z; //mul r0.y, r0.z, r0.y
r1.yz = input.Colour0.xy * globalScalars.zy; //mul r1.yz, v1.xxyx, globalScalars.zzyz //vertex.colour0
r0.y = r0.y * r1.y; //mul r0.y, r0.y, r1.y
r0.x = r0.x * sv.w + 1.0; //mad r0.x, r0.x, r2.w, l(1.000000)
sv.xy = sv.xy*sv.xy; //mul r2.xy, r2.xyxx, r2.xyxx
r0.z = sv.w * specularFalloffMult; //mul r0.z, r2.w, specularFalloffMult
r3.y = r0.z * 0.001953125; //mul r3.y, r0.z, l(0.001953) (1/512)
r0.z = dot(sv.xyz, specMapIntMask); //dp3 r0.z, r2.xyzx, specMapIntMask.xyzx
r0.z = r0.z*specularIntensityMult; //mul r0.z, r0.z, specularIntensityMult
r3.x = r0.x * r0.z; //mul r3.x, r0.x, r0.z
r0.z = saturate(r0.z*r0.x + 0.4); //mad_sat r0.z, r0.z, r0.x, l(0.400000)
//sv.xy = r0.z*float2(0.5, 0.488281); //mul r2.xy, r0.zzzz, l(0.500000, 0.488281, 0.000000, 0.000000)
r0.z = 1 - r3.x*0.5; //mad r0.z, -r3.x, l(0.500000), l(1.000000)
r0.z = r0.z * r0.y; //mul r0.z, r0.z, r0.y
r0.y = r0.y * wetnessMultiplier; //mul r0.y, r0.y, wetnessMultiplier
r0.z = 1 - r0.z*0.5; //mad r0.z, r0.z, l(-0.500000), l(1.000000)
float3 tc = c.rgb * r0.x;
c.rgb = tc * r0.z; //diffuse factors...
float3 incident = normalize(input.CamRelPos);
float3 refl = normalize(reflect(incident, norm));
float specb = saturate(dot(refl, GlobalLights.LightDir));
float specp = max(exp(specb * 10) - 1, 0);
spec += GlobalLights.LightDirColour.rgb * 0.00006 * specp * r0.z * sv.x * specularIntensityMult;// ((specularIntensityMult != 0) ? 1 : 0);
if (SpecOnly == 1)
{
c.a *= (EnableSpecMap == 0) ? nv.a : saturate(specp);
}
}
float4 fc = c;
c.rgb = FullLighting(c.rgb, spec, norm, input.Colour0, GlobalLights, EnableShadows, input.Shadows.x, input.LightShadow);
if (IsEmissive==1)
{
c.rgb += fc.rgb;
}
else
{
}
//c.rgb = max(c.rgb, 0);
c.a = saturate(c.a);
return c;
}
//normal_spec_detail.fxc_PS_DeferredTextured
//mul r0.xy, v2.xyxx, detailSettings.zwzz
//mul r0.zw, r0.xxxy, l(0.000000, 0.000000, 3.170000, 3.170000)
//sample r1.xyzw, r0.xyxx, t2.xyzw, s2 (DetailSampler)
//mad r0.xy, r1.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
//sample r1.xyzw, r0.zwzz, t2.xyzw, s2 (DetailSampler)
//mad r0.zw, r1.xxxy, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
//mul r0.zw, r0.zzzw, l(0.000000, 0.000000, 0.500000, 0.500000)
//mad r0.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), r0.zwzz
//mul r0.yz, r0.xxyx, detailSettings.yyyy
//mul r0.x, -r0.x, detailSettings.x
//sample r1.xyzw, v2.xyxx, t3.xyzw, s3 (BumpSampler)
//sample r2.xyzw, v2.xyxx, t4.xyzw, s4 (SpecSampler)
//mad r0.yz, r0.yyzy, r2.wwww, r1.xxyx
//mad r0.yz, r0.yyzy, l(0.000000, 2.000000, 2.000000, 0.000000), l(0.000000, -1.000000, -1.000000, 0.000000)
//max r0.w, bumpiness, l(0.001000)
//mul r1.xy, r0.wwww, r0.yzyy
//dp2 r0.y, r0.yzyy, r0.yzyy
//add r0.y, -r0.y, l(1.000000)
//sqrt r0.y, |r0.y|
//mul r1.yzw, r1.yyyy, v5.xxyz
//mad r1.xyz, r1.xxxx, v4.xyzx, r1.yzwy
//mad r0.yzw, r0.yyyy, v3.xxyz, r1.xxyz
//dp3 r1.x, r0.yzwy, r0.yzwy
//rsq r1.x, r1.x
//mad r1.y, r0.w, r1.x, l(-0.350000)
//mul r0.yzw, r0.yyzw, r1.xxxx
//mad o1.xyz, r0.yzwy, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
//add r0.z, -globalScalars2.z, l(1.000000)
//mul_sat r0.y, r1.y, l(1.538462)
//mul r0.y, r0.y, gDynamicBakesAndWetness.z
//mul r0.y, r0.z, r0.y
//mul r1.yz, v1.xxyx, globalScalars.zzyz
//mul r0.y, r0.y, r1.y
//mad r0.x, r0.x, r2.w, l(1.000000)
//mul r2.xy, r2.xyxx, r2.xyxx
//mul r0.z, r2.w, specularFalloffMult
//mul r3.y, r0.z, l(0.001953)
//dp3 r0.z, r2.xyzx, specMapIntMask.xyzx
//mul r0.z, r0.z, specularIntensityMult
//mul r3.x, r0.x, r0.z
//mad_sat r0.z, r0.z, r0.x, l(0.400000)
//mul r2.xy, r0.zzzz, l(0.500000, 0.488281, 0.000000, 0.000000)
//mad r0.z, -r3.x, l(0.500000), l(1.000000)
//mul r0.z, r0.z, r0.y
//mul r0.y, r0.y, wetnessMultiplier
//mad r0.z, r0.z, l(-0.500000), l(1.000000)
//sample r4.xyzw, v2.xyxx, t0.xyzw, s0 //DiffuseSampler
//mul r4.xyzw, r0.xxxx, r4.xyzw
//mul o0.xyz, r0.zzzz, r4.xyzx
//mul r0.x, r4.w, v1.w
//mul o0.w, r0.x, globalScalars.x
//add r0.x, wetnessMultiplier, l(-0.200000)
//mul_sat r0.x, r0.x, l(10.000000)
//mad_sat r0.z, v3.z, l(128.000000), l(-127.000000)
//mul o1.w, r0.x, r0.z
//mov r2.z, l(0.970000)
//mov r3.z, specularFresnel
//add r0.xzw, r2.xxyz, -r3.xxyz
//max r0.xzw, r0.xxzw, l(0.000000, 0.000000, 0.000000, 0.000000)
//mad r0.xyz, r0.xzwx, r0.yyyy, r3.xyzx
//sqrt o2.xy, r0.xyxx
//mov o2.z, r0.z
//mov o2.w, l(1.000000)
//mad r1.x, v1.x, globalScalars.z, gLightArtificialIntAmbient0.w
//mul r0.xy, r1.xzxx, l(0.500000, 0.500000, 0.000000, 0.000000)
//sqrt o3.xy, r0.xyxx
//mov o3.zw, l(0,0,0,1.001884)
/*
//normal_spec.fxc_PS_DeferredTextured
//
max r0.x, bumpiness, l(0.001000) //cb12[1].w
sample r1.xyzw, v2.xyxx, BumpSampler.xyzw, s2
mad r0.yz, r1.xxyx, l(0.000000, 2.000000, 2.000000, 0.000000), l(0.000000, -1.000000, -1.000000, 0.000000)
mul r0.xw, r0.xxxx, r0.yyyz
dp2 r0.y, r0.yzyy, r0.yzyy
add r0.y, -r0.y, l(1.000000)
sqrt r0.y, |r0.y|
mul r1.xyz, r0.wwww, v5.xyzx
mad r0.xzw, r0.xxxx, v4.xxyz, r1.xxyz
mad r0.xyz, r0.yyyy, v3.xyzx, r0.xzwx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mad r1.x, r0.z, r0.w, l(-0.350000)
mul r0.xyz, r0.wwww, r0.xyzx
mad o1.xyz, r0.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
mul_sat r0.x, r1.x, l(1.538462)
mul r0.x, r0.x, gDynamicBakesAndWetness.z //cb5[3].z
add r0.y, -globalScalars2.z, l(1.000000) //cb2[12].z
mul r0.x, r0.y, r0.x
mul r1.yz, v1.xxyx, globalScalars.zzyz //vertex.colour0, cb2[11].zzyz
mul r0.x, r0.x, r1.y
sample r2.xyzw, v2.xyxx, SpecSampler.xyzw, s3
mul r2.xy, r2.xyxx, r2.xyxx
mul r0.y, r2.w, specularFalloffMult //cb12[0].y
mul r3.y, r0.y, l(0.001953)
dp3 r0.y, r2.xyzx, specMapIntMask.xyzx //cb12[1].xyzx
mul r3.x, r0.y, specularIntensityMult //cb12[0].z
mad_sat r0.y, r0.y, specularIntensityMult, l(0.400000) //cb12[0].z
mul r2.xy, r0.yyyy, l(0.500000, 0.488281, 0.000000, 0.000000)
mad r0.y, -r3.x, l(0.500000), l(1.000000)
mul r0.y, r0.y, r0.x
mul r0.x, r0.x, wetnessMultiplier; //cb12[2].x
mad r0.y, r0.y, l(-0.500000), l(1.000000)
sample r4.xyzw, v2.xyxx, DiffuseSampler.xyzw, s0
mul o0.xyz, r0.yyyy, r4.xyzx
mul r0.y, r4.w, v1.w //vertex.colour0
mul o0.w, r0.y, globalScalars.x //cb2[11].x
add r0.y, wetnessMultiplier, l(-0.200000) //cb12[2].x
mul_sat r0.y, r0.y, l(10.000000)
mad_sat r0.z, v3.z, l(128.000000), l(-127.000000)
mul o1.w, r0.y, r0.z
mov r2.z, l(0.970000)
mov r3.z, specularFresnel //cb12[0].x
add r0.yzw, r2.xxyz, -r3.xxyz
max r0.yzw, r0.yyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
mad r0.xyz, r0.yzwy, r0.xxxx, r3.xyzx
sqrt o2.xy, r0.xyxx
mov o2.z, r0.z
mov o2.w, l(1.000000)
mad r1.x, v1.x, globalScalars.z, gLightArtificialIntAmbient0.w //vertex.colour0, cb2[11].z, cb3[45].w
mul r0.xy, r1.xzxx, l(0.500000, 0.500000, 0.000000, 0.000000)
sqrt o3.xy, r0.xyxx
mov o3.zw, l(0,0,0,1.001884)
ret
// Approximately 54 instruction slots used
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// Resource Bindings:
//
// Name Type Format Dim HLSL Bind Count
// ------------------------------ ---------- ------- ----------- -------------- ------
// DiffuseSampler sampler NA NA s0 1
// BumpSampler sampler NA NA s2 1
// SpecSampler sampler NA NA s3 1
// DiffuseSampler texture float4 2d t0 1
// BumpSampler texture float4 2d t2 1
// SpecSampler texture float4 2d t3 1
// misc_globals cbuffer NA NA cb2 1
// lighting_globals cbuffer NA NA cb3 1
// more_stuff cbuffer NA NA cb5 1
// megashader_locals cbuffer NA NA cb12 1
//
//
// Buffer Definitions:
//
// cbuffer misc_globals
// {
//
// float4 globalFade; // Offset: 0 Size: 16 [unused]
// float globalHeightScale; // Offset: 16 Size: 4 [unused]
// float4 g_Rage_Tessellation_CameraPosition;// Offset: 32 Size: 16 [unused]
// float4 g_Rage_Tessellation_CameraZAxis;// Offset: 48 Size: 16 [unused]
// float4 g_Rage_Tessellation_ScreenSpaceErrorParams;// Offset: 64 Size: 16 [unused]
// float4 g_Rage_Tessellation_LinearScale;// Offset: 80 Size: 16 [unused]
// float4 g_Rage_Tessellation_Frustum[4];// Offset: 96 Size: 64 [unused]
// float4 g_Rage_Tessellation_Epsilons;// Offset: 160 Size: 16 [unused]
// float4 globalScalars; // Offset: 176 Size: 16
// float4 globalScalars2; // Offset: 192 Size: 16
// float4 globalScalars3; // Offset: 208 Size: 16 [unused]
// float4 globalScreenSize; // Offset: 224 Size: 16 [unused]
// uint4 gTargetAAParams; // Offset: 240 Size: 16 [unused]
// float4 colorize; // Offset: 256 Size: 16 [unused]
// float4 gGlobalParticleShadowBias; // Offset: 272 Size: 16 [unused]
// float gGlobalParticleDofAlphaScale;// Offset: 288 Size: 4 [unused]
// float gGlobalFogIntensity; // Offset: 292 Size: 4 [unused]
// float4 gPlayerLFootPos; // Offset: 304 Size: 16 [unused]
// float4 gPlayerRFootPos; // Offset: 320 Size: 16 [unused]
//
// }
//
// cbuffer lighting_globals
// {
//
// float4 gDirectionalLight; // Offset: 0 Size: 16 [unused]
// float4 gDirectionalColour; // Offset: 16 Size: 16 [unused]
// int gNumForwardLights; // Offset: 32 Size: 4 [unused]
// float4 gLightPositionAndInvDistSqr[8];// Offset: 48 Size: 128 [unused]
// float4 gLightDirectionAndFalloffExponent[8];// Offset: 176 Size: 128 [unused]
// float4 gLightColourAndCapsuleExtent[8];// Offset: 304 Size: 128 [unused]
// float gLightConeScale[8]; // Offset: 432 Size: 116 [unused]
// float gLightConeOffset[8]; // Offset: 560 Size: 116 [unused]
// float4 gLightNaturalAmbient0; // Offset: 688 Size: 16 [unused]
// float4 gLightNaturalAmbient1; // Offset: 704 Size: 16 [unused]
// float4 gLightArtificialIntAmbient0;// Offset: 720 Size: 16
// float4 gLightArtificialIntAmbient1;// Offset: 736 Size: 16 [unused]
// float4 gLightArtificialExtAmbient0;// Offset: 752 Size: 16 [unused]
// float4 gLightArtificialExtAmbient1;// Offset: 768 Size: 16 [unused]
// float4 gDirectionalAmbientColour; // Offset: 784 Size: 16 [unused]
// float4 globalFogParams[5]; // Offset: 800 Size: 80 [unused]
// float4 globalFogColor; // Offset: 880 Size: 16 [unused]
// float4 globalFogColorE; // Offset: 896 Size: 16 [unused]
// float4 globalFogColorN; // Offset: 912 Size: 16 [unused]
// float4 globalFogColorMoon; // Offset: 928 Size: 16 [unused]
// float4 gReflectionTweaks; // Offset: 944 Size: 16 [unused]
//
// }
//
// cbuffer more_stuff
// {
//
// float4 gEntitySelectColor[2]; // Offset: 0 Size: 32 [unused]
// float4 gAmbientOcclusionEffect; // Offset: 32 Size: 16 [unused]
// float4 gDynamicBakesAndWetness; // Offset: 48 Size: 16
// float4 gAlphaRefVec0; // Offset: 64 Size: 16 [unused]
// float4 gAlphaRefVec1; // Offset: 80 Size: 16 [unused]
// float gAlphaTestRef; // Offset: 96 Size: 4 [unused]
// bool gTreesUseDiscard; // Offset: 100 Size: 4 [unused]
// float gReflectionMipCount; // Offset: 104 Size: 4 [unused]
// bool gUseTransparencyAA; // Offset: 108 Size: 4 [unused]
// bool gUseFogRay; // Offset: 112 Size: 4 [unused]
//
// }
//
// cbuffer megashader_locals
// {
//
// float specularFresnel; // Offset: 0 Size: 4
// float specularFalloffMult; // Offset: 4 Size: 4
// float specularIntensityMult; // Offset: 8 Size: 4
// float3 specMapIntMask; // Offset: 16 Size: 12
// float bumpiness; // Offset: 28 Size: 4
// float wetnessMultiplier; // Offset: 32 Size: 4
// float useTessellation; // Offset: 36 Size: 4 [unused]
// float HardAlphaBlend; // Offset: 40 Size: 4 [unused]
//
// }
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float
// COLOR 0 xyzw 1 NONE float xy w
// TEXCOORD 0 xy 2 NONE float xy
// TEXCOORD 1 xyz 3 NONE float xyz
// TEXCOORD 4 xyz 4 NONE float xyz
// TEXCOORD 5 xyz 5 NONE float xyz
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
// SV_Target 1 xyzw 1 TARGET float xyzw
// SV_Target 2 xyzw 2 TARGET float xyzw
// SV_Target 3 xyzw 3 TARGET float xyzw
//
ps_4_0
dcl_constantbuffer CB2[13], immediateIndexed
dcl_constantbuffer CB3[46], immediateIndexed
dcl_constantbuffer CB5[4], immediateIndexed
dcl_constantbuffer CB12[3], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_input_ps linear v1.xyw
dcl_input_ps linear v2.xy
dcl_input_ps linear v3.xyz
dcl_input_ps linear v4.xyz
dcl_input_ps linear v5.xyz
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_temps 5
*/
+755
View File
@@ -0,0 +1,755 @@
#include "Quaternion.hlsli"
#include "Shadowmap.hlsli"
cbuffer VSSceneVars : register(b0)
{
float4x4 ViewProj;
float4 WindVector;
}
cbuffer VSEntityVars : register(b2)
{
float4 CamRel;
float4 Orientation;
uint HasSkeleton;
uint HasTransforms;
uint TintPaletteIndex;
uint Pad1;
float3 Scale;
uint IsInstanced;
}
cbuffer VSModelVars : register(b3)
{
float4x4 Transform;
}
cbuffer VSGeomVars : register(b4)
{
uint EnableTint;
float TintYVal;
uint IsDecal;
uint EnableWind;
float4 WindOverrideParams;
}
cbuffer VSInstGlobals : register(b5)
{
float4 gInstanceVars[24]; //instance rotation matrices
}
cbuffer VSInstLocals : register(b6)
{
float3 vecBatchAabbMin; // Offset: 0 Size: 12
float instPad0;
float3 vecBatchAabbDelta; // Offset: 16 Size: 12
float instPad1;
float4 vecPlayerPos; // Offset: 32 Size: 16
float2 _vecCollParams; // Offset: 48 Size: 8
float2 instPad2;
float4 fadeAlphaDistUmTimer; // Offset: 256 Size: 16
float4 uMovementParams; // Offset: 272 Size: 16
float4 _fakedGrassNormal; // Offset: 288 Size: 16 [unused]
float3 gScaleRange; // Offset: 304 Size: 12
float instPad3;
float4 gWindBendingGlobals; // Offset: 320 Size: 16
float2 gWindBendScaleVar; // Offset: 336 Size: 8
float gAlphaTest; // Offset: 344 Size: 4 [unused]
float gAlphaToCoverageScale; // Offset: 348 Size: 4 [unused]
float3 gLodFadeInstRange; // Offset: 352 Size: 12 [unused]
uint gUseComputeShaderOutputBuffer;// Offset: 364 Size: 4
}
struct VS_OUTPUT
{
float4 Position : SV_POSITION;
float3 Normal : NORMAL;
float2 Texcoord0 : TEXCOORD0;
float2 Texcoord1 : TEXCOORD1;
float2 Texcoord2 : TEXCOORD2;
float4 Shadows : TEXCOORD3;
float4 LightShadow : TEXCOORD4;
float4 Colour0 : COLOR0;
float4 Colour1 : COLOR1;
float4 Tint : COLOR2;
float4 Tangent : TEXCOORD5;
float4 Bitangent : TEXCOORD6;
float3 CamRelPos : TEXCOORD7;
};
Texture2D<float4> TintPalette : register(t0);
SamplerState TextureSS : register(s0);
struct rage__fwGrassInstanceListDef__InstanceData //16 bytes, Key:2740378365 rage__fwGrassInstanceListDef__InstanceData//3985044770
{
uint PosXY_u16; // Offset: 0
uint PosZ_u16_NormXY_u8; // Offset: 4
uint ColorRGB_Scale_u8; // Offset: 8
uint Ao_Pad3_u8; // Offset: 12
};
StructuredBuffer<rage__fwGrassInstanceListDef__InstanceData> GrassInstances : register(t2);
float3 GetGrassInstancePosition(float3 ipos, float3 vc0, float3 vc1, uint iid)
{
float3 opos = ipos;
float4 windBendParam = float4(gWindBendScaleVar.xy, gWindBendingGlobals.xy);
if (EnableWind == 0)
{
windBendParam = 0;
}
float4 r0, r1, r2, r3, r4, r5, r6, r7;
uint4 u0, u1, u2, u6;
//r0.x = iid; //ld_structured r0.x, v5.x, l(0), t0.xxxx
//ushr r0.y, r0.x, l(16)
//and r0.y, r0.y, l(255)
//utof r0.y, r0.y
u0.y = (iid >> 16) & 255;
r0.y = (float)u0.y;
r1.y = r0.y * 0.0039215686; //mul r1.y, r0.y, l(0.003922)
//r2.x=iid //mov r2.x, v5.x
//r2.yz=1 //mov r2.yz, l(0,1.000000,1.000000,0)
u0.y = (iid >> 24); //ushr r0.y, r0.x, l(24)
u1.x = u0.x & 0xFFFF; //and r1.x, r0.x, l(0x0000ffff)
r0.x = (float)u0.y; //utof r0.x, r0.y
r1.z = r0.x * 0.0039215686; //mul r1.z, r0.x, l(0.003922)
r0.xyz = (gUseComputeShaderOutputBuffer != 0) ? float3(u1.x, r1.yz) : float3(iid, 1, 1); //movc r0.xyz, gUseComputeShaderOutputBuffer, r1.xyzx, r2.xyzx
float amo = r0.z*r0.y; //mul o4.x, r0.z, r0.y //alpha multiplier output
r0.xyz = float3(iid, 1, 1);
//ld_structured r1.xyzw, r0.x, l(0), t1.xyzw
rage__fwGrassInstanceListDef__InstanceData inst = GrassInstances[iid];
u1.x = inst.PosXY_u16;
u1.y = inst.PosZ_u16_NormXY_u8;
u1.z = inst.ColorRGB_Scale_u8;
u1.w = inst.Ao_Pad3_u8;
////debug positioning
//float px = (float)((u1.x & 0xFFFF));
//float py = (float)((u1.x >> 16) & 0xFFFF);
//float pz = (float)((u1.y & 0xFFFF));
//float3 pab = float3(px, py, pz)*0.000015;
//float3 fpos = vecBatchAabbMin.xyz + vecBatchAabbDelta.xyz * pab;
//return opos + fpos - vecPlayerPos.xyz;
u2.w = u1.z >> 8; //ushr r2.w, r1.z, l(8)
u2.xy = u1.xy >> 16; //ushr r2.xy, r1.xyxx, l(16)
u2.yz = u2.yw & 255; //and r2.yz, r2.yywy, l(0, 255, 255, 0)
r3.y = (float)u2.x; //utof r3.y, r2.x
r2.x = (float)u2.y; //utof r2.x, r2.y
u0.w = u1.y >> 24; //ushr r0.w, r1.y, l(24)
r2.y = (float)u0.w; //utof r2.y, r0.w
r2.xy = r2.xy*0.0078431373 - 1.0; //mad r2.xy, r2.xyxx, l(0.007843, 0.007843, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
r0.w = dot(r2.xy, r2.xy); //dp2 r0.w, r2.xyxx, r2.xyxx
r0.w = 1.0 - r0.w; //add r0.w, -r0.w, l(1.000000)
r2.z = sqrt(r0.w); //sqrt r2.z, r0.w
r0.w = r2.z*-0.018729 + 0.074261; //mad r0.w, r2.z, l(-0.018729), l(0.074261)
r0.w = r0.w*r2.z - 0.212114; //mad r0.w, r0.w, r2.z, l(-0.212114)
r0.w = r0.w*r2.z + 1.570729; //mad r0.w, r0.w, r2.z, l(1.570729)
r2.w = 1.0 - r2.z; //add r2.w, -r2.z, l(1.000000)
r2.w = sqrt(r2.w); //sqrt r2.w, r2.w
r2.xyz = -r2.z*float3(0, 0, 1) + r2.xyz; //mad r2.xyz, -r2.zzzz, l(0.000000, 0.000000, 1.000000, 0.000000), r2.xyzx
r0.w = r0.w*r2.w; //mul r0.w, r0.w, r2.w
r0.w = r0.w * vecPlayerPos.w; //mul r0.w, r0.w, vecPlayerPos.w
r5.x = sin(r0.w); //sincos r5.x, r6.x, r0.w
r6.x = cos(r0.w);
//r0.w = dot(r2.xyz, r2.xyz); //dp3 r0.w, r2.xyzx, r2.xyzx
//r0.w = 1.0 / sqrt(r0.w); //rsq r0.w, r0.w
//r2.xyz = r2.xyz*r0.w; //mul r2.xyz, r0.wwww, r2.xyzx
r2.xyz = normalize(r2.xyz);
r2.xyz = r2.xyz * r5.x; //mul r2.xyz, r5.xxxx, r2.xyzx
r2.xyz = r6.x*float3(0, 0, 1) + r2.xyz; //mad r2.xyz, r6.xxxx, l(0.000000, 0.000000, 1.000000, 0.000000), r2.xyzx
r5.xy = r2.yz*float2(1, 0); //mul r5.xy, r2.yzyy, l(1.000000, 0.000000, 0.000000, 0.000000)
r5.xy = r2.zx*float2(0, 1) - r5.xy; //mad r5.xy, r2.zxzz, l(0.000000, 1.000000, 0.000000, 0.000000), -r5.xyxx
r0.w = dot(r5.xy, r5.xy); //dp2 r0.w, r5.xyxx, r5.xyxx
r0.w = sqrt(r0.w); //sqrt r0.w, r0.w
r5.xy = r5.xy / r0.w; //div r5.xy, r5.xyxx, r0.wwww
r0.w = 1.0 - r2.z; //add r0.w, -r2.z, l(1.000000)
r2.w = r5.x*r0.w; //mul r2.w, r5.x, r0.w
r5.x = r2.w*r5.x + r2.z; //mad r5.x, r2.w, r5.x, r2.z
r5.z = r5.y*r2.w; //mul r5.z, r5.y, r2.w
r2.w = r5.y*r5.y; //mul r2.w, r5.y, r5.y
r5.w = r2.w*r0.w + r2.z; //mad r5.w, r2.w, r0.w, r2.z
u0.w = r2.z < 1.0; //lt r0.w, r2.z, l(1.000000)
r2.xyz = r2.xyz*float3(-1, -1, 1); //mul r2.xyz, r2.xyzx, l(-1.000000, -1.000000, 1.000000, 0.000000)
r2.xyz = (u0.w != 0) ? r2.xyz : float3(0, 0, 1); //movc r2.xyz, r0.wwww, r2.xyzx, l(0, 0, 1.000000, 0)
r5.xyz = (u0.w != 0) ? r5.xzw : float3(1, 0, 1); //movc r5.xyz, r0.wwww, r5.xzwx, l(1.000000, 0, 1.000000, 0)
r0.w = vc0.y * 6.283185; //mul r0.w, v2.y, l(6.283185)
r6.xyz = fadeAlphaDistUmTimer.z*uMovementParams.zzw + r0.w; //mad r6.xyz, fadeAlphaDistUmTimer.zzzz, uMovementParams.zzwz, r0.wwww
r6.xyz = sin(r6.xyz); //sincos r6.xyz, null, r6.xyzx
r0.w = 1.0 - vc0.z; //add r0.w, -v2.z, l(1.000000)
r7.z = r0.w * uMovementParams.y; //mul r7.z, r0.w, uMovementParams.y
r7.xy = vc0.x * uMovementParams.x; //mul r7.xy, v2.xxxx, uMovementParams.xxxx
r6.xyz = r6.xyz * r7.xyz; //mul r6.xyz, r6.xyzx, r7.xyzx
u0.w = u1.z >> 24; //ushr r0.w, r1.z, l(24)
r0.w = (float)u0.w; //utof r0.w, r0.w
r0.w = r0.w * 0.0039215686; //mul r0.w, r0.w, l(0.003922)
r2.w = gScaleRange.y - gScaleRange.x; //add r2.w, -gScaleRange.x, gScaleRange.y
r0.w = r2.w*r0.w + gScaleRange.x; //mad r0.w, r2.w, r0.w, gScaleRange.x
r2.w = gScaleRange.z * gScaleRange.y; //mul r2.w, gScaleRange.z, gScaleRange.y
u0.x = iid & 7; //and r0.x, r0.x, l(7)
u0.x = u0.x * 3; //imul null, r0.x, r0.x, l(3)
r2.w = dot(gInstanceVars[u0.x].ww, r2.ww); //dp2 r2.w, gInstanceVars[r0.x + 0].wwww, r2.wwww
r2.w = -gScaleRange.y * gScaleRange.z + r2.w; //mad r2.w, -gScaleRange.y, gScaleRange.z, r2.w
r0.w = r0.w + r2.w; //add r0.w, r0.w, r2.w
r0.w = max(r0.w, 0.0); //max r0.w, r0.w, l(0.000000)
r0.w = r0.w * r0.z; //mul r0.w, r0.z, r0.w //compute cull scale fadeout?
r0.yzw = opos*r0.w + r6.xyz; //mad r0.yzw, v0.xxyz, r0.wwww, r6.xxyz //scale and offset (movement?)
r6.xyz = r0.z * gInstanceVars[u0.x + 1].xyz; //mul r6.xyz, r0.zzzz, gInstanceVars[r0.x + 1].xyzx //rotate vertex positions with instance matrix
r6.xyz = r0.y * gInstanceVars[u0.x].xyz + r6.xyz; //mad r6.xyz, r0.yyyy, gInstanceVars[r0.x + 0].xyzx, r6.xyzx
r0.yzw = r0.w * gInstanceVars[u0.x + 2].xyz + r6.xyz; //mad r0.yzw, r0.wwww, gInstanceVars[r0.x + 2].xxyz, r6.xxyz
//instance matrices!!!
u6.xyzw = u1.xyzw & uint4(0xFFFF, 0xFFFF, 255, 255); //and r6.xyzw, r1.xyzw, l(0x0000ffff, 0x0000ffff, 255, 255)
u1.x = u1.z >> 16; //ushr r1.x, r1.z, l(16)
u1.x = u1.x & 255; //and r1.x, r1.x, l(255)
r3.xzw = (float3)u6.xyw; //utof r3.xzw, r6.xxyw
r4.z = (float)u1.x; //utof r4.z, r1.x
r4.y = (float)u2.z; //utof r4.y, r2.z
r4.x = (float)u6.z; //utof r4.x, r6.z
float3 tnt = r4.xyz * 0.0039215686; //mul o1.xyz, r4.xyzx, l(0.003922, 0.003922, 0.003922, 0.000000) ///colour tint output
float aoo = r3.w * 0.0039215686; //mul o4.y, r3.w, l(0.003922) //ambient occlusion value output
r1.xyz = r3.xyz*vecBatchAabbDelta.xyz; //mul r1.xyz, r3.xyzx, vecBatchAabbDelta.xyzx
r1.xyz = r1.xyz/65535 + vecBatchAabbMin.xyz; //mad r1.xyz, r1.xyzx, l(0.000015, 0.000015, 0.000015, 0.000000), vecBatchAabbMin.xyzx
r1.w = dot(r1.xyz, r1.xyz); //dp3 r1.w, r1.xyzx, r1.xyzx
r1.w = cos(r1.w); //sincos null, r1.w, r1.w
r1.w = r1.w*0.5 + 0.5; //mad r1.w, r1.w, l(0.500000), l(0.500000)
r1.w = r1.w*windBendParam.y + 1.0; //gWindBendScaleVar.y + 1.0; //mad r1.w, gWindBendScaleVar.y, r1.w, l(1.000000)
r1.w = r1.w*windBendParam.x; //gWindBendScaleVar.x; //mul r1.w, r1.w, gWindBendScaleVar.x
r3.xy = r1.w*windBendParam.zw; //gWindBendingGlobals.xy; //mul r3.xy, r1.wwww, gWindBendingGlobals.xyxx
r5.w = r3.x; //mov r5.w, r3.x
r4.x = dot(r0.yzw, r5.xyw); //dp3 r4.x, r0.yzwy, r5.xywx
r3.zw = r5.yz; //mov r3.zw, r5.yyyz
r4.y = dot(r0.wyz, r3.yzw); //dp3 r4.y, r0.wyzw, r3.yzwy
r4.z = dot(r0.yzw, r2.xyz); //dp3 r4.z, r0.yzwy, r2.xyzx
r0.yzw = r1.xyz + r4.xyz; //add r0.yzw, r1.xxyz, r4.xxyz //add vertex position to instance position
r1.yzw = r0.yzw - (vecPlayerPos.xyz - float3(0,0,-0.2)); //add r1.yzw, r0.yyzw, -vecPlayerPos.xxyz
r1.w = dot(r1.yzw, r1.yzw); //dp3 r1.w, r1.yzwy, r1.yzwy
r2.w = 1.0 / sqrt(r1.w); //rsq r2.w, r1.w
r1.w = _vecCollParams.x - r1.w; //add r1.w, -r1.w, _vecCollParams.x
r1.w = saturate(_vecCollParams.y * r1.w); //mul_sat r1.w, r1.w, _vecCollParams.y
r1.w = r1.w * 0.5; //mul r1.w, r1.w, l(0.500000)
r1.yz = r1.yz * r2.w; //mul r1.yz, r1.yyzy, r2.wwww
r1.yz = r1.yz * r1.w; //mul r1.yz, r1.yyzy, r1.wwww
r0.yz = r1.yz * vc1.z + r0.yz; //mad r0.yz, r1.yyzy, v3.zzzz, r0.yyzy //contribute player collision
//float3 fpos = r0.yzw;
return r0.yzw - vecPlayerPos.xyz;
//return CamRel.xyz + opos;
}
float3 ModelTransform(float3 ipos, float3 vc0, float3 vc1, uint iid)
{
if (IsInstanced)
{
return GetGrassInstancePosition(ipos, vc0, vc1, iid);
}
else
{
float3 tpos = (HasTransforms == 1) ? mul(float4(ipos, 1), Transform).xyz : ipos;
float3 spos = tpos * Scale;
float3 bpos = mulvq(spos, Orientation);
if (EnableWind)
{
bpos = GeomWindMotion(bpos, vc0, WindVector, WindOverrideParams);
}
return CamRel.xyz + bpos;
}
}
float4 ScreenTransform(float3 opos)
{
float4 pos = float4(opos, 1);
float4 cpos = mul(pos, ViewProj);
//if (IsDecal == 1)
//{
// //cpos.z -= 0.003; //todo: correct decal z-bias
//}
cpos.z = DepthFunc(cpos.zw);
return cpos;
}
float3 NormalTransform(float3 inorm)
{
float3 tnorm = (HasTransforms == 1) ? mul(inorm, (float3x3)Transform) : inorm;
float3 bnorm = normalize(mulvq(tnorm, Orientation));
return bnorm;
}
float4 ColourTint(float tx, float tx2, uint iid)
{
float4 tnt = 1;
if (IsInstanced)
{
//RenderableGrassInstance inst = GrassInstances[iid];
//tnt = Unpack4x8UNF(inst.Colour);
rage__fwGrassInstanceListDef__InstanceData inst = GrassInstances[iid];
uint c = inst.ColorRGB_Scale_u8;
float3 rgb = float3(c & 0xFF, (c >> 8) & 0xFF, (c >> 16) & 0xFF);
tnt = float4(rgb * 0.003922, 1);
}
else if (EnableTint > 0)
{
float tu = (EnableTint == 1) ? tx : tx2;
tnt = TintPalette.SampleLevel(TextureSS, float2(tu, TintYVal), 0);
}
return tnt;
}
//grass_batch.fxc_VS_Transform
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// Buffer Definitions:
//
// cbuffer rage_matrices
// {
//
// row_major float4x4 gWorld; // Offset: 0 Size: 64 [unused]
// row_major float4x4 gWorldView; // Offset: 64 Size: 64 [unused]
// row_major float4x4 gWorldViewProj; // Offset: 128 Size: 64
// row_major float4x4 gViewInverse; // Offset: 192 Size: 64 [unused]
//
// }
//
// cbuffer grassglobals
// {
//
// bool bVehColl0Enabled; // Offset: 0 Size: 4
// bool bVehColl1Enabled; // Offset: 4 Size: 4
// bool bVehColl2Enabled; // Offset: 8 Size: 4
// bool bVehColl3Enabled; // Offset: 12 Size: 4
// float4 depthValueBias; // Offset: 16 Size: 16 [unused]
//
// }
//
// cbuffer grassbatchlocals
// {
//
// float3 vecBatchAabbMin; // Offset: 0 Size: 12
// float3 vecBatchAabbDelta; // Offset: 16 Size: 12
// float4 vecPlayerPos; // Offset: 32 Size: 16
// float2 _vecCollParams; // Offset: 48 Size: 8
// float4 _vecVehColl0B; // Offset: 64 Size: 16
// float4 _vecVehColl0M; // Offset: 80 Size: 16
// float4 _vecVehColl0R; // Offset: 96 Size: 16
// float4 _vecVehColl1B; // Offset: 112 Size: 16
// float4 _vecVehColl1M; // Offset: 128 Size: 16
// float4 _vecVehColl1R; // Offset: 144 Size: 16
// float4 _vecVehColl2B; // Offset: 160 Size: 16
// float4 _vecVehColl2M; // Offset: 176 Size: 16
// float4 _vecVehColl2R; // Offset: 192 Size: 16
// float4 _vecVehColl3B; // Offset: 208 Size: 16
// float4 _vecVehColl3M; // Offset: 224 Size: 16
// float4 _vecVehColl3R; // Offset: 240 Size: 16
// float4 fadeAlphaDistUmTimer; // Offset: 256 Size: 16
// float4 uMovementParams; // Offset: 272 Size: 16
// float4 _fakedGrassNormal; // Offset: 288 Size: 16 [unused]
// float3 gScaleRange; // Offset: 304 Size: 12
// float4 gWindBendingGlobals; // Offset: 320 Size: 16
// float2 gWindBendScaleVar; // Offset: 336 Size: 8
// float gAlphaTest; // Offset: 344 Size: 4 [unused]
// float gAlphaToCoverageScale; // Offset: 348 Size: 4 [unused]
// float3 gLodFadeInstRange; // Offset: 352 Size: 12 [unused]
// uint gUseComputeShaderOutputBuffer;// Offset: 364 Size: 4
// float2 gInstCullParams; // Offset: 368 Size: 8 [unused]
// uint gNumClipPlanes; // Offset: 376 Size: 4 [unused]
// float4 gClipPlanes[16]; // Offset: 384 Size: 256 [unused]
// float3 gCameraPosition; // Offset: 640 Size: 12 [unused]
// uint gLodInstantTransition; // Offset: 652 Size: 4 [unused]
// float4 gLodThresholds; // Offset: 656 Size: 16 [unused]
// float2 gCrossFadeDistance; // Offset: 672 Size: 8 [unused]
// float2 gLodFadeStartDist; // Offset: 680 Size: 8 [unused]
// float2 gLodFadeRange; // Offset: 688 Size: 8 [unused]
// float2 gLodFadePower; // Offset: 696 Size: 8 [unused]
// float2 gLodFadeTileScale; // Offset: 704 Size: 8 [unused]
// uint gIsShadowPass; // Offset: 712 Size: 4 [unused]
// float3 gLodFadeControlRange; // Offset: 720 Size: 12 [unused]
// float4 bDebugSwitches; // Offset: 736 Size: 16 [unused]
//
// }
//
// cbuffer grassbatch_instmtx
// {
//
// float4 gInstanceVars[24]; // Offset: 0 Size: 384
//
// }
//
// Resource bind info for InstanceBuffer
// {
//
// struct
// {
//
// uint InstId_u16_CrossFade_Scale_u8;// Offset: 0
//
// } $Element; // Offset: 0 Size: 4
//
// }
//
// Resource bind info for RawInstanceBuffer
// {
//
// struct
// {
//
// uint PosXY_u16; // Offset: 0
// uint PosZ_u16_NormXY_u8; // Offset: 4
// uint ColorRGB_Scale_u8; // Offset: 8
// uint Ao_Pad3_u8; // Offset: 12
//
// } $Element; // Offset: 0 Size: 16
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim HLSL Bind Count
// ------------------------------ ---------- ------- ----------- -------------- ------
// InstanceBuffer texture struct r/o t0 1
// RawInstanceBuffer texture struct r/o t1 1
// rage_matrices cbuffer NA NA cb1 1
// grassglobals cbuffer NA NA cb4 1
// grassbatch_instmtx cbuffer NA NA cb7 1
// grassbatchlocals cbuffer NA NA cb11 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION 0 xyzw 0 NONE float xyz
// NORMAL 0 xyz 1 NONE float xyz
// COLOR 0 xyzw 2 NONE float xyz
// COLOR 1 xyzw 3 NONE float x z
// TEXCOORD 0 xy 4 NONE float xy
// SV_InstanceID 0 x 5 INSTID uint x
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float xyzw
// TEXCOORD 0 xyzw 1 NONE float xyzw
// TEXCOORD 1 xyzw 2 NONE float xyzw
// TEXCOORD 2 xyzw 3 NONE float xyzw
// TEXCOORD 5 xy 4 NONE float xy
//
/*
vs_4_0
dcl_globalFlags refactoringAllowed | enableRawAndStructuredBuffers
dcl_constantbuffer CB1[12], immediateIndexed
dcl_constantbuffer CB4[1], immediateIndexed
dcl_constantbuffer CB11[23], immediateIndexed
dcl_constantbuffer CB7[24], dynamicIndexed
dcl_resource_structured t0, 4
dcl_resource_structured t1, 16
dcl_input v0.xyz
dcl_input v1.xyz
dcl_input v2.xyz
dcl_input v3.xz
dcl_input v4.xy
dcl_input_sgv v5.x, instance_id
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xy
dcl_temps 8
ld_structured r0.x, v5.x, l(0), t0.xxxx
ushr r0.y, r0.x, l(16)
and r0.y, r0.y, l(255)
utof r0.y, r0.y
mul r1.y, r0.y, l(0.003922)
mov r2.x, v5.x
mov r2.yz, l(0,1.000000,1.000000,0)
ushr r0.y, r0.x, l(24)
and r1.x, r0.x, l(0x0000ffff)
utof r0.x, r0.y
mul r1.z, r0.x, l(0.003922)
movc r0.xyz, gUseComputeShaderOutputBuffer, r1.xyzx, r2.xyzx
ld_structured r1.xyzw, r0.x, l(0), t1.xyzw
ushr r2.w, r1.z, l(8)
ushr r2.xy, r1.xyxx, l(16)
and r2.yz, r2.yywy, l(0, 255, 255, 0)
utof r3.y, r2.x
utof r2.x, r2.y
utof r4.y, r2.z
ushr r0.w, r1.y, l(24)
utof r2.y, r0.w
mad r2.xy, r2.xyxx, l(0.007843, 0.007843, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r0.w, r2.xyxx, r2.xyxx
add r0.w, -r0.w, l(1.000000)
sqrt r2.z, r0.w
mad r0.w, r2.z, l(-0.018729), l(0.074261)
mad r0.w, r0.w, r2.z, l(-0.212114)
mad r0.w, r0.w, r2.z, l(1.570729)
add r2.w, -r2.z, l(1.000000)
mad r2.xyz, -r2.zzzz, l(0.000000, 0.000000, 1.000000, 0.000000), r2.xyzx
sqrt r2.w, r2.w
mul r0.w, r0.w, r2.w
mul r0.w, r0.w, vecPlayerPos.w
sincos r5.x, r6.x, r0.w
dp3 r0.w, r2.xyzx, r2.xyzx
rsq r0.w, r0.w
mul r2.xyz, r0.wwww, r2.xyzx
mul r2.xyz, r5.xxxx, r2.xyzx
mad r2.xyz, r6.xxxx, l(0.000000, 0.000000, 1.000000, 0.000000), r2.xyzx
mul r5.xy, r2.yzyy, l(1.000000, 0.000000, 0.000000, 0.000000)
mad r5.xy, r2.zxzz, l(0.000000, 1.000000, 0.000000, 0.000000), -r5.xyxx
dp2 r0.w, r5.xyxx, r5.xyxx
sqrt r0.w, r0.w
div r5.xy, r5.xyxx, r0.wwww
add r0.w, -r2.z, l(1.000000)
mul r2.w, r5.x, r0.w
mad r5.x, r2.w, r5.x, r2.z
mul r5.z, r5.y, r2.w
mul r2.w, r5.y, r5.y
mad r5.w, r2.w, r0.w, r2.z
lt r0.w, r2.z, l(1.000000)
mul r2.xyz, r2.xyzx, l(-1.000000, -1.000000, 1.000000, 0.000000)
movc r2.xyz, r0.wwww, r2.xyzx, l(0,0,1.000000,0)
movc r5.xyz, r0.wwww, r5.xzwx, l(1.000000,0,1.000000,0)
mul r0.w, v2.y, l(6.283185)
mad r6.xyz, fadeAlphaDistUmTimer.zzzz, uMovementParams.zzwz, r0.wwww
sincos r6.xyz, null, r6.xyzx
add r0.w, -v2.z, l(1.000000)
mul r7.z, r0.w, uMovementParams.y
mul r7.xy, v2.xxxx, uMovementParams.xxxx
mul r6.xyz, r6.xyzx, r7.xyzx
ushr r0.w, r1.z, l(24)
utof r0.w, r0.w
mul r0.w, r0.w, l(0.003922)
add r2.w, -gScaleRange.x, gScaleRange.y
mad r0.w, r2.w, r0.w, gScaleRange.x
mul r2.w, gScaleRange.z, gScaleRange.y
and r0.x, r0.x, l(7)
imul null, r0.x, r0.x, l(3)
dp2 r2.w, gInstanceVars[r0.x + 0].wwww, r2.wwww
mad r2.w, -gScaleRange.y, gScaleRange.z, r2.w
add r0.w, r0.w, r2.w
max r0.w, r0.w, l(0.000000)
mul r0.w, r0.z, r0.w
mul o4.x, r0.z, r0.y //alpha multiplier output
mad r0.yzw, v0.xxyz, r0.wwww, r6.xxyz //scale and offset (movement?)
mul r6.xyz, r0.zzzz, gInstanceVars[r0.x + 1].xyzx //rotate vertex positions with instance matrix
mad r6.xyz, r0.yyyy, gInstanceVars[r0.x + 0].xyzx, r6.xyzx
mad r0.yzw, r0.wwww, gInstanceVars[r0.x + 2].xxyz, r6.xxyz
and r6.xyzw, r1.xyzw, l(0x0000ffff, 0x0000ffff, 255, 255)
ushr r1.x, r1.z, l(16)
and r1.x, r1.x, l(255)
utof r4.z, r1.x
utof r3.xzw, r6.xxyw
utof r4.x, r6.z
mul o1.xyz, r4.xyzx, l(0.003922, 0.003922, 0.003922, 0.000000) ///colour tint output
mul o4.y, r3.w, l(0.003922) //ambient occlusion value output
mul r1.xyz, r3.xyzx, vecBatchAabbDelta.xyzx
mad r1.xyz, r1.xyzx, l(0.000015, 0.000015, 0.000015, 0.000000), vecBatchAabbMin.xyzx
dp3 r1.w, r1.xyzx, r1.xyzx
sincos null, r1.w, r1.w
mad r1.w, r1.w, l(0.500000), l(0.500000)
mad r1.w, gWindBendScaleVar.y, r1.w, l(1.000000)
mul r1.w, r1.w, gWindBendScaleVar.x
mul r3.xy, r1.wwww, gWindBendingGlobals.xyxx
mov r5.w, r3.x
dp3 r4.x, r0.yzwy, r5.xywx
mov r3.zw, r5.yyyz
dp3 r4.y, r0.wyzw, r3.yzwy
dp3 r4.z, r0.yzwy, r2.xyzx
add r0.yzw, r1.xxyz, r4.xxyz //add vertex position to instance position
add r1.yzw, r0.yyzw, -vecPlayerPos.xxyz
dp3 r1.w, r1.yzwy, r1.yzwy
rsq r2.w, r1.w
add r1.w, -r1.w, _vecCollParams.x
mul_sat r1.w, r1.w, _vecCollParams.y
mul r1.w, r1.w, l(0.500000)
mul r1.yz, r1.yyzy, r2.wwww
mul r1.yz, r1.yyzy, r1.wwww
mad r0.yz, r1.yyzy, v3.zzzz, r0.yyzy //contribute player collision
add r1.x, -r0.w, _vecVehColl0R.w
add r1.yz, r0.yyzy, -_vecVehColl0B.xxyx
dp2 r1.y, _vecVehColl0M.xyxx, r1.yzyy
mul_sat r1.y, r1.y, _vecVehColl0M.w
mad r1.yz, r1.yyyy, _vecVehColl0M.xxyx, _vecVehColl0B.xxyx
add r1.yz, r0.yyzy, -r1.yyzy
dp2 r1.w, r1.yzyy, r1.yzyy
add r2.w, -r1.w, _vecVehColl0R.y
mul_sat r2.w, r2.w, _vecVehColl0R.z
mad r1.x, r2.w, r1.x, r0.w
mul r2.w, r2.w, _vecVehColl0R.x
mul r3.x, _vecVehColl0R.x, l(0.500000)
mul r3.x, r3.x, r3.x
lt r3.x, r1.w, r3.x
rsq r1.w, r1.w
mul r1.yz, r1.wwww, r1.yyzy
mul r1.yz, r1.yyzy, r2.wwww
mad r4.xy, r1.yzyy, v3.zzzz, r0.yzyy
add r1.y, _vecVehColl0R.w, l(-0.250000)
movc r4.z, r3.x, r1.y, r1.x
add r1.x, r0.w, -_vecVehColl0R.w
ge r1.x, l(2.000000), |r1.x|
movc r1.xyz, r1.xxxx, r4.xyzx, r0.yzwy
movc r0.yzw, bVehColl0Enabled, r1.xxyz, r0.yyzw //contribute vehicle collision 0
add r1.x, -r0.w, _vecVehColl1R.w
add r1.yz, r0.yyzy, -_vecVehColl1B.xxyx
dp2 r1.y, _vecVehColl1M.xyxx, r1.yzyy
mul_sat r1.y, r1.y, _vecVehColl1M.w
mad r1.yz, r1.yyyy, _vecVehColl1M.xxyx, _vecVehColl1B.xxyx
add r1.yz, r0.yyzy, -r1.yyzy
dp2 r1.w, r1.yzyy, r1.yzyy
add r2.w, -r1.w, _vecVehColl1R.y
mul_sat r2.w, r2.w, _vecVehColl1R.z
mad r1.x, r2.w, r1.x, r0.w
mul r2.w, r2.w, _vecVehColl1R.x
mul r3.x, _vecVehColl1R.x, l(0.500000)
mul r3.x, r3.x, r3.x
lt r3.x, r1.w, r3.x
rsq r1.w, r1.w
mul r1.yz, r1.wwww, r1.yyzy
mul r1.yz, r1.yyzy, r2.wwww
mad r4.xy, r1.yzyy, v3.zzzz, r0.yzyy
add r1.y, _vecVehColl1R.w, l(-0.250000)
movc r4.z, r3.x, r1.y, r1.x
add r1.x, r0.w, -_vecVehColl1R.w
ge r1.x, l(2.000000), |r1.x|
movc r1.xyz, r1.xxxx, r4.xyzx, r0.yzwy
movc r0.yzw, bVehColl1Enabled, r1.xxyz, r0.yyzw //contribute vehicle collision 1
add r1.x, -r0.w, _vecVehColl2R.w
add r1.yz, r0.yyzy, -_vecVehColl2B.xxyx
dp2 r1.y, _vecVehColl2M.xyxx, r1.yzyy
mul_sat r1.y, r1.y, _vecVehColl2M.w
mad r1.yz, r1.yyyy, _vecVehColl2M.xxyx, _vecVehColl2B.xxyx
add r1.yz, r0.yyzy, -r1.yyzy
dp2 r1.w, r1.yzyy, r1.yzyy
add r2.w, -r1.w, _vecVehColl2R.y
mul_sat r2.w, r2.w, _vecVehColl2R.z
mad r1.x, r2.w, r1.x, r0.w
mul r2.w, r2.w, _vecVehColl2R.x
mul r3.x, _vecVehColl2R.x, l(0.500000)
mul r3.x, r3.x, r3.x
lt r3.x, r1.w, r3.x
rsq r1.w, r1.w
mul r1.yz, r1.wwww, r1.yyzy
mul r1.yz, r1.yyzy, r2.wwww
mad r4.xy, r1.yzyy, v3.zzzz, r0.yzyy
add r1.y, _vecVehColl2R.w, l(-0.250000)
movc r4.z, r3.x, r1.y, r1.x
add r1.x, r0.w, -_vecVehColl2R.w
ge r1.x, l(2.000000), |r1.x|
movc r1.xyz, r1.xxxx, r4.xyzx, r0.yzwy
movc r0.yzw, bVehColl2Enabled, r1.xxyz, r0.yyzw //contribute vehicle collision 2
add r1.x, -r0.w, _vecVehColl3R.w
add r1.yz, r0.yyzy, -_vecVehColl3B.xxyx
dp2 r1.y, _vecVehColl3M.xyxx, r1.yzyy
mul_sat r1.y, r1.y, _vecVehColl3M.w
mad r1.yz, r1.yyyy, _vecVehColl3M.xxyx, _vecVehColl3B.xxyx
add r1.yz, r0.yyzy, -r1.yyzy
dp2 r1.w, r1.yzyy, r1.yzyy
add r2.w, -r1.w, _vecVehColl3R.y
mul_sat r2.w, r2.w, _vecVehColl3R.z
mad r1.x, r2.w, r1.x, r0.w
mul r2.w, r2.w, _vecVehColl3R.x
mul r3.x, _vecVehColl3R.x, l(0.500000)
mul r3.x, r3.x, r3.x
lt r3.x, r1.w, r3.x
rsq r1.w, r1.w
mul r1.yz, r1.wwww, r1.yyzy
mul r1.yz, r1.yyzy, r2.wwww
mad r4.xy, r1.yzyy, v3.zzzz, r0.yzyy
add r1.y, _vecVehColl3R.w, l(-0.250000)
movc r4.z, r3.x, r1.y, r1.x
add r1.x, r0.w, -_vecVehColl3R.w
ge r1.x, l(2.000000), |r1.x|
movc r1.xyz, r1.xxxx, r4.xyzx, r0.yzwy
movc r0.yzw, bVehColl3Enabled, r1.xxyz, r0.yyzw //contribute vehicle collision 3
mul r1.xyzw, r0.zzzz, gWorldViewProj[1].xyzw
mad r1.xyzw, r0.yyyy, gWorldViewProj[0].xyzw, r1.xyzw
mad r1.xyzw, r0.wwww, gWorldViewProj[2].xyzw, r1.xyzw //screen transform
mov o3.xyz, r0.yzwy
add o0.xyzw, r1.xyzw, gWorldViewProj[3].xyzw //main position output
mov o1.w, v3.x
mul r0.yzw, v1.yyyy, gInstanceVars[r0.x + 1].xxyz //rotate normals with instance matrix
mad r0.yzw, v1.xxxx, gInstanceVars[r0.x + 0].xxyz, r0.yyzw
mad r0.xyz, v1.zzzz, gInstanceVars[r0.x + 2].xyzx, r0.yzwy
dp3 r1.x, r0.xyzx, r5.xywx
dp3 r1.y, r0.zxyz, r3.yzwy
dp3 r1.z, r0.xyzx, r2.xyzx
dp3 r0.x, r1.xyzx, r1.xyzx
rsq r0.x, r0.x
mul o2.xyz, r0.xxxx, r1.xyzx //lighting stuff
mov o2.w, v4.x //main texcoords
mov o3.w, v4.y
ret
*/
// Approximately 224 instruction slots used
Binary file not shown.
+68
View File
@@ -0,0 +1,68 @@
#include "BasicVS.hlsli"
struct VS_INPUT
{
float4 Position : POSITION;
float3 Normal : NORMAL;
};
struct RenderableBox
{
float3 Corner;
uint Colour;
float3 Edge1;
float Pad1;
float3 Edge2;
float Pad2;
float3 Edge3;
float Pad3;
};
StructuredBuffer<RenderableBox> Boxes : register(t1);
VS_OUTPUT main(VS_INPUT input, uint iid : SV_InstanceID)
{
VS_OUTPUT output;
RenderableBox box = Boxes[iid];
//float3 mpos = input.Position.xyz * box.Size;
//float3 ipos = mulvq(mpos, box.Orientation);
//float3 inorm = mulvq(input.Normal, box.Orientation);
float3 p = input.Position.xyz;
float3 n = input.Normal;
//float3 s = float3(box.Length1, box.Length2, box.Length3);
float3 ipos = (p.x*box.Edge1 + p.y*box.Edge2 + p.z*box.Edge3);// *s;
float3 inorm = normalize(n.x*box.Edge1 + n.y*box.Edge2 + n.z*box.Edge3);
float3 spos = (box.Corner + ipos) * Scale;
float3 rpos = mulvq(spos, Orientation);
float3 opos = CamRel.xyz + rpos;// bpos ModelTransform(input.Position.xyz);
float4 cpos = ScreenTransform(opos);
float3 bnorm = inorm;// mulvq(inorm, Orientation));// NormalTransform(input.Normal);
float3 btang = 0.5;// NormalTransform(float3(1, 0, 0)); //no tangent to use on this vertex type...
float4 c = Unpack4x8UNF(box.Colour).abgr;
//c = float4(abs(input.Normal),1);
float4 lightspacepos;
float shadowdepth = ShadowmapSceneDepth(opos, lightspacepos);
output.LightShadow = lightspacepos;
output.Shadows = float4(shadowdepth, 0,0,0);
output.Position = cpos;
output.CamRelPos = opos;
output.Normal = bnorm;
output.Texcoord0 = 0.5;// input.Texcoord0;
output.Texcoord1 = 0.5;// input.Texcoord;
output.Texcoord2 = 0.5;// input.Texcoord;
output.Colour0 = c;// float4(0.5, 0.5, 0.5, 1); //input.Colour0;
output.Colour1 = float4(0.5,0.5,0.5,1); //input.Colour1
output.Tint = 0;
output.Tangent = float4(btang, 1);
output.Bitangent = float4(cross(btang, bnorm), 0);
return output;
}
Binary file not shown.
+62
View File
@@ -0,0 +1,62 @@
#include "BasicVS.hlsli"
struct VS_INPUT
{
float4 Position : POSITION;
//float3 Normal : NORMAL;
};
struct RenderableCapsule
{
float3 Point1;
float Radius;
float4 Orientation;
float Length;
uint Colour;
float Pad0;
float Pad1;
};
StructuredBuffer<RenderableCapsule> Capsules : register(t1);
VS_OUTPUT main(VS_INPUT input, uint iid : SV_InstanceID)
{
VS_OUTPUT output;
RenderableCapsule cap = Capsules[iid];
float3 mpos = input.Position.xyz*cap.Radius;
mpos.y += input.Position.w*cap.Length;
float3 ipos = mulvq(mpos, cap.Orientation);
float3 inorm = mulvq(input.Position.xyz, cap.Orientation);// input.Normal;
float3 spos = (ipos + cap.Point1) * Scale;
float3 rpos = mulvq(spos, Orientation);
float3 opos = CamRel.xyz + rpos;// bpos ModelTransform(input.Position.xyz);
float4 cpos = ScreenTransform(opos);
float3 bnorm = normalize(mulvq(inorm, Orientation));// NormalTransform(input.Normal);
float3 btang = 0.5;// NormalTransform(float3(1, 0, 0)); //no tangent to use on this vertex type...
float4 c = Unpack4x8UNF(cap.Colour).abgr;
float4 lightspacepos;
float shadowdepth = ShadowmapSceneDepth(opos, lightspacepos);
output.LightShadow = lightspacepos;
output.Shadows = float4(shadowdepth, 0,0,0);
output.Position = cpos;
output.CamRelPos = opos;
output.Normal = bnorm;
output.Texcoord0 = 0.5;// input.Texcoord0;
output.Texcoord1 = 0.5;// input.Texcoord;
output.Texcoord2 = 0.5;// input.Texcoord;
output.Colour0 = c;// float4(0.5, 0.5, 0.5, 1); //input.Colour0;
output.Colour1 = float4(0.5,0.5,0.5,1); //input.Colour1
output.Tint = 0;
output.Tangent = float4(btang, 1);
output.Bitangent = float4(cross(btang, bnorm), 0);
return output;
}
Binary file not shown.
+62
View File
@@ -0,0 +1,62 @@
#include "BasicVS.hlsli"
struct VS_INPUT
{
float4 Position : POSITION;
float3 Normal : NORMAL;
};
struct RenderableCylinder
{
float3 Point1;
float Radius;
float4 Orientation;
float Length;
uint Colour;
float Pad0;
float Pad1;
};
StructuredBuffer<RenderableCylinder> Cylinders : register(t1);
VS_OUTPUT main(VS_INPUT input, uint iid : SV_InstanceID)
{
VS_OUTPUT output;
RenderableCylinder cyl = Cylinders[iid];
float3 mpos = input.Position.xyz*cyl.Radius;
mpos.y += input.Position.w*cyl.Length;
float3 ipos = mulvq(mpos, cyl.Orientation);
float3 inorm = mulvq(input.Normal, cyl.Orientation);// input.Normal;
float3 spos = (ipos + cyl.Point1) * Scale;
float3 rpos = mulvq(spos, Orientation);
float3 opos = CamRel.xyz + rpos;// bpos ModelTransform(input.Position.xyz);
float4 cpos = ScreenTransform(opos);
float3 bnorm = normalize(mulvq(inorm, Orientation));// NormalTransform(input.Normal);
float3 btang = 0.5;// NormalTransform(float3(1, 0, 0)); //no tangent to use on this vertex type...
float4 c = Unpack4x8UNF(cyl.Colour).abgr;
float4 lightspacepos;
float shadowdepth = ShadowmapSceneDepth(opos, lightspacepos);
output.LightShadow = lightspacepos;
output.Shadows = float4(shadowdepth, 0,0,0);
output.Position = cpos;
output.CamRelPos = opos;
output.Normal = bnorm;
output.Texcoord0 = 0.5;// input.Texcoord0;
output.Texcoord1 = 0.5;// input.Texcoord;
output.Texcoord2 = 0.5;// input.Texcoord;
output.Colour0 = c;// float4(0.5, 0.5, 0.5, 1); //input.Colour0;
output.Colour1 = float4(0.5,0.5,0.5,1); //input.Colour1
output.Tint = 0;
output.Tangent = float4(btang, 1);
output.Bitangent = float4(cross(btang, bnorm), 0);
return output;
}
Binary file not shown.
+40
View File
@@ -0,0 +1,40 @@
#include "BasicVS.hlsli"
struct VS_INPUT
{
float4 Position : POSITION;
float3 Normal : NORMAL;
float2 Texcoord0 : TEXCOORD0;
float4 Colour0 : COLOR0;
float4 Colour1 : COLOR1;
};
VS_OUTPUT main(VS_INPUT input, uint iid : SV_InstanceID)
{
VS_OUTPUT output;
float3 opos = ModelTransform(input.Position.xyz, input.Colour0.xyz, input.Colour1.xyz, iid);
float4 cpos = ScreenTransform(opos);
float3 bnorm = NormalTransform(input.Normal);
float3 btang = 0.5;// NormalTransform(float3(1, 0, 0)); //no tangent to use on this vertex type...
float4 tnt = ColourTint(input.Colour0.b, input.Colour1.b, iid); //colour tinting if enabled
float4 lightspacepos;
float shadowdepth = ShadowmapSceneDepth(opos, lightspacepos);
output.LightShadow = lightspacepos;
output.Shadows = float4(shadowdepth, 0,0,0);
output.Position = cpos;
output.CamRelPos = opos;
output.Normal = bnorm;
output.Texcoord0 = input.Texcoord0;
output.Texcoord1 = 0.5;// input.Texcoord;
output.Texcoord2 = 0.5;// input.Texcoord;
output.Colour0 = input.Colour0;
output.Colour1 = input.Colour1;
output.Tint = tnt;
output.Tangent = float4(btang, 1);
output.Bitangent = float4(cross(btang, bnorm), 0);
return output;
}
Binary file not shown.
+41
View File
@@ -0,0 +1,41 @@
#include "BasicVS.hlsli"
struct VS_INPUT
{
float4 Position : POSITION;
float3 Normal : NORMAL;
float2 Texcoord0 : TEXCOORD0;
float2 Texcoord1 : TEXCOORD1;
float4 Colour0 : COLOR0;
float4 Colour1 : COLOR1;
};
VS_OUTPUT main(VS_INPUT input, uint iid : SV_InstanceID)
{
VS_OUTPUT output;
float3 opos = ModelTransform(input.Position.xyz, input.Colour0.xyz, input.Colour1.xyz, iid);
float4 cpos = ScreenTransform(opos);
float3 bnorm = NormalTransform(input.Normal);
float3 btang = 0.5;// NormalTransform(float3(1, 0, 0)); //no tangent to use on this vertex type...
float4 tnt = ColourTint(input.Colour0.b, input.Colour1.b, iid); //colour tinting if enabled
float4 lightspacepos;
float shadowdepth = ShadowmapSceneDepth(opos, lightspacepos);
output.LightShadow = lightspacepos;
output.Shadows = float4(shadowdepth, 0,0,0);
output.Position = cpos;
output.CamRelPos = opos;
output.Normal = bnorm;
output.Texcoord0 = input.Texcoord0;
output.Texcoord1 = input.Texcoord1;
output.Texcoord2 = 0.5;// input.Texcoord;
output.Colour0 = input.Colour0;
output.Colour1 = input.Colour1;
output.Tint = tnt;
output.Tangent = float4(btang, 1);
output.Bitangent = float4(cross(btang, bnorm), 0);
return output;
}
Binary file not shown.
+42
View File
@@ -0,0 +1,42 @@
#include "BasicVS.hlsli"
struct VS_INPUT
{
float4 Position : POSITION;
float3 Normal : NORMAL;
float2 Texcoord0 : TEXCOORD0;
float2 Texcoord1 : TEXCOORD1;
float2 Texcoord2 : TEXCOORD2;
float4 Colour0 : COLOR0;
float4 Colour1 : COLOR1;
};
VS_OUTPUT main(VS_INPUT input, uint iid : SV_InstanceID)
{
VS_OUTPUT output;
float3 opos = ModelTransform(input.Position.xyz, input.Colour0.xyz, input.Colour1.xyz, iid);
float4 cpos = ScreenTransform(opos);
float3 bnorm = NormalTransform(input.Normal);
float3 btang = 0.5;// NormalTransform(float3(1, 0, 0)); //no tangent to use on this vertex type...
float4 tnt = ColourTint(input.Colour0.b, input.Colour1.b, iid); //colour tinting if enabled
float4 lightspacepos;
float shadowdepth = ShadowmapSceneDepth(opos, lightspacepos);
output.LightShadow = lightspacepos;
output.Shadows = float4(shadowdepth, 0,0,0);
output.Position = cpos;
output.CamRelPos = opos;
output.Normal = bnorm;
output.Texcoord0 = input.Texcoord0;
output.Texcoord1 = input.Texcoord1;
output.Texcoord2 = input.Texcoord2;
output.Colour0 = input.Colour0;
output.Colour1 = input.Colour1;
output.Tint = tnt;
output.Tangent = float4(btang, 1);
output.Bitangent = float4(cross(btang, bnorm), 0);
return output;
}
Binary file not shown.
+43
View File
@@ -0,0 +1,43 @@
#include "BasicVS.hlsli"
struct VS_INPUT
{
float4 Position : POSITION;
float3 Normal : NORMAL;
float2 Texcoord0 : TEXCOORD0;
float2 Texcoord1 : TEXCOORD1;
float2 Texcoord2 : TEXCOORD2;
float4 Colour0 : COLOR0;
float4 Colour1 : COLOR1;
float4 Tangent : TANGENT;
};
VS_OUTPUT main(VS_INPUT input, uint iid : SV_InstanceID)
{
VS_OUTPUT output;
float3 opos = ModelTransform(input.Position.xyz, input.Colour0.xyz, input.Colour1.xyz, iid);
float4 cpos = ScreenTransform(opos);
float3 bnorm = NormalTransform(input.Normal);
float3 btang = NormalTransform(input.Tangent.xyz);
float4 tnt = ColourTint(input.Colour0.b, input.Colour1.b, iid); //colour tinting if enabled
float4 lightspacepos;
float shadowdepth = ShadowmapSceneDepth(opos, lightspacepos);
output.LightShadow = lightspacepos;
output.Shadows = float4(shadowdepth, 0,0,0);
output.Position = cpos;
output.CamRelPos = opos;
output.Normal = bnorm;
output.Texcoord0 = input.Texcoord0;
output.Texcoord1 = input.Texcoord1;
output.Texcoord2 = input.Texcoord2;
output.Colour0 = input.Colour0;
output.Colour1 = input.Colour1;
output.Tint = tnt;
output.Tangent = float4(btang, input.Tangent.w);
output.Bitangent = float4(cross(btang, bnorm) * input.Tangent.w, 0);
return output;
}
Binary file not shown.
+42
View File
@@ -0,0 +1,42 @@
#include "BasicVS.hlsli"
struct VS_INPUT
{
float4 Position : POSITION;
float3 Normal : NORMAL;
float2 Texcoord0 : TEXCOORD0;
float2 Texcoord1 : TEXCOORD1;
float4 Colour0 : COLOR0;
float4 Colour1 : COLOR1;
float4 Tangent : TANGENT;
};
VS_OUTPUT main(VS_INPUT input, uint iid : SV_InstanceID)
{
VS_OUTPUT output;
float3 opos = ModelTransform(input.Position.xyz, input.Colour0.xyz, input.Colour1.xyz, iid);
float4 cpos = ScreenTransform(opos);
float3 bnorm = NormalTransform(input.Normal);
float3 btang = NormalTransform(input.Tangent.xyz);
float4 tnt = ColourTint(input.Colour0.b, input.Colour1.b, iid); //colour tinting if enabled
float4 lightspacepos;
float shadowdepth = ShadowmapSceneDepth(opos, lightspacepos);
output.LightShadow = lightspacepos;
output.Shadows = float4(shadowdepth, 0,0,0);
output.Position = cpos;
output.CamRelPos = opos;
output.Normal = bnorm;
output.Texcoord0 = input.Texcoord0;
output.Texcoord1 = input.Texcoord1;
output.Texcoord2 = 0.5;// input.Texcoord;
output.Colour0 = input.Colour0;
output.Colour1 = input.Colour1;
output.Tint = tnt;
output.Tangent = float4(btang, input.Tangent.w);
output.Bitangent = float4(cross(btang, bnorm) * input.Tangent.w, 0);
return output;
}
Binary file not shown.
+41
View File
@@ -0,0 +1,41 @@
#include "BasicVS.hlsli"
struct VS_INPUT
{
float4 Position : POSITION;
float3 Normal : NORMAL;
float2 Texcoord0 : TEXCOORD0;
float4 Colour0 : COLOR0;
float4 Colour1 : COLOR1;
float4 Tangent : TANGENT;
};
VS_OUTPUT main(VS_INPUT input, uint iid : SV_InstanceID)
{
VS_OUTPUT output;
float3 opos = ModelTransform(input.Position.xyz, input.Colour0.xyz, input.Colour1.xyz, iid);
float4 cpos = ScreenTransform(opos);
float3 bnorm = NormalTransform(input.Normal);
float3 btang = NormalTransform(input.Tangent.xyz);
float4 tnt = ColourTint(input.Colour0.b, input.Colour1.b, iid); //colour tinting if enabled
float4 lightspacepos;
float shadowdepth = ShadowmapSceneDepth(opos, lightspacepos);
output.LightShadow = lightspacepos;
output.Shadows = float4(shadowdepth, 0,0,0);
output.Position = cpos;
output.CamRelPos = opos;
output.Normal = bnorm;
output.Texcoord0 = input.Texcoord0;
output.Texcoord1 = 0.5;// input.Texcoord;
output.Texcoord2 = 0.5;// input.Texcoord;
output.Colour0 = input.Colour0;
output.Colour1 = input.Colour1;
output.Tint = tnt;
output.Tangent = float4(btang, input.Tangent.w);
output.Bitangent = float4(cross(btang, bnorm) * input.Tangent.w, 0);
return output;
}
Binary file not shown.
+39
View File
@@ -0,0 +1,39 @@
#include "BasicVS.hlsli"
struct VS_INPUT
{
float4 Position : POSITION;
float3 Normal : NORMAL;
float2 Texcoord0 : TEXCOORD0;
float4 Colour0 : COLOR0;
};
VS_OUTPUT main(VS_INPUT input, uint iid : SV_InstanceID)
{
VS_OUTPUT output;
float3 opos = ModelTransform(input.Position.xyz, input.Colour0.xyz, input.Colour0.xyz, iid);
float4 cpos = ScreenTransform(opos);
float3 bnorm = NormalTransform(input.Normal);
float3 btang = 0.5;// NormalTransform(float3(1, 0, 0)); //no tangent to use on this vertex type...
float4 tnt = ColourTint(input.Colour0.b, 0, iid); //colour tinting if enabled
float4 lightspacepos;
float shadowdepth = ShadowmapSceneDepth(opos, lightspacepos);
output.LightShadow = lightspacepos;
output.Shadows = float4(shadowdepth, 0,0,0);
output.Position = cpos;
output.CamRelPos = opos;
output.Normal = bnorm;
output.Texcoord0 = input.Texcoord0;
output.Texcoord1 = 0.5;// input.Texcoord;
output.Texcoord2 = 0.5;// input.Texcoord;
output.Colour0 = input.Colour0;
output.Colour1 = float4(0.5,0.5,0.5,1); //input.Colour
output.Tint = tnt;
output.Tangent = float4(btang, 1);
output.Bitangent = float4(cross(btang, bnorm), 0);
return output;
}
Binary file not shown.
+42
View File
@@ -0,0 +1,42 @@
#include "BasicVS.hlsli"
struct VS_INPUT
{
float4 Position : POSITION;
float3 Normal : NORMAL;
float2 Texcoord0 : TEXCOORD0;
float2 Texcoord1 : TEXCOORD1;
float2 Texcoord2 : TEXCOORD2;
float4 Colour0 : COLOR0;
float4 Tangent : TANGENT;
};
VS_OUTPUT main(VS_INPUT input, uint iid : SV_InstanceID)
{
VS_OUTPUT output;
float3 opos = ModelTransform(input.Position.xyz, input.Colour0.xyz, input.Colour0.xyz, iid);
float4 cpos = ScreenTransform(opos);
float3 bnorm = NormalTransform(input.Normal);
float3 btang = NormalTransform(input.Tangent.xyz);
float4 tnt = ColourTint(input.Colour0.b, 0, iid); //colour tinting if enabled
float4 lightspacepos;
float shadowdepth = ShadowmapSceneDepth(opos, lightspacepos);
output.LightShadow = lightspacepos;
output.Shadows = float4(shadowdepth, 0,0,0);
output.Position = cpos;
output.CamRelPos = opos;
output.Normal = bnorm;
output.Texcoord0 = input.Texcoord0;
output.Texcoord1 = input.Texcoord1;
output.Texcoord2 = input.Texcoord2;
output.Colour0 = input.Colour0;
output.Colour1 = float4(0.5,0.5,0.5,1); //input.Colour
output.Tint = tnt;
output.Tangent = float4(btang, input.Tangent.w);
output.Bitangent = float4(cross(btang, bnorm) * input.Tangent.w, 0);
return output;
}
Binary file not shown.
+41
View File
@@ -0,0 +1,41 @@
#include "BasicVS.hlsli"
struct VS_INPUT
{
float4 Position : POSITION;
float3 Normal : NORMAL;
float2 Texcoord0 : TEXCOORD0;
float2 Texcoord1 : TEXCOORD1;
float4 Colour0 : COLOR0;
float4 Tangent : TANGENT;
};
VS_OUTPUT main(VS_INPUT input, uint iid : SV_InstanceID)
{
VS_OUTPUT output;
float3 opos = ModelTransform(input.Position.xyz, input.Colour0.xyz, input.Colour0.xyz, iid);
float4 cpos = ScreenTransform(opos);
float3 bnorm = NormalTransform(input.Normal);
float3 btang = NormalTransform(input.Tangent.xyz);
float4 tnt = ColourTint(input.Colour0.b, 0, iid); //colour tinting if enabled
float4 lightspacepos;
float shadowdepth = ShadowmapSceneDepth(opos, lightspacepos);
output.LightShadow = lightspacepos;
output.Shadows = float4(shadowdepth, 0,0,0);
output.Position = cpos;
output.CamRelPos = opos;
output.Normal = bnorm;
output.Texcoord0 = input.Texcoord0;
output.Texcoord1 = input.Texcoord1;
output.Texcoord2 = 0.5;// input.Texcoord;
output.Colour0 = input.Colour0;
output.Colour1 = float4(0.5,0.5,0.5,1); //input.Colour
output.Tint = tnt;
output.Tangent = float4(btang, input.Tangent.w);
output.Bitangent = float4(cross(btang, bnorm) * input.Tangent.w, 0);
return output;
}
Binary file not shown.
+40
View File
@@ -0,0 +1,40 @@
#include "BasicVS.hlsli"
struct VS_INPUT
{
float4 Position : POSITION;
float3 Normal : NORMAL;
float2 Texcoord0 : TEXCOORD0;
float4 Colour0 : COLOR0;
float4 Tangent : TANGENT;
};
VS_OUTPUT main(VS_INPUT input, uint iid : SV_InstanceID)
{
VS_OUTPUT output;
float3 opos = ModelTransform(input.Position.xyz, input.Colour0.xyz, input.Colour0.xyz, iid);
float4 cpos = ScreenTransform(opos);
float3 bnorm = NormalTransform(input.Normal);
float3 btang = NormalTransform(input.Tangent.xyz);
float4 tnt = ColourTint(input.Colour0.b, 0, iid); //colour tinting if enabled
float4 lightspacepos;
float shadowdepth = ShadowmapSceneDepth(opos, lightspacepos);
output.LightShadow = lightspacepos;
output.Shadows = float4(shadowdepth, 0,0,0);
output.Position = cpos;
output.CamRelPos = opos;
output.Normal = bnorm;
output.Texcoord0 = input.Texcoord0;
output.Texcoord1 = 0.5;// input.Texcoord;
output.Texcoord2 = 0.5;// input.Texcoord;
output.Colour0 = input.Colour0;
output.Colour1 = float4(0.5,0.5,0.5,1); //input.Colour
output.Tint = tnt;
output.Tangent = float4(btang, input.Tangent.w);
output.Bitangent = float4(cross(btang, bnorm) * input.Tangent.w, 0);
return output;
}
Binary file not shown.
+56
View File
@@ -0,0 +1,56 @@
#include "BasicVS.hlsli"
struct VS_INPUT
{
float4 Position : POSITION;
//float3 Normal : NORMAL;
};
struct RenderableSphere
{
float3 Center;
float Radius;
float3 Pad0;
uint Colour;
};
StructuredBuffer<RenderableSphere> Spheres : register(t1);
VS_OUTPUT main(VS_INPUT input, uint iid : SV_InstanceID)
{
VS_OUTPUT output;
RenderableSphere sph = Spheres[iid];
float3 ipos = (input.Position.xyz) * sph.Radius;// *0.5;
float3 inorm = input.Position.xyz;// input.Normal; //unit sphere pos == normal
float3 spos = (ipos + sph.Center) * Scale;
float3 rpos = mulvq(spos, Orientation);
float3 opos = CamRel.xyz + rpos;// bpos ModelTransform(input.Position.xyz);
float4 cpos = ScreenTransform(opos);
float3 bnorm = normalize(mulvq(inorm, Orientation));// NormalTransform(input.Normal);
float3 btang = 0.5;// NormalTransform(float3(1, 0, 0)); //no tangent to use on this vertex type...
float4 c = Unpack4x8UNF(sph.Colour).abgr;
float4 lightspacepos;
float shadowdepth = ShadowmapSceneDepth(opos, lightspacepos);
output.LightShadow = lightspacepos;
output.Shadows = float4(shadowdepth, 0,0,0);
output.Position = cpos;
output.CamRelPos = opos;
output.Normal = bnorm;
output.Texcoord0 = 0.5;// input.Texcoord0;
output.Texcoord1 = 0.5;// input.Texcoord;
output.Texcoord2 = 0.5;// input.Texcoord;
output.Colour0 = c;// float4(0.5, 0.5, 0.5, 1); //input.Colour0;//float4(abs(input.Position.xyz), 1);//
output.Colour1 = float4(0.5,0.5,0.5,1); //input.Colour1
output.Tint = 0;
output.Tangent = float4(btang, 1);
output.Bitangent = float4(cross(btang, bnorm), 0);
return output;
}
Binary file not shown.
+27
View File
@@ -0,0 +1,27 @@
#include "Common.hlsli"
#include "Quaternion.hlsli"
cbuffer VSSceneVars : register(b0)
{
float4x4 ViewProj;
}
cbuffer VSBoxVars : register(b1)
{
float4 Orientation;
float4 BBMin;
float4 BBRng; //max-min
float3 CamRel;
float Pad1;
float3 Scale;
float Pad2;
}
float4 main(float4 pos: POSITION) : SV_POSITION
{
float3 bpos = (BBMin.xyz + pos.xyz*BBRng.xyz) * Scale;
float3 opos = mulvq(bpos, Orientation);
float3 f = CamRel + opos;
float4 cpos = mul(float4(f,1), ViewProj);
cpos.z = DepthFunc(cpos.zw);
return cpos;
}
Binary file not shown.
+32
View File
@@ -0,0 +1,32 @@
#include "Common.hlsli"
cbuffer VSSceneVars : register(b0)
{
float4x4 ViewProj;
float4x4 ViewInv;
float SegmentCount;
float VertexCount;
float Pad1;
float Pad2;
}
cbuffer VSSphereVars : register(b1)
{
float3 Center;
float Radius;
}
float4 main(uint id : SV_VertexID) : SV_POSITION
{
static const float twopi = 6.283185307179586476925286766559;
uint seg = id;
float t = twopi*((float)seg)/SegmentCount;
float ct = cos(t);
float st = sin(t);
float r = Radius;
float3 o = float3(ct*r, st*r, 0);
float3 f = Center.xyz + mul(o, (float3x3)ViewInv);
float4 cpos = mul(float4(f,1), ViewProj);
cpos.z = DepthFunc(cpos.zw);
return cpos;
}
Binary file not shown.
+9
View File
@@ -0,0 +1,9 @@
cbuffer PSVars : register(b0)
{
float4 Colour;
}
float4 main() : SV_TARGET
{
return Colour;
}
Binary file not shown.
+102
View File
@@ -0,0 +1,102 @@
#include "Shadowmap.hlsli"
Texture2D<float4> Colourmap : register(t0);
SamplerState TextureSS : register(s0);
cbuffer PSSceneVars : register(b0)
{
ShaderGlobalLightParams GlobalLights;
uint EnableShadows;
uint RenderMode;//0=default, 1=normals, 2=tangents, 3=colours, 4=texcoords, 5=diffuse, 6=normalmap, 7=spec, 8=direct
uint RenderModeIndex;
uint RenderSamplerCoord;
}
cbuffer PSGeomVars : register(b2)
{
uint EnableTexture;
uint EnableTint;
uint Pad100;
uint Pad101;
}
struct VS_OUTPUT
{
float4 Position : SV_POSITION;
float3 Normal : NORMAL;
float2 Texcoord0 : TEXCOORD0;
float2 Texcoord1 : TEXCOORD1;
float2 Texcoord2 : TEXCOORD2;
float4 Shadows : TEXCOORD3;
float4 LightShadow : TEXCOORD4;
float4 Colour0 : COLOR0;
float4 Colour1 : COLOR1;
float4 Tint : COLOR2;
float4 Tangent : TANGENT;
};
float4 main(VS_OUTPUT input) : SV_TARGET
{
float4 c = float4(0.2, 0.2, 0.2, 1);
if (EnableTexture == 1)
{
float2 texc = input.Texcoord0;
if (RenderMode >= 5)
{
if (RenderSamplerCoord == 2) texc = input.Texcoord1;
else if (RenderSamplerCoord == 3) texc = input.Texcoord2;
}
c = Colourmap.Sample(TextureSS, texc);
//c = Depthmap.SampleLevel(DepthmapSS, input.Texcoord, 0); c.a = 1;
//if ((IsDecal == 0) && (c.a <= 0.33)) discard;
//if ((IsDecal == 1) && (c.a <= 0.0)) discard;
//if(IsDecal==0) c.a = 1;
c.a = 1;
}
//else //if(RenderMode!=8)//
//{
// c = float4(input.Colour0.rgb, 1);
//}
if (EnableTint > 0)
{
c.rgb *= input.Tint.rgb;
}
//if (IsDecal == 1)
//{
// c.a *= input.Colour0.a;
//}
float3 norm = normalize(input.Normal);
if (RenderMode == 1) //normals
{
c.rgb = norm*0.5+0.5;
}
else if (RenderMode == 2) //tangents
{
c.rgb = normalize(input.Tangent.rgb)*0.5+0.5;
}
else if (RenderMode == 3) //colours
{
c.rgb = input.Colour0.rgb;
if (RenderModeIndex == 2) c.rgb = input.Colour1.rgb;
}
else if (RenderMode == 4) //texcoords
{
c.rgb = float3(input.Texcoord0, 0);
if (RenderModeIndex == 2) c.rgb = float3(input.Texcoord1, 0);
if (RenderModeIndex == 3) c.rgb = float3(input.Texcoord2, 0);
}
c.rgb = FullLighting(c.rgb, 0, norm, input.Colour0, GlobalLights, EnableShadows, input.Shadows.x, input.LightShadow);
c.a = saturate(c.a);
return c;
}
Binary file not shown.
+39
View File
@@ -0,0 +1,39 @@
#include "BasicVS.hlsli"
struct VS_INPUT
{
float4 Position : POSITION;
float3 Normal : NORMAL;
float2 Texcoord0 : TEXCOORD0;
float4 Colour0 : COLOR0;
};
VS_OUTPUT main(VS_INPUT input)
{
VS_OUTPUT output;
float3 opos = ModelTransform(input.Position.xyz, input.Colour0.xyz, input.Colour0.xyz, 0);
float4 cpos = ScreenTransform(opos);
float3 bnorm = NormalTransform(input.Normal);
float3 btang = 0.5;// NormalTransform(float3(1, 0, 0)); //no tangent to use on this vertex type...
float4 tnt = ColourTint(input.Colour0.b, 0, 0); //colour tinting if enabled
float4 lightspacepos;
float shadowdepth = ShadowmapSceneDepth(opos, lightspacepos);
output.LightShadow = lightspacepos;
output.Shadows = float4(shadowdepth, 0,0,0);
output.Position = cpos;
output.CamRelPos = opos;
output.Normal = bnorm;
output.Texcoord0 = input.Texcoord0;
output.Texcoord1 = 0.5;// input.Texcoord;
output.Texcoord2 = 0.5;// input.Texcoord;
output.Colour0 = input.Colour0;
output.Colour1 = float4(0.5,0.5,0.5,1); //input.Colour
output.Tint = tnt;
output.Tangent = float4(btang, 1);
output.Bitangent = float4(cross(btang, bnorm), 0);
return output;
}
+49
View File
@@ -0,0 +1,49 @@
cbuffer clouds_locals : register(b0)
{
float3 gSkyColor; // Offset: 0 Size: 12 [unused]
float gPad00;
float3 gEastMinusWestColor; // Offset: 16 Size: 12 [unused]
float gPad01;
float3 gWestColor; // Offset: 32 Size: 12 [unused]
float gPad02;
float3 gSunDirection; // Offset: 48 Size: 12
float gPad03;
float3 gSunColor; // Offset: 64 Size: 12
float gPad04;
float3 gCloudColor; // Offset: 80 Size: 12 [unused]
float gPad05;
float3 gAmbientColor; // Offset: 96 Size: 12 [unused]
float gPad06;
float3 gBounceColor; // Offset: 112 Size: 12 [unused]
float gPad07;
float4 gDensityShiftScale; // Offset: 128 Size: 16 [unused]
float4 gScatterG_GSquared_PhaseMult_Scale;// Offset: 144 Size: 16
float4 gPiercingLightPower_Strength_NormalStrength_Thickness;// Offset: 160 Size: 16
float3 gScaleDiffuseFillAmbient; // Offset: 176 Size: 12 [unused]
float gPad08;
float3 gWrapLighting_MSAARef; // Offset: 192 Size: 12 [unused]
float gPad09;
float4 gNearFarQMult; // Offset: 208 Size: 16 [unused]
float3 gAnimCombine; // Offset: 224 Size: 12 [unused]
float gPad10;
float3 gAnimSculpt; // Offset: 240 Size: 12 [unused]
float gPad11;
float3 gAnimBlendWeights; // Offset: 256 Size: 12 [unused]
float gPad12;
float4 gUVOffset[2]; // Offset: 272 Size: 32
row_major float4x4 gCloudViewProj; // Offset: 304 Size: 64
float4 gCameraPos; // Offset: 368 Size: 16
float2 gUVOffset1; // Offset: 384 Size: 8
float2 gUVOffset2; // Offset: 392 Size: 8
float2 gUVOffset3; // Offset: 400 Size: 8
float2 gRescaleUV1; // Offset: 408 Size: 8
float2 gRescaleUV2; // Offset: 416 Size: 8
float2 gRescaleUV3; // Offset: 424 Size: 8
float gSoftParticleRange; // Offset: 432 Size: 4 [unused]
float gEnvMapAlphaScale; // Offset: 436 Size: 4 [unused]
float2 cloudLayerAnimScale1; // Offset: 440 Size: 8
float2 cloudLayerAnimScale2; // Offset: 448 Size: 8
float2 cloudLayerAnimScale3; // Offset: 456 Size: 8
};
Binary file not shown.
+301
View File
@@ -0,0 +1,301 @@
#include "Clouds.hlsli"
Texture2D<float4> DensitySampler : register(t0);
Texture2D<float4> NormalSampler : register(t1);
Texture2D<float4> DetailDensitySampler : register(t2);
Texture2D<float4> DetailNormalSampler : register(t3);
Texture2D<float4> DetailDensity2Sampler : register(t4);
Texture2D<float4> DetailNormal2Sampler : register(t5);
Texture2D<float4> DepthMapTexSampler : register(t6);
SamplerState TextureSS : register(s0);
cbuffer PSSceneVars : register(b1)
{
float4 LightDirection;
uint EnableHDR;
uint Pad0;
uint Pad1;
uint Pad2;
}
struct VS_OUTPUT
{
float4 Position : SV_POSITION; // 0 xyzw 0 POS float xyzw
float4 o0 : TEXCOORD0; // 0 xyzw 0 NONE float
float4 o1 : TEXCOORD1; // 1 xyzw 1 NONE float xyzw
float4 o2 : TEXCOORD2; // 2 xyzw 2 NONE float xyzw
float4 o3 : TEXCOORD3; // 3 xyzw 3 NONE float xyzw
float2 o4 : TEXCOORD4; // 4 xy 4 NONE float xy
float4 o5 : TEXCOORD5; // 5 xyzw 5 NONE float xyzw
float4 o6 : TEXCOORD6; // 6 xyzw 6 NONE float xy w
float4 o7 : TEXCOORD7; // 7 xyzw 7 NONE float xyzw
float3 o8 : TEXCOORD8; // 8 xyz 8 NONE float xyz
float4 o9 : TEXCOORD9; // 9 xyzw 9 NONE float xyzw
};
float4 main(VS_OUTPUT input) : SV_TARGET
{
float2 texc = input.o4;
float4 d = DensitySampler.Sample(TextureSS, texc);
float4 n = NormalSampler.Sample(TextureSS, texc);
float dv = saturate((1.0 - d.g) * input.o1.w);
float3 dc = gSunColor;
return float4(dc, saturate(dv));
}
/*
//clouds_animsoft.fxc_PSCloudsVertScatterPiercing_AnimSoft
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// Buffer Definitions:
//
// cbuffer misc_globals
// {
//
// float4 globalFade; // Offset: 0 Size: 16 [unused]
// float globalHeightScale; // Offset: 16 Size: 4 [unused]
// float4 g_Rage_Tessellation_CameraPosition;// Offset: 32 Size: 16 [unused]
// float4 g_Rage_Tessellation_CameraZAxis;// Offset: 48 Size: 16 [unused]
// float4 g_Rage_Tessellation_ScreenSpaceErrorParams;// Offset: 64 Size: 16 [unused]
// float4 g_Rage_Tessellation_LinearScale;// Offset: 80 Size: 16 [unused]
// float4 g_Rage_Tessellation_Frustum[4];// Offset: 96 Size: 64 [unused]
// float4 g_Rage_Tessellation_Epsilons;// Offset: 160 Size: 16 [unused]
// float4 globalScalars; // Offset: 176 Size: 16 [unused]
// float4 globalScalars2; // Offset: 192 Size: 16 [unused]
// float4 globalScalars3; // Offset: 208 Size: 16
// float4 globalScreenSize; // Offset: 224 Size: 16 [unused]
// uint4 gTargetAAParams; // Offset: 240 Size: 16 [unused]
// float4 colorize; // Offset: 256 Size: 16 [unused]
// float4 gGlobalParticleShadowBias; // Offset: 272 Size: 16 [unused]
// float gGlobalParticleDofAlphaScale;// Offset: 288 Size: 4 [unused]
// float gGlobalFogIntensity; // Offset: 292 Size: 4 [unused]
// float4 gPlayerLFootPos; // Offset: 304 Size: 16 [unused]
// float4 gPlayerRFootPos; // Offset: 320 Size: 16 [unused]
//
// }
//
// cbuffer clouds_locals
// {
//
// float3 gSkyColor; // Offset: 0 Size: 12
// float3 gEastMinusWestColor; // Offset: 16 Size: 12
// float3 gWestColor; // Offset: 32 Size: 12
// float3 gSunDirection; // Offset: 48 Size: 12
// float3 gSunColor; // Offset: 64 Size: 12
// float3 gCloudColor; // Offset: 80 Size: 12
// float3 gAmbientColor; // Offset: 96 Size: 12
// float3 gBounceColor; // Offset: 112 Size: 12
// float4 gDensityShiftScale; // Offset: 128 Size: 16
// float4 gScatterG_GSquared_PhaseMult_Scale;// Offset: 144 Size: 16 [unused]
// float4 gPiercingLightPower_Strength_NormalStrength_Thickness;// Offset: 160 Size: 16
// float3 gScaleDiffuseFillAmbient; // Offset: 176 Size: 12
// float3 gWrapLighting_MSAARef; // Offset: 192 Size: 12
// float4 gNearFarQMult; // Offset: 208 Size: 16
// float3 gAnimCombine; // Offset: 224 Size: 12
// float3 gAnimSculpt; // Offset: 240 Size: 12
// float3 gAnimBlendWeights; // Offset: 256 Size: 12
// float4 gUVOffset[2]; // Offset: 272 Size: 32 [unused]
// row_major float4x4 gCloudViewProj; // Offset: 304 Size: 64 [unused]
// float4 gCameraPos; // Offset: 368 Size: 16 [unused]
// float2 gUVOffset1; // Offset: 384 Size: 8 [unused]
// float2 gUVOffset2; // Offset: 392 Size: 8 [unused]
// float2 gUVOffset3; // Offset: 400 Size: 8 [unused]
// float2 gRescaleUV1; // Offset: 408 Size: 8 [unused]
// float2 gRescaleUV2; // Offset: 416 Size: 8 [unused]
// float2 gRescaleUV3; // Offset: 424 Size: 8 [unused]
// float gSoftParticleRange; // Offset: 432 Size: 4
// float gEnvMapAlphaScale; // Offset: 436 Size: 4 [unused]
// float2 cloudLayerAnimScale1; // Offset: 440 Size: 8 [unused]
// float2 cloudLayerAnimScale2; // Offset: 448 Size: 8 [unused]
// float2 cloudLayerAnimScale3; // Offset: 456 Size: 8 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim HLSL Bind Count
// ------------------------------ ---------- ------- ----------- -------------- ------
// DensitySampler sampler NA NA s2 1
// NormalSampler sampler NA NA s3 1
// DetailDensitySampler sampler NA NA s4 1
// DetailNormalSampler sampler NA NA s5 1
// DetailDensity2Sampler sampler NA NA s6 1
// DetailNormal2Sampler sampler NA NA s7 1
// DepthMapTexSampler sampler NA NA s10 1
// DensitySampler texture float4 2d t2 1
// NormalSampler texture float4 2d t3 1
// DetailDensitySampler texture float4 2d t4 1
// DetailNormalSampler texture float4 2d t5 1
// DetailDensity2Sampler texture float4 2d t6 1
// DetailNormal2Sampler texture float4 2d t7 1
// DepthMapTexSampler texture float4 2d t10 1
// misc_globals cbuffer NA NA cb2 1
// clouds_locals cbuffer NA NA cb12 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD 0 xyzw 0 NONE float
// TEXCOORD 1 xyzw 1 NONE float xyzw
// TEXCOORD 2 xyzw 2 NONE float xyzw
// TEXCOORD 3 xyzw 3 NONE float xyzw
// TEXCOORD 4 xy 4 NONE float xy
// TEXCOORD 5 xyzw 5 NONE float xyzw
// TEXCOORD 6 xyzw 6 NONE float xy w
// TEXCOORD 7 xyzw 7 NONE float xyzw
// TEXCOORD 8 xyz 8 NONE float xyz
// TEXCOORD 9 xyzw 9 NONE float xyzw
// SV_Position 0 xyzw 10 POS float
// SV_ClipDistance 0 xyzw 11 CLIPDST float
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
ps_4_0
dcl_constantbuffer CB2[14], immediateIndexed
dcl_constantbuffer CB12[28], immediateIndexed
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_sampler s6, mode_default
dcl_sampler s7, mode_default
dcl_sampler s10, mode_default
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_resource_texture2d (float,float,float,float) t10
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xyzw
dcl_input_ps linear v3.xyzw
dcl_input_ps linear v4.xy
dcl_input_ps linear v5.xyzw
dcl_input_ps linear v6.xyw
dcl_input_ps linear v7.xyzw
dcl_input_ps linear v8.xyz
dcl_input_ps linear v9.xyzw
dcl_output o0.xyzw
dcl_temps 5
sample r0.xyzw, v5.zwzz, t7.xyzw, s7
mad r0.xy, r0.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r0.w, r0.xyxx, r0.xyxx
add r0.w, -r0.w, l(1.000000)
max r0.w, r0.w, l(0.000000)
sqrt r0.z, r0.w
sample r1.xyzw, v4.xyxx, t3.xyzw, s3
mad r1.xy, r1.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r0.w, r1.xyxx, r1.xyxx
add r0.w, -r0.w, l(1.000000)
max r0.w, r0.w, l(0.000000)
sqrt r1.z, r0.w
sample r2.xyzw, v5.xyxx, t5.xyzw, s5
mad r2.xy, r2.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r0.w, r2.xyxx, r2.xyxx
add r0.w, -r0.w, l(1.000000)
max r0.w, r0.w, l(0.000000)
sqrt r2.z, r0.w
sample r3.xyzw, v4.xyxx, t2.yxzw, s2
sample r4.xyzw, v5.xyxx, t4.xyzw, s4
mov r3.y, r4.y
sample r4.xyzw, v5.zwzz, t6.xyzw, s6
mov r3.z, r4.y
mad r3.xyz, -r3.xyzx, r3.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r3.xyz, r3.xyzx, cb12[16].xyzx
mul r4.xyz, r3.xyzx, cb12[14].xyzx
mul r2.xyz, r2.xyzx, r4.yyyy
mad r1.xyz, r1.xyzx, r4.xxxx, r2.xyzx
mad r0.xyz, r0.xyzx, r4.zzzz, r1.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
mul r1.xyz, r0.yyyy, v3.xyzx
mad r0.xyw, r0.xxxx, v2.xyxz, r1.xyxz
mad r0.xyz, r0.zzzz, v1.xyzx, r0.xywx
mad_sat r1.xyz, r0.xzzx, l(0.500000, -0.800000, 0.571429, 0.000000), l(0.500000, 0.200000, 0.428571, 0.000000)
mad r2.xyz, r1.xxxx, cb12[1].xyzx, cb12[2].xyzx
mad r1.xyw, cb12[7].xyxz, r1.yyyy, r2.xyxz
mad r1.xyz, cb12[0].xyzx, r1.zzzz, r1.xywx
dp3 r0.w, r0.xyzx, cb12[3].xyzx
dp3_sat r0.x, r0.xyzx, v7.xyzx
mul r0.x, r0.x, cb12[10].z
mad_sat r0.y, r0.w, cb12[12].x, cb12[12].y
mul r0.yzw, r0.yyyy, cb12[4].xxyz
mul r0.yzw, r0.yyzw, cb12[11].xxxx
mad r0.yzw, cb12[11].yyyy, r1.xxyz, r0.yyzw
mad r0.yzw, cb12[6].xxyz, cb12[11].zzzz, r0.yyzw
mad r1.x, r3.x, cb12[15].x, v3.w
mad r1.x, r3.y, cb12[15].y, r1.x
mad r1.x, r3.z, cb12[15].z, r1.x
max r1.y, r4.z, r4.y
max r1.y, r1.y, r4.x
mul r1.z, r1.y, v2.w
mad r1.y, -v2.w, r1.y, l(1.000000)
mad r1.x, -r1.y, r1.x, r1.z
add r1.x, r1.x, -cb12[8].x
mul_sat r1.x, r1.x, cb12[8].y
add r1.y, -r1.x, l(1.000000)
mul r1.x, r1.x, v1.w
add r1.z, -cb12[10].w, l(1.000000)
mad_sat r1.y, r1.y, cb12[10].w, r1.z
mul r2.xyz, r1.yyyy, v8.xyzx
mad r0.yzw, cb12[5].xxyz, r0.yyzw, r2.xxyz
mul r1.z, r0.x, v7.w
mad r0.x, -r0.x, v7.w, v7.w
mad r0.x, v7.w, r0.x, r1.z
mul r0.x, r1.y, r0.x
mul r1.yzw, r0.xxxx, cb12[4].xxyz
mad r0.xyz, r1.yzwy, cb12[10].yyyy, r0.yzwy
mad r0.xyz, r0.xyzx, v9.wwww, v9.xyzx
mul o0.xyz, r0.xyzx, cb2[13].zzzz
div r0.xy, v6.xyxx, v6.wwww
sample r0.xyzw, r0.xyxx, t10.xyzw, s10
add r0.x, -r0.x, l(1.000000)
add r0.y, r0.x, -cb12[13].z
ge r0.x, r0.x, l(1.000000)
div r0.y, cb12[13].w, r0.y
add r0.y, r0.y, -v6.w
movc r0.x, r0.x, cb12[27].x, r0.y
div_sat r0.x, r0.x, cb12[27].x
mul o0.w, r0.x, r1.x
ret
// Approximately 82 instruction slots used
*/
Binary file not shown.
+398
View File
@@ -0,0 +1,398 @@
#include "Common.hlsli"
#include "Quaternion.hlsli"
#include "Clouds.hlsli"
cbuffer VSSceneVars : register(b1)
{
float4x4 ViewProj;
float4x4 ViewInv;
}
cbuffer VSEntityVars : register(b2)
{
float4 CamRel;
float4 Orientation;
float4 Scale;
}
cbuffer VSModelVars : register(b3)
{
float4x4 Transform;
}
struct VS_INPUT
{
float4 Position : POSITION;
float3 Normal : NORMAL;
float2 Texcoord0 : TEXCOORD0;
float4 Colour0 : COLOR0;
float4 Tangent : TANGENT;
};
struct VS_OUTPUT
{
float4 Position : SV_POSITION; // 0 xyzw 0 POS float xyzw
float4 o0 : TEXCOORD0; // 0 xyzw 0 NONE float
float4 o1 : TEXCOORD1; // 1 xyzw 1 NONE float xyzw
float4 o2 : TEXCOORD2; // 2 xyzw 2 NONE float xyzw
float4 o3 : TEXCOORD3; // 3 xyzw 3 NONE float xyzw
float2 o4 : TEXCOORD4; // 4 xy 4 NONE float xy
float4 o5 : TEXCOORD5; // 5 xyzw 5 NONE float xyzw
float4 o6 : TEXCOORD6; // 6 xyzw 6 NONE float xy w
float4 o7 : TEXCOORD7; // 7 xyzw 7 NONE float xyzw
float3 o8 : TEXCOORD8; // 8 xyz 8 NONE float xyz
float4 o9 : TEXCOORD9; // 9 xyzw 9 NONE float xyzw
};
VS_OUTPUT main(VS_INPUT input)
{
VS_OUTPUT output;
float3 spos = input.Position.xyz * Scale.xyz*0.05;
float3 bpos = mulvq(spos, Orientation);
float3 opos = CamRel.xyz + bpos;
float4 cpos = mul(float4(opos, 1), ViewProj);
float3 tnorm = input.Normal;
float3 bnorm = normalize(mulvq(tnorm, Orientation));
float4 vc = input.Colour0;
float2 tc = input.Texcoord0;
float2 o4xy = (gUVOffset[0].xy * cloudLayerAnimScale1) + (tc * gRescaleUV1) + gUVOffset1;
float2 o5xy = (gUVOffset[0].zw * cloudLayerAnimScale2) + (tc * gRescaleUV2) + gUVOffset2;
float2 o5zw = (gUVOffset[1].xy * cloudLayerAnimScale3) + (tc * gRescaleUV3) + gUVOffset3;
output.Position = cpos;
output.o0 = 0;
output.o1 = float4(bnorm, vc.w);
output.o2 = float4(0, 0, 0, vc.y);
output.o3 = float4(0, 0, 0, vc.z);
output.o4 = o4xy;
output.o5 = float4(o5xy, o5zw);
output.o6 = 0;
output.o7 = 0;
output.o8 = 0;
output.o9 = 0;
return output;
}
/*
//clouds_animsoft.fxc_VSCloudsVertScatterPiercing
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// Buffer Definitions:
//
// cbuffer rage_matrices
// {
//
// row_major float4x4 gWorld; // Offset: 0 Size: 64
// row_major float4x4 gWorldView; // Offset: 64 Size: 64 [unused]
// row_major float4x4 gWorldViewProj; // Offset: 128 Size: 64
// row_major float4x4 gViewInverse; // Offset: 192 Size: 64 [unused]
//
// }
//
// cbuffer rage_clipplanes
// {
//
// float4 ClipPlanes; // Offset: 0 Size: 16
//
// }
//
// cbuffer lighting_globals
// {
//
// float4 gDirectionalLight; // Offset: 0 Size: 16 [unused]
// float4 gDirectionalColour; // Offset: 16 Size: 16 [unused]
// int gNumForwardLights; // Offset: 32 Size: 4 [unused]
// float4 gLightPositionAndInvDistSqr[8];// Offset: 48 Size: 128 [unused]
// float4 gLightDirectionAndFalloffExponent[8];// Offset: 176 Size: 128 [unused]
// float4 gLightColourAndCapsuleExtent[8];// Offset: 304 Size: 128 [unused]
// float gLightConeScale[8]; // Offset: 432 Size: 116 [unused]
// float gLightConeOffset[8]; // Offset: 560 Size: 116 [unused]
// float4 gLightNaturalAmbient0; // Offset: 688 Size: 16 [unused]
// float4 gLightNaturalAmbient1; // Offset: 704 Size: 16 [unused]
// float4 gLightArtificialIntAmbient0;// Offset: 720 Size: 16 [unused]
// float4 gLightArtificialIntAmbient1;// Offset: 736 Size: 16 [unused]
// float4 gLightArtificialExtAmbient0;// Offset: 752 Size: 16 [unused]
// float4 gLightArtificialExtAmbient1;// Offset: 768 Size: 16 [unused]
// float4 gDirectionalAmbientColour; // Offset: 784 Size: 16 [unused]
// float4 globalFogParams[5]; // Offset: 800 Size: 80
// float4 globalFogColor; // Offset: 880 Size: 16
// float4 globalFogColorE; // Offset: 896 Size: 16
// float4 globalFogColorN; // Offset: 912 Size: 16
// float4 globalFogColorMoon; // Offset: 928 Size: 16
// float4 gReflectionTweaks; // Offset: 944 Size: 16 [unused]
//
// }
//
// cbuffer clouds_locals
// {
//
// float3 gSkyColor; // Offset: 0 Size: 12 [unused]
// float3 gEastMinusWestColor; // Offset: 16 Size: 12 [unused]
// float3 gWestColor; // Offset: 32 Size: 12 [unused]
// float3 gSunDirection; // Offset: 48 Size: 12
// float3 gSunColor; // Offset: 64 Size: 12
// float3 gCloudColor; // Offset: 80 Size: 12 [unused]
// float3 gAmbientColor; // Offset: 96 Size: 12 [unused]
// float3 gBounceColor; // Offset: 112 Size: 12 [unused]
// float4 gDensityShiftScale; // Offset: 128 Size: 16 [unused]
// float4 gScatterG_GSquared_PhaseMult_Scale;// Offset: 144 Size: 16
// float4 gPiercingLightPower_Strength_NormalStrength_Thickness;// Offset: 160 Size: 16
// float3 gScaleDiffuseFillAmbient; // Offset: 176 Size: 12 [unused]
// float3 gWrapLighting_MSAARef; // Offset: 192 Size: 12 [unused]
// float4 gNearFarQMult; // Offset: 208 Size: 16 [unused]
// float3 gAnimCombine; // Offset: 224 Size: 12 [unused]
// float3 gAnimSculpt; // Offset: 240 Size: 12 [unused]
// float3 gAnimBlendWeights; // Offset: 256 Size: 12 [unused]
// float4 gUVOffset[2]; // Offset: 272 Size: 32
// row_major float4x4 gCloudViewProj; // Offset: 304 Size: 64
// float4 gCameraPos; // Offset: 368 Size: 16
// float2 gUVOffset1; // Offset: 384 Size: 8
// float2 gUVOffset2; // Offset: 392 Size: 8
// float2 gUVOffset3; // Offset: 400 Size: 8
// float2 gRescaleUV1; // Offset: 408 Size: 8
// float2 gRescaleUV2; // Offset: 416 Size: 8
// float2 gRescaleUV3; // Offset: 424 Size: 8
// float gSoftParticleRange; // Offset: 432 Size: 4 [unused]
// float gEnvMapAlphaScale; // Offset: 436 Size: 4 [unused]
// float2 cloudLayerAnimScale1; // Offset: 440 Size: 8
// float2 cloudLayerAnimScale2; // Offset: 448 Size: 8
// float2 cloudLayerAnimScale3; // Offset: 456 Size: 8
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim HLSL Bind Count
// ------------------------------ ---------- ------- ----------- -------------- ------
// rage_clipplanes cbuffer NA NA cb0 1
// rage_matrices cbuffer NA NA cb1 1
// lighting_globals cbuffer NA NA cb3 1
// clouds_locals cbuffer NA NA cb12 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION 0 xyzw 0 NONE float xyzw
// COLOR 0 xyzw 1 NONE float xyzw
// NORMAL 0 xyz 2 NONE float xyz
// TEXCOORD 0 xy 3 NONE float xy
// TANGENT 0 xyzw 4 NONE float xyzw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD 0 xyzw 0 NONE float xyzw
// TEXCOORD 1 xyzw 1 NONE float xyzw
// TEXCOORD 2 xyzw 2 NONE float xyzw
// TEXCOORD 3 xyzw 3 NONE float xyzw
// TEXCOORD 4 xy 4 NONE float xy
// TEXCOORD 5 xyzw 5 NONE float xyzw
// TEXCOORD 6 xyzw 6 NONE float xyzw
// TEXCOORD 7 xyzw 7 NONE float xyzw
// TEXCOORD 8 xyz 8 NONE float xyz
// TEXCOORD 9 xyzw 9 NONE float xyzw
// SV_Position 0 xyzw 10 POS float xyzw
// SV_ClipDistance 0 xyzw 11 CLIPDST float xyzw
//
vs_4_0
dcl_constantbuffer CB1[12], immediateIndexed
dcl_constantbuffer CB0[1], immediateIndexed
dcl_constantbuffer CB3[59], immediateIndexed
dcl_constantbuffer CB12[29], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyzw
dcl_input v2.xyz
dcl_input v3.xy
dcl_input v4.xyzw
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xy
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.xyzw
dcl_output o8.xyz
dcl_output o9.xyzw
dcl_output_siv o10.xyzw, position
dcl_output_siv o11.xyzw, clip_distance
dcl_temps 5
mul r0.xyz, v0.yyyy, gWorld[1].xyzx
mad r0.xyz, v0.xxxx, gWorld[0].xyzx, r0.xyzx
mad r0.xyz, v0.zzzz, gWorld[2].xyzx, r0.xyzx
mad r0.xyz, v0.wwww, gWorld[3].xyzx, r0.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
sqrt r1.w, r0.w
rsq r0.w, r0.w
mul r2.xyz, r0.wwww, r0.xyzx
div r1.xyz, r0.xyzx, r1.wwww
mov o0.xyzw, r1.xyzw
mul r3.xyz, v2.yyyy, gWorld[1].xyzx
mad r3.xyz, v2.xxxx, gWorld[0].xyzx, r3.xyzx
mad r3.xyz, v2.zzzz, gWorld[2].xyzx, r3.xyzx
dp3 r0.w, r3.xyzx, r3.xyzx
rsq r0.w, r0.w
mul o1.xyz, r0.wwww, r3.xyzx
mov o1.w, v1.w
mul r3.xyz, v4.yyyy, gWorld[1].xyzx
mad r3.xyz, v4.xxxx, gWorld[0].xyzx, r3.xyzx
mad r3.xyz, v4.zzzz, gWorld[2].xyzx, r3.xyzx
dp3 r0.w, r3.xyzx, r3.xyzx
rsq r0.w, r0.w
mul o2.xyz, r0.wwww, r3.xyzx
mov o2.w, v1.y
mul r3.xyz, v2.yzxy, v4.zxyz
mad r3.xyz, v4.yzxy, v2.zxyz, -r3.xyzx
mul r3.xyz, r3.xyzx, v4.wwww
mul r4.xyz, r3.yyyy, gWorld[1].xyzx
mad r3.xyw, r3.xxxx, gWorld[0].xyxz, r4.xyxz
mad r3.xyz, r3.zzzz, gWorld[2].xyzx, r3.xywx
dp3 r0.w, r3.xyzx, r3.xyzx
rsq r0.w, r0.w
mul o3.xyz, r0.wwww, r3.xyzx
mov o3.w, v1.z
mad r3.xy, v3.xyxx, gRescaleUV1.xyxx, gUVOffset1.xyxx
mad o4.xy, gUVOffset[0].xyxx, cloudLayerAnimScale1.xyxx, r3.xyxx
mad r3.xy, v3.xyxx, gRescaleUV2.xyxx, gUVOffset2.xyxx
mad o5.xy, gUVOffset[0].zwzz, cloudLayerAnimScale2.xyxx, r3.xyxx
mad r3.xy, v3.xyxx, gRescaleUV3.xyxx, gUVOffset3.xyxx
mad o5.zw, gUVOffset[1].xxxy, cloudLayerAnimScale3.xxxy, r3.xxxy
mul r3.xyzw, r0.yyyy, gCloudViewProj[1].xyzw
mad r3.xyzw, r0.xxxx, gCloudViewProj[0].xyzw, r3.xyzw
mad r3.xyzw, r0.zzzz, gCloudViewProj[2].xyzw, r3.xyzw
add r3.xyzw, r3.xyzw, gCloudViewProj[3].xyzw
mul r0.xyw, r3.xwxy, l(0.500000, 0.500000, 0.000000, 0.500000)
mad o6.y, r3.w, l(0.500000), -r0.w
add o6.x, r0.y, r0.x
mov o6.zw, r3.wwww
dp3 r0.x, -r1.xyzx, gSunDirection.xyzx
mad r0.xyw, -r0.xxxx, gSunDirection.xyxz, -r1.xyxz
dp3 r1.x, r1.xyzx, gSunDirection.xyzx
dp3 r1.y, r0.xywx, r0.xywx
rsq r1.y, r1.y
mul o7.xyz, r0.xywx, r1.yyyy
mov_sat r0.x, r1.x
log r0.x, r0.x
mul r0.x, r0.x, gPiercingLightPower_Strength_NormalStrength_Thickness.x
exp o7.w, r0.x
dp2 r0.x, r1.xxxx, gScatterG_GSquared_PhaseMult_Scale.xxxx
mad r0.y, r1.x, r1.x, l(1.000000)
add r0.w, gScatterG_GSquared_PhaseMult_Scale.y, l(1.000000)
add r0.x, -r0.x, r0.w
log r0.x, |r0.x|
mul r0.x, r0.x, l(1.500000)
exp r0.x, r0.x
div r0.x, r0.y, r0.x
mul r0.x, r0.x, gScatterG_GSquared_PhaseMult_Scale.z
mul r0.xyw, r0.xxxx, gSunColor.xyxz
mul o8.xyz, r0.xywx, gScatterG_GSquared_PhaseMult_Scale.wwww
dp3_sat r0.x, r2.xyzx, globalFogParams[3].xyzx
dp3_sat r0.y, r2.xyzx, globalFogParams[4].xyzx
log r0.y, r0.y
mul r0.y, r0.y, globalFogParams[4].w
exp r0.y, r0.y
log r0.x, r0.x
mul r0.x, r0.x, globalFogParams[3].w
exp r0.x, r0.x
add r1.xyz, -globalFogColorE.xyzx, globalFogColorMoon.xyzx
mad r1.xyz, r0.yyyy, r1.xyzx, globalFogColorE.xyzx
add r2.xyz, -r1.xyzx, globalFogColor.xyzx
mad r0.xyw, r0.xxxx, r2.xyxz, r1.xyxz
add r0.xyw, r0.xyxw, -globalFogColorN.xyxz
add r1.x, r1.w, -globalFogParams[0].x
max r1.x, r1.x, l(0.000000)
mul r1.y, r1.x, -globalFogParams[1].z
mul r1.y, r1.y, l(1.442695)
exp r1.y, r1.y
add r1.y, -r1.y, l(1.000000)
mad r0.xyw, r1.yyyy, r0.xyxw, globalFogColorN.xyxz
div r1.y, r1.x, r1.w
mul r1.x, r1.x, globalFogParams[1].w
mul r0.z, r0.z, r1.y
lt r1.y, l(0.010000), |r0.z|
mul r0.z, r0.z, globalFogParams[2].z
mul r1.z, r0.z, l(-1.442695)
exp r1.z, r1.z
add r1.z, -r1.z, l(1.000000)
div r0.z, r1.z, r0.z
movc r0.z, r1.y, r0.z, l(1.000000)
mul r0.z, r0.z, r1.x
min r0.z, r0.z, l(1.000000)
mul r0.z, r0.z, l(1.442695)
exp r0.z, r0.z
min r0.z, r0.z, l(1.000000)
add r0.z, -r0.z, l(1.000000)
mul_sat r0.z, r0.z, globalFogParams[2].y
add r1.x, -v1.x, l(1.000000)
max r0.z, r0.z, r1.x
mul r0.xyw, r0.zzzz, r0.xyxw
add r0.z, -r0.z, l(1.000000)
mul r1.y, r1.x, globalFogParams[2].w
mad r1.x, -r1.x, globalFogParams[2].w, l(1.000000)
mul r2.x, r1.y, globalFogColor.w
mul r2.y, r1.y, globalFogColorE.w
mul r2.z, r1.y, globalFogColorN.w
mad o9.xyz, r0.xywx, r1.xxxx, r2.xyzx
mul o9.w, r0.z, r1.x
lt r0.x, r3.z, l(0.000000)
div r0.y, l(0.100000), r3.w
movc r0.x, r0.x, r0.y, r3.z
lt r0.y, r3.w, r3.z
add r0.z, r3.w, l(-0.100000)
movc r0.y, r0.y, r0.z, r3.z
ne r0.z, l(0.000000, 0.000000, 0.000000, 0.000000), gCameraPos.w
movc r0.x, r0.z, r0.x, r0.y
lt r0.y, l(0.000000), r3.w
movc o10.z, r0.y, r0.x, r3.z
mov o10.xyw, r3.xyxw
mul r0.xyzw, v0.yyyy, gWorldViewProj[1].xyzw
mad r0.xyzw, v0.xxxx, gWorldViewProj[0].xyzw, r0.xyzw
mad r0.xyzw, v0.zzzz, gWorldViewProj[2].xyzw, r0.xyzw
add r0.xyzw, r0.xyzw, gWorldViewProj[3].xyzw
dp4 o11.x, r0.xyzw, ClipPlanes.xyzw
mov o11.yzw, l(0,0,0,0)
ret
// Approximately 135 instruction slots used
*/
+551
View File
@@ -0,0 +1,551 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{0D14B076-0ABF-434E-AB9F-36E7800D8887}</ProjectGuid>
<RootNamespace>CodeWalkerShaders</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
</ClCompile>
<FxCompile>
<ObjectFileOutput>$(ProjectDir)%(Filename).cso</ObjectFileOutput>
<ShaderModel>4.0</ShaderModel>
</FxCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
</ClCompile>
<FxCompile>
<ObjectFileOutput>$(ProjectDir)%(Filename).cso</ObjectFileOutput>
<ShaderModel>4.0</ShaderModel>
</FxCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<FxCompile>
<ObjectFileOutput>$(ProjectDir)%(Filename).cso</ObjectFileOutput>
<ShaderModel>4.0</ShaderModel>
</FxCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<FxCompile>
<ObjectFileOutput>$(ProjectDir)%(Filename).cso</ObjectFileOutput>
<ShaderModel>4.0</ShaderModel>
</FxCompile>
</ItemDefinitionGroup>
<ItemGroup>
<FxCompile Include="BasicPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="BasicVS_Box.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="BasicVS_Capsule.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="BasicVS_Cylinder.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="BasicVS_PNCCT.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="BasicVS_PNCCTT.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="BasicVS_PNCCTTT.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="BasicVS_PNCCTTTX.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="BasicVS_PNCCTTX.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="BasicVS_PNCCTX.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="BasicVS_PNCT.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4.0</ShaderModel>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4.0</ShaderModel>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4.0</ShaderModel>
</FxCompile>
<FxCompile Include="BasicVS_PNCTTTX.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="BasicVS_PNCTTX.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="BasicVS_PNCTX.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="BasicVS_Sphere.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="BoundingBoxVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="BoundsPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="BoundingSphereVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="CablePS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="CableVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="CloudsPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="CloudsVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="DistantLightsPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="DistantLightsVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="MarkerPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="MarkerVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="PathBoxPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="PathBoxVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="PathDynVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="PathPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="PathVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="PPBloomFilterBPHCS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4.0</ShaderModel>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4.0</ShaderModel>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4.0</ShaderModel>
</FxCompile>
<FxCompile Include="PPBloomFilterVCS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4.0</ShaderModel>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4.0</ShaderModel>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4.0</ShaderModel>
</FxCompile>
<FxCompile Include="PPCopyPixelsPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="PPFinalPassPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="PPFinalPassVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="PPLumBlendCS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4.0</ShaderModel>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4.0</ShaderModel>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4.0</ShaderModel>
</FxCompile>
<FxCompile Include="PPReduceTo0DCS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4.0</ShaderModel>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4.0</ShaderModel>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4.0</ShaderModel>
</FxCompile>
<FxCompile Include="PPReduceTo1DCS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4.0</ShaderModel>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4.0</ShaderModel>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">4.0</ShaderModel>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Compute</ShaderType>
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">4.0</ShaderModel>
</FxCompile>
<FxCompile Include="ShadowPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="ShadowVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="SkydomePS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="SkydomeVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="SkyMoonPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="SkyMoonVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="SkySunPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="SkySunVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="TerrainPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="TerrainVS_PNCCT.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="TerrainVS_PNCCTT.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="TerrainVS_PNCCTTTX.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="TerrainVS_PNCCTTX.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="TerrainVS_PNCCTX.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="TerrainVS_PNCTTTX.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="TerrainVS_PNCTTX.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="TreesLodPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="TreesLodVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="WaterPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="WaterVS_PCT.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="WaterVS_PNCT.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="WaterVS_PNCTX.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="WaterVS_PT.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
<FxCompile Include="WidgetPS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="WidgetVS.hlsl">
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
</FxCompile>
</ItemGroup>
<ItemGroup>
<None Include="BasicVS.hlsli" />
<None Include="Clouds.hlsli" />
<None Include="Common.hlsli" />
<None Include="Quaternion.hlsli" />
<None Include="Shadowmap.hlsli" />
<None Include="Skydome.hlsli" />
<None Include="TerrainVS.hlsli" />
<None Include="WaterVS.hlsli" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+79
View File
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<FxCompile Include="BasicPS.hlsl" />
<FxCompile Include="TerrainPS.hlsl" />
<FxCompile Include="TerrainVS_PNCTTX.hlsl" />
<FxCompile Include="TerrainVS_PNCCT.hlsl" />
<FxCompile Include="TerrainVS_PNCCTT.hlsl" />
<FxCompile Include="TerrainVS_PNCCTTTX.hlsl" />
<FxCompile Include="TerrainVS_PNCCTTX.hlsl" />
<FxCompile Include="TerrainVS_PNCCTX.hlsl" />
<FxCompile Include="TerrainVS_PNCTTTX.hlsl" />
<FxCompile Include="MarkerVS.hlsl" />
<FxCompile Include="MarkerPS.hlsl" />
<FxCompile Include="SkydomeVS.hlsl" />
<FxCompile Include="SkydomePS.hlsl" />
<FxCompile Include="BoundingSphereVS.hlsl" />
<FxCompile Include="BoundsPS.hlsl" />
<FxCompile Include="BoundingBoxVS.hlsl" />
<FxCompile Include="TreesLodVS.hlsl" />
<FxCompile Include="TreesLodPS.hlsl" />
<FxCompile Include="ShadowVS.hlsl" />
<FxCompile Include="ShadowPS.hlsl" />
<FxCompile Include="BasicVS_PNCT.hlsl" />
<FxCompile Include="BasicVS_PNCTX.hlsl" />
<FxCompile Include="BasicVS_PNCCT.hlsl" />
<FxCompile Include="BasicVS_PNCCTT.hlsl" />
<FxCompile Include="BasicVS_PNCCTTT.hlsl" />
<FxCompile Include="BasicVS_PNCCTX.hlsl" />
<FxCompile Include="BasicVS_PNCTTX.hlsl" />
<FxCompile Include="BasicVS_PNCCTTX.hlsl" />
<FxCompile Include="BasicVS_PNCTTTX.hlsl" />
<FxCompile Include="BasicVS_PNCCTTTX.hlsl" />
<FxCompile Include="BasicVS_Box.hlsl" />
<FxCompile Include="BasicVS_Sphere.hlsl" />
<FxCompile Include="BasicVS_Capsule.hlsl" />
<FxCompile Include="BasicVS_Cylinder.hlsl" />
<FxCompile Include="CableVS.hlsl" />
<FxCompile Include="CablePS.hlsl" />
<FxCompile Include="DistantLightsVS.hlsl" />
<FxCompile Include="DistantLightsPS.hlsl" />
<FxCompile Include="PPBloomFilterBPHCS.hlsl" />
<FxCompile Include="PPBloomFilterVCS.hlsl" />
<FxCompile Include="PPCopyPixelsPS.hlsl" />
<FxCompile Include="PPFinalPassPS.hlsl" />
<FxCompile Include="PPFinalPassVS.hlsl" />
<FxCompile Include="PPLumBlendCS.hlsl" />
<FxCompile Include="PPReduceTo0DCS.hlsl" />
<FxCompile Include="PPReduceTo1DCS.hlsl" />
<FxCompile Include="SkySunVS.hlsl" />
<FxCompile Include="SkySunPS.hlsl" />
<FxCompile Include="CloudsVS.hlsl" />
<FxCompile Include="CloudsPS.hlsl" />
<FxCompile Include="WaterVS_PNCT.hlsl" />
<FxCompile Include="WaterVS_PNCTX.hlsl" />
<FxCompile Include="WaterPS.hlsl" />
<FxCompile Include="WaterVS_PT.hlsl" />
<FxCompile Include="WaterVS_PCT.hlsl" />
<FxCompile Include="PathVS.hlsl" />
<FxCompile Include="PathPS.hlsl" />
<FxCompile Include="WidgetVS.hlsl" />
<FxCompile Include="WidgetPS.hlsl" />
<FxCompile Include="PathBoxVS.hlsl" />
<FxCompile Include="PathBoxPS.hlsl" />
<FxCompile Include="SkyMoonVS.hlsl" />
<FxCompile Include="SkyMoonPS.hlsl" />
<FxCompile Include="PathDynVS.hlsl" />
</ItemGroup>
<ItemGroup>
<None Include="Quaternion.hlsli" />
<None Include="Common.hlsli" />
<None Include="Shadowmap.hlsli" />
<None Include="TerrainVS.hlsli" />
<None Include="BasicVS.hlsli" />
<None Include="Skydome.hlsli" />
<None Include="Clouds.hlsli" />
<None Include="WaterVS.hlsli" />
</ItemGroup>
</Project>
+169
View File
@@ -0,0 +1,169 @@
struct ShaderGlobalLightParams
{
float3 LightDir;
float LightHdr; //global intensity
float4 LightDirColour;
float4 LightDirAmbColour;
float4 LightNaturalAmbUp;
float4 LightNaturalAmbDown;
float4 LightArtificialAmbUp;
float4 LightArtificialAmbDown;
};
//for unpacking colours etc
uint4 Unpack4x8(uint v)
{
return uint4(v >> 24, v >> 16, v >> 8, v) & 0xFF;
}
float4 Unpack4x8UNF(uint v)
{
float4 u = (float4)Unpack4x8(v);
return u*0.0039215686274509803921568627451f;// u * 1/255
}
float DepthFunc(float2 zw)
{
return zw.x;//
//return zw.x * (0.1 + 0.00001*(abs(zw.y)));
//return zw.x * (0.1 + 0.00001*((zw.y)));
//const float far = 1000.0; //outerra version - needs logz written to frag depth in PS...
//const float C = 0.01; //~10m linearization
//const float FC = 1.0/log(far*C + 1);
//////logz = gl_Position.w*C + 1; //version with fragment code
////logz = log(gl_Position.w*C + 1)*FC;
////gl_Position.z = (2*logz - 1)*gl_Position.w;
//float logz = log(zw.y*C + 1)*FC;
//return (2*logz - 1)*zw.y;
}
float3 GeomWindMotion(float3 ipos, float3 vc0, float4 windvec, float4 overrideparams)
{
//lt r1.x, r0.x, l(1.000000)
//mul r1.yzw, v2.xxxz, cb12[0].xxxy //umGlobalParams
//mul r1.yzw, r1.yyzw, cb9[13].xxxy //umGlobalOverrideParams
//add r2.x, v2.y, cb9[0].w //_worldPlayerPos_umGlobalPhaseShift
//mul r2.x, |r2.x|, l(6.283185)
//mul r2.yzw, cb9[13].zzzw, cb12[0].zzzw //umGlobalOverrideParams, umGlobalParams
//mad r2.xyz, cb2[12].xxxx, r2.yzwy, r2.xxxx //globalScalars2
//sincos r2.xyz, null, r2.xyzx
//mad r1.yzw, r2.xxyz, r1.yyzw, v0.xxyz
//movc r1.xyz, r1.xxxx, r1.yzwy, v0.xyzx
//add r1.w, -r0.x, l(1.000000)
//mul r0.xyz, r0.yzwy, r0.xxxx
//mad r0.xyz, r1.wwww, r1.xyzx, r0.xyzx
//mul r1.xyzw, r0.yyyy, cb1[9].xyzw
//mad r1.xyzw, r0.xxxx, cb1[8].xyzw, r1.xyzw
//mad r0.xyzw, r0.zzzz, cb1[10].xyzw, r1.xyzw
//add o0.xyzw, r0.xyzw, cb1[11].xyzw //screen pos out
//mov o1.xy, v4.xyxx
float3 f1 = vc0.xxz * windvec.xxy * overrideparams.xxy;
float phase = vc0.y + 0.0; //playerpos/global phase shift?
float phrad = abs(phase)*6.283185;
float3 f2 = windvec.zzw * overrideparams.zzw + phrad; //globalScalars2
f2 = sin(f2);
f1 = f2*f1 + ipos;
return f1;
//return ipos;
}
float3 NormalMap(float2 nmv, float bumpinezz, float3 norm, float3 tang, float3 bita)
{
//r1 = nmv; //sample r1.xyzw, v2.xyxx, t2.xyzw, s2 (BumpSampler)
//float bmp = max(bumpinezz, 0.001); //max r0.x, bumpiness, l(0.001000)
float2 nxy = nmv.xy * 2 - 1; //mad r0.yz, r1.xxyx, l(0.000000, 2.000000, 2.000000, 0.000000), l(0.000000, -1.000000, -1.000000, 0.000000)
float2 bxy = nxy * max(bumpinezz, 0.001); //mul r0.xw, r0.xxxx, r0.yyyz
float bxyz = sqrt(abs(1 - dot(nxy, nxy))); //r0.y = dot(nxy, nxy); //dp2 r0.y, r0.yzyy, r0.yzyy //r0.y = 1.0 - r0.y; //add r0.y, -r0.y, l(1.000000) //r0.y = sqrt(abs(r0.y)); //sqrt r0.y, |r0.y|
float3 t1 = tang * bxy.x; //mad r0.xzw, r0.xxxx, v4.xxyz, r1.xxyz
float3 t2 = bita * bxy.y + t1; //mul r1.xyz, r0.wwww, v5.xyzx
float3 t3 = norm * bxyz + t2; //mad r0.xyz, r0.yyyy, v3.xyzx, r0.xzwx
return normalize(t3);
//r0.w = dot(t3, t3); //dp3 r0.w, r0.xyzx, r0.xyzx
//r0.w = 1.0 / sqrt(r0.w); //rsq r0.w, r0.w
////r1.x = r0.z*r0.w - 0.35; //mad r1.x, r0.z, r0.w, l(-0.350000)
//t3 = t3*r0.w; //mul r0.xyz, r0.wwww, r0.xyzx
////mad o1.xyz, t3.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
//return t3;
}
float3 BasicLighting(float4 lightcolour, float4 ambcolour, float pclit)
{
return (ambcolour.rgb + lightcolour.rgb*pclit);
}
float3 AmbientLight(float3 diff, float normz, float4 upcolour, float4 downcolour, float amount)
{
float bf = normz*0.5 + 0.5;
float3 upval = upcolour.rgb*saturate(1.0-bf);
float3 downval = downcolour.rgb*saturate(bf);
return diff*(upval + downval)*amount;
//return (float3)0;
}
float3 GlobalLighting(float3 diff, float3 norm, float4 vc0, float lf, uniform ShaderGlobalLightParams globalLights)
{
float3 c = saturate(diff);
float3 fc = c;
float naturalDiffuseFactor = 1.0;
float artificialDiffuseFactor = saturate(vc0.g);
c *= BasicLighting(globalLights.LightDirColour, globalLights.LightDirAmbColour, lf);
c += AmbientLight(fc, norm.z, globalLights.LightNaturalAmbUp, globalLights.LightNaturalAmbDown, naturalDiffuseFactor);
c += AmbientLight(fc, norm.z, globalLights.LightArtificialAmbUp, globalLights.LightArtificialAmbDown, artificialDiffuseFactor);
return c;
}
Binary file not shown.
+16
View File
@@ -0,0 +1,16 @@
Texture2D<float4> Lightmap : register(t0);
SamplerState TextureSS : register(s0);
struct VS_OUTPUT
{
float4 Position : SV_POSITION;
float2 Texcoord : TEXCOORD0;
float4 Colour : COLOR0;
};
float4 main(VS_OUTPUT input) : SV_TARGET
{
//return float4(1,0,0,1);
return Lightmap.Sample(TextureSS, input.Texcoord) * input.Colour;
}
Binary file not shown.
+57
View File
@@ -0,0 +1,57 @@
#include "Common.hlsli"
struct VS_INPUT
{
float4 Position : POSITION;
float2 Texcoord : TEXCOORD0;
};
struct VS_OUTPUT
{
float4 Position : SV_POSITION;
float2 Texcoord : TEXCOORD0;
float4 Colour : COLOR0;
};
struct DistLODLight
{
float3 Position;
uint Colour;
};
StructuredBuffer<DistLODLight> LightInstances : register(t0);
cbuffer VSSceneVars : register(b0)
{
float4x4 ViewProj;
float4x4 ViewInv;
float3 CamPos;
float Pad0;
};
VS_OUTPUT main(VS_INPUT input, uint iid : SV_InstanceID)
{
VS_OUTPUT output;
DistLODLight light = LightInstances[iid];
float4 ipos = float4(light.Position - CamPos, 1.0);
float4 vpos = float4(input.Position.xy, 0.0, 0.0);// *20.0f;
float4 rgbi = Unpack4x8UNF(light.Colour).gbar;
float dist = length(ipos.xyz);
float size = rgbi.a * min(dist, 50);
float3 offs = vpos.xyz * min(size*0.1f, 3.0f);
float3 tpos = mul(offs, (float3x3)ViewInv);
ipos.xyz += tpos;
float4 opos = mul(ipos, ViewProj);
//opos.xy += offs * opos.w;
output.Position = opos;// +vpos;
output.Texcoord = input.Texcoord;
output.Colour = float4(rgbi.rgb, 0.25);
return output;
}
Binary file not shown.
+15
View File
@@ -0,0 +1,15 @@
Texture2D<float4> Colourmap : register(t0);
SamplerState TextureSS : register(s0);
struct VS_OUTPUT
{
float4 Position : SV_POSITION;
float2 Texcoord : TEXCOORD0;
};
float4 main(VS_OUTPUT input) : SV_TARGET
{
//return float4(1,0,0,1);
return Colourmap.Sample(TextureSS, input.Texcoord);
}
Binary file not shown.
+41
View File
@@ -0,0 +1,41 @@
#include "Common.hlsli"
cbuffer VSSceneVars : register(b0)
{
float4x4 ViewProj;
float4x4 ViewInv;
float4 ScreenScale; //xy = 1/wh
}
cbuffer VSMarkerVars : register(b1)
{
float4 CamRel;
float2 Size;
float2 Offset;
}
struct VS_INPUT
{
float4 Position : POSITION;
float2 Texcoord : TEXCOORD0;
};
struct VS_OUTPUT
{
float4 Position : SV_POSITION;
float2 Texcoord : TEXCOORD0;
};
VS_OUTPUT main(VS_INPUT input)
{
VS_OUTPUT output;
float3 ipos = input.Position.xyz * float3(Size * ScreenScale.y, 1) + float3(Offset * ScreenScale.y, 0);
float3 bpos = mul(ipos, (float3x3)ViewInv);
float3 opos = CamRel.xyz + bpos;
float4 pos = float4(opos, 1);
float4 cpos = mul(pos, ViewProj);
cpos.z = DepthFunc(cpos.zw);
output.Position = cpos;
output.Texcoord = input.Texcoord;
return output;
}
Binary file not shown.
+62
View File
@@ -0,0 +1,62 @@
//--------------------------------------------------------------------------------------
// File: BrightPassAndHorizFilterCS.hlsl
//
// The CS for bright pass and horizontal blur, used in CS path of
// HDRToneMappingCS11 sample
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//--------------------------------------------------------------------------------------
static const float MIDDLE_GRAY = 0.72f;
static const float LUM_WHITE = 1.5f;
static const float BRIGHT_THRESHOLD = 50.0f;//0.8f;
Texture2D Input : register( t0 );
StructuredBuffer<float> lum : register( t1 );
RWStructuredBuffer<float4> Result : register( u0 );
cbuffer cb0
{
float4 g_avSampleWeights[15];
uint g_outputwidth;
float g_inverse;
int2 g_inputsize;
}
#define kernelhalf 7
#define groupthreads 128
groupshared float4 temp[groupthreads];
[numthreads( groupthreads, 1, 1 )]
void main( uint3 Gid : SV_GroupID, uint GI : SV_GroupIndex )
{
int2 coord = int2( GI - kernelhalf + (groupthreads - kernelhalf * 2) * Gid.x, Gid.y );
coord = coord.xy * 8 + int2(4, 3);
coord = clamp( coord, int2(0, 0), int2(g_inputsize.x-1, g_inputsize.y-1) );
float4 vColor = Input.Load( int3(coord, 0) );
float fLum = max(lum[0]*g_inverse, 0.75);
// Bright pass and tone mapping
vColor = max( 0.0f, vColor - BRIGHT_THRESHOLD );
vColor *= MIDDLE_GRAY / (fLum + 0.001f);
vColor *= (1.0f + vColor/LUM_WHITE);
vColor /= (1.0f + vColor);
temp[GI] = vColor;
GroupMemoryBarrierWithGroupSync();
// Horizontal blur
if ( GI >= kernelhalf &&
GI < (groupthreads - kernelhalf) &&
( (Gid.x * (groupthreads - 2 * kernelhalf) + GI - kernelhalf) < g_outputwidth) )
{
float4 vOut = 0;
[unroll]
for ( int i = -kernelhalf; i <= kernelhalf; ++i )
vOut += temp[GI + i] * g_avSampleWeights[i + kernelhalf];
Result[GI - kernelhalf + (groupthreads - kernelhalf * 2) * Gid.x + Gid.y * g_outputwidth] = float4(vOut.rgb, 1.0f);
}
}
Binary file not shown.
+72
View File
@@ -0,0 +1,72 @@
//VERTICAL FILTER ONLY
//--------------------------------------------------------------------------------------
// File: FilterCS.hlsl
//
// The CSs for doing vertical and horizontal blur, used in CS path of
// HDRToneMappingCS11 sample
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//--------------------------------------------------------------------------------------
StructuredBuffer<float4> InputBuf : register( t0 );
Texture2D InputTex : register( t1 );
RWStructuredBuffer<float4> Result : register( u0 );
cbuffer cb0
{
float4 g_avSampleWeights[15];
int2 g_outputsize;
int2 g_inputsize;
}
#define kernelhalf 7
#define groupthreads 128
groupshared float4 temp[groupthreads];
[numthreads( groupthreads, 1, 1 )]
void main( uint3 Gid : SV_GroupID, uint GI : SV_GroupIndex )
{
int offsety = GI - kernelhalf + (groupthreads - kernelhalf * 2) * Gid.y;
offsety = clamp( offsety, 0, g_inputsize.y-1 );
int offset = Gid.x + offsety * g_inputsize.x;
temp[GI] = InputBuf[offset];
GroupMemoryBarrierWithGroupSync();
// Vertical blur
if ( GI >= kernelhalf &&
GI < (groupthreads - kernelhalf) &&
( (GI - kernelhalf + (groupthreads - kernelhalf * 2) * Gid.y) < (uint)g_outputsize.y) )
{
float4 vOut = 0;
[unroll]
for ( int i = -kernelhalf; i <= kernelhalf; ++i )
vOut += temp[GI + i] * g_avSampleWeights[i + kernelhalf];
Result[Gid.x + (GI - kernelhalf + (groupthreads - kernelhalf * 2) * Gid.y) * g_outputsize.x] = float4(vOut.rgb, 1.0f);
}
}
//[numthreads( groupthreads, 1, 1 )]
//void CSHorizFilter( uint3 Gid : SV_GroupID, uint GI : SV_GroupIndex )
//{
// int2 coord = int2( GI - kernelhalf + (groupthreads - kernelhalf * 2) * Gid.x, Gid.y );
// coord = clamp( coord, int2(0, 0), int2(g_inputsize.x-1, g_inputsize.y-1) );
// temp[GI] = InputTex.Load( int3(coord, 0) );
//
// GroupMemoryBarrierWithGroupSync();
//
// // Horizontal blur
// if ( GI >= kernelhalf &&
// GI < (groupthreads - kernelhalf) &&
// ( (Gid.x * (groupthreads - 2 * kernelhalf) + GI - kernelhalf) < g_outputsize.x) )
// {
// float4 vOut = 0;
//
// [unroll]
// for ( int i = -kernelhalf; i <= kernelhalf; ++i )
// vOut += temp[GI + i] * g_avSampleWeights[i + kernelhalf];
//
// Result[GI - kernelhalf + (groupthreads - kernelhalf * 2) * Gid.x + Gid.y * g_outputsize.x] = float4(vOut.rgb, 1.0f);
// }
//}
Binary file not shown.
+27
View File
@@ -0,0 +1,27 @@
//--------------------------------------------------------------------------------------
// File: DumpToTexture.hlsl
//
// The PS for converting CS output buffer to a texture, used in CS path of
// HDRToneMappingCS11 sample
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//--------------------------------------------------------------------------------------
StructuredBuffer<float4> buffer : register( t0 );
struct QuadVS_Output
{
float4 Pos : SV_POSITION;
float2 Tex : TEXCOORD0;
};
cbuffer cbPS : register( b0 )
{
uint4 g_param;
};
float4 main( QuadVS_Output Input ) : SV_TARGET
{
// To calculate the buffer offset, it is natural to use the screen space coordinates,
// Input.Pos is the screen space coordinates of the pixel being written
return buffer[ (Input.Pos.x - 0.5) + (Input.Pos.y - 0.5) * g_param.x ];
}
Binary file not shown.
+41
View File
@@ -0,0 +1,41 @@
struct VS_Output
{
float4 Pos : SV_POSITION;
float2 Tex : TEXCOORD0;
};
Texture2D<float4> tex : register( t0 );
StructuredBuffer<float> lum : register( t1 );
Texture2D<float4> bloom : register( t2 );
SamplerState PointSampler : register (s0);
SamplerState LinearSampler : register (s1);
static const float MIDDLE_GRAY = 0.72f;
static const float LUM_WHITE = 1.5f;
cbuffer cbPS : register( b0 )
{
float4 g_param;
};
float4 main(VS_Output input) : SV_TARGET
{
float4 vColor = tex.Sample(PointSampler, input.Tex);
float fLum = min(max(lum[0]*g_param.x, 0.2), 10); //limit amplification...
float3 vBloom = bloom.Sample(LinearSampler, input.Tex).rgb;
// Tone mapping
vColor.rgb *= MIDDLE_GRAY / (fLum + 0.001f);
vColor.rgb *= (1.0f + vColor.rgb/LUM_WHITE);
vColor.rgb /= (1.0f + vColor.rgb);
vColor.rgb += 0.6f * vBloom;
vColor.a = 1.0f;
return vColor;
}
Binary file not shown.
+14
View File
@@ -0,0 +1,14 @@
struct VS_Output
{
float4 Pos : SV_POSITION;
float2 Tex : TEXCOORD0;
};
VS_Output main( float4 pos : POSITION )
{
VS_Output output;
output.Pos = pos;
output.Tex.x = (pos.x*0.5)+0.5;
output.Tex.y = (pos.y*-0.5)+0.5;
return output;
}
Binary file not shown.
+16
View File
@@ -0,0 +1,16 @@
StructuredBuffer<float> Target : register( t0 );
RWStructuredBuffer<float> Current : register( u0 );
cbuffer cb0
{
float BlendFactor;
float3 pad;
}
[numthreads(1, 1, 1)]
void main( uint3 DTid : SV_DispatchThreadID )
{
float t = max(Target[0],0);
float c = max(Current[0],0);
Current[0] = c + ((t - c) * BlendFactor);
}
Binary file not shown.
+54
View File
@@ -0,0 +1,54 @@
StructuredBuffer<float> Input : register( t0 );
RWStructuredBuffer<float> Result : register( u0 );
cbuffer cbCS : register( b0 )
{
uint4 g_param; // g_param.x is the actual elements contained in Input
// g_param.y is the x dimension of the Dispatch call
};
#define groupthreads 128
groupshared float accum[groupthreads];
[numthreads(groupthreads,1,1)]
void main( uint3 Gid : SV_GroupID, uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID, uint GI : SV_GroupIndex )
{
if ( DTid.x < g_param.x )
accum[GI] = Input[DTid.x];
else
accum[GI] = 0;
// Parallel reduction algorithm follows
GroupMemoryBarrierWithGroupSync();
if ( GI < 64 )
accum[GI] += accum[64+GI];
GroupMemoryBarrierWithGroupSync();
if ( GI < 32 )
accum[GI] += accum[32+GI];
GroupMemoryBarrierWithGroupSync();
if ( GI < 16 )
accum[GI] += accum[16+GI];
GroupMemoryBarrierWithGroupSync();
if ( GI < 8 )
accum[GI] += accum[8+GI];
GroupMemoryBarrierWithGroupSync();
if ( GI < 4 )
accum[GI] += accum[4+GI];
GroupMemoryBarrierWithGroupSync();
if ( GI < 2 )
accum[GI] += accum[2+GI];
GroupMemoryBarrierWithGroupSync();
if ( GI < 1 )
accum[GI] += accum[1+GI];
if ( GI == 0 )
{
Result[Gid.x] = accum[0];
}
}
Binary file not shown.
+63
View File
@@ -0,0 +1,63 @@
Texture2D Input : register( t0 );
RWStructuredBuffer<float> Result : register( u0 );
cbuffer cbCS : register( b0 )
{
uint4 g_param; // (g_param.x, g_param.y) is the x and y dimensions of the Dispatch call
// (g_param.z, g_param.w) is the size of the above Input Texture2D
};
//#define CS_FULL_PIXEL_REDUCTION // Defining this or not must be the same as in PostProcessor....
#define blocksize 8
#define blocksizeY 8
#define groupthreads (blocksize*blocksizeY)
groupshared float accum[groupthreads];
static const float4 LUM_VECTOR = float4(.299, .587, .114, 0);
[numthreads(blocksize,blocksizeY,1)]
void main( uint3 Gid : SV_GroupID, uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID, uint GI : SV_GroupIndex )
{
float4 s =
#ifdef CS_FULL_PIXEL_REDUCTION
Input.Load( uint3(DTid.xy , 0) )+
Input.Load( uint3(DTid.xy + uint2(blocksize*g_param.x, 0), 0) ) +
Input.Load( uint3(DTid.xy + uint2(0, blocksizeY*g_param.y), 0) ) +
Input.Load( uint3(DTid.xy + uint2(blocksize*g_param.x, blocksizeY*g_param.y), 0) );
#else
Input.Load( uint3((float)DTid.x/81.0f*g_param.z, (float)DTid.y/81.0f*g_param.w, 0) );
#endif
accum[GI] = dot( s, LUM_VECTOR );
// Parallel reduction algorithm follows
GroupMemoryBarrierWithGroupSync();
if ( GI < 32 )
accum[GI] += accum[32+GI];
GroupMemoryBarrierWithGroupSync();
if ( GI < 16 )
accum[GI] += accum[16+GI];
GroupMemoryBarrierWithGroupSync();
if ( GI < 8 )
accum[GI] += accum[8+GI];
GroupMemoryBarrierWithGroupSync();
if ( GI < 4 )
accum[GI] += accum[4+GI];
GroupMemoryBarrierWithGroupSync();
if ( GI < 2 )
accum[GI] += accum[2+GI];
GroupMemoryBarrierWithGroupSync();
if ( GI < 1 )
accum[GI] += accum[1+GI];
if ( GI == 0 )
{
Result[Gid.y*g_param.x+Gid.x] = accum[0];
}
}
Binary file not shown.
+17
View File
@@ -0,0 +1,17 @@
struct VS_OUTPUT
{
float4 Position : SV_POSITION;
float4 Colour : COLOR0;
float3 Normal : NORMAL;
};
float4 main(VS_OUTPUT input) : SV_TARGET
{
float4 c = input.Colour;
return float4(c.rgb, 1.0f);
}
Binary file not shown.
+45
View File
@@ -0,0 +1,45 @@
cbuffer VSSceneVars : register(b0)
{
float4x4 ViewProj;
float4 CameraPos;
float4 LightColour;
}
StructuredBuffer<float4> Nodes : register(t0);
struct VS_INPUT
{
float4 Position : POSITION;
float4 Normal : NORMAL;
};
struct VS_OUTPUT
{
float4 Position : SV_POSITION;
float4 Colour : COLOR0;
float3 Normal : NORMAL;
};
VS_OUTPUT main(VS_INPUT input, uint iid : SV_InstanceID)
{
VS_OUTPUT output;
float4 n = Nodes[iid];
float3 npos = n.xyz;
float3 ipos = input.Position.xyz * 0.25f;
float3 opos = ipos + npos - CameraPos.xyz;
float4 cpos = mul(float4(opos, 1), ViewProj);
output.Position = cpos;
output.Colour = ((float4)1) * LightColour.a; //apply intensity
output.Normal = input.Normal.xyz;
return output;
}
Binary file not shown.
+45
View File
@@ -0,0 +1,45 @@
#include "Common.hlsli"
cbuffer VSSceneVars : register(b0)
{
float4x4 ViewProj;
float4 CameraPos;
float4 LightColour;
}
struct PathShaderVertex
{
float3 Position;
uint Colour;
};
StructuredBuffer<PathShaderVertex> Vertices : register(t0);
struct VS_OUTPUT
{
float4 Position : SV_POSITION;
float4 Colour : COLOR0;
};
VS_OUTPUT main(uint id : SV_VertexID)
{
VS_OUTPUT output;
float3 pos;
float4 col;
PathShaderVertex vert = Vertices[id];
pos = vert.Position;
col = Unpack4x8UNF(vert.Colour).abgr;
float3 opos = pos - CameraPos.xyz;
float4 cpos = mul(float4(opos, 1), ViewProj);
output.Position = cpos;
output.Colour.rgb = col.rgb * LightColour.a; //apply intensity
output.Colour.a = col.a;
return output;
}
Binary file not shown.
+16
View File
@@ -0,0 +1,16 @@
struct VS_OUTPUT
{
float4 Position : SV_POSITION;
float4 Colour : COLOR0;
};
float4 main(VS_OUTPUT input) : SV_TARGET
{
float4 c = input.Colour;
return float4(c.rgb, saturate(c.a));
}
Binary file not shown.
+37
View File
@@ -0,0 +1,37 @@
cbuffer VSSceneVars : register(b0)
{
float4x4 ViewProj;
float4 CameraPos;
float4 LightColour;
}
struct VS_INPUT
{
float4 Position : POSITION;
float4 Colour : COLOR0;
};
struct VS_OUTPUT
{
float4 Position : SV_POSITION;
float4 Colour : COLOR0;
};
VS_OUTPUT main(VS_INPUT input)
{
VS_OUTPUT output;
float3 pos = input.Position.xyz;
float4 col = input.Colour;
float3 opos = pos - CameraPos.xyz;
float4 cpos = mul(float4(opos, 1), ViewProj);
output.Position = cpos;
output.Colour.rgb = col.rgb * LightColour.a; //apply intensity
output.Colour.a = col.a;
return output;
}
+11
View File
@@ -0,0 +1,11 @@
float3 mulvq(float3 v, float4 q)
{
float3 u = q.xyz;
float s = q.w;
return (dot(u, v)*u*2.0f) + (s*s - dot(u, u)) * v + (cross(u, v)*s*2.0f);
}
Binary file not shown.
+32
View File
@@ -0,0 +1,32 @@
Texture2D<float4> Colourmap : register(t0);
SamplerState TextureSS : register(s0);
cbuffer PSGeomVars : register(b0)
{
uint EnableTexture;
uint EnableTint;
uint IsDecal;
uint Pad3;
}
struct VS_OUTPUT
{
float4 Position : SV_POSITION;
//float3 Normal : NORMAL;
float2 Texcoord : TEXCOORD0;
//float4 Colour : COLOR0;
//float4 Tint : COLOR1;
};
float4 main(VS_OUTPUT input) : SV_TARGET
{
if (EnableTexture == 1)
{
float4 c = Colourmap.Sample(TextureSS, input.Texcoord);
if ((IsDecal == 0) && (c.a <= 0.33)) discard;
if ((IsDecal == 1) && (c.a <= 0.0)) discard;
}
return float4(1.0f, 1.0f, 1.0f, 1.0f);
}
Binary file not shown.
+93
View File
@@ -0,0 +1,93 @@
#include "Common.hlsli"
#include "Quaternion.hlsli"
cbuffer VSSceneVars : register(b0)
{
float4x4 ViewProj;
float4 WindVector;
}
cbuffer VSEntityVars : register(b1)
{
float4 CamRel;
float4 Orientation;
uint HasSkeleton;
uint HasTransforms;
uint TintPaletteIndex;
uint Pad1;
float3 Scale;
uint Pad2;
}
cbuffer VSModelVars : register(b2)
{
float4x4 Transform;
}
cbuffer GeomVars : register(b3)
{
uint EnableTexture;
uint EnableTint;
uint IsDecal;
uint EnableWind;
float4 WindOverrideParams;
}
struct VS_INPUT
{
float4 Position : POSITION;
float3 Normal : NORMAL;
float2 Texcoord : TEXCOORD0;
float4 Colour : COLOR0;
};
struct VS_OUTPUT
{
float4 Position : SV_POSITION;
//float3 Normal : NORMAL;
float2 Texcoord : TEXCOORD0;
//float4 Colour : COLOR0;
//float4 Tint : COLOR1;
};
//Texture2D<float4> TintPalette : register(t0);
//SamplerState TextureSS : register(s0);
VS_OUTPUT main(VS_INPUT input)
{
VS_OUTPUT output;
float3 ipos = input.Position.xyz;
float3 tpos = (HasTransforms == 1) ? mul(float4(ipos, 1), Transform).xyz : ipos;
float3 spos = tpos * Scale;
float3 bpos = mulvq(spos, Orientation);
if (EnableWind)
{
bpos = GeomWindMotion(bpos, input.Colour.xyz, WindVector, WindOverrideParams);
}
float3 opos = CamRel.xyz + bpos;
float4 pos = float4(opos, 1);
float4 cpos = mul(pos, ViewProj);
//if (IsDecal == 1)
//{
// //cpos.z -= 0.003; //todo: correct decal z-bias
//}
//cpos.z = saturate(cpos.z); //might need work
//cpos.z = DepthFunc(cpos.zw);
//float3 inorm = input.Normal;
//float3 tnorm = (HasTransforms == 1) ? mul(inorm, (float3x3)Transform) : inorm;
//float3 bnorm = normalize(mulvq(tnorm, Orientation));
//float4 tnt = 0;
//if (EnableTint == 1)
//{
// tnt = TintPalette.SampleLevel(TextureSS, float2(input.Colour.b, TintYVal), 0);
//}
output.Position = cpos;
//output.Normal = bnorm;
output.Texcoord = input.Texcoord;
//output.Colour = input.Colour;
//output.Tint = tnt;
return output;
}
+250
View File
@@ -0,0 +1,250 @@
#include "Common.hlsli"
//Texture2DArray<float> Depthmap : register(t1);
//SamplerState DepthmapSS : register(s1);
Texture2D Depthmap : register(t1);
SamplerComparisonState DepthmapSS : register(s1);
cbuffer ShadowmapVars : register(b1)
{
float4 CamScenePos; //in shadow scene coords
float4x4 CamSceneView;
float4x4 LightView;
float4 LightDir;
float4 CascadeOffsets[16];
float4 CascadeScales[16];
float4 CascadeDepths[16]; //in scene eye space
int CascadeCount;
int CascadeVisual;
int PCFLoopStart;
int PCFLoopEnd;
float BorderPaddingMin;
float BorderPaddingMax;
float Bias;
float BlurBetweenCascades;
float CascadeCountInv;
float TexelSize;
float TexelSizeX;
float Pad20;
};
float ShadowmapSceneDepth(float3 camRelPos, out float4 lspos)
{
float4 scenePos = float4(camRelPos + CamScenePos.xyz, 1.0);
lspos = mul(scenePos, LightView);
return mul(scenePos, CamSceneView).z;
}
//--------------------------------------------------------------------------------------
// Use PCF to sample the depth map and return a percent lit value.
//--------------------------------------------------------------------------------------
void ShadowmapCalculatePCFPercentLit(in float4 vShadowTexCoord,
in float fRightTexelDepthDelta,
in float fUpTexelDepthDelta,
in float fBlurRowSize,
in float fCascade,
out float fPercentLit
)
{
fPercentLit = 0.0f;
// This loop could be unrolled, and texture immediate offsets could be used if the kernel size were fixed.
// This would be performance improvment.
for (int x = PCFLoopStart; x < PCFLoopEnd; ++x)
{
for (int y = PCFLoopStart; y < PCFLoopEnd; ++y)
{
float depthcompare = vShadowTexCoord.z;
// A very simple solution to the depth bias problems of PCF is to use an offset.
// Unfortunately, too much offset can lead to Peter-panning (shadows near the base of object disappear )
// Too little offset can lead to shadow acne ( objects that should not be in shadow are partially self shadowed ).
depthcompare -= Bias;
//depthcompare += Bias;
// Compare the transformed pixel depth to the depth read from the map.
//fPercentLit += Depthmap.SampleLevel(DepthmapSS,
fPercentLit += Depthmap.SampleCmpLevelZero(DepthmapSS,
float2(
vShadowTexCoord.x + (((float)x) * TexelSizeX),
vShadowTexCoord.y + (((float)y) * TexelSize)//,
), depthcompare);
//fCascade
//), 0).r > depthcompare ? 1.0 : 0.0;// , depthcompare);//== 1.0)?1:0;//
}
}
fPercentLit /= (float)fBlurRowSize;
}
//--------------------------------------------------------------------------------------
// Calculate amount to blend between two cascades and the band where blending will occure.
//--------------------------------------------------------------------------------------
void ShadowmapCalculateBlendAmountForMap(in float4 vShadowMapTextureCoord,
in out float fCurrentPixelsBlendBandLocation,
out float fBlendBetweenCascadesAmount)
{
// Calcaulte the blend band for the map based selection.
float2 distanceToOne = float2 (1.0f - vShadowMapTextureCoord.x, 1.0f - vShadowMapTextureCoord.y);
fCurrentPixelsBlendBandLocation = min(vShadowMapTextureCoord.x, vShadowMapTextureCoord.y);
float fCurrentPixelsBlendBandLocation2 = min(distanceToOne.x, distanceToOne.y);
fCurrentPixelsBlendBandLocation =
min(fCurrentPixelsBlendBandLocation, fCurrentPixelsBlendBandLocation2);
fBlendBetweenCascadesAmount = BlurBetweenCascades != 0.0 ?
(fCurrentPixelsBlendBandLocation / BlurBetweenCascades) : 0.0;
}
static const float4 vCascadeColorsMultiplier[8] =
{
float4 (1.5f, 0.0f, 0.0f, 1.0f),
float4 (0.0f, 1.5f, 0.0f, 1.0f),
float4 (0.0f, 0.0f, 5.5f, 1.0f),
float4 (1.5f, 0.0f, 5.5f, 1.0f),
float4 (1.5f, 1.5f, 0.0f, 1.0f),
float4 (1.0f, 1.0f, 1.0f, 1.0f),
float4 (0.0f, 1.0f, 5.5f, 1.0f),
float4 (0.5f, 3.5f, 0.75f, 1.0f)
};
void ShadowComputeCoordinatesTransform(in int iCascadeIndex, inout float4 vShadowTexCoord)
{
//transform X coord for current cascade.
vShadowTexCoord.x *= CascadeCountInv;// m_fShadowPartitionSize; // precomputed (float)iCascadeIndex / (float)CASCADE_CNT
vShadowTexCoord.x += (CascadeCountInv*(float)iCascadeIndex);// (m_fShadowPartitionSize * (float)iCascadeIndex);
}
float ShadowAmount(float4 shadowcoord, float shadowdepth)//, inout float4 colour)
{
float4 vShadowMapTextureCoord = 0.0f;
float4 vShadowMapTextureCoord_blend = 0.0f;
float4 vVisualizeCascadeColor = float4(0.0f, 0.0f, 0.0f, 1.0f);
float fPercentLit = 0.0f;
float fPercentLit_blend = 0.0f;
float fUpTextDepthWeight = 0;
float fRightTextDepthWeight = 0;
float fUpTextDepthWeight_blend = 0;
float fRightTextDepthWeight_blend = 0;
int iBlurRowSize = PCFLoopEnd - PCFLoopStart;
iBlurRowSize *= iBlurRowSize;
float fBlurRowSize = (float)iBlurRowSize;
int iCascadeFound = 0;
int iNextCascadeIndex = 1;
// The interval based selection technique compares the pixel's depth against the frustum's cascade divisions.
float fCurrentPixelDepth = shadowdepth;
// This for loop is not necessary when the frustum is uniformaly divided and interval based selection is used.
// In this case fCurrentPixelDepth could be used as an array lookup into the correct frustum.
int iCurrentCascadeIndex = 0;
float4 vShadowMapTextureCoordViewSpace = shadowcoord;
if (CascadeCount == 1)
{
vShadowMapTextureCoord = vShadowMapTextureCoordViewSpace * CascadeScales[0];
vShadowMapTextureCoord += CascadeOffsets[0];
}
if (CascadeCount > 1) {
for (int iCascadeIndex = 0; iCascadeIndex < CascadeCount && iCascadeFound == 0; ++iCascadeIndex)
{
vShadowMapTextureCoord = vShadowMapTextureCoordViewSpace * CascadeScales[iCascadeIndex];
vShadowMapTextureCoord += CascadeOffsets[iCascadeIndex];
if (min(vShadowMapTextureCoord.x, vShadowMapTextureCoord.y) > BorderPaddingMin
&& max(vShadowMapTextureCoord.x, vShadowMapTextureCoord.y) < BorderPaddingMax)
{
iCurrentCascadeIndex = iCascadeIndex;
iCascadeFound = 1;
}
}
}
if (iCascadeFound == 0 || vShadowMapTextureCoord.z>=1)
{
//colour = float4(0.1, 0.3, 1.0, 0.5);
return 1.0; //out of range!
}
else
{
ShadowComputeCoordinatesTransform(iCurrentCascadeIndex, vShadowMapTextureCoord);
vVisualizeCascadeColor = vCascadeColorsMultiplier[iCurrentCascadeIndex];
//colour = vVisualizeCascadeColor;
// Repeat texcoord calculations for the next cascade.
// The next cascade index is used for blurring between maps.
iNextCascadeIndex = min(CascadeCount - 1, iCurrentCascadeIndex + 1);
float fBlendBetweenCascadesAmount = 1.0f;
float fCurrentPixelsBlendBandLocation = 1.0f;
ShadowmapCalculateBlendAmountForMap(vShadowMapTextureCoord, fCurrentPixelsBlendBandLocation, fBlendBetweenCascadesAmount);
ShadowmapCalculatePCFPercentLit(vShadowMapTextureCoord, fRightTextDepthWeight, fUpTextDepthWeight, fBlurRowSize, (float)iCurrentCascadeIndex, fPercentLit);
if (CascadeCount > 1)
{
if (fCurrentPixelsBlendBandLocation < BlurBetweenCascades)
{ // the current pixel is within the blend band.
// Repeat texcoord calculations for the next cascade.
// The next cascade index is used for blurring between maps.
vShadowMapTextureCoord_blend = vShadowMapTextureCoordViewSpace * CascadeScales[iNextCascadeIndex];
vShadowMapTextureCoord_blend += CascadeOffsets[iNextCascadeIndex];
ShadowComputeCoordinatesTransform(iNextCascadeIndex, vShadowMapTextureCoord_blend);
// We repeat the calcuation for the next cascade layer, when blending between maps.
if (fCurrentPixelsBlendBandLocation < BlurBetweenCascades)
{
// the current pixel is within the blend band.
ShadowmapCalculatePCFPercentLit(vShadowMapTextureCoord_blend, fRightTextDepthWeight_blend, fUpTextDepthWeight_blend, fBlurRowSize, (float)iNextCascadeIndex, fPercentLit_blend);
fPercentLit = lerp(fPercentLit_blend, fPercentLit, fBlendBetweenCascadesAmount);
// Blend the two calculated shadows by the blend amount.
}
}
}
return fPercentLit;
}
}
float3 FullLighting(float3 diff, float3 spec, float3 norm, float4 vc0, uniform ShaderGlobalLightParams globalLights, uint enableShadows, float shadowdepth, float4 shadowcoord)
{
float lf = saturate(dot(norm, globalLights.LightDir.xyz));
float shadowlit = 1.0;
if (enableShadows == 1)
{
//float shadowdepth = input.Shadows.x;// *0.000001;
if (abs(shadowdepth) < 2000)//2km
{
//float4 shadowcoord = input.LightShadow;
//float4 shadowcolour = (float4)1;
shadowlit = ShadowAmount(shadowcoord, shadowdepth);// , shadowcolour);
}
}
lf *= shadowlit;
float3 speclit = spec*shadowlit;
return GlobalLighting(diff, norm, vc0, lf, globalLights) + speclit;
}
Binary file not shown.
+24
View File
@@ -0,0 +1,24 @@
cbuffer PSMoonVars : register(b0)
{
float4 Colour;
}
Texture2D<float4> MoonSampler : register(t0);
SamplerState TextureSS : register(s0);
struct VS_OUTPUT
{
float4 Position : SV_POSITION;
float2 Texcoord : TEXCOORD0;
};
float4 main(VS_OUTPUT input) : SV_TARGET
{
float2 texc = input.Texcoord;
float4 m = MoonSampler.Sample(TextureSS, texc);
return float4(Colour.rgb*m.rgb, m.a);
}
Binary file not shown.
+36
View File
@@ -0,0 +1,36 @@
#include "Common.hlsli"
cbuffer VSMoonVars : register(b0)
{
float4x4 ViewProj;
float4x4 ViewInv;
float4 CamRel;
float2 Size;
float2 Offset;
}
struct VS_INPUT
{
float4 Position : POSITION;
};
struct VS_OUTPUT
{
float4 Position : SV_POSITION;
float2 Texcoord : TEXCOORD0;
};
VS_OUTPUT main(VS_INPUT input)
{
VS_OUTPUT output;
float3 ipos = input.Position.xyz * float3(Size, 1);
float3 bpos = mul(ipos, (float3x3)ViewInv);
float3 opos = CamRel.xyz + bpos;
float4 pos = float4(opos, 1);
float4 cpos = mul(pos, ViewProj);
cpos.z = DepthFunc(cpos.zw);
output.Position = cpos;
output.Texcoord = input.Position.xy*0.5+0.5;
return output;
}
Binary file not shown.
+11
View File
@@ -0,0 +1,11 @@
cbuffer PSSunVars : register(b0)
{
float4 Colour;
}
float4 main() : SV_TARGET
{
return Colour;
}
Binary file not shown.
+36
View File
@@ -0,0 +1,36 @@
#include "Common.hlsli"
cbuffer VSSunVars : register(b0)
{
float4x4 ViewProj;
float4x4 ViewInv;
float4 CamRel;
float2 Size;
float2 Offset;
}
struct VS_INPUT
{
float4 Position : POSITION;
};
struct VS_OUTPUT
{
float4 Position : SV_POSITION;
float2 Texcoord : TEXCOORD0;
};
VS_OUTPUT main(VS_INPUT input)
{
VS_OUTPUT output;
float3 ipos = input.Position.xyz * float3(Size, 1);
float3 bpos = mul(ipos, (float3x3)ViewInv);
float3 opos = CamRel.xyz + bpos;
float4 pos = float4(opos, 1);
float4 cpos = mul(pos, ViewProj);
cpos.z = DepthFunc(cpos.zw);
output.Position = cpos;
output.Texcoord = input.Position.xy;
return output;
}
+45
View File
@@ -0,0 +1,45 @@
cbuffer SkySystemLocals : register(b0)
{
float4 azimuthEastColor; // Offset: 0 Size: 12 [unused]
float4 azimuthWestColor; // Offset: 16 Size: 12 [unused]
float3 azimuthTransitionColor; // Offset: 32 Size: 12 [unused]
float azimuthTransitionPosition; // Offset: 44 Size: 4 [unused]
float4 zenithColor; // Offset: 48 Size: 12 [unused]
float4 zenithTransitionColor; // Offset: 64 Size: 12 [unused]
float4 zenithConstants; // Offset: 80 Size: 16 [unused]
float4 skyPlaneColor; // Offset: 96 Size: 16 [unused]
float4 skyPlaneParams; // Offset: 112 Size: 16 [unused]
float hdrIntensity; // Offset: 128 Size: 4 [unused]
float3 sunColor; // Offset: 132 Size: 12
float4 sunColorHdr; // Offset: 144 Size: 12
float4 sunDiscColorHdr; // Offset: 160 Size: 12 [unused]
float4 sunConstants; // Offset: 176 Size: 16
float4 sunDirection; // Offset: 192 Size: 12
float4 sunPosition; // Offset: 208 Size: 12 [unused]
float4 cloudBaseMinusMidColour; // Offset: 224 Size: 12
float4 cloudMidColour; // Offset: 240 Size: 12
float4 cloudShadowMinusBaseColourTimesShadowStrength;// Offset: 256 Size: 12
float4 cloudDetailConstants; // Offset: 272 Size: 16
float4 cloudConstants1; // Offset: 288 Size: 16
float4 cloudConstants2; // Offset: 304 Size: 16
float4 smallCloudConstants; // Offset: 320 Size: 16
float4 smallCloudColorHdr; // Offset: 336 Size: 12
float4 effectsConstants; // Offset: 352 Size: 16
float horizonLevel; // Offset: 368 Size: 4 [unused]
float3 speedConstants; // Offset: 372 Size: 12 [unused]
float starfieldIntensity; // Offset: 384 Size: 4
float3 moonDirection; // Offset: 388 Size: 12
float3 moonPosition; // Offset: 400 Size: 12 [unused]
float moonIntensity; // Offset: 412 Size: 4 [unused]
float4 lunarCycle; // Offset: 416 Size: 12
float3 moonColor; // Offset: 432 Size: 12
float noiseFrequency; // Offset: 444 Size: 4 [unused]
float noiseScale; // Offset: 448 Size: 4 [unused]
float noiseThreshold; // Offset: 452 Size: 4 [unused]
float noiseSoftness; // Offset: 456 Size: 4 [unused]
float noiseDensityOffset; // Offset: 460 Size: 4 [unused]
float4 noisePhase; // Offset: 464 Size: 8 [unused]
};
Binary file not shown.
+342
View File
@@ -0,0 +1,342 @@
#include "Skydome.hlsli"
Texture2D<float4> Starmap : register(t0);
SamplerState TextureSS : register(s0);
cbuffer PSSceneVars : register(b1)
{
float4 LightDirection;
uint EnableHDR;
uint Pad0;
uint Pad1;
uint Pad2;
}
struct VS_OUTPUT
{
float4 Position : SV_POSITION; // 0 xyzw 0 POS float xyzw
float4 o1 : TEXCOORD0; // 0 xyzw 1 NONE float xyzw
float4 o2 : TEXCOORD1; // 1 xyzw 2 NONE float xyzw
float4 o3 : TEXCOORD2; // 2 xyzw 3 NONE float xyzw
float4 o4 : TEXCOORD3; // 3 xyzw 4 NONE float xyzw
float4 o5 : TEXCOORD4; // 4 xyzw 5 NONE float xyzw
float2 o6 : TEXCOORD5; // 5 xy 6 NONE float xy
float4 o7 : TEXCOORD6; // 6 xyzw 7 NONE float xyzw
};
float4 main(VS_OUTPUT input) : SV_TARGET
{
//return float4(1,0,0,1);
float4 sf = Starmap.Sample(TextureSS, input.o6);
sf.rgb = saturate(sf.rgb*2.0 - 0.1);
float3 skybase = input.o3.rgb;
if (EnableHDR == 0)
{
sf.rgb *= max(starfieldIntensity, 1.25);
if (hdrIntensity != 0.0)
{
sf.rgb *= saturate(1.0f / (hdrIntensity*25.0f));//fake hiding stars when no HDR
}
}
else
{
sf.rgb *= starfieldIntensity;
}
//float4 zen = zenithColor * hdrIntensity;
//sf.rgb += zen.rgb;
//sf.rgb += input.o3.rgb * hdrIntensity;
float4 o2 = input.o2;
float4 r0, r1, r2, r3, r4;
float poslen = length(o2); //4d length...
r2.xyz = o2.xyz / poslen; //normalized
r4.x = dot(r2.xyz, -sunDirection.xyz); //dp3 r4.x, r2.xyzx, -sunDirection.xyzx
///return float4(r4.xxx, 1);
//r4.y = dot(r2.xyz, -moonDirection.xyz); //dp3 r4.y, r2.xyzx, moonDirection.xyzx;//.yzwy
r0.z = r4.x*-sunConstants.x +sunConstants.y; //mad r0.z, -sunConstants.x, r4.x, sunConstants.y //mie phase, scatter
r0.z = log(abs(r0.z)); //log r0.z, |r0.z|
r0.z = r0.z * 1.5; //mul r0.z, r0.z, l(1.500000)
r0.z = exp(r0.z); //exp r0.z, r0.z
r0.w = r4.x*r4.x + 1.0; //mad r0.w, r4.x, r4.x, l(1.000000)
r4.x = saturate(-r4.x); //mov_sat r4.x, -r4.x
//r2.xy = 1.0 - r4.xy; //add r2.xy, -r4.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
r0.z = r0.w / r0.z; //div r0.z, r0.w, r0.z
r0.w = r0.z*sunConstants.z; //mul r0.w, r0.z, sunConstants.z //mie range?
r0.z = saturate(1.0 - r0.w); //mad_sat r0.z, -r0.z, sunConstants.z, l(1.000000)
r0.w = saturate(r0.w); //mov_sat r0.w, r0.w
r4.xyz = r0.w*sunColorHdr.xyz; //mul r4.xyz, r0.wwww, sunColorHdr.xyzx
r4.xyz = r4.xyz*sunConstants.w; //mul r4.xyz, r4.xyzx, sunConstants.wwww //scatter intensity?
r4.xyz = skybase*r0.z + r4.xyz; //mad r4.xyz, v3.xyzx, r0.zzzz, r4.xyzx
sf.rgb += r4.xyz;
if (EnableHDR == 0)
{
sf = saturate(sf);
}
else
{
sf.a = saturate(sf.a);
}
return sf;
//float f = frac(tc.x);
//return (f < 0.5) ? float4(1, 0, 1, 1) : sf;
}
/*
sky normal all PS:
ps_4_0
dcl_constantbuffer CB2[14], immediateIndexed
dcl_constantbuffer CB12[28], immediateIndexed
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_sampler s6, mode_default
dcl_resource_texture2d (float,float,float,float) t3 perlinSampler
dcl_resource_texture2d (float,float,float,float) t4 highDetailSampler
dcl_resource_texture2d (float,float,float,float) t5 starFieldSampler
dcl_resource_texture2d (float,float,float,float) t6 ditherSampler
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xyzw
dcl_input_ps linear v3.xyz
dcl_input_ps linear v4.xyzw
dcl_input_ps linear v5.xyzw
dcl_input_ps linear v6.xy
dcl_input_ps linear v7.xyzw
dcl_output o0.xyzw
dcl_temps 6
sample r0.xyzw, v4.xyxx, highDetailSampler.xyzw, s4
add r0.x, r0.x, l(-0.500000)
mul r0.x, r0.x, cloudDetailConstants.x
sample r1.xyzw, v5.zwzz, highDetailSampler.xyzw, s4
add r0.z, r1.x, l(-0.500000)
mul r0.y, r0.z, smallCloudConstants.y
sample r1.xyzw, v4.zwzz, highDetailSampler.xyzw, s4
add r1.x, r1.x, l(-0.500000)
mul r0.z, r1.x, cloudConstants2.z
sample r2.xyzw, v1.zwzz, perlinSampler.xyzw, s3
mad r0.z, r0.z, cloudDetailConstants.z, r2.x
mul r0.z, r0.z, cloudConstants1.x
sample r3.xyzw, v1.xyxx, perlinSampler.xyzw, s3
mul r0.z, r0.z, r3.x
mad_sat r0.w, -r0.z, l(2.000000), l(1.000000)
mul r0.xy, r0.wwww, r0.xyxx
mul r0.xy, r3.zzzz, r0.xyxx
mov r4.x, cloudDetailConstants.z
mov r4.y, smallCloudConstants.y
add r1.y, -r3.z, l(1.000000)
mad r0.xy, r1.xyxx, r4.xyxx, r0.xyxx
add r0.w, r0.x, r2.y
mad r1.xyz, r0.wwww, cloudShadowMinusBaseColourTimesShadowStrength.xyzx, cloudBaseMinusMidColour.xyzx
mad r1.xyz, r0.zzzz, r1.xyzx, cloudMidColour.xyzx
mov r3.y, l(0)
add r0.xy, r0.xyxx, r3.xyxx
mul r2.x, r0.x, cloudConstants1.y
mul r2.y, r0.y, smallCloudConstants.z
add_sat r0.x, -r0.x, l(1.000000)
mov r3.y, -smallCloudConstants.w
mov r3.xz, -cloudConstants1.zzwz
add_sat r0.yz, r2.xxyx, r3.xxyx
mul r0.yz, r0.yyzy, r0.yyzy
dp4 r0.w, v2.xyzw, v2.xyzw
rsq r0.w, r0.w
mul r2.xyz, r0.wwww, v2.xyzx
mad_sat r0.w, r2.z, l(5.000000), r3.z
mul r3.xy, r0.wwww, r0.yzyy
mad r0.y, -r0.y, r0.w, l(1.000000)
mul r0.y, r0.y, r3.y
mad r0.y, r0.y, l(0.300000), r3.x
dp3 r4.x, r2.xyzx, -sunDirection.xyzx
dp3 r4.y, r2.xyzx, moonDirection.xyzx;//.yzwy
mad r0.z, -sunConstants.x, r4.x, sunConstants.y
log r0.z, |r0.z|
mul r0.z, r0.z, l(1.500000)
exp r0.z, r0.z
mad r0.w, r4.x, r4.x, l(1.000000)
mov_sat r4.x, -r4.x
add r2.xy, -r4.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
div r0.z, r0.w, r0.z
mul r0.w, r0.z, sunConstants.z
mad_sat r0.z, -r0.z, sunConstants.z, l(1.000000)
mov_sat r0.w, r0.w
mul r4.xyz, r0.wwww, sunColorHdr.xyzx
mul r4.xyz, r4.xyzx, sunConstants.wwww
mad r4.xyz, v3.xyzx, r0.zzzz, r4.xyzx
add r5.xyz, -r4.xyzx, smallCloudColorHdr.xyzx
mad r4.xyz, r3.yyyy, r5.xyzx, r4.xyzx
mad r1.xyz, r1.xyzx, cloudConstants2.wwww, -r4.xyzx
mad r1.xyz, r3.xxxx, r1.xyzx, r4.xyzx
add r0.z, r3.y, r3.x
add_sat o0.w, -r0.z, v2.w
div r0.zw, r2.xxxy, effectsConstants.xxxz
ge r1.w, r2.y, l(0.000545)
and r1.w, r1.w, l(0x3f800000)
mul_sat r0.zw, r0.zzzw, l(0.000000, 0.000000, 100.000000, 100.000000)
add r0.zw, -r0.zzzw, l(0.000000, 0.000000, 1.000000, 1.000000)
mul r0.zw, r0.yyyy, r0.zzzw
add r0.y, -r0.y, l(1.000000)
mul r0.xz, r0.xxxx, r0.zzwz
mul r0.xz, r0.xxzx, r0.xxzx
mul r0.xz, r0.xxzx, r0.xxzx
mad r0.w, lunarCycle.y, l(0.500000), l(0.500000)
mul r0.w, r0.w, effectsConstants.w
mul r0.z, r0.w, r0.z
mul r0.x, r0.x, effectsConstants.y
mul r2.xyz, r0.zzzz, moonColor.xyzx
mad r0.xzw, sunColor.yyzw, r0.xxxx, r2.xxyz
add r0.xzw, r0.xxzw, r1.xxyz
sample r2.xyzw, v6.xyxx, starFieldSampler.xyzw, s5
mad_sat r1.xyz, r2.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-0.100000, -0.100000, -0.100000, 0.000000)
mul r1.xyz, r1.xyzx, starfieldIntensity.xxxx
mul r1.xyz, r1.wwww, r1.xyzx
mad r0.xyz, r1.xyzx, r0.yyyy, r0.xzwx
add r1.xyz, -r0.xyzx, v7.xyzx
mad r0.xyz, v7.wwww, r1.xyzx, r0.xyzx
sample r1.xyzw, v5.xyxx, ditherSampler.xyzw, s6
add r0.w, r1.x, l(-0.500000)
mad r0.xyz, r0.wwww, l(0.000100, 0.000100, 0.000100, 0.000000), r0.xyzx
mul o0.xyz, r0.xyzx, globalScalars3.zzzz
ret
// Approximately 92 instruction slots used
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// Buffer Definitions:
//
// cbuffer misc_globals
// {
//
// float4 globalFade; // Offset: 0 Size: 16 [unused]
// float globalHeightScale; // Offset: 16 Size: 4 [unused]
// float4 g_Rage_Tessellation_CameraPosition;// Offset: 32 Size: 16 [unused]
// float4 g_Rage_Tessellation_CameraZAxis;// Offset: 48 Size: 16 [unused]
// float4 g_Rage_Tessellation_ScreenSpaceErrorParams;// Offset: 64 Size: 16 [unused]
// float4 g_Rage_Tessellation_LinearScale;// Offset: 80 Size: 16 [unused]
// float4 g_Rage_Tessellation_Frustum[4];// Offset: 96 Size: 64 [unused]
// float4 g_Rage_Tessellation_Epsilons;// Offset: 160 Size: 16 [unused]
// float4 globalScalars; // Offset: 176 Size: 16 [unused]
// float4 globalScalars2; // Offset: 192 Size: 16 [unused]
// float4 globalScalars3; // Offset: 208 Size: 16
// float4 globalScreenSize; // Offset: 224 Size: 16 [unused]
// uint4 gTargetAAParams; // Offset: 240 Size: 16 [unused]
// float4 colorize; // Offset: 256 Size: 16 [unused]
// float4 gGlobalParticleShadowBias; // Offset: 272 Size: 16 [unused]
// float gGlobalParticleDofAlphaScale;// Offset: 288 Size: 4 [unused]
// float gGlobalFogIntensity; // Offset: 292 Size: 4 [unused]
// float4 gPlayerLFootPos; // Offset: 304 Size: 16 [unused]
// float4 gPlayerRFootPos; // Offset: 320 Size: 16 [unused]
//
// }
//
// cbuffer sky_system_locals
// {
//
// float3 azimuthEastColor; // Offset: 0 Size: 12 [unused]
// float3 azimuthWestColor; // Offset: 16 Size: 12 [unused]
// float3 azimuthTransitionColor; // Offset: 32 Size: 12 [unused]
// float azimuthTransitionPosition; // Offset: 44 Size: 4 [unused]
// float3 zenithColor; // Offset: 48 Size: 12 [unused]
// float3 zenithTransitionColor; // Offset: 64 Size: 12 [unused]
// float4 zenithConstants; // Offset: 80 Size: 16 [unused]
// float4 skyPlaneColor; // Offset: 96 Size: 16 [unused]
// float4 skyPlaneParams; // Offset: 112 Size: 16 [unused]
// float hdrIntensity; // Offset: 128 Size: 4 [unused]
// float3 sunColor; // Offset: 132 Size: 12
// float3 sunColorHdr; // Offset: 144 Size: 12
// float3 sunDiscColorHdr; // Offset: 160 Size: 12 [unused]
// float4 sunConstants; // Offset: 176 Size: 16
// float3 sunDirection; // Offset: 192 Size: 12
// float3 sunPosition; // Offset: 208 Size: 12 [unused]
// float3 cloudBaseMinusMidColour; // Offset: 224 Size: 12
// float3 cloudMidColour; // Offset: 240 Size: 12
// float3 cloudShadowMinusBaseColourTimesShadowStrength;// Offset: 256 Size: 12
// float4 cloudDetailConstants; // Offset: 272 Size: 16
// float4 cloudConstants1; // Offset: 288 Size: 16
// float4 cloudConstants2; // Offset: 304 Size: 16
// float4 smallCloudConstants; // Offset: 320 Size: 16
// float3 smallCloudColorHdr; // Offset: 336 Size: 12
// float4 effectsConstants; // Offset: 352 Size: 16
// float horizonLevel; // Offset: 368 Size: 4 [unused]
// float3 speedConstants; // Offset: 372 Size: 12 [unused]
// float starfieldIntensity; // Offset: 384 Size: 4
// float3 moonDirection; // Offset: 388 Size: 12
// float3 moonPosition; // Offset: 400 Size: 12 [unused]
// float moonIntensity; // Offset: 412 Size: 4 [unused]
// float3 lunarCycle; // Offset: 416 Size: 12
// float3 moonColor; // Offset: 432 Size: 12
// float noiseFrequency; // Offset: 444 Size: 4 [unused]
// float noiseScale; // Offset: 448 Size: 4 [unused]
// float noiseThreshold; // Offset: 452 Size: 4 [unused]
// float noiseSoftness; // Offset: 456 Size: 4 [unused]
// float noiseDensityOffset; // Offset: 460 Size: 4 [unused]
// float2 noisePhase; // Offset: 464 Size: 8 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim HLSL Bind Count
// ------------------------------ ---------- ------- ----------- -------------- ------
// perlinSampler sampler NA NA s3 1
// highDetailSampler sampler NA NA s4 1
// starFieldSampler sampler NA NA s5 1
// ditherSampler sampler NA NA s6 1
// perlinSampler texture float4 2d t3 1
// highDetailSampler texture float4 2d t4 1
// starFieldSampler texture float4 2d t5 1
// ditherSampler texture float4 2d t6 1
// misc_globals cbuffer NA NA cb2 1
// sky_system_locals cbuffer NA NA cb12 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float
// TEXCOORD 0 xyzw 1 NONE float xyzw
// TEXCOORD 1 xyzw 2 NONE float xyzw
// TEXCOORD 2 xyzw 3 NONE float xyz
// TEXCOORD 3 xyzw 4 NONE float xyzw
// TEXCOORD 4 xyzw 5 NONE float xyzw
// TEXCOORD 5 xy 6 NONE float xy
// TEXCOORD 6 xyzw 7 NONE float xyzw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
*/

Some files were not shown because too many files have changed in this diff Show More