mirror of
https://github.com/cemu-project/cemu_graphic_packs.git
synced 2024-12-24 17:01:49 +01:00
15b1ff9522
added the smoke shaders of guardian explosion this time, although tbh might not need all of them to workaround the bug, just in case... (too lazy to check xD
343 lines
9.8 KiB
Plaintext
343 lines
9.8 KiB
Plaintext
#version 420
|
|
#extension GL_ARB_texture_gather : enable
|
|
// shader 8146394a1b1f1f28 // guardian explosion yellow smoke ps
|
|
uniform ivec4 uf_remappedPS[5];
|
|
uniform float uf_alphaTestRef;
|
|
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0x21048800 res 256x128x1 dim 1 tm: 4 format 0007 compSel: 0 1 1 1 mipView: 0x0 (num 0x9) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 0 0 0 border: 0
|
|
layout(binding = 1) uniform sampler2D textureUnitPS1;// Tex1 addr 0x2105e800 res 256x256x1 dim 1 tm: 4 format 001a compSel: 0 1 2 3 mipView: 0x0 (num 0x9) sliceView: 0x0 (num 0x1) Sampler1 ClampX/Y/Z: 2 2 0 border: 0
|
|
layout(binding = 2) uniform sampler2D textureUnitPS2;// Tex2 addr 0x210b5000 res 200x200x1 dim 1 tm: 4 format 0034 compSel: 0 0 0 0 mipView: 0x0 (num 0x8) sliceView: 0x0 (num 0x1) Sampler2 ClampX/Y/Z: 0 0 0 border: 0
|
|
layout(binding = 4) uniform sampler2D textureUnitPS4;// Tex4 addr 0xf4e91800 res 1280x720x1 dim 1 tm: 4 format 0806 compSel: 0 4 4 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler4 ClampX/Y/Z: 2 2 0 border: 0
|
|
layout(binding = 10) uniform samplerCubeArray textureUnitPS10;// Tex10 addr 0x3d568800 res 16x16x1 dim 3 tm: 4 format 0816 compSel: 0 1 2 5 mipView: 0x0 (num 0x2) sliceView: 0x0 (num 0x6) Sampler10 ClampX/Y/Z: 2 2 2 border: 1
|
|
layout(location = 0) in vec4 passParameterSem0;
|
|
layout(location = 1) in vec4 passParameterSem1;
|
|
layout(location = 2) in vec4 passParameterSem3;
|
|
layout(location = 3) in vec4 passParameterSem4;
|
|
layout(location = 4) in vec4 passParameterSem5;
|
|
layout(location = 5) in vec4 passParameterSem8;
|
|
layout(location = 6) in vec4 passParameterSem9;
|
|
layout(location = 7) in vec4 passParameterSem11;
|
|
layout(location = 8) in vec4 passParameterSem14;
|
|
layout(location = 9) in vec4 passParameterSem15;
|
|
layout(location = 10) in vec4 passParameterSem16;
|
|
layout(location = 0) out vec4 passPixelColor0;
|
|
uniform vec2 uf_fragCoordScale;
|
|
void redcCUBE(vec4 src0, vec4 src1, out vec3 stm, out int faceId)
|
|
{
|
|
// stm -> x .. s, y .. t, z .. MajorAxis*2.0
|
|
vec3 inputCoord = normalize(vec3(src1.y, src1.x, src0.x));
|
|
float rx = inputCoord.x;
|
|
float ry = inputCoord.y;
|
|
float rz = inputCoord.z;
|
|
if( abs(rx) > abs(ry) && abs(rx) > abs(rz) )
|
|
{
|
|
stm.z = rx*2.0;
|
|
stm.xy = vec2(ry,rz);
|
|
if( rx >= 0.0 )
|
|
{
|
|
faceId = 0;
|
|
}
|
|
else
|
|
{
|
|
faceId = 1;
|
|
}
|
|
}
|
|
else if( abs(ry) > abs(rx) && abs(ry) > abs(rz) )
|
|
{
|
|
stm.z = ry*2.0;
|
|
stm.xy = vec2(rx,rz);
|
|
if( ry >= 0.0 )
|
|
{
|
|
faceId = 2;
|
|
}
|
|
else
|
|
{
|
|
faceId = 3;
|
|
}
|
|
}
|
|
else //if( abs(rz) > abs(ry) && abs(rz) > abs(rx) )
|
|
{
|
|
stm.z = rz*2.0;
|
|
stm.xy = vec2(rx,ry);
|
|
if( rz >= 0.0 )
|
|
{
|
|
faceId = 4;
|
|
}
|
|
else
|
|
{
|
|
faceId = 5;
|
|
}
|
|
}
|
|
}
|
|
vec3 redcCUBEReverse(vec2 st, int faceId)
|
|
{
|
|
st.yx = st.xy;
|
|
vec3 v;
|
|
float majorAxis = 1.0;
|
|
if( faceId == 0 )
|
|
{
|
|
v.yz = (st-vec2(1.5))*(majorAxis*2.0);
|
|
v.x = 1.0;
|
|
}
|
|
else if( faceId == 1 )
|
|
{
|
|
v.yz = (st-vec2(1.5))*(majorAxis*2.0);
|
|
v.x = -1.0;
|
|
}
|
|
else if( faceId == 2 )
|
|
{
|
|
v.xz = (st-vec2(1.5))*(majorAxis*2.0);
|
|
v.y = 1.0;
|
|
}
|
|
else if( faceId == 3 )
|
|
{
|
|
v.xz = (st-vec2(1.5))*(majorAxis*2.0);
|
|
v.y = -1.0;
|
|
}
|
|
else if( faceId == 4 )
|
|
{
|
|
v.xy = (st-vec2(1.5))*(majorAxis*2.0);
|
|
v.z = 1.0;
|
|
}
|
|
else
|
|
{
|
|
v.xy = (st-vec2(1.5))*(majorAxis*2.0);
|
|
v.z = -1.0;
|
|
}
|
|
return v;
|
|
}
|
|
int clampFI32(int v)
|
|
{
|
|
if( v == 0x7FFFFFFF )
|
|
return floatBitsToInt(1.0);
|
|
else if( v == 0xFFFFFFFF )
|
|
return floatBitsToInt(0.0);
|
|
return floatBitsToInt(clamp(intBitsToFloat(v), 0.0, 1.0));
|
|
}
|
|
float mul_nonIEEE(float a, float b){ return min(a*b,min(abs(a)*3.40282347E+38F,abs(b)*3.40282347E+38F)); }
|
|
void main()
|
|
{
|
|
vec4 R0f = vec4(0.0);
|
|
vec4 R1f = vec4(0.0);
|
|
vec4 R2f = vec4(0.0);
|
|
vec4 R3f = vec4(0.0);
|
|
vec4 R4f = vec4(0.0);
|
|
vec4 R5f = vec4(0.0);
|
|
vec4 R6f = vec4(0.0);
|
|
vec4 R7f = vec4(0.0);
|
|
vec4 R8f = vec4(0.0);
|
|
vec4 R9f = vec4(0.0);
|
|
vec4 R10f = vec4(0.0);
|
|
vec4 R11f = vec4(0.0);
|
|
vec4 R123f = vec4(0.0);
|
|
vec4 R125f = vec4(0.0);
|
|
vec4 R126f = vec4(0.0);
|
|
vec4 R127f = vec4(0.0);
|
|
float backupReg0f, backupReg1f, backupReg2f, backupReg3f, backupReg4f;
|
|
vec4 PV0f = vec4(0.0), PV1f = vec4(0.0);
|
|
float PS0f = 0.0, PS1f = 0.0;
|
|
vec4 tempf = vec4(0.0);
|
|
float tempResultf;
|
|
int tempResulti;
|
|
ivec4 ARi = ivec4(0);
|
|
bool predResult = true;
|
|
vec3 cubeMapSTM;
|
|
int cubeMapFaceId;
|
|
float cubeMapArrayIndex10 = 0.0;
|
|
R0f = passParameterSem0;
|
|
R1f = passParameterSem1;
|
|
R2f = passParameterSem3;
|
|
R3f = passParameterSem4;
|
|
R4f = passParameterSem5;
|
|
R5f = passParameterSem8;
|
|
R6f = passParameterSem9;
|
|
R7f = passParameterSem11;
|
|
R8f = passParameterSem14;
|
|
R9f = passParameterSem15;
|
|
R10f = passParameterSem16;
|
|
R11f.xw = (texture(textureUnitPS0, R5f.xy).xw);
|
|
// 0
|
|
backupReg0f = R7f.z;
|
|
R123f.x = (R11f.x * 2.0 + -(1.0));
|
|
PV0f.x = R123f.x;
|
|
R127f.y = (1.5 * R4f.x + 0.5);
|
|
R7f.z = -(backupReg0f);
|
|
R123f.w = (R11f.w * 2.0 + -(1.0));
|
|
PV0f.w = R123f.w;
|
|
PS0f = 1.0 / R2f.w;
|
|
// 1
|
|
R4f.x = mul_nonIEEE(R2f.x, PS0f);
|
|
R126f.y = mul_nonIEEE(R3f.y, PV0f.w);
|
|
R127f.z = mul_nonIEEE(R3f.y, PV0f.x);
|
|
PV1f.z = R127f.z;
|
|
R4f.w = mul_nonIEEE(R2f.y, PS0f);
|
|
R11f.w = intBitsToFloat(uf_remappedPS[0].x);
|
|
PS1f = R11f.w;
|
|
// 2
|
|
redcCUBE(vec4(R7f.z,R7f.z,R7f.x,R7f.y),vec4(R7f.y,R7f.x,R7f.z,R7f.z),cubeMapSTM,cubeMapFaceId);
|
|
R125f.x = cubeMapSTM.x;
|
|
R125f.y = cubeMapSTM.y;
|
|
R125f.z = cubeMapSTM.z;
|
|
R125f.w = intBitsToFloat(cubeMapFaceId);
|
|
PV0f.x = R125f.x;
|
|
PV0f.y = R125f.y;
|
|
PV0f.z = R125f.z;
|
|
PV0f.w = R125f.w;
|
|
PS0f = mul_nonIEEE(PV1f.z, R127f.y);
|
|
// 3
|
|
backupReg0f = R6f.x;
|
|
R6f.x = R5f.z + PS0f;
|
|
R7f.y = R6f.y + R126f.y;
|
|
PV1f.z = mul_nonIEEE(R126f.y, R127f.y);
|
|
R7f.w = backupReg0f + R127f.z;
|
|
PS1f = 1.0 / abs(PV0f.z);
|
|
// 4
|
|
R5f.x = (R0f.x * 1.5 + -(R0f.x));
|
|
R6f.y = R5f.w + PV1f.z;
|
|
R123f.z = (mul_nonIEEE(R125f.y,PS1f) + 1.5);
|
|
PV0f.z = R123f.z;
|
|
R123f.w = (mul_nonIEEE(R125f.x,PS1f) + 1.5);
|
|
PV0f.w = R123f.w;
|
|
R11f.z = R125f.w;
|
|
PS0f = R11f.z;
|
|
// 5
|
|
R11f.x = PV0f.z;
|
|
R11f.y = PV0f.w;
|
|
R5f.z = (R0f.y * 1.5 + -(R0f.y));
|
|
R3f.w = (R0f.z * 1.5 + -(R0f.z));
|
|
R5f.w = 1.0 / R2f.w;
|
|
PS1f = R5f.w;
|
|
R4f.x = (texture(textureUnitPS4, R4f.xw).x);
|
|
R6f.xyzw = (texture(textureUnitPS1, R6f.xy).xyzw);
|
|
R11f.xyz = (textureLod(textureUnitPS10, vec4(redcCUBEReverse(R11f.xy,floatBitsToInt(R11f.z)),cubeMapArrayIndex10),R11f.w).xyz);
|
|
R7f.y = (texture(textureUnitPS2, R7f.wy).w);
|
|
// 0
|
|
backupReg0f = R0f.z;
|
|
R125f.x = R0f.x;
|
|
R125f.x /= 2.0;
|
|
R127f.y = (mul_nonIEEE(intBitsToFloat(uf_remappedPS[1].w),R4f.x) + intBitsToFloat(uf_remappedPS[1].x));
|
|
PV0f.z = R2f.z * R5f.w;
|
|
R125f.w = R0f.y;
|
|
R125f.w /= 2.0;
|
|
R125f.y = backupReg0f;
|
|
R125f.y /= 2.0;
|
|
PS0f = R125f.y;
|
|
// 1
|
|
R123f.x = (mul_nonIEEE(R5f.x,R6f.x) + R0f.x);
|
|
PV1f.x = R123f.x;
|
|
R123f.y = (mul_nonIEEE(PV0f.z,intBitsToFloat(uf_remappedPS[1].w)) + -(intBitsToFloat(uf_remappedPS[1].y)));
|
|
PV1f.y = R123f.y;
|
|
R123f.z = (mul_nonIEEE(R3f.w,R6f.x) + R0f.z);
|
|
PV1f.z = R123f.z;
|
|
R123f.w = (mul_nonIEEE(R5f.z,R6f.x) + R0f.y);
|
|
PV1f.w = R123f.w;
|
|
R127f.x = R11f.y * 1.0;
|
|
PS1f = R127f.x;
|
|
// 2
|
|
R123f.x = (mul_nonIEEE(R125f.w,R6f.y) + PV1f.w);
|
|
PV0f.x = R123f.x;
|
|
R123f.y = (mul_nonIEEE(R125f.x,R6f.y) + PV1f.x);
|
|
PV0f.y = R123f.y;
|
|
R125f.z = R11f.x * 1.0;
|
|
R123f.w = (mul_nonIEEE(R125f.y,R6f.y) + PV1f.z);
|
|
PV0f.w = R123f.w;
|
|
PS0f = 1.0 / PV1f.y;
|
|
// 3
|
|
R125f.x = R11f.z * 1.0;
|
|
R125f.y = mul_nonIEEE(R1f.y, PV0f.x);
|
|
R127f.z = mul_nonIEEE(R1f.x, PV0f.y);
|
|
R125f.w = -(intBitsToFloat(uf_remappedPS[1].z)) * PS0f;
|
|
PV1f.w = R125f.w;
|
|
R126f.x = mul_nonIEEE(R1f.z, PV0f.w);
|
|
PS1f = R126f.x;
|
|
// 4
|
|
backupReg0f = R8f.x;
|
|
backupReg1f = R8f.y;
|
|
R8f.x = backupReg0f + 0.0;
|
|
R8f.y = R8f.z + 0.0;
|
|
R11f.z = backupReg1f + 0.0;
|
|
PV0f.w = -(PV1f.w) + R127f.y;
|
|
R8f.z = (mul_nonIEEE(R125f.z,intBitsToFloat(uf_remappedPS[2].y)) + 0.0);
|
|
PS0f = R8f.z;
|
|
// 5
|
|
R0f.x = (mul_nonIEEE(R125f.x,intBitsToFloat(uf_remappedPS[2].y)) + 0.0);
|
|
R0f.y = (mul_nonIEEE(R127f.x,intBitsToFloat(uf_remappedPS[2].y)) + 0.0);
|
|
R123f.z = (PV0f.w * intBitsToFloat(0x3d4ccccd) + intBitsToFloat(0xbd4ccccd));
|
|
R123f.z = clamp(R123f.z, 0.0, 1.0);
|
|
PV1f.z = R123f.z;
|
|
R123f.w = (R0f.w * 2.0 + -(1.0));
|
|
PV1f.w = R123f.w;
|
|
PS1f = -(R6f.z) + 1.0;
|
|
// 6
|
|
R123f.x = (intBitsToFloat(0x3ecccccc) * PV1f.z + intBitsToFloat(0x3f19999a));
|
|
PV0f.x = R123f.x;
|
|
PV0f.y = R125f.w + PS1f;
|
|
PV0f.w = R7f.y + PV1f.w;
|
|
// 7
|
|
PV1f.x = mul_nonIEEE(R6f.w, PV0f.w);
|
|
R6f.y = mul_nonIEEE(R127f.z, PV0f.x);
|
|
R6f.z = mul_nonIEEE(R126f.x, PV0f.x);
|
|
R6f.w = mul_nonIEEE(R125f.y, PV0f.x);
|
|
PS1f = R127f.y + -(PV0f.y);
|
|
PS1f = clamp(PS1f, 0.0, 1.0);
|
|
// 8
|
|
PV0f.x = PS1f;
|
|
PV0f.x *= 4.0;
|
|
PV0f.x = clamp(PV0f.x, 0.0, 1.0);
|
|
PV0f.y = mul_nonIEEE(R1f.w, PV1f.x);
|
|
PV0f.y = clamp(PV0f.y, 0.0, 1.0);
|
|
// 9
|
|
PV1f.x = mul_nonIEEE(PV0f.y, PV0f.x);
|
|
PV1f.x = clamp(PV1f.x, 0.0, 1.0);
|
|
// 10
|
|
R3f.w = mul_nonIEEE(R3f.x, PV1f.x);
|
|
// 0
|
|
R123f.y = (mul_nonIEEE(intBitsToFloat(uf_remappedPS[0].w),R0f.x) + R8f.y);
|
|
PV0f.y = R123f.y;
|
|
R123f.z = (mul_nonIEEE(intBitsToFloat(uf_remappedPS[0].w),R0f.y) + R11f.z);
|
|
PV0f.z = R123f.z;
|
|
R123f.w = (mul_nonIEEE(intBitsToFloat(uf_remappedPS[0].w),R8f.z) + R8f.x);
|
|
PV0f.w = R123f.w;
|
|
// 1
|
|
R126f.x = mul_nonIEEE(R6f.y, PV0f.w);
|
|
PV1f.x = R126f.x;
|
|
R127f.z = mul_nonIEEE(R6f.z, PV0f.y);
|
|
PV1f.z = R127f.z;
|
|
R125f.w = mul_nonIEEE(R6f.w, PV0f.z);
|
|
PV1f.w = R125f.w;
|
|
// 2
|
|
PV0f.x = -(PV1f.w) + intBitsToFloat(uf_remappedPS[3].y);
|
|
PV0f.y = -(PV1f.x) + intBitsToFloat(uf_remappedPS[3].x);
|
|
PV0f.w = -(PV1f.z) + intBitsToFloat(uf_remappedPS[3].z);
|
|
// 3
|
|
backupReg0f = R126f.x;
|
|
R126f.x = (mul_nonIEEE(PV0f.w,R10f.y) + R127f.z);
|
|
PV1f.x = R126f.x;
|
|
R127f.y = (mul_nonIEEE(PV0f.x,R10f.y) + R125f.w);
|
|
PV1f.y = R127f.y;
|
|
R127f.z = (mul_nonIEEE(PV0f.y,R10f.y) + backupReg0f);
|
|
PV1f.z = R127f.z;
|
|
// 4
|
|
PV0f.y = R9f.z + -(PV1f.x);
|
|
PV0f.z = R9f.y + -(PV1f.y);
|
|
PV0f.w = R9f.x + -(PV1f.z);
|
|
// 5
|
|
backupReg0f = R126f.x;
|
|
R126f.x = (mul_nonIEEE(PV0f.w,R9f.w) + R127f.z);
|
|
PV1f.x = R126f.x;
|
|
R127f.z = (mul_nonIEEE(PV0f.y,R9f.w) + backupReg0f);
|
|
PV1f.z = R127f.z;
|
|
R125f.w = (mul_nonIEEE(PV0f.z,R9f.w) + R127f.y);
|
|
PV1f.w = R125f.w;
|
|
// 6
|
|
PV0f.x = -(PV1f.w) + intBitsToFloat(uf_remappedPS[4].y);
|
|
PV0f.y = -(PV1f.x) + intBitsToFloat(uf_remappedPS[4].x);
|
|
PV0f.w = -(PV1f.z) + intBitsToFloat(uf_remappedPS[4].z);
|
|
// 7
|
|
R3f.x = (mul_nonIEEE(PV0f.y,R10f.x) + R126f.x);
|
|
R3f.y = (mul_nonIEEE(PV0f.x,R10f.x) + R125f.w);
|
|
R3f.z = (mul_nonIEEE(PV0f.w,R10f.x) + R127f.z);
|
|
// export
|
|
if( ((vec4(R3f.x, R3f.y, R3f.z, R3f.w)).a > uf_alphaTestRef) == false) discard;
|
|
passPixelColor0 = vec4(R3f.x, R3f.y, R3f.z, R3f.w);
|
|
}
|