ikbensiep / lofigame

A 2D game without canvas, only html vibes. SVG is used not only for artwork but to annotate as much world/level data as possible, simply by drawing shapes accoring to a few rules. Exploring wether it's worthwile to make it into an open source 2d world game engine.
https://ikbensiep.github.io/lofigame/
GNU General Public License v3.0
1 stars 0 forks source link

Generate lightmaps (in a clever way) #27

Open ikbensiep opened 11 months ago

ikbensiep commented 11 months ago

----8<--------8<-------8<--------8<--------8<----

previously, in this issue:

This super simple effect can add dramatic night time lighting:

  1. create an element to cover the entire world (ie, ::after)
  2. add a dark (blue) background color and add a repeating background-image with a radial gradient
  3. set this (pseudo) element's mix-blend-mode to multiply

Yields:

Image

Image

Not bad.

However, to have light around the complex shapes of a racetrack, a repeating pattern won't do.