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

Implement Transparent/Translucent Voxels #69

Open
zauberparacelsus opened this issue Sep 21, 2019 · 3 comments
Open

Implement Transparent/Translucent Voxels #69

zauberparacelsus opened this issue Sep 21, 2019 · 3 comments

Comments

@zauberparacelsus
Copy link

One useful feature to have would be support for voxels that are transparent, translucent, etc. So, I'm creating an issue report for it.

In the context of implementing the geometry generation, it would be relatively simple. The mesh for opaque voxels would produce surface geometry along where opaque voxels border either transparent or empty voxels (instead of only empty voxels). As well, transparent voxels of differing materials (eg: water, ice, crystal, etc.) would generate as separate meshes.

In the context of rendering, that's a bit out of my ballpark.

@TokisanGames
Copy link
Contributor

TokisanGames commented Sep 21, 2019

Blocky Voxels already support multiple materials. Godot supports translucent materials. See #66.

What else does this issue bring up that is not already supported?

@zauberparacelsus
Copy link
Author

@tinmanjuggernaut The main issue is what I highlighted in the middle paragraph, the need for making sure that opaque voxels remain solid when viewed through a transparent section of mesh.

The image below demonstrates what I'm talking about:

8a7084fe9a468bbd4bff68d7cc67d458

Both spheres are the same: each is divided in half, with one half being opaque and the other being transparent. But the one on the right has an extra face against the transparent half, so that it is solid.

@Zylann
Copy link
Owner

Zylann commented Sep 22, 2019

It looks like this is exclusively for smooth voxels, since blocky meshing supports this already (see #66 (comment)).

It could be interesting to use the TYPE channel in such a way cell polygonization would append geometry to different surfaces of the mesh, like the blocky mesher does. That would basically implement multimaterials (without blending of course). I'm just not sure how to handle face culling at the boundary of two different types of surfaces. A super naive way to do this would be to run the meshing as many times as there are materials, resulting in independent volumes but not cleanly connected and without face culling between them...

I'm also not sure about the consequence on edition, considering that a single voxel cannot have multiple materials.

I also realise that on your screenshot with the two spheres, you are showing a clean, sharp separation between the two parts. But marching cubes or transvoxel can't represent sharp features, so it's likely the result won't be as clean.

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

3 participants