-
Notifications
You must be signed in to change notification settings - Fork 15
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 AOV Is Euclidean Camera Distance Rather Than "Traditional" Image Plane Distance #22
Comments
After looking more into it, it turns out that there already is a mode in hdospray that is supposed to return the depth buffer projected along camera z in renderPass.cpp:826. It appears to be a bit off. Working on fixing this. |
I believe I have fixed the issue, a deceptively simple one line fix which I'll add into the next release. Let me know if this resolves it:
|
This fix does result in the depth values now reflecting the distance to the imaging plane, and match what other delegates return on the same scene. I want to note though that the world depth values across a flat surface do vary and lead to world camera/hit distances fluctuating by around 1% in my test scene (49.81 to 50.30) which I do not see under other delegates using the same aov/calculations such as RenderMan, which gives a solid reading of 50.03 across the face. |
I suspect the variance is because the conversion happens in hdOSPRay, assuming the rays go through the pixel center (which they don't for anti-aliasing). This should be solve once the projected depth to the image-plane is directly calculated by OSPRay. |
The depth buffer AOV records the depth to the camera rather than what most depth aov's record, which is the depth from the image plane. I think it might be reasonable/expected that hdospray followed this convention when exposing its depth aov through hydra.
This can cause issues if you want to use the depth plane and the camera projection matrix in Hydra to get a world position from an image plane position and the depth value.
To reproduce, put a plane in front of the camera at a known distance, then check out the depth values in the AOV. They will vary across its surface rather than be constant.
The text was updated successfully, but these errors were encountered: