Skip to content
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

The cube example shouldn't use integers for texture coordinates #390

Open
ucarion opened this issue May 27, 2017 · 0 comments
Open

The cube example shouldn't use integers for texture coordinates #390

ucarion opened this issue May 27, 2017 · 0 comments

Comments

@ucarion
Copy link

ucarion commented May 27, 2017

This isn't a bug, but rather a suggestion for making the cube example more helpful for noobs (like me).

In the cube example, a_tex_coord is an ivec2/[i8; 2], which led me to assume that it is supposed to be an index. Of course, if I knew how texture() works in fragment shaders, I would have known better -- but I didn't, because I'm a noob. I assumed that a_tex_coord was a 2d-index into my texture, rather than a point in the unit square.

Perhaps a_tex_coord should be changed to be of the type vec2 in GLSL and [f32; 2] in Rust? Having it be an integer is useful only in the case of a texture of size no greater than 2x2, which is a rare use-case.

If there's no reason against making this change, I'll gladly open a PR myself. But I have the suspicion that I simply don't have the relevant context, and that there's a good reason the code is as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant