Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depth Cache not populated - Exported Image is Black #1128

Closed
2 tasks done
klauskobald opened this issue Aug 10, 2023 · 8 comments
Closed
2 tasks done

Depth Cache not populated - Exported Image is Black #1128

klauskobald opened this issue Aug 10, 2023 · 8 comments
Labels
Unity Bug Issues we have confirmed or suspect are issues with Unity URP

Comments

@klauskobald
Copy link

Is there an existing issue for this?

  • I have searched the existing issues.

Have you checked the documentation to resolve your problem?

  • I have read the linked documentation and could not resolve my issue.

Current Behavior

(This is a copy from Discord)
I am investigating since yesterday why this is not working anymore. I am browsing thru my repo history and found out that after the update in February from 4.15 to 4.16 (unity 21.3.11) it is still working but after the update to unity 21.3.17 it breaks. The populate method is called and it does not throw any error, but the cache-map stays black. I cannot see any significant changes. Stepping thru with the debugger seems to reach the same code pieces as far I can see. I noticed that a new CustomMonoBehavior has been introduced which is also a base for depthcache script. I need help on how I could track this malfunction.

I made an update to 4.18 and it still does not work

I made a new scene. I found out that OceanDepthCache On Demand is not working. When I use On Start, it is creating the depth cache. BUT I need On Demand!

Expected Behavior

WaveCache working

Steps To Reproduce

new scene
put objects like this:
image

Unity Version

2021.3.29

Crest Version

4.16, 4.18

Render Pipeline

Universal

Editor or Standalone

Editor (Play Mode)

Environment

- OS: Mac 13.1
- GPU:
- Graphics API: Metal
- Target Platform: Any

Anything else?

No response

@klauskobald
Copy link
Author

Another interesting Behaviour: when I set to "OnDemand" and start the scene, the water stays flat - no waves. When I trigger Populate Cache the waves start but the depth cache is black.
When set to "OnStart" populate creates the proper depth cache. When I change to On Demand during play populate cache does not work either.

@klauskobald
Copy link
Author

"Force Always Update Debug" does not work either

@daleeidd daleeidd added URP Unity Bug Issues we have confirmed or suspect are issues with Unity and removed Bug Needs Triage labels Aug 11, 2023
@daleeidd
Copy link
Collaborator

Thanks for reporting. I had bug report on Discord about this but looks like Discord automatically closed it due to inactivity.

Depth priming currently breaks the ODC. Will eventually fix this. Workaround is to disable it or disable and use depth cache baking then re-enable

Since then I have worked out that it is related to both depth priming and SSAO. I reported this to Unity and they confirmed a few bugs on their end. They gave me a solution but I could not get this to work with the ODC.

Workaround for now is to use a baked depth cache and to disable SSAO and/or depth priming when baking.

@klauskobald
Copy link
Author

My game is depending on a dynamic depth map. Wind direction is used to build underwater objects once in a while for generating areas with no waves. Can you please explain exactly how to disable/enable/populate during runtime? I tried but it does not work.
I cannot find how to turn off depth priming - is there a switch?
I cannot NOT ship prebaked maps!! I am currently building a terrain/harbour editor which depends on dynamic maps!

@daleeidd
Copy link
Collaborator

You have to disable depth priming and/or SSAO in URP settings. I do not think it can be done at runtime or at least I do not know how.

@klauskobald
Copy link
Author

So, I turned off Priming - it was on Auto. They are writing, that on iOs and Android priming could lead to even more GPU load.
With priming off, everything works.

@daleeidd
Copy link
Collaborator

@daleeidd
Copy link
Collaborator

daleeidd commented Apr 4, 2024

@daleeidd daleeidd closed this as completed Apr 4, 2024
@daleeidd daleeidd pinned this issue Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Unity Bug Issues we have confirmed or suspect are issues with Unity URP
Projects
None yet
Development

No branches or pull requests

2 participants