Fix model screen size calculation in orthographic view projections
#980
This commit is contained in:
@@ -395,7 +395,7 @@ uint64 RenderTools::CalculateTextureMemoryUsage(PixelFormat format, int32 width,
|
||||
float RenderTools::ComputeBoundsScreenRadiusSquared(const Float3& origin, float radius, const Float3& viewOrigin, const Matrix& projectionMatrix)
|
||||
{
|
||||
const float screenMultiple = 0.5f * Math::Max(projectionMatrix.Values[0][0], projectionMatrix.Values[1][1]);
|
||||
const float distSqr = Float3::DistanceSquared(origin, viewOrigin);
|
||||
const float distSqr = Float3::DistanceSquared(origin, viewOrigin) * projectionMatrix.Values[2][3];
|
||||
return Math::Square(screenMultiple * radius) / Math::Max(1.0f, distSqr);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,9 +73,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 = (renderContext.LodProxyView ? renderContext.LodProxyView->IsOrthographicProjection() : IsOrthographicProjection()) ? 100.0f : ModelLODDistanceFactor;
|
||||
ModelLODDistanceFactorSqrt = modelLODDistanceFactor * modelLODDistanceFactor;
|
||||
ModelLODDistanceFactorSqrt = ModelLODDistanceFactor * ModelLODDistanceFactor;
|
||||
|
||||
// Setup main view render info
|
||||
if (!mainView)
|
||||
|
||||
Reference in New Issue
Block a user