mirror of
https://github.com/cemu-project/cemu_graphic_packs.git
synced 2024-11-22 17:49:17 +01:00
49719345a7
Cutscene DOF is LOD based, should not have been scaled.
300 lines
10 KiB
Plaintext
300 lines
10 KiB
Plaintext
#version 430
|
|
#extension GL_ARB_texture_gather : enable
|
|
#extension GL_ARB_separate_shader_objects : enable
|
|
// shader 9ea5cab5137f8604 //point "sprite" 3 verified
|
|
// start of shader inputs/outputs, predetermined by Cemu. Do not touch
|
|
#ifdef VULKAN
|
|
#define ATTR_LAYOUT(__vkSet, __location) layout(set = __vkSet, location = __location)
|
|
#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(set = __vkSet, binding = __vkLocation, std140)
|
|
#define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(set = __vkSet, binding = __vkLocation)
|
|
#define gl_VertexID gl_VertexIndex
|
|
#define gl_InstanceID gl_InstanceIndex
|
|
#define SET_POSITION(_v) gl_Position = _v; gl_Position.z = (gl_Position.z + gl_Position.w) / 2.0
|
|
#else
|
|
#define ATTR_LAYOUT(__vkSet, __location) layout(location = __location)
|
|
#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140)
|
|
#define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation)
|
|
#define SET_POSITION(_v) gl_Position = _v
|
|
#endif
|
|
#ifdef VULKAN
|
|
layout(set = 0, binding = 0) uniform ufBlock
|
|
{
|
|
uniform ivec4 uf_remappedVS[17];
|
|
};
|
|
#else
|
|
uniform ivec4 uf_remappedVS[17];
|
|
#endif
|
|
ATTR_LAYOUT(0, 0) in uvec4 attrDataSem0;
|
|
ATTR_LAYOUT(0, 1) in uvec4 attrDataSem5;
|
|
out gl_PerVertex
|
|
{
|
|
vec4 gl_Position;
|
|
float gl_PointSize;
|
|
};
|
|
// end of shader inputs/outputs
|
|
const float resScale = float($gameWidth / $width);
|
|
|
|
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 R4f = vec4(0.0);
|
|
vec4 R5f = vec4(0.0);
|
|
vec4 R123f = vec4(0.0);
|
|
vec4 R124f = vec4(0.0);
|
|
vec4 R125f = vec4(0.0);
|
|
vec4 R126f = vec4(0.0);
|
|
vec4 R127f = vec4(0.0);
|
|
uvec4 attrDecoder;
|
|
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 = floatBitsToInt(ivec4(gl_VertexID, 0, 0, gl_InstanceID));
|
|
attrDecoder.xyzw = attrDataSem0.xyzw;
|
|
attrDecoder = ((attrDecoder>>8)&0xFF)|((attrDecoder<<8)&0xFF00);
|
|
attrDecoder.xyzw = floatBitsToInt(vec4(unpackHalf2x16(attrDecoder.x|(attrDecoder.y<<16)),unpackHalf2x16(attrDecoder.z|(attrDecoder.w<<16))));
|
|
R1f = vec4(intBitsToFloat(int(attrDecoder.x)), intBitsToFloat(int(attrDecoder.y)), intBitsToFloat(int(attrDecoder.z)), intBitsToFloat(int(attrDecoder.w)));
|
|
attrDecoder.xyzw = attrDataSem5.xyzw;
|
|
attrDecoder = ((attrDecoder>>8)&0xFF)|((attrDecoder<<8)&0xFF00);
|
|
attrDecoder.xyzw = floatBitsToInt(vec4(unpackHalf2x16(attrDecoder.x|(attrDecoder.y<<16)),unpackHalf2x16(attrDecoder.z|(attrDecoder.w<<16))));
|
|
R2f = vec4(intBitsToFloat(int(attrDecoder.x)), intBitsToFloat(int(attrDecoder.y)), intBitsToFloat(int(attrDecoder.z)), intBitsToFloat(int(attrDecoder.w)));
|
|
// 0
|
|
PV0f.x = max(intBitsToFloat(uf_remappedVS[0].w), -(intBitsToFloat(uf_remappedVS[0].w)));
|
|
R127f.y = mul_nonIEEE(R2f.x, intBitsToFloat(uf_remappedVS[1].x));
|
|
PV0f.z = max(R1f.w, -(R1f.w));
|
|
R127f.w = mul_nonIEEE(R2f.y, intBitsToFloat(uf_remappedVS[1].y));
|
|
R4f.w = 1.0;
|
|
PS0f = R4f.w;
|
|
// 1
|
|
PV1f.y = mul_nonIEEE(PV0f.z, intBitsToFloat(uf_remappedVS[2].y));
|
|
R127f.z = mul_nonIEEE(R2f.z, intBitsToFloat(uf_remappedVS[1].z));
|
|
tempResultf = max(0.0, PV0f.x);
|
|
tempResultf = log2(tempResultf);
|
|
if( isinf(tempResultf) == true ) tempResultf = -3.40282347E+38F;
|
|
R126f.y = tempResultf;
|
|
PS1f = R126f.y;
|
|
// 2
|
|
PV0f.x = -(PV1f.y) + intBitsToFloat(uf_remappedVS[2].x);
|
|
R0f.y = -(intBitsToFloat(uf_remappedVS[3].x)) * intBitsToFloat(0x7f7ffffd);
|
|
R0f.y = clamp(R0f.y, 0.0, 1.0);
|
|
R124f.z = -(intBitsToFloat(uf_remappedVS[3].y)) * intBitsToFloat(0x7f7ffffd);
|
|
R124f.z = clamp(R124f.z, 0.0, 1.0);
|
|
R124f.w = max(intBitsToFloat(uf_remappedVS[3].x), -(intBitsToFloat(uf_remappedVS[3].x)));
|
|
R0f.w = max(intBitsToFloat(uf_remappedVS[3].y), -(intBitsToFloat(uf_remappedVS[3].y)));
|
|
PS0f = R0f.w;
|
|
// 3
|
|
backupReg0f = R127f.y;
|
|
R125f.x = -(intBitsToFloat(uf_remappedVS[3].z)) * intBitsToFloat(0x7f7ffffd);
|
|
R125f.x = clamp(R125f.x, 0.0, 1.0);
|
|
R127f.y = backupReg0f + intBitsToFloat(uf_remappedVS[0].x);
|
|
R126f.z = R127f.w + intBitsToFloat(uf_remappedVS[0].y);
|
|
R126f.w = max(PV0f.x, 0.0);
|
|
PV1f.w = R126f.w;
|
|
R0f.z = max(intBitsToFloat(uf_remappedVS[3].z), -(intBitsToFloat(uf_remappedVS[3].z)));
|
|
PS1f = R0f.z;
|
|
// 4
|
|
PV0f.x = mul_nonIEEE(PV1f.w, R126f.y);
|
|
PV0f.y = mul_nonIEEE(PV1f.w, intBitsToFloat(uf_remappedVS[4].z));
|
|
PV0f.z = mul_nonIEEE(PV1f.w, intBitsToFloat(uf_remappedVS[4].y));
|
|
PV0f.w = mul_nonIEEE(PV1f.w, intBitsToFloat(uf_remappedVS[4].x));
|
|
R125f.z = PV1f.w + -(intBitsToFloat(0x3a83126f));
|
|
PS0f = R125f.z;
|
|
// 5
|
|
PV1f.x = R2f.w + PV0f.w;
|
|
R125f.y = R127f.z + intBitsToFloat(uf_remappedVS[0].z);
|
|
PV1f.z = R2f.w + PV0f.y;
|
|
PV1f.w = R2f.w + PV0f.z;
|
|
PS1f = exp2(PV0f.x);
|
|
// 6
|
|
PV0f.x = PV1f.w * intBitsToFloat(0x40c90fdb);
|
|
PV0f.y = PV1f.x * intBitsToFloat(0x40c90fdb);
|
|
PV0f.z = -(PS1f) + 1.0;
|
|
PV0f.w = PV1f.z * intBitsToFloat(0x40c90fdb);
|
|
R127f.z = mul_nonIEEE(R126f.w, intBitsToFloat(uf_remappedVS[5].x));
|
|
PS0f = R127f.z;
|
|
// 7
|
|
R123f.x = (PV0f.w * intBitsToFloat(0x3e22f983) + 0.5);
|
|
PV1f.x = R123f.x;
|
|
R126f.y = mul_nonIEEE(PV0f.z, intBitsToFloat(uf_remappedVS[1].w));
|
|
PV1f.y = R126f.y;
|
|
R123f.z = (PV0f.y * intBitsToFloat(0x3e22f983) + 0.5);
|
|
PV1f.z = R123f.z;
|
|
R123f.w = (PV0f.x * intBitsToFloat(0x3e22f983) + 0.5);
|
|
PV1f.w = R123f.w;
|
|
R124f.y = mul_nonIEEE(R126f.w, intBitsToFloat(uf_remappedVS[5].y));
|
|
PS1f = R124f.y;
|
|
// 8
|
|
R2f.x = mul_nonIEEE(PV1f.y, R127f.y);
|
|
PV0f.y = fract(PV1f.z);
|
|
PV0f.z = fract(PV1f.w);
|
|
PV0f.w = fract(PV1f.x);
|
|
R127f.y = mul_nonIEEE(PV1f.y, R126f.z);
|
|
PS0f = R127f.y;
|
|
// 9
|
|
R123f.x = (PV0f.y * intBitsToFloat(0x40c90fdb) + -(intBitsToFloat(0x40490fdb)));
|
|
PV1f.x = R123f.x;
|
|
R123f.y = (PV0f.z * intBitsToFloat(0x40c90fdb) + -(intBitsToFloat(0x40490fdb)));
|
|
PV1f.y = R123f.y;
|
|
R123f.z = (PV0f.w * intBitsToFloat(0x40c90fdb) + -(intBitsToFloat(0x40490fdb)));
|
|
PV1f.z = R123f.z;
|
|
R2f.w = mul_nonIEEE(R126f.y, R125f.y);
|
|
R127f.x = mul_nonIEEE(R126f.w, intBitsToFloat(uf_remappedVS[5].z));
|
|
PS1f = R127f.x;
|
|
// 10
|
|
R126f.x = PV1f.z * intBitsToFloat(0x3e22f983);
|
|
R126f.y = PV1f.x * intBitsToFloat(0x3e22f983);
|
|
PV0f.y = R126f.y;
|
|
R126f.z = mul_nonIEEE(R1f.x, intBitsToFloat(uf_remappedVS[6].x));
|
|
R125f.w = PV1f.y * intBitsToFloat(0x3e22f983);
|
|
R127f.w = mul_nonIEEE(R1f.y, intBitsToFloat(uf_remappedVS[6].y));
|
|
PS0f = R127f.w;
|
|
// 11
|
|
R1f.x = mul_nonIEEE(R126f.w, R124f.y);
|
|
R125f.y = mul_nonIEEE(R126f.w, R127f.x);
|
|
PV1f.z = mul_nonIEEE(R1f.z, intBitsToFloat(uf_remappedVS[6].z));
|
|
R1f.w = mul_nonIEEE(R126f.w, R127f.z);
|
|
R127f.x = sin((PV0f.y)/0.1591549367);
|
|
PS1f = R127f.x;
|
|
// 12
|
|
backupReg0f = R125f.z;
|
|
R0f.x = R127f.w + intBitsToFloat(uf_remappedVS[7].y);
|
|
R124f.y = R126f.z + intBitsToFloat(uf_remappedVS[7].x);
|
|
R125f.z = backupReg0f * intBitsToFloat(0x7f7ffffd);
|
|
R125f.z = clamp(R125f.z, 0.0, 1.0);
|
|
R127f.w = PV1f.z + intBitsToFloat(uf_remappedVS[7].z);
|
|
R126f.z = sin((R125f.w)/0.1591549367);
|
|
PS0f = R126f.z;
|
|
// 13
|
|
R123f.z = (mul_nonIEEE(R126f.w,intBitsToFloat(uf_remappedVS[8].x)) + intBitsToFloat(uf_remappedVS[8].y));
|
|
PV1f.z = R123f.z;
|
|
R124f.x = sin((R126f.x)/0.1591549367);
|
|
PS1f = R124f.x;
|
|
// 14
|
|
PV0f.y = floor(PV1f.z);
|
|
R3f.z = 0.0;
|
|
PS0f = cos((R126f.y)/0.1591549367);
|
|
// 15
|
|
PV1f.x = mul_nonIEEE(PV0f.y, intBitsToFloat(uf_remappedVS[9].x));
|
|
PV1f.z = -(R127f.x) + PS0f;
|
|
PS1f = cos((R125f.w)/0.1591549367);
|
|
// 16
|
|
backupReg0f = R0f.y;
|
|
PV0f.x = fract(PV1f.x);
|
|
PV0f.y = -(R126f.z) + PS1f;
|
|
PV0f.z = floor(PV1f.x);
|
|
R123f.w = (mul_nonIEEE(PV1f.z,backupReg0f) + R127f.x);
|
|
PV0f.w = R123f.w;
|
|
PS0f = cos((R126f.x)/0.1591549367);
|
|
// 17
|
|
PV1f.x = -(R124f.x) + PS0f;
|
|
PV1f.y = mul_nonIEEE(R124f.w, PV0f.w);
|
|
R123f.z = (mul_nonIEEE(PV0f.y,R124f.z) + R126f.z);
|
|
PV1f.z = R123f.z;
|
|
PV1f.w = mul_nonIEEE(PV0f.x, intBitsToFloat(uf_remappedVS[10].x));
|
|
R3f.y = mul_nonIEEE(PV0f.z, intBitsToFloat(uf_remappedVS[9].y));
|
|
PS1f = R3f.y;
|
|
// 18
|
|
backupReg0f = R0f.w;
|
|
PV0f.x = R2f.x + PV1f.y;
|
|
R123f.y = (mul_nonIEEE(PV1f.x,R125f.x) + R124f.x);
|
|
PV0f.y = R123f.y;
|
|
PV0f.z = floor(PV1f.w);
|
|
PV0f.w = mul_nonIEEE(backupReg0f, PV1f.z);
|
|
// 19
|
|
backupReg0f = R0f.z;
|
|
PV1f.x = R127f.y + PV0f.w;
|
|
PV1f.y = PV0f.x + R1f.w;
|
|
PV1f.z = mul_nonIEEE(backupReg0f, PV0f.y);
|
|
R3f.x = mul_nonIEEE(PV0f.z, intBitsToFloat(uf_remappedVS[9].x));
|
|
PS1f = R3f.x;
|
|
// 20
|
|
PV0f.x = PV1f.x + R1f.x;
|
|
R0f.y = R124f.y + PV1f.y;
|
|
PV0f.w = R2f.w + PV1f.z;
|
|
// 21
|
|
R1f.y = R0f.x + PV0f.x;
|
|
PV1f.z = PV0f.w + R125f.y;
|
|
// 22
|
|
R0f.z = R127f.w + PV1f.z;
|
|
PV0f.z = R0f.z;
|
|
// 23
|
|
tempf.x = dot(vec4(R0f.y,R1f.y,PV0f.z,R4f.w),vec4(intBitsToFloat(uf_remappedVS[11].x),intBitsToFloat(uf_remappedVS[11].y),intBitsToFloat(uf_remappedVS[11].z),intBitsToFloat(uf_remappedVS[11].w)));
|
|
PV1f.x = tempf.x;
|
|
PV1f.y = tempf.x;
|
|
PV1f.z = tempf.x;
|
|
PV1f.w = tempf.x;
|
|
R5f.w = tempf.x;
|
|
// 24
|
|
PV0f.y = PV1f.x + -(intBitsToFloat(uf_remappedVS[3].w));
|
|
// 25
|
|
PV1f.x = mul_nonIEEE(PV0f.y, intBitsToFloat(uf_remappedVS[12].w));
|
|
PV1f.x = clamp(PV1f.x, 0.0, 1.0);
|
|
// 26
|
|
R3f.w = mul_nonIEEE(R125f.z, PV1f.x);
|
|
PV0f.w = R3f.w;
|
|
// 27
|
|
PV1f.z = PV0f.w + -(intBitsToFloat(0x3a83126f));
|
|
// 28
|
|
tempf.x = dot(vec4(R0f.y,R1f.y,R0f.z,R4f.w),vec4(intBitsToFloat(uf_remappedVS[13].x),intBitsToFloat(uf_remappedVS[13].y),intBitsToFloat(uf_remappedVS[13].z),intBitsToFloat(uf_remappedVS[13].w)));
|
|
PV0f.x = tempf.x;
|
|
PV0f.y = tempf.x;
|
|
PV0f.z = tempf.x;
|
|
PV0f.w = tempf.x;
|
|
R5f.z = tempf.x;
|
|
R2f.w = PV1f.z * intBitsToFloat(0x7f7ffffd);
|
|
R2f.w = clamp(R2f.w, 0.0, 1.0);
|
|
PS0f = R2f.w;
|
|
// export
|
|
// skipped export to semanticId 255
|
|
// 0
|
|
PV0f.y = -(R2f.w) + 1.0;
|
|
R125f.x = 1.0 / R5f.z;
|
|
PS0f = R125f.x;
|
|
// 1
|
|
backupReg0f = R0f.z;
|
|
tempf.x = dot(vec4(R0f.y,R1f.y,backupReg0f,R4f.w),vec4(intBitsToFloat(uf_remappedVS[14].x),intBitsToFloat(uf_remappedVS[14].y),intBitsToFloat(uf_remappedVS[14].z),intBitsToFloat(uf_remappedVS[14].w)));
|
|
PV1f.x = tempf.x;
|
|
PV1f.y = tempf.x;
|
|
PV1f.z = tempf.x;
|
|
PV1f.w = tempf.x;
|
|
R125f.z = PV0f.y * intBitsToFloat(0x7f7ffffd);
|
|
PS1f = R125f.z;
|
|
// 2
|
|
backupReg0f = R0f.z;
|
|
tempf.x = dot(vec4(R0f.y,R1f.y,backupReg0f,R4f.w),vec4(intBitsToFloat(uf_remappedVS[15].x),intBitsToFloat(uf_remappedVS[15].y),intBitsToFloat(uf_remappedVS[15].z),intBitsToFloat(uf_remappedVS[15].w)));
|
|
PV0f.x = tempf.x;
|
|
PV0f.y = tempf.x;
|
|
PV0f.z = tempf.x;
|
|
PV0f.w = tempf.x;
|
|
R5f.x = PV1f.x + PS1f;
|
|
PS0f = R5f.x;
|
|
// 3
|
|
R5f.y = PV0f.x + R125f.z;
|
|
PV1f.w = R125f.x * intBitsToFloat(uf_remappedVS[16].z);
|
|
// 4
|
|
R3f.x = mul_nonIEEE(R2f.w, PV1f.w);
|
|
// export
|
|
SET_POSITION(vec4(R5f.x, R5f.y, R5f.z, R5f.w));
|
|
// export
|
|
gl_PointSize = (vec4(R3f.x, R3f.y, R3f.y, R3f.y)).x/resScale;
|
|
// 0
|
|
}
|