Sign in to follow this  
racarate

What is the relationship between area lights and reflections (SSR/local/global)

Recommended Posts

I have been reading about the various reflection techniques in the Frostbite paper (planar, SSR, local cube map, global cube map) and just when I think I have everything sorted out I see this:

 

https://www.youtube.com/watch?v=O3TG1VXx1tg

 

So, to my eyes that looks just like some of the reflection techniques I am studying (especially distance-based roughness in the FB paper).  Does the usage of area lights remove the need for the reflection techniques I mentioned above?  Or are the authors just using these additional techniques and not mentioning it?

 

The whole paper is here, but honestly it is a bit over my head:

 

http://pascal.lecocq.home.free.fr/publications/lecocq_i3D2016_specularAreaLighting.pdf

Share this post


Link to post
Share on other sites
I'd stick at Frostbite kind of area lights in general, those are practical solutions.

The video is very impressive, but it has issues:
Very expensive
No general shadowing (would need to use approximating low poly occluders or voxels... even more expensive)

That limits the usecase to special situations, brobably not worth the affort?

Share this post


Link to post
Share on other sites

Since area lights and punctual light sources (spot, directional, point) basically try to approximate a realtime reflection for one light source it's not wrong for you to think that they are one and the same because what they are trying to achieve is the same thing. However as "everything reflects" in some way or another you'd have to evaluate every single pixel in your scene as a sort of light source, which is kinda what you're doing in image based lighting. Capture the environment and evaluate the reflected light from/into all directions.

Which also has the issue that it can only be done efficiently in an offline preprocess so that leaves us (for realtime reflections) with either planar reflections or screen space techniques.

Edited by lipsryme

Share this post


Link to post
Share on other sites

Ah, right I got confused with that "blurry reflection look" and forgot that this video is only about lights.  What a bozo I am!

 

I've never written SSR/cube reflection before -- it seems like you would have to turn off the lights before your SSR/cube reflection pass so you don't "double up" the reflections of the light, right?  It Otherwise you would have one reflection from the analytic/punctual light model and another reflection from your SSR/cube reflection pass.  Or is that not that big of a deal?

Share this post


Link to post
Share on other sites

Ah, right I got confused with that "blurry reflection look" and forgot that this video is only about lights.  What a bozo I am!

 

I've never written SSR/cube reflection before -- it seems like you would have to turn off the lights before your SSR/cube reflection pass so you don't "double up" the reflections of the light, right?  It Otherwise you would have one reflection from the analytic/punctual light model and another reflection from your SSR/cube reflection pass.  Or is that not that big of a deal?

 

For cubemaps you turn off any direct contribution, correct. But it's not necessary for SSR as you are essentially overwriting any other specular contribution if the SSR contribution actually hits valid info, so it shouldn't double the contribution. But this assumes your specular from the lightsource is actually at least somewhat of a match with whatever emissive material the light source is supposed to come from. If they're too mismatched it could certainly look odd.

Share this post


Link to post
Share on other sites

 

Ah, right I got confused with that "blurry reflection look" and forgot that this video is only about lights.  What a bozo I am!

 

I've never written SSR/cube reflection before -- it seems like you would have to turn off the lights before your SSR/cube reflection pass so you don't "double up" the reflections of the light, right?  It Otherwise you would have one reflection from the analytic/punctual light model and another reflection from your SSR/cube reflection pass.  Or is that not that big of a deal?

 

For cubemaps you turn off any direct contribution, correct.

 

Do you really ? I always thought you capture it n number of times to simulate light bounces ?

Share this post


Link to post
Share on other sites

 

 

Ah, right I got confused with that "blurry reflection look" and forgot that this video is only about lights.  What a bozo I am!

 

I've never written SSR/cube reflection before -- it seems like you would have to turn off the lights before your SSR/cube reflection pass so you don't "double up" the reflections of the light, right?  It Otherwise you would have one reflection from the analytic/punctual light model and another reflection from your SSR/cube reflection pass.  Or is that not that big of a deal?

 

For cubemaps you turn off any direct contribution, correct.

 

Do you really ? I always thought you capture it n number of times to simulate light bounces ?

 

 

I'm assuming he means the emissive texture/sprite that's supposed to represent the actual "light emitting" part of the light. EG your sun disc representing the sun. In which case you'd want to turn it off for cubemaps or else you'd get a double contribution, one from the cubemap capturing the sun disc, and one from your analytic directional light. This doesn't, or shouldn't matter for SSR as SSR is hopefully just going to overwrite your analytic specular with more accurate SSR reflections of your emissive material (assuming it hits).

 

There are plenty of circumstances where you may even want to leave them on for cubemaps too. If the light is distant enough that its analytic solution doesn't contribute, you can certainly capture it in a cubemap (distant city lights or something). 

 

And for actual light contribution otherwise, eg drawing point lights and etc. then you just leave them on for both cubemaps and SSR.

 

