Alphamaps gone wrong

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
shogun
Posts: 162
Joined: Wed Sep 05, 2007 11:02 am
Location: inside

Alphamaps gone wrong

Post 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.
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post 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?
shogun
Posts: 162
Joined: Wed Sep 05, 2007 11:02 am
Location: inside

Post 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.
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post 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.
Image
Post Reply