0
\$\begingroup\$

I want to create a "Building site is (not) obstructed." indicator for my building system.

How can I throw away those faces which would be hidden if the material would be opaque?

enter image description here

\$\endgroup\$
  • \$\begingroup\$ A culling shader is what you are looking for. I am no shader magician though, so I can't really help :( \$\endgroup\$ – Gabriele Vierti Dec 22 '18 at 10:34
  • 1
    \$\begingroup\$ There's a fundamental irony of voxel games that trips up many newcomers: 1) Voxel games look like they're rendering a bunch of individual cube meshes 2) No well-performing voxel game actually does it this way. I recommend taking a tour through previous voxels-tagged questions for some existing explanations of techniques for constructing a mesh of only the outermost surface. That said, if you just want a quick & dirty fix for this one case to hide everything but the frontmost surface, you can use the depth reservation trick shown here. \$\endgroup\$ – DMGregory Dec 22 '18 at 11:02
  • \$\begingroup\$ I just need a trick, because I did some research, then some benchmarking, and I will never use as many voxels that will cause performance issues. Even if in some miraculous ways I will have to, then I will combine meshes, optimize in other ways, etc, then. Because I don't want to prematurely optimize. Thanks for the link, I will have a look at that. \$\endgroup\$ – Tudvari Dec 22 '18 at 11:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.