OH! And edit, duh. Here's the exact same thing as the area lights OP posted, but with source code and a permissive license and etc. etc. Also diffuse lighting at the same time, still no shadows though (raytrace analytic shapes/signed distance fields?) https://eheitzresearch.wordpress.com/415-2/

 

https://www.youtube.com/watch?v=ZLRgEN7AQgM

Edited by Frenetic Pony

Share this post


Link to post
Share on other sites

The lighting for an Area light generally includes diffuse lighting and specular lighting.

 

Compared with the specular one, the diffuse area-lighting is relative simple. It's view-independent. There are so many approx methods to mimic the efforts, and most of them are relatively accurate. The main contribution of Frostbite's course in Sig15 is the summary for typical approx methods that used for diffuse area-lighting.

 

But the specular area-lighting is just another thing. It is the most significant perception that you feel like a 'reflection'. Its fast & ACCURATE approx methods were not available until Pascal's I3D paper (I3D2016 Best Paper) and  Heitz's Sig16 paper (another big break-though).

 

On the other hand, SSR is a screen-space based technology. Generally speaking, I prefer to consider it just like a Post-Effect. Accurate calculation for area-lighting is not involved in SSR.

 

For demo purpose, the author of area-lighting traditionally prefer to use a planar ground to show the specular area-lighting. But by no mean should this case be confused with a Glossy SSR scene.

Edited by neoragex

Share this post


Link to post
Share on other sites
Does the linearly cosine transform base fit more complex function than uniform polygon? My be it can be used for environment map specular integration

Share this post


Link to post
Share on other sites

Compared with the specular one, the diffuse area-lighting is relative simple. It's view-independent

That depends if you're using Lambert BRDF or not :wink:

Does the linearly cosine transform base fit more complex function than uniform polygon? My be it can be used for environment map specular integration

Yeah, in the paper they extend it to include a good approximation for textured polygons.
However, they split the calculations between light intensity (which receives the Blinn-esque skewing at glancing angles) and light colour (which doesn't)... So unfortunately, while this does reproduce the shape of Blinn/GGX/etc BRDF's quite well in general, this accurate reproduction doesn't apply to the way that the texture-colours are blurred.
 

I have been reading about the various reflection techniques in the Frostbite paper (planar, SSR, local cube map, global cube map) and just when I think I have everything sorted out I see this:
...
So, to my eyes that looks just like some of the reflection techniques I am studying (especially distance-based roughness in the FB paper).  Does the usage of area lights remove the need for the reflection techniques I mentioned above?  Or are the authors just using these additional techniques and not mentioning it?

At the heart of the rendering equation is the BRDF. This is a function for each surface/pixel/etc, which defines how it reflects light.
Light sources emit light, light bumps into surfaces, the BRDF then says how much is absorbed, how much is reflected, what direction(s) it's reflected, and what kind of colouration occurs.
Typically in games we make our BRDFs by glueing together the Lambert diffuse BRDF and the Blinn-Phong specular BRDF, to create a function that captures a range of surfaces from rough to smooth, and dull to shiny.

When we calculate the reflections that are caused by photos that have directly come from a light source (light->surface->eye), we call it direct lighting. For these, we calculate the irradiance/illuminance - the amount of light arriving at the surface from the light source -- plug that value into the BRDF along with the eye direction, and we calculate the radiance towards the eye.
We can do direct lighting for point lights, spot lights, directional lights, etc -- and recently good techniques have been invented for computing direct lighting from area lights quickly too.

With only direct lighting calculations, shadows are too dark and bumps in a surface have too much contrast. Everything looks very fake.
Traditionally in realtime graphics, we use a hacky solution of an "ambient light", which just adds some constant lighting everywhere to fill out the shadows and stop them from being black.
What we really want though is to calculate the indirect lighting -- this is the photons that have have been emitted from a light source, have bounced off multiple surfaces before reaching the eye (light->surface->...->surface->eye). This is where other techniques that you've been researching come in. Planar reflections, cube-map reflections (a.k.a. environment maps, or nowadays: IBL) and SSR are all ways to capture a second bounce of light. Using these techniques we first compute light->surface->eye as usual, but we store the results into this environment map. Later on, we can compute environment->surface->eye, which gives us a good approximation of light->surface->surface->eye.
Often these techniques are tied to a particular kind of BRDF -- e.g. planar reflections work best for perfect mirrors, or the Phong specular BRDF. Only recently have decent approximations for the Blinn-Phong BRDF been invented for use with cube-map reflections, etc...

Edited by Hodgman

Share this post


Link to post
Share on other sites

Btw why was Lecoq's paper and Heitz's paper quoted together ? As far as I understand they're using different approximation to solve spherical integration over a polygon.

Lecoq's is approximating the "moment" (tbh I don't understand where it comes from, seems related to some 1995 paper) while Heitz's is approximating brdf expression in ggx case with linear transformation of clamped cosinus (which happens to have a closed form expression for polygonal integration).

Share this post


Link to post
Share on other sites

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