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

有帮助吗?

解决方案

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).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top