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

478 lines
17 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;>;
struct
{
float4 VideoTex_NumPerRow_LastFrame_SingleRow_isRand;
float4 ColorAnimationFunctions[6];
float4 TimeKeys;
int ShaderType;
float SpeedMultiplier;
float2 ColorScaleRange;
} Draw : register(vs_3_0, c39) <string UIWidget = "None"; string SasBindAddress = "Particle.Draw";> = { 4, 15, -1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, -0.1, 0.2 };
struct
{
float3 Gravity;
float3 DriftVelocity;
float2 VelocityDampingRange;
} Physics : register(vs_3_0, c60) <string UIWidget = "None"; string SasBindAddress = "Particle.Physics";> = { 0, 0, 0, 0, 0, 0, 1, 0 };
struct
{
float3 Size_Rate_Damping__Min;
float3 Size_Rate_Damping__Spread;
float3 XYRotation_Rate_Damping__Min;
float3 XYRotation_Rate_Damping__Spread;
float3 ZRotation_Rate_Damping__Min;
float3 ZRotation_Rate_Damping__Spread;
} Update : register(vs_3_0, c50) <string UIWidget = "None"; string SasBindAddress = "Particle.Update";> = { 0, 0, 1, 10, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0 };
int _SasGlobal : SasGlobal <string UIWidget = "None"; int3 SasVersion = int3(1, 0, 0); string RenderBin = "OceanDisplacement";>;
texture NormalTexture <string UIWidget = "None"; string SasBindAddress = "Particle.Draw.Texture";>; // 10
sampler2D NormalTextureSampler : register(ps_3_0, s0) <string Texture = "NormalTexture"; string UIWidget = "None"; string SasBindAddress = "Particle.Draw.Texture";> =
sampler_state
{
Texture = <NormalTexture>; // 13
MinFilter = 2;
MagFilter = 2;
MipFilter = 2;
AddressU = 1;
AddressV = 1;
};
float4 ParticleMiscValues : register(vs_3_0, c66) <string UIWidget = "None"; string SasBindAddress = "Particle.Draw.MiscValues";> = { 1, 1, 1, 1 };
column_major float4x4 WorldViewProjection : WorldViewProjection : register(vs_3_0, c56);
float Time : Time;
// Default_M_PixelShader1 Pixel_3_0 Has PRES False
struct Default_M_PixelShader1_Input
{
float2 texcoord : TEXCOORD;
float4 texcoord1 : TEXCOORD1;
};
float4 Default_M_PixelShader1(Default_M_PixelShader1_Input i) : COLOR
{
float4 out_color;
float4 temp0, temp1;
// def c0, 1, 0, 0, 0
// dcl_texcoord v0.xy
// dcl_texcoord1 v1.w
// dcl_2d s0
// texld r0, v0, s0
temp0 = tex2D(NormalTextureSampler, i.texcoord.xy);
// mul r1, c0.xxxy, v1.w
temp1 = float4(1, 1, 1, 0) * i.texcoord1.w;
// mul oC0, r0, r1
out_color = temp0 * temp1;
//
return out_color;
}
// Default_M_VertexShader2 Vertex_3_0 Has PRES True
struct Default_M_VertexShader2_Input
{
float4 position : POSITION;
float4 texcoord : TEXCOORD;
float4 texcoord1 : TEXCOORD1;
};
struct Default_M_VertexShader2_Output
{
float4 position : POSITION;
float2 texcoord : TEXCOORD;
float4 texcoord1 : TEXCOORD1;
};
Default_M_VertexShader2_Output Default_M_VertexShader2(Default_M_VertexShader2_Input i)
{
/*
PRSI
OutputRegisterOffset: 63
Unknown1: 0
Unknown2: 0
OutputRegisterCount: 3
Unknown3: 0
Unknown4: 0
Unknown5: 63
Unknown6: 3
Mappings: 1
0 - ConstOutput: 0 ConstInput 0
*/
float4 expr63;
float4 expr64;
float4 expr65;
{
// Expression_2_1
// mul c63.x, c1.x, (30)
expr63.x = Time.x * (30);
// rcp c64.x, c0.y
expr64.x = 1.0f / (Draw.VideoTex_NumPerRow_LastFrame_SingleRow_isRand.y);
// rcp c65.x, c0.x
expr65.x = 1.0f / (Draw.VideoTex_NumPerRow_LastFrame_SingleRow_isRand.x);
}
Default_M_VertexShader2_Output o;
float4 temp0, temp1, addr0, temp2, temp3, temp4;
// def c28, 0.5, -0.5, 16, -1
// def c36, 1.375, 2.0625, 8.9375, 6.1875
// def c30, -0.5, 0.5, 0.1591549, 0
// def c31, 0, 0, 6.283185, -3.141593
// def c37, 0.1875, 4.8125, 2.75, 0
// def c38, 1, -1, 0.5, 0
// def c29, 0.5, 0.5, 1.0001, 0.6931472
// def c27, -0.5, -0.5, 0, 0.1875
// def c11, 0.957897, 0.3788705, 0.3635719, 0.3287609
// def c12, 0.1762373, 0.9145751, 0.4360935, 0.3476284
// def c13, 0.743219, 0.4425611, 0.9974546, 0.3622138
// def c14, 0.4896626, 0.6664233, 0.8305699, 0.9742577
// def c15, 0.8947675, 0.8236215, 0.9309705, 0.05219847
// def c16, 0.1411007, 0.6527002, 0.008452523, 0.6430574
// def c17, 0.229799, 0.897999, 0.753822, 0.1316504
// def c18, 0.5815384, 0.2836916, 0.09156471, 0.407481
// def c19, 0.2706044, 0.7228181, 0.1694367, 0.1469052
// def c20, 0.5995556, 0.0964533, 0.8763983, 0.1172229
// def c21, 0.5101711, 0.9421572, 0.1957888, 0.9167565
// def c22, 0.03546793, 0.5340094, 0.1673218, 0.5576764
// def c23, 0.861564, 0.2251601, 0.082332, 0.8790039
// def c24, 0.1730866, 0.8935188, 0.01392406, 0.1787381
// def c25, 0.8269383, 0.7718143, 0.4395359, 0.493963
// def c26, 0.5423613, 0.7218617, 0.7697314, 0.5878567
// def c32, -0.25, -0.25, 0, 0
// def c33, 0.25, -0.25, 0, 0
// def c34, 0.25, 0.25, 0, 0
// def c35, -0.25, 0.25, 0, 0
// dcl_position v0
// dcl_texcoord v1
// dcl_texcoord1 v2
// dcl_position o0
// dcl_texcoord o1.xy
// dcl_texcoord1 o2
// mov r0.w, c27.w
temp0.w = float1(0.1875);
// mad r0, v2.x, r0.w, c36
temp0 = i.texcoord1.x * temp0.w + float4(1.375, 2.0625, 8.9375, 6.1875);
// frc r0, r0
temp0 = frac(temp0);
// mul r0, r0, c28.z
temp0 = temp0 * float4(16, 16, 16, 16);
// frc r1, r0
temp1 = frac(temp0);
// add r0, r0, -r1
temp0 = temp0 + -temp1;
// mova a0, r0
addr0 = temp0;
// mov r0.xyz, c11[a0.x]
temp0.xyz = float3(0.957897, 0.37887052, 0.36357188);
// mov r1.xyz, c55
temp1.xyz = Update.ZRotation_Rate_Damping__Spread.xyz;
// mad r0.xyz, r0, r1, c54
temp0.xyz = temp0.xyz * temp1.xyz + Update.ZRotation_Rate_Damping__Min.xyz;
// add r0.w, r0.z, c28.w
temp0.w = temp0.z + float1(-1);
// sge r0.w, -r0_abs.w, r0_abs.w
temp0.w = (r0.w == 0) ? 1 : 0;
// lrp r1.x, r0.w, c29.z, r0.z
temp1.x = lerp(temp0.z, float1(1.0001), temp0.w);
// log r0.z, r1.x
temp0.z = log2(temp1.x);
// mul r0.w, r0.z, c29.w
temp0.w = temp0.z * float1(0.6931472);
// rcp r0.w, r0.w
temp0.w = 1.0f / temp0.w;
// add r1.x, c63.x, -v1.w
temp1.x = expr63.x + -i.texcoord.w;
// mul r0.z, r0.z, r1.x
temp0.z = temp0.z * temp1.x;
// exp r0.z, r0.z
temp0.z = exp2(temp0.z);
// add r0.z, r0.z, c28.w
temp0.z = temp0.z + float1(-1);
// mul r0.z, r0.w, r0.z
temp0.z = temp0.w * temp0.z;
// mad r0.x, r0.y, r0.z, r0.x
temp0.x = temp0.y * temp0.z + temp0.x;
// mad r0.x, r0.x, c30.z, c30.y
temp0.x = temp0.x * float1(0.15915494) + float1(0.5);
// frc r0.x, r0.x
temp0.x = frac(temp0.x);
// mad r0.x, r0.x, c31.z, c31.w
temp0.x = temp0.x * float1(6.2831855) + float1(-3.1415927);
// sincos r2.xy, r0.x
temp2.xy = float2(cos(temp0.x), sin(temp0.x));
// mul r0.xyz, r2.xyxw, v1.xyyw
temp0.xyz = temp2.xyx * i.texcoord.xyy;
// mad r0.w, v1.x, -r2.y, r0.z
temp0.w = i.texcoord.x * -temp2.y + temp0.z;
// add r0.z, r0.y, r0.x
temp0.z = temp0.y + temp0.x;
// mov r0.xy, c62
temp0.xy = Physics.VelocityDampingRange.xy;
// mad r0.x, c11[a0.z].x, r0.y, r0.x
temp0.x = float1(0.957897) * temp0.y + temp0.x;
// add r0.y, r0.x, c28.w
temp0.y = temp0.x + float1(-1);
// sge r0.y, -r0_abs.y, r0_abs.y
temp0.y = (r0.y == 0) ? 1 : 0;
// lrp r1.y, r0.y, c29.z, r0.x
temp1.y = lerp(temp0.x, float1(1.0001), temp0.y);
// log r0.x, r1.y
temp0.x = log2(temp1.y);
// mul r0.y, r0.x, c29.w
temp0.y = temp0.x * float1(0.6931472);
// mul r0.x, r1.x, r0.x
temp0.x = temp1.x * temp0.x;
// rcp r0.y, r0.y
temp0.y = 1.0f / temp0.y;
// exp r0.x, r0.x
temp0.x = exp2(temp0.x);
// add r0.x, r0.x, c28.w
temp0.x = temp0.x + float1(-1);
// mul r0.x, r0.y, r0.x
temp0.x = temp0.y * temp0.x;
// mad r1.yzw, r0.xzww, r0.x, v0.xxyy
temp1.yzw = temp0.zww * temp0.xxx + i.position.xyy;
// mul r0.x, r1.x, -c27.x
temp0.x = temp1.x * float1(0.5);
// mov r2.xy, c60
temp2.xy = Physics.Gravity.xy;
// mad r2.xyz, r0.x, r2.xyyw, c61.xyyw
temp2.xyz = temp0.xxx * temp2.xyy + Physics.DriftVelocity.xyy;
// mad r1.yzw, r2.xxyz, r1.x, r1
temp1.yzw = temp2.xyz * temp1.xxx + temp1.yzw;
// add r1.yzw, r1, -v0.xxyy
temp1.yzw = temp1.yzw + -i.position.xyy;
// mov r2.xyz, c11[a0.w]
temp2.xyz = float3(0.957897, 0.37887052, 0.36357188);
// mov r3.xyz, c53
temp3.xyz = Update.XYRotation_Rate_Damping__Spread.xyz;
// mad r2.xyz, r2, r3, c52
temp2.xyz = temp2.xyz * temp3.xyz + Update.XYRotation_Rate_Damping__Min.xyz;
// mov r3.xyz, c11[a0.y]
temp3.xyz = float3(0.957897, 0.37887052, 0.36357188);
// mov r4.xyz, c51
temp4.xyz = Update.Size_Rate_Damping__Spread.xyz;
// mad r3.xyz, r3, r4, c50
temp3.xyz = temp3.xyz * temp4.xyz + Update.Size_Rate_Damping__Min.xyz;
// add r0.x, r2.z, c28.w
temp0.x = temp2.z + float1(-1);
// sge r0.x, -r0_abs.x, r0_abs.x
temp0.x = (r0.x == 0) ? 1 : 0;
// lrp r3.w, r0.x, c29.z, r2.z
temp3.w = lerp(temp2.z, float1(1.0001), temp0.x);
// log r0.x, r3.w
temp0.x = log2(temp3.w);
// mul r0.y, r0.x, c29.w
temp0.y = temp0.x * float1(0.6931472);
// mul r0.x, r1.x, r0.x
temp0.x = temp1.x * temp0.x;
// rcp r0.y, r0.y
temp0.y = 1.0f / temp0.y;
// exp r0.x, r0.x
temp0.x = exp2(temp0.x);
// add r0.x, r0.x, c28.w
temp0.x = temp0.x + float1(-1);
// mul r0.x, r0.y, r0.x
temp0.x = temp0.y * temp0.x;
// mad r0.x, r2.y, r0.x, r2.x
temp0.x = temp2.y * temp0.x + temp2.x;
// mad r0.x, r0.x, c30.z, c30.y
temp0.x = temp0.x * float1(0.15915494) + float1(0.5);
// frc r0.x, r0.x
temp0.x = frac(temp0.x);
// mad r0.x, r0.x, c31.z, c31.w
temp0.x = temp0.x * float1(6.2831855) + float1(-3.1415927);
// sincos r2.xy, r0.x
temp2.xy = float2(cos(temp0.x), sin(temp0.x));
// mul r2.xzw, r1.yyzw, r2.xyyx
temp2.xzw = temp1.yzw * temp2.xyx;
// mad r0.y, r1.y, -r2.y, r2.w
temp0.y = temp1.y * -temp2.y + temp2.w;
// add r0.x, r2.z, r2.x
temp0.x = temp2.z + temp2.x;
// add r0.xy, r0, v0
temp0.xy = temp0.xy + i.position.xy;
// mul r1.yz, r0.xzww, r0.xzww
temp1.yz = temp0.zw * temp0.zw;
// add r1.y, r1.z, r1.y
temp1.y = temp1.z + temp1.y;
// rsq r1.y, r1.y
temp1.y = 1 / sqrt(temp1.y);
// mul r1.yz, r0.xzww, r1.y
temp1.yz = temp0.zw * temp1.yy;
// mov r1.w, -r1.z
temp1.w = -temp1.z;
// slt r0.z, v0.w, r1.x
temp0.z = (i.position.w < temp1.x) ? 1 : 0;
// mad r0.z, r0.z, -v2.y, v2.y
temp0.z = temp0.z * -i.texcoord1.y + i.texcoord1.y;
// frc r0.w, r0.z
temp0.w = frac(temp0.z);
// add r0.z, r0.z, -r0.w
temp0.z = temp0.z + -temp0.w;
// mova a0.x, r0.z
addr0.x = temp0.z;
// mul r2, r1.wyyz, c27[a0.x].xxyy
temp2 = temp1.wyyz * float4(-0.5, -0.5, -0.5, -0.5);
// mov r4.xy, c27[a0.x]
temp4.xy = float2(-0.5, -0.5);
// mad r0.zw, r4.xyxy, c38.xyxy, c38.z
temp0.zw = temp4.xy * float2(1, -1) + float2(0.5, 0.5);
// mad r1.yz, r2.xxyw, c66.x, r2.xzww
temp1.yz = temp2.xy * ParticleMiscValues.xx + temp2.zw;
// add r1.w, r3.z, c28.w
temp1.w = temp3.z + float1(-1);
// sge r1.w, -r1_abs.w, r1_abs.w
temp1.w = (r1.w == 0) ? 1 : 0;
// lrp r2.x, r1.w, c29.z, r3.z
temp2.x = lerp(temp3.z, float1(1.0001), temp1.w);
// log r1.w, r2.x
temp1.w = log2(temp2.x);
// mul r2.x, r1.w, c29.w
temp2.x = temp1.w * float1(0.6931472);
// mul r1.w, r1.x, r1.w
temp1.w = temp1.x * temp1.w;
// rcp r2.x, r2.x
temp2.x = 1.0f / temp2.x;
// exp r1.w, r1.w
temp1.w = exp2(temp1.w);
// add r1.w, r1.w, c28.w
temp1.w = temp1.w + float1(-1);
// mul r1.w, r2.x, r1.w
temp1.w = temp2.x * temp1.w;
// mad r1.w, r3.y, r1.w, r3.x
temp1.w = temp3.y * temp1.w + temp3.x;
// mad r1.yz, r1.w, r1, r0.xxyw
temp1.yz = temp1.ww * temp1.yz + temp0.xy;
// mov r1.w, -c28.w
temp1.w = float1(1);
// dp3 o0.x, r1.yzww, c56.xyww
o.position.x = dot(temp1.yzw, (WorldViewProjection._m00_m10_m20_m30).xyw);
// dp3 o0.y, r1.yzww, c57.xyww
o.position.y = dot(temp1.yzw, (WorldViewProjection._m01_m11_m21_m31).xyw);
// dp3 o0.z, r1.yzww, c58.xyww
o.position.z = dot(temp1.yzw, (WorldViewProjection._m02_m12_m22_m32).xyw);
// dp3 o0.w, r1.yzww, c59.xyww
o.position.w = dot(temp1.yzw, (WorldViewProjection._m03_m13_m23_m33).xyw);
// mad r0.xy, v2.x, c37.x, c37.yzzw
temp0.xy = i.texcoord1.xx * float2(0.1875, 0.1875) + float2(4.8125, 2.75);
// frc r0.xy, r0
temp0.xy = frac(temp0.xy);
// mul r0.xy, r0, c28.z
temp0.xy = temp0.xy * float2(16, 16);
// frc r1.yz, r0.xxyw
temp1.yz = frac(temp0.xy);
// add r0.xy, r0, -r1.yzzw
temp0.xy = temp0.xy + -temp1.yz;
// mova a0.xy, r0
addr0.xy = temp0.xy;
// mov r0.y, c39.y
temp0.y = Draw.VideoTex_NumPerRow_LastFrame_SingleRow_isRand.y;
// mul r0.x, r0.y, c11[a0.x].x
temp0.x = temp0.y * float1(0.957897);
// frc r0.x, r0.x
temp0.x = frac(temp0.x);
// mad r0.x, c11[a0.x].x, r0.y, -r0.x
temp0.x = float1(0.957897) * temp0.y + -temp0.x;
// mov r2.xy, c49
temp2.xy = Draw.ColorScaleRange.xy;
// mad r0.y, c11[a0.y].x, r2.y, r2.x
temp0.y = float1(0.957897) * temp2.y + temp2.x;
// mad r0.x, r1.x, c48.x, r0.x
temp0.x = temp1.x * Draw.SpeedMultiplier.x + temp0.x;
// mul r0.x, r0.x, c64.x
temp0.x = temp0.x * expr64.x;
// frc r1.y, r0_abs.x
temp1.y = frac(abs(temp0).x);
// sge r0.x, r0.x, -r0.x
temp0.x = (temp0.x >= -temp0.x) ? 1 : 0;
// lrp r2.x, r0.x, r1.y, -r1.y
temp2.x = lerp(-temp1.y, temp1.y, temp0.x);
// mul r0.x, r2.x, c39.y
temp0.x = temp2.x * Draw.VideoTex_NumPerRow_LastFrame_SingleRow_isRand.y;
// mul r1.z, r0.x, c65.x
temp1.z = temp0.x * expr65.x;
// frc r0.x, r1_abs.z
temp0.x = frac(abs(temp1).z);
// sge r1.w, r1.z, -r1.z
temp1.w = (temp1.z >= -temp1.z) ? 1 : 0;
// lrp r2.x, r1.w, r0.x, -r0.x
temp2.x = lerp(-temp0.x, temp0.x, temp1.w);
// mul r1.y, r2.x, c39.x
temp1.y = temp2.x * Draw.VideoTex_NumPerRow_LastFrame_SingleRow_isRand.x;
// frc r2.xy, r1.yzzw
temp2.xy = frac(temp1.yz);
// add r1.yz, r1, -r2.xxyw
temp1.yz = temp1.yz + -temp2.xy;
// add r0.xz, r0.zyww, r1.yyzw
temp0.xz = temp0.zw + temp1.yz;
// mul o1.xy, r0.xzzw, c65.x
o.texcoord = temp0.xzzw * expr65.x;
// rcp r0.x, v0.w
temp0.x = 1.0f / i.position.w;
// mul r0.x, r1.x, r0.x
temp0.x = temp1.x * temp0.x;
// mov r1, c42
temp1 = Draw.ColorAnimationFunctions[2];
// mad r1, r1, r0.x, c43
temp1 = temp1 * temp0.x + Draw.ColorAnimationFunctions[3];
// mov r2, c44
temp2 = Draw.ColorAnimationFunctions[4];
// mad r2, r2, r0.x, c45
temp2 = temp2 * temp0.x + Draw.ColorAnimationFunctions[5];
// slt r0.zw, r0.x, c46.xyyz
temp0.zw = (temp0.xx < Draw.TimeKeys.yz) ? 1 : 0;
// mov r3, c40
temp3 = Draw.ColorAnimationFunctions[0];
// mad r3, r3, r0.x, c41
temp3 = temp3 * temp0.x + Draw.ColorAnimationFunctions[1];
// lrp r4, r0.w, r1, r2
temp4 = lerp(temp2, temp1, temp0.w);
// lrp r1, r0.z, r3, r4
temp1 = lerp(temp4, temp3, temp0.z);
// mul o2, r0.y, r1
o.texcoord1 = temp0.y * temp1;
//
return o;
}
technique Default_M
{
pass P0
{
VertexShader = compile vs_3_0 Default_M_VertexShader2(); // 19
PixelShader = compile ps_3_0 Default_M_PixelShader1(); // 20
ZEnable = 0;
ZWriteEnable = 0;
CullMode = 1;
AlphaBlendEnable = 1;
SrcBlend = 2;
DestBlend = 2;
AlphaTestEnable = 0;
}
}
technique Default_L
{
}