Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Unfortunately this is very demanding to run considering the whole 1000 rays per pixel strategy. You'll also notice slightly awkward corner clipping. 

I highly suggest you only cast rays to vertices of walls for performance saves (https://ncase.me/sight-and-light/). (note: you will need to make custom code to identify walls/corners from the normal map. You could also brute-force it and treat every single opaque pixel as a square wall with 4 vertices, and then when initially loading the map for the first time, determine which pixels aren't consecutively connected, so you can "delete" redundant pixel corner vertices. There probably is a better solution since your map has a decent amount of surfaces that aren't simply flat rows/columns, but has curves, which won't get removed "properly", but this will still save you from casting a few ten thousand rays.)

Since you are using a pixel-art setup, I highly recommend you check out the palette shading strategies used  here: (https://www.lexaloffle.com/bbs/?tid=28785) (you may also want to use the techniques in their part 3 that also makes the lighting "cooler" with flickers/dithering)

(+1)

Shooting rays only towards corners is an interesting idea!  Unfortunately a big part of the lighting right now is from bounce lighting, which doesn't necessarily come from primary light sources like torches.  You can actually see the impact of bounce-light if you open the dev UI with Tab and turn off Bounce light, it makes a big difference!

That being said, totally agree that the current cost is unacceptable!  My approach in this case was to get something looking the way I wanted first, and then move on to optimization after.  That way i have a good idea which features are important to keep, and a nice 'ground truth' renderer to compare against as I try to optimize.

Thank you for both links, I'll definitely dive in and investigate!