DepthTexture isn't perfect for Andriod

Hi, I write an postprocess:

void OnEnable ()
{
        camera.depthTextureMode |= DepthTextureMode.Depth;
}

And in shader:

float kDepth = UNITY_SAMPLE_DEPTH(tex2D(_CameraDepthTexture, kuv));//kViewDiruv));
                kDepth = Linear01Depth (kDepth);
                return float4(kDepth,kDepth,kDepth,1);

And, the result is:

Why there are so many striation? And how to resolve it?
Thank you?

I assume this is not the actual result on an Android device. The Unity preview can be quite pessimistic when it comes to the bit depth of depth buffers on mobile platforms.

On the other side, you must realize that many mobile platforms use a TBDR (Tile Based Deferred Renderer). This means there is no full screen depth buffer available at all. I’m not sure whether this influences your current solution, but it might.

So my advice would be to test on an actual device.

(As far as I know, Unity can’t simulate a TBDR right now, but it would be nice if it could.)

The test phone is samsung note2. The picture is screen shot form the samsung note2. (Look the rightdown of the picture: Development Build.)
Are there some settings for unity building?

I’m only to show the depth, it’s look like:
The code is:

//VS
PX_T_outvs Vert_T(PX_T_invs i)
{
    PX_T_outvs o;
  
    o.pos = mul (UNITY_MATRIX_MVP, i.vertex);
    o.texcoord = i.texcoord;
 
    return o;
}
fixed4 Frag_Tex( PX_T_outvs i ) : COLOR
{
    float depth = UNITY_SAMPLE_DEPTH(tex2D(_CameraDepthTexture, i.texcoord));
    depth = Linear01Depth (depth);
    return fixed4(depth,depth,depth,1);
}

But I use another phone(nexus 5), the depth texture is good. Is the graphic device of samsung note2 very poor to make the depth texture bad?

Well, there are so many devices out there. I usually check gfxbench.com to find out relative performance and the chipsets used. That’s the first step. So, I come to:

Note 3: Adreno 305
Nexus 5: Adreno 330

The note 2 is not on there, but after some googling I found it has the Mali-400MP in there. I’d say there is a bit of a generation difference there. The Adreno 3xx series probably supports 24 bit depth, while the Mali-4xx series only goes to 16 bit depth. It’ll take a bit more digging to make sure, but it’s not uncommon for mobile GPU’s to have less bits in the depth buffer. Only the latest generation seems to generally be on par with desktop GPU’s in that area.

There are publish settings for this, but I don’t think that will help with the note 2. First thing to try would be to place the near and far clip plane more tightly around your scene to make more use out of the available depth buffer range.

Thank you, jvo3dc, you let me know why the striation appear at samsung note2.
So I think there need some codes to prohibit depth texture at Mali-400MP.

Thank you very much.