-
Notifications
You must be signed in to change notification settings - Fork 144
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
Incorrect depth buffer check in depth buffer test #48
Comments
Also, the ray direction should be normalized within the rayCast() method. |
…rint! Previously, ray directions were normalized, and then multiplied by the application-to-voxel matrix. This meant that SetSteps specified how far the ray should march at each step in the application's coordinate space, instead of in terms of voxels! As a result, `SetSteps` now specifies how far the ray should march at each step in terms of voxels. This commit updates all of the samples to fix this (which fixes an artifact visible on g3DPrint when using a high voxel resolution plus the surface visualization mode would result in undersampling), which improves rendering performance. Also: - Fixes ray-depth buffer intersection (#48, #95) without adding a new variable to the GVDB scene or info struct, by adding a new function, `getRayDepthBufferMax`. - Hopefully correct ray transformation in volume shaders (#89). - Fixes a bug where RotateTZYXS was multiplying on the left instead of on the right by the scaling matrix. - Renames `SCN_PSTEP`, `SCN_SSTEP`, and `SCN_FSTEP` to use more descriptive names. - Adds an `m_draw_topology` flag to `gInteractiveOptix` to choose whether to draw topology at compile-time - Adjusted volume translation in `gInteractiveOptix` and extinction to account for scale change - Includes minor formatting changes
Hi icoderaven, I've just pushed commit 9ffc6b7, which should fix this by adding a new function, Thanks! |
The current depth buffer test compares the linear depth for a particular pixel with the raybox intersection distance along the ray.
This is incorrect, and should be comparing the linear depth against the distance along the ray projected to the camera z axis (assuming that scene depth buffer is equivalent to a depth image transformed by the projection matrix to normalized 0..1 values)
i.e., instead of
it should be something along the lines of
where for convenience I have exposed the camera z in world frame as
scn.dir_vec
Of possible relevance to @drmateo and #44
The text was updated successfully, but these errors were encountered: