[Okada’s World Devlog] v0.08

The way I had implemented lighting was taxing on even a fast PC.

It was basically a large lighting texture, scaled hundreds of times higher - way off in the distance, to simulate a sun.

The problem with this is it is inefficient, and as soon as any other lighting texture came into the mix - things ground to a halt.

Instead I went with a more typical approach for 2d games, which is to modulate the entire viewport based on the intended lighting effect.

  • [ADD] torch spritesheets for Okada
  • [ADD] torch you can pick up / drop with a / b (space/q on keyboard)
  • [FIX] global lighting in place of global canvasmodulation, improving performance by about 15x, sacrificing shadows, and making entering caves require canvasmodulation override

Peter Alabaster

Full time Software Engineer & Dad. Keep up to date with my projects here.


Performance - Lighting rework

By Peter Alabaster, 2020-05-10