• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Limited number of vertices in 2d primitives?

J

Jonas Mumm

Guest
Hey all,
today I've started programming a system that allows me to draw planets with different layers in 2d.
For this matter I've used 2d primitives, and as I need many "round" edges for the planet I've added a variable that controls the number of sides the polygons are drawn with to make them appear round (very similar to draw_set_circle_precision).
Now what I stumbled across is that seemingly there's a limit of how many vertices can be put into a single primitive: When I increase my circle precision variable, the primitive is drawn incomplete once the vertex-count in that primitive surpasses ~1000.
I've checked my code multiple times for an error, but everything seemed fine.
I also made Gamemaker handle the drawing process within multiple seperate primitives, and everything worked as expected.
What I'm asking now is wether there's indeed a limit of how many vertices can be in a single primitive, and if so wether there is a meaningfull way to surpass that limit.
Any help is appreciated :)
 

Mike

nobody important
GMC Elder
I do seem to remember there being an odd internal limit to single batches for old d3d_prim types.

Use vertex buffers, there is no limit on them - should be faster too. (failing that, just submit the batch every 1000)
 
J

Jonas Mumm

Guest
Thank you for the reply Mike, I will probably stick to splitting the draw process into multiple primitives then!
 
R

renex

Guest
I remember having issues after exactly 32000 vertices way back still in 8.x.

I also recommend vertex buffers, after you get them working they're really fast and flexible too.
 
Top