I am currently trying to verify the correctness of my diffuse lighting. I am fairly sure that my GGX specular model is correct, but I'm struggling with diffuse ambient lighting.
I am using a normalized lambert diffuse model. For simplicity, I'm assuming that the light has a color/intensity of (1, 1, 1) and that the surface has an albedo of (1, 1, 1) as those can be trivially multiplied into the final result.
float diffuse = saturate(dot(N, L)) / PI;
QUESTION 1: This implies that the correct result for a directional light hitting the surface at a perfect 90 degree angle (meaning the dot product is 1.0), I'd get a result of 1/PI. This is indeed what I'm seeing. Is that the expected/correct result?
Secondly, I'm looking into my usage of irradiance maps. I currently generate a tiny irradiance cube map, which I do a cosine convolution of. I believe the result of this convolution is correct. I am currently simply sampling this map and applying that as a diffuse color. For simplicity's sake, let's assume that the environment map is (1, 1, 1) in all directions (both before and after convolution).
vec3 ambient = texture(irradianceMap, N);
QUESTION 2: What is the expected amount of diffuse light reflected off of a white object in this case? In my current code, I simply sample the irradiance map and get 1.0, but online sources are saying that the result in this case should be 1/PI as well.
For various reasons, I want to move over to storing my irradiance map with spherical harmonics instead. I have a lot of questions about the math of doing ambient lighting with SH, specifically about how the math just all seems to cancel out, but I'd like to know what the expected diffuse light should be before I proceed with that.