Add culling and render mask check for models rendered via Custom Actors list
This commit is contained in:
@@ -251,9 +251,10 @@ void SceneRenderTask::CollectPostFxVolumes(RenderContext& renderContext)
|
|||||||
}
|
}
|
||||||
if ((ActorsSource & ActorsSources::CustomActors) != 0)
|
if ((ActorsSource & ActorsSources::CustomActors) != 0)
|
||||||
{
|
{
|
||||||
for (int32 i = 0; i < CustomActors.Count(); i++)
|
for (auto a : CustomActors)
|
||||||
{
|
{
|
||||||
if (auto* postFxVolume = dynamic_cast<PostFxVolume*>(CustomActors[i]))
|
auto* postFxVolume = dynamic_cast<PostFxVolume*>(a);
|
||||||
|
if (postFxVolume && a->GetIsActive())
|
||||||
{
|
{
|
||||||
postFxVolume->Collect(renderContext);
|
postFxVolume->Collect(renderContext);
|
||||||
}
|
}
|
||||||
@@ -266,10 +267,12 @@ void SceneRenderTask::OnCollectDrawCalls(RenderContext& renderContext)
|
|||||||
// Draw actors (collect draw calls)
|
// Draw actors (collect draw calls)
|
||||||
if ((ActorsSource & ActorsSources::CustomActors) != 0)
|
if ((ActorsSource & ActorsSources::CustomActors) != 0)
|
||||||
{
|
{
|
||||||
for (int32 i = 0; i < CustomActors.Count(); i++)
|
for (auto a : CustomActors)
|
||||||
{
|
{
|
||||||
if (CustomActors[i] && CustomActors[i]->GetIsActive())
|
if (a && a->GetIsActive())
|
||||||
CustomActors[i]->DrawHierarchy(renderContext);
|
{
|
||||||
|
a->DrawHierarchy(renderContext);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((ActorsSource & ActorsSources::Scenes) != 0)
|
if ((ActorsSource & ActorsSources::Scenes) != 0)
|
||||||
|
|||||||
@@ -623,7 +623,10 @@ void AnimatedModel::Draw(RenderContext& renderContext)
|
|||||||
|
|
||||||
void AnimatedModel::DrawGeneric(RenderContext& renderContext)
|
void AnimatedModel::DrawGeneric(RenderContext& renderContext)
|
||||||
{
|
{
|
||||||
Draw(renderContext);
|
if (renderContext.View.RenderLayersMask.Mask & GetLayerMask() && renderContext.View.CullingFrustum.Intersects(_box))
|
||||||
|
{
|
||||||
|
Draw(renderContext);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_EDITOR
|
#if USE_EDITOR
|
||||||
|
|||||||
@@ -268,7 +268,10 @@ void StaticModel::Draw(RenderContext& renderContext)
|
|||||||
|
|
||||||
void StaticModel::DrawGeneric(RenderContext& renderContext)
|
void StaticModel::DrawGeneric(RenderContext& renderContext)
|
||||||
{
|
{
|
||||||
Draw(renderContext);
|
if (renderContext.View.RenderLayersMask.Mask & GetLayerMask() && renderContext.View.CullingFrustum.Intersects(_box))
|
||||||
|
{
|
||||||
|
Draw(renderContext);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StaticModel::IntersectsItself(const Ray& ray, float& distance, Vector3& normal)
|
bool StaticModel::IntersectsItself(const Ray& ray, float& distance, Vector3& normal)
|
||||||
|
|||||||
Reference in New Issue
Block a user