Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LensFlare: parameterize number of occlusion steps #3234

Merged
merged 7 commits into from
Jul 20, 2022

Conversation

scpeters
Copy link
Member

Some testing of the LensFlare effects has indicated that the number of steps used when checking for occlusions in LensFlareCompositorListener::OcclusionScale is impacting performance. To investigate, I've exposed it as a parameter in the rendering::LensFlare c++ API and as an XML parameter <occlusion_steps> to the LensFlarePlugin.

scpeters added 5 commits June 10, 2022 15:34
There is a significant amount of CPU time taken
when checking for occlusions in the LensFlare
compositor listener. This exposes the number
of steps taken when checking occlusions to allow
users to attempt to speed up this process.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
The SetCamera call passes the current parameters to
the compositor listener, so make sure that it is
called last.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters scpeters marked this pull request as ready for review June 22, 2022 20:37
@scpeters
Copy link
Member Author

this is ready for review

@jacobperron jacobperron self-requested a review June 29, 2022 20:13
Copy link

@jacobperron jacobperron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, only some minor comments


/// \brief Number of steps to take in each direction when checking for
/// occlusion.
public: double occlusionSteps = 10;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public: double occlusionSteps = 10;
public: double occlusionSteps = 10.0;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -356,6 +367,9 @@ namespace gazebo
public: ignition::math::Vector3d lensFlareColor
= ignition::math::Vector3d(1.0, 1.0, 1.0);

/// \brief Color of lens flare.
public: double lensFlareOcclusionSteps = 10;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public: double lensFlareOcclusionSteps = 10;
public: double lensFlareOcclusionSteps = 10.0;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -40,6 +40,9 @@ namespace gazebo
public: ignition::math::Vector3d color
= ignition::math::Vector3d(1.4, 1.2, 1.0);

/// \brief Lens flare occlusion steps
public: double occlusionSteps = 10;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public: double occlusionSteps = 10;
public: double occlusionSteps = 10.0;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scpeters added 2 commits July 1, 2022 14:24
Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters scpeters merged commit 20705f5 into gazebo11 Jul 20, 2022
@scpeters scpeters deleted the scpeters/lensflare_occlusion_steps branch July 20, 2022 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants