Use both DepthTextureMode.Depth and DepthTextureMode.DepthNormals on camera

Hi,

I need to use 2 post effects on my camera, one is with DepthTextureMode.Depth and the other with DepthTextureMode.DepthNormals.

Both scripts are attached to the camera, and it seems I must use either the Depth Mode or the DepthNormals mode, I can’t use one mode for each shader (or I didn’t find how to do it?).

I then tried to transform my shader using DepthTextureMode.Depth by using “DecodeDepthNormal”, but the restful is still wrong and it still takes into account the normal…

Any idea how I can combien both effects on the same camera?

Cheers,

If one of (or both of) the image effects you’re using is using:
cam.depthTextureMode __*=*__ DepthTextureMode.Depth;

Instead of using:
cam.depthTextureMode **|=** DepthTextureMode.Depth;

You’ll have the problem you’re describing. Using just the equal sign will override the depth texture mode to just use that one type. Using the vertical bar and equal sign will add that mode to the existing modes already enabled allowing multiple modes to be used together.