Jump to content
  • Advertisement
Sign in to follow this  
JohnHurt

Batching

This topic is 4876 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Say I have a load of geometry in the node of a quadtree, not all peices of geometry shares the same texture. What i want to do is send this geometry to the renderer, sorted by material. What is the best way to impliment a vertex buffer in this situation? Do you build the buffer each frame? BTW: this is in OpenGL.

Share this post


Link to post
Share on other sites
Advertisement
Why would you want to do it each frame ? You build it once only. If you plan on updating the texture you could use glTexSubImage2D for it. Anyway building it each frame would lose its purpose.



Share this post


Link to post
Share on other sites
ok, after you've built the vertex array, how do you switch textures? say, i put all the peices into 1 array, how would you know when to change the current texture?

Share this post


Link to post
Share on other sites
You batch it based on material. Your material info will have the texture id/key or the bound texture ID itself with which you access your texture from your texture manager. So your structure will go something like this


MaterialInfo
FaceList
MatrixInfo



Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!