Skip to content

Conversation

@douira
Copy link
Collaborator

@douira douira commented Oct 15, 2025

Performs the generation of visibility data for a set of 8 perspectives, which each enable a different set of 3 allowed traversal directions through the chunk, and then combines them based on the camera's relative position to each chunk. As a side effect, this also prevents visibility paths through sections that contain opposing step directions from being accepted. Such paths are always invalid since they can never contain a straight view ray.

This implementation has some optimization potential, but I have also not measured the performance of the visibility data generation so I don't know how necessary it is. Feel free to review and suggest (or make) improvements. I'm going to keep this as a draft until we've tested and discussed it more thoroughly.

See discussion of my recent ideas on valid and invalid paths here. This is the implementation of this concept I suggested last year.

Screenshot_2024-10-12_at_20 11 21

In my brief test, this reduced the section count from 4820 to 4512 in a simple overworld scene. More testing of its effectiveness and correctness is required.

Screenshot_2025-10-15_at_03 39 12 Screenshot_2025-10-15_at_03 41 16

A demonstration of how it can cull sections behind this section where no view ray is possible, which was previously not culled. (with all non-air blocks turned "opaque" for visualization)

Screenshot_2025-10-15_at_03 47 17

Prerequisite: #3484

@douira douira added the F-help-wanted Flag: Help wanted label Oct 15, 2025
@douira douira force-pushed the directional-vis-graph branch from b80f3d1 to 3bdf281 Compare January 17, 2026 17:08
@douira douira removed the F-help-wanted Flag: Help wanted label Jan 17, 2026
…g when above the world.

This was caused by the above-world init adding every section of the top of the world to the queue at once, resulting in some sections being visited too early such that they are not traversed through with all potentially incoming directions but marked as finished.
…R on the direction index

propagate symmetry into the number of visibility data sets needed,
reduce stack size to 3*16 since paths can no longer fold back in on themselves

use symmetry to avoid doing half the work in generating visibility data

use bitfield index based neighbor traversal instead of conversion to coordinate triplets

in vis graph construction, skip origin directions that are opposite the allowed step directions since they cannot lead to any visibility

Remove debug code, undo unnecessary changes, delete unused code

Avoid continuing the search if all possible destination faces have already been reached

Don't generate full visibility data arrays if they're just the same everywhere

Fix crash when initializing air chunks and they have no visibility data

Perspective based occlusion culling

Improve accuracy of visibility data by not allowing the traversal to go backwards
@douira douira force-pushed the directional-vis-graph branch from 3bdf281 to cc4e254 Compare January 18, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant