mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-25 09:52:56 +08:00
jitter dof (:
shadow jitter still not working
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
//#extension GL_EXT_gpu_shader4 : disable
|
||||
#include "/lib/settings.glsl"
|
||||
#include "/lib/res_params.glsl"
|
||||
#include "/lib/bokeh.glsl"
|
||||
|
||||
/*
|
||||
!! DO NOT REMOVE !!
|
||||
@ -31,6 +32,13 @@ uniform vec3 sunPosition;
|
||||
uniform float sunElevation;
|
||||
uniform sampler2D colortex4;
|
||||
|
||||
uniform int frameCounter;
|
||||
uniform float far;
|
||||
uniform float aspectRatio;
|
||||
uniform float viewHeight;
|
||||
uniform float viewWidth;
|
||||
uniform int hideGUI;
|
||||
uniform float screenBrightness;
|
||||
|
||||
uniform vec2 texelSize;
|
||||
uniform int framemod8;
|
||||
@ -81,4 +89,20 @@ void main() {
|
||||
#ifdef TAA
|
||||
gl_Position.xy += offsets[framemod8] * gl_Position.w*texelSize;
|
||||
#endif
|
||||
|
||||
#ifdef DOF_JITTER
|
||||
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 DOF_JITTER_FOCUS < 0
|
||||
float focusMul = gl_Position.z - mix(pow(512.0, screenBrightness), 512.0 * screenBrightness, 0.25);
|
||||
#else
|
||||
float focusMul = gl_Position.z - DOF_JITTER_FOCUS;
|
||||
#endif
|
||||
|
||||
vec2 totalOffset = (jitter * JITTER_STRENGTH) * focusMul * 1e-2;
|
||||
gl_Position.xy += hideGUI >= 1 ? totalOffset : vec2(0);
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user