-
Notifications
You must be signed in to change notification settings - Fork 53
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 loading grayscale emissive map #503
Conversation
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
Signed-off-by: Ian Chen <[email protected]>
…/ign-rendering into fix_emissive_map_upload
Codecov Report
@@ Coverage Diff @@
## ign-rendering6 #503 +/- ##
==================================================
- Coverage 55.53% 55.44% -0.09%
==================================================
Files 195 195
Lines 19698 19736 +38
==================================================
+ Hits 10939 10943 +4
- Misses 8759 8793 +34
Continue to review full report at Codecov.
|
Sounds like this is something that should be fixed from Upstream? Detect if emissive is greyscale, then use a shader with the right swizzle Update: Added fix to upstream. Remember to update C++ and copy shader files to ignition's. |
Signed-off-by: Ian Chen <[email protected]>
great, thanks for implementing grayscale emissive map support upstream! I'm going to try get this in first, and remove later when I get time to port the fix over to our fork (and package / release new debs etc) |
🦟 Bug fix
Fixes #499
Summary
Continuing the effort from #501, this PR fixes loading grayscale emissive map by converting it to RGB color texture so that the visual with the emissive map is not incorrectly rendered as red color.
Test by lauching ign gazebo with the
fuel_textured_mesh.sdf
world file.Before:
After:
Alternative considered
The other option considered is to some customization in the Pbs Hlms pixel shader and just apply only the r channel of the emissive texture to the final color, .e.g. changing the code here to
finalColour += emissiveCol.rrr;
.I went with the approach in this PR mainly to keep the changes within one function without touching the shaders so we don't deviate too much from the original Pbs shader code we took from ogre. This approach was also easier for me to to implement.
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge