-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Add an example demonstrating how to repeat textures #11136
Comments
I was looking at that PR briefly earlier and had a few questions for @IceSentry or other rendering/assets folks. I'll post them here.
|
IMO that issue is likely to be fixed quite easily: I'd prefer to wait on the fix rather than polluting the main git history. |
Is it? This code bevy/crates/bevy_asset/src/server/info.rs Line 64 in 70b0eac
maps assets by path. To work correctly, this should be mapped by a pairs: (path, For the reference, the definition of bevy/crates/bevy_asset/src/meta.rs Line 9 in 70b0eac
The opposite might be practically more convenient: land the example, and then remove extra copy during the fix demonstrating the issue is actually fixed. |
While the new example would be nice, there is no rush, and adding it now doesn't add that much value rather than waiting a bit on how to fix the underlying issue. I don't remember that scenario (loading the same file with different settings) being discussed in the recent asset rework. Let's wait for more people to chime in on #11111. It's an holiday season for many, so it can take a bit of time. |
@mockersf Do you think we really need to show off non-repeating textures in this example? Could we just strip that part of the example out? |
Yup that could work! |
If we remove non-repeating texture example, it won't be obvious what this example demonstrates: that is texture is not repeating by default, side by side (both code and visually) what it means. In particular, what code is mandatory to just make textures work, and what is the delta to make it repeating. |
I think that's sort of inherent in an example where there all these extra steps to do a repeating texture. The important part in my eyes is showing users how to accomplish this. It's not trivial to do right now, and users really want to do it. I can see the utility in showing users the results side-by-side, especially in the example showcase. But it doesn't seem totally necessary and skipping it is a way to unblock this. |
There are steps to step up texture, and there are extra steps to make it repeating. Example as is shows that setting up image sampler is extra steps.
Example is not really blocked. Two copies of the file until the issue is fixed is a small price to pay. Alternatively, an image can be loaded directly, without asset server. |
I was looking for a way to make a repeated texture today. I was using the plane mesh builder and I expected a way to control UVs there. Currently that isn't supported, and the UVs are always in the // Example, current
let mesh = Plane3d::default().mesh().size(5.0, 5.0);
commands.spawn(PbrBundle {
mesh: meshes.add(mesh),
..default()
}) not exactly sure what the API should look like but it would be great if something like // Example, with modified UVs
let mesh = Plane3d::default().mesh().uv(Vec2::new(3.0, 2.0)).size(5.0, 5.0);
commands.spawn(PbrBundle {
mesh: meshes.add(mesh),
..default()
}) which would make the mesh have UVs from I think that would be a more user friendly approach than having to go via mesh attributes |
I didn't use *.meta files for sampler configuration (I used configuration in code too), because meta files mask is in .gitignore |
# Objective Fixes #11136 . Fixes #11161. ## Solution - Set image sampler with repeated mode for u and v - set uv_transform of StandardMaterial to resizing params ## Testing Got this view on example run ![image](https://github.com/bevyengine/bevy/assets/17225606/a5f7c414-7966-4c31-97e1-320241ddc75b)
This is a simple adoption of #11109.
The text was updated successfully, but these errors were encountered: