Lighting

Published December 16, 2004
Advertisement
Polishing up the lighting code that I ripped from Golem:



Allows static and dynamic light types. Day and night cycles affect ambient light as well. Currently, time interpolates between a Day and a Night ambient color, but I will eventually attach it to a color gradient instead to allow more flexibility in how the time of day affects the ambient lighting color, how rapidly day changes to night, etc... Static and dynamic lights can be colored, and can even have negative intensities (cool for implementing spells of darkness, regions of evil darkness, etc...) One cool effect is to place an altar to an evil god, and place a light with negative R and G components and a positive B component. This has the effect of leaching R and G out of the area, and giving everything a sinister blue cast. Doing similar with R positive and B and G negative gives it a hellish red light. Fun stuff. Fun stuff.

At some point in the past, for some vaguely recalled reason, I eliminated 'ceilings' for tiles, and incorporated 'ceilings' to be part of the wall instead. Well, this looks bad with lighting enabled, so I'll probably be bringing 'ceilings' back. It'll add an extra pass to the rendering loop, but shouldn't affect performance noticeably. A ceiling piece has to be lit in a manner similar to a floor tile (ie, a lightmap color value for each vertex) while a wall piece is only lit using the color values for the front two vertices. On walls running east and west, it looks fine. On walls running north and south, it looks like ass.

With the console completed, I have one final small change on my list of things to do (assuming I hold off on ceilings until later), then I'll freeze features and try to do as much testing and bug-fixing as I can. Then, I'll upload. Finally. It'll be buggy, but what else is new... [grin]

As evolutional intimated, this thing is getting closer and closer to being an actual game. It's actually pretty much over-engineered for what it is. I've been fiddling around on paper with some ideas for a game to build upon it, which I may end up doing. All in all, although this thing has many faults (and more appear with every new 'feature'), it is a lot nicer to work with than the original Golem 2D engine, in terms of organization, convenience and structure. A lot of the ideas I had for that original game are still screaming around in my head, begging to be let out, and this would be a much more convenient vehicle for their expression. We'll see how it goes.
Previous Entry Console
0 likes 1 comments

Comments

rogerdv
Well, will it be an engine? Can I use it to make my own game? Really looks awesome.
Another question, will you make a similar work with Golem3D?
December 18, 2004 07:32 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement