157 lines
5.1 KiB
Plaintext
157 lines
5.1 KiB
Plaintext
#version 420
|
|
#extension GL_ARB_texture_gather : enable
|
|
#extension GL_ARB_separate_shader_objects : enable
|
|
// shader 4facbb67739c71ec
|
|
// light on prayer monument shrines
|
|
uniform ivec4 uf_remappedPS[6];
|
|
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf5054000 res 640x360x1 dim 1 tm: 4 format 080e compSel: 0 4 4 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 1
|
|
layout(binding = 1) uniform sampler2D textureUnitPS1;// Tex1 addr 0xf494a800 res 1280x720x1 dim 1 tm: 4 format 001a compSel: 0 1 2 3 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler1 ClampX/Y/Z: 2 2 2 border: 1
|
|
layout(location = 1) noperspective in vec4 passParameterSem1;
|
|
layout(location = 0) out vec4 passPixelColor0;
|
|
layout(location = 1) out vec4 passPixelColor1;
|
|
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 R3f = vec4(0.0);
|
|
vec4 R122f = 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;
|
|
R0f = vec4(gl_FragCoord.xy*uf_fragCoordScale,gl_FragCoord.zw);
|
|
R1f = passParameterSem1;
|
|
// 0
|
|
R3f.x = 0.0;
|
|
PV0f.z = R0f.y + intBitsToFloat(0xbc23d70a);
|
|
PV0f.w = R0f.x + intBitsToFloat(0xbc23d70a);
|
|
R2f.w = 0.0;
|
|
PS0f = R2f.w;
|
|
// 1
|
|
R0f.x = mul_nonIEEE(PV0f.w, intBitsToFloat(uf_remappedPS[0].z));
|
|
R0f.y = 1-mul_nonIEEE(PV0f.z - intBitsToFloat(0x40f00000), intBitsToFloat(uf_remappedPS[0].w));
|
|
R0f.w = (texture(textureUnitPS0, R0f.xy).x);
|
|
R0f.xyz = (texture(textureUnitPS1, R0f.xy).xyz);
|
|
// 0
|
|
R126f.x = (R0f.x * 2.0 + -(1.0));
|
|
R126f.y = (R0f.y * 2.0 + -(1.0));
|
|
R125f.z = (R0f.z * 2.0 + -(1.0));
|
|
PV0f.z = R125f.z;
|
|
R123f.w = (mul_nonIEEE(intBitsToFloat(uf_remappedPS[1].y),R0f.w) + intBitsToFloat(uf_remappedPS[1].x));
|
|
PV0f.w = R123f.w;
|
|
// 1
|
|
R127f.x = (mul_nonIEEE(R1f.x,-(PV0f.w)) + -(intBitsToFloat(uf_remappedPS[2].x)));
|
|
PV1f.x = R127f.x;
|
|
R127f.y = (mul_nonIEEE(R1f.y,-(PV0f.w)) + -(intBitsToFloat(uf_remappedPS[2].y)));
|
|
PV1f.y = R127f.y;
|
|
R127f.z = (mul_nonIEEE(R1f.z,-(PV0f.w)) + -(intBitsToFloat(uf_remappedPS[2].z)));
|
|
PV1f.z = R127f.z;
|
|
PS1f = PV0f.z * PV0f.z;
|
|
// 2
|
|
tempf.x = dot(vec4(PV1f.x,PV1f.y,PV1f.z,-0.0),vec4(PV1f.x,PV1f.y,PV1f.z,0.0));
|
|
PV0f.x = tempf.x;
|
|
PV0f.y = tempf.x;
|
|
PV0f.z = tempf.x;
|
|
PV0f.w = tempf.x;
|
|
R122f.x = (R126f.y * R126f.y + PS1f);
|
|
PS0f = R122f.x;
|
|
// 3
|
|
R126f.z = (R126f.x * R126f.x + PS0f);
|
|
tempResultf = 1.0 / sqrt(PV0f.x);
|
|
PS1f = tempResultf;
|
|
// 4
|
|
backupReg0f = R127f.x;
|
|
backupReg1f = R127f.y;
|
|
backupReg2f = R127f.z;
|
|
R127f.x = mul_nonIEEE(backupReg0f, PS1f);
|
|
R127f.y = mul_nonIEEE(backupReg1f, PS1f);
|
|
R127f.z = mul_nonIEEE(backupReg2f, PS1f);
|
|
PV0f.z = R127f.z;
|
|
PS0f = 1.0 / PS1f;
|
|
// 5
|
|
PV1f.x = mul_nonIEEE(PV0f.z, intBitsToFloat(uf_remappedPS[3].z));
|
|
PV1f.w = intBitsToFloat(uf_remappedPS[4].w) * PS0f;
|
|
PV1f.w = clamp(PV1f.w, 0.0, 1.0);
|
|
tempResultf = 1.0 / sqrt(R126f.z);
|
|
PS1f = tempResultf;
|
|
// 6
|
|
backupReg0f = R126f.x;
|
|
backupReg1f = R126f.y;
|
|
R126f.x = mul_nonIEEE(backupReg0f, PS1f);
|
|
R126f.y = mul_nonIEEE(backupReg1f, PS1f);
|
|
PV0f.z = mul_nonIEEE(R125f.z, PS1f);
|
|
PV0f.w = -(PV1f.w) + 1.0;
|
|
R122f.x = (mul_nonIEEE(R127f.y,intBitsToFloat(uf_remappedPS[3].y)) + PV1f.x);
|
|
PS0f = R122f.x;
|
|
// 7
|
|
PV1f.x = mul_nonIEEE(PV0f.z, R127f.z);
|
|
R123f.w = (mul_nonIEEE(R127f.x,intBitsToFloat(uf_remappedPS[3].x)) + PS0f);
|
|
PV1f.w = R123f.w;
|
|
tempResultf = log2(PV0f.w);
|
|
if( isinf(tempResultf) == true ) tempResultf = -3.40282347E+38F;
|
|
R125f.y = tempResultf;
|
|
PS1f = R125f.y;
|
|
// 8
|
|
tempf.x = dot(vec4(R126f.x,R126f.y,PV1f.x,-0.0),vec4(R127f.x,R127f.y,1.0,0.0));
|
|
PV0f.x = tempf.x;
|
|
PV0f.y = tempf.x;
|
|
PV0f.z = tempf.x;
|
|
PV0f.w = tempf.x;
|
|
R122f.x = (mul_nonIEEE(PV1f.w,intBitsToFloat(uf_remappedPS[5].y)) + -(intBitsToFloat(uf_remappedPS[5].z)));
|
|
R122f.x = clamp(R122f.x, 0.0, 1.0);
|
|
PS0f = R122f.x;
|
|
// 9
|
|
PV1f.x = mul_nonIEEE(intBitsToFloat(uf_remappedPS[2].w), R125f.y);
|
|
PV1f.y = max(-(PV0f.x), 0.0);
|
|
tempResultf = log2(PS0f);
|
|
if( isinf(tempResultf) == true ) tempResultf = -3.40282347E+38F;
|
|
PS1f = tempResultf;
|
|
// 10
|
|
PV0f.x = min(PV1f.y, 1.0);
|
|
PV0f.y = mul_nonIEEE(intBitsToFloat(uf_remappedPS[3].w), PS1f);
|
|
PS0f = exp2(PV1f.x);
|
|
// 11
|
|
PV1f.z = mul_nonIEEE(PS0f, PV0f.x);
|
|
PS1f = exp2(PV0f.y);
|
|
// 12
|
|
PV0f.y = mul_nonIEEE(PS1f, PV1f.z);
|
|
PV0f.y = clamp(PV0f.y, 0.0, 1.0);
|
|
// 13
|
|
R2f.x = mul_nonIEEE(intBitsToFloat(uf_remappedPS[4].x), PV0f.y);
|
|
PV1f.x = R2f.x;
|
|
R2f.y = mul_nonIEEE(intBitsToFloat(uf_remappedPS[4].y), PV0f.y);
|
|
PV1f.y = R2f.y;
|
|
R2f.z = mul_nonIEEE(intBitsToFloat(uf_remappedPS[4].z), PV0f.y);
|
|
PV1f.z = R2f.z;
|
|
// 14
|
|
R0f.xyz = vec3(PV1f.x,PV1f.y,PV1f.z);
|
|
R0f.w = R2f.w;
|
|
// 15
|
|
R1f.xyz = vec3(R3f.x,R3f.x,R3f.x);
|
|
R1f.w = R3f.w;
|
|
// export
|
|
passPixelColor0 = vec4(R0f.x, R0f.y, R0f.z, R0f.w);
|
|
passPixelColor1 = vec4(R1f.x, R1f.y, R1f.z, R1f.w);
|
|
}
|