We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm creating a Tile object and then I have a function to draw things with this tiles. Problem is that I need at least 140 instances of those tiles and my frame rate is being killed
My Tile object is made of 2 arcs() and 2 lines(). Sometimes I have a third arc() colouring the tile. My Tile object changes its size according to how the function that draws with it calls it.
Looking for the solution I found Daniel's pshape tutotal which says:
Try to draw around 500 stars and your sketch may run rather slowly, about 10 FPS. This is because this style of drawing, often referred to as "immediate" mode, requires the renderer to compute the geometry each time through draw for each and every star. But is this necessary? After all, it's the same star over and over and over again. Using a PShape allows Processing to essentially "memorize" the geometry of that star. Drawing the memorized geometry (called a "Vertex Buffer Object" in lower-level OpenGL syntax) is called "retained" mode and is a great deal faster. Those 500 stars render easily at 60 FPS using a PShape instead. This can be achieved by including a PShape variable as part of the Star class.
So I looked for such PShape in P5 and only found that where the topic of PShape seems to be in the design phase.
So here I am, asking you guy for a work around : ]
(things I have tried: - hide my tiles as much as possible (I get 5 FPS that way) - render my tile with 2 arcs with big strokes (I get 10 FPS that way [ I need 30]) - render my tile with a bezier... I get lost trying to make my shape parametric - move everything, as is, over to Processing (I get almost 30 FPS !!! :) but my webpage doesn't get better :( ) - I didn't even try to implement the PShape thing in Processing since the Frame Rate is fine )