Lighting engine library
Displaying 1-11 of 11 total.
1
Kildorf
|
Hi, all.
I took the lighting engine from Geas and turned into a portable library type deal. You can get it (and a little demo-ish thingy for it) here. I'll put it up in the files section here once it's unbroken!
Posted on 2006-07-15 12:34:30
|
Gayo
|
There was a little collection of VERGE libs somewhere on the site, wasn't there? This would be a good addition to those, but maybe I imagined their existence.
Posted on 2006-07-15 13:38:29
|
Overkill
|
The Code Vault? That's a collection of tiny useful functions that were fairly independent from one another. A lighting library, on the other hand, would probably need several functions, plus global variables.
Posted on 2006-07-15 13:44:55
|
Code
|
It might be cool to have a "libs" section of the website similar to the "games" section, but with things like Kildorf's lighting engine library, Omni's image distortion library, or the bare-bones Sully library. Anything that will allow people to add functionality to their own creations.
Posted on 2006-07-15 15:57:44
|
Gayo
|
Hmm, yeah. Sadly VERGE isn't very friendly about libs. But that WOULD be a nice feature.
Posted on 2006-07-15 18:44:56
|
Omni
|
Kildorf, this is very interesting, but how do you make the lights seem to blend as two sources come closer together? Is that some special thing you're doing, or is that an inherit benefit of using the SubtractBlits?
Also, what's the difference between aboveground/underground lighting? It just seems to toggle between darkening the screen and tinting the screen just a little bit light blue. Is that some source of ambient setting? (...which the day/night loop uses? I didn't take the time to fully understand the main cycle part...it involved a lot of arrays...)
It's pretty nifty, but having to create the light "map" images is a minus. Couldn't you custom-create the light spheres on the fly using CircleFill, AlphaBlit(), SetLucent(), and a clever While() loop?
EDIT: By "on the fly" I mean using said technique to pre-render them, of course. Heaven forbit you do all of that each frame.
Posted on 2006-07-16 12:09:58 (last edited on 2006-07-16 12:10:59)
|
Kildorf
|
The light blending is actually just a side effect of using SubtractiveBlit. I thought it was pretty when I stumbled across it, so I kept going with it.
The difference between above and underground is the cycling. A "day" is about seven and a half minutes long (if I recall correctly), but you will never see any change in the ambient light if you are "underground".
I thought about generating my own images, but I ended up using PNGs for flexibility's sake. Using images means that I can have irregularly shaped lights, or use a more cartoony lighting circle (think the lantern in the SNES Zelda game) or whatever.
Also, there are a few things I will eventually add to Geas and so, this library. First and foremost off the top of my head is the ability to define a light as "the same as the current day/night value" so you could, for instance, have an underground map with a shaft of light coming from above that would get lighter and darker depending on the time of day. I think it'd be neat.
Edit: Oh yeah, and in the demo, you can use F10/F9 to speed up/slow down time, if you want to watch the transitions and such.
Posted on 2006-07-16 16:24:46 (last edited on 2006-07-16 16:29:50)
|
Omni
|
The day/night transitions look very awesome.
Posted on 2006-07-16 17:32:28
|
janus
|
Hey, I'm going to see what I can do about getting you a radial gradient function so you don't have to do this premade light bitmap stuff. It makes me sad inside.
Posted on 2006-07-22 16:35:20
|
Gayo
|
Radial gradiant would be sexy, yes.
Posted on 2006-07-27 01:21:25
|
janus
|
RectRGrad and Rect4Grad are checked in, so once a new build rolls around you should have all the radiality you need.
Posted on 2006-07-27 16:48:10
|