Is there a way to disable anti-aliasing on just the depth texture?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Grove_DG

I have a shader that reads from the depth texture, but when I enable anti-aliasing (MSAA) it seems to be anti-aliasing the depth texture which messes up the shader.

Is there any way to keep the anti-aliasing on everything but the depth texture?

Alternatively, is there any way to get the unprocessed depth texture in the shader or any other way of working around this issue?

EDIT: to clarify I’m talking about the depth texture accessed through the DEPTH_TEXTURE variable in spatial shaders

I couldn’t find a way to disable anti-aliasing unfortunately. Instead, I used some clamping and if statements to try and replace bad data caused by the anti-aliasing. Hope this can help anyone in a similar situation.

Grove_DG | 2022-08-13 21:38

:bust_in_silhouette: Reply From: USBashka

Selelct texture file. Open Import tab, deselect Filter and reimport.

I meant the depth texture accessed through the DEPTH_TEXTURE variable in the spatial shader, not an imported texture. Sorry if that wasn’t clear.

Grove_DG | 2022-07-14 15:30