Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🦟 Bug fix
Summary
Tuned Ogre2GpusRays' (lidar) ogre2 compositor to bypass computationally expensive phases involving lights. Since we are just generating depth data, we do not need to care about the lights in the scene so we can skip these computations.
The compositor parameter description can be found in this ogre doc.
enable_forwardplus
- affects performance when there are many lights in the scene. However we only care about depth data for lidars (and not the rgb color images that are affected by lights) so set this to be disabled. Specifically, a big chunk of time was found to be spent in ogre scene manager's_cullPhase01
function. Disabling this flag gave the most perf boost.enable_plus
which is a typo.light_visibility_mask
- tells ogre that we don't want to see any lightsI used this lidar_profile.sdf world for profiling. It consists of a single lidar with 160 degrees FOV and 640 samples.
Ogre2GpuRays
uses 3 environment cameras for collecting depth data - the number of env cameras is important as it directly affects to total render time. If a lidar has a smaller FOV (<90), only 1 env camera is needed and the update time would be close to ~1/3 of the time shown below.Here're before and after plots of time taken to do a Render operation
The time taken is now roughly 2-4ms for each render update. The performance is still behind ogre 1.x in which the render operation for the same lidar takes ~1ms
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.