Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualHodgman

Posted 18 October 2012 - 07:23 PM

Yeah that was just another option for hiding sub-meshes - it would require each sub-mesh to not share any verts with other sub-meshes (but that's guaranteed because the per-sub-mesh UV coordinates make the verts unique).

You could apply the same trick to your already mentioned bone-based sub-meshes, where if you wanted to hide a sub-mesh after it's been on the floor for some time, you could replace that bone's transform matrix with a scale=zero matrix.


I've only used the multiply-by-zero trick in a few cases, such as:
* Tile-based post processing. Instead of using a full-screen quad for post effects, you can use a grid of quads. If a quad doens't need to be processed (e.g. it's entirely in-focus when performing DOF) you can hide that quad.
* Shader LOD on sub-meshes. We had an expensive pixel shader and a cheap LODed version of that pixel shader. We first used a per-pixel if to choose which one would be used, based on distance, but then found that on our target GPU it was quicker to draw the mesh twice (once with each shader) and then hide one of the meshes if it's beyond a certain distance, and hide the other if it's closer than a certain distance -- so that when the mesh's centre point gets a certain distance away, it automatically starts using a cheaper pixel shader.


There's practically endless options for mesh rendering, depending on what your situation is. So, different games would be best suited to different mesh rendering schemes.

#1Hodgman

Posted 18 October 2012 - 07:19 PM

Yeah that was just another option for hiding sub-meshes - it would require each sub-mesh to not share any verts with other sub-meshes (but that's guaranteed because the per-sub-mesh UV coordinates make the verts unique).

You could apply the same trick to your already mentioned bone-based sub-meshes, where if you wanted to hide a sub-mesh after it's been on the floor for some time, you could replace that bone's transform matrix with a scale=zero matrix.

I've only used the multiply-by-zero trick in a few cases, such as:
* Tile-based post processing. Instead of using a full-screen quad for post effects, you can use a grid of quads. If a quad doens't need to be processed (e.g. it's entirely in-focus when performing DOF) you can hide that quad.
* Shader LOD on sub-meshes. We had an expensive pixel shader and a cheap LODed version of that pixel shader. We first used a per-pixel if to choose which one would be used, based on distance, but then found that on our target GPU it was quicker to draw the mesh twice (once with each shader) and then hide one of the meshes if it's beyond a certain distance, and hide the other if it's closer than a certain distance -- so that when the mesh's centre point gets a certain distance away, it automatically starts using a cheaper pixel shader.

PARTNERS