organicCard.shader
- .metadata15 B
- README.md1.1 KB
- preview.png25.2 KB
- properties.yaml1.1 KB
- shader.wgsl4.2 KB
README.md
organicCard
The surface of organicMaterials' translucent cut-out cards (leafBroad, leafNeedle, leafAutumn, petalPink, featherCard). It hands the engine a full PBR surface (base colour with alpha, ORM mask, green-up normal map, sheen) and shades it with zero_pbr_shade, then adds diffuse transmission: a thin leaf lit from behind glows over its whole area in translucency_color × translucency, with its veins and spots showing through, brightest when you look toward the sun (forward_scatter). Other cards' shadows block it, so a leaf behind a leaf stays dark. Fragments under alpha_cutoff are discarded; back faces flip their normal, so a card shades correctly from both sides (cull: none).
Why not the engine's subsurface_color: its back-transmission term only lights up when the view looks almost straight into the light through the surface (a (v·−l)^4 cone scaled by the albedo), so a backlit leaf seen from the side stays dark.
Four sampled textures. Transmission is taken from the sun and the sky; point and spot lights light the front through the engine's usual lobes.