I was making a custom postprocess and stored some value in the prepass textures. But as they are linear, I failed to get the value pixel by pixel.
This is what I’ve tried: https://playground.babylonjs.com/#JAVY4F#19. I tried to use updateCount but it failed, the depth channel’s texture is nearest when debug but it remains bilinear when I use Spector to see the result.
The textures you create by calling updateCount are recreated later by the prepass renderer, so your changes will be overwritten. Instead, you can do it like this:
The resolution do work but it seems msaa also caused value to mix with near pixels, I’ll try to find if there is a way to disable msaa for depth channel only. Thank you all the same!
Unfortunately it’s not possible, MSAA is a global setting for all the textures of the MRT, you can’t have it at the texture level (it’s a limitation of the underlying native APIs). If you don’t want MSAA for the depth, you will have to disable it and use another AA method for the color texture (like FXAA).