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

Why matrix can't be passed as mat4x4? #586

Open
ivnsch opened this issue Dec 23, 2024 · 0 comments
Open

Why matrix can't be passed as mat4x4? #586

ivnsch opened this issue Dec 23, 2024 · 0 comments

Comments

@ivnsch
Copy link

ivnsch commented Dec 23, 2024

In https://sotrh.github.io/learn-wgpu/beginner/tutorial7-instancing/#the-instance-buffer, it would be good to explain why we need to define a slot for each vec4. It's especially confusing since the camera uses directly mat4x4 in the shader, so a bit more background would be helpful.

// A mat4 takes up 4 vertex slots as it is technically 4 vec4s. We need to define a slot
// for each vec4. We'll have to reassemble the mat4 in the shader.
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