Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Depth buffer on android

Discussion in 'Shaders' started by kripto289, Feb 19, 2015.

  1. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    Hello.
    Does the depth buffer on android?
    I tested on the unity 4.6 / 5 using the forward / deffered / legacy deffered renderes with settings "24/32 depth buffer" on poverVR 544mp2 (opengl es 2.0) and adreno305 (openGL es 3.0). But I can not get the depth buffer.
     
  2. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
    What do you mean with getting the depth buffer? You should be able to access the depth buffer from a shader, so you can use it.

    But on most mobile hardware there is no full screen depth buffer you can "get", because everything is rendered in tiles on most platforms. The depth buffer will only exist for one tile at a time in that case.
     
  3. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    I want use this shader https://chrismflynn.wordpress.com/2012/09/06/fun-with-shaders-and-the-depth-buffer/ , but he does't work on android.
    How i can read this texture "_CameraDepthTexture" in shader?
     
  4. Phantomx

    Phantomx

    Joined:
    Oct 30, 2012
    Posts:
    202
    KenSteelyHunter likes this.
  5. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    On deffered rendering is available by default. I also tried to activate depthTextureMode in forward and deffered rendering. It does not help.
    Just note that a tile rendering only works on poverVR, but I tested the same way and on the adreno 305, which does not use tile renderer.
     
  6. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
  7. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    I am creating the water, so it works only on the forward and deffered renderer. I also set camera.depthTextureMode = ... Depth.
    I tried to change the quality and other settings, but still can not get texture depth in the shader.
     
  8. Phantomx

    Phantomx

    Joined:
    Oct 30, 2012
    Posts:
    202
    st-VALVe likes this.