[XCX] ambient occlusion scaling

Add - Scaling of AO noise, blur steps and partial coverage
This commit is contained in:
getdls 2017-12-17 18:17:40 +01:00
parent 9917ec52f7
commit 5f6725df66
4 changed files with 755 additions and 0 deletions

View File

@ -0,0 +1,118 @@
<?php
include 'Source/functions.php';
$fullWidth = $argv[1];
$fullHeight = $argv[2];
$scaleFactorX = always_decimal_format($fullWidth / 1280.0);
$scaleFactorY = always_decimal_format($fullHeight / 720.0);
?>
#version 420
#extension GL_ARB_texture_gather : enable
// shader 5098356af9ebfe85
//AO pass 3 vertical blur
const float resScale = <?=$scaleFactorX?>;
//const float resScale = 4.0;
uniform ivec4 uf_remappedPS[2];
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf5911000 res 640x360x1 dim 1 tm: 4 format 0007 compSel: 0 1 4 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 0
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()
{
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 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 = passParameterSem0;
// 0
PV0f.x = -(intBitsToFloat(uf_remappedPS[0].y)/ resScale);
PV0f.x /= 2.0;
R127f.y = intBitsToFloat(uf_remappedPS[0].y) / resScale;
R127f.y /= 2.0;
R127f.z = 0.0;
PV0f.z = R127f.z;
PV0f.w = intBitsToFloat(uf_remappedPS[0].y) / resScale * intBitsToFloat(0xbfc00000);
R126f.z = intBitsToFloat(uf_remappedPS[0].y) / resScale*1.5;// *1.5;
PS0f = R126f.z;
// 1
R1f.x = PV0f.z + R0f.x;
R1f.y = PV0f.w + R0f.y;
R0f.z = PV0f.z + R0f.x;
R0f.w = PV0f.x + R0f.y;
R2f.x = PV0f.z + R0f.x;
PS1f = R2f.x;
// 2
backupReg0f = R0f.x;
R0f.x = intBitsToFloat(uf_remappedPS[1].z) * intBitsToFloat(0x40100000);
R2f.y = R127f.y + R0f.y;
R1f.z = intBitsToFloat(uf_remappedPS[1].z) * 0.25;
R3f.w = R127f.z + backupReg0f;
R3f.y = R126f.z + R0f.y;
PS0f = R3f.y;
R1f.x = (texture(textureUnitPS0, R1f.xy).x);
R3f.x = (texture(textureUnitPS0, R0f.zw).x);
R2f.x = (texture(textureUnitPS0, R2f.xy).x);
R4f.x = (texture(textureUnitPS0, R3f.wy).x);
// 0
R127f.x = -(R1f.x) + 1.0;
R127f.y = -(R1f.z) * intBitsToFloat(0x3fb8aa3b);
PV0f.z = -(R0f.x) * intBitsToFloat(0x3fb8aa3b);
R127f.w = -(R3f.x) + 1.0;
R0f.w = 1.0;
PS0f = R0f.w;
// 1
R126f.x = -(R2f.x) + 1.0;
R126f.y = -(R4f.x) + 1.0;
R125f.w = exp2(PV0f.z);
PS1f = R125f.w;
// 2
PV0f.y = PS1f + 0.0;
R123f.z = (R127f.x * PS1f + 0.0);
PV0f.z = R123f.z;
R126f.w = exp2(R127f.y);
PS0f = R126f.w;
// 3
R123f.y = (R127f.w * PS0f + PV0f.z);
PV1f.y = R123f.y;
PV1f.z = PV0f.y + PS0f;
// 4
PV0f.z = R126f.w + PV1f.z;
R123f.w = (R126f.w * R126f.x + PV1f.y);
PV0f.w = R123f.w;
// 5
backupReg0f = R125f.w;
PV1f.x = R125f.w + PV0f.z;
R125f.w = (backupReg0f * R126f.y + PV0f.w);
// 6
PS0f = 1.0 / PV1f.x;
// 7
PV1f.y = R125f.w * PS0f;
// 8
R0f.x = (-(PV1f.y) * intBitsToFloat(uf_remappedPS[1].y) + 1.0);
R0f.x = clamp(R0f.x, 0.0, 1.0);
// export
passPixelColor0 = vec4(R0f.x, R0f.x, R0f.x, R0f.w);
}

