-
Notifications
You must be signed in to change notification settings - Fork 19
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
Populate chunk margins #41
Comments
A fix here will likely have a massive benefit to terrain rendering performance, as right now the overwhelming majority of rendered triangles are hidden. |
For the second bullet point, as more chunks are generated, surface extraction has to be repeated for chunks with new neighbors. @Ralith, do you have a recommended optimization for this, or should this be figured out by the person who tackles this issue? |
Off the cuff, I think it would be reasonable to mark chunks generated with incomplete margins, and regenerate them when new margin data becomes available. We could also just perform no surface extraction for a chunk unless its margins are fully known; that would require more data to be held in memory to achieve a given view distance, but that memory usage might not be the limiting factor anyway. |
That makes a lot of sense. I think the second option would be simpler for an initial implementation, so once we've done some profiling, we should be able to make a better decision here. |
Simpler approach: whenever voxel data for a chunk is first populated, invalidate surface extraction for any previously surface-extracted chunks. The same mechanism can be applied when edits touch a chunk face. |
Chunk data sent to the GPU is wrapped in a one-voxel margin that should be, but is not currently, populated with the data from neighboring chunks. If supplied, this data would produce correct AO and hidden face detection for voxels on the face of a chunk, improving both visuals and performance.
There are two exceptions:
The text was updated successfully, but these errors were encountered: