0

Is it possible in AGAL in fragment shader get current fragment depth if any?

J. Holmes
  • 18,466
  • 5
  • 47
  • 52
nikitablack
  • 4,359
  • 2
  • 35
  • 68

1 Answers1

1

No, I'm afraid there is no way to read from the depth buffer in AGAL.

You can however do a workaround by rendering a depthmap first into a texture, and then using it (which may be enought, depending on the effect you are trying to implement).

In fact, even rendering a depth map with good precision can be (a little) tricky, because there are no float32 textures in flash, so the depth as to be stored in a R8G8B8A8 texture (by packing and unpackings values on the GPU).