Hi Stephane, thanks for the response.
I did manage to get _something_ using the DepthAux. My approach currently is to check if it’s valid, and use it if so, otherwise try to use just Depth. (I can’t use LookupDeviceZ as the SceneTexturesStruct doesn’t appear to be available in my shader, and I’m not sure how to get it in there). I haven’t yet solved not having a scene color to sample from, but for now I’m just rendering black or white based on detected edges.
It is sort of working now, but I’m getting some strange results -
- The format of `DepthAux` is always PF_R16F, no matter what the format of `Depth` is. I’ve tried modifying the Android project settings to force a 24-bit or 32-bit depth buffer, to no effect. That said, although PF_R16F is not considered by the `IsDepthOrStencilFormat` method to be a valid depth format, if I just go ahead and use it anyway, then I can still sample it, and it seems to be the data I want. Except…
- It appears to be the depth buffer contents from the previous frame. If I’m moving the view quickly enough, I can see the outlines lag behind where they should be, seemingly by a frame. If this is expected and `DepthAux` is intended to be the previous frame’s depth, then this will be a non-starter unfortunately. Naturally we don’t want to be running at a low framerate, but it’s inevitable some users will be running on lower-end phones, and seeing the outlines trail behind everything else will be no good.
- On top of this, there seems to be some artifacts in the form of thin horizontal and vertical lines flashing on and off as I move the view around. If I just sample and output the depth itself, I don’t see these, but I’m not sure why my edge detection would cause those lines to appear (is it a precision thing?) It appears like a fixed grid of 5 rows and 2 columns, different parts of it flash on and off as I move the view around.
- It doesn’t occur in the editor when I use Vulkan Preview (though there, I am able to use Depth and not DepthAux, which isn’t available).
- This picture here is roughly what it looks like - the thick lines are the outlines of geometry I expect to see, then this grid of white thin lines appears over top as I’m moving the view. It never appears if I’m not moving.[Image Removed]
EDIT:
In addition to this, I went ahead and tried to force a full depth prepass, by adding this to AndroidEngine.ini:
```
[/Script/Engine.RendererSettings]
r.Mobile.EarlyZPass=1
```
and this seems to result in having the full, current frame’s depth buffer available at the end of opaque rendering. It’s not ideal, since we’re not using any of the other features you’d need a depth prepass for, but I’m getting somewhere at least.