Sign in to follow this  

Ambient lighting

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

Hi,

An easy old method to do ambient lighting is to do : DiffuseColor + (AmbientFactor * DiffuseColor * AmbientColor);

Another method is to have upper color and bottom color.

The best method is global illumination but still cost a lot.

Is it better to stay to the old way of ambient factor ?

Share this post


Link to post
Share on other sites

It's really hard to answer such a general question without knowing the context..

 

That said, a full global illumination solution like Voxel Cone Tracing or Light Propagation Volumes is still in my opinion too expensive or has too many issues to be used in most games. The solution presented for the game The Tomorrow Children looks promising but it comes with a high performance cost.

 

For our game I'm currently using a simple solution where I calculate the ambient lighting using 3 color lerps (think cube), one for each axis. The lerps can be converted into 3 madd instructions so it's fairly cheap (if you have the surface normal).

 

Henning

Share this post


Link to post
Share on other sites

Yeah, we probably need more context. You can probably cheaply improve upon that if you're targeting a certain situation.

 

For instance, for an outdoor scene with a strong directional light (e.g. sun), I found this article that does a nice job explaining how to add some "ambient" light by simulating a bounce of the directional light:

http://www.iquilezles.org/www/articles/outdoorslighting/outdoorslighting.htm

 

I did something similar, but a little bit more complex:

http://mtnphil.wordpress.com/2014/05/03/global-illumination-improving-my-ambient-light-shader/

Share this post


Link to post
Share on other sites
Yeah, we probably need more context.

I speak about a general context for a 3D Engine, like when you write a point light calcule that's general, ambient light is a real general stuff.

I don't understand why you speak about context because when you write lighting stuff you don't need a context, that's a general stuff.

http://mtnphil.wordpress.com/2014/05/03/global-illumination-improving-my-ambient-light-shader/

I'm not sure this is a good way, looks like not enough for nowadays.

http://www.geforce.com/hardware/technology/vxgi

That's the last work of NVidia on the subject, looks like a good work but I'm not sure that works good on AMD.

Edited by Alundra

Share this post


Link to post
Share on other sites

I don't understand why you speak about context because when you write lighting stuff you don't need a context, that's a general stuff.

 

That's not true. It's very commonplace in games that you can produce an effect more cheaply if it only needs to work in limited scenarios. In this case you were asking for a less expensive solution than full global illumination, so it seems reasonable to assume maybe you'd be ok with some limitations.

Edited by phil_t

Share this post


Link to post
Share on other sites

Hi,
An easy old method to do ambient lighting is to do : DiffuseColor + (AmbientFactor * DiffuseColor * AmbientColor);
Another method is to have upper color and bottom color.
The best method is global illumination but still cost a lot.
Is it better to stay to the old way of ambient factor ?

 

True, to be more accurate on the question, I mean : what is the best option nowadays for ambient lighting to have a physical correct calcule and real-time ?

I don't get it. The first two options you mention are real time but they are VERY far from being what you call "physically correct"* unless we assume light never bounces to other surfaces; which almost never happens in real life.
 
First, there are more fake methods. Like...

  • Adding additional lights that are positioned relative to the camera (Hollywood movies do this a lot. Keywords here is 3 point lighting setup)
  • Adding additional lights that are placed in a controlled environment (usually a cinematic or some small indoor level).
  • There's also a technique which dinamically places point lights at the place where the light hits on the geometry; thus simulating the bounces (works only for directional, spot and area lights). The "Leo" demo from AMD showcases this. Draw the scene from the light's perspective, and use an UAV to store the fake point lights' positions.
  • Use IBL (Image Based Lighting) to loosely approximate GI. It can give very convincing results.

Second,

The best method is global illumination but still cost a lot.

That is veeeery broad.
GI can be:

  1. Raytraced (or path tracing). Often not suitable for real time. Although the PowerVR guys say otherwise. Intel also has a demo that didn't took off from around 2008 but I can't find it now. It was all running on the CPU.
  2. Baked. Depends on your definition of "real time". It is baked, but you can move the camera in real time. Depending on how much data you bake, you may even be able to move the geometry, but not the lights.
  3. Light Propagation Volumes. Crysis 3 uses them.
  4. Voxel Cone Tracing.
  5. Screen space. Gives terrible results to be used as a generic solution, but it is good enough for distant geometry (Crysis uses SSGI for distant geometry and LPV for close geometry).

 

* We actually reserve the term "physically correct" for something else. Being physically correct means the math obeys certain properties from the real world, like the fresnel effect and that the amount of light coming out of a surface can't be higher than the amount of incoming light (unless the material is generates lights from another source, like a fluorescent effect or a lit cigarette).

GI is just about the number of bounces that are taken into account by the math.

Edited by Matias Goldberg

Share this post


Link to post
Share on other sites
being physically correct means having an unbiased path tracer that, with an infinity amount of time, will end up with the result of the real world. Nobody does that in real time, most movies are not path traced and even those that are (e.g. using arnold) are not fully physically correct for speed reasons.

That's why nowadays everyone tries to be "physically based" (although that's been the case for long time, but with less accuracy). It's about limiting your design to special cases that allow you to exploit those cases. And every engine there is, has different constrains, based and what the architects want to achieve/support.

To answer your question "what is the best option nowadays for ambient lighting to have a physical correct calcule and real-time ?" you'd need to tell the constrains you have. E.g. what hardware it needs to run on. If you look for example at UE4, they had voxel cone tracing and dropped that for consoles. Tomorrow's children uses some kind of voxel cone tracing, but it's far less generic and accurate, yet fits their constrains.

You need to be really elaborative explaining your case to get the best possible replies (and even then, every graphics programme gonna tell you his personal opinion that will differ from the others, probably).

Share this post


Link to post
Share on other sites

Actually I'm using SSAO and a simple ambient light : DiffuseColor + (AmbientFactor * DiffuseColor * AmbientColor);

Normally using an ambient light real time, SSAO should not be needed anymore since the global illumination should generate it auto.

But maybe current hardware are not good and we must wait the next-gen.

I speak about a solution on current modern hardware.

Share this post


Link to post
Share on other sites

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