Page 1 of 1

Alphamaps gone wrong

Posted: Thu Jan 03, 2008 6:39 pm
by shogun
Hallo,

I just experienced a strange error in my project:
Image

The alphamap (the dirt) shines through another alphamap (the wing of the mill), i.e. the sorting is wrong. The wings of the mill are animated, of course.
Perhaps somebpdy could enlighten me what could cause this.

Posted: Mon Jan 07, 2008 1:51 pm
by christianclavet
Hi Shogun.

Can you give me some more detaisl. The dirt and the wing of mill are part of the same object? Are those are 2 poly superposed?

What is animated in the wings of the mills? The texture or the mesh?

Posted: Mon Jan 07, 2008 7:43 pm
by shogun
Thanks for the reply but I already solved the problem. Well, it's not really solved, but I do understand now why the texture shines through. (BTW, dirt and wings aren't part of the same scene node, and the wings rotate, there is no texture animation.)
The problem is that the wings, as there are four of them in one scene node, have a pretty big bounding box. At some point the bounding box of the house (with the dirt) is "nearer" to the camera than the wings, because only the center of the bounding box is calculated for distance. As soon as the center of the house is nearer to the camera than the center of the wings, the sorting of the alphamaps goes wrong and the dirt shines through.
I will now create only one wing and make a scene node for every wing, so their bounding boxes aren't so big any more.

Posted: Mon Jan 07, 2008 8:06 pm
by dlangdev
oh dear, this one reminds me of the never-ending debate between bounding boxes and convex hulls.

anyway, BBs are easier to calculate, though i would prefer convex hulls if there is hardware support for it.