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

Started by
4 comments, last by Alundra 8 years, 8 months ago

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.

?

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.

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

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

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.

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/

You have lot of information here : http://www.filmicworlds.com/2014/04/21/optimizing-ggx-shaders-with-dotlh/

This topic is closed to new replies.

Advertisement