Merge pull request #29 from lvonasek/feature_vignette_yaw_noisefilter

Add noise filter for yaw delta values when drawing vignette
This commit is contained in:
Simon 2022-03-20 18:25:41 +00:00 committed by GitHub
commit 83bd49f800
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2592,6 +2592,7 @@ CG_DrawVignette
==============
*/
float currentComfortVignetteValue = 0.0f;
float filteredViewYawDelta = 0.0f;
static void CG_DrawVignette( void )
{
@ -2602,8 +2603,13 @@ static void CG_DrawVignette( void )
return;
}
const float yawDelta = fabsf(vr->clientview_yaw_delta);
if (VectorLength(cg.predictedPlayerState.velocity) > 30.0 || (yawDelta > 1 && yawDelta < 20) || (yawDelta > 340))
float yawDelta = fabsf(vr->clientview_yaw_delta);
if (yawDelta > 180)
{
yawDelta = fabs(yawDelta - 360);
}
filteredViewYawDelta = filteredViewYawDelta * 0.75f + yawDelta * 0.25f;
if (VectorLength(cg.predictedPlayerState.velocity) > 30.0 || (filteredViewYawDelta > 1))
{
if (currentComfortVignetteValue < comfortVignetteValue)
{