Skip to content

Fix transparency issue for textures without alpha channel #186

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

Merged
merged 3 commits into from
Dec 18, 2020

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Dec 16, 2020

When SetAlphaFromTexture(true) is invoked on a material with texture that does not have an alpha channel, it causes the visual with the assigned material to be completely transparent. The fix is to do a check to make sure the texture does have an alpha channel, and if not we disable using alpha from the texture.

These changes were included in pull request #182 for ign-rendering5, which are necessary for displaying the Indoor Lighting model.

Another test: launch ign-gazebo and insert the DronePlatformX1 model. Without these changes, the model is transparent.

@iche033 iche033 requested a review from nkoenig December 16, 2020 04:20
@github-actions github-actions bot added the 🔮 dome Ignition Dome label Dec 16, 2020
Copy link
Contributor

@nkoenig nkoenig left a comment

Choose a reason for hiding this comment

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

Works great.

Signed-off-by: Nate Koenig <[email protected]>
@codecov
Copy link

codecov bot commented Dec 16, 2020

Codecov Report

Merging #186 (cc5c4a6) into ign-rendering4 (26497e7) will decrease coverage by 0.00%.
The diff coverage is 71.42%.

Impacted file tree graph

@@                Coverage Diff                 @@
##           ign-rendering4     #186      +/-   ##
==================================================
- Coverage           52.58%   52.58%   -0.01%     
==================================================
  Files                 143      143              
  Lines               13333    13337       +4     
==================================================
+ Hits                 7011     7013       +2     
- Misses               6322     6324       +2     
Impacted Files Coverage Δ
ogre2/src/Ogre2Material.cc 94.75% <71.42%> (-0.69%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 26497e7...cc5c4a6. Read the comment docs.

@iche033
Copy link
Contributor Author

iche033 commented Dec 16, 2020

@osrf-jenkins run tests please

@iche033 iche033 merged commit 2c85d92 into ign-rendering4 Dec 18, 2020
@iche033 iche033 deleted the texture_alpha branch December 18, 2020 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔮 dome Ignition Dome
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants