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

Combine sides in voxel exports #54

Open
Carifio24 opened this issue Sep 18, 2024 · 1 comment
Open

Combine sides in voxel exports #54

Carifio24 opened this issue Sep 18, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request voxel

Comments

@Carifio24
Copy link
Member

Something that we should consider to make the voxel files more lightweight is to pre-alpha-composite sides of adjacent boxes. While this won't be helpful on boundaries, this should still lead to a significant reduction in vertex and triangle count.

To be more specific, suppose we have two boxes $A$ and $B$ that are adjacent. This means that they meet along a common face. Call this face $F_A$ in A and $F_B$ in B. $F_A$ and $F_B$ are spatially coincident, but may have different opacities due to the data. What we can do is instead replace this by one common face $F_AB$ whose opacity comes from alpha-compositing together the materials of the original two faces.

This would require some modification of the geometry, but we're only dealing with rectangular prisms so this shouldn't be too difficult.

@Carifio24 Carifio24 added enhancement New feature or request voxel labels Sep 18, 2024
@Carifio24 Carifio24 self-assigned this Sep 18, 2024
@Carifio24
Copy link
Member Author

I'm actually not sure whether or not this will work due to visibility issues from various sides. Currently all of the normals for the "box" geometry point out - if we want a single side to be visible from both directions (as we would want here) then we would need to double-triangulate anyways, so maybe any gains to be had here aren't worth the effort?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request voxel
Projects
None yet
Development

No branches or pull requests

1 participant