fixed jitter dof and added it to dh geometry

This commit is contained in:
Sasha
2024-03-13 23:38:04 +00:00
parent e0f61f0128
commit 85a1b68bf0
6 changed files with 129 additions and 8 deletions

View File

@ -150,4 +150,22 @@ void main() {
#ifdef TAA
gl_Position.xy += offsets[framemod8] * gl_Position.w*texelSize;
#endif
#if DOF_QUALITY == 5
vec2 jitter = clamp(jitter_offsets[frameCounter % 64], -1.0, 1.0);
jitter = rotate(radians(float(frameCounter))) * jitter;
jitter.y *= aspectRatio;
jitter.x *= DOF_ANAMORPHIC_RATIO;
#if MANUAL_FOCUS == -2
float focusMul = 0;
#elif MANUAL_FOCUS == -1
float focusMul = gl_Position.z - mix(pow(512.0, screenBrightness), 512.0 * screenBrightness, 0.25);
#else
float focusMul = gl_Position.z - MANUAL_FOCUS;
#endif
vec2 totalOffset = (jitter * JITTER_STRENGTH) * focusMul * 1e-2;
gl_Position.xy += hideGUI >= 1 ? totalOffset : vec2(0);
#endif
}