unity-xr-plugin icon indicating copy to clipboard operation
unity-xr-plugin copied to clipboard

DepthNormals texture created without depth buffer

Open CarpetHead opened this issue 5 years ago • 6 comments

Currently while using this plugin alongside traditional image effects, the _CameraDepthNormals texture is completely broken. It looks as though this is because the RenderTexture is created without a depth buffer.

Video here https://streamable.com/xmjmv4

CarpetHead avatar Oct 13 '20 12:10 CarpetHead

Hi @CarpetHead - we're adding depth buffers in the next release. we'd like to test your issue specifically against it though - do you have a minimal repro for us?

1runeberg avatar Nov 17 '20 03:11 1runeberg

ShaderRepro.zip

DepthNormalsIssue Scene: Here is a repo of two different issues. Toggle in and out of play mode to see the issue with the depthnormals of the cubes.

TargetTextureIssue Scene: As a workaround, I tried to render the DepthNormalsTexture with a seperate camera, but you can see in the TargetTextureIssue scene, even doing this has an issue. A final blit on the extra camera causes a grey screen rather than the desired depth normals texture. Toggle in and out of play mode to see the issue.

CarpetHead avatar Nov 25 '20 13:11 CarpetHead

I had a go at compiling the UpdatedHeaders branch locally and putting in my Packages folder, and this issue doesn't seem to be resolved. Is it fixed in the repro case for you?

CarpetHead avatar Dec 08 '20 14:12 CarpetHead

Hi, thanks for reporting the issue. This should be fixed in the latest release. You're welcome to give it a try and let us know if it solves the problem. https://github.com/ValveSoftware/unity-xr-plugin/releases/tag/v1.1.1b

keithbradner avatar Dec 11 '20 20:12 keithbradner

Hmm, I'm not sure exactly what the root cause of the issue is, but I can still reproduce it in the above beta release: XR Enabled image XR Disabled image

you can see the depth sorting of the depthnormals texture is wrong while the xr plugin is active

CarpetHead avatar Dec 14 '20 12:12 CarpetHead

Hi @CarpetHead - The depth textures have been added in the latest beta, the main camera preview and VR results appear correct to me based on the scene layout:

image

Perhaps I'm misunderstanding your issue?

1runeberg avatar Dec 15 '20 22:12 1runeberg