-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
How generate depth images in Unity? #6198
Comments
Hello! I have just came up with same question. I wanted to create depth map input for my CNN inside agent. This is what I managed to do.
![]() ![]()
![]()
![]() ![]()
![]()
![]()
![]()
P.S. I haven't tested actual machine learning with this setup, but I think everything will work fine. You can use my project as example, but it is not finished yet. |
Great instructions, thanks! Each camera in the scene multiplies the number of Draw Calls. |
@Javaec, I think you should use render texture with low resolution and corresponding sensor instead of camera sensor. As far as I know, this approach will generate relatively light images (compared to full screen rendering). CNN work fine with small images if your task is simple enough. Maybe you can play with texture colour formats to make images even lighter. Using full screen shader is inefficient, but I don’t have other solutions for URP. Maybe built-in render pipeline can offer different ways to get depth maps. |
Check this approach. It can be more suitable. https://discussions.unity.com/t/how-to-extract-view-depth-from-a-camera-render-with-a-shader/931374 |
I really don't know how to generate depth images in Unity URP.
The text was updated successfully, but these errors were encountered: