mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-26 18:22:33 +08:00
add flashlight effects. add TAA jitter toggle for DH LOD, force responsive TAA jitter on DH. add adjustable health thresholds for damage effects..
This commit is contained in:
@ -231,6 +231,22 @@ vec4 GetVolumetricFog(
|
||||
|
||||
color += (lighting - lighting * fogVolumeCoeff) * totalAbsorbance;
|
||||
|
||||
#if defined FLASHLIGHT && defined FLASHLIGHT_FOG_ILLUMINATION
|
||||
vec3 shiftedViewPos = mat3(gbufferModelView)*(progressW-cameraPosition) + vec3(-0.25, 0.2, 0.0);
|
||||
vec3 shiftedPlayerPos = mat3(gbufferModelViewInverse) * shiftedViewPos;
|
||||
vec2 scaledViewPos = shiftedViewPos.xy / max(-shiftedViewPos.z - 0.5, 1e-7);
|
||||
float linearDistance = length(shiftedPlayerPos);
|
||||
float shiftedLinearDistance = length(scaledViewPos);
|
||||
|
||||
float lightFalloff = 1.0 - clamp(1.0-linearDistance/FLASHLIGHT_RANGE, -0.999,1.0);
|
||||
lightFalloff = max(exp(-30.0 * lightFalloff),0.0);
|
||||
float projectedCircle = clamp(1.0 - shiftedLinearDistance*FLASHLIGHT_SIZE,0.0,1.0);
|
||||
|
||||
vec3 flashlightGlow = vec3(FLASHLIGHT_R,FLASHLIGHT_G,FLASHLIGHT_B) * lightFalloff * projectedCircle * 0.5;
|
||||
|
||||
color += (flashlightGlow - flashlightGlow * exp(-max(fogDensity,0.005)*dd*dL)) * totalAbsorbance;
|
||||
#endif
|
||||
|
||||
// kill fog absorbance when in caves.
|
||||
totalAbsorbance *= mix(1.0, fogVolumeCoeff, lightLevelZero);
|
||||
//------------------------------------
|
||||
@ -261,7 +277,6 @@ vec4 GetVolumetricFog(
|
||||
|
||||
atmosphereAbsorbance *= atmosphereVolumeCoeff*fogVolumeCoeff;
|
||||
|
||||
|
||||
//------------------------------------
|
||||
//------ LPV FOG EFFECT
|
||||
//------------------------------------
|
||||
|
Reference in New Issue
Block a user