three-gpu-pathtracer icon indicating copy to clipboard operation
three-gpu-pathtracer copied to clipboard

EquirectEnvInfoUniform: Sampling with 1 x 1 images seems to be wrong

Open gkjohnson opened this issue 1 year ago • 3 comments

When creating a 1, 1 white texture for the environment map we get this strange split:

image

gkjohnson avatar Feb 20 '24 14:02 gkjohnson

This seems to be an issue related to MIS? Disabling MIS "fixes" the problem

gkjohnson avatar Feb 23 '24 05:02 gkjohnson

This line seems to be he issue?

result = attenuatedColor * environmentIntensity * envColor * state.throughputColor * sampleColor * misWeight / envPdf;

gkjohnson avatar Feb 23 '24 05:02 gkjohnson

Textures are not capable of sampling the first or last pixel due to the way the the samples are stored. With 1x1 px we get a marginal weights texture that is 1 px wide storing 0.5 which means only one direction can ever be sampled. The way weights are stored should be adjusted such that the first pixel is always the first valid pixel to sample and the last pixel is that last valid pixel to sample.

gkjohnson avatar Feb 23 '24 05:02 gkjohnson