Well, I’ve got a week of ‘holiday’ cough study break, and so dug out where I was on my last project, which happens to be my lighting manager.
At the time, I was held up by a couple of bugs which have now been fixed (thanks to whoever allowed spotlight shadows to change size). As it currently is, it fills the need for my project, mostly. So I’ve got a few questions, but I’d also like suggestions.
What it does:
This is designed as part of a ‘base’ scene. What I mean by this is that your game consists of a level, some characters/assets, in-game menu’s, a HUD etc. Then there is one scene that libloads all of that together into the game you play. So a couple of frames after game-start, the lighting manager will compile a list of all lights in the scene, replace them with empties, and then dish out it’s own supply of lights and shadow lamps to illuminate the scene with as little bother as possible.
Because the lighting manager uses it’s own lights, the original level scene could have hundreds of lights, but only the closest (ideally visible ones) will be displayed, resulting in much lower rasterizer time, and consequently, bigger possible levels.
It also implements my point-light-shadow-fudge-up, which is demonstrated in this video here:
It automagically assigns things like lamp type, (ie spot or point, it won’t touch sun lamps), energy, color, falloff etc. (not tested thoroughly yet, but in theory it should…)
Feature Requests for Blender:
Currently I can’t access/assign that many things about lights. Things I’d consider necessary to see python bindings for:
- Specularity toggle
- Diffuse toggle
- Sphere toggle
- Addition of light types such as ‘HEMI’ and ‘AREA’ to the light.type, as opposed to just dumping them under ‘NORMAL’
Ones I’d like to see:
- Change from variance to simple shadow via python
- Change variance shadow values dynamically (ie bleed)
- Clipping levels of shadows (perhaps a whole shadows section)
- Only shadow toggle
- Square toggle for spots
I hear the developers groan as they read this. The one I really root for at the moment is the first. The ability to dynamically switch specularity on and off based on line-of-sight to the lamp casting it would be fantastic. In fact, it appears to be what happens in some other modern-ish engines.
So, to the community:
What do you want to see from a lighting manager? Unfortunately I won’t be building it directly into the engine itself, so it will remain a little bit of a pain to set up/use. But the current feature set of:
- Point Light Shadows
- Controllable maximum number active lamps/shadows
Seems a little small, compared to it’s limitations of:
- Any custom logic bricks on lights get deleted
- No animatable light values
- Can’t toggle specific lights on/off mid-game
So what do you want to see added, if anything?
Here’s the bit that some people want to see, but maybe only two will understand, and probably only I will ever use. Here’s a zip file containing a ‘level’ and the base lighting manager:
Lighting Manager v1.zip
Please test it, see if you can crash it, let me know what framerate you’re getting etc.
Some particular things I’d like you to test:
- Does it work if you export it and run it? (Has issues for me, is it just me? I hope so)
- Do the shadows even show?
And my linux graphics drivers just crashed… See you guys later