Назад
· 1 мин. четене
Normal-mapped sprites
A normal_map on a sprite or shape2d lights it per pixel from every light2d, through kiss3d's LitMaterial2d.
- Dragos Balaur
A sprite or shape2d that names a normal_map is lit per pixel by every light2d, so its bumps catch the light from the side it comes from.
![]()
normal_mapnames a tangent-space image. Give itsrgb = false, in its sidecar or in atextureasset.specular_strengthadds a highlight, andshininesstightens it, 16 by default.normal_strengthscales the bumps; 0 lights the node flat.- A
light2dsitsheightabove the plane, 1 world unit by default. For a directional light,heightis rise over run, so 1 comes in at 45 degrees. - The node draws with kiss3d's
LitMaterial2d. It lights itself, so it draws after the light map's composite, over every node the light map lit, and no light casts a shadow on it. - With no
light2din the scene, a normal-mapped node draws as an unlit one does.
[nodes.sprite]
texture = "art/stones.png"
normal_map = "#stones_normals"
specular_strength = 0.6
shininess = 24.0