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

Question about attribute indexes #8

Open
CarterFendley opened this issue Sep 4, 2022 · 0 comments
Open

Question about attribute indexes #8

CarterFendley opened this issue Sep 4, 2022 · 0 comments

Comments

@CarterFendley
Copy link

Thank you for the great videos + code!

I am following along here. After watching your second tutorial, I was getting the results shown below.

Screen Shot 2022-09-03 at 11 15 07 PM

Comparing the diff between my code at the time and yours, I could not see any meaningful difference. Eventually I stumbled into the get_attrib_location(...) function and gave that a try. In this commit I was able to use this function to patch the issue and get the result shown at the end of the second video (very exciting!).

When printing out the attribute values, I found that they were reversed from the ones I expected (aColor: 0, aPosition: 1). This happens even though I list my attributes in the same order you have them in the shader.

My question is: Why might this happen? Do different GPUs order the indexes differently?

The docs for enable_vertex_attrib_array(...) does note "Some vertex attribute indices may have predefined purposes, depending on the platform and/or the GPU." Could this be related.

Cheers 🍻

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