Log inGet started
Package

nring_foliage.shader

Newest version

README.md

nring_foliage

Foliage and bark for the Nürburgring Drive Eifel forest. One shader draws a whole tree mesh: vertex alpha 0 is bark, alpha above 0 is foliage (and how far it sways with the engine wind).

Card levels (textured = 1): foliage is cut out of foliage_texture (branch sprays / leaf clusters with alpha; the cutoff relaxes from alpha_cutoff to alpha_cutoff_far over cutoff_fade metres because mips thin the alpha), bark samples the tileable bark_texture, and a foliage vertex whose uv.y is 2 or more is opaque crown core. Solid levels (textured = 0: proxies, far stands) draw flat colours with a distance-faded value-noise breakup.

Every instance takes its own brightness and warm/cool shift from a hash of its world origin, the baked vertex shade also darkens ambient so crowns read deep, and foliage gets a weak, rough specular. Normals are authored bent outward from the crown centre and are not flipped on back faces: draw two-sided (cull none) and the cards shade as one volume. lod_focus / lod_near / lod_far give each material a distance window that the forest's ForestDetail component moves with the camera.