How to downsample depth map conservatively

hey everyone : )

I’m trynna do some culling related stuff.

and I want a conservative downsample (the highest value pixel gets chosen when the resolution is halved) of the depth map till a certain low resolution. (different mip levels)

I’m trying to get that using a post process, but I’m getting strange results.
(the depth map is deformed, panned and there’s some extra stuff to the right)

Can anyone help me debug this? ty : )

PG:

see textures here:

any help w/ what I’m doing wrong here or what the best approach for this would be is immensely helpful! ty : )

1 Like

MIght be a stupid question but is the screensize supposed to change in between calls to conservativeDownsample?

2 Likes

I think so? since the ratio of postprocess is 1, it should take whatever dimensions of the things it’s applied on is, which is the RTT here.

so every downsample its dimensions should change too.

okay yeah, so I checked and PP dimensions were the same as RTT but for some reason ratio wasn’t scaling down the RTT properly?

here’s a PG w/ properly scaled down RTT

okay and after updating the sampling to nearest, this seems to work!

thank you so much : ))

1 Like

lol, so I accidentally helped :grin:

2 Likes

ye! : ) ty : D

1 Like