threejs-worldgen
    Preparing search index...

    Function drawLeafImage

    • Draws a leaf card for shape into an RGBA buffer, with no image files: shapes are evaluated as distance fields. Alpha is a narrow ramp across each edge rather than a hard step, so mipmaps keep the 0.5 iso-line where the edge is and alpha-tested foliage doesn't thin out with distance.

      Parameters

      Returns LeafImage