Lighting System A


I highly reccomend that you check out the video before watching this post to get a good idea about what i'm talking about.
https://twitter.com/AndrewNReinke/status/1446158878782066689
or tikytook for ya'll youngins
https://www.tiktok.com/@andrewnreinke/video/7016370849557105925?lang=ja-JP&is_co...

Today I spent a good amount of my development time thinking about exactly *how* i'm going to do the lighting system.
I wrote a good amount about ideas I had in this previous post https://andrewnreinke.itch.io/funmi/devlog/301001/graphics-ramblings to catch you up to speed a bit.

Pretty much what I decided to do was to follow in the footsteps of what older games did. That is, to go more general with how light works.
Since from what I know atm, light ultimately depends on photons bouncing around and eventually hitting your eye, you can easily approximate that idea by just saying that i have some light in the scene that has a position and I want to know how much of it hits my thingy.

So like, you could just say you defined that as a percentage of hit of which you use and multiply that by the current color of a given texel that's about to be drawn for the current mesh. Only downside is that as soon as light hits your object, you'll have the entire object light up.
So what would be better is to do the lighting per vertex. You basically just test if the light hits the vertex / can see it and how much in this case. So each very will result in a % lit and you basically have the worlds best lighting system (unless you want to add more things to calculate I guess like tangents (I think but I haven't done so don't actually take this as fact but instead go and research it yourself)).

Anyways, the game is currently just doing the simple % lit per vertex (soon) and changes the color based off that percentage. Later, i'll actually make it a bit more complicated, probably.

Thanks for reading and please let me know your thoughts on how bad or good the game is! Also, have a nice day :)

Get Funmi

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.