From 7d2f35ab9a016372609167eeace1a4b5b02a6bd6 Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Sat, 10 Apr 2021 17:23:04 +0200 Subject: [PATCH] Only do parallax correction test for local cubemaps --- base/renderprogs/builtin/lighting/ambient_lighting_IBL.ps.hlsl | 3 ++- neo/renderer/RenderBackend.cpp | 2 +- neo/renderer/RenderProgs_embedded.h | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/base/renderprogs/builtin/lighting/ambient_lighting_IBL.ps.hlsl b/base/renderprogs/builtin/lighting/ambient_lighting_IBL.ps.hlsl index ce85289a..a99daa64 100644 --- a/base/renderprogs/builtin/lighting/ambient_lighting_IBL.ps.hlsl +++ b/base/renderprogs/builtin/lighting/ambient_lighting_IBL.ps.hlsl @@ -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; diff --git a/neo/renderer/RenderBackend.cpp b/neo/renderer/RenderBackend.cpp index 4cf2f983..96f1f59b 100644 --- a/neo/renderer/RenderBackend.cpp +++ b/neo/renderer/RenderBackend.cpp @@ -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]; diff --git a/neo/renderer/RenderProgs_embedded.h b/neo/renderer/RenderProgs_embedded.h index eaceab4a..bdd1c269 100644 --- a/neo/renderer/RenderProgs_embedded.h +++ b/neo/renderer/RenderProgs_embedded.h @@ -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"