112Shaders/riverreflection.fx
2021-12-28 10:06:46 +01:00

341 lines
10 KiB
HLSL

string DefaultParameterScopeBlock = "material"; // 1
float3 AmbientLightColor <bool unmanaged = 1;> = { 0.3, 0.3, 0.3 };
struct {
float3 Color;
float3 Direction;
} DirectionalLight[3] <bool unmanaged = 1;> = { 1.625198, 1.512711, 1.097048, 0.62914, -0.34874, 0.69465, 0.5232916, 0.6654605, 0.7815244, -0.32877, 0.90329, 0.27563, 0.4420466, 0.4102767, 0.4420466, -0.80704, -0.58635, 0.06975 };
struct {
float3 Color;
float3 Position;
float2 Range_Inner_Outer;
} PointLight[8] <bool unmanaged = 1;>;
struct {
float4 WorldPositionMultiplier_XYZZ;
float2 CurrentOffsetUV;
} Cloud <bool unmanaged = 1;>;
float3 NoCloudMultiplier <bool unmanaged = 1;> = { 1, 1, 1 };
float3 RecolorColorDummy <bool unmanaged = 1;>;
row_major float4x4 ShadowMapWorldToShadow <bool unmanaged = 1;>;
float OpacityOverride <bool unmanaged = 1;> = { 1 };
float3 TintColor <bool unmanaged = 1;> = { 1, 1, 1 };
float3 EyePosition : register(vs_2_0, c123) <bool unmanaged = 1;>;
row_major float4x4 ViewProjection <bool unmanaged = 1;>;
float4 WorldBones[128] <bool unmanaged = 1;>;
texture RiverTexture <string UIName = "River Texture";>; // 2
sampler2D RiverTextureSampler : register(ps_2_0, s0) <string Texture = "RiverTexture"; string UIName = "River Texture";> =
sampler_state
{
Texture = <RiverTexture>; // 4
MipFilter = 2;
MinFilter = 2;
MagFilter = 2;
AddressU = 1;
AddressV = 1;
};
float4 Opacity <string UIName = "Opacity";> = { 1, 1, 1, 1 };
texture WaterReflectionTexture <string UIWidget = "None"; string SasBindAddress = "Water.ReflectionTexture";>; // 8
sampler2D WaterReflectionTextureSampler <string Texture = "WaterReflectionTexture"; string UIWidget = "None"; string SasBindAddress = "Water.ReflectionTexture";> =
sampler_state
{
Texture = <WaterReflectionTexture>; // 11
MipFilter = 1;
MinFilter = 2;
MagFilter = 2;
AddressU = 3;
AddressV = 3;
};
texture EnvironmentTexture <string UIWidget = "None"; string SasBindAddress = "Terrain.EnvironmentTexture"; string ResourceType = "Cube";>; // 15
samplerCUBE EnvironmentTextureSampler <string Texture = "EnvironmentTexture"; string UIWidget = "None"; string SasBindAddress = "Terrain.EnvironmentTexture"; string ResourceType = "Cube";> =
sampler_state
{
Texture = <EnvironmentTexture>; // 19
MinFilter = 2;
MagFilter = 2;
MipFilter = 2;
AddressU = 3;
AddressV = 3;
AddressW = 3;
};
struct
{
float4 ScaleUV_OffsetUV;
} Shroud <string UIWidget = "None"; string SasBindAddress = "Terrain.Shroud";> = { 1, 1, 0, 0 };
texture ShroudTexture <string UIWidget = "None"; string SasBindAddress = "Terrain.Shroud.Texture"; string ResourceName = "ShaderPreviewShroud.dds";>; // 26
sampler2D ShroudTextureSampler : register(ps_2_0, s2) <string Texture = "ShroudTexture"; string UIWidget = "None"; string SasBindAddress = "Terrain.Shroud.Texture"; string ResourceName = "ShaderPreviewShroud.dds";> =
sampler_state
{
Texture = <ShroudTexture>; // 30
MinFilter = 2;
MagFilter = 2;
MipFilter = 2;
AddressU = 3;
AddressV = 3;
};
column_major float4x4 WorldViewProjection : WorldViewProjection : register(vs_2_0, c11);
column_major float4x4 World : World : register(vs_2_0, c15);
float Time : Time;
// _Default_PixelShader1 Pixel_2_0 Has PRES False
struct _Default_PixelShader1_Input
{
float4 color : COLOR;
float color1 : COLOR1;
float2 texcoord : TEXCOORD;
float2 texcoord1 : TEXCOORD1;
float3 texcoord2 : TEXCOORD2;
};
float4 _Default_PixelShader1(_Default_PixelShader1_Input i) : COLOR
{
float4 out_color;
float4 temp0, temp1, temp2;
// dcl v0
// dcl v1.x
// dcl t0.xy
// dcl t1.xy
// dcl t2.xyz
// dcl_2d s0
// dcl_cube s1
// dcl_2d s2
// texld r0, t2, s1
temp0 = texCUBE(EnvironmentTextureSampler, i.texcoord2.xyz);
// texld r1, t0, s0
temp1 = tex2D(RiverTextureSampler, i.texcoord.xy);
// texld r2, t1, s2
temp2 = tex2D(ShroudTextureSampler, i.texcoord1.xy);
// mul r1, r1, v0
temp1 = temp1 * i.color;
// mul r0.xyz, r0, r1
temp0.xyz = temp0.xyz * temp1.xyz;
// mul r0.xyz, r0, v1.x
temp0.xyz = temp0.xyz * i.color1.xxx;
// mul r1.xyz, r2, r0
temp1.xyz = temp2.xyz * temp0.xyz;
// mov oC0, r1
out_color = temp1;
//
return out_color;
}
// _Default_VertexShader2 Vertex_2_0 Has PRES False
struct _Default_VertexShader2_Input
{
float4 position : POSITION;
float4 color : COLOR;
float4 texcoord1 : TEXCOORD1;
};
struct _Default_VertexShader2_Output
{
float4 position : POSITION;
float4 color : COLOR;
float2 texcoord1 : TEXCOORD1;
float3 texcoord2 : TEXCOORD2;
float color1 : COLOR1;
float2 texcoord : TEXCOORD;
};
_Default_VertexShader2_Output _Default_VertexShader2(_Default_VertexShader2_Input i)
{
_Default_VertexShader2_Output o;
float4 temp0;
float3 temp1;
// def c0, 1, 0, -0, -2
// dcl_position v0
// dcl_color v1
// dcl_texcoord1 v2
// mad r0, v0.xyzx, c0.xxxy, c0.zzzx
temp0 = i.position.xyzx * float4(1, 1, 1, 0) + float4(-0, -0, -0, 1);
// dp4 oPos.x, r0, c11
o.position.x = dot(temp0, (WorldViewProjection._m00_m10_m20_m30));
// dp4 oPos.y, r0, c12
o.position.y = dot(temp0, (WorldViewProjection._m01_m11_m21_m31));
// dp4 oPos.z, r0, c13
o.position.z = dot(temp0, (WorldViewProjection._m02_m12_m22_m32));
// dp4 oPos.w, r0, c14
o.position.w = dot(temp0, (WorldViewProjection._m03_m13_m23_m33));
// mul oD0.w, v1.w, c18.w
o.color.w = i.color.w * Opacity.w;
// dp4 r1.x, r0, c15
temp1.x = dot(temp0, (World._m00_m10_m20_m30));
// dp4 r1.y, r0, c16
temp1.y = dot(temp0, (World._m01_m11_m21_m31));
// dp4 r1.z, r0, c17
temp1.z = dot(temp0, (World._m02_m12_m22_m32));
// add r0.xy, r1, c19.zwzw
temp0.xy = temp1.xy + Shroud.ScaleUV_OffsetUV.zw;
// add r1.xyz, -r1, c123
temp1.xyz = -temp1.xyz + EyePosition.xyz;
// mul oT1.xy, r0, c19
o.texcoord1 = temp0 * Shroud.ScaleUV_OffsetUV;
// nrm r0.xyz, r1
temp0.xyz = normalize(temp1.xyz).xyz;
// mad r0.xyz, r0.z, c0.zzww, r0
temp0.xyz = temp0.zzz * float3(-0, -0, -2) + temp0.xyz;
// mov oT2.xyz, -r0
o.texcoord2 = -temp0;
// mov oD0.xyz, v1
o.color.xyz = i.color.xyz;
// mov oD1.x, c0.x
o.color1 = float4(1, 1, 1, 1);
// mov oT0.xy, v2
o.texcoord = i.texcoord1;
//
return o;
}
// Default_U_PixelShader3 Pixel_2_0 Has PRES False
struct Default_U_PixelShader3_Input
{
float4 color : COLOR;
float color1 : COLOR1;
float2 texcoord : TEXCOORD;
float2 texcoord1 : TEXCOORD1;
float3 texcoord2 : TEXCOORD2;
};
float4 Default_U_PixelShader3(Default_U_PixelShader3_Input i) : COLOR
{
float4 out_color;
float4 temp0, temp1, temp2;
// dcl v0
// dcl v1.x
// dcl t0.xy
// dcl t1.xy
// dcl t2.xyz
// dcl_2d s0
// dcl_2d s1
// dcl_2d s2
// rcp r0.w, t2.z
temp0.w = 1.0f / i.texcoord2.z;
// mul r0.xy, r0.w, t2
temp0.xy = temp0.ww * i.texcoord2.xy;
// texld r0, r0, s1
temp0 = tex2D(WaterReflectionTextureSampler, temp0.xy);
// texld r1, t0, s0
temp1 = tex2D(RiverTextureSampler, i.texcoord.xy);
// texld r2, t1, s2
temp2 = tex2D(ShroudTextureSampler, i.texcoord1.xy);
// mul r1, r1, v0
temp1 = temp1 * i.color;
// mul r0.xyz, r0, r1
temp0.xyz = temp0.xyz * temp1.xyz;
// mul r0.xyz, r0, v1.x
temp0.xyz = temp0.xyz * i.color1.xxx;
// mul r1.xyz, r2, r0
temp1.xyz = temp2.xyz * temp0.xyz;
// mov oC0, r1
out_color = temp1;
//
return out_color;
}
// Default_U_VertexShader4 Vertex_2_0 Has PRES False
struct Default_U_VertexShader4_Input
{
float4 position : POSITION;
float4 color : COLOR;
float4 texcoord1 : TEXCOORD1;
};
struct Default_U_VertexShader4_Output
{
float4 position : POSITION;
float4 color : COLOR;
float2 texcoord1 : TEXCOORD1;
float3 texcoord2 : TEXCOORD2;
float color1 : COLOR1;
float2 texcoord : TEXCOORD;
};
Default_U_VertexShader4_Output Default_U_VertexShader4(Default_U_VertexShader4_Input i)
{
Default_U_VertexShader4_Output o;
float4 temp0;
float3 temp1;
// def c0, 1, 0, 0.5, 0
// dcl_position v0
// dcl_color v1
// dcl_texcoord1 v2
// mad r0, v0.xyzx, c0.xxxy, c0.yyyx
temp0 = i.position.xyzx * float4(1, 1, 1, 0) + float4(0, 0, 0, 1);
// dp4 oPos.z, r0, c13
o.position.z = dot(temp0, (WorldViewProjection._m02_m12_m22_m32));
// mul oD0.w, v1.w, c17.w
o.color.w = i.color.w * Opacity.w;
// dp4 r1.x, r0, c15
temp1.x = dot(temp0, (World._m00_m10_m20_m30));
// dp4 r1.y, r0, c16
temp1.y = dot(temp0, (World._m01_m11_m21_m31));
// add r1.xy, r1, c18.zwzw
temp1.xy = temp1.xy + Shroud.ScaleUV_OffsetUV.zw;
// mul oT1.xy, r1, c18
o.texcoord1 = temp1 * Shroud.ScaleUV_OffsetUV;
// dp4 r1.x, r0, c11
temp1.x = dot(temp0, (WorldViewProjection._m00_m10_m20_m30));
// dp4 r1.y, r0, c12
temp1.y = dot(temp0, (WorldViewProjection._m01_m11_m21_m31));
// dp4 r1.z, r0, c14
temp1.z = dot(temp0, (WorldViewProjection._m03_m13_m23_m33));
// add r0.xy, r1, r1.z
temp0.xy = temp1.xy + temp1.zz;
// mov oPos.xyw, r1.xyzz
o.position.xyw = temp1.xyz;
// mov oT2.z, r1.z
o.texcoord2.z = temp1.z;
// mul oT2.xy, r0, c0.z
o.texcoord2.xy = temp0.xy * float2(0.5, 0.5);
// mov oD0.xyz, v1
o.color.xyz = i.color.xyz;
// mov oD1.x, c0.x
o.color1 = float4(1, 1, 1, 1);
// mov oT0.xy, v2
o.texcoord = i.texcoord1;
//
return o;
}
technique Default_U
{
pass P0
{
VertexShader = compile vs_2_0 Default_U_VertexShader4(); // 35
PixelShader = compile ps_2_0 Default_U_PixelShader3(); // 36
ZEnable = 1;
ZFunc = 4;
ZWriteEnable = 0;
CullMode = 1;
AlphaBlendEnable = 1;
AlphaTestEnable = 0;
ColorWriteEnable = 7;
SrcBlend = 5;
DestBlend = 2;
}
}
technique _Default
{
pass P0
{
VertexShader = compile vs_2_0 _Default_VertexShader2(); // 37
PixelShader = compile ps_2_0 _Default_PixelShader1(); // 38
ZEnable = 1;
ZFunc = 4;
ZWriteEnable = 0;
CullMode = 1;
AlphaBlendEnable = 1;
AlphaTestEnable = 0;
ColorWriteEnable = 7;
SrcBlend = 5;
DestBlend = 2;
}
}
technique _Default_L
{
}