the_dude_abides
Member
I'm not very well versed in the graphics side of GMS 1.4, so some (or all) of this may be incorrect
I vaguely recall someone saying that when drawing primitives each change of sprite used for a texture constitutes a draw call. So when using textured primitives you want to draw as much as possible (presumably still within some limit imposed by the engine itself, or the gpu) before changing to anything else.
My current project is an enemy with a lot of moving parts, that won't quite work as hoped if I use the sprite drawing functions and it would need multiple sprites. So I have done it as textured primitives, which only requires one sprite, and arranged it so that it follows the above thinking.
I suppose the first question is: is that thinking wrong about the draw calls?
One object draws everything for this enemy. Every object where there is multiple of it, is done through a triangle list of all their points, so there is only one draw call (?) for that sprite. It only needs one sprite, as I have the texture coordinates for every point that it's drawing. I can animate it through the points, so there is that benefit too. But that might be a moot gain, depending on whether my understanding about the draw calls is correct.......
The final question, if this thinking is not wrong, is this: Is this actually just doing what GMS handles under the hood? (because all of its graphics are textured primitives anyway)
If I instead had instances drawing this themselves somehow, would GMS just draw it in a structured way:
1) find sprite to be drawn
2) start the primitive
3) loop through all that have the sprite + do vertexes
4) end the primitive
Like that? So every instance is handled under one draw call?
Or is each instance a draw call?
I'd like to understand how it works, if anyone doesn't mind explaining
Cheers!
I vaguely recall someone saying that when drawing primitives each change of sprite used for a texture constitutes a draw call. So when using textured primitives you want to draw as much as possible (presumably still within some limit imposed by the engine itself, or the gpu) before changing to anything else.
My current project is an enemy with a lot of moving parts, that won't quite work as hoped if I use the sprite drawing functions and it would need multiple sprites. So I have done it as textured primitives, which only requires one sprite, and arranged it so that it follows the above thinking.
I suppose the first question is: is that thinking wrong about the draw calls?
One object draws everything for this enemy. Every object where there is multiple of it, is done through a triangle list of all their points, so there is only one draw call (?) for that sprite. It only needs one sprite, as I have the texture coordinates for every point that it's drawing. I can animate it through the points, so there is that benefit too. But that might be a moot gain, depending on whether my understanding about the draw calls is correct.......
The final question, if this thinking is not wrong, is this: Is this actually just doing what GMS handles under the hood? (because all of its graphics are textured primitives anyway)
If I instead had instances drawing this themselves somehow, would GMS just draw it in a structured way:
1) find sprite to be drawn
2) start the primitive
3) loop through all that have the sprite + do vertexes
4) end the primitive
Like that? So every instance is handled under one draw call?
Or is each instance a draw call?
I'd like to understand how it works, if anyone doesn't mind explaining
Cheers!
Last edited: