pyrender
pyrender copied to clipboard
depth output not working when using OrthographicCamera
Hello there,
I'm trying to obtain a depth map using the orthographic camera.
I took this example code and replaced PerspectiveCamera(yfov=np.pi / 3.0, aspectRatio=1.0)
with OrthographicCamera(xmag=0.2,ymag=0.2)
.
This is what I get with PerspectiveCamera:
...and with OrthographicCamera:
It seems like all the geometry has disappeared and all I'm left with, is a dark outline.
In order to confirm this, I extracted the histogram of all the data in the depth channel:
Am I doing anything wrong? Thanks in advance :)
Hi there, I had the same issue and fixed it by patching the original code
https://github.com/mmatl/pyrender/compare/master...andreanicastro:master
This is my patch
Grazie Andrea! Just out of curiosity, do you know if the lib author is interested in merging your fix?
I was coming here for the same issue. Nice work. Unless I misread it, I think you missed another place where your patch would be required: read_depth_buf() in renderer.py
*edit: typo
Hi all, I had a PR opened for two months and I was updating it to keep it in line with the repo. I closed it because I thought was not going to be merged. I can re-do the PR early next week :)
On 20 Sep 2019 19:27, Simon Savary [email protected] wrote:
I was coming here for the same issue. Nice work. Unless I misread it, I think you missed another place where your patch would required: read_depth_buf() in renderer.py
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/mmatl/pyrender/issues/72?email_source=notifications&email_token=ADTYPIFDQ3UAEP54RJKXEHLQKUBX5A5CNFSM4IXRK2U2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7HLZEA#issuecomment-533642384, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ADTYPIENOAPCZV4VBWU7IR3QKUBX5ANCNFSM4IXRK2UQ.
@ssavary You are right, I will have a look a the issue this evening. I think I will have a PR ready by tonight.
Hi there, I had the same issue and fixed it by patching the original code
master...andreanicastro:master
This is my patch
Im wondering why the author not merge the code in, it solves my issue
@andreanicastro still very helpful, thank you!