Only do parallax correction test for local cubemaps

This commit is contained in:
Robert Beckebans 2021-04-10 17:23:04 +02:00
parent 69f17a61fd
commit 7d2f35ab9a
3 changed files with 5 additions and 3 deletions

View file

@ -168,7 +168,8 @@ void main( PS_IN fragment, out PS_OUT result )
// we can't start inside the box so move this outside and use the reverse path
rayStart += reflectionVector * 10000.0;
if( AABBRayIntersection( bounds, rayStart, -reflectionVector, hitScale ) )
// only do a box <-> ray intersection test if we use a local cubemap
if( ( rpWobbleSkyX.w > 0.0 ) && AABBRayIntersection( bounds, rayStart, -reflectionVector, hitScale ) )
{
float3 hitPoint = rayStart - reflectionVector * hitScale;

View file

@ -1330,7 +1330,7 @@ void idRenderBackend::DrawSingleInteraction( drawInteraction_t* din, bool useFas
probeMins[0] = viewDef->globalProbeBounds[0][0];
probeMins[1] = viewDef->globalProbeBounds[0][1];
probeMins[2] = viewDef->globalProbeBounds[0][2];
probeMins[3] = viewDef->globalProbeBounds.IsCleared() ? 1.0f : 0.0f;
probeMins[3] = viewDef->globalProbeBounds.IsCleared() ? 0.0f : 1.0f;
probeMaxs[0] = viewDef->globalProbeBounds[1][0];
probeMaxs[1] = viewDef->globalProbeBounds[1][1];

View file

@ -4656,7 +4656,8 @@ static const cgShaderDef_t cg_renderprogs[] =
" // we can't start inside the box so move this outside and use the reverse path\n"
" rayStart += reflectionVector * 10000.0;\n"
"\n"
" if( AABBRayIntersection( bounds, rayStart, -reflectionVector, hitScale ) )\n"
" // only do a box <-> ray intersection test if we use a local cubemap\n"
" if( ( rpWobbleSkyX.w > 0.0 ) && AABBRayIntersection( bounds, rayStart, -reflectionVector, hitScale ) )\n"
" {\n"
" float3 hitPoint = rayStart - reflectionVector * hitScale;\n"
"\n"