I have a bunch of meshes with custom depth enabled, all with the same stencil value. Then I read that stencil in a post process. Usually everything works fine, but sometimes the buffer seems to be written with the meshes in a weird transform.
What’s particularly weird is that while in PIE, the camera preview of the player’s camera renders correctly while the main viewport is wrong. Similarly, if I eject from the pawn, it looks correctly in the main viewport. Additionally, when the stenciled meshes move, the custom depth buffer remains unchanged, but when camera focal length changes, the stencils clearly switch between mesh LODs. However, destroying and respawning the meshes or continuously ejecting and repossessing sometimes fixes it.
Here’s an example with a post process that just renders
SceneTexture:CustomDepth / 1e8. The preview in the corner is the camera of the possessed pawn, and always renders correctly.
Anyone seen this or have any idea what might be causing this?