Skip to content

Commit

Permalink
Render each cubemap frame twice with material system enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
VReaperV committed Sep 17, 2024
1 parent d7865ec commit 41b1afd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/engine/renderer/tr_bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6583,6 +6583,9 @@ void R_BuildCubeMaps()
Log::Notice("0%% 10 20 30 40 50 60 70 80 90 100%%" );
Log::Notice("|----|----|----|----|----|----|----|----|----|----|" );

const bool gpuOcclusionCulling = r_gpuOcclusionCulling.Get();
r_gpuOcclusionCulling.Set( false );

for ( size_t j = 0; j < tr.cubeProbes.size(); j++ )
{
cubemapProbe_t *cubeProbe = tr.cubeProbes[ j ];
Expand Down Expand Up @@ -6737,6 +6740,16 @@ void R_BuildCubeMaps()
tr.refdef.pixelTargetWidth = REF_CUBEMAP_SIZE;
tr.refdef.pixelTargetHeight = REF_CUBEMAP_SIZE;

if ( glConfig2.materialSystemAvailable ) {
tr.refdef.pixelTarget = nullptr;

RE_BeginFrame();
RE_RenderScene( &rf );
RE_EndFrame( &ii, &jj );

tr.refdef.pixelTarget = tr.cubeTemp[i];
}

RE_BeginFrame();
RE_RenderScene( &rf );
RE_EndFrame( &ii, &jj );
Expand Down Expand Up @@ -6834,6 +6847,8 @@ void R_BuildCubeMaps()
R_UploadImage( ( const byte ** ) tr.cubeTemp, 6, 1, cubeProbe->cubemap, imageParams );
}

r_gpuOcclusionCulling.Set( gpuOcclusionCulling );

Log::Notice("");

// turn pixel targets off
Expand Down

0 comments on commit 41b1afd

Please sign in to comment.