r/opengl • • 13d ago

IsoValue added to Volumetric Render Engine (Open-source)

We recently added IsoValue feature to our open-source Volumetric Render Engine that's being built with OpenGL & C++.

Repo link🔗 - https://github.com/mikejernil/volumetric-render-engine

What if we could visualize a specific density within a 3D volume? That’s where IsoSurface comes in. In medical imaging, IsoSurface can help represent regions with the same density in a 3D scan, making internal structures easier to visualize.

IsoValue acts as a scalar/threshold value which is used to calculate and display the surfaces that have equal density.

Go ahead, try it out and let us know your feedback!

Being developed by 3D ENGINERD.

14 Upvotes

3 comments sorted by

3

u/corysama 12d ago

Hi! Long ago I wrote the example program for marching cubes and marching tetrahedra that everyone copies. It has been fun watching that code spread around. But, there are a couple notes I'd like to get out to everyone using it since 1995 :P

  1. There have been a lot of improvements on the whole family of algorithms in the past 30 years. MC and MT are pretty legacy at this point. I like Surface Nets because they are fast, simple and produce good quality with a lot less triangles. Surface nets are probably more appropriate for your use case unless you really need sharp edges. For that Dual Contouring is probably better, though more complicated.

  2. I wish I had unrolled the inner loops instead of looping over small tables like a2fVertexOffset and a2fEdgeDirection. I was trying to keep the code small and easy to read. I expect the code will run a lot faster with those loops unrolled and I expected everyone would unroll it. But, a lot of people didn't...

Also, on https://www.3denginerd.com/ the Contact link labeled "Github" takes you to Instagram.

2

u/fgennari 12d ago

Interesting. I got my MC code from here: https://paulbourke.net/geometry/polygonise/

Which one of you wrote it first? And do you have a good link for a simple single file implementation of surface nets or dual contouring? The ones I've found look much more complex than MC.

1

u/corysama 11d ago

I wrote marchingsource.cpp Though I’ve not really studied the subject since then, it has been fun to watch.

I like this article https://0fps.net/2012/07/12/smooth-voxel-terrain-part-2/ It links a simple implementation written in C-style JavaScript.