View File

@ -0,0 +1,121 @@
<?php
include 'Source/functions.php';
$fullWidth = $argv[1];
$fullHeight = $argv[2];
$scaleFactorX = always_decimal_format($fullWidth / 1280.0);
$scaleFactorY = always_decimal_format($fullHeight / 720.0);
?>
#version 420
#extension GL_ARB_texture_gather : enable
// shader 5b5c7c2a52ed1459
// AO step 2 horizontal blur
const float resScale = <?=$scaleFactorX?>;
//const float resScale = 4.0;
uniform ivec4 uf_remappedPS[2];
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf589e000 res 640x360x1 dim 1 tm: 4 format 0007 compSel: 0 1 4 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 0
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()
{
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 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 = passParameterSem0;
// 0
PV0f.x = -(intBitsToFloat(uf_remappedPS[0].x) / resScale);
PV0f.x /= 2.0 ;
PV0f.y = 0.0;
R126f.z = 0.0;
PV0f.z = R126f.z;
PV0f.w = intBitsToFloat(uf_remappedPS[0].x) / resScale * intBitsToFloat(0xbfc00000) ; //-1.5
R127f.z = intBitsToFloat(uf_remappedPS[0].x) / resScale;
R127f.z /= 2.0 ;
PS0f = R127f.z ;
// 1
R1f.x = R0f.x + PV0f.w ;
R1f.y = R0f.y + PV0f.z ;
R0f.z = R0f.x + PV0f.x ;
R0f.w = R0f.y + PV0f.y ;
PS1f = 0.0;
// 2
backupReg0f = R0f.x;
backupReg1f = R0f.y;
PV0f.x = intBitsToFloat(uf_remappedPS[1].z) * 0.25;
PV0f.y = intBitsToFloat(uf_remappedPS[1].z) * intBitsToFloat(0x40100000); //2.25
R1f.z = backupReg0f + R127f.z;
R1f.w = backupReg1f + PS1f;
PS0f = intBitsToFloat(uf_remappedPS[0].x) / resScale*1.5;// *1.5;
// 3
R3f.x = -(PV0f.x) * intBitsToFloat(0x3fb8aa3b); //1.442695
R2f.y = R0f.y + R126f.z;
R2f.z = R0f.x + PS0f;
R2f.w = -(PV0f.y) * intBitsToFloat(0x3fb8aa3b); //1.442695
R5f.y = 0.0;
PS1f = R5f.y;
R1f.x = (texture(textureUnitPS0, R1f.xy).x);
R0f.x = (texture(textureUnitPS0, R0f.zw).x);
R2f.x = (texture(textureUnitPS0, R1f.zw).x);
R4f.x = (texture(textureUnitPS0, R2f.zy).x);
// 0
R127f.x = -(R2f.x) + 1.0;
PV0f.z = -(R1f.x) + 1.0;
R127f.w = -(R0f.x) + 1.0;
R126f.x = exp2(R2f.w);
PS0f = R126f.x;
// 1
R125f.x = -(R4f.x) + 1.0;
R123f.y = (PV0f.z * PS0f + 0.0);
PV1f.y = R123f.y;
PV1f.z = PS0f + 0.0;
R5f.w = 1.0;
R126f.z = exp2(R3f.x);
PS1f = R126f.z;
// 2
R123f.y = (R127f.w * PS1f + PV1f.y);
PV0f.y = R123f.y;
PV0f.w = PV1f.z + PS1f;
// 3
R123f.y = (R126f.z * R127f.x + PV0f.y);
PV1f.y = R123f.y;
PV1f.z = R126f.z + PV0f.w;
// 4
PV0f.y = R126f.x + PV1f.z;
R127f.w = (R126f.x * R125f.x + PV1f.y);
// 5
PS1f = 1.0 / PV0f.y;
// 6
PV0f.z = R127f.w * PS1f;
// 7
R5f.x = -(PV0f.z) + 1.0;
// export
passPixelColor0 = vec4(R5f.x, R5f.y, R5f.y, R5f.w);
}

