Actually make use of the model matrix in the atmosphere radius calculation for determining whether it should be culled (closes #1465)

This commit is contained in:
Alexander Bock
2021-05-08 21:25:35 +02:00
parent 9b1f733deb
commit 2ca7101b6c
@@ -113,7 +113,7 @@ namespace {
constexpr const char* GlslDeferredcastVsPath =
"${MODULES}/atmosphere/shaders/atmosphere_deferred_vs.glsl";
constexpr const float ATM_EPS = 2.f;
constexpr const float ATM_EPS = 2000.f;
constexpr const float KM_TO_M = 1000.f;
@@ -213,7 +213,7 @@ void AtmosphereDeferredcaster::preRaycast(const RenderData& renderData,
renderData.camera.sgctInternal.projectionMatrix()
) * renderData.camera.combinedViewMatrix();
const float totalAtmosphere = (_atmosphereRadius + ATM_EPS)* KM_TO_M;
const float totalAtmosphere = (scaledRadius + ATM_EPS);
if (!isAtmosphereInFrustum(MV, tPlanetPosWorld, totalAtmosphere)) {
program.setUniform(_uniformCache.cullAtmosphere, 1);
}