mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-30 11:42:51 +08:00
More jitter DOF stuff
blur sky, and improve DOF a tiny bit, add a focus strength slider and focal point indicator. also tweaked the clouds a little
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
#extension GL_EXT_gpu_shader4 : enable
|
||||
#include "lib/settings.glsl"
|
||||
#include "/lib/res_params.glsl"
|
||||
#include "/lib/bokeh.glsl"
|
||||
@ -136,6 +135,9 @@ vec3 blackbody2(float Temp)
|
||||
#define SEASONS_VSH
|
||||
#include "/lib/climate_settings.glsl"
|
||||
|
||||
mat2 rotate(float angle){
|
||||
return mat2(cos(angle), -sin(angle), sin(angle), cos(angle));
|
||||
}
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
//////////////////////////////VOID MAIN//////////////////////////////
|
||||
@ -266,7 +268,9 @@ void main() {
|
||||
#endif
|
||||
|
||||
#ifdef DOF_JITTER
|
||||
vec2 jitter = jitter_offsets[1024 - (frameCounter % 1024)];
|
||||
vec2 jitter = clamp(jitter_offsets[1024 - (frameCounter % 1024)] ,-1.0,1.0) ;
|
||||
|
||||
jitter = rotate(frameTimeCounter) * jitter;
|
||||
jitter.y *= aspectRatio;
|
||||
|
||||
float focus = DOF_JITTER_FOCUS;
|
||||
@ -274,6 +278,6 @@ void main() {
|
||||
// float focus = texture2D(colortex4, coords).r;
|
||||
// focus = pow(far + 1.0, focus) - 1.0;
|
||||
float distanceToFocus = gl_Position.z - focus;
|
||||
gl_Position.xy += jitter * distanceToFocus * 1e-2;
|
||||
gl_Position.xy += (jitter * JITTER_STRENGTH) * distanceToFocus * 1e-2;
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user