You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 19, 2021. It is now read-only.
The particle system can be improved a lot. This is an unordered list of things I noticed:
the small vertex buffer for the particle quad should be created only once, instead of every draw() call
the bigger dynamic vertex buffer shouldn't be recreated every draw() call: it's filled with a buffer map afterwards anyway! So just use the old buffer.
currently, you create the Vec for the dynamic vertex buffer from the particle list first, then you simulate all particles and change the position in both vectors! First simulate your particles and fill the vertex buffer afterwards with the final positions
we could use two dynamic vertex buffers to use "double buffering" ... I've read this can give quite a performance boost, but this is rather complicated and needs to be measured
Apart from all this: you should really try to make your code more readable and shorter. Strive for the shortest, most expressive, most self-explanatory code that solves your task at hand.
The text was updated successfully, but these errors were encountered:
The particle system can be improved a lot. This is an unordered list of things I noticed:
draw()
calldraw()
call: it's filled with a buffer map afterwards anyway! So just use the old buffer.Vec
for the dynamic vertex buffer from the particle list first, then you simulate all particles and change the position in both vectors! First simulate your particles and fill the vertex buffer afterwards with the final positionsApart from all this: you should really try to make your code more readable and shorter. Strive for the shortest, most expressive, most self-explanatory code that solves your task at hand.
The text was updated successfully, but these errors were encountered: