mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-14 06:34:10 +00:00
Don't render motion vectors if standing still
This commit is contained in:
parent
39227f1559
commit
0c866655f8
1 changed files with 12 additions and 5 deletions
|
@ -5528,11 +5528,18 @@ void idRenderBackend::DrawMotionVectors()
|
|||
int mvpIndex = ( viewDef->renderView.viewEyeBuffer == 1 ) ? 1 : 0;
|
||||
|
||||
// derive the matrix to go from current pixels to previous frame pixels
|
||||
idRenderMatrix inverseMVP;
|
||||
idRenderMatrix::Inverse( viewDef->worldSpace.unjitteredMVP, inverseMVP );
|
||||
|
||||
bool cameraMoved = false;
|
||||
idRenderMatrix motionMatrix;
|
||||
idRenderMatrix::Multiply( prevMVP[mvpIndex], inverseMVP, motionMatrix );
|
||||
|
||||
if( memcmp( &viewDef->worldSpace.unjitteredMVP[0][0], &prevMVP[mvpIndex][0][0], sizeof( idRenderMatrix ) ) != 0 )
|
||||
{
|
||||
idRenderMatrix inverseMVP;
|
||||
idRenderMatrix::Inverse( viewDef->worldSpace.unjitteredMVP, inverseMVP );
|
||||
|
||||
idRenderMatrix::Multiply( prevMVP[mvpIndex], inverseMVP, motionMatrix );
|
||||
|
||||
cameraMoved = true;
|
||||
}
|
||||
|
||||
prevMVP[mvpIndex] = viewDef->worldSpace.unjitteredMVP;
|
||||
|
||||
|
@ -5550,7 +5557,7 @@ void idRenderBackend::DrawMotionVectors()
|
|||
windowCoordParm[3] = h;
|
||||
SetFragmentParm( RENDERPARM_WINDOWCOORD, windowCoordParm ); // rpWindowCoord
|
||||
|
||||
if( r_taaMotionVectors.GetBool() && prevViewsValid )
|
||||
if( r_taaMotionVectors.GetBool() && prevViewsValid && cameraMoved )
|
||||
{
|
||||
RB_SetMVP( motionMatrix );
|
||||
|
||||
|
|
Loading…
Reference in a new issue