Jump to content
  • Advertisement
Sign in to follow this  
PolGraphic

Which techniques should I use for lights & shadows in my game engine (SSAO, shadow mapping?)

This topic is 1073 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

I am not very experienced with shadow mapping / global illumination / ray-casting. But I do know C++, a bit of HLSL/CG and I work with DirectX 11.

 

I want to add an optimal light/shadows solution to my game engine (it can depend on pre-calculated maps). The engine usually works on closed scenes (e.g. room), with the camera behind the person (limited range of view, but good details). Most of the objects are static, but there are some skinned meshes too.

 

Which technique or combination of techniques (I know that some of them cannot be mixed together) will give me the "full" (complete) solution?

 

For now I have implemented the phong shading, but the result is far from "good enough":

engine.jpg

 

I was thinking about shadow-mapping and/or SSAO (it's possible to combine them somehow?). Will that be "enough"?

 

I consider the radiosity as too expensive. The game engine supposed to works fine (60fps) on most of present graphic cards and the games target is not AAA productions. But I do have to improve the shading.

 

I guess that effects like bloom, HDR or even motion-blur etc. can improve the result, but are not really related to light & shadows (which don't look convincing in my engine now). So I don't consider them in that question.

 

I do know that those are just approximations and will never give me the quality level comparable to non real-time rendering (e.g. in 3ds max with GI).

I look for the direction and not for detailed step-by-step how-to. I know that the details are complicated and can be found elsewhere without the need to expand this thread to enormous size ;) I just need to decide which one to use and which can be combined.

 

 Thank you for your patience.

?

Edited by PolGraphic

Share this post


Link to post
Share on other sites
Advertisement

You can implement SSAO to have shadow when 2 surfaces are near and add shadow mapping on the point light to have shadow from your point light.

Bloom is the effect of blurring part of the image based on luminance. HDR is just to store the lighting result upper than 1.0 then you use a tone mapping to convert to LDR.

The luminance used for the bloom is based of the HDR image. You can add camera motion blur if you want to have movie effect.

To be more physically correct you can change your phong by Physically Based Rendering.

For the Antialiasing, FXAA is enough but suffer of the temporal aliasing.

After implementing all that then you will have better image result.

Share this post


Link to post
Share on other sites

it's possible to combine them somehow?

Of course it is, they are completely unrelated effects.
One casts shadows on ambience in your scene, the other casts shadows from light sources. They are completely separate and unrelated parts of the accumulation of light in your scene.

You do, however, have the option of including some of the ambient occlusion/obscurance in regular lighting. Although technically light from an actual light source (point light, directional light, etc.) should not be effected by the ambient-occlusion term, your lighting will look more more alive if it is. So once your basic implementation is in place it would be worth it to then modulate regular light sources by the ambient-occlusion term scaled by some factor (0.5 for half occlusion, 1.0 for full, etc.)


L. Spiro

Share this post


Link to post
Share on other sites

Which technique or combination of techniques (I know that some of them cannot be mixed together) will give me the "full" (complete) solution?


None. All screen-space techniques push towards a blurry and "muddy" image (HBAO could almost be an exception, but it's somewhat expensive too) and all global lighting solutions take too much time to compute (unless you have an engine that allows convenient partial lightmap rebuilds).

 

But really, the image you have there is quite alright (apart from the missing textures). It's just missing some very basic things like strong shadows under the bed and the table - you can easily add those by baking ambient occlusion in a texture for bed, table and walls/floor. Basically, for everything that doesn't look right, you can just bake an AO texture.

 

From what I saw while researching the technical art of SC:Conviction, they did exactly this. If you look closely, you can see that AO size and shape varies from edge to edge, and some of them don't have AO at all. There's often no symmetry between edges, and that's fine because all we ultimately care about are the shadow gradients.

Edited by snake5

Share this post


Link to post
Share on other sites

You can implement SSAO to have shadow when 2 surfaces are near and add shadow mapping on the point light to have shadow from your point light.

Bloom is the effect of blurring part of the image based on luminance. HDR is just to store the lighting result upper than 1.0 then you use a tone mapping to convert to LDR.

The luminance used for the bloom is based of the HDR image. You can add camera motion blur if you want to have movie effect.

To be more physically correct you can change your phong by Physically Based Rendering.

For the Antialiasing, FXAA is enough but suffer of the temporal aliasing.

After implementing all that then you will have better image result.

 

Do you know of any good sources for implementing PBR?

 

Also on the topic of SSAO I would suggest taking a look at http://graphics.cs.williams.edu/papers/SAOHPG12/

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!