Graphics.blit 3 texture

Hi guys

I am very puzzled.

Set up this code in an empty scene. and set up the scene similar to the screen shot. so 3 camera each can only see 1 object. and each camera will render what it sees to a rawImage. the expect result is raw image 1 sees the cube, raw imge 2 sees the cube and the sphere and raw image 3 sees cube sphere and capsule. but image 3 is where it gets weird. it sees cube and capsule instead.

    [SerializeField] Camera CameraA;
    [SerializeField] Camera CameraB;
    [SerializeField] Camera CameraC;

    [SerializeField] RenderTexture textureA;
    [SerializeField] RenderTexture textureB;
    [SerializeField] RenderTexture textureC;

    [SerializeField] RawImage rawImageA;
    [SerializeField] RawImage rawImageB;
    [SerializeField] RawImage rawImageC;

    private void Start()
    {
        textureA = new RenderTexture(CameraA.pixelWidth, CameraA.pixelWidth, 1);
        textureB = new RenderTexture(CameraB.pixelWidth, CameraB.pixelWidth, 2);
        textureC = new RenderTexture(CameraC.pixelWidth, CameraC.pixelWidth, 3);

        CameraA.targetTexture = textureA;
        CameraB.targetTexture = textureB;
        CameraC.targetTexture = textureC;

        rawImageA.texture = textureA;
        rawImageB.texture = textureB;
        rawImageC.texture = textureC;
    }

    // Update is called once per frame
    void Update()
    {
        Graphics.Blit(textureA, textureB);
        Graphics.Blit(textureB, textureC);
    }

We have no idea what the clear flags of your 3 cameras look like. Since you have a solid background we can assume that at least one camera is clearing the background with a solid color. We also don’t know how large the area of the 3 cameras are and if they render to the full screen / rendertexture or only a part of it. Graphics.Blit will copy the entire content of the first texture ontop of the second texture.

It’s also not clear if you used a layer mask for any of your cameras / objects. Though what is the most disurbing is that you use a 1 bit depth buffer for the first rendertexture, a 2 bit depth buffer for the second and a 3 bit depth buffer for the 3rd. Note that only depth buffers values of 0, 16 or 24 are actually supported.