Day 3 - Light system done

Published August 11, 2016
Advertisement

Today was the last day of the week i had to work, and unfortuantly i didn't get much sleep the night before so for the most part i was half tired the entire day. Eventually i just called it a night fairly early at 9, and figured i'd get some solid sleep in to be refreshed for the next day. anyway, i did stick out and got my lighting system in place:

I'm pretty stoked having the system in place, my next goal is the level editor to be in place. then friday thru sunday i plan to focus on getting the actual gameplay done.

Previous Entry Woa Iv - Day 2
Next Entry WoA IV - Day 4
4 likes 5 comments

Comments

dmatter

Oooh swanky! Nicely done, it looks cool!

How does the light work at a technical level? My guess is you calculate a set of projected vertices that construct a lit polygon and you render that.

August 11, 2016 05:06 PM
slicer4ever

I generate a polygon for the light volume and color that white(or w/e defuse color the light is). then each occulude within range of the light i generate a shadow mesh that consists of the object itself, plus an extruded mesh of what the light should be blocked. Their's a small issue where if the light is too close to the occulude then the shadow mesh might not extrude out far enough to block the entire light, but i'm not too worried at the moment.

I then draw the light into a seprate buffer, then draw all the shadowed meshs over top that light to create a light map, then i blend the lights together into their own buffer. and then multiply this light map with my game map.

I wanted to use stencils to mask the shadow area from the light so i didn't have to draw to separate buffer before copying into my light map, but i actually haven't implemented stencils into my directX renderer, and don't want to waste time right now doing so.

I also plan to testout how it'll look if the light map is at quarter and half scale's to reduce performance requirments from them, but right now i need to get my level editor up so things well actually look a bit prettier then the above :P

August 11, 2016 05:17 PM
dmatter

Ah I see, so it's virtually a full-blown lighting system! All the more impressive.

It's interesting seeing your take on the themes, almost like an "official" example of them in action ;-)

Good luck with the rest of it!

August 11, 2016 07:32 PM
ryan20fun

That looks really cool!

August 11, 2016 08:35 PM
Thaumaturge

Ooh, that's impressive! (I'm somewhat of a fan of this sort of 2D shadowing; the description above of your algorithm was somewhat interesting.) ^_^

Good luck with the rest of the gameplay! ^_^

August 11, 2016 09:04 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement