TreeAtlas¶
-
class TreeAtlas¶
Bases:
TypedReferenceCountPaints a species’ textures, deterministically from a seed: no image files.
`paint_leaves(style, rgb, variation, seed)` draws `SPRITES` sprites of `SPRITE` pixels side by side (a leaf card picks one). A sprite’s shoot runs from its bottom edge (the card’s anchor on the twig) upwards, the way
TreeMesherlays a card along its leaf. Styles: `broadleaf`, `maple`, `small`, `bush` (clusters of leaves round a few twigs), `willow` (hanging strands), `needles` (a flat spray: side shoots combed with needles, fir and spruce), `pine` (brushes of long needles), `frond` (palm leaflets). See-through texels take their neighbours’ colour (no dark fringes), the mip chain keeps the top level’s alpha-tested coverage, and a normal map domes each blade from its edge.`paint_bark(style, rgb, seed)` draws a `BARK_W` x `BARK_H` texture that tiles both ways (`furrowed`, `smooth`, `birch`, `plates`, `scaly`, `palm`) and a normal map from its shading.
The images are float RGBA/RGB, top row first (`get_leaves()` …), for tests and tools; `make_*_texture()` upload them: colour as sRGB, normal maps linear (tangent space: +x along U, +y along V, V up). All the arithmetic is in doubles in a fixed order, the randomness splitmix64.
Inheritance diagram
digraph inheritanced18de84022 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; "TreeAtlas" [URL="acron.proctree.TreeAtlas.html#acron.proctree.TreeAtlas",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedReferenceCount" -> "TreeAtlas" [arrowsize=0.75,style=""]; "TypedObject" [URL="acron.core.TypedObject.html#acron.core.TypedObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "TypedObject" [arrowsize=0.75,style=""]; "TypedReferenceCount" [URL="acron.core.TypedReferenceCount.html#acron.core.TypedReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedObject" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; "ReferenceCount" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; }- TreeAtlas.__init__()¶
- static TreeAtlas.bark_normal_strength()¶
How hard the bark’s normal map leans, by style.
- TreeAtlas.get_bark()¶
- TreeAtlas.get_bark_normal()¶
- static TreeAtlas.get_class_type()¶
- TreeAtlas.get_leaf_mip()¶
- TreeAtlas.get_leaf_mip_size()¶
- TreeAtlas.get_leaves()¶
- TreeAtlas.get_leaves_normal()¶
- TreeAtlas.get_num_leaf_mips()¶
- TreeAtlas.make_bark_normal_texture()¶
The bark’s normal map (linear, tiling).
- TreeAtlas.make_bark_texture()¶
The bark as a tiling sRGB texture.
- TreeAtlas.make_leaf_normal_texture()¶
The leaves’ normal map (linear RGBA; the GPU builds its mips).
- TreeAtlas.make_leaf_texture()¶
The leaf sprites as an sRGB RGBA texture with the coverage-keeping mips.
- TreeAtlas.paint_bark()¶
Paints the tiling bark and its normal map (from its shading).
- TreeAtlas.paint_leaves()¶
Paints the leaf sprites, their normal map and the alpha mip chain.