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

448 lines
11 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;>;
row_major float4x4 ViewProjection <bool unmanaged = 1;>;
float4 WorldBones[128] <bool unmanaged = 1;>;
bool IsHdrEnabled <string SasBindAddress = "WW3D.IsHdrEnabled";>;
texture PostEffectOutlineTexture <string SasBindAddress = "WW3D.Outline.Texture";>; // 3
sampler2D PostEffectOutlineTextureSampler : register(ps_2_0, s0) <string Texture = "PostEffectOutlineTexture"; string SasBindAddress = "WW3D.Outline.Texture";> =
sampler_state
{
Texture = <PostEffectOutlineTexture>; // 5
MinFilter = 2;
MagFilter = 2;
MipFilter = 1;
AddressU = 3;
AddressV = 3;
};
float2 FrameBufferSize <string UIWidget = "None"; string SasBindAddress = "WW3D.FrameBufferSize";> = { 1, 1 };
// Blit_PixelShader1 Pixel_2_0 Has PRES False
float4 Blit_PixelShader1(float2 texcoord : TEXCOORD) : COLOR
{
float4 out_color;
float4 temp0;
// dcl t0.xy
// dcl_2d s0
// texld r0, t0, s0
temp0 = tex2D(PostEffectOutlineTextureSampler, texcoord.xy);
// mov oC0, r0
out_color = temp0;
//
return out_color;
}
// Blit_VertexShader2 Vertex_2_0 Has PRES False
struct Blit_VertexShader2_Input
{
float4 position : POSITION;
float4 texcoord : TEXCOORD;
};
struct Blit_VertexShader2_Output
{
float4 position : POSITION;
float2 texcoord : TEXCOORD;
};
Blit_VertexShader2_Output Blit_VertexShader2(Blit_VertexShader2_Input i)
{
Blit_VertexShader2_Output o;
// def c0, 1, 0, 0, 0
// dcl_position v0
// dcl_texcoord v1
// mov oPos.xyz, v0
o.position.xyz = i.position.xyz;
// mov oPos.w, c0.x
o.position.w = float1(1);
// mov oT0.xy, v1
o.texcoord = i.texcoord;
//
return o;
}
// DrawWithStencil_PixelShader3 Pixel_2_0 Has PRES False
float4 DrawWithStencil_PixelShader3(float2 texcoord : TEXCOORD) : COLOR
{
float4 out_color;
float4 temp0;
// dcl t0.xy
// dcl_2d s0
// texld r0, t0, s0
temp0 = tex2D(PostEffectOutlineTextureSampler, texcoord.xy);
// mov oC0, r0
out_color = temp0;
//
return out_color;
}
// DrawWithStencil_VertexShader4 Vertex_2_0 Has PRES False
struct DrawWithStencil_VertexShader4_Input
{
float4 position : POSITION;
float4 texcoord : TEXCOORD;
};
struct DrawWithStencil_VertexShader4_Output
{
float4 position : POSITION;
float2 texcoord : TEXCOORD;
};
DrawWithStencil_VertexShader4_Output DrawWithStencil_VertexShader4(DrawWithStencil_VertexShader4_Input i)
{
DrawWithStencil_VertexShader4_Output o;
// def c0, 1, 0, 0, 0
// dcl_position v0
// dcl_texcoord v1
// mov oPos.xyz, v0
o.position.xyz = i.position.xyz;
// mov oPos.w, c0.x
o.position.w = float1(1);
// mov oT0.xy, v1
o.texcoord = i.texcoord;
//
return o;
}
// BlurBox_PixelShader5 Pixel_2_0 Has PRES False
struct BlurBox_PixelShader5_Input
{
float2 texcoord : TEXCOORD;
float4 texcoord1 : TEXCOORD1;
};
float4 BlurBox_PixelShader5(BlurBox_PixelShader5_Input i) : COLOR
{
float4 out_color;
float4 temp0, temp1, temp2, temp3;
float2 temp4;
// def c0, 1.25, 0, 0, 0
// dcl t0.xy
// dcl t1
// dcl_2d s0
// mov r0.xy, t0
temp0.xy = i.texcoord.xy;
// add r1.x, r0.x, t1.x
temp1.x = temp0.x + i.texcoord1.x;
// add r1.y, r0.y, t1.z
temp1.y = temp0.y + i.texcoord1.z;
// add r2.x, r0.x, t1.x
temp2.x = temp0.x + i.texcoord1.x;
// add r2.y, r0.y, t1.w
temp2.y = temp0.y + i.texcoord1.w;
// add r3.xy, r0, t1.yzxw
temp3.xy = temp0.xy + i.texcoord1.yz;
// add r4.x, r0.x, t1.y
temp4.x = temp0.x + i.texcoord1.y;
// add r4.y, r0.y, t1.w
temp4.y = temp0.y + i.texcoord1.w;
// texld r0, r1, s0
temp0 = tex2D(PostEffectOutlineTextureSampler, temp1.xy);
// texld r1, r2, s0
temp1 = tex2D(PostEffectOutlineTextureSampler, temp2.xy);
// texld r2, r3, s0
temp2 = tex2D(PostEffectOutlineTextureSampler, temp3.xy);
// texld r3, r4, s0
temp3 = tex2D(PostEffectOutlineTextureSampler, temp4.xy);
// add r0, r0, r1
temp0 = temp0 + temp1;
// add r0, r2, r0
temp0 = temp2 + temp0;
// add r0, r3, r0
temp0 = temp3 + temp0;
// mul r0, r0, c0.x
temp0 = temp0 * float4(1.25, 1.25, 1.25, 1.25);
// mov oC0, r0
out_color = temp0;
//
return out_color;
}
// BlurBox_VertexShader6 Vertex_2_0 Has PRES True
struct BlurBox_VertexShader6_Input
{
float4 position : POSITION;
float4 texcoord : TEXCOORD;
};
struct BlurBox_VertexShader6_Output
{
float4 position : POSITION;
float2 texcoord : TEXCOORD;
float4 texcoord1 : TEXCOORD1;
};
BlurBox_VertexShader6_Output BlurBox_VertexShader6(BlurBox_VertexShader6_Input i)
{
/*
PRSI
OutputRegisterOffset: 12
Unknown1: 0
Unknown2: 0
OutputRegisterCount: 1
Unknown3: 0
Unknown4: 0
Unknown5: 12
Unknown6: 1
Mappings: 1
0 - ConstOutput: 0 ConstInput 0
*/
float4 expr12;
{
float4 temp0;
// Expression_2_1
// rcp r0.x, c0.x
temp0.x = 1.0f / (FrameBufferSize.x);
// mul c12.x, r0.x, (-1.5)
expr12.x = temp0.x * (-1.5);
// mul c12.y, r0.x, (1.5)
expr12.y = temp0.x * (1.5);
// rcp r0.x, c0.y
temp0.x = 1.0f / (FrameBufferSize.y);
// mul c12.z, r0.x, (-1.5)
expr12.z = temp0.x * (-1.5);
// mul c12.w, r0.x, (1.5)
expr12.w = temp0.x * (1.5);
}
BlurBox_VertexShader6_Output o;
// def c0, 1, 0, 0, 0
// dcl_position v0
// dcl_texcoord v1
// mov oPos.xyz, v0
o.position.xyz = i.position.xyz;
// mov oPos.w, c0.x
o.position.w = float1(1);
// mov oT0.xy, v1
o.texcoord = i.texcoord;
// mov oT1, c12
o.texcoord1 = expr12;
//
return o;
}
// FillHoverAttack_PixelShader7 Pixel_2_0 Has PRES False
float4 FillHoverAttack_PixelShader7() : COLOR
{
float4 out_color;
// def c0, 1, 0, 0, 1
// mov oC0, c0
out_color = float4(1, 0, 0, 1);
//
return out_color;
}
// FillHoverAttack_VertexShader8 Vertex_2_0 Has PRES False
float4 FillHoverAttack_VertexShader8(float4 position : POSITION) : POSITION
{
float4 out_position;
// def c0, 1, 0, 0, 0
// dcl_position v0
// mov oPos.xyz, v0
out_position.xyz = position.xyz;
// mov oPos.w, c0.x
out_position.w = float1(1);
//
return out_position;
}
// FillHoverSelect_PixelShader9 Pixel_2_0 Has PRES False
float4 FillHoverSelect_PixelShader9() : COLOR
{
float4 out_color;
float4 temp0;
// def c0, 1, 0, 0, 0
// mov r0, c0.x
temp0 = float4(1, 1, 1, 1);
// mov oC0, r0
out_color = temp0;
//
return out_color;
}
// FillHoverSelect_VertexShader10 Vertex_2_0 Has PRES False
float4 FillHoverSelect_VertexShader10(float4 position : POSITION) : POSITION
{
float4 out_position;
// def c0, 1, 0, 0, 0
// dcl_position v0
// mov oPos.xyz, v0
out_position.xyz = position.xyz;
// mov oPos.w, c0.x
out_position.w = float1(1);
//
return out_position;
}
// FillSelected_PixelShader11 Pixel_2_0 Has PRES False
float4 FillSelected_PixelShader11() : COLOR
{
float4 out_color;
// def c0, 1, 0.713, 0, 1
// mov oC0, c0
out_color = float4(1, 0.713, 0, 1);
//
return out_color;
}
// FillSelected_VertexShader12 Vertex_2_0 Has PRES False
float4 FillSelected_VertexShader12(float4 position : POSITION) : POSITION
{
float4 out_position;
// def c0, 1, 0, 0, 0
// dcl_position v0
// mov oPos.xyz, v0
out_position.xyz = position.xyz;
// mov oPos.w, c0.x
out_position.w = float1(1);
//
return out_position;
}
technique FillSelected
{
pass P0
{
VertexShader = compile vs_2_0 FillSelected_VertexShader12(); // 10
PixelShader = compile ps_2_0 FillSelected_PixelShader11(); // 11
ZEnable = 0;
ZWriteEnable = 0;
CullMode = 1;
StencilEnable = 1;
StencilFunc = 3;
StencilPass = 1;
StencilZFail = 1;
StencilFail = 1;
StencilMask = 1;
StencilRef = 1;
AlphaBlendEnable = 0;
AlphaTestEnable = 0;
}
}
technique FillHoverSelect
{
pass P0
{
VertexShader = compile vs_2_0 FillHoverSelect_VertexShader10(); // 12
PixelShader = compile ps_2_0 FillHoverSelect_PixelShader9(); // 13
ZEnable = 0;
ZWriteEnable = 0;
CullMode = 1;
AlphaBlendEnable = 0;
AlphaTestEnable = 0;
StencilEnable = 1;
StencilFunc = 3;
StencilPass = 1;
StencilZFail = 1;
StencilFail = 1;
StencilMask = 2;
StencilRef = 2;
}
}
technique FillHoverAttack
{
pass P0
{
VertexShader = compile vs_2_0 FillHoverAttack_VertexShader8(); // 14
PixelShader = compile ps_2_0 FillHoverAttack_PixelShader7(); // 15
ZEnable = 0;
ZWriteEnable = 0;
CullMode = 1;
AlphaBlendEnable = 0;
AlphaTestEnable = 0;
StencilEnable = 1;
StencilFunc = 3;
StencilPass = 1;
StencilZFail = 1;
StencilFail = 1;
StencilMask = 3;
StencilRef = 3;
}
}
technique BlurBox
{
pass P0
{
VertexShader = compile vs_2_0 BlurBox_VertexShader6(); // 16
PixelShader = compile ps_2_0 BlurBox_PixelShader5(); // 17
ZEnable = 0;
ZWriteEnable = 0;
CullMode = 1;
StencilEnable = 0;
AlphaBlendEnable = 0;
AlphaTestEnable = 0;
}
}
technique DrawWithStencil
{
pass P0
{
VertexShader = compile vs_2_0 DrawWithStencil_VertexShader4(); // 18
PixelShader = compile ps_2_0 DrawWithStencil_PixelShader3(); // 19
ZEnable = 0;
ZWriteEnable = 0;
CullMode = 1;
StencilEnable = 1;
StencilFunc = 3;
StencilPass = 1;
StencilZFail = 1;
StencilFail = 1;
StencilMask = 3;
StencilRef = 0;
AlphaBlendEnable = 1;
SrcBlend = 5;
DestBlend = 6;
}
}
technique Blit
{
pass P0
{
VertexShader = compile vs_2_0 Blit_VertexShader2(); // 20
PixelShader = compile ps_2_0 Blit_PixelShader1(); // 21
ZEnable = 0;
ZWriteEnable = 0;
CullMode = 1;
StencilEnable = 0;
AlphaTestEnable = 0;
AlphaBlendEnable = 0;
}
}