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

Batching for the rendering of objects. #6279

Open
2 of 17 tasks
RandomGamingDev opened this issue Jul 23, 2023 · 2 comments
Open
2 of 17 tasks

Batching for the rendering of objects. #6279

RandomGamingDev opened this issue Jul 23, 2023 · 2 comments

Comments

@RandomGamingDev
Copy link
Contributor

RandomGamingDev commented Jul 23, 2023

Increasing Access

This would increase the speed of projects.

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build Process
  • Unit Testing
  • Internalization
  • Friendly Errors
  • Other (specify if possible)

Feature enhancement details

Currently projects with multiple shapes drawn can be very slow. This is largely due to draw calls. This can be partially fixed with instancing like seen here: #6276 and in issue #6275, but another effective strategy, especially for those who don't want to deal with more complex things like combining meshes manually or instancing would be to batch the rendering of objects together so that they may be able to be drawn within less drawn calls. This would however be quite the undertaking and require a decently substantial change to p5.js, so if it's not possible or worth it to implement this, I'd understand that too.

@davepagurek
Copy link
Contributor

Specifically for the combining multiple meshes into one case, I'm working on something for #5393 that will be able to do that, I'll tag you when I put up a PR so you can see if that addresses some of the use you're thinking of! For now it'd be done on the CPU once upfront to create a p5.Geometry that can be drawn all at once with model(), optimizing mostly for the case where you would be reusing that one combined shape. In the future that could be sped up with webgl2 transform feedback instead of CPU calculations, but maybe you were talking about something more immediate mode than retained mode like that?

@RandomGamingDev
Copy link
Contributor Author

That sounds pretty good and I was talking more generally so both count lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: System Level Changes
Development

No branches or pull requests

3 participants