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

Fix non-deterministic rendering due to background texture loading #765

Conversation

darksylinc
Copy link
Contributor

@darksylinc darksylinc commented Nov 27, 2022

🦟 Bug fix

No ticket was created for this issue.

Summary

OgreNext 2.2+ has a feature where all textures are asynchronously loaded by default; and a blank texture will be shown until it's ready.

This is great for low latency interactions & most games; but terrible if we want all our simulated frames to be perfect & deterministic results

We don't want placeholder textures to be used; thus wait until all textures being loaded are done.

I found this bug while working on the Heightmap Integration tests for Fortress. The test required to load some PNGs and it failed spectacularly as the first frames rendered used the placeholder textures instead of the final ones.

waitForStreamingCompletion doesn't have any performance impact if there are no textures waiting to finish loading; and it will obviously affect performance if there are textures still loading andhas to wait. However this is a case of "rendering ASAP vs correctness".

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

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.

@darksylinc darksylinc requested a review from iche033 as a code owner November 27, 2022 14:04
@github-actions github-actions bot added the 🏯 fortress Ignition Fortress label Nov 27, 2022
@codecov
Copy link

codecov bot commented Nov 27, 2022

Codecov Report

Merging #765 (aa0207f) into ign-rendering6 (913efa6) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@                Coverage Diff                 @@
##           ign-rendering6     #765      +/-   ##
==================================================
- Coverage           77.82%   77.81%   -0.01%     
==================================================
  Files                 146      146              
  Lines               13397    13399       +2     
==================================================
+ Hits                10426    10427       +1     
- Misses               2971     2972       +1     
Impacted Files Coverage Δ
ogre2/src/Ogre2Scene.cc 77.69% <100.00%> (+0.06%) ⬆️
...e/ignition/rendering/base/BaseGaussianNoisePass.hh 96.66% <0.00%> (-3.34%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@mjcarroll mjcarroll merged commit dcd40b8 into gazebosim:ign-rendering6 Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants