Hi all, learning shaders here.
So I have a pre-rendered scene (think RE 1/2/3, Parasite Eve, FF, etc) where I have two cameras, one perspective to render 3d geometry and another ortho for the background. The background plane is scaled to match the screen, and the FOV of the main camera is adjusted to match the one in the 3d app (blender) (by converting horizontal to vertical FOV) - In blender, I export the corresponding depth maps along with my renders. I do it via nodes (as seen here - divide by far-near and subtract near) - I use a custom shader to use those depth images and occlude stuff (src)
However; I’m having problems where I see stripes/bands artifacts causing the render to overlap 3d objects where it shouldn’t. I have been told that this is because of precision issues, and that I should pack the depth value to a RGBA texture, but I’m not sure how to go about that… and where does this exactly fall into my setup, in my current depth shader code? or… ? I also read about using RenderTexture RFloat format when reading depth but again I’m not sure about the steps to do it… (and yes, I’ve read the doc about depth textures, along with many many relevant threads, all added to the confusion)
Here’s a video demonstrating the issue, and showing my setup:
Notice how changing the depth texture quality causes less (with higher quality) or more (with less quality) stripes…
What are those artifacts and what causes them? if it’s precision, how to go about getting accurate results and eliminating the issue?
Any help is greatly appreciated!
Thanks.