-
-
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
Example how to repeat texture #11109
Conversation
The generated |
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.
Looks like a useful example?
We should avoid using AI generated assets in the repo due to questionable copyright status.
Can you open a bug for not respecting loader settings when loading different files?
It might be an issue if this asset was distributed with Bevy (to be used in large company), but this does not apply to examples. Or any suggestions how to make/get a better texture? |
Midjourney has a vested commercial interest in that position: the law is definitely not settled and we can sidestep the question easily enough. As for alternate textures, I'd look for a tile pack on itch.io labelled under Creative Commons. I like the looks of this water texture, or perhaps this industrial background. |
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.
Almost every bevy examples puts main()
at the top, then setup()
then everything else. This example should also follow this pattern.
Most examples also use ..default()
instead of ..TypeName::default()
.
(Also I accidentally re-requested review from Alice Cecile). |
I still think the comment should explain why it's important for the UVs to be outside of the My suggested comment was wrong but I didn't mean you should use that one, just something in the same style. Like you said, just repeating what is in the code isn't helpful but explaining why it's like this is important. Especially when it comes to examples. Maybe something like: "A Quad with UVs outside of the Without a comment like this it isn't obvious why you are manually constructing a mesh here. |
These are quite obvious logical steps if you understand what the problem is. And you probably are, if you looked at screenshot. There are bazillion things which are not obvious in this example for the beginner, for example:
Examples are not meant to be obvious to complete beginners. Examples are meant to require basic understanding of machinery below, so that one thing on top is explained. And the explanation is not mesh generation, it is this line of code: // Here we override the sampler settings to repeat the image instead. This is not step by step tutorial from zero knowledge of programming to your shiny AAA game. If you already know how texture mapping works, but want to know how to make texture repeated, this is the example for you. Anyway, I changed the comment to: /// Quad with UV coordinates in range `-1..=2`, which is outside of texture UV range `0..=1`.
It does not force texture to repeat. Moreover, this quad is used twice: once with default settings, and second time with texture repeated. |
Added another comment on top. |
I just want a comment to explain why there's a function that creates a quad when bevy already has a quad. I asked that question in the original review because it wasn't obvious on a quick read. It's also why I suggested the order of functions should be main(), setup(), everything else. Putting mesh generation at the top just makes it seem important but since it's not the main point of the example without explanation it just seems like it distracts from the goal. Again, I know my suggestions are not necessarily the most correct. I just want to show the style of comment I'm looking for. I said the texture repeats because I just couldn't think of a better word. I know it doesn't necessarily repeat. I'm not asking for a comment to explain every basic thing. I just want a comment to explain why this function exists. Here's another suggestion (again, doesn't have to be used verbatim but in a similar style of not just stating the obvious) /// Builds a Quad with UVs in the range `-1..=2` to showcase the sampling modes.
/// We need to do this because the built-in Quad always has UVs in the range `0..=1`. |
Are you sure you are being objective here? Speaking for majority of readers?
Everything in this PR is to showcase the sampling modes.
I consider this comment redundant.
After several iterations of applying your comments, I have a suggestion. First, we wasted too much time already discussing trivial things. Second, I applied all your suggestions which I believe are beneficial, and even some which, in my subjective opinion, decrease this example quality. Further applying these suggestions would make this example even worse in my subjective view, so I could no longer sign this off. So can you please take this PR from me, and submit it with your name, in a way you believe it should be done? |
Great, I've closed this PR. I'll make an issue to adopt it. |
If @IceSentry wants to do it, fine with me. If @alice-i-cecile agrees with suggestions by @IceSentry, then maybe I'm wrong. But just throwing away the PR calling it good-first-never-to-be-resolved issue, does not look constructive. |
As an SME-Documentation, I agree with IceSentry's position. Consistency, clarity and polish are critically important for learning materials. As a maintainer, your behavior here is frustrating and difficult to work with. You were provided with a friendly, constructive review and good faith questions. Rather than fixing the issues or asking questions about why we see it as valuable, you insisted that you knew best, derailed into a condescending explanation of bikeshedding and then said "please take this off my hands". Following the suggestions is not particularly challenging: I suspect this will be adopted pretty readily. I am genuinely grateful for your contributions: they have largely been high quality, and resolved a number of problems in our code and documentation as you've encountered them. However, this is part of a continuing pattern of hostile and argumentative behavior, particularly when receiving feedback, that is not consistent with our code of conduct. Please pay particular attention to the second and third bullet point listed there. Differences of opinion are welcome here: it's vital to building something good and steadily improving it. But this is my workplace: vitriol and condescension have no place in it. |
Comment incorrect suggests that texture is clamped outside of `0..=1` range, while it can actually be configured. CC #11109
Encountered it while implementing #11109. Co-authored-by: Alice Cecile <[email protected]>
Shortcut to avoid repetition in code like #11109. --------- Co-authored-by: Alice Cecile <[email protected]>
Texture from ambientCG.
Adding two copies because Bevy ignores loader settings when loading the same file twice.