-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Make tiling a texture easier #7406
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
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 <[email protected]>
Co-authored-by: robtfm <[email protected]>
Objective
This PR attempts to implement a simpler way to tile textures.
Solution
I set the default image sampler to always usewgpu::AddressMode::Repeat
so 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 aTextureTilingSettings
struct that stores the intended tiling mode for calculating the new UVs. I also edited thetexture
example to show texture tiling.UPDATE: I removed theTextureTilingSettings
struct (use aTextureTilingMode
tuple 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
texture
example) that allow you to easily modify mesh UVs to get tiling. You must also modify theImagePlugin
like 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_w
settings back toAddressMode::ClampToEdge
UPDATE: No breaking changes! The 2 helper functions live in the
texture
example now.