three-gpu-pathtracer
three-gpu-pathtracer copied to clipboard
EquirectEnvInfoUniform: Sampling with 1 x 1 images seems to be wrong
When creating a 1, 1 white texture for the environment map we get this strange split:
This seems to be an issue related to MIS? Disabling MIS "fixes" the problem
This line seems to be he issue?
result = attenuatedColor * environmentIntensity * envColor * state.throughputColor * sampleColor * misWeight / envPdf;
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.