Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualMJP

Posted 27 March 2013 - 07:45 PM

To batch like this you either need to pre-transform the vertices, or in the vertex shader you need to be able to look up which mesh any given vertex belongs to so that you can retrieve the correct world matrix. However you're talking about static meshes here, so you could just pre-transform once when building the level or at load time. That said, your approach may not scale well for scenes with high-polygon scenes since you will have to move and process a whole lot of data on CPU. There can also be GPU performance implications from accessing memory that's CPU-writable.

The more modern approach would be to use instancing, which is where you draw the same mesh many times in a single draw call. Of course, this relies on you having meshes that are duplicated many times.


#1MJP

Posted 27 March 2013 - 07:42 PM

To batch like this you either need to pre-transform the vertices, or you in the vertex shader you need to be able to look up which mesh any given vertex belongs to so that you can retrieve the correct world matrix. However you're talking about static meshes here, so you could just pre-transform once when building the level or at load time.

The more modern approach would be to use instancing. However instancing relies on having the same mesh duplicated many times throughout the scene.


PARTNERS