Jump to content
  • Advertisement
Sign in to follow this  
n00body

Fill lighting [ANSWERED]

This topic is 3624 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Forward: ____This thread revolves around those ugly black regions indicative of Lambertian lighting. We've all seen them, we all hate them. Trying to deal with them has given rise to a variety of solutions, and that's what I'm here to ask about today. Situation: ____I'm trying to figure out a decent lighting scheme that will allow my characters to keep the appearance of normal maps on the side facing away from the light (sort of like Gears of War 2). This setup would have to be reasonably easy to implement (changing a few lines in a shader, or adding a new post-pass). Adding a whole new pre-processing step, or system to manage data from said pre-processing step are both unacceptable. Has to work well with gamma correction, and has to run well on early SM 3.0 hardware (GF 6800 era). ____For my pipeline, I will have deferred shading, with one directional light, and an arbitrary number of point/spot/etc. lights. Possibly using cube-maps for most specular effects. Likely, there will only be one shadow map, being cast by the directional light, and only slightly darkening the scene (enough to know it's there, but not pitch black). In post-processing, I will have SSAO of some form (almost a given these days. :p). At the end of it all, tonemap (from an MDR 32-bit buffer), and gamma-correct the results (rendering final pass to an sRGB target). No lightmaps, or grids of SH/ambient cubes. ____I'm thinking something like modifying my directional light, while keeping the rest of my lights Lambertian. This is mostly to maintain the feel that local lights have limits. However, I am flexible in this regard. Approaches tried thus far: Constant Ambient is out of the question, since it doesn't take normals into account, and just creates a washed out look. Hemilights work reasonably well, so long as the two colors are distinct enough. Though this isn't much of an improvement over constant ambient, it is the most trivial to implement. Bidirectional lighting, like the setup described for Tabula Rasa looks decent without gamma correction. However, once you add gamma correction, the two colors meet at perpendicular normals, creating an ugly black seem. Half-Lambert Directional lights do a pretty good job preserving detail, so long as they are at an angle above or below the model. When they are level with the model, issues start to arise. When the light is directly in front of the model, normal detail is limited by the light being too bright. When it is directly behind, it is the opposite case of normal detail being limited by it being too dark. Wrapped Directional lights where largely the same as Half-Lambert except that normals that were exactly opposite the directional light were completely black. Also, only seemed to look decent for low wrap values, causing discontinuities in shading otherwise. Closing ____Since I suspect everyone has faced this problem at some point, I'm curious to see what everyone has to say. If you need more info from me, please feel free to ask. Otherwise, just hit me with whatever ideas you may have. Example shots would be nice, if you can manage them. ;) [Edited by - n00body on January 14, 2009 8:08:22 PM]

Share this post


Link to post
Share on other sites
Advertisement


Hi There,

have you tried a more sophisticated Ambient lighting solution?
Like using surface normals map(possibly bent by an Ambient Occlusion render) to look up an convolved spherical(hdr maybe even) environment map. And modulating with a baked Ambient Occlusion map on your characters?

cheers
fred

Share this post


Link to post
Share on other sites
____I haven't tried things like an SH/Ambient Cube system for ambient lighting. Partly because even if they do work well, I am not sure I want to deal with the preprocess and runtime complexity required for managing such systems.

____As it stands, I don't plan to use pre-baked ambient occlusion maps, instead opting to let SSAO do the work. I've been considering implementing the approach outlined in the second paper for link [1]. It combines both ambient lighting and SSAO, requiring no more complexity than a typical post-processing pass. The results may not be as nice as precomputed solutions, but it would be far less complexity for me to manage.

I was considering doing a skylight with each area's skybox, but I haven't tested that yet.


[1] http://www.uni-koblenz.de/~ritschel/

Share this post


Link to post
Share on other sites
We use an SH based ambient system, and it's incredibly simple. The artists can put boxes/regions in the maps, and set the SH coefficients for each region. As we move through the world, we pick the correct box, and lerp coefficients if we're between regions. This keeps the run-time incredibly simple, and lets the artists do nice things like per-room ambient to fake GI effects, etc... I know that several other studios have done similar things.

Share this post


Link to post
Share on other sites
Here is a method: for every surface try calculating a subtle fresnel-type effect; do a point light from the view pos. Then multiply this value with a color approximating your sky or ambient color, then add to the total output.

It should be subtle, and tends to make things appear slightly reflective. But this adds a lot of detail in otherwise flat areas. Combine this with possible sky light and SSAO and you have some kind of system.

Share this post


Link to post
Share on other sites
Okay, I appreciate the tips I received. I've mostly solved my question now.

Thanks for what help was given.

[Edited by - n00body on January 14, 2009 8:11:13 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!