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

Add support for an index buffer #2

Open
OmarShehata opened this issue Dec 11, 2021 · 0 comments
Open

Add support for an index buffer #2

OmarShehata opened this issue Dec 11, 2021 · 0 comments
Labels
good first issue Good for newcomers

Comments

@OmarShehata
Copy link
Owner

Right now the compute rasterizer only supports a simple list of triangles. It would be a good exercise to add support for an index buffer to support more complex models without using too much memory. You'll need to:

  • Create another buffer, similar to the vertex buffer, that holds indices into the vertex buffer, and send that to the compute shader
  • Change how many times the compute dispatches to number of indices / 3
  • In the shader, get the triangle v1, v2, v3 by getting the next 3 indices and fetching them from the vertex buffer
  • Change src/loadModel.js to return a vertex buffer and an index buffer
@OmarShehata OmarShehata added the good first issue Good for newcomers label Dec 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant