cemu_graphic_packs/Source/XenobladeX/_fe436d1abf8cc6f6_000000000000000f_ps.txt

62 lines
1.8 KiB
Plaintext
Raw Normal View History

#version 420
#extension GL_ARB_texture_gather : enable
// shader fe436d1abf8cc6f6
//noise texture for AO, don't scale, use AO sahder.
const float resScale = 1.0;
uniform ivec4 uf_uniformRegisterPS[256];
layout(location = 0) in vec4 passParameterSem0;
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){ return min(a*b,min(abs(a)*3.40282347E+38F,abs(b)*3.40282347E+38F)); }
void main()
{
ivec4 R0i = ivec4(0);
ivec4 R127i = ivec4(0);
int backupReg0i, backupReg1i, backupReg2i, backupReg3i, backupReg4i;
ivec4 PV0i = ivec4(0), PV1i = ivec4(0);
int PS0i = 0, PS1i = 0;
ivec4 tempi = ivec4(0);
float tempResultf;
int tempResulti;
ivec4 ARi = ivec4(0);
bool predResult = true;
vec3 cubeMapSTM;
int cubeMapFaceId;
R0i = floatBitsToInt(passParameterSem0);
// 0
R127i.y = R0i.x;
R127i.y = floatBitsToInt(intBitsToFloat(R127i.y) * 4.0/ resScale);
R0i.z = 0;
PV0i.w = R0i.y;
PV0i.w = floatBitsToInt(intBitsToFloat(PV0i.w) * 4.0/ resScale);
// 1
PS1i = int(intBitsToFloat(PV0i.w));
// 2
PV0i.y = PS1i << 0x00000002;
PS0i = int(intBitsToFloat(R127i.y));
// 3
PV1i.x = PS0i + PV0i.y;
// 4
R127i.w = floatBitsToInt(float(PV1i.x));
PS0i = R127i.w;
// 5
tempResultf = intBitsToFloat(PS0i);
tempResultf = floor(tempResultf);
tempResultf = clamp(tempResultf, -256.0, 255.0);
ARi.x = int(tempResultf);
PV1i.x = floatBitsToInt(tempResultf);
// 6
R0i.x = uf_uniformRegisterPS[ARi.x+0].x;
R0i.y = uf_uniformRegisterPS[ARi.x+0].y;
// export
passPixelColor0 = vec4(intBitsToFloat(R0i.x), intBitsToFloat(R0i.y), intBitsToFloat(R0i.z), intBitsToFloat(R0i.z));
}