[XCX] - Cleanup scale and remove old blur

Fix - Scales to res cut scene blur
Update - Remove old blur that doesn't scale
This commit is contained in:
getdls 2017-12-14 00:33:02 +01:00
parent d9dd2faba0
commit f8b64c7e98

View File

@ -8,12 +8,10 @@ $scaleFactorY = always_decimal_format($fullHeight / 720.0);
#version 420 #version 420
#extension GL_ARB_texture_gather : enable #extension GL_ARB_texture_gather : enable
// shader 840947e29015aa9a // fix circle // shader 840947e29015aa9a // Looking at LA cut-scene base blur
// cutscene DOF, reveal talk BG //
// To-do. Tweak blur scaling to resolution. Weights are funky, too bright //const float resScale = 3.0;
const float resScale = <?=$scaleFactorX?>; const float resScale = <?=$scaleFactorX?>;
//const float resScale = 3;
uniform ivec4 uf_remappedPS[3]; uniform ivec4 uf_remappedPS[3];
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf470a000 res 1280x720x1 dim 1 tm: 4 format 0816 compSel: 0 1 2 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 0 layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf470a000 res 1280x720x1 dim 1 tm: 4 format 0816 compSel: 0 1 2 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 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
@ -21,72 +19,6 @@ layout(location = 0) in vec4 passParameterSem0;
layout(location = 1) in vec4 passParameterSem1; layout(location = 1) in vec4 passParameterSem1;
layout(location = 0) out vec4 passPixelColor0; layout(location = 0) out vec4 passPixelColor0;
uniform vec2 uf_fragCoordScale; uniform vec2 uf_fragCoordScale;
vec2 Circle(float Start, float Points, float Point)
{
float Rad = (3.141592 * 2.0 * (1.0 / Points)) * (Point + Start);
return vec2(sin(Rad), cos(Rad));
}
highp float lineRand(vec2 co)
{
highp float a = 12.9898;
highp float b = 78.233;
highp float c = 43758.5453;
highp float dt = dot(co.xy, vec2(a, b));
highp float sn = mod(dt, 3.14);
return fract(sin(sn) * c);
}
vec4 circleBlur(sampler2D image, vec2 vuv, vec2 res) {
vec2 uv = vuv;
vec2 PixelOffset = 1.25 / res.xy; //1.0
float Start = 2.0 / 14.0;
vec2 Scale = 0.66 * 4.0 * 2.0 * PixelOffset.xy;
vec3 N0 = texture(image, uv + Circle(Start, 14.0, 0.0) * Scale).rgb;
vec3 N1 = texture(image, uv + Circle(Start, 14.0, 1.0) * Scale).rgb;
vec3 N2 = texture(image, uv + Circle(Start, 14.0, 2.0) * Scale).rgb;
vec3 N3 = texture(image, uv + Circle(Start, 14.0, 3.0) * Scale).rgb;
vec3 N4 = texture(image, uv + Circle(Start, 14.0, 4.0) * Scale).rgb;
vec3 N5 = texture(image, uv + Circle(Start, 14.0, 5.0) * Scale).rgb;
vec3 N6 = texture(image, uv + Circle(Start, 14.0, 6.0) * Scale).rgb;
vec3 N7 = texture(image, uv + Circle(Start, 14.0, 7.0) * Scale).rgb;
vec3 N8 = texture(image, uv + Circle(Start, 14.0, 8.0) * Scale).rgb;
vec3 N9 = texture(image, uv + Circle(Start, 14.0, 9.0) * Scale).rgb;
vec3 N10 = texture(image, uv + Circle(Start, 14.0, 10.0) * Scale).rgb;
vec3 N11 = texture(image, uv + Circle(Start, 14.0, 11.0) * Scale).rgb;
vec3 N12 = texture(image, uv + Circle(Start, 14.0, 12.0) * Scale).rgb;
vec3 N13 = texture(image, uv + Circle(Start, 14.0, 13.0) * Scale).rgb;
vec3 N14 = texture(image, uv).rgb;
vec3 color = vec3(0, 0, 0);
color.rgb =
(N0 * 0.01478636) +
(N1 * 0.03696590) +
(N2 * 0.07393179) +
(N3 * 0.07393179) +
(N4 * 0.12013917) +
(N5 * 0.16018555) +
(N6 * 0.17620411) +
(N7 * 0.17620411) +
(N8 * 0.16018555) +
(N9 * 0.12013917) +
(N10 * 0.07393179) +
(N11 * 0.07393179) +
(N12 * 0.03696590) +
(N13 * 0.03696590) +
(N14 * 0.01478636);
return vec4(color.rgb, 1.0);
}
int clampFI32(int v) int clampFI32(int v)
{ {
if( v == 0x7FFFFFFF ) if( v == 0x7FFFFFFF )
@ -121,28 +53,26 @@ void main()
int cubeMapFaceId; int cubeMapFaceId;
R0f = passParameterSem0; R0f = passParameterSem0;
R1f = passParameterSem1; R1f = passParameterSem1;
// 0er // 0
R2f.x = R1f.x + (intBitsToFloat(uf_remappedPS[0].x) / resScale); R2f.x = R1f.x + (intBitsToFloat(uf_remappedPS[0].x) / resScale);
R2f.y = R1f.y + (intBitsToFloat(uf_remappedPS[0].y) / resScale); R2f.y = R1f.y + (intBitsToFloat(uf_remappedPS[0].y) / resScale);
R0f.z = R1f.x + (intBitsToFloat(uf_remappedPS[0].z) ); R0f.z = R1f.x + (intBitsToFloat(uf_remappedPS[0].z) / resScale);
R0f.w = R1f.y + (intBitsToFloat(uf_remappedPS[0].w) ); R0f.w = R1f.y + (intBitsToFloat(uf_remappedPS[0].w) / resScale);
// 1 // 1
backupReg0f = R1f.x; backupReg0f = R1f.x;
backupReg1f = R1f.y; backupReg1f = R1f.y;
backupReg0f = R1f.x; backupReg0f = R1f.x;
backupReg1f = R1f.y; backupReg1f = R1f.y;
R1f.xyz = vec3(backupReg0f,backupReg1f,backupReg0f) + vec3(intBitsToFloat(uf_remappedPS[1].x) / resScale,intBitsToFloat(uf_remappedPS[1].y) / resScale,intBitsToFloat(uf_remappedPS[1].z)); R1f.xyz = vec3(backupReg0f,backupReg1f,backupReg0f) + vec3(intBitsToFloat(uf_remappedPS[1].x) / resScale,intBitsToFloat(uf_remappedPS[1].y) / resScale,intBitsToFloat(uf_remappedPS[1].z) / resScale);
R1f.w = backupReg1f + intBitsToFloat(uf_remappedPS[1].w) ; R1f.w = backupReg1f + intBitsToFloat(uf_remappedPS[1].w) / resScale;
R3f.xyz = (texture(textureUnitPS1, R2f.xy).xyz); R3f.xyz = (texture(textureUnitPS1, R2f.xy).xyz);
R4f.xyz = (texture(textureUnitPS1, R0f.zw).xyz); R4f.xyz = (texture(textureUnitPS1, R0f.zw).xyz);
R5f.xyz = (texture(textureUnitPS1, R1f.xy).xyz); R5f.xyz = (texture(textureUnitPS1, R1f.xy).xyz);
R6f.xyz = (texture(textureUnitPS1, R1f.zw).xyz); R6f.xyz = (texture(textureUnitPS1, R1f.zw).xyz);
R2f.xyz = (texture(textureUnitPS0, R2f.xy).xyz);
//R6f = circleBlur(textureUnitPS0, R1f.xy, textureSize(textureUnitPS0, 0)); R7f.xyz = (texture(textureUnitPS0, R0f.zw).xyz);
R2f.xyz = (circleBlur(textureUnitPS0, R2f.xy, textureSize(textureUnitPS0, 0)).xyz); R8f.xyz = (texture(textureUnitPS0, R1f.xy).xyz);
R7f.xyz = (circleBlur(textureUnitPS0, R0f.zw, textureSize(textureUnitPS0, 0)).xyz); R1f.xyz = (texture(textureUnitPS0, R1f.zw).xyz);
R8f.xyz = (circleBlur(textureUnitPS0, R1f.xy, textureSize(textureUnitPS0, 0)).xyz);
R1f.xyz = (circleBlur(textureUnitPS0, R1f.zw, textureSize(textureUnitPS0, 0)).xyz);
// 0 // 0
tempf.x = dot(vec4(R3f.x,R3f.y,R3f.z,-0.0),vec4(intBitsToFloat(0x3e000000),intBitsToFloat(0x41ff0000),intBitsToFloat(0x45fe0100),0.0)); tempf.x = dot(vec4(R3f.x,R3f.y,R3f.z,-0.0),vec4(intBitsToFloat(0x3e000000),intBitsToFloat(0x41ff0000),intBitsToFloat(0x45fe0100),0.0));
PV0f.x = tempf.x; PV0f.x = tempf.x;