487 lines
14 KiB
HLSL
487 lines
14 KiB
HLSL
string DefaultParameterScopeBlock = "material"; // 1
|
|
float3 AmbientLightColor <bool unmanaged = 1;> = { 0.3, 0.3, 0.3 };
|
|
struct
|
|
{
|
|
float3 Color;
|
|
float3 Direction;
|
|
} DirectionalLight[3] : register(ps_2_0, c5) <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;>;
|
|
texture EnvironmentTexture <string SasBindAddress = "Environment.SourceTexture"; string ResourceType = "Cube";>; // 2
|
|
samplerCUBE EnvironmentTextureSampler : register(ps_2_0, s0) <string Texture = "EnvironmentTexture"; string SasBindAddress = "Environment.SourceTexture"; string ResourceType = "Cube";> =
|
|
sampler_state
|
|
{
|
|
Texture = <EnvironmentTexture>; // 5
|
|
MinFilter = 2;
|
|
MagFilter = 2;
|
|
MipFilter = 2;
|
|
AddressU = 3;
|
|
AddressV = 3;
|
|
AddressW = 3;
|
|
};
|
|
// CubeFace5_PixelShader1 Pixel_2_0 Has PRES False
|
|
float4 CubeFace5_PixelShader1(float3 texcoord : TEXCOORD) : COLOR
|
|
{
|
|
float4 out_color;
|
|
float4 temp0;
|
|
float3 temp1;
|
|
// def c0, 0, 0, 1, 0
|
|
// dcl t0.xyz
|
|
// dcl_cube s0
|
|
// mov r0.xyz, c6
|
|
temp0.xyz = DirectionalLight[0].Direction.xyz;
|
|
// mul r1.xyz, r0.zxyw, c0
|
|
temp1.xyz = temp0.zxy * float3(0, 0, 1);
|
|
// mad r0.xyz, r0.yzxw, c0.yzxw, -r1
|
|
temp0.xyz = temp0.yzx * float3(0, 1, 0) + -temp1.xyz;
|
|
// nrm r1.xyz, r0
|
|
temp1.xyz = normalize(temp0.xyz).xyz;
|
|
// mul r0.xyz, r1.yzxw, c6.zxyw
|
|
temp0.xyz = temp1.yzx * DirectionalLight[0].Direction.zxy;
|
|
// mad r0.xyz, c6.yzxw, r1.zxyw, -r0
|
|
temp0.xyz = DirectionalLight[0].Direction.yzx * temp1.zxy + -temp0.xyz;
|
|
// dp3 r1.x, r1, t0
|
|
temp1.x = dot(temp1.xyz, texcoord.xyz);
|
|
// dp3 r1.y, r0, t0
|
|
temp1.y = dot(temp0.xyz, texcoord.xyz);
|
|
// dp3 r1.z, c6, t0
|
|
temp1.z = dot(DirectionalLight[0].Direction.xyz, texcoord.xyz);
|
|
// texld r0, r1, s0
|
|
temp0 = texCUBE(EnvironmentTextureSampler, temp1.xyz);
|
|
// mov oC0, r0
|
|
out_color = temp0;
|
|
//
|
|
|
|
return out_color;
|
|
}
|
|
|
|
// CubeFace5_VertexShader2 Vertex_2_0 Has PRES False
|
|
struct CubeFace5_VertexShader2_Output
|
|
{
|
|
float4 position : POSITION;
|
|
float3 texcoord : TEXCOORD;
|
|
};
|
|
|
|
CubeFace5_VertexShader2_Output CubeFace5_VertexShader2(float4 position : POSITION)
|
|
{
|
|
CubeFace5_VertexShader2_Output o;
|
|
// def c0, 1, -1, 0, 0
|
|
// dcl_position v0
|
|
// mov oPos.xyz, v0
|
|
o.position.xyz = position.xyz;
|
|
// mov oPos.w, c0.x
|
|
o.position.w = float1(1);
|
|
// mul oT0.xy, v0, c0.yxzw
|
|
o.texcoord.xy = position.xy * float2(-1, 1);
|
|
// mov oT0.z, c0.y
|
|
o.texcoord.z = float1(-1);
|
|
//
|
|
|
|
return o;
|
|
}
|
|
|
|
// CubeFace4_PixelShader3 Pixel_2_0 Has PRES False
|
|
float4 CubeFace4_PixelShader3(float3 texcoord : TEXCOORD) : COLOR
|
|
{
|
|
float4 out_color;
|
|
float4 temp0;
|
|
float3 temp1;
|
|
// def c0, 0, 0, 1, 0
|
|
// dcl t0.xyz
|
|
// dcl_cube s0
|
|
// mov r0.xyz, c6
|
|
temp0.xyz = DirectionalLight[0].Direction.xyz;
|
|
// mul r1.xyz, r0.zxyw, c0
|
|
temp1.xyz = temp0.zxy * float3(0, 0, 1);
|
|
// mad r0.xyz, r0.yzxw, c0.yzxw, -r1
|
|
temp0.xyz = temp0.yzx * float3(0, 1, 0) + -temp1.xyz;
|
|
// nrm r1.xyz, r0
|
|
temp1.xyz = normalize(temp0.xyz).xyz;
|
|
// mul r0.xyz, r1.yzxw, c6.zxyw
|
|
temp0.xyz = temp1.yzx * DirectionalLight[0].Direction.zxy;
|
|
// mad r0.xyz, c6.yzxw, r1.zxyw, -r0
|
|
temp0.xyz = DirectionalLight[0].Direction.yzx * temp1.zxy + -temp0.xyz;
|
|
// dp3 r1.x, r1, t0
|
|
temp1.x = dot(temp1.xyz, texcoord.xyz);
|
|
// dp3 r1.y, r0, t0
|
|
temp1.y = dot(temp0.xyz, texcoord.xyz);
|
|
// dp3 r1.z, c6, t0
|
|
temp1.z = dot(DirectionalLight[0].Direction.xyz, texcoord.xyz);
|
|
// texld r0, r1, s0
|
|
temp0 = texCUBE(EnvironmentTextureSampler, temp1.xyz);
|
|
// mov oC0, r0
|
|
out_color = temp0;
|
|
//
|
|
|
|
return out_color;
|
|
}
|
|
|
|
// CubeFace4_VertexShader4 Vertex_2_0 Has PRES False
|
|
struct CubeFace4_VertexShader4_Output
|
|
{
|
|
float4 position : POSITION;
|
|
float3 texcoord : TEXCOORD;
|
|
};
|
|
|
|
CubeFace4_VertexShader4_Output CubeFace4_VertexShader4(float4 position : POSITION)
|
|
{
|
|
CubeFace4_VertexShader4_Output o;
|
|
// def c0, 1, 0, 0, 0
|
|
// dcl_position v0
|
|
// mov oPos.xyz, v0
|
|
o.position.xyz = position.xyz;
|
|
// mov oPos.w, c0.x
|
|
o.position.w = float1(1);
|
|
// mov oT0.xy, v0
|
|
o.texcoord.xy = position.xy;
|
|
// mov oT0.z, c0.x
|
|
o.texcoord.z = float1(1);
|
|
//
|
|
|
|
return o;
|
|
}
|
|
|
|
// CubeFace3_PixelShader5 Pixel_2_0 Has PRES False
|
|
float4 CubeFace3_PixelShader5(float3 texcoord : TEXCOORD) : COLOR
|
|
{
|
|
float4 out_color;
|
|
float4 temp0;
|
|
float3 temp1;
|
|
// def c0, 0, 0, 1, 0
|
|
// dcl t0.xyz
|
|
// dcl_cube s0
|
|
// mov r0.xyz, c6
|
|
temp0.xyz = DirectionalLight[0].Direction.xyz;
|
|
// mul r1.xyz, r0.zxyw, c0
|
|
temp1.xyz = temp0.zxy * float3(0, 0, 1);
|
|
// mad r0.xyz, r0.yzxw, c0.yzxw, -r1
|
|
temp0.xyz = temp0.yzx * float3(0, 1, 0) + -temp1.xyz;
|
|
// nrm r1.xyz, r0
|
|
temp1.xyz = normalize(temp0.xyz).xyz;
|
|
// mul r0.xyz, r1.yzxw, c6.zxyw
|
|
temp0.xyz = temp1.yzx * DirectionalLight[0].Direction.zxy;
|
|
// mad r0.xyz, c6.yzxw, r1.zxyw, -r0
|
|
temp0.xyz = DirectionalLight[0].Direction.yzx * temp1.zxy + -temp0.xyz;
|
|
// dp3 r1.x, r1, t0
|
|
temp1.x = dot(temp1.xyz, texcoord.xyz);
|
|
// dp3 r1.y, r0, t0
|
|
temp1.y = dot(temp0.xyz, texcoord.xyz);
|
|
// dp3 r1.z, c6, t0
|
|
temp1.z = dot(DirectionalLight[0].Direction.xyz, texcoord.xyz);
|
|
// texld r0, r1, s0
|
|
temp0 = texCUBE(EnvironmentTextureSampler, temp1.xyz);
|
|
// mov oC0, r0
|
|
out_color = temp0;
|
|
//
|
|
|
|
return out_color;
|
|
}
|
|
|
|
// CubeFace3_VertexShader6 Vertex_2_0 Has PRES False
|
|
struct CubeFace3_VertexShader6_Output
|
|
{
|
|
float4 position : POSITION;
|
|
float3 texcoord : TEXCOORD;
|
|
};
|
|
|
|
CubeFace3_VertexShader6_Output CubeFace3_VertexShader6(float4 position : POSITION)
|
|
{
|
|
CubeFace3_VertexShader6_Output o;
|
|
// def c0, 1, -1, 0, 0
|
|
// dcl_position v0
|
|
// mov oPos.xyz, v0
|
|
o.position.xyz = position.xyz;
|
|
// mov oPos.w, c0.x
|
|
o.position.w = float1(1);
|
|
// mov oT0.xz, v0.xyyw
|
|
o.texcoord.xz = position.xy;
|
|
// mov oT0.y, c0.y
|
|
o.texcoord.y = float1(-1);
|
|
//
|
|
|
|
return o;
|
|
}
|
|
|
|
// CubeFace2_PixelShader7 Pixel_2_0 Has PRES False
|
|
float4 CubeFace2_PixelShader7(float3 texcoord : TEXCOORD) : COLOR
|
|
{
|
|
float4 out_color;
|
|
float4 temp0;
|
|
float3 temp1;
|
|
// def c0, 0, 0, 1, 0
|
|
// dcl t0.xyz
|
|
// dcl_cube s0
|
|
// mov r0.xyz, c6
|
|
temp0.xyz = DirectionalLight[0].Direction.xyz;
|
|
// mul r1.xyz, r0.zxyw, c0
|
|
temp1.xyz = temp0.zxy * float3(0, 0, 1);
|
|
// mad r0.xyz, r0.yzxw, c0.yzxw, -r1
|
|
temp0.xyz = temp0.yzx * float3(0, 1, 0) + -temp1.xyz;
|
|
// nrm r1.xyz, r0
|
|
temp1.xyz = normalize(temp0.xyz).xyz;
|
|
// mul r0.xyz, r1.yzxw, c6.zxyw
|
|
temp0.xyz = temp1.yzx * DirectionalLight[0].Direction.zxy;
|
|
// mad r0.xyz, c6.yzxw, r1.zxyw, -r0
|
|
temp0.xyz = DirectionalLight[0].Direction.yzx * temp1.zxy + -temp0.xyz;
|
|
// dp3 r1.x, r1, t0
|
|
temp1.x = dot(temp1.xyz, texcoord.xyz);
|
|
// dp3 r1.y, r0, t0
|
|
temp1.y = dot(temp0.xyz, texcoord.xyz);
|
|
// dp3 r1.z, c6, t0
|
|
temp1.z = dot(DirectionalLight[0].Direction.xyz, texcoord.xyz);
|
|
// texld r0, r1, s0
|
|
temp0 = texCUBE(EnvironmentTextureSampler, temp1.xyz);
|
|
// mov oC0, r0
|
|
out_color = temp0;
|
|
//
|
|
|
|
return out_color;
|
|
}
|
|
|
|
// CubeFace2_VertexShader8 Vertex_2_0 Has PRES False
|
|
struct CubeFace2_VertexShader8_Output
|
|
{
|
|
float4 position : POSITION;
|
|
float3 texcoord : TEXCOORD;
|
|
};
|
|
|
|
CubeFace2_VertexShader8_Output CubeFace2_VertexShader8(float4 position : POSITION)
|
|
{
|
|
CubeFace2_VertexShader8_Output o;
|
|
// def c0, 1, -1, 0, 0
|
|
// dcl_position v0
|
|
// mov oPos.xyz, v0
|
|
o.position.xyz = position.xyz;
|
|
// mov oPos.w, c0.x
|
|
o.position.w = float1(1);
|
|
// mul oT0.xz, v0.xyyw, c0.xyyw
|
|
o.texcoord.xz = position.xy * float2(1, -1);
|
|
// mov oT0.y, c0.x
|
|
o.texcoord.y = float1(1);
|
|
//
|
|
|
|
return o;
|
|
}
|
|
|
|
// CubeFace1_PixelShader9 Pixel_2_0 Has PRES False
|
|
float4 CubeFace1_PixelShader9(float3 texcoord : TEXCOORD) : COLOR
|
|
{
|
|
float4 out_color;
|
|
float4 temp0;
|
|
float3 temp1;
|
|
// def c0, 0, 0, 1, 0
|
|
// dcl t0.xyz
|
|
// dcl_cube s0
|
|
// mov r0.xyz, c6
|
|
temp0.xyz = DirectionalLight[0].Direction.xyz;
|
|
// mul r1.xyz, r0.zxyw, c0
|
|
temp1.xyz = temp0.zxy * float3(0, 0, 1);
|
|
// mad r0.xyz, r0.yzxw, c0.yzxw, -r1
|
|
temp0.xyz = temp0.yzx * float3(0, 1, 0) + -temp1.xyz;
|
|
// nrm r1.xyz, r0
|
|
temp1.xyz = normalize(temp0.xyz).xyz;
|
|
// mul r0.xyz, r1.yzxw, c6.zxyw
|
|
temp0.xyz = temp1.yzx * DirectionalLight[0].Direction.zxy;
|
|
// mad r0.xyz, c6.yzxw, r1.zxyw, -r0
|
|
temp0.xyz = DirectionalLight[0].Direction.yzx * temp1.zxy + -temp0.xyz;
|
|
// dp3 r1.x, r1, t0
|
|
temp1.x = dot(temp1.xyz, texcoord.xyz);
|
|
// dp3 r1.y, r0, t0
|
|
temp1.y = dot(temp0.xyz, texcoord.xyz);
|
|
// dp3 r1.z, c6, t0
|
|
temp1.z = dot(DirectionalLight[0].Direction.xyz, texcoord.xyz);
|
|
// texld r0, r1, s0
|
|
temp0 = texCUBE(EnvironmentTextureSampler, temp1.xyz);
|
|
// mov oC0, r0
|
|
out_color = temp0;
|
|
//
|
|
|
|
return out_color;
|
|
}
|
|
|
|
// CubeFace1_VertexShader10 Vertex_2_0 Has PRES False
|
|
struct CubeFace1_VertexShader10_Output
|
|
{
|
|
float4 position : POSITION;
|
|
float3 texcoord : TEXCOORD;
|
|
};
|
|
|
|
CubeFace1_VertexShader10_Output CubeFace1_VertexShader10(float4 position : POSITION)
|
|
{
|
|
CubeFace1_VertexShader10_Output o;
|
|
// def c0, 1, -1, 0, 0
|
|
// dcl_position v0
|
|
// mov oPos.xyz, v0
|
|
o.position.xyz = position.xyz;
|
|
// mov oPos.w, c0.x
|
|
o.position.w = float1(1);
|
|
// mov oT0.x, c0.y
|
|
o.texcoord.x = float1(-1);
|
|
// mov oT0.yz, v0.xyxw
|
|
o.texcoord.yz = position.yx;
|
|
//
|
|
|
|
return o;
|
|
}
|
|
|
|
// CubeFace0_PixelShader11 Pixel_2_0 Has PRES False
|
|
float4 CubeFace0_PixelShader11(float3 texcoord : TEXCOORD) : COLOR
|
|
{
|
|
float4 out_color;
|
|
float4 temp0;
|
|
float3 temp1;
|
|
// def c0, 0, 0, 1, 0
|
|
// dcl t0.xyz
|
|
// dcl_cube s0
|
|
// mov r0.xyz, c6
|
|
temp0.xyz = DirectionalLight[0].Direction.xyz;
|
|
// mul r1.xyz, r0.zxyw, c0
|
|
temp1.xyz = temp0.zxy * float3(0, 0, 1);
|
|
// mad r0.xyz, r0.yzxw, c0.yzxw, -r1
|
|
temp0.xyz = temp0.yzx * float3(0, 1, 0) + -temp1.xyz;
|
|
// nrm r1.xyz, r0
|
|
temp1.xyz = normalize(temp0.xyz).xyz;
|
|
// mul r0.xyz, r1.yzxw, c6.zxyw
|
|
temp0.xyz = temp1.yzx * DirectionalLight[0].Direction.zxy;
|
|
// mad r0.xyz, c6.yzxw, r1.zxyw, -r0
|
|
temp0.xyz = DirectionalLight[0].Direction.yzx * temp1.zxy + -temp0.xyz;
|
|
// dp3 r1.x, r1, t0
|
|
temp1.x = dot(temp1.xyz, texcoord.xyz);
|
|
// dp3 r1.y, r0, t0
|
|
temp1.y = dot(temp0.xyz, texcoord.xyz);
|
|
// dp3 r1.z, c6, t0
|
|
temp1.z = dot(DirectionalLight[0].Direction.xyz, texcoord.xyz);
|
|
// texld r0, r1, s0
|
|
temp0 = texCUBE(EnvironmentTextureSampler, temp1.xyz);
|
|
// mov oC0, r0
|
|
out_color = temp0;
|
|
//
|
|
|
|
return out_color;
|
|
}
|
|
|
|
// CubeFace0_VertexShader12 Vertex_2_0 Has PRES False
|
|
struct CubeFace0_VertexShader12_Output
|
|
{
|
|
float4 position : POSITION;
|
|
float3 texcoord : TEXCOORD;
|
|
};
|
|
|
|
CubeFace0_VertexShader12_Output CubeFace0_VertexShader12(float4 position : POSITION)
|
|
{
|
|
CubeFace0_VertexShader12_Output o;
|
|
// def c0, 1, -1, 0, 0
|
|
// dcl_position v0
|
|
// mov oPos.xyz, v0
|
|
o.position.xyz = position.xyz;
|
|
// mov oPos.w, c0.x
|
|
o.position.w = float1(1);
|
|
// mov oT0.x, c0.x
|
|
o.texcoord.x = float1(1);
|
|
// mul oT0.yz, v0.xyxw, c0.xxyw
|
|
o.texcoord.yz = position.yx * float2(1, -1);
|
|
//
|
|
|
|
return o;
|
|
}
|
|
|
|
technique CubeFace0
|
|
{
|
|
pass p0
|
|
{
|
|
VertexShader = compile vs_2_0 CubeFace0_VertexShader12(); // 9
|
|
PixelShader = compile ps_2_0 CubeFace0_PixelShader11(); // 10
|
|
ZEnable = 0;
|
|
ZWriteEnable = 0;
|
|
CullMode = 1;
|
|
AlphaTestEnable = 0;
|
|
AlphaBlendEnable = 0;
|
|
}
|
|
}
|
|
|
|
technique CubeFace1
|
|
{
|
|
pass p0
|
|
{
|
|
VertexShader = compile vs_2_0 CubeFace1_VertexShader10(); // 11
|
|
PixelShader = compile ps_2_0 CubeFace1_PixelShader9(); // 12
|
|
ZEnable = 0;
|
|
ZWriteEnable = 0;
|
|
CullMode = 1;
|
|
AlphaTestEnable = 0;
|
|
AlphaBlendEnable = 0;
|
|
}
|
|
}
|
|
|
|
technique CubeFace2
|
|
{
|
|
pass p0
|
|
{
|
|
VertexShader = compile vs_2_0 CubeFace2_VertexShader8(); // 13
|
|
PixelShader = compile ps_2_0 CubeFace2_PixelShader7(); // 14
|
|
ZEnable = 0;
|
|
ZWriteEnable = 0;
|
|
CullMode = 1;
|
|
AlphaTestEnable = 0;
|
|
AlphaBlendEnable = 0;
|
|
}
|
|
}
|
|
|
|
technique CubeFace3
|
|
{
|
|
pass p0
|
|
{
|
|
VertexShader = compile vs_2_0 CubeFace3_VertexShader6(); // 15
|
|
PixelShader = compile ps_2_0 CubeFace3_PixelShader5(); // 16
|
|
ZEnable = 0;
|
|
ZWriteEnable = 0;
|
|
CullMode = 1;
|
|
AlphaTestEnable = 0;
|
|
AlphaBlendEnable = 0;
|
|
}
|
|
}
|
|
|
|
technique CubeFace4
|
|
{
|
|
pass p0
|
|
{
|
|
VertexShader = compile vs_2_0 CubeFace4_VertexShader4(); // 17
|
|
PixelShader = compile ps_2_0 CubeFace4_PixelShader3(); // 18
|
|
ZEnable = 0;
|
|
ZWriteEnable = 0;
|
|
CullMode = 1;
|
|
AlphaTestEnable = 0;
|
|
AlphaBlendEnable = 0;
|
|
}
|
|
}
|
|
|
|
technique CubeFace5
|
|
{
|
|
pass p0
|
|
{
|
|
VertexShader = compile vs_2_0 CubeFace5_VertexShader2(); // 19
|
|
PixelShader = compile ps_2_0 CubeFace5_PixelShader1(); // 20
|
|
ZEnable = 0;
|
|
ZWriteEnable = 0;
|
|
CullMode = 1;
|
|
AlphaTestEnable = 0;
|
|
AlphaBlendEnable = 0;
|
|
}
|
|
}
|
|
|