Add ObjectRadius to DrawCall to properly cull local lights and env probes in Forward Shading

This commit is contained in:
Wojtek Figat
2023-09-20 15:01:02 +02:00
parent 8bd6649510
commit 8cd8ae93c3
12 changed files with 29 additions and 8 deletions

View File

@@ -405,6 +405,7 @@ void SplineModel::Draw(RenderContext& renderContext)
const Transform splineTransform = GetTransform();
renderContext.View.GetWorldMatrix(splineTransform, drawCall.World);
drawCall.ObjectPosition = drawCall.World.GetTranslation() + drawCall.Deformable.LocalMatrix.GetTranslation();
drawCall.ObjectRadius = _sphere.Radius; // TODO: use radius for the spline chunk rather than whole spline
const float worldDeterminantSign = drawCall.World.RotDeterminant() * drawCall.Deformable.LocalMatrix.RotDeterminant();
for (int32 segment = 0; segment < _instances.Count(); segment++)
{