1

I want to render a depth map.

The issue is in the edges between 2 depths z1 and z2: enter image description here

As discussed in this post: How does anti-aliasing work in cycles?

There are 2 options: aliasing and anti-aliasing

  • Aliasing - I get a sharp edge, which means that I'll get z1 or z2 based on the center (I did it by using pixel filter with the smallest width. However, it is not represented very well "where is the edge inside the pixel" i.e what is the percentage that this depth appears.
  • Anti-Aliasing - an average over all the samples, which means that if z1 covers 80% of the pixel and z2 covers 20% of the pixel, I'll get z=0.8z1 + 0.2z2

The anti aliasing is the preferred, however, it's actually gives wrong depth.

What I actually want in order to solve the ambiguity is 2 depth maps: z1 and z2

  • z1 will give the minimum depth over the pixel
  • z2 will give the maximum depth over the pixel
  • w1 will give the percentage of values of values smaller than (z1+z2)/2
  • w2 will give the percentage of values of values greater than (z1+z2)/2 which is just 1-w1

w2 = 1 - w1 so I need 3 channels.

Is there an option to do so?

The best thing I thought about is the divide the pixels to sub pixels, than calculate only 1 spp for each of them, calculate the minimum and maximum and sum the value smaller than (z1+z2)/2.

However, it seems that it's much slower to render pixel with subdivision of 8x8 than calculate the value of spp=64 without division. (it is very bad for larger samples such as 16x16 and 256)

Any ideas?

kalonymus
  • 11
  • 1

0 Answers0