Laserbrain Studios

Games Forum Blog Contact

Author Topic: Smooth lighting  (Read 1828 times)

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Smooth lighting
« on: March 10, 2012, 12:06:35 AM »

As mentioned briefly in the last blog post, I’ve been working on smooth lighting. That’s now complete and working as well as I think I’ll get it to. Check out these comparison screenshots:


Click to enlarge Click to enlarge


Click to enlarge Click to enlarge


As I also mentioned in the last blog post, this was somewhat inspired by the Project Zomboid programmer adding smooth lighting to that game (and now I notice that they also posted some comparison screenshots just yesterday!). I believe he accomplished this by overlaying a multiplied and untextured polygon that completely matches the shape of each ground tile, with the vertices of that polygon set to color values that create a smooth transition. I tried this as well, but wasn’t quite able to get the same results, and switching the OpenGL blending between normal mode and the multiply mode each frame also added a bit of overhead, so I went for a simpler method where I just supply the smoothing color values to the vertices of the sprite itself, skipping the overlay entirely.


The Project Zomboid method results in much smoother lighting on the ground (there really aren’t any hard edges at all), while my method still retains some of the per tile lighting, which I kinda like. It’s sort of halfway between the old X-COM hard lighting and the completely smooth lighting of Project Zomboid. I’m adding a toggle to the options menu to turn smooth lighting off if you prefer the old school hard edges.



Joseph

  • Guest
Smooth lighting
« Reply #1 on: March 12, 2012, 04:55:57 PM »

Looks nice. I really like the ‘grained’ look.



Darren

  • Guest
Smooth lighting
« Reply #2 on: March 28, 2012, 02:45:36 AM »

Nice can’t wait to be able to buy or try a demo of your game