-
Notifications
You must be signed in to change notification settings - Fork 67
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
Added support for fuel textures #342
Conversation
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
I wonder if we should/could somehow have a "material name" type of scheme, where (by default) it would use the texture name not only for the color/albedo, but if it finds the other maps (normal, roughness, metal, environment) exist with the same name, it will use them by default at the same scale. That seems like it would be the 99% use case, where if you get one, you get them all. |
That could be a separate PR though; this initial improvement for high-resolution color textures is awesome! |
Agreed, I think that is the most common use case, I was thinking of something along the lines of:
This should cover some of the edge cases, such as:
Anyway all of those are Ignition specific, while this PR is a rendering improvement that can be applied to both Ignition and Gazebo classic |
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Signed-off-by: Luca Della Vedova <[email protected]>
Done!
Yea this is documented in #338, we need to add support for texture scaling for walls. For now walls expect a 2.5m x 1m texture so if a square one is provided (like the floor tiles you are using) they will be stretched vertically by a factor of 2.5. |
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.
LGTM!
New feature implementation
Implemented feature
Added support for downloading textures from URLs (tested with Fuel).
Implementation description
As we move into more realistic looking worlds we can't keep adding textures to the git repo since high quality textures can be in the order of multiple MB.
This PR introduces support for URLs in the
texture_name
field for walls and floors. If the field is a valid URL the floor / wall generator will download it and copy the texture, if it isn't it will try the legacy way of doing a file copy.An alternative implementation could be using
pit_crew
, it would have the benefit of having better isolation between the code that downloads models and the code that builds maps (as well as actually skipping all downloads if the users wanted to), but it could be a bit trickier to implement since to my understanding pit_crew doesn't have logic to access models and download single files.Also the workflow of "using a fuel URL for a single texture" is supported by Ignition and will make future work (adding multiple textures for PBR assets) a lot easier to implement.
For example a typical sdf for a PBR asset, the indoor lightmap model, looks like this
Try it!
To test the PR, just open a project in
traffic_editor
and assign a fuel texture URL to the texture name, for example:Then run the demo
And enjoy the high resolution textures!
Next steps
To get the best possible results for Ignition we will need to implement fields for all the other PBR maps (such as normal, roughness, metal, environment). They can be implemented through a similar workflow by adding more fields to traffic_editor for the different texture maps.