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

195 lines
6.1 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 View : View : register(vs_2_0, c11);
float Time : Time;
float4 HouseColor : register(ps_2_0, c11) <string UIWidget = "None"; string SasBindAddress = "ConnectionLine.HouseColor"; int WW3DDynamicSet = 2;> = { 1, 1, 1, 1 };
float LineLength : register(vs_2_0, c16) <string UIWidget = "None"; string SasBindAddress = "ConnectionLine.LineLength"; int WW3DDynamicSet = 2;> = { 2.5 };
texture LineTexture <string UIWidget = "None";>; // 6
sampler2D LineTextureSampler : register(ps_2_0, s0) <string Texture = "LineTexture"; string UIWidget = "None";> =
sampler_state
{
Texture = <LineTexture>; // 8
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";>; // 13
sampler2D ShroudTextureSampler : register(ps_2_0, s1) <string Texture = "ShroudTexture"; string UIWidget = "None"; string SasBindAddress = "Terrain.Shroud.Texture"; string ResourceName = "ShaderPreviewShroud.dds";> =
sampler_state
{
Texture = <ShroudTexture>; // 17
MinFilter = 2;
MagFilter = 2;
MipFilter = 2;
AddressU = 3;
AddressV = 3;
};
// Default_PixelShader1 Pixel_2_0 Has PRES False
struct Default_PixelShader1_Input
{
float2 texcoord : TEXCOORD;
float2 texcoord1 : TEXCOORD1;
float2 texcoord2 : TEXCOORD2;
};
float4 Default_PixelShader1(Default_PixelShader1_Input i) : COLOR
{
float4 out_color;
float4 temp0, temp1, temp2;
// dcl t0.xy
// dcl t1.xy
// dcl t2.xy
// dcl_2d s0
// dcl_2d s1
// texld r0, t0, s0
temp0 = tex2D(LineTextureSampler, i.texcoord.xy);
// texld r1, t1, s0
temp1 = tex2D(LineTextureSampler, i.texcoord1.xy);
// texld r2, t2, s1
temp2 = tex2D(ShroudTextureSampler, i.texcoord2.xy);
// add r0, r0, r1
temp0 = temp0 + temp1;
// mul r0, r0, c11
temp0 = temp0 * HouseColor;
// mul r0.xyz, r2.x, r0
temp0.xyz = temp2.xxx * temp0.xyz;
// mov oC0, r0
out_color = temp0;
//
return out_color;
}
// Default_VertexShader2 Vertex_2_0 Has PRES True
struct Default_VertexShader2_Input
{
float4 position : POSITION;
float4 tangent : TANGENT;
float4 texcoord : TEXCOORD;
};
struct Default_VertexShader2_Output
{
float4 position : POSITION;
float2 texcoord : TEXCOORD;
float2 texcoord1 : TEXCOORD1;
float2 texcoord2 : TEXCOORD2;
};
Default_VertexShader2_Output Default_VertexShader2(Default_VertexShader2_Input i)
{
/*
PRSI
OutputRegisterOffset: 14
Unknown1: 0
Unknown2: 0
OutputRegisterCount: 2
Unknown3: 0
Unknown4: 0
Unknown5: 14
Unknown6: 2
Mappings: 1
0 - ConstOutput: 0 ConstInput 0
*/
float4 expr14;
float4 expr15;
{
// Expression_2_1
// mul c14.x, c0.x, (4)
expr14.x = Time.x * (4);
// mul c15.x, c0.x, (0.8)
expr15.x = Time.x * (0.8);
}
Default_VertexShader2_Output o;
float4 temp0;
// def c0, -0.5, 10, 1, 0.006666667
// dcl_position v0
// dcl_tangent v1
// dcl_texcoord v2
// mul r0.xyz, v1.zxyw, c13.yzxw
temp0.xyz = i.tangent.zxy * (View._m02_m12_m22_m32).yzx;
// mad r0.xyz, v1.yzxw, c13.zxyw, -r0
temp0.xyz = i.tangent.yzx * (View._m02_m12_m22_m32).zxy + -temp0.xyz;
// add r0.w, v2.x, c0.x
temp0.w = i.texcoord.x + float1(-0.5);
// mul r0.w, r0.w, c0.y
temp0.w = temp0.w * float1(10);
// mad r0.xyz, r0, r0.w, v0
temp0.xyz = temp0.xyz * temp0.www + i.position.xyz;
// mov r0.w, c0.z
temp0.w = float1(1);
// dp4 oPos.x, r0, c119
o.position.x = dot(temp0, (ViewProjection._m00_m10_m20_m30));
// dp4 oPos.y, r0, c120
o.position.y = dot(temp0, (ViewProjection._m01_m11_m21_m31));
// dp4 oPos.z, r0, c121
o.position.z = dot(temp0, (ViewProjection._m02_m12_m22_m32));
// dp4 oPos.w, r0, c122
o.position.w = dot(temp0, (ViewProjection._m03_m13_m23_m33));
// add r0.xy, r0, c17.zwzw
temp0.xy = temp0.xy + Shroud.ScaleUV_OffsetUV.zw;
// mul r0.z, v2.y, c16.x
temp0.z = i.texcoord.y * LineLength.x;
// mov r0.w, c0.w
temp0.w = float1(0.006666667);
// mad oT0.y, r0.z, r0.w, -c14.x
o.texcoord.y = temp0.z * temp0.w + -expr14.x;
// mad oT1.y, r0.z, r0.w, -c15.x
o.texcoord1.y = temp0.z * temp0.w + -expr15.x;
// mul oT2.xy, r0, c17
o.texcoord2 = temp0 * Shroud.ScaleUV_OffsetUV;
// mov oT0.x, v2.x
o.texcoord.x = i.texcoord.x;
// mov oT1.x, v2.x
o.texcoord1.x = i.texcoord.x;
//
return o;
}
technique Default
{
pass pass0
{
VertexShader = compile vs_2_0 Default_VertexShader2(); // 22
PixelShader = compile ps_2_0 Default_PixelShader1(); // 23
ZEnable = 1;
ZWriteEnable = 0;
ZFunc = 4;
AlphaBlendEnable = 1;
CullMode = 1;
SrcBlend = 2;
DestBlend = 2;
}
}