fixed focus laser, improved F1 TAA behaviour

This commit is contained in:
Sasha
2023-04-20 22:13:02 +01:00
parent b001f98071
commit 26c35b59b0
4 changed files with 34 additions and 29 deletions

View File

@ -65,6 +65,7 @@ uniform mat4 shadowProjection;
uniform mat4 gbufferModelView;
// uniform float viewWidth;
// uniform float viewHeight;
uniform int hideGUI;
uniform float aspectRatio;
uniform vec2 texelSize;
uniform vec3 cameraPosition;
@ -1176,6 +1177,31 @@ void main() {
// gl_FragData[0].rgb = vec3(1.0);
// if(z < 1) gl_FragData[0].rgb = Custom_GGX(normal, -np3, WsunVec, SpecularTex.r, SpecularTex.g) * vec3(1.0);
#ifdef DOF_JITTER
vec3 laserColor;
#if FOCUS_LASER_COLOR == 0 // Red
laserColor = vec3(25, 0, 0);
#elif FOCUS_LASER_COLOR == 1 // Green
laserColor = vec3(0, 25, 0);
#elif FOCUS_LASER_COLOR == 2 // Blue
laserColor = vec3(0, 0, 25);
#elif FOCUS_LASER_COLOR == 3 // Pink
laserColor = vec3(25, 10, 15);
#elif FOCUS_LASER_COLOR == 4 // Yellow
laserColor = vec3(25, 25, 0);
#elif FOCUS_LASER_COLOR == 5 // White
laserColor = vec3(25);
#endif
#if DOF_JITTER_FOCUS < 0
float focusDist = mix(pow(512.0, screenBrightness), 512.0 * screenBrightness, 0.25);
#else
float focusDist = DOF_JITTER_FOCUS;
#endif
if( hideGUI < 1.0) gl_FragData[0].rgb += laserColor * pow( clamp( 1.0-abs(focusDist-abs(fragpos.z)) ,0,1),25) ;
#endif
/* DRAWBUFFERS:3 */
}