Thursday, April 10, 2008

Quadtree Holes Fixed

I got the holes fixed, it really really hurt my brain. You can see the results here compared to CLOD. There's nothing that different really, just the same terrain with no holes in it. The weird thing is that the quadtree renders a LOT less polys but the FPS is lower. Also, if I try to render a large terrain, quadtree crawls. I'll have to do some optimisation on it next.

quadnoholes clodnoholes

You can't see it in these pictures but sometime I have these intermittent tiny dots of yellow (so a tiny hole way smaller than a poly) on the quadtree and also tiny hairline cracks with both CLOD and the quadtree.

I think part of the problem is that I'm using my base object which allows an object hierarchy of children to be recursively attached. All this hierarchy does is move each attached child if the parent object moves, so for example, if you move your arm but don't move your hand relative to your arm, your hand should still be in a different position. This is neat for some applications but I think perhaps it's adding unnecessary overhead to the terrain: the patches are all statically fixed unlike joints in an arm. There are inevitable tiny floating point errors which with tons of children attached - like with the patches - is probably causing the hairline cracks. The matrix calculations are adding to the CPU cycles and may be why my quadtree appears to run slower than my CLOD while showing less polys.

So, reluctantly I'll have to overhaul some code and do some optimisation. I hate overhauls, there's little or no visual improvement for a lot of work, but as it stands I think it would take my engine longer to create a world scene than it took the world to be created (even in Creationist terms!) ... stupid Creationists.

No comments: