Alternativa3d 8 Decal object.

The Decal object is a special kind of object in Alternativa3d 8 that always wins the Z-Sorting against other non-Decal object. What does this means? that if you place for example a normal cube and then you create a Decal object with the same geometry as the cube and place it in the very same position, then the Decal object will be drawed on top of the other object.  If you placed 2 normal cubes in the same place, you would see weird depth swapping results, and it will result in an ugly visual effect…

On the left, 2 normal cubes, in the same place. On the right, 1 normal cube and one Decal cube in the same place (Decal wins)

To create a Decal object you:

  1. Instanciate a Decal object.
  2. Set the geometry that the Decal object will use, a reference to a Geometry object. Because the point of using decal objects is to place them over another geometry, this will have the shape of the surface on which it will be placed. Generally a plane, but can be any shape…
  3. Then, based on the geometry, you create the surfaces for the object to be able to map a texture onto it.
  4. Place the Decal object in the scene, at the same position of the desired suface.

The common use of this type of object is to create visual effects over a surface without changing the texture of the original surface on which it is being applied.