Skip to content
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

Improve occlusion shapes for 3D rendering #63

Open
Dawoodoz opened this issue Apr 21, 2023 · 1 comment
Open

Improve occlusion shapes for 3D rendering #63

Dawoodoz opened this issue Apr 21, 2023 · 1 comment

Comments

@Dawoodoz
Copy link
Owner

There is currently no viewframe clipping of occlusion shapes when drawing to the occlusion grid, which makes large occlusion shapes less effective when entering a clip plane makes them vanish. With clipping, more surface would be occluded. One could also calculate the worst case depth per cell instead of per shape for long walls.

Occlusion shapes currently only support boxes, but arbitrary convex shapes from point clouds could also be added.

@Dawoodoz Dawoodoz added this to the First stable release milestone Apr 23, 2023
@Dawoodoz
Copy link
Owner Author

Dawoodoz commented May 21, 2023

Using the fact that a drawn convex shape will have its furthest point of a convex screen region in one of the corners (assuming that the near clip plane is not cutting up holes), one can apply sparse ray-tracing against convex polyhedrons defined as a set of cutting planes. Then just take the line intersection against all forward facing planes and use the intersection furthest in as the intersection against the occlusion shape. If the closest back intersection is closer, we are outside and get infinite depth as the result. Each cell in the depth grid then becomes the furthest of all four corner depths from the grid. By starting ray-tracing at the camera's near clip plane and not sending rays outside of the view frustum, no clipping is required. If one would go inside of an occlusion shape however, everything would become invisible from detecting the occlusion from each ray's origin. This would be better than clipping against the camera, because it would also give the pessimistic furthest depth per cell instead of occluder, allowing occlusion shapes to run along a large wall and hide things closely on the other side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant