mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2025-02-15 16:50:40 +00:00
Add noise filter for yaw delta values when drawing vignette
This commit is contained in:
parent
e00ae24aff
commit
004e8d3b06
1 changed files with 8 additions and 2 deletions
|
@ -2592,6 +2592,7 @@ CG_DrawVignette
|
||||||
==============
|
==============
|
||||||
*/
|
*/
|
||||||
float currentComfortVignetteValue = 0.0f;
|
float currentComfortVignetteValue = 0.0f;
|
||||||
|
float filteredViewYawDelta = 0.0f;
|
||||||
|
|
||||||
static void CG_DrawVignette( void )
|
static void CG_DrawVignette( void )
|
||||||
{
|
{
|
||||||
|
@ -2602,8 +2603,13 @@ static void CG_DrawVignette( void )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const float yawDelta = fabsf(vr->clientview_yaw_delta);
|
float yawDelta = fabsf(vr->clientview_yaw_delta);
|
||||||
if (VectorLength(cg.predictedPlayerState.velocity) > 30.0 || (yawDelta > 1 && yawDelta < 20) || (yawDelta > 340))
|
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)
|
if (currentComfortVignetteValue < comfortVignetteValue)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue