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

Enable alpha based transparency on PBR materials by default #249

Merged
merged 1 commit into from
Jul 16, 2020

Conversation

luca-della-vedova
Copy link
Member

@luca-della-vedova luca-della-vedova commented Jul 16, 2020

This (simple) PR enables transparency on Physically Based Rendering materials. The alpha channel of the diffuse / albedo map is used to set the transparency.

An example way to test it is by using Pine Tree from Fuel, it will be necessary to update the model.sdf file by changing the <material> tag of the branch into:

        <material>
          <diffuse>1.0 1.0 1.0</diffuse>
          <script>
            <uri>model://Pine Tree/materials/scripts/</uri>
            <uri>model://Pine Tree/materials/textures/</uri>
            <name>PineTree/Branch</name>
          </script>
          <!-- PBR for Ignition, material scripts for gazebo classic-->
          <pbr>
            <metal>
              <albedo_map>model://Pine Tree/materials/textures/branch_2_diffuse.png</albedo_map>
            </metal>
          </pbr>
        </material>

Before and after the PR:
image
image

Open to feedback! (especially if this PR introduces any regression / change in behavior in preexisting assets / projects).

@github-actions github-actions bot added the 🔮 dome Ignition Dome label Jul 16, 2020
@codecov
Copy link

codecov bot commented Jul 16, 2020

Codecov Report

Merging #249 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #249   +/-   ##
=======================================
  Coverage   65.78%   65.78%           
=======================================
  Files         128      128           
  Lines        6307     6307           
=======================================
  Hits         4149     4149           
  Misses       2158     2158           

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 6a3f5dd...467cf64. Read the comment docs.

Copy link
Contributor

@iche033 iche033 left a comment

Choose a reason for hiding this comment

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

The pine tree model renders correctly for me now. I also tested with a few other assets and it seems to work fine!

@chapulina chapulina merged commit 3518572 into master Jul 16, 2020
@chapulina chapulina deleted the luca/pbr_diffuse_alpha branch July 16, 2020 22:31
chapulina pushed a commit that referenced this pull request Oct 16, 2020
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.

3 participants