Use builtin environment probe data as fallback

This commit is contained in:
Robert Beckebans 2021-04-30 16:39:27 +02:00
parent 0762ed4f04
commit ae7dc33b5c
3 changed files with 19 additions and 5 deletions

View file

@ -6170,7 +6170,7 @@ void idRenderBackend::PostProcess( const void* data )
/*
* The shader has three passes, chained together as follows:
*
* |input|------------------·
* |input|------------------<EFBFBD>
* v |
* [ SMAA*EdgeDetection ] |
* v |
@ -6180,7 +6180,7 @@ void idRenderBackend::PostProcess( const void* data )
* v |
* |blendTex| |
* v |
* [ SMAANeighborhoodBlending ] <------·
* [ SMAANeighborhoodBlending ] <------<EFBFBD>
* v
* |output|
*/

View file

@ -1443,6 +1443,9 @@ public:
{
if( ( count + 1 ) >= nextTicCount )
{
// discard anything currently on the list
tr.SwapCommandBuffers( NULL, NULL, NULL, NULL, NULL, NULL );
// restore the original resolution, same as "vid_restart"
glConfig.nativeScreenWidth = sysWidth;
glConfig.nativeScreenHeight = sysHeight;
@ -1467,6 +1470,7 @@ public:
}
common->UpdateScreen( false );
common->UpdateScreen( false );
}
count++;

View file

@ -525,7 +525,11 @@ static void R_FindClosestEnvironmentProbes()
RenderEnvprobeLocal* nearest = viewEnvprobes[0];
tr.viewDef->globalProbeBounds = nearest->globalProbeBounds;
tr.viewDef->irradianceImage = nearest->irradianceImage;
if( !nearest->irradianceImage->IsDefaulted() )
{
tr.viewDef->irradianceImage = nearest->irradianceImage;
}
// form a triangle of the 3 closest probes
idVec3 verts[3];
@ -566,7 +570,10 @@ static void R_FindClosestEnvironmentProbes()
for( int i = 0; i < viewEnvprobes.Num() && i < 3; i++ )
{
tr.viewDef->radianceImages[i] = viewEnvprobes[i]->radianceImage;
if( !viewEnvprobes[i]->radianceImage->IsDefaulted() )
{
tr.viewDef->radianceImages[i] = viewEnvprobes[i]->radianceImage;
}
}
}
// RB end
@ -682,7 +689,10 @@ void R_RenderPostProcess( viewDef_t* parms )
{
viewDef_t* oldView = tr.viewDef;
R_AddDrawPostProcess( parms );
//if( !( parms->renderView.rdflags & RDF_IRRADIANCE ) )
{
R_AddDrawPostProcess( parms );
}
tr.viewDef = oldView;
}