Add Graphics::MotionVectors::MinObjectScreenSize to skip too small objects from drawing motion vectors
This commit is contained in:
@@ -32,6 +32,7 @@ bool Graphics::SpreadWorkload = true;
|
||||
#if !BUILD_RELEASE || USE_EDITOR
|
||||
float Graphics::TestValue = 0.0f;
|
||||
#endif
|
||||
float Graphics::MotionVectors::MinObjectScreenSize = 0.02f;
|
||||
float Graphics::Shadows::MinObjectPixelSize = 2.0f;
|
||||
bool Graphics::PostProcessing::ColorGradingVolumeLUT = true;
|
||||
|
||||
|
||||
@@ -110,6 +110,15 @@ public:
|
||||
API_FIELD() static float MinObjectPixelSize;
|
||||
};
|
||||
|
||||
// Motion Vectors rendering configuration.
|
||||
API_CLASS(Static, Attributes="DebugCommand") class FLAXENGINE_API MotionVectors
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(MotionVectors);
|
||||
|
||||
// The minimum screen size of objects to draw motion vectors. Improves performance by skipping too small objects (eg. sub-pixel) from rendering motion vectors.
|
||||
API_FIELD() static float MinObjectScreenSize;
|
||||
};
|
||||
|
||||
// Post Processing effects rendering configuration.
|
||||
API_CLASS(Static, Attributes="DebugCommand") class FLAXENGINE_API PostProcessing
|
||||
{
|
||||
|
||||
@@ -710,7 +710,9 @@ void RenderList::AddDrawCall(const RenderContext& renderContext, DrawPass drawMo
|
||||
{
|
||||
DrawCallsLists[(int32)DrawCallsListType::Distortion].Indices.Add(index);
|
||||
}
|
||||
if ((drawModes & DrawPass::MotionVectors) != DrawPass::None && (staticFlags & StaticFlags::Transform) == StaticFlags::None)
|
||||
if ((drawModes & DrawPass::MotionVectors) != DrawPass::None &&
|
||||
(staticFlags & StaticFlags::Transform) == StaticFlags::None &&
|
||||
RenderTools::ComputeBoundsScreenRadiusSquared(drawCall.ObjectPosition, drawCall.ObjectRadius, renderContext.View) > Math::Square(Graphics::MotionVectors::MinObjectScreenSize))
|
||||
{
|
||||
DrawCallsLists[(int32)DrawCallsListType::MotionVectors].Indices.Add(index);
|
||||
}
|
||||
@@ -756,7 +758,9 @@ void RenderList::AddDrawCall(const RenderContextBatch& renderContextBatch, DrawP
|
||||
{
|
||||
DrawCallsLists[(int32)DrawCallsListType::Distortion].Indices.Add(index);
|
||||
}
|
||||
if ((drawModes & DrawPass::MotionVectors) != DrawPass::None && (staticFlags & StaticFlags::Transform) == StaticFlags::None)
|
||||
if ((drawModes & DrawPass::MotionVectors) != DrawPass::None &&
|
||||
(staticFlags & StaticFlags::Transform) == StaticFlags::None &&
|
||||
RenderTools::ComputeBoundsScreenRadiusSquared(bounds.Center, (float)bounds.Radius, mainRenderContext.View) > Math::Square(Graphics::MotionVectors::MinObjectScreenSize))
|
||||
{
|
||||
DrawCallsLists[(int32)DrawCallsListType::MotionVectors].Indices.Add(index);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user