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

PBR textures for walls and floors in Ignition Gazebo #345

Merged
merged 5 commits into from
May 24, 2021

Conversation

luca-della-vedova
Copy link
Member

New feature implementation

Implemented feature

This PR is a followup of #342, and is to work towards #343. It adds support to rmf_building_map_tools for PBR textures to be used in Ignition, specifically metalness, roughness, normal, environment and light maps.

Implementation description

The YAML format now has additional parameters for walls and floors that follow the same naming convention as the SDF metal PBR workflow.
For ease of review the PR doesn't yet include all the rmf_traffic_editor GUI work to include the parameters, hence they have to be added manually to the yaml file. An example gist for the office world that can be used to test the PR is here.

Followup work will be to add the parameters to the rmf_traffic_editor GUI and autopopulate them when possible (i.e. if a [...]_Diffuse.png texture is present, the Normal map should default to [...]_Normal.png)

Before the PR:
image

After the PR (notice the reflections on the floor for the ceiling lights given by the environment map. It looks better when moving around I promise!
image

While implementing I took the chance to do a small refactor of the wall parameters and how they were grouped by adding an equality operator to parameters, this made the implementation quite a bit cleaner (otherwise we had to keep comparing parameters manually every time a new one was added).

A small issue that I couldn't figure out yet is that the model.material file created here has duplicated entries which makes me think that the generate function is called twice for each wall / floor.
It still works but it makes me wonder if there is some part of the map generator that is responsible for this issue and if there is a chance for optimizing it.

Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
@youliangtan
Copy link
Member

Tested and works without breaking (Cant really tell the diff with a naked eye thou). One thing that I am unsure of, does the rendering works if we use the .mtl with pbr field?

@luca-della-vedova
Copy link
Member Author

Tested and works without breaking (Cant really tell the diff with a naked eye thou). One thing that I am unsure of, does the rendering works if we use the .mtl with pbr field?

Not really for now sadly. I'm not sure why it is not implemented, one guess is that the mtl specification for PBR textures is a bit limited and doesn't offer support for all the maps we use (for example I don't think think there is a standard for metalness maps or light maps).

@luca-della-vedova
Copy link
Member Author

With ign-common #216 PBR tags can now be added straight to the mtl, however there is still no way to add lightmaps since they usually require a different uv set to be mapped and the obj format doesn't support multiple uv sets.
Hence while the ign-common PR would help to get rid of the sdf material override code, it would make mapping light maps not possible. The code can probably be cleaned up in the future once we figure out how to use light maps in OBJ files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants