-
-
Notifications
You must be signed in to change notification settings - Fork 2
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 to render depth information? #1
Comments
Hey Khiem, Unfortunately, it is not straight forward. To get accurate and usable depth results from the unreal engine you need to use a custom shader to write the scene depth values into textures. I did this in a previous work you can find the relevant code here: https://github.com/search?q=repo%3Aunrealgt%2Funrealgt%20depth&type=code In theory something similar should be possible in this tool as well. However, Adding a depth shader/material would be possible, if you switch from rendering cube maps to rendering individual image slices, and then render the slices using a normal scene capture instead of a cube map scene capture. So rough outline on what could be done: Option 1:
Option 2:
|
Hi Lorenz @lolleko, Thank you for your detailed response, I appreciate it. I admit that I'm not familiar with UE so please bear with me :). The task I'm trying to do is a little simpler: for a given geo-referenced camera pose (e.g., lat/long/alt + rotation), I just want to render both perspective RGB + depth for that perspective viewpoint. So I guess I don't have to deal with rendering cube map/panorama like what you discussed. I looked up online and found a few other options that can render the depth with Unreal Engine, such as using another plugin Movie Render Queue Additional Render Passes. This seems to me a reasonable tool that allows me to render depth. In fact, I saw one or two projects also used this tool to render depth from python script (e.g., https://github.com/PerceivingSystems/bedlam_render/tree/main/unreal/render). Have you had any experience with this tool and is it similar to your custom depth shader? Since I don't have experience with writing custom shaders/plugins for UE, I'm hoping to find a simple solution that doesn't require writing those. Hopefully the question is not too out of scope! Thank you! |
I think I would be able to make the changes to make this possible, as this is indeed a lot simpler. Unfortunatly i don't think there is a solution that would offer what you need out of the box, neither with this project nor with other tools. |
Hi Lorenz @lolleko, Definitely! If you can draft up a quick sample of taking as input a location + rotation (maybe w.r.t. ECEF or local ENU, etc. -- up to you) then output the rendered RGB + depth, that would be awesome. From this starting point, I'm happy to make a PR to extend it to be more thorough if needed. Can I also ask are you compiling the project on Ubuntu or Windows? Opening the project with UE 5.4.3 on Ubuntu has been giving me problems. Thanks! |
Hey @kvuong2711 , I will try to code up a PoC, that will give you the ability to generate depth images alongside regular images. I will post more detailed instructions once the PoC is ready. |
I didn't test on Linux yet, this has also been on my TODO list for a long time. Windows is fully supported, Linux might require some fixes. and also sorry about all the bot comments here, not sure what's going on. |
Hi @lolleko, Is there any update regarding this? 😃 |
Hey, took some hours to continue working on this, but don't think i can invest more any time soon. If you enable depth capture on the Resamplercomponent (disabled by default) it will generate the following pairs: The depth images use a custom format. The depth is encoded in mm as a 24bit integer inside the RGB channels, have a look at https://colab.research.google.com/drive/1wgKrLEiQ4yHdqjLnJmFPXk_D8z3TRsYE?usp=sharing for example conversion code back to meters. Known Issues
|
@kvuong2711 were you able to test this out? |
Hi Lorenz,
Thanks for the cool work! I know "rendering depth" is on your to-do list, but I'm wondering if you have any quick pointers on how to implement this function inside your current code base (e.g., is it something relatively simple to do).
Thank you for your help!
The text was updated successfully, but these errors were encountered: