Multiple trees in impostor (+Fix)

Demon Lord

07-02-2008 01:25:04

It seems this tree is not alone! (resolution halved)

If you follow closely, the tree in the back follows the camera rotation. I suppose the tree snapshots are created with more than one tree in place...

Obviously, graphic glitches ensue. The same problem exists on all impostor pictures.

Edit: I just noticed that the superfluous trees are always the same and at the same position in each impostor pictures... Might be of interest.

Demon Lord

07-02-2008 02:33:48

Managed to solve the problem.

Most of the PagedGeometry module use RENDER_QUEUE_6. In the current implementation, the trees are placed on the field before the impostors are created. Therefore, if there are trees close enough to where individual trees are photographed, these will also appear in the impostors.

By making sure the impostor pictures are taken alone, there must not be any object in the same render queue.

In the ImpostorTexture::renderTextures() method, changing:

//Only render the entity

//uint8 oldRenderQueueGroup = entity->getRenderQueueGroup();


//Only render the entity

//uint8 oldRenderQueueGroup = entity->getRenderQueueGroup();

was enough to bypass the problem and get adequate impostors.


07-02-2008 03:52:23

Nice, thanks for spotting that :). Apparently the inclusion of cross-LOD fading caused this since before batched geometry used RENDER_QUEUE_MAIN.

Also, I like the idea of using RENDER_QUEUE_6+1 (=61) rather than something like RENDER_QUEUE_7 (=70), since it's a little more obscure and less likely to clash with the user or some other library again.