Hallo,
I just experienced a strange error in my project:
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.
Alphamaps gone wrong
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
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.
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.