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

Block LoDs #535

Open
kpreid opened this issue Sep 26, 2024 · 0 comments
Open

Block LoDs #535

kpreid opened this issue Sep 26, 2024 · 0 comments
Labels
area: data Things related to the data structures underlying the world, and the functions that manipulate them. area: graphics kind: feature Adding user-facing/developer-facing functionality

Comments

@kpreid
Copy link
Owner

kpreid commented Sep 26, 2024

Allow an EvaluatedBlock to provide a series of levels of detail (LoDs) — voxel data of lower resolution than the original/full resolution. This will serve several purposes:

  • Modifier::Inventory wants to draw inventory items without potentially greatly increasing the resolution, so LoDs for icons are needed.
  • In rendering, reducing aliasing and mesh complexity in distant portions of the scene and excessively complex chunks.
  • Preview icons of large multiblock structures (this is a case where it will really have to be well-cached to be useful).
  • In some cases of exceeding the block evaluation budget, a lower maximum LoD might enable evaluation to succeed in an acceptable fashion.

How it should work:

  • Block evaluation requests (EvalFilter) should specify the max LoD they are interested in, and whether they want smaller LoDs.
  • EvaluatedBlock should store a list of LoDs rather than just the single voxel array (note there are only at most 7 possible).
  • Evaluation will automatically generate requested LoDs by downsampling 2×2×2 groups to single voxels.
    • Blocks may have a LoD hint attribute which specifies the downsampling filter. For example, in most cases the filter should not introduce partial transparency that was not already present, and therefore there is a choice to be made about whether to tie-break towards opaque voxels or invisible voxels.
    • Perhaps there can be a modifier to add manually-defined LoDs. This means throwing out all consistency guarantees, though.
  • We may find it necessary to introduce anisotropic voxels which have a different material per face. Note that EvaluatedBlock essentially already has this for LoD resolution = 1, but the renderers do not use it because it doesn't fit into the current assumptions of isotropic voxels (see Mesh face colors #421).

Related: Modifier::Zoom would greatly benefit from being able to ask for only a portion of the voxel data. That's a bit like LoDs in how it influences evaluation. But, see #442 before doing anything about that.

@kpreid kpreid added kind: feature Adding user-facing/developer-facing functionality area: graphics area: data Things related to the data structures underlying the world, and the functions that manipulate them. labels Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: data Things related to the data structures underlying the world, and the functions that manipulate them. area: graphics kind: feature Adding user-facing/developer-facing functionality
Projects
None yet
Development

No branches or pull requests

1 participant