Make tiling a texture easier#7406
Make tiling a texture easier#7406Augigogigi wants to merge 15 commits intobevyengine:mainfrom Augigogigi:main
Conversation
|
Before this is merged can someone remove the need for |
fixed. |
|
There still might be a possible issue with having everything be |
|
|
|
Welcome, new contributor! |
I talked with superdump on discord and this is just a temporary measure until there is something better in place, so it can live in the example.
|
Welcome, new contributor! |
|
Welcome, new contributor! |
|
Welcome, new contributor! |
|
Welcome, new contributor! |
|
no longer a breaking change. |
|
unless this is gonna be merged soon it should have C-Examples too. |
|
honestly i think the world uvs function is more confusing now, it is called "plane_uvs" but we use it with the built in primitive can we please go back to the simple function for quads with a comment about using positions 0 and 2 for planes? |
done |
Co-authored-by: robtfm <50659922+robtfm@users.noreply.github.com>
Co-authored-by: robtfm <50659922+robtfm@users.noreply.github.com>
Objective
This PR attempts to implement a simpler way to tile textures.
Solution
I set the default image sampler to always usewgpu::AddressMode::Repeatso all that is needed to tile textures is to change the mesh UVs, which I added a function to make easier to do. There is also aTextureTilingSettingsstruct that stores the intended tiling mode for calculating the new UVs. I also edited thetextureexample to show texture tiling.UPDATE: I removed theTextureTilingSettingsstruct (use aTextureTilingModetuple instead) as I optimized out its usage, and in doing so that also fixed the need to have.init_resource::<TextureTilingSettings>(), which removes the only breaking change I know of.UPDATE: There are 2 helper functions (in the
textureexample) that allow you to easily modify mesh UVs to get tiling. You must also modify theImagePluginlike so:Migration Guide
None :)UPDATE: If for some reason you have a texture doing this in your project (the mesh UVs are larger than the texture), it will now tile. Changing this back involves changingImageSampler'saddress_mode_u,address_mode_v, andaddress_mode_wsettings back toAddressMode::ClampToEdgeUPDATE: No breaking changes! The 2 helper functions live in the
textureexample now.