198 lines
6.1 KiB
HLSL
198 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;>;
|
|
row_major float4x4 ViewProjection <bool unmanaged = 1;>;
|
|
float4 WorldBones[128] <bool unmanaged = 1;>;
|
|
bool IsHdrEnabled <string SasBindAddress = "WW3D.IsHdrEnabled";>;
|
|
float2 ScreenInfo <string SasBindAddress = "WW3D.FrameBufferSize";>;
|
|
float4 CameraInfo <string SasBindAddress = "WW3D.AA.CameraInfo";> = { -30.23873, 1.007958, 30, 0.000265252 };
|
|
texture FrameBufferSampler <string SasBindAddress = "PostEffect.FrameBufferTexture"; int WW3DDynamicSet = 2;>; // 5
|
|
sampler2D FrameBufferSamplerSampler : register(ps_3_0, s0) <string Texture = "FrameBufferSampler"; string SasBindAddress = "PostEffect.FrameBufferTexture"; int WW3DDynamicSet = 2;> =
|
|
sampler_state
|
|
{
|
|
Texture = <FrameBufferSampler>; // 7
|
|
AddressU = 3;
|
|
AddressV = 3;
|
|
MipFilter = 0;
|
|
MinFilter = 2;
|
|
MagFilter = 2;
|
|
};
|
|
texture DepthBufferSampler <string SasBindAddress = "PostEffect.DepthBufferTexture"; int WW3DDynamicSet = 2;>; // 10
|
|
sampler2D DepthBufferSamplerSampler <string Texture = "DepthBufferSampler"; string SasBindAddress = "PostEffect.DepthBufferTexture"; int WW3DDynamicSet = 2;> =
|
|
sampler_state
|
|
{
|
|
Texture = <DepthBufferSampler>; // 12
|
|
AddressU = 3;
|
|
AddressV = 3;
|
|
MipFilter = 0;
|
|
MinFilter = 1;
|
|
MagFilter = 1;
|
|
};
|
|
// AntiAlias_PixelShader1 Pixel_3_0 Has PRES False
|
|
struct AntiAlias_PixelShader1_Input
|
|
{
|
|
float2 texcoord : TEXCOORD;
|
|
float4 texcoord1 : TEXCOORD1;
|
|
float4 texcoord2 : TEXCOORD2;
|
|
};
|
|
|
|
float4 AntiAlias_PixelShader1(AntiAlias_PixelShader1_Input i) : COLOR
|
|
{
|
|
float4 out_color;
|
|
float4 temp0, temp1, temp2, temp3, temp4;
|
|
// def c0, 0.3, 0.59, 0.11, 0.02
|
|
// def c1, 100, 0.2, 0, 0
|
|
// dcl_texcoord v0.xy
|
|
// dcl_texcoord1 v1
|
|
// dcl_texcoord2 v2
|
|
// dcl_2d s0
|
|
// texld r0, v1, s0
|
|
temp0 = tex2D(FrameBufferSamplerSampler, i.texcoord1.xy);
|
|
// texld r1, v1.zwzw, s0
|
|
temp1 = tex2D(FrameBufferSamplerSampler, i.texcoord1.zw);
|
|
// add r2.xyz, r0, -r1
|
|
temp2.xyz = temp0.xyz + -temp1.xyz;
|
|
// dp3 r2.x, r2_abs, c0
|
|
temp2.x = dot(abs(temp2).xyz, float3(0.3, 0.59, 0.11));
|
|
// texld r3, v2, s0
|
|
temp3 = tex2D(FrameBufferSamplerSampler, i.texcoord2.xy);
|
|
// texld r4, v2.zwzw, s0
|
|
temp4 = tex2D(FrameBufferSamplerSampler, i.texcoord2.zw);
|
|
// add r2.yzw, r3.xxyz, -r4.xxyz
|
|
temp2.yzw = temp3.xyz + -temp4.xyz;
|
|
// add r0, r0, r3
|
|
temp0 = temp0 + temp3;
|
|
// dp3 r2.y, r2_abs.yzww, c0
|
|
temp2.y = dot(abs(temp2).yzw, float3(0.3, 0.59, 0.11));
|
|
// max r3.x, r2.x, r2.y
|
|
temp3.x = max(temp2.x, temp2.y);
|
|
// add r2.x, r3.x, -c0.w
|
|
temp2.x = temp3.x + float1(-0.02);
|
|
// add r2.y, -r3.x, c0.w
|
|
temp2.y = -temp3.x + float1(0.02);
|
|
// mul_sat r2.x, r2.x, c1.x
|
|
temp2.x = saturate(temp2.x * float1(100));
|
|
// add r0, r1, r0
|
|
temp0 = temp1 + temp0;
|
|
// add r0, r4, r0
|
|
temp0 = temp4 + temp0;
|
|
// texld r1, v0, s0
|
|
temp1 = tex2D(FrameBufferSamplerSampler, i.texcoord.xy);
|
|
// lrp r3, c1.y, r0, -r1
|
|
temp3 = lerp(-temp1, temp0, float4(0.2, 0.2, 0.2, 0.2));
|
|
// mad r0, r2.x, r3, r1
|
|
temp0 = temp2.x * temp3 + temp1;
|
|
// cmp oC0, r2.y, r1, r0
|
|
out_color = (temp2.y >= 0) ? temp1 : temp0;
|
|
//
|
|
|
|
return out_color;
|
|
}
|
|
|
|
// AntiAlias_VertexShader2 Vertex_3_0 Has PRES True
|
|
struct AntiAlias_VertexShader2_Input
|
|
{
|
|
float4 position : POSITION;
|
|
float4 texcoord : TEXCOORD;
|
|
};
|
|
|
|
struct AntiAlias_VertexShader2_Output
|
|
{
|
|
float4 position : POSITION;
|
|
float2 texcoord : TEXCOORD;
|
|
float4 texcoord1 : TEXCOORD1;
|
|
float4 texcoord2 : TEXCOORD2;
|
|
};
|
|
|
|
AntiAlias_VertexShader2_Output AntiAlias_VertexShader2(AntiAlias_VertexShader2_Input i)
|
|
{
|
|
/*
|
|
PRSI
|
|
OutputRegisterOffset: 11
|
|
Unknown1: 0
|
|
Unknown2: 0
|
|
OutputRegisterCount: 2
|
|
Unknown3: 0
|
|
Unknown4: 0
|
|
Unknown5: 11
|
|
Unknown6: 2
|
|
Mappings: 1
|
|
0 - ConstOutput: 0 ConstInput 0
|
|
|
|
*/
|
|
float4 expr11;
|
|
float4 expr12;
|
|
{
|
|
// Expression_2_1
|
|
// rcp c11.x, c0.x
|
|
expr11.x = 1.0f / (ScreenInfo.x);
|
|
// rcp c12.x, c0.y
|
|
expr12.x = 1.0f / (ScreenInfo.y);
|
|
}
|
|
|
|
AntiAlias_VertexShader2_Output o;
|
|
// def c0, 0, 1, 0, 0
|
|
// dcl_position v0
|
|
// dcl_texcoord v1
|
|
// dcl_position o0
|
|
// dcl_texcoord o1.xy
|
|
// dcl_texcoord1 o2
|
|
// dcl_texcoord2 o3
|
|
// add o2.x, -c11.x, v1.x
|
|
o.texcoord1.x = -expr11.x + i.texcoord.x;
|
|
// add o2.z, c11.x, v1.x
|
|
o.texcoord1.z = expr11.x + i.texcoord.x;
|
|
// add o3.y, -c12.x, v1.y
|
|
o.texcoord2.y = -expr12.x + i.texcoord.y;
|
|
// add o3.w, c12.x, v1.y
|
|
o.texcoord2.w = expr12.x + i.texcoord.y;
|
|
// mov o0.xy, v0
|
|
o.position.xy = i.position.xy;
|
|
// mov o0.zw, c0.xyxy
|
|
o.position.zw = float2(0, 1);
|
|
// mov o1.xy, v1
|
|
o.texcoord = i.texcoord;
|
|
// mov o2.yw, v1.y
|
|
o.texcoord1.yw = i.texcoord.y;
|
|
// mov o3.xz, v1.x
|
|
o.texcoord2.xz = i.texcoord.x;
|
|
//
|
|
|
|
return o;
|
|
}
|
|
|
|
technique AntiAlias
|
|
{
|
|
pass p0
|
|
{
|
|
VertexShader = compile vs_3_0 AntiAlias_VertexShader2(); // 15
|
|
PixelShader = compile ps_3_0 AntiAlias_PixelShader1(); // 16
|
|
AlphaTestEnable = 0;
|
|
AlphaBlendEnable = 0;
|
|
CullMode = 1;
|
|
ZEnable = 0;
|
|
ZWriteEnable = 0;
|
|
ZFunc = 8;
|
|
ColorWriteEnable = 15;
|
|
}
|
|
}
|
|
|