-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add gamma correction to simple_demo_qml example #1019
Add gamma correction to simple_demo_qml example #1019
Conversation
4ecb579
to
fc95a6c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## gz-rendering8 #1019 +/- ##
=================================================
- Coverage 75.68% 75.63% -0.06%
=================================================
Files 177 177
Lines 16959 16993 +34
=================================================
+ Hits 12835 12852 +17
- Misses 4124 4141 +17 ☔ View full report in Codecov by Sentry. |
72abe1c
to
e704ccc
Compare
GLuint rhiFbo = 0; | ||
// internal texture ID to hold texture data from render engine texture, | ||
// in linear GL_RGB format | ||
GLuint rhiId = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you make these ids member variables so that we can delete the fbo and texture in the destructor when the app exits? e.g. see code here
f->glGetIntegerv(GL_FRAMEBUFFER_BINDING, ¤tFbo); | ||
|
||
// bind render engine texture to RHI FBO | ||
f->glGenFramebuffers(1, &rhiFbo); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will create a new fbo every frame. So related to previous comment, we need to store this id and as member var, and here only create the frame buffer if the fbo does not exist yet, i.e. rhiFbo
is 0. Same goes for the glGenTextures
line below
Signed-off-by: Athena Z <[email protected]>
Signed-off-by: Athena Z <[email protected]>
7c5ee65
to
964f911
Compare
…re2DepthCamera (gazebosim#1022) Signed-off-by: Ian Chen <[email protected]>
…> linear conversion Signed-off-by: Athena Z <[email protected]>
…ry frame Signed-off-by: Athena Z <[email protected]>
964f911
to
d65f167
Compare
🦟 Bug fix
Summary
When running with Ogre2 and OpenGL,
simple_demo_qml
has darker shadows and the scene is a bit darker overall when compared tosimple_demo
. This is because the texture from the render engine is in sRGB color space, but Qt's textures are created in linear color space. As per gazebosim/gz-gui#629, this fix forsimple_demo_qml
ensures that the render engine texture, originally in sRGB format, is correctly passed to Qt in linear format. Thus, now thesimple_demo_qml
scene is lighter and matchessimple_demo
's scene.Edit: modified changes as per gazebosim/gz-gui#630. Original changes copied render texture to a new internal texture before passing to Qt. Now, add a parameter to the render texture that disables sRGB decoding (only one time, not every frame) such that there is no sRGB -> linear conversion when texture is copied from Ogre2 to Qt, and now Qt displays it as-is as sRGB.
Before
After
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.