From f7ef21ef548e57f7d2471137b0fa6ee4779c2ffc Mon Sep 17 00:00:00 2001 From: getdls Date: Sat, 17 Mar 2018 00:58:12 +0100 Subject: [PATCH] [XCX] Improve point light scaling One value was off in the first version, less bright instead of scaling --- .../ba19276703190072_0000000000001e49_ps.txt | 30 +++++++++---------- .../bd74794730fc559a_00000000ff249249_ps.txt | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Source/XenobladeX/ba19276703190072_0000000000001e49_ps.txt b/Source/XenobladeX/ba19276703190072_0000000000001e49_ps.txt index 1b499098..98c9bd74 100644 --- a/Source/XenobladeX/ba19276703190072_0000000000001e49_ps.txt +++ b/Source/XenobladeX/ba19276703190072_0000000000001e49_ps.txt @@ -10,7 +10,7 @@ $scaleFactorY = always_decimal_format($fullHeight / 720.0); #extension GL_ARB_texture_gather : enable #extension GL_ARB_separate_shader_objects : enable // shader ba19276703190072 -//point light shadow scaling, indoors +//point light scaling v2, const float resScale = ; uniform ivec4 uf_remappedPS[11]; layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf5196000 res 1280x720x1 dim 1 tm: 4 format 0810 compSel: 0 1 4 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 0 @@ -138,7 +138,7 @@ PV0i.y = tempi.x; PV0i.z = tempi.x; PV0i.w = tempi.x; // 3 -R0i.w = floatBitsToInt(intBitsToFloat(PV0i.x) + -(intBitsToFloat(uf_remappedPS[1].z)));//nop +R0i.w = floatBitsToInt(intBitsToFloat(PV0i.x) + -(intBitsToFloat(uf_remappedPS[1].z))); R0i.w = clampFI32(R0i.w); // 4 predResult = (0.0 >= intBitsToFloat(R0i.w)); @@ -196,7 +196,7 @@ PS1i = R122i.x; // 4 backupReg0i = R127i.x; R127i.x = floatBitsToInt((intBitsToFloat(R1i.x) * intBitsToFloat(R1i.x) + intBitsToFloat(PS1i))); -R125i.y = floatBitsToInt((mul_nonIEEE(intBitsToFloat(PV1i.w),intBitsToFloat(uf_remappedPS[7].y)) + intBitsToFloat(uf_remappedPS[8].z)));//nop +R125i.y = floatBitsToInt((mul_nonIEEE(intBitsToFloat(PV1i.w),intBitsToFloat(uf_remappedPS[7].y)) + intBitsToFloat(uf_remappedPS[8].z))); PV0i.y = R125i.y; R127i.z = floatBitsToInt(mul_nonIEEE(intBitsToFloat(backupReg0i), intBitsToFloat(R5i.y))); PS0i = floatBitsToInt(1.0 / intBitsToFloat(PV1i.w)); @@ -204,7 +204,7 @@ PS0i = floatBitsToInt(1.0 / intBitsToFloat(PV1i.w)); PV1i.x = floatBitsToInt(intBitsToFloat(R126i.x) * intBitsToFloat(PS0i)); PV1i.y = floatBitsToInt(intBitsToFloat(R127i.y) * intBitsToFloat(PS0i)); PV1i.z = floatBitsToInt(intBitsToFloat(PV0i.y) + intBitsToFloat(R127i.w)); -R127i.w = floatBitsToInt(-(intBitsToFloat(uf_remappedPS[7].z)/resScale)); //ok +R127i.w = floatBitsToInt(-(intBitsToFloat(uf_remappedPS[7].z))); R126i.z = uf_remappedPS[7].z; PS1i = R126i.z; // 6 @@ -212,9 +212,9 @@ backupReg0i = R127i.x; R127i.x = floatBitsToInt(intBitsToFloat(R126i.y) + intBitsToFloat(R125i.y)); PV0i.y = PV1i.z; PV0i.y = clampFI32(PV0i.y); -R123i.z = floatBitsToInt((mul_nonIEEE(intBitsToFloat(PV1i.x),intBitsToFloat(uf_remappedPS[7].x)) + intBitsToFloat(uf_remappedPS[8].y)));// +R123i.z = floatBitsToInt((mul_nonIEEE(intBitsToFloat(PV1i.x),intBitsToFloat(uf_remappedPS[7].x)) + intBitsToFloat(uf_remappedPS[8].y))); PV0i.z = R123i.z; -R123i.w = floatBitsToInt((mul_nonIEEE(intBitsToFloat(PV1i.y),intBitsToFloat(uf_remappedPS[7].x)) + intBitsToFloat(uf_remappedPS[8].x)));// +R123i.w = floatBitsToInt((mul_nonIEEE(intBitsToFloat(PV1i.y),intBitsToFloat(uf_remappedPS[7].x)) + intBitsToFloat(uf_remappedPS[8].x))); PV0i.w = R123i.w; tempResultf = 1.0 / sqrt(intBitsToFloat(backupReg0i)); R125i.x = floatBitsToInt(tempResultf); @@ -230,8 +230,8 @@ R1i.w = PV0i.y; PS1i = R1i.w; // 8 backupReg0i = R127i.x; -R127i.x = floatBitsToInt(-(intBitsToFloat(uf_remappedPS[7].z)/ resScale)); -PV0i.y = floatBitsToInt(intBitsToFloat(PV1i.w) + intBitsToFloat(uf_remappedPS[9].y));// +R127i.x = floatBitsToInt(-(intBitsToFloat(uf_remappedPS[7].z))); +PV0i.y = floatBitsToInt(intBitsToFloat(PV1i.w) + intBitsToFloat(uf_remappedPS[9].y)); PV0i.y = floatBitsToInt(intBitsToFloat(PV0i.y) / 2.0); PV0i.z = floatBitsToInt(intBitsToFloat(PV1i.x) + intBitsToFloat(uf_remappedPS[9].x)); PV0i.z = floatBitsToInt(intBitsToFloat(PV0i.z) / 2.0); @@ -248,17 +248,17 @@ PV1i.w = floatBitsToInt(mul_nonIEEE(intBitsToFloat(PV0i.y), intBitsToFloat(uf_re R3i.w = PV0i.w; PS1i = R3i.w; // 10 -R0i.x = floatBitsToInt(intBitsToFloat(PV1i.x) + intBitsToFloat(R127i.w)); +R0i.x = floatBitsToInt(intBitsToFloat(PV1i.x) + intBitsToFloat(R127i.w) / resScale); R4i.y = floatBitsToInt((mul_nonIEEE(-(intBitsToFloat(R1i.x)),intBitsToFloat(R125i.x)) + intBitsToFloat(R6i.x))); R127i.z = floatBitsToInt(-(intBitsToFloat(PV1i.w)) + 1.0); PV0i.z = R127i.z; R2i.w = floatBitsToInt(intBitsToFloat(R126i.y) + intBitsToFloat(PV1i.x)); -R1i.x = floatBitsToInt(intBitsToFloat(PV1i.x) + intBitsToFloat(R127i.w)); +R1i.x = floatBitsToInt(intBitsToFloat(PV1i.x) + intBitsToFloat(R127i.w) / resScale); PS0i = R1i.x; // 11 R2i.x = floatBitsToInt(intBitsToFloat(R127i.x) + intBitsToFloat(PV0i.z)); -R0i.y = floatBitsToInt(intBitsToFloat(PV0i.z) + intBitsToFloat(R127i.w)); -R3i.z = floatBitsToInt(intBitsToFloat(uf_remappedPS[7].z) / resScale + intBitsToFloat(R126i.x)); +R0i.y = floatBitsToInt(intBitsToFloat(PV0i.z) + intBitsToFloat(R127i.w) / resScale); +R3i.z = floatBitsToInt(intBitsToFloat(uf_remappedPS[7].z) / resScale + intBitsToFloat(R126i.x)); // R4i.w = floatBitsToInt((mul_nonIEEE(-(intBitsToFloat(R1i.y)),intBitsToFloat(R125i.x)) + intBitsToFloat(R6i.y))); R1i.y = floatBitsToInt(intBitsToFloat(PV0i.z) + intBitsToFloat(R126i.z)); PS1i = R1i.y; @@ -266,9 +266,9 @@ PS1i = R1i.y; backupReg0i = R1i.z; backupReg1i = R0i.w; R3i.x = floatBitsToInt(-(intBitsToFloat(R125i.y)) + 1.0); -R3i.y = floatBitsToInt(intBitsToFloat(uf_remappedPS[7].z)/resScale + intBitsToFloat(R127i.z)); -R1i.z = floatBitsToInt((mul_nonIEEE(-(intBitsToFloat(backupReg0i) / resScale),intBitsToFloat(R125i.x)) + intBitsToFloat(R5i.z))); -R0i.w = floatBitsToInt(mul_nonIEEE(intBitsToFloat(backupReg1i), intBitsToFloat(uf_remappedPS[1].w))); +R3i.y = floatBitsToInt(intBitsToFloat(uf_remappedPS[7].z) / resScale + intBitsToFloat(R127i.z)); // +R1i.z = floatBitsToInt((mul_nonIEEE(-(intBitsToFloat(backupReg0i)),intBitsToFloat(R125i.x)) + intBitsToFloat(R5i.z))); +R0i.w = floatBitsToInt(mul_nonIEEE(intBitsToFloat(backupReg1i), intBitsToFloat(uf_remappedPS[1].w)));//N } if( activeMaskStackC[1] == true ) { R0i.x = floatBitsToInt(texture(textureUnitPS2, vec3(intBitsToFloat(R0i.xy), intBitsToFloat(R0i.w)))); diff --git a/Workaround/XenobladeX_AdjustableBrightness/bd74794730fc559a_00000000ff249249_ps.txt b/Workaround/XenobladeX_AdjustableBrightness/bd74794730fc559a_00000000ff249249_ps.txt index b8709f5c..e7fc52ab 100644 --- a/Workaround/XenobladeX_AdjustableBrightness/bd74794730fc559a_00000000ff249249_ps.txt +++ b/Workaround/XenobladeX_AdjustableBrightness/bd74794730fc559a_00000000ff249249_ps.txt @@ -3,7 +3,7 @@ #extension GL_ARB_separate_shader_objects : enable // shader bd74794730fc559a //tweak glare, less J.J. Abrams -const float glare = 0.85; //reflection on skell, characters, metal objects etc +const float glare = 0.95; //reflection on skell, characters, metal objects etc uniform ivec4 uf_remappedPS[12]; layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf5196000 res 1280x720x1 dim 1 tm: 4 format 0810 compSel: 0 1 4 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 0 layout(binding = 1) uniform sampler2D textureUnitPS1;// Tex1 addr 0xf4386000 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: 0