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 texture linearization banding on Mali 400

Note: This was originally posted on 19th June 2013 at http://forums.arm.com

Hello Mali devs,

We are working on an application that performs depth buffer based post processing effects, mainly for fog. We are using 24bit depth for the main scene. However when sampling this depth, the results are very banded (see attachment) due to the non linear nature of the depth buffer and Mali400's mediump 0-1 precision (2^-10 I believe). With most depth values lying in the 0.96-1.0 range, the precision is obviously insufficient. Are there any workarounds that would allow use to leverage the non fractional range of mediump floats? I suspect there isn't however wanted to make sure as the platform does provide depth24 and depth texture extensions. The option of vertex based fogging is an alternative, however, we hope to stay away from that due to the added global cost of the technique.

Many thanks,

Stephane
  • Note: This was originally posted on 24th June 2013 at http://forums.arm.com

    Hello stepjac,

    With most applications that we see, the vertex shader is usually very under utilised. Moving the fogging over to the vertex shader should give you a much better depth range than what you are currently seeing, with little performance impact (assuming you are currently not vertex bound).
    If you have a development platform, you can see how utilised each core is with our performance analysis tool, DS-5.
    I hope this helps answer your question. Please let us know the outcome, and feel free to ask us any further questions.

    Kind Regards,

    McGeagh

    Hello Mali devs,

    We are working on an application that performs depth buffer based post processing effects, mainly for fog. We are using 24bit depth for the main scene. However when sampling this depth, the results are very banded (see attachment) due to the non linear nature of the depth buffer and Mali400's mediump 0-1 precision (2^-10 I believe). With most depth values lying in the 0.96-1.0 range, the precision is obviously insufficient. Are there any workarounds that would allow use to leverage the non fractional range of mediump floats? I suspect there isn't however wanted to make sure as the platform does provide depth24 and depth texture extensions. The option of vertex based fogging is an alternative, however, we hope to stay away from that due to the added global cost of the technique.

    Many thanks,

    Stephane
  • Note: This was originally posted on 24th June 2013 at http://forums.arm.com

    Thanks McGeagh,

    That's what I figured. Though our app is very vertex heavy, it's probably still heavier on the pixel side. Obviously, per vertex fog does mean modifying/updating every shader in the product (and there are a lot) rather than the single post processing step, but definitely doable if we want to maintain the effect. This is a non issue on the T-604 correct? We don't have a device handy, however, I believe it does do higher precision in fragment shader than the 400-MP.

    Best,
    Stephane

    Hello stepjac,

    With most applications that we see, the vertex shader is usually very under utilised. Moving the fogging over to the vertex shader should give you a much better depth range than what you are currently seeing, with little performance impact (assuming you are currently not vertex bound).
    If you have a development platform, you can see how utilised each core is with our performance analysis tool, DS-5.
    I hope this helps answer your question. Please let us know the outcome, and feel free to ask us any further questions.

    Kind Regards,

    McGeagh

  • Note: This was originally posted on 1st July 2013 at http://forums.arm.com

    Hi Stephane,

    You are correct, the Mali-T600 series GPUs support high precision in the fragment shader. So as long as you are requesting highp in the fragment shader for such devices, this should give you the precision you need.

    Happy to help,

    McGeagh

    Thanks McGeagh,

    That's what I figured. Though our app is very vertex heavy, it's probably still heavier on the pixel side. Obviously, per vertex fog does mean modifying/updating every shader in the product (and there are a lot) rather than the single post processing step, but definitely doable if we want to maintain the effect. This is a non issue on the T-604 correct? We don't have a device handy, however, I believe it does do higher precision in fragment shader than the 400-MP.

    Best,
    Stephane

  • Note: This was originally posted on 1st July 2013 at http://forums.arm.com

    Always worth a couple of footnotes to the "Mali-T600 family can do highp" ...

    * Mali-T600 can do highp in the fragment shader and is very good at it, but mediump may well be faster / lower power / lower memory bandwidth (doubling the size of the vector elements and memory access size isn't free ;P).
    * Remember most content has orders of magnitude more fragments than vertices - if you can "get away with" doing the work in the vertex shader it may well give better overall performance.

    HTH,
    Iso