cemu_graphic_packs/Modifications/BreathOfTheWild_!Monochromia/53422d4f43914447_0000000000000079_ps.txt
Michael c854a5eea0 [Monochromia] Change priority
Fixes colored cloud issue
2018-04-01 22:57:21 -07:00

129 lines
4.3 KiB
Plaintext

#version 420
#extension GL_ARB_texture_gather : enable
// shader 53422d4f43914447
// Monochromia
// Sky
// original shader dumped using cemu 1.11.0c, BotW 1.3.1
uniform ivec4 uf_remappedPS[5];
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0x3da26000 res 256x256x1 dim 1 tm: 4 format 0820 compSel: 0 1 2 3 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 1
layout(location = 0) in vec4 passParameterSem0;
layout(location = 1) in vec4 passParameterSem6;
layout(location = 0) out vec4 passPixelColor0;
uniform vec2 uf_fragCoordScale;
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){ if( a == 0.0 || b == 0.0 ) return 0.0; return a*b; }
void main()
{
vec4 R0f = vec4(0.0);
vec4 R1f = vec4(0.0);
vec4 R2f = vec4(0.0);
vec4 R123f = 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;
R0f = passParameterSem0;
R1f = passParameterSem6;
// 0
tempf.x = dot(vec4(R1f.x,R1f.y,R1f.z,-0.0),vec4(R1f.x,R1f.y,R1f.z,0.0));
PV0f.x = tempf.x;
PV0f.y = tempf.x;
PV0f.z = tempf.x;
PV0f.w = tempf.x;
R126f.x = intBitsToFloat(uf_remappedPS[0].z) + -(intBitsToFloat(uf_remappedPS[0].w));
PS0f = R126f.x;
// 1
R2f.w = 1.0;
tempResultf = 1.0 / sqrt(PV0f.x);
PS1f = tempResultf;
// 2
PV0f.x = mul_nonIEEE(R1f.x, PS1f);
R127f.y = mul_nonIEEE(R1f.y, PS1f);
PV0f.y = R127f.y;
PV0f.z = mul_nonIEEE(R1f.z, PS1f);
// 3
tempf.x = dot(vec4(intBitsToFloat(uf_remappedPS[1].x),intBitsToFloat(uf_remappedPS[1].y),intBitsToFloat(uf_remappedPS[1].z),-0.0),vec4(PV0f.x,PV0f.y,PV0f.z,0.0));
tempf.x /= 2.0;
PV1f.x = tempf.x;
PV1f.y = tempf.x;
PV1f.z = tempf.x;
PV1f.w = tempf.x;
PS1f = PV0f.y;
PS1f /= 2.0;
// 4
R127f.x = PV1f.x + 0.5;
PV0f.x = R127f.x;
PV0f.y = R127f.y;
PV0f.y = clamp(PV0f.y, 0.0, 1.0);
R1f.z = PS1f + 0.5;
// 5
R123f.x = (PV0f.x * intBitsToFloat(0xbc996e30) + intBitsToFloat(0x3d981626));
PV1f.x = R123f.x;
PV1f.w = -(PV0f.x) + 1.0;
tempResultf = log2(PV0f.y);
if( isinf(tempResultf) == true ) tempResultf = -3.40282347E+38F;
PS1f = tempResultf;
// 6
PV0f.x = mul_nonIEEE(PS1f, intBitsToFloat(uf_remappedPS[0].y));
R123f.z = (mul_nonIEEE(R127f.x,PV1f.x) + intBitsToFloat(0xbe593484));
PV0f.z = R123f.z;
PS0f = sqrt(PV1f.w);
// 7
PV1f.x = PS0f * intBitsToFloat(0x3f22f983);
R123f.y = (mul_nonIEEE(R127f.x,PV0f.z) + intBitsToFloat(0x3fc90da4));
PV1f.y = R123f.y;
PS1f = exp2(PV0f.x);
// 8
R1f.x = (mul_nonIEEE(PV1f.x,-(PV1f.y)) + 1.0);
R0f.w = (mul_nonIEEE(R126f.x,PS1f) + intBitsToFloat(uf_remappedPS[0].w));
R1f.xyzw = (texture(textureUnitPS0, R1f.xz).xyzw);
// 0
R126f.x = R1f.w + intBitsToFloat(uf_remappedPS[2].w);
R126f.x = clamp(R126f.x, 0.0, 1.0);
R127f.y = (mul_nonIEEE(R1f.z,intBitsToFloat(uf_remappedPS[3].x)) + -(intBitsToFloat(uf_remappedPS[2].z)));
R126f.z = mul_nonIEEE(R0f.x, R0f.w);
// 1
R123f.z = (mul_nonIEEE(R1f.y,intBitsToFloat(uf_remappedPS[3].x)) + -(intBitsToFloat(uf_remappedPS[2].y)));
PV1f.z = R123f.z;
R123f.w = (mul_nonIEEE(R1f.x,intBitsToFloat(uf_remappedPS[3].x)) + -(intBitsToFloat(uf_remappedPS[2].x)));
PV1f.w = R123f.w;
// 2
backupReg0f = R126f.x;
backupReg1f = R127f.y;
backupReg0f = R126f.x;
backupReg0f = R126f.x;
R126f.x = (mul_nonIEEE(PV1f.w,backupReg0f) + intBitsToFloat(uf_remappedPS[2].x));
PV0f.x = R126f.x;
R127f.y = (mul_nonIEEE(backupReg1f,backupReg0f) + intBitsToFloat(uf_remappedPS[2].z));
PV0f.y = R127f.y;
R127f.z = (mul_nonIEEE(PV1f.z,backupReg0f) + intBitsToFloat(uf_remappedPS[2].y));
PV0f.z = R127f.z;
// 3
PV1f.x = -(PV0f.z) + intBitsToFloat(uf_remappedPS[4].y);
PV1f.y = -(PV0f.x) + intBitsToFloat(uf_remappedPS[4].x);
PV1f.w = -(PV0f.y) + intBitsToFloat(uf_remappedPS[4].z);
// 4
R2f.x = (mul_nonIEEE(PV1f.y,R126f.z) + R126f.x);
R2f.y = (mul_nonIEEE(PV1f.x,R126f.z) + R127f.z);
R2f.z = (mul_nonIEEE(PV1f.w,R126f.z) + R127f.y);
// export
passPixelColor0 = vec4(R2f.x, R2f.y, R2f.z, R2f.w);
float luma = dot(passPixelColor0.rgb, vec3(0.2126, 0.7152, 0.0722));
passPixelColor0.rgb = vec3(luma);
}