FLAT SPRITESNORMAL LIGHTING
WebGL2
frame -
-
Bitmaps with L-05 mapsThe keeper, herbalist, lampposts and well are drawn with
drawSprite(img, map, ...). Nothing that carries a lantern is mirrored: the keeper only walks to the right, the herbalist looks at him from the left. The slimes are (a symmetric blob): when one hops left its map is mirrored and negated, so the light still falls on the side that faces it.No map, derivedThe oak has no normal map:
'derive' builds one from its alpha and shading. Canvas paths wrapped in shape() get normals from the drawn shape the same way. The moss slimes are painted sprites whose map was derived offline by the L-05 tool.Shares J-01's lightsThe dusk darkness, lantern pools and shadows are J-01. J-02 reads the same light list and adds the relief, glints and rim on the sprites. Switch J-01 off: J-02 lights its own copy of the lights.