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:
@@ -426,6 +426,11 @@ API_STRUCT(NoDefault) struct RenderContext
|
||||
/// </summary>
|
||||
API_FIELD() SceneRenderTask* Task = nullptr;
|
||||
|
||||
/// <summary>
|
||||
/// The proxy render view used to synchronize objects level of detail during rendering (eg. during shadow maps rendering passes). It's optional.
|
||||
/// </summary>
|
||||
API_FIELD() RenderView* LodProxyView = nullptr;
|
||||
|
||||
/// <summary>
|
||||
/// The render view.
|
||||
/// </summary>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -55,6 +55,7 @@ void RenderView::Prepare(RenderContext& renderContext)
|
||||
}
|
||||
|
||||
renderContext.List->Init(renderContext);
|
||||
renderContext.LodProxyView = nullptr;
|
||||
|
||||
PrepareCache(renderContext, width, height, taaJitter);
|
||||
}
|
||||
@@ -73,7 +74,7 @@ void RenderView::PrepareCache(const RenderContext& renderContext, float width, f
|
||||
WorldPosition = Origin + Position;
|
||||
|
||||
// Ortho views have issues with screen size LOD culling
|
||||
const float modelLODDistanceFactor = IsOrthographicProjection() ? 100.0f : ModelLODDistanceFactor;
|
||||
const float modelLODDistanceFactor = (renderContext.LodProxyView ? renderContext.LodProxyView->IsOrthographicProjection() : IsOrthographicProjection()) ? 100.0f : ModelLODDistanceFactor;
|
||||
ModelLODDistanceFactorSqrt = modelLODDistanceFactor * modelLODDistanceFactor;
|
||||
|
||||
// Setup main view render info
|
||||
|
||||
Reference in New Issue
Block a user