This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

depth component16-32 texture not work on mali t760

i'm doing deferred shading. i use a framebuffer which attach 4 color texture and 1 depth texture as geometrypass.

i try to rebuild world position using depth, and use it for lighting.

so i need to use depth in my fragment shader,and i want my depth texture to be more precise like  16bits or 24bits or more.

but when i read from depth texture in the 2nd shader,it seems depth_component24 is not work,i can get the depth but it behaves like a 8bits depth beacuse my light model works but not accurate.

i use the same code on PC and it works fine.

(i use highp in my shader,)

so does anyone know the reason?

or anyone successfully read from more than 8bit depth texture?

Parents
  • I  use

    glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, ui_width, ui_height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, uc_pbuffer) to init texture

    and i use

    nearest filter and edge clamp for depth texture param

    i read depth in shader like this:

    uniform sampler2D g_depth;

    float depth=texture(g_depth, v_texCoord).x;

    The result is below,left is on phone and right is on PC

    In fact ,i have tried to output depth by encodeing it to RGBA as a texture in the first shader,and  decode it in the second shader and it works fine.So i can know it maybe not my calculation problem.

Reply
  • I  use

    glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, ui_width, ui_height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, uc_pbuffer) to init texture

    and i use

    nearest filter and edge clamp for depth texture param

    i read depth in shader like this:

    uniform sampler2D g_depth;

    float depth=texture(g_depth, v_texCoord).x;

    The result is below,left is on phone and right is on PC

    In fact ,i have tried to output depth by encodeing it to RGBA as a texture in the first shader,and  decode it in the second shader and it works fine.So i can know it maybe not my calculation problem.

Children