IBL Problem with consistency using GGX / Anisotropy

Started by
21 comments, last by Digitalfragment 9 years, 11 months ago

Depends on which way around your looking at it. In my case, i'm outputting a cubemap thats sampled by Normal, so the direction to the pixel that im outputting is N (which is the "UVandIndexToBoxCoord" wrapped direction, and so L is the direction of the pixel in the *source* cubemap being sampled. In my specular sample, L was calculated using importance sampling around N, but for a complete diffuse convolve you would need to sample the entire hemisphere around N.

For this reason, id still suggest using hammersley to generate a set of points, but dont use the GGX distribution, instead use a hemispherical distribution (or just use GGX but with a roughness of 1). Those are your L vectors that you sample the source with.

Advertisement

EnvBRDF: It works smile.png Can you tell me why the input vector to importanceSampleGGX is float3(0, 0, 1) ? This is what I couldn't figure out before. Also I changed the Smith term to the Schlick approximation that they're using:


// http://graphicrants.blogspot.com.au/2013/08/specular-brdf-reference.html
float GGX(float NdotV, float a)
{
	float k = (a * a) / 2;
	return NdotV / (NdotV * (1.0f - k) + k);
}

I still find the part about his G term confusing in the paper. He's talking about remapping it do be (a+1)² / 2. Tried that but the texture didn't produce correct values so I guess that's not what he's using. In another sentence he talks about using a/2 which is what I'm using here and this gives me a texture pretty much exactly the same as the one seen in his paper (just the Y-axis rotated but that doesn't matter).

IrradianceMap: I've compared using the ImportanceSampleGGX with roughness = 1.0f to the output using AMD CubeMapGen and there seem to be some minor differences. Is it "safe" to use this for the irradiance map ? or do you recommend using the "correct" way? Then again I have no idea how to compute the hemispherical distribution.

Is there any book / paper / link that explains how the importance sample distributions are calculated ?

There isn't really a correct way; Physically Based Rendering still isn't physically accurate rendering, no matter which way you go. I'm using the roughness 1 trick, and our artists are happy with that, but the "correct" way is going to yield better results. In the "correct" sense you shouldn't importance sample and instead use every pixel in the source cubemap - so that way as long as it shows up in the source it is factored in.

As far as links etc on importance sampling, I did google searches for "hammersley distribution sampling" and found out most of it that way.

This topic is closed to new replies.

Advertisement