Revert "Remove unused LodProxyView feature from RenderContext (shadow projections are using the same draw batch as main view now)"

This reverts commit c33fe04645.
This commit is contained in:
Wojtek Figat
2022-11-26 20:37:04 +01:00
parent bdb27fef1b
commit 39dc439cd8
6 changed files with 18 additions and 5 deletions

View File

@@ -441,7 +441,8 @@ float RenderTools::ComputeBoundsScreenRadiusSquared(const Float3& origin, float
int32 RenderTools::ComputeModelLOD(const Model* model, const Float3& origin, float radius, const RenderContext& renderContext)
{
const float screenRadiusSquared = ComputeBoundsScreenRadiusSquared(origin, radius, renderContext.View) * renderContext.View.ModelLODDistanceFactorSqrt;
const auto lodView = (renderContext.LodProxyView ? renderContext.LodProxyView : &renderContext.View);
const float screenRadiusSquared = ComputeBoundsScreenRadiusSquared(origin, radius, *lodView) * renderContext.View.ModelLODDistanceFactorSqrt;
// Check if model is being culled
if (Math::Square(model->MinScreenSize * 0.5f) > screenRadiusSquared)
@@ -465,7 +466,8 @@ int32 RenderTools::ComputeModelLOD(const Model* model, const Float3& origin, flo
int32 RenderTools::ComputeSkinnedModelLOD(const SkinnedModel* model, const Float3& origin, float radius, const RenderContext& renderContext)
{
const float screenRadiusSquared = ComputeBoundsScreenRadiusSquared(origin, radius, renderContext.View) * renderContext.View.ModelLODDistanceFactorSqrt;
const auto lodView = (renderContext.LodProxyView ? renderContext.LodProxyView : &renderContext.View);
const float screenRadiusSquared = ComputeBoundsScreenRadiusSquared(origin, radius, *lodView) * renderContext.View.ModelLODDistanceFactorSqrt;
// Check if model is being culled
if (Math::Square(model->MinScreenSize * 0.5f) > screenRadiusSquared)