mirror of
https://github.com/cemu-project/cemu_graphic_packs.git
synced 2024-12-29 03:11:50 +01:00
9d2f5ed768
The cloud in the vallys and on the dueling peaks
367 lines
11 KiB
Plaintext
367 lines
11 KiB
Plaintext
#version 420
|
|
#extension GL_ARB_texture_gather : enable
|
|
// shader 6ef3887dc83ac35e // distant cloud and fog ps
|
|
uniform ivec4 uf_remappedPS[9];
|
|
uniform float uf_alphaTestRef;
|
|
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0x21106000 res 128x128x1 dim 1 tm: 4 format 0035 compSel: 0 1 1 1 mipView: 0x0 (num 0x8) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 0 0 0 border: 0
|
|
layout(binding = 1) uniform sampler2D textureUnitPS1;// Tex1 addr 0x212a2000 res 400x400x1 dim 1 tm: 4 format 0035 compSel: 0 0 0 1 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 0x212f1000 res 64x64x1 dim 1 tm: 4 format 0034 compSel: 0 0 0 0 mipView: 0x0 (num 0x7) sliceView: 0x0 (num 0x1) Sampler2 ClampX/Y/Z: 2 2 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 0x3d56d800 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 passParameterSem8;
|
|
layout(location = 5) in vec4 passParameterSem9;
|
|
layout(location = 6) in vec4 passParameterSem11;
|
|
layout(location = 7) in vec4 passParameterSem14;
|
|
layout(location = 8) in vec4 passParameterSem15;
|
|
layout(location = 9) 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 R122f = 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;
|
|
float cubeMapArrayIndex10 = 0.0;
|
|
R0f = passParameterSem0;
|
|
R1f = passParameterSem1;
|
|
R2f = passParameterSem3;
|
|
R3f = passParameterSem4;
|
|
R4f = passParameterSem8;
|
|
R5f = passParameterSem9;
|
|
R6f = passParameterSem11;
|
|
R7f = passParameterSem14;
|
|
R8f = passParameterSem15;
|
|
R9f = passParameterSem16;
|
|
R10f.xw = (texture(textureUnitPS0, R4f.xy).xw);
|
|
R10f.y = (texture(textureUnitPS2, R5f.xy).w);
|
|
// 0
|
|
R11f.x = R0f.x + -(R1f.x);
|
|
R123f.y = (R10f.w * 2.0 + -(1.0));
|
|
PV0f.y = R123f.y;
|
|
R123f.z = (R10f.x * 2.0 + -(1.0));
|
|
PV0f.z = R123f.z;
|
|
R127f.w = R10f.y * 1.0;
|
|
R127f.z = 1.0 / R2f.w;
|
|
PS0f = R127f.z;
|
|
// 1
|
|
PV1f.x = mul_nonIEEE(R3f.y, PV0f.z);
|
|
PV1f.y = mul_nonIEEE(R3f.y, PV0f.y);
|
|
R11f.z = mul_nonIEEE(R2f.x, PS0f);
|
|
R10f.w = intBitsToFloat(uf_remappedPS[0].x);
|
|
R11f.y = mul_nonIEEE(R2f.y, PS0f);
|
|
PS1f = R11f.y;
|
|
// 2
|
|
PV0f.x = R2f.z * R127f.z;
|
|
R2f.y = R0f.y + -(R1f.y);
|
|
PV0f.z = mul_nonIEEE(PV1f.x, R127f.w);
|
|
PV0f.w = mul_nonIEEE(R127f.w, PV1f.y);
|
|
R2f.w = R7f.x + 0.0;
|
|
PS0f = R2f.w;
|
|
// 3
|
|
R4f.xyz = vec3(R4f.z,R4f.w,R5f.x) + vec3(PV0f.z,PV0f.w,PV0f.z);
|
|
R4f.w = R5f.y + PV0f.w;
|
|
R122f.x = (mul_nonIEEE(intBitsToFloat(uf_remappedPS[1].w),PV0f.x) + -(intBitsToFloat(uf_remappedPS[1].y)));
|
|
PS1f = R122f.x;
|
|
// 4
|
|
R5f.x = dot(vec4(R6f.x,R6f.y,R6f.z,-0.0),vec4(intBitsToFloat(uf_remappedPS[2].x),intBitsToFloat(uf_remappedPS[2].y),intBitsToFloat(uf_remappedPS[2].z),0.0));
|
|
PV0f.x = R5f.x;
|
|
PV0f.y = R5f.x;
|
|
PV0f.z = R5f.x;
|
|
PV0f.w = R5f.x;
|
|
R127f.z = 1.0 / PS1f;
|
|
PS0f = R127f.z;
|
|
// 5
|
|
backupReg0f = R0f.z;
|
|
tempf.x = dot(vec4(R6f.x,R6f.y,R6f.z,-0.0),vec4(intBitsToFloat(uf_remappedPS[3].x),intBitsToFloat(uf_remappedPS[3].y),intBitsToFloat(uf_remappedPS[3].z),0.0));
|
|
PV1f.x = tempf.x;
|
|
PV1f.y = tempf.x;
|
|
PV1f.z = tempf.x;
|
|
PV1f.w = tempf.x;
|
|
R127f.y = tempf.x;
|
|
R5f.y = backupReg0f + -(R1f.z);
|
|
PS1f = R5f.y;
|
|
// 6
|
|
tempf.x = dot(vec4(R6f.x,R6f.y,R6f.z,-0.0),vec4(intBitsToFloat(uf_remappedPS[4].x),intBitsToFloat(uf_remappedPS[4].y),intBitsToFloat(uf_remappedPS[4].z),0.0));
|
|
PV0f.x = tempf.x;
|
|
PV0f.y = tempf.x;
|
|
PV0f.z = tempf.x;
|
|
PV0f.w = tempf.x;
|
|
R2f.z = tempf.x;
|
|
R3f.z = R7f.y + 0.0;
|
|
PS0f = R3f.z;
|
|
// 7
|
|
backupReg0f = R6f.z;
|
|
tempf.x = dot(vec4(R6f.x,R6f.y,R6f.z,-0.0),vec4(intBitsToFloat(uf_remappedPS[5].x),intBitsToFloat(uf_remappedPS[5].y),intBitsToFloat(uf_remappedPS[5].z),0.0));
|
|
PV1f.x = tempf.x;
|
|
PV1f.y = tempf.x;
|
|
PV1f.z = tempf.x;
|
|
PV1f.w = tempf.x;
|
|
R127f.w = tempf.x;
|
|
R6f.z = -(backupReg0f);
|
|
PS1f = R6f.z;
|
|
// 8
|
|
redcCUBE(vec4(PS1f,PS1f,R6f.x,R6f.y),vec4(R6f.y,R6f.x,PS1f,PS1f),cubeMapSTM,cubeMapFaceId);
|
|
R126f.x = cubeMapSTM.x;
|
|
R126f.y = cubeMapSTM.y;
|
|
R126f.z = cubeMapSTM.z;
|
|
R126f.w = intBitsToFloat(cubeMapFaceId);
|
|
PV0f.x = R126f.x;
|
|
PV0f.y = R126f.y;
|
|
PV0f.z = R126f.z;
|
|
PV0f.w = R126f.w;
|
|
R6f.y = -(intBitsToFloat(uf_remappedPS[1].z)) * R127f.z;
|
|
PS0f = R6f.y;
|
|
// 9
|
|
backupReg0f = R0f.w;
|
|
PV1f.x = R127f.w * R127f.w;
|
|
R0f.y = R7f.z + 0.0;
|
|
R10f.z = PV0f.w;
|
|
R0f.w = (backupReg0f * 2.0 + -(1.0));
|
|
PS1f = 1.0 / abs(PV0f.z);
|
|
// 10
|
|
R123f.x = (R2f.z * R2f.z + PV1f.x);
|
|
PV0f.x = R123f.x;
|
|
R123f.z = (mul_nonIEEE(R126f.y,PS1f) + 1.5);
|
|
PV0f.z = R123f.z;
|
|
R123f.w = (mul_nonIEEE(R126f.x,PS1f) + 1.5);
|
|
PV0f.w = R123f.w;
|
|
// 11
|
|
R10f.x = PV0f.z;
|
|
R10f.y = PV0f.w;
|
|
R0f.x = (R127f.y * R127f.y + PV0f.x);
|
|
PS1f = R0f.x;
|
|
R10f.xyz = (textureLod(textureUnitPS10, vec4(redcCUBEReverse(R10f.xy,floatBitsToInt(R10f.z)),cubeMapArrayIndex10),R10f.w).xyz);
|
|
R7f.xyzw = (texture(textureUnitPS1, R4f.xy).xyzw);
|
|
R4f.y = (texture(textureUnitPS4, R11f.zy).x);
|
|
R11f.y = (texture(textureUnitPS0, R4f.zw).w);
|
|
// 0
|
|
R123f.x = (R5f.x * R5f.x + R0f.x);
|
|
PV0f.x = R123f.x;
|
|
PV0f.y = R10f.x * 1.0;
|
|
PV0f.z = R10f.y * 1.0;
|
|
PV0f.w = R10f.z * 1.0;
|
|
R126f.x = mul_nonIEEE(R7f.z, R7f.z);
|
|
PS0f = R126f.x;
|
|
// 1
|
|
R127f.x = (mul_nonIEEE(PV0f.w,intBitsToFloat(uf_remappedPS[6].y)) + 0.0);
|
|
R123f.y = (mul_nonIEEE(PV0f.z,intBitsToFloat(uf_remappedPS[6].y)) + 0.0);
|
|
PV1f.y = R123f.y;
|
|
R123f.z = (mul_nonIEEE(PV0f.y,intBitsToFloat(uf_remappedPS[6].y)) + 0.0);
|
|
PV1f.z = R123f.z;
|
|
R126f.w = mul_nonIEEE(R7f.x, R7f.x);
|
|
tempResultf = 1.0 / sqrt(PV0f.x);
|
|
PS1f = tempResultf;
|
|
// 2
|
|
backupReg0f = R126f.x;
|
|
R126f.x = (mul_nonIEEE(R5f.y,backupReg0f) + R1f.z);
|
|
PV0f.y = mul_nonIEEE(R7f.y, R7f.y);
|
|
PV0f.z = mul_nonIEEE(R2f.z, PS1f);
|
|
R127f.w = (mul_nonIEEE(intBitsToFloat(uf_remappedPS[0].w),PV1f.z) + R2f.w);
|
|
R126f.z = (mul_nonIEEE(intBitsToFloat(uf_remappedPS[0].w),PV1f.y) + R3f.z);
|
|
PS0f = R126f.z;
|
|
// 3
|
|
R123f.x = (mul_nonIEEE(intBitsToFloat(uf_remappedPS[0].w),R127f.x) + R0f.y);
|
|
PV1f.x = R123f.x;
|
|
PV1f.y = max(PV0f.z, -(PV0f.z));
|
|
R123f.z = (mul_nonIEEE(R11f.x,R126f.w) + R1f.x);
|
|
PV1f.z = R123f.z;
|
|
R123f.w = (mul_nonIEEE(R2f.y,PV0f.y) + R1f.y);
|
|
PV1f.w = R123f.w;
|
|
// 4
|
|
backupReg0f = R126f.z;
|
|
PV0f.x = max(PV1f.y, intBitsToFloat(0x3e99999a));
|
|
R127f.y = mul_nonIEEE(PV1f.z, R127f.w);
|
|
PV0f.y = R127f.y;
|
|
R126f.z = mul_nonIEEE(R126f.x, PV1f.x);
|
|
PV0f.z = R126f.z;
|
|
R127f.w = mul_nonIEEE(PV1f.w, backupReg0f);
|
|
PV0f.w = R127f.w;
|
|
PS0f = R11f.y + R0f.w;
|
|
PS0f = clamp(PS0f, 0.0, 1.0);
|
|
// 5
|
|
PV1f.x = -(PV0f.w) + intBitsToFloat(uf_remappedPS[7].y);
|
|
PV1f.y = -(PV0f.y) + intBitsToFloat(uf_remappedPS[7].x);
|
|
PV1f.z = -(PV0f.z) + intBitsToFloat(uf_remappedPS[7].z);
|
|
PV1f.w = min(PV0f.x, 1.0);
|
|
PS1f = mul_nonIEEE(R7f.w, PS0f);
|
|
// 6
|
|
backupReg0f = R1f.w;
|
|
R126f.x = (mul_nonIEEE(PV1f.y,R9f.y) + R127f.y);
|
|
PV0f.x = R126f.x;
|
|
R127f.y = (mul_nonIEEE(PV1f.x,R9f.y) + R127f.w);
|
|
PV0f.y = R127f.y;
|
|
PV0f.z = PV1f.w + intBitsToFloat(0xbe99999a);
|
|
R127f.w = (mul_nonIEEE(PV1f.z,R9f.y) + R126f.z);
|
|
PV0f.w = R127f.w;
|
|
R1f.w = mul_nonIEEE(backupReg0f, PS1f);
|
|
PS0f = R1f.w;
|
|
// 7
|
|
PV1f.x = R8f.z + -(PV0f.w);
|
|
PV1f.y = PV0f.z * intBitsToFloat(0x3fb6db6e);
|
|
PV1f.z = R8f.y + -(PV0f.y);
|
|
PV1f.w = R8f.x + -(PV0f.x);
|
|
// 8
|
|
backupReg0f = R127f.y;
|
|
PV0f.x = -(PV1f.y) + 1.0;
|
|
R127f.y = (mul_nonIEEE(PV1f.w,R8f.w) + R126f.x);
|
|
PV0f.y = R127f.y;
|
|
R126f.z = (mul_nonIEEE(PV1f.x,R8f.w) + R127f.w);
|
|
PV0f.z = R126f.z;
|
|
R127f.w = (mul_nonIEEE(PV1f.z,R8f.w) + backupReg0f);
|
|
PV0f.w = R127f.w;
|
|
// 9
|
|
PV1f.x = -(PV0f.w) + intBitsToFloat(uf_remappedPS[8].y);
|
|
PV1f.y = -(PV0f.y) + intBitsToFloat(uf_remappedPS[8].x);
|
|
PV1f.z = -(PV0f.z) + intBitsToFloat(uf_remappedPS[8].z);
|
|
PV1f.w = mul_nonIEEE(PV0f.x, PV0f.x);
|
|
// 10
|
|
backupReg0f = R6f.y;
|
|
R6f.x = (mul_nonIEEE(PV1f.y,R9f.x) + R127f.y);
|
|
R6f.y = (mul_nonIEEE(PV1f.x,R9f.x) + R127f.w);
|
|
R8f.z = (PV1f.w * intBitsToFloat(0x42c80000) + backupReg0f);
|
|
R6f.z = (mul_nonIEEE(PV1f.z,R9f.x) + R126f.z);
|
|
PS0f = R6f.z;
|
|
// 0
|
|
R123f.y = (mul_nonIEEE(R4f.y,intBitsToFloat(uf_remappedPS[1].w)) + intBitsToFloat(uf_remappedPS[1].x));
|
|
PV0f.y = R123f.y;
|
|
// 1
|
|
PV1f.y = PV0f.y + -(R8f.z);
|
|
// 2
|
|
PV0f.x = max(PV1f.y, 0.0);
|
|
// 3
|
|
PV1f.w = min(PV0f.x, intBitsToFloat(0x42c80000));
|
|
// 4
|
|
PV0f.z = PV1f.w + -0.0;
|
|
// 5
|
|
PV1f.y = PV0f.z * intBitsToFloat(0x3c23d70a);
|
|
PV1f.y = clamp(PV1f.y, 0.0, 1.0);
|
|
// 6
|
|
PV0f.x = mul_nonIEEE(R1f.w, PV1f.y);
|
|
PV0f.x = clamp(PV0f.x, 0.0, 1.0);
|
|
// 7
|
|
R6f.w = mul_nonIEEE(R3f.x, PV0f.x);
|
|
// export
|
|
if( ((vec4(R6f.x, R6f.y, R6f.z, R6f.w)).a > uf_alphaTestRef) == false) discard;
|
|
passPixelColor0 = vec4(R6f.x, R6f.y, R6f.z, R6f.w);
|
|
}
|