Advertisement

PBR - direct and indirect lighting?

Started by May 09, 2020 06:19 PM
4 comments, last by JoeJ 4 years, 9 months ago

I was thinking of implementing PBR in my engine and so I went about researching it. I haven’t found it the easiest thing to comprehend but I’ve seen a few papers that explain it pretty well but I’ve noticed that a lot of the time they combine direct and indirect lighting models, I.e. diffuse and specular lighting plus image-based lighting.

My question is, isn‘t image based lighting all you need for PBR? It feels to me (in my non-maths-expert-brain), that having both would introduce unrealistic results. In my mind, you just need an environment map with mip levels containing roughness. That should allow you to simulate metallic materials with a hint of colour for gold, copper, bronze, etc and also give you nice specular for dielectric materials which you can combine with an albedo map.

RobMaddison said:
My question is, isn‘t image based lighting all you need for PBR?

Yes, if this image would contain all the lighting for the given pixel to shade.
But because we can not calculate one environment map per pixel, it is just a faked compromise to use image based env for assumed static surrounding at infinite distance, and add some analytic dynamic lights on top.

I have implemeted basic PBR in a simple offline path tracer, and there is no need for neither environment maps nor analytical lights when using just emmissive surface as light sources. (and not caring about fast next even estimation to sample lighting).
That's probably the easiest way to look at realistic rendering, without any need for special cases or custom data structures to represent lighting.

But you can at least imagine things correctly to avoid confusion.
Any lighting on any point is a weighted sum of it's visible environment interacting with the material, and image based lighting comes very close to represent this environment.
So if we would render this env map as seen from the shading point, and this render would also contain all light sources, IBL would be perfect.
But in practice some lights are missing, so we need to add them to the result we get from IBL. That's why we do ‘both’ IBL + analytical lights. Nothing wrong with that.

BTW, even if we could render env map per pixel (it's not impossible, see e.g. the Many LODs paper.), we had a problem with adding point lights we use in games.
Becasue point lights have zero size and render resolution is finite we could not capture them well in the rendered env map.
This is becasue point lights do not exist in reality, only area lights do. So it's the concept of point lights which is wrong the most here, eventually.
Also giving lights a finite radius of contribution is wrong and not really realistic.

Advertisement

… but there is also cases where we can see how IBL is limited in practice.
In the basic PBR demo we mostly use only one environment probe, assuming the environment is very far away.
This works perfectly for convex objects like a sphere or a helmet. But if it is a convex shape like a character, we already get errors because self occlusion is missing.
In games this often loads to specular reflections that should be occluded, which looks a bit like rim lighting.

So, with all those issues we do not really have PBR in games. We just try to come close to it.
What we have is PBS. Getting a correct environment is a matter of GI and a very different problem than surface shading.
So if we talk about PBR in games we mostly only mean to model the interaction of material from incoming light, but not how to calculate the incoming light itself.

Thanks very much for that detailed explanation, you’ve really highlighted the ups and downs. I hadn’t considered the self occlusion aspect with character models so that’s something to think about.

RobMaddison said:
I hadn’t considered the self occlusion aspect with character models so that’s something to think about.

To me it is the worst artifact of current games. It is why sometimes scenes look very realistic, but then totally off some second later.

I think Control is the only game that fixed it (without using RTX). Heard they trace distance fields for specular but not sure.

This topic is closed to new replies.

Advertisement