This topic is now archived and is closed to further replies.


Batching polygons and state change

Recommended Posts

Hi everyone, I have read a lot of topics about DirectX and I know that I must batch my polygons so I can minimize the DrawIndexPrimitive calls into my main game loop. I don''t understand how I can batch polygons that have different textures, different shaders or different states. Is the number of buffers must equals to the minimum state changes for each frames ? Another question is if I have for example 2 objects that move in my world. Those 2 objects may have their own buffers and for the moment, I do something like this : SetupMatrixForObject1(); DrawObject1(); SetupMatrixForObject2(); DrawObject2(); If I place the 2 objects buffer into 1 buffer, how can I setup the matrix for each objects ?

Share this post

Link to post
Share on other sites