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

259 lines
8.5 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 <bool unmanaged = 1;>;
column_major float4x4 ViewProjection : register(vs_2_0, c119) <bool unmanaged = 1;>;
float4 WorldBones[128] <bool unmanaged = 1;>;
column_major float4x4 World : World : register(vs_2_0, c11) <string UIWidget = "None";>;
column_major float4x4 View : View : register(vs_2_0, c14) <string UIWidget = "None";>;
texture Texture1 <string UIWidget = "None";>; // 4
sampler2D Texture1Sampler : register(ps_2_0, s0) <string Texture = "Texture1"; string UIWidget = "None";> =
sampler_state
{
Texture = <Texture1>; // 6
MinFilter = 3;
MagFilter = 2;
MipFilter = 2;
MaxAnisotropy = 8;
AddressU = 1;
AddressV = 1;
};
texture Texture2 <string UIWidget = "None";>; // 9
sampler2D Texture2Sampler : register(ps_2_0, s1) <string Texture = "Texture2"; string UIWidget = "None";> =
sampler_state
{
Texture = <Texture2>; // 11
MinFilter = 2;
MagFilter = 2;
MipFilter = 2;
AddressU = 1;
AddressV = 1;
};
struct
{
float4 ScaleUV_OffsetUV;
} Shroud : register(vs_2_0, c17) <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";>; // 16
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>; // 20
MinFilter = 2;
MagFilter = 2;
MipFilter = 2;
AddressU = 3;
AddressV = 3;
};
// Default_M_PixelShader1 Pixel_2_0 Has PRES False
struct Default_M_PixelShader1_Input
{
float2 texcoord : TEXCOORD;
float2 texcoord1 : TEXCOORD1;
float2 texcoord2 : TEXCOORD2;
float3 texcoord3 : TEXCOORD3;
float3 texcoord4 : TEXCOORD4;
float3 texcoord5 : TEXCOORD5;
};
float4 Default_M_PixelShader1(Default_M_PixelShader1_Input i) : COLOR
{
float4 out_color;
float4 temp0, temp1, temp2;
// def c0, 2, -1, 0.5, -0.75
// def c1, 0, 0, 0, 0
// dcl t0.xy
// dcl t1.xy
// dcl t2.xy
// dcl t3.xyz
// dcl t4.xyz
// dcl t5.xyz
// dcl_2d s0
// dcl_2d s1
// dcl_2d s2
// texld r0, t0, s0
temp0 = tex2D(Texture1Sampler, i.texcoord.xy);
// texld r1, t1, s1
temp1 = tex2D(Texture2Sampler, i.texcoord1.xy);
// texld r2, t2, s2
temp2 = tex2D(ShroudTextureSampler, i.texcoord2.xy);
// mad r0.xyz, r0, c0.x, c0.y
temp0.xyz = temp0.xyz * float3(2, 2, 2) + float3(-1, -1, -1);
// mad r0.xyz, r1, c0.x, r0
temp0.xyz = temp1.xyz * float3(2, 2, 2) + temp0.xyz;
// mul r0.w, r0.w, r1.w
temp0.w = temp0.w * temp1.w;
// add r0.xyz, r0, c0.y
temp0.xyz = temp0.xyz + float3(-1, -1, -1);
// nrm r1.xyz, r0
temp1.xyz = normalize(temp0.xyz).xyz;
// dp3 r0.x, r1, t3
temp0.x = dot(temp1.xyz, i.texcoord3.xyz);
// dp3 r0.y, r1, t4
temp0.y = dot(temp1.xyz, i.texcoord4.xyz);
// dp3 r0.z, r1, t5
temp0.z = dot(temp1.xyz, i.texcoord5.xyz);
// mad r1.xyz, r0, c0.z, c0.z
temp1.xyz = temp0.xyz * float3(0.5, 0.5, 0.5) + float3(0.5, 0.5, 0.5);
// add r0.x, r2.x, c0.w
temp0.x = temp2.x + float1(-0.75);
// add r0.x, r0.x, r0.x
temp0.x = temp0.x + temp0.x;
// max r2.x, r0.x, c1.x
temp2.x = max(temp0.x, float1(0));
// mul r0.x, r0.w, r2.x
temp0.x = temp0.w * temp2.x;
// add r1.w, r0.x, r0.x
temp1.w = temp0.x + temp0.x;
// mov oC0, r1
out_color = temp1;
//
return out_color;
}
// Default_M_VertexShader2 Vertex_2_0 Has PRES False
struct Default_M_VertexShader2_Input
{
float4 position : POSITION;
float4 normal : NORMAL;
float4 tangent : TANGENT;
float4 binormal : BINORMAL;
float4 texcoord : TEXCOORD;
float4 texcoord1 : TEXCOORD1;
};
struct Default_M_VertexShader2_Output
{
float4 position : POSITION;
float3 texcoord3 : TEXCOORD3;
float3 texcoord4 : TEXCOORD4;
float3 texcoord5 : TEXCOORD5;
float2 texcoord2 : TEXCOORD2;
float2 texcoord : TEXCOORD;
float2 texcoord1 : TEXCOORD1;
};
Default_M_VertexShader2_Output Default_M_VertexShader2(Default_M_VertexShader2_Input i)
{
Default_M_VertexShader2_Output o;
float4 temp0, temp1;
float3 temp2;
// def c0, 1, 0, 0, 0
// dcl_position v0
// dcl_normal v1
// dcl_tangent v2
// dcl_binormal v3
// dcl_texcoord v4
// dcl_texcoord1 v5
// mad r0, v0.xyzx, c0.xxxy, c0.yyyx
temp0 = i.position.xyzx * float4(1, 1, 1, 0) + float4(0, 0, 0, 1);
// dp4 r1.z, r0, c13
temp1.z = dot(temp0, (World._m02_m12_m22_m32));
// mov r1.w, c0.x
temp1.w = float1(1);
// dp4 r1.x, r0, c11
temp1.x = dot(temp0, (World._m00_m10_m20_m30));
// dp4 r1.y, r0, c12
temp1.y = dot(temp0, (World._m01_m11_m21_m31));
// dp4 oPos.x, r1, c119
o.position.x = dot(temp1, (ViewProjection._m00_m10_m20_m30));
// dp4 oPos.y, r1, c120
o.position.y = dot(temp1, (ViewProjection._m01_m11_m21_m31));
// dp4 oPos.z, r1, c121
o.position.z = dot(temp1, (ViewProjection._m02_m12_m22_m32));
// dp4 oPos.w, r1, c122
o.position.w = dot(temp1, (ViewProjection._m03_m13_m23_m33));
// add r0.xy, r1, c17.zwzw
temp0.xy = temp1.xy + Shroud.ScaleUV_OffsetUV.zw;
// dp3 r1.x, v3, c11
temp1.x = dot(i.binormal.xyz, (World._m00_m10_m20_m30).xyz);
// dp3 r1.y, v3, c12
temp1.y = dot(i.binormal.xyz, (World._m01_m11_m21_m31).xyz);
// dp3 r1.z, v3, c13
temp1.z = dot(i.binormal.xyz, (World._m02_m12_m22_m32).xyz);
// nrm r2.xyz, r1
temp2.xyz = normalize(temp1.xyz).xyz;
// dp3 oT3.x, -r2, c14
o.texcoord3.x = dot(-temp2.xyz, (View._m00_m10_m20_m30).xyz);
// dp3 oT4.x, -r2, c15
o.texcoord4.x = dot(-temp2.xyz, (View._m01_m11_m21_m31).xyz);
// dp3 oT5.x, -r2, c16
o.texcoord5.x = dot(-temp2.xyz, (View._m02_m12_m22_m32).xyz);
// dp3 r1.x, v2, c11
temp1.x = dot(i.tangent.xyz, (World._m00_m10_m20_m30).xyz);
// dp3 r1.y, v2, c12
temp1.y = dot(i.tangent.xyz, (World._m01_m11_m21_m31).xyz);
// dp3 r1.z, v2, c13
temp1.z = dot(i.tangent.xyz, (World._m02_m12_m22_m32).xyz);
// nrm r2.xyz, r1
temp2.xyz = normalize(temp1.xyz).xyz;
// dp3 oT3.y, -r2, c14
o.texcoord3.y = dot(-temp2.xyz, (View._m00_m10_m20_m30).xyz);
// dp3 oT4.y, -r2, c15
o.texcoord4.y = dot(-temp2.xyz, (View._m01_m11_m21_m31).xyz);
// dp3 oT5.y, -r2, c16
o.texcoord5.y = dot(-temp2.xyz, (View._m02_m12_m22_m32).xyz);
// dp3 r1.x, v1, c11
temp1.x = dot(i.normal.xyz, (World._m00_m10_m20_m30).xyz);
// dp3 r1.y, v1, c12
temp1.y = dot(i.normal.xyz, (World._m01_m11_m21_m31).xyz);
// dp3 r1.z, v1, c13
temp1.z = dot(i.normal.xyz, (World._m02_m12_m22_m32).xyz);
// nrm r2.xyz, r1
temp2.xyz = normalize(temp1.xyz).xyz;
// dp3 oT3.z, r2, c14
o.texcoord3.z = dot(temp2.xyz, (View._m00_m10_m20_m30).xyz);
// dp3 oT4.z, r2, c15
o.texcoord4.z = dot(temp2.xyz, (View._m01_m11_m21_m31).xyz);
// dp3 oT5.z, r2, c16
o.texcoord5.z = dot(temp2.xyz, (View._m02_m12_m22_m32).xyz);
// mul oT2.xy, r0, c17
o.texcoord2 = temp0 * Shroud.ScaleUV_OffsetUV;
// mov oT0.xy, v4
o.texcoord = i.texcoord;
// mov oT1.xy, v5
o.texcoord1 = i.texcoord1;
//
return o;
}
technique Default_M
{
pass pass0
{
VertexShader = compile vs_2_0 Default_M_VertexShader2(); // 25
PixelShader = compile ps_2_0 Default_M_PixelShader1(); // 26
ZEnable = 1;
ZWriteEnable = 1;
ZFunc = 4;
AlphaBlendEnable = 1;
AlphaTestEnable = 0;
CullMode = 1;
SrcBlend = 5;
DestBlend = 6;
}
}
technique Default_L
{
}