Sign in to follow this  

Suggestions for simulating ambient light

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

Hello .

 

What do you think is a decent approach to have diffuse ambient and also specular ambient light in our games ? 

For specular I am using cubemaps that hold the surrounding environment , It's not really bad but it needs a lot of memory usage. For diffuse lighting I either use a constant ambient color or Hemispheric ambient light Which is not satisfying .

And I couldn't find any good resource on how to bake diffuse information and further use it in real time for moving objects .

 

 

Can u please give suggestions on ways that provide better and more physical based that are decent ?

 

Thanks in advance

 

Share this post


Link to post
Share on other sites

Look for GI (global illumination) approaches. There are some really cool ways to do them (eg. cone voxel tracing), but they are really expensive. Most common for the last generation (PS3/XBOX360) were light probes/spherical harmonics (eg cube map lookup) or texture baked solutions. 

 

Epic (unreal engine) and crytek have some impressive demos about the more advanced stuff, take a look at their publications/demonstrations/videos. An other good start is the gdc vault.

Edited by Ashaman73

Share this post


Link to post
Share on other sites
You mentioned that you use hemishere for diffuse light. My approach is hemisphere for ambient and directional or positional lights for diffuse (point, spot, area). The directional and positional lights also result in specular (depending on the material)

Share this post


Link to post
Share on other sites
The standard solution today is pre-filtered IBL, AKA light probes, AKA cube maps for specular, and either the same, or SH light probes for diffuse.

On prev-gen, We often used a very cheap lighting model based around only using two directional light sources.
You'd merge together your main lights into one directional "key light" per object (there's a God of War and a Gears of War presentation that explains this trick), which gives strong diffuse/spec on half the model (leaving the other half unlit).
Then we would use a magic formula to pick another direction per-object to use as a "fill light". This direction would be opposite the key light to fill the other side of the model with light, but also somewhat opposite the camera to ensure it creates some nice specular reflections. We'd sample a simple light probe (SH, etc) using the surface normal and then use that value as the colour of the directional "fill light".

Share this post


Link to post
Share on other sites

You mentioned that you use hemishere for diffuse light. My approach is hemisphere for ambient and directional or positional lights for diffuse (point, spot, area). The directional and positional lights also result in specular (depending on the material)

I wish that life would be that easy but it's not. We have diffuse and specular terms for ambient . In past it was usually ignored ,Though nowadays most games use PBR which is necessary to have both terms of it. Hemispheric is just a harsh hack sad.png .

Share this post


Link to post
Share on other sites

The standard solution today is pre-filtered IBL, AKA light probes, AKA cube maps for specular, and either the same, or SH light probes for diffuse.

On prev-gen, We often used a very cheap lighting model based around only using two directional light sources.
You'd merge together your main lights into one directional "key light" per object (there's a God of War and a Gears of War presentation that explains this trick), which gives strong diffuse/spec on half the model (leaving the other half unlit).
Then we would use a magic formula to pick another direction per-object to use as a "fill light". This direction would be opposite the key light to fill the other side of the model with light, but also somewhat opposite the camera to ensure it creates some nice specular reflections. We'd sample a simple light probe (SH, etc) using the surface normal and then use that value as the colour of the directional "fill light".

Thanks . I am not interested in past because it's past . I am more interested in 'today' way of doing things . Spherical Harmonics has a scary math behind it and I all I know about it is this " It's a way to regenerate low frequency functions by saving some coefficients" .

I ended up using AMD CubeMap Generator to build Irradiance map and Pre Filtered Blurry radiance Cubemap with chain of mip maps for specular . (Choosing mip slice based on object's roughness) 

It works but I am kinda curious to know more about how these maps are generated . Do you think it is necessary for a graphics programmer to know?

Do you know any good resources on this ? 

 

Thank you again

Share this post


Link to post
Share on other sites

This topic is 1119 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.

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

Sign in to follow this