Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Inside Out

Sign in to follow this  


Indoor / Outdoor

Yesterday I added skybox support to the game engine. It was a little trick to get right, with the semi-deferred shading system I have in place.

The fact that I had a black background around the level was hiding some problems with anti-aliasing, but after I added the skybox they were quite obviously dark sub-pixel borders around the level when AA was on. I fixed this, and then put the skybox in the level.

Of course it looks out of place on indoor levels, so I made it optional. But that brought up another set of issues we had been discussing for some time - how to draw the edge of the world.

For outdoor levels, we have some ideas, but nothing implemented. Indoor levels didn't have a great solution. We don't want to actually model or render ceilings, because one of the key parts of the game is the ability to zoom out and get a tactical overview of the situation.

One hack I played with a while ago, which some games like Baldur's Gate do, is to render black on top of the walls, and at the map edges. This is what I tried, and it looked ok, but still out of place, and it looked really bad when the majority of the screen was just black at certain angles.

Here is a shot that contains both normally lit wall tops ( the middle island ), and black tops. Also note the incorrect indoor sunlight shadows, and the flat lighting on the character.

So, this morming we looked at a few other games, and decided to try rendering an understated version of a texture, rather than just black. In order to keep in understated, I only light it with ambient light, and it doesn't participate in other rendering. This is key, because often the point lights in an indoor level we be placed at or above celiing level for effect, and you don't want to light up the ceiling tops to distract the player from the action.

Another problem was the overall scene lighting. For outdoor levels, we have a sun or moon directional light that handles most or all of the lighting needs for the level, although you can put point lights around as well.

For indoor levels, leaving in a directional light obviously is wrong, but it wasn't as bad as I thought. We disussed ways to light the level without a directional light, and considered environmental cubemap lighting. I still may try this later on, but due to the very boxy nature of our current levels, I knew this wouldn't work super great.

I decided to just tweak the ambient occlusion term, and combine that with a scalar ambient, and that worked very well indeed.
After averaging that with the ambient bump mapping, I think we have a very good approach, and I'm really happy how it turned out.

Yet another issue that came up in low-lighting scenes was the flat character lighting. Characters typically also got most of their lighting from the sunlight, but without one, they were very washed out, so I adjusted the character ambient based on the y coordinate of the model's normal in world space. This allows the characters to have some depth even in low-light settings.

Here is a shot with all of the tweaks so far :

Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!