Wednesday, March 17, 2010

Some Thoughts About Lighting...

I thought since this is our dev blog and even though I don't really post here frequently.. or at all so far that I would kick off my first post here with some of my thoughts about our level's lighting and lightmass and why we did not use any baked lighting for the UT3 mod and of course that lead to the UDK version of the demo also only utilizing dynamic lighting.

I really prefer the look of dynamic lighting in games. To create a truly cohesive or unified look, this is the only way. This really comes down to how surfaces are shaded and how moving through lights and shadows for any object will look part of the same world in stead of moving objects cut out from the static objects. Granted that UT3 was capable of being quite convincing with regards to this mix, it's still something that really stood out in my eyes. Ultimately it's about the visual quality.

Initially my thoughts were to go fully dynamic because of these reasons and also because of space saving reasons. To really create good looking shadow maps you need resolution on them and of course that means more space is taken up. I generally am against anything that just end up taking loads of space for no good reason. Casting bad looking low res shadows was not an option and casting good looking shadows takes lots of extra space because of the resolutions needed to create them. Using sometimes high and sometimes low res is another option but also not good because it's just more inconsistency on top of the existing inconsistencies.

So those are the major reasons about the dynamic lights used in the demo and considering the engine really does not like dynamic lights to be used too much, it actually turned out fairly decent with rendering speed. With regards to shadows however, I had to lose them completely for the simple reason that they are too expensive to use. A trade off I chose and accepted. I really had to end up pulling out every trick available to make lights work and the fact is that it's always gonna be slower than baked lighting. Because of this and the amount of massaging to make it work I decided that dynamic lighting is probably gonna be out of the question for future development of this game. Too many hoops to jump through to get a decent result rendering at acceptable speeds and going against the grain of the engine with regards to the lighting system is just not gonna work that well.

Now, about the Lightmass system in the UDK. This turns out to be just the perfect middle ground with regards to baked lighting and shadows. It is capable of generating shadow maps at a fraction of the resolution needed compared to the old shadow maps and render them back sharp and clean. This means that low res shadow maps can be used without really losing quality in their final look and in fact is of much higher quality than before even at this low res. Of course there are limits to this as can be expected but it is hugely more efficient than before.

On top of this (which is not directly related to lightmass) there is the ability to cast on to dynamic abjects only, a dynamic shadow from static objects. So this means that you can run through shadows and your character will receive the correct shadow as well compared to what's on the ground as a static shadow. This is actually kind of important.. or rather it is to me. Objects reacting more real towards shadow and light just plain looks better. Of course the fact that you can also render out lighting that incorporates global illumination is just pure bonus.

I'll give credit where it's due for Epic to have this in the UDK. I think maybe sometimes, this kind of thing is probably overlooked or possibly taken for granted by most people but I appreciate a well implemented lighting system in a game engine. Basically being forced to deal with shadow maps, this is not a bad way to go about it.

So currently the level is just about fully converted over to utilize all this. I am quite happy with the results and the trade off in surface shading and 100% cohesive look vs ease of use and getting good looking shadows and of course getting GI is well worth it. It actually ends up looking pretty good with regards to uniformity so I'm also quite happy about that. It also means a fairly decent speed bump in rendering the level so I'm really happy about that.

So, there it is and I think I've rambled on long enough about lights now... :)

7 comments:

  1. is there a release date yet?

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. I really liked your break down of the lighting here. It would be cool to see more "Making of Features". Personally I'm really interested in how you guys put the levels together. :) Loved the demo can't wait for the full gam

    ReplyDelete
  4. acez024: Sorry, we don't have any info about release dates yet.

    deadpixl: Cool, yeah I'd be happy to post some answers if you had any specific questions. I had a lot to say about lighting because of the importance to make the right choices there and the fact that tech changed through making our demo and it impacted those choices quite significantly. Mostly I think the level is built fairly standard with regards to Unreal tech. If I get the urge to ramble on about something, I'd post it here but feel free to post any question you might have as well.

    ReplyDelete
    Replies
    1. mohsin: hello i just wanna ask how would i make strategy for interior designer to explain our lighting product how i v'll make customer please help me out.............

      Delete
  5. Game sounds nice, but it's unplayable : I'm using a AZERTY keyboard not a QWERTY one. Such a shame (sic) option doesn't allow keyboard configuration.
    Btw : 1600x1200 resolution in 4:3 is quite strange as it doesn't fill my screen (SyncMaster 204B).
    Good luck in your game

    ReplyDelete
  6. The only thing I can suggest for the keyboard problem is to look through the DefaultInput.cfg in the Config directory. You can see what keys are binded to what actions and replace them with your keys.

    For example, this line is one of the key binds to look out for. They're generally in the same place in the config file.

    .Bindings=(Name="C",Command="GBA_Jump")

    For the resolution, if you want to run in your screen's native res you can bring down the console with "tilde" key while in the menu and use the "setres" command to use any other resolution not available in the menu options.

    For example you can type...

    setres 640x480f

    or..

    setres 640x480w

    So replace the 640x480 with your resolution you'd like to use. The "f" or "w" at the end will be for either full screen or window mode.

    ReplyDelete