Page 1 of 1

Mirror artefacts

Posted: Wed Jan 02, 2019 6:29 pm
by CodeHD
While setting up some scene, I came across a strange behaviour with a mirror and Sky-background. Looking somewhat perpendicular at a mirror gives me the following type of artefact:
test.jpg
Blend file attached, consisting of a clean setup of only a mirror and camera, the rest is left pretty much default.
Here is what I can say so far from quick playing around with it:

- happens with all bidir/path + /sobol/MLT/Random combinations
- The artifact is half the size using BiDir than using path
- It can be different between preview and actual render
- Mirror and Glossy material behave the same
- The pattern heavily depens on the camera-mirror distance
- The pattern heavily depends on clipping start, but not clipping stop
- camera FL changes nothing other than zooming in on it
- Using volumes or not makes no difference
- The pattern changes with orientation of the camera/mirror pair. It then appears to be partly cut off (by what??). You can test this by selecting camera+mirror and rotating them around the origin.

What I haven't tested a lot yet is various light sources, i.e. if this only an issue with the background sky.

Re: Mirror artefacts

Posted: Wed Jan 02, 2019 6:46 pm
by B.Y.O.B.
Your stuff is exactly at the world origin. This causes floating point precision problems.
Solution:
- move everything a bit
- or change the min. epsilon (multiply it by 10)

Re: Mirror artefacts

Posted: Wed Jan 02, 2019 7:24 pm
by CodeHD
ok thanks, that makes sense and moving stuff around changes things.
It seems to me that it is more of a relative issue though. When I shift the mirror to x=100, I can still get the pattern, although the camera has to be much further away (>10000, compared to 150 previously). In this case, your min.-epsilon method only helps if I multiply it by 1000, whatever all the consequences of adjusting that parameter are...

Re: Mirror artefacts

Posted: Wed Jan 02, 2019 7:32 pm
by B.Y.O.B.
I think due to the way IEEE floats are specified, you will always have "bad spots" in the coordinate grid.

Re: Mirror artefacts

Posted: Wed Jan 02, 2019 8:47 pm
by Dade
CodeHD wrote: Wed Jan 02, 2019 7:24 pm It seems to me that it is more of a relative issue though.
Floating point number precision is not linear or uniform, for instance, it is a lot higher in some range than others. The distance between 2 consecutive values also keep increasing farther you are from the 0.0 and they exhibits many other strange/counter intuitive behaviors when compared to true real numbers.
Unfortunately, it is unavoidable when you approximate the infinite set (i.e. Real numbers) with just 2^32 possible different values.

Re: Mirror artefacts

Posted: Wed Jan 02, 2019 8:50 pm
by CodeHD
Dade wrote: Wed Jan 02, 2019 8:47 pm Floating point number precision is not linear or uniform, for instance, it is a lot higher in some range than others. The distance between 2 consecutive values also keep increasing farther you are from the 0.0 and they exhibits many other strange/counter intuitive behaviors when compared to true real numbers.
Unfortunately, it is unavoidable when you approximate the infinite set (i.e. Real numbers) with just 2^32 possible different values.
Yeah, Im aware of that, I worded it a bit too mich like a guess ;) I only really wanted to point out the min-epsilon behaviour I observed in case anyone else comes across and reads this.