Bitbybit Docs
    Preparing search index...

    Class BabylonDecal

    Sticking images onto meshes, the way a label or a logo sits on a product. A geometry decal is a thin clipped mesh hugging the surface, which works on any static mesh; a decal map paints into the mesh's own texture space instead, adds no geometry, follows deformation and lets many projections build up, but needs clean UV coordinates.

    Index

    Constructors

    create

    • Creates a geometry decal that projects an image onto a mesh. The decal is a clipped child mesh that hugs the surface of the source mesh, which makes it work with any material and on any static mesh. It adds geometry, so for deforming meshes or many accumulating decals prefer the decal map approach instead.

      Parameters

      Returns Mesh

      Babylon mesh representing the decal, parented to the source mesh

    • Enables a UV-space decal map on a mesh and turns on the decal map plugin of its material. Unlike geometry decals this projects images directly into the mesh texture space, so no geometry is added, decals follow deformation and multiple projections accumulate into a single map. The mesh must have proper, non-overlapping UV coordinates.

      Parameters

      Returns MeshUVSpaceRenderer

      Babylon decal map renderer used to project images

    update

    • Projects an image into a decal map. Each call adds the image at the given location, accumulating onto previously projected decals. Use it together with a decal map enabled on the mesh.

      Parameters

      • inputs: ProjectDecalDto

        decal map renderer, image texture and projection parameters

      Returns void

    • Clears all projected decals from a decal map, resetting it to empty.

      Parameters

      Returns void