mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-06-03 10:11:35 +00:00
Skip hands + view weapons for motion vectors
This commit is contained in:
parent
6cd2b98491
commit
54d30bbd05
2 changed files with 12 additions and 22 deletions
|
@ -5435,8 +5435,6 @@ void idRenderBackend::CalculateAutomaticExposure()
|
||||||
{
|
{
|
||||||
idLib::Printf( "HDR luminance avg = %f, max = %f, key = %f\n", hdrAverageLuminance, hdrMaxLuminance, hdrKey );
|
idLib::Printf( "HDR luminance avg = %f, max = %f, key = %f\n", hdrAverageLuminance, hdrMaxLuminance, hdrKey );
|
||||||
}
|
}
|
||||||
|
|
||||||
//GL_CheckErrors();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void idRenderBackend::DrawMotionVectors()
|
void idRenderBackend::DrawMotionVectors()
|
||||||
|
@ -5467,18 +5465,22 @@ void idRenderBackend::DrawMotionVectors()
|
||||||
// clear the alpha buffer and draw only the hands + weapon into it so
|
// clear the alpha buffer and draw only the hands + weapon into it so
|
||||||
// we can avoid blurring them
|
// we can avoid blurring them
|
||||||
GL_State( GLS_COLORMASK | GLS_DEPTHMASK );
|
GL_State( GLS_COLORMASK | GLS_DEPTHMASK );
|
||||||
|
GL_Color( 0, 0, 0, 1 );
|
||||||
|
|
||||||
|
renderProgManager.BindShader_Color();
|
||||||
|
|
||||||
|
currentSpace = &viewDef->worldSpace;
|
||||||
|
RB_SetMVP( viewDef->worldSpace.mvp );
|
||||||
|
|
||||||
|
DrawElementsWithCounters( &unitSquareSurface );
|
||||||
|
|
||||||
|
// draw the hands + weapon with alpha 0
|
||||||
GL_Color( 0, 0, 0, 0 );
|
GL_Color( 0, 0, 0, 0 );
|
||||||
|
|
||||||
GL_SelectTexture( 0 );
|
GL_SelectTexture( 0 );
|
||||||
globalImages->blackImage->Bind();
|
globalImages->blackImage->Bind();
|
||||||
currentSpace = NULL;
|
currentSpace = NULL;
|
||||||
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
TODO mask out the view weapon + hands using the stencil buffer
|
|
||||||
|
|
||||||
commandList->clearTextureFloat( globalImages->currentHDRImage->GetTextureHandle(), nvrhi::AllSubresources, nvrhi::Color( 0.f ) );
|
|
||||||
|
|
||||||
drawSurf_t** drawSurfs = ( drawSurf_t** )&viewDef->drawSurfs[0];
|
drawSurf_t** drawSurfs = ( drawSurf_t** )&viewDef->drawSurfs[0];
|
||||||
for( int surfNum = 0; surfNum < viewDef->numDrawSurfs; surfNum++ )
|
for( int surfNum = 0; surfNum < viewDef->numDrawSurfs; surfNum++ )
|
||||||
{
|
{
|
||||||
|
@ -5517,17 +5519,11 @@ void idRenderBackend::DrawMotionVectors()
|
||||||
// draw it solid
|
// draw it solid
|
||||||
DrawElementsWithCounters( surf );
|
DrawElementsWithCounters( surf );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
globalFramebuffers.taaMotionVectorsFBO->Bind();
|
globalFramebuffers.taaMotionVectorsFBO->Bind();
|
||||||
|
|
||||||
commandList->clearTextureFloat( globalImages->taaMotionVectorsImage->GetTextureHandle(), nvrhi::AllSubresources, nvrhi::Color( 0.f ) );
|
commandList->clearTextureFloat( globalImages->taaMotionVectorsImage->GetTextureHandle(), nvrhi::AllSubresources, nvrhi::Color( 0.f ) );
|
||||||
|
|
||||||
// copy off the color buffer and the depth buffer for the motion blur prog
|
|
||||||
// we use the viewport dimensions for copying the buffers in case resolution scaling is enabled.
|
|
||||||
//const idScreenRect& viewport = viewDef->viewport;
|
|
||||||
//globalImages->currentRenderImage->CopyFramebuffer( viewport.x1, viewport.y1, viewport.GetWidth(), viewport.GetHeight() );
|
|
||||||
|
|
||||||
// in stereo rendering, each eye needs to get a separate previous frame mvp
|
// in stereo rendering, each eye needs to get a separate previous frame mvp
|
||||||
int mvpIndex = ( viewDef->renderView.viewEyeBuffer == 1 ) ? 1 : 0;
|
int mvpIndex = ( viewDef->renderView.viewEyeBuffer == 1 ) ? 1 : 0;
|
||||||
|
|
||||||
|
@ -5546,10 +5542,6 @@ void idRenderBackend::DrawMotionVectors()
|
||||||
|
|
||||||
renderProgManager.BindShader_MotionVectors();
|
renderProgManager.BindShader_MotionVectors();
|
||||||
|
|
||||||
// let the fragment program know how many samples we are going to use
|
|
||||||
idVec4 samples( ( float )( 1 << 4 ) ); ///r_motionBlur.GetInteger() ) );
|
|
||||||
SetFragmentParm( RENDERPARM_OVERBRIGHT, samples.ToFloatPtr() );
|
|
||||||
|
|
||||||
GL_SelectTexture( 0 );
|
GL_SelectTexture( 0 );
|
||||||
globalImages->currentRenderHDRImage->Bind();
|
globalImages->currentRenderHDRImage->Bind();
|
||||||
|
|
||||||
|
@ -6944,7 +6936,7 @@ void idRenderBackend::DrawViewInternal( const viewDef_t* _viewDef, const int ste
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// resolve of HDR target using temporal anti aliasing before any tonemapping and post processing
|
// resolve of HDR target using temporal anti aliasing before any tonemapping and post processing
|
||||||
//
|
//
|
||||||
// use this to eat all stochastic noise like from volumetric light sampling,
|
// use this to eat all stochastic noise like from volumetric light sampling or SSAO
|
||||||
// runs at full resolution
|
// runs at full resolution
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
TemporalAAPass( _viewDef );
|
TemporalAAPass( _viewDef );
|
||||||
|
|
|
@ -61,14 +61,12 @@ void main( PS_IN fragment, out PS_OUT result )
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0 //!VECTORS_ONLY
|
|
||||||
// don't motion blur the hands, which were drawn with alpha = 0
|
// don't motion blur the hands, which were drawn with alpha = 0
|
||||||
if( t_ViewColor.Sample( LinearSampler, fragment.texcoord0 ).w == 0.0 )
|
if( t_ViewColor.Sample( LinearSampler, fragment.texcoord0 ).a == 0.0 )
|
||||||
{
|
{
|
||||||
discard;
|
discard;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// derive clip space from the depth buffer and screen position
|
// derive clip space from the depth buffer and screen position
|
||||||
float windowZ = t_ViewDepth.Sample( LinearSampler, fragment.texcoord0 ).x;
|
float windowZ = t_ViewDepth.Sample( LinearSampler, fragment.texcoord0 ).x;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue