oculus-samples / Unity-DepthAPI

Examples of using Depth API for real-time, dynamic occlusions
Other
167 stars 24 forks source link

URP Occlusion Sub Graph don't seems to work with 2023.2 #36

Closed xjorma closed 2 months ago

xjorma commented 2 months ago

I have no occlusion at all using the subgraph "OcclusionSubGraph" in my custom shadergraph on unity. Pre made shader works with 2023.2. And my shadergraph works with 2022.3. I can sent a super simple example project if needed.

xjorma commented 2 months ago

Seems to also be broken in 2022.3.25 (Lastest) Repro step are very easy. Import DepthAPI_URP in 2022.3.21 (Shadergraph WORKS) Import DepthAPI_URP in 2022.3.25 (Shadergraph DOESN'T WORK, the deformed red sphere and the green dodecahedron are never occluded as they should, the rest seems to work ok) It seems most of the code is stripped.

image

xjorma commented 2 months ago

Ok seems to be a very recent issue 2022.3.24 seems to work. So it seems to be introduced in 2022.3.25. Also I believe I found a fix. I changed your OcclusionSubGraph and it's fixed. I will do more test and test the fix in a recent 2023.2, let you know. image

xjorma commented 2 months ago

Also works in 2023.2.19 :)

TudorJude commented 2 months ago

Hey,

Thanks a lot for this analysis and fix. I'll try and repro this on our side as well. Shadergraph has been a little finnicky lately for some reason, I assume Unity is making some under the hood changes to it. For instance, our Shadergraph example shaders broke in Unity's 2022.3.11 version because of a URP/Shadergraph package update. We were doing occlusions by using alpha clipping with a threshold of 0. That stopped working in 2022.3.11 for some reason, so we had to modify that value to 0.01.

Hope you're enjoying the API otherwise, though.

Cheers

xjorma commented 2 months ago

It's definitely a good job. This repo is very useful. It's awesome to play with occlusion. I'll take inspiration from it to directly access the linear depth from a pixel and experiment with volumetric effects. It's a shame we can't do the same with the passthrough color—I could've done cool effects like refraction or reflection. Maybe one day :)

Message ID: @.*** com>