View File

@ -0,0 +1,455 @@
<?php
include 'Source/functions.php';
$fullWidth = $argv[1];
$fullHeight = $argv[2];
$scaleFactorX = always_decimal_format($fullWidth / 1280.0);
$scaleFactorY = always_decimal_format($fullHeight / 720.0);
?>
#version 420
#extension GL_ARB_texture_gather : enable
// shader 986b29629873321d
/// AO 1st pass detection
const float AOScale = 1.5; // AO detail vs volume 1.5 as a compromise 1.0 default. Scale to res = 100% detail but sharp and tiny. lines 357, 360 for comments: Needs blur++
const float noiseScale = <?=$scaleFactorX?>;
//const float noiseScale = 4.0; //multiple of noise texture samples ie banding vs details
uniform ivec4 uf_remappedPS[4];
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf5f0a000 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: 0
layout(binding = 1) uniform sampler2D textureUnitPS1;// Tex1 addr 0xf5984000 res 4x4x1 dim 1 tm: 2 format 081e compSel: 0 1 4 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler1 ClampX/Y/Z: 0 0 0 border: 0
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 R1i = ivec4(0);
ivec4 R2i = ivec4(0);
ivec4 R3i = ivec4(0);
ivec4 R4i = ivec4(0);
ivec4 R5i = ivec4(0);
ivec4 R6i = ivec4(0);
ivec4 R7i = ivec4(0);
ivec4 R8i = ivec4(0);
ivec4 R9i = ivec4(0);
ivec4 R10i = ivec4(0);
ivec4 R11i = ivec4(0);
ivec4 R12i = ivec4(0);
ivec4 R13i = ivec4(0);
ivec4 R14i = ivec4(0);
ivec4 R15i = ivec4(0);
ivec4 R16i = ivec4(0);
ivec4 R17i = ivec4(0);
ivec4 R18i = ivec4(0);
ivec4 R19i = ivec4(0);
ivec4 R20i = ivec4(0);
ivec4 R21i = ivec4(0);
ivec4 R22i = ivec4(0);
ivec4 R23i = ivec4(0);
ivec4 R24i = ivec4(0);
ivec4 R25i = ivec4(0);
ivec4 R26i = ivec4(0);
ivec4 R27i = ivec4(0);
ivec4 R28i = ivec4(0);
ivec4 R29i = ivec4(0);
ivec4 R30i = ivec4(0);
ivec4 R31i = ivec4(0);
ivec4 R32i = ivec4(0);
ivec4 R33i = ivec4(0);
ivec4 R34i = ivec4(0);
ivec4 R35i = ivec4(0);
ivec4 R36i = ivec4(0);
ivec4 R37i = ivec4(0);
ivec4 R38i = ivec4(0);
ivec4 R39i = ivec4(0);
ivec4 R40i = ivec4(0);
ivec4 R41i = ivec4(0);
ivec4 R42i = ivec4(0);
ivec4 R43i = ivec4(0);
ivec4 R44i = ivec4(0);
ivec4 R45i = ivec4(0);
ivec4 R46i = ivec4(0);
ivec4 R47i = ivec4(0);
ivec4 R48i = ivec4(0);
ivec4 R49i = ivec4(0);
ivec4 R50i = ivec4(0);
ivec4 R51i = ivec4(0);
ivec4 R52i = ivec4(0);
ivec4 R53i = ivec4(0);
ivec4 R54i = ivec4(0);
ivec4 R55i = ivec4(0);
ivec4 R56i = ivec4(0);
ivec4 R57i = ivec4(0);
ivec4 R58i = ivec4(0);
ivec4 R59i = ivec4(0);
ivec4 R60i = ivec4(0);
ivec4 R61i = ivec4(0);
ivec4 R62i = ivec4(0);
ivec4 R63i = ivec4(0);
ivec4 R64i = ivec4(0);
ivec4 R65i = ivec4(0);
ivec4 R66i = ivec4(0);
ivec4 R67i = ivec4(0);
ivec4 R68i = ivec4(0);
ivec4 R69i = ivec4(0);
ivec4 R70i = ivec4(0);
ivec4 R71i = ivec4(0);
ivec4 R72i = ivec4(0);
ivec4 R73i = ivec4(0);
ivec4 R74i = ivec4(0);
ivec4 R75i = ivec4(0);
ivec4 R76i = ivec4(0);
ivec4 R77i = ivec4(0);
ivec4 R78i = ivec4(0);
ivec4 R79i = ivec4(0);
ivec4 R80i = ivec4(0);
ivec4 R81i = ivec4(0);
ivec4 R82i = ivec4(0);
ivec4 R83i = ivec4(0);
ivec4 R84i = ivec4(0);
ivec4 R85i = ivec4(0);
ivec4 R86i = ivec4(0);
ivec4 R87i = ivec4(0);
ivec4 R88i = ivec4(0);
ivec4 R89i = ivec4(0);
ivec4 R90i = ivec4(0);
ivec4 R91i = ivec4(0);
ivec4 R92i = ivec4(0);
ivec4 R93i = ivec4(0);
ivec4 R94i = ivec4(0);
ivec4 R95i = ivec4(0);
ivec4 R96i = ivec4(0);
ivec4 R97i = ivec4(0);
ivec4 R98i = ivec4(0);
ivec4 R99i = ivec4(0);
ivec4 R100i = ivec4(0);
ivec4 R101i = ivec4(0);
ivec4 R102i = ivec4(0);
ivec4 R103i = ivec4(0);
ivec4 R104i = ivec4(0);
ivec4 R105i = ivec4(0);
ivec4 R106i = ivec4(0);
ivec4 R107i = ivec4(0);
ivec4 R108i = ivec4(0);
ivec4 R109i = ivec4(0);
ivec4 R110i = ivec4(0);
ivec4 R111i = ivec4(0);
ivec4 R112i = ivec4(0);
ivec4 R113i = ivec4(0);
ivec4 R114i = ivec4(0);
ivec4 R115i = ivec4(0);
ivec4 R116i = ivec4(0);
ivec4 R117i = ivec4(0);
ivec4 R118i = ivec4(0);
ivec4 R119i = ivec4(0);
ivec4 R120i = ivec4(0);
ivec4 R121i = ivec4(0);
ivec4 R122i = ivec4(0);
ivec4 R123i = ivec4(0);
ivec4 R124i = ivec4(0);
ivec4 R125i = ivec4(0);
ivec4 R126i = 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;
bool activeMaskStack[2];
bool activeMaskStackC[3];
activeMaskStack[0] = false;
activeMaskStackC[0] = false;
activeMaskStackC[1] = false;
activeMaskStack[0] = true;
activeMaskStackC[0] = true;
activeMaskStackC[1] = true;
vec3 cubeMapSTM;
int cubeMapFaceId;
R0i = floatBitsToInt(passParameterSem0 );
if( activeMaskStackC[1] == true ) {
R9i.xy = floatBitsToInt(texture(textureUnitPS0, intBitsToFloat(R0i.xy) ).xx);
}
if( activeMaskStackC[1] == true ) {
R1i.x = 0xbe000000;
R1i.y = 0x3e5db3c0 ; // to be tweaked later, cut off points
R0i.z = floatBitsToInt(intBitsToFloat(uf_remappedPS[0].z) * intBitsToFloat(0x3c75c28f)); //n
PV0i.z = R0i.z;
R2i.x = 0xbe800000;
PS0i = R2i.x;
// 1
R3i.x = 0x3f400000;
R2i.y = 0xbeddb3e1; // NNN
R0i.w = floatBitsToInt((intBitsToFloat(uf_remappedPS[1].w) * intBitsToFloat(0x3c75c28f) + intBitsToFloat(PV0i.z))); //n
R3i.y = 0x3f000000;
PS1i = R3i.y;
R4i.x = 0x3e304eb9 ; // to be tweaked later, cut off points
R5i.x = 0x3e474d45;
PS0i = R5i.x;
// 3
R6i.x = 0x3e157895; //NN
PS1i = floatBitsToInt(1.0 / intBitsToFloat(uf_remappedPS[0].x));//n
PS1i = floatBitsToInt(intBitsToFloat(PS1i) / 2.0);
// 4
R10i.x = 0x3ff7d5aa;
R123i.w = floatBitsToInt((intBitsToFloat(R0i.x) * intBitsToFloat(uf_remappedPS[0].x) + -(intBitsToFloat(PS1i))));//N
PV0i.w = R123i.w;
PS0i = floatBitsToInt(1.0 / intBitsToFloat(uf_remappedPS[0].y));
PS0i = floatBitsToInt(intBitsToFloat(PS0i) / 2.0);
// 5
R7i.x = 0x3fdda0c7;
R1i.z = floatBitsToInt((intBitsToFloat(R0i.y) * intBitsToFloat(uf_remappedPS[0].y) + -(intBitsToFloat(PS0i))));//N
R4i.w = floatBitsToInt(intBitsToFloat(PV0i.w) * 0.25*noiseScale); //NNN
R8i.x = 0x3fa95400; /// to be tweaked later, cut off points
PS1i = R8i.x;
// 6
R13i.x = R1i.x;
R13i.y = R1i.y;
// 7
R14i.x = R2i.x;
R14i.y = R2i.y;
// 8
R15i.x = R3i.x;
R15i.y = R3i.y;
// 9
R16i.x = R4i.x;
// 10
R17i.x = R5i.x;
// 11
R18i.x = R6i.x;
// 12
R19i.x = R10i.x;
// 13
R20i.x = R7i.x;
// 14
R4i.y = floatBitsToInt(intBitsToFloat(R1i.z) * 0.25*noiseScale);
}
if( activeMaskStackC[1] == true ) {
R3i.xy = floatBitsToInt(texture(textureUnitPS1, intBitsToFloat(R4i.wy)).xy);// insert better noise here.. some day
}
if( activeMaskStackC[1] == true ) {
activeMaskStack[1] = activeMaskStack[0];
activeMaskStackC[2] = activeMaskStackC[1];
// 0
R21i.x = R8i.x;
// 1
R4i.x = floatBitsToInt(-(intBitsToFloat(R3i.x))); //pos
R1i.y = R3i.y ; //Don't scale here
// 2
predResult = (intBitsToFloat(R9i.x) >= intBitsToFloat(R0i.w));
activeMaskStack[1] = predResult;
activeMaskStackC[2] = predResult == true && activeMaskStackC[1] == true;
}
else {
activeMaskStack[1] = false;
activeMaskStackC[2] = false;
}
if( activeMaskStackC[2] == true ) {
// 0
R0i.x = 0x3f800000;
R0i.y = 0;
}
activeMaskStack[1] = activeMaskStack[1] == false;
activeMaskStackC[2] = activeMaskStack[1] == true && activeMaskStackC[1] == true;
if( activeMaskStackC[2] == true ) {
// 0
R127i.x = floatBitsToInt(intBitsToFloat(R9i.y) + 1.0);
PV0i.y = floatBitsToInt(intBitsToFloat(R9i.y) * intBitsToFloat(uf_remappedPS[2].z));//n
PV0i.z = uf_remappedPS[2].y;//n
PV0i.z = floatBitsToInt(intBitsToFloat(PV0i.z) / 2.0);
R5i.x = 0;
PS0i = R5i.x;
// 1
R6i.x = PV0i.z;
PV1i.y = floatBitsToInt(max(intBitsToFloat(PV0i.y), intBitsToFloat(uf_remappedPS[2].z)));//n
R6i.y = PV0i.z;
PS1i = R6i.y;
// 2
R0i.w = floatBitsToInt(min(intBitsToFloat(PV1i.y), intBitsToFloat(0x42c80000)));
PS0i = floatBitsToInt(1.0 / intBitsToFloat(R127i.x));
// 3
PV1i.y = floatBitsToInt(intBitsToFloat(PS0i) * intBitsToFloat(uf_remappedPS[1].x));//prob
R3i.w = floatBitsToInt(intBitsToFloat(PS0i) * intBitsToFloat(uf_remappedPS[1].z)); //*4 prob
R3i.w = clampFI32(R3i.w);
// 4
PV0i.z = floatBitsToInt(max(intBitsToFloat(PV1i.y), intBitsToFloat(0x3cf5c28f)));
// 5
R3i.z = floatBitsToInt(min(intBitsToFloat(PV0i.z), intBitsToFloat(0x3e19999a)));
}
while( activeMaskStackC[2] == true )
{
if( activeMaskStackC[2] == true ) {
// 0
R1i.z = (0x00000003 > R5i.x)?int(0xFFFFFFFF):int(0x0);
// 1
predResult = (R1i.z != 0);
if( predResult == false ) break;
}
if( activeMaskStackC[2] == true ) {
// 0
R2i.x = R5i.x;
R1i.x = R5i.x + 0x00000006; //5?
PS0i = R1i.x;
// 1
tempResulti = R2i.x;
tempResulti = clamp(tempResulti, -256, 255);
ARi.x = tempResulti;
PV1i.x = tempResulti;
// 2
R2i.x = ((ARi.x==0)?R13i.x:(ARi.x==1)?R14i.x:(ARi.x==2)?R15i.x:(ARi.x==3)?R16i.x:(ARi.x==4)?R17i.x:(ARi.x==5)?R18i.x:(ARi.x==6)?R19i.x:(ARi.x==7)?R20i.x:(ARi.x==8)?R21i.x:(ARi.x==110)?R123i.x:(ARi.x==113)?R126i.x:(ARi.x==114)?R127i.x:0);
R2i.y = ((ARi.x==0)?R13i.y:(ARi.x==1)?R14i.y:(ARi.x==2)?R15i.y:(ARi.x==3)?R16i.y:(ARi.x==4)?R17i.y:(ARi.x==5)?R18i.y:(ARi.x==6)?R19i.y:(ARi.x==7)?R20i.y:(ARi.x==8)?R21i.y:(ARi.x==110)?R123i.y:(ARi.x==113)?R126i.y:(ARi.x==114)?R127i.y:0);
// 3
tempResulti = R1i.x;
tempResulti = clamp(tempResulti, -256, 255);
ARi.x = tempResulti;
PV1i.x = tempResulti;
// 4
R1i.x = ((ARi.x==0)?R13i.x:(ARi.x==1)?R14i.x:(ARi.x==2)?R15i.x:(ARi.x==3)?R16i.x:(ARi.x==4)?R17i.x:(ARi.x==5)?R18i.x:(ARi.x==6)?R19i.x:(ARi.x==7)?R20i.x:(ARi.x==8)?R21i.x:(ARi.x==110)?R123i.x:(ARi.x==113)?R126i.x:(ARi.x==114)?R127i.x:0);
// 5
backupReg0i = R0i.w;
PV1i.x = floatBitsToInt(intBitsToFloat(R4i.x) * intBitsToFloat(R2i.y));
PV1i.y = R1i.x;
PV1i.w = floatBitsToInt(intBitsToFloat(R1i.y) * intBitsToFloat(R2i.y));
R2i.w = floatBitsToInt(1.0 / intBitsToFloat(backupReg0i));
PS1i = R2i.w;
// 6
backupReg0i = R5i.x;
R1i.x = R5i.x + 0x00000003; // //3
R123i.y = floatBitsToInt((intBitsToFloat(R2i.x) * intBitsToFloat(R3i.x) + intBitsToFloat(PV1i.w)));
PV0i.y = R123i.y;
R123i.z = floatBitsToInt((intBitsToFloat(R2i.x) * intBitsToFloat(R3i.y) + intBitsToFloat(PV1i.x)));
PV0i.z = R123i.z;
PV0i.w = floatBitsToInt(intBitsToFloat(R3i.z) * intBitsToFloat(PV1i.y));
R5i.x = backupReg0i + int(1);
PS0i = R5i.x;
// 7
PV1i.z = PV0i.y;
PV1i.w = floatBitsToInt(intBitsToFloat(PV0i.z) * intBitsToFloat(uf_remappedPS[1].y)/AOScale);
PS1i = floatBitsToInt(1.0 / intBitsToFloat(PV0i.w));
// 8
//scale here
PV0i.x = floatBitsToInt(intBitsToFloat(R3i.z) * intBitsToFloat(PV1i.w) / AOScale);
PV0i.z = floatBitsToInt(intBitsToFloat(PS1i) * intBitsToFloat(0x40400000) * AOScale);//intensity
PV0i.w = floatBitsToInt(intBitsToFloat(R3i.z) * intBitsToFloat(PV1i.z) / AOScale); //
// 9
R2i.x = floatBitsToInt(intBitsToFloat(R0i.x) + intBitsToFloat(PV0i.x) / AOScale);
R2i.y = floatBitsToInt(intBitsToFloat(R0i.y) + intBitsToFloat(PV0i.w) / AOScale); //
R1i.z = floatBitsToInt(intBitsToFloat(R0i.x) + -(intBitsToFloat(PV0i.x) / AOScale));
R1i.w = floatBitsToInt(intBitsToFloat(R0i.y) + -(intBitsToFloat(PV0i.w) / AOScale));
R2i.z = floatBitsToInt(intBitsToFloat(R3i.w) * intBitsToFloat(PV0i.z)* AOScale);
PS1i = R2i.z;
}
if( activeMaskStackC[2] == true ) {
R2i.x = floatBitsToInt(texture(textureUnitPS0, intBitsToFloat(R2i.xy)).x);
R2i.y = floatBitsToInt(texture(textureUnitPS0, intBitsToFloat(R1i.zw)).x);
}
if( activeMaskStackC[2] == true ) {
// 0
tempResulti = R1i.x;
tempResulti = clamp(tempResulti, -256, 255);
ARi.x = tempResulti;
PV0i.x = tempResulti;
// 1
R1i.x = ((ARi.x==0)?R13i.x:(ARi.x==1)?R14i.x:(ARi.x==2)?R15i.x:(ARi.x==3)?R16i.x:(ARi.x==4)?R17i.x:(ARi.x==5)?R18i.x:(ARi.x==6)?R19i.x:(ARi.x==7)?R20i.x:(ARi.x==8)?R21i.x:(ARi.x==110)?R123i.x:(ARi.x==113)?R126i.x:(ARi.x==114)?R127i.x:0);
// 2
PV0i.y = floatBitsToInt(-(intBitsToFloat(R9i.y)) + intBitsToFloat(R2i.x));
PV0i.w = floatBitsToInt(-(intBitsToFloat(R9i.y)) + intBitsToFloat(R2i.y));
// 3
R127i.x = floatBitsToInt((intBitsToFloat(R2i.z) * intBitsToFloat(PV0i.y) + 0.5));
R127i.x = clampFI32(R127i.x);
PV1i.x = R127i.x;
R127i.y = floatBitsToInt((intBitsToFloat(R2i.z) * intBitsToFloat(PV0i.w) + 0.5));
R127i.y = clampFI32(R127i.y);
PV1i.y = R127i.y;
PV1i.z = floatBitsToInt(max(intBitsToFloat(PV0i.w), -(intBitsToFloat(PV0i.w))));
PV1i.w = floatBitsToInt(max(intBitsToFloat(PV0i.y), -(intBitsToFloat(PV0i.y))));
// 4
PV0i.x = floatBitsToInt(intBitsToFloat(R0i.w) + -(intBitsToFloat(PV1i.w)));
PV0i.y = floatBitsToInt(intBitsToFloat(R0i.w) + -(intBitsToFloat(PV1i.z)));
PV0i.z = floatBitsToInt(-(intBitsToFloat(PV1i.y)) + 1.0);
PV0i.w = floatBitsToInt(-(intBitsToFloat(PV1i.x)) + 1.0);
// 5
R126i.x = floatBitsToInt(intBitsToFloat(PV0i.y) * intBitsToFloat(R2i.w));
R126i.x = clampFI32(R126i.x);
PV1i.x = R126i.x;
PV1i.y = floatBitsToInt(intBitsToFloat(PV0i.z) + -(0.5));
R127i.z = floatBitsToInt(intBitsToFloat(PV0i.x) * intBitsToFloat(R2i.w));
R127i.z = clampFI32(R127i.z);
PV1i.z = R127i.z;
PV1i.w = floatBitsToInt(intBitsToFloat(PV0i.w) + -(0.5));
// 6
R126i.y = floatBitsToInt((intBitsToFloat(PV1i.y) * intBitsToFloat(PV1i.x) + 0.5));
PV0i.y = R126i.y;
R127i.w = floatBitsToInt((intBitsToFloat(PV1i.w) * intBitsToFloat(PV1i.z) + 0.5));
PV0i.w = R127i.w;
// 7
PV1i.y = floatBitsToInt(intBitsToFloat(R127i.y) + -(intBitsToFloat(PV0i.w)));
PV1i.z = floatBitsToInt(intBitsToFloat(R127i.x) + -(intBitsToFloat(PV0i.y)));
// 8
R123i.z = floatBitsToInt((intBitsToFloat(PV1i.y) * intBitsToFloat(R126i.x) + intBitsToFloat(R127i.w)));
PV0i.z = R123i.z;
R123i.w = floatBitsToInt((intBitsToFloat(PV1i.z) * intBitsToFloat(R127i.z) + intBitsToFloat(R126i.y)));
PV0i.w = R123i.w;
// 9
backupReg0i = R6i.x;
backupReg1i = R6i.y;
R6i.x = floatBitsToInt((intBitsToFloat(PV0i.w) * intBitsToFloat(R1i.x) + intBitsToFloat(backupReg0i)));
R6i.y = floatBitsToInt((intBitsToFloat(PV0i.z) * intBitsToFloat(R1i.x) + intBitsToFloat(backupReg1i)));
}
}
if( activeMaskStackC[2] == true ) {
// 0
backupReg0i = R0i.z;
PV0i.x = floatBitsToInt(intBitsToFloat(R6i.y) + -(0.5));
PV0i.x = floatBitsToInt(intBitsToFloat(PV0i.x) * 2.0);
PV0i.x = clampFI32(PV0i.x);
PV0i.y = floatBitsToInt(intBitsToFloat(R6i.x) + -(0.5));
PV0i.y = floatBitsToInt(intBitsToFloat(PV0i.y) * 2.0);
PV0i.y = clampFI32(PV0i.y);
PV0i.z = floatBitsToInt(-(intBitsToFloat(backupReg0i)) + intBitsToFloat(R9i.y));
// 1
PV1i.y = floatBitsToInt(intBitsToFloat(PV0i.z) * intBitsToFloat(uf_remappedPS[3].x) ); //nope
PV1i.y = clampFI32(PV1i.y);
PV1i.w = floatBitsToInt(intBitsToFloat(PV0i.y) + intBitsToFloat(PV0i.x));
PV1i.w = clampFI32(PV1i.w);
// 2
PV0i.x = floatBitsToInt(intBitsToFloat(PV1i.w) + intBitsToFloat(PV1i.y));
PV0i.x = clampFI32(PV0i.x);
// 3
tempResultf = log2(intBitsToFloat(PV0i.x));
if( isinf(tempResultf) == true ) tempResultf = -3.40282347E+38F;
PS1i = floatBitsToInt(tempResultf);
// 4
PV0i.z = floatBitsToInt(intBitsToFloat(PS1i) * intBitsToFloat(uf_remappedPS[2].w)); //nope
// 5
R0i.y = 0;
R0i.x = floatBitsToInt(exp2(intBitsToFloat(PV0i.z)));
PS1i = R0i.x;
}
activeMaskStackC[1] = activeMaskStack[0] == true && activeMaskStackC[0] == true;
// export
passPixelColor0 = vec4(intBitsToFloat(R0i.x), intBitsToFloat(R0i.y), intBitsToFloat(R0i.y), intBitsToFloat(R0i.y));
//passPixelColor0 = vec4(intBitsToFloat(R0i.x), intBitsToFloat(R0i.y), intBitsToFloat(R0i.y), intBitsToFloat(R0i.y));
}

View File

@ -0,0 +1,61 @@
#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));
}