<p>There are many methods to go about visualizing volume data. Two famous ones are texture slices and ray marching. Texture slices intends to render 3D textures with volume data. Refer to the wiki page for Volume Rendering for more approaches. Ray marching shoots rays through the volume and composites values as the ray progresses through. This is a very simple explanation.</p>
<p>Now you can code raymarching in a fragment shader or a compute shader or even on the cpu.
If you are interested in Raymarching, you can use my project as a reference (I used a compute shader approach)
<a href="https://github.com/gallickgunner/Volume-Renderer" rel="nofollow noreferrer">https://github.com/gallickgunner/Volume-Renderer</a></p>
<p>Also these tutorials might come in handy.</p>
<p><a href="http://graphicsrunner.blogspot.com/2009/01/volume-rendering-101.html" rel="nofollow noreferrer">http://graphicsrunner.blogspot.com/2009/01/volume-rendering-101.html</a></p>
<p>For an in-depth explanation to these topics, refer to the book &quot;Real time Volume Graphics&quot;</p>

CC BY-SA 4.0
2020-12-12T07:28:03.977Z
2020-12-12T07:28:03.977Z
gallickgunner
<p>What you're looking for is &quot;volumetric rendering&quot;, here is one resource with code that takes data in the form of images of the layers:</p>
<p><a href="https://www.codeproject.com/articles/352270/getting-started-with-volume-rendering" rel="nofollow noreferrer">Getting started with Volume Rendering using OpenGL</a></p>
<p>A quick hack would be to use a grid of particles/&quot;billboards&quot;, and make them transparent based on the density.</p>

CC BY-SA 4.0
2020-11-10T20:01:33.613Z
2020-11-12T00:06:24.287Z
2020-11-12T00:06:24.287Z
AnnoyinC
<p>I have a CT scan of a portion of a human body, with each point describing density. The data file provides X, Y, Z, and density values.  I want to know how to visualize this data, using OpenGL or a library based on OpenGL.</p>

CC BY-SA 4.0
2020-12-12T12:46:14.210Z
This is typically referred to as Isosurface extraction and is classically solved with the marching cubes algorithm which was famously invented and patented for this very task. The patent has ended and you can implement the algorithm or download libraries. Search for "Marching cubes: A high resolution 3D surface construction algorithm". There have been many "improvements" to this and the internet is rich with examples.
pmw1234
<volume-rendering>
How to visualize density data as volume using OpenGL?
user2309000
# How to visualize density data as volume using OpenGL?

(Asked by: username_0 on 2020-11-10)

I have a CT scan of a portion of a human body, with each point describing density. The data file provides X, Y, Z, and density values. I want to know how to visualize this data, using OpenGL or a library based on OpenGL.

**Tags:** volume-rendering

> **Comments:**
> **username_1**: This is typically referred to as Isosurface extraction and is classically solved with the marching cubes algorithm which was famously invented and patented for this very task. The patent has ended and you can implement the algorithm or download libraries. Search for "Marching cubes: A high resolution 3D surface construction algorithm". There have been many "improvements" to this and the internet is rich with examples.  

---

## 2 answers

### Answer by username_2 on 2020-12-12. Score: 2

There are many methods to go about visualizing volume data. Two famous ones are texture slices and ray marching. Texture slices intends to render 3D textures with volume data. Refer to the wiki page for Volume Rendering for more approaches. Ray marching shoots rays through the volume and composites values as the ray progresses through. This is a very simple explanation.

Now you can code raymarching in a fragment shader or a compute shader or even on the cpu.
If you are interested in Raymarching, you can use my project as a reference (I used a compute shader approach)
<https://github.com/username_2/Volume-Renderer>

Also these tutorials might come in handy.

<http://graphicsrunner.blogspot.com/2009/01/volume-rendering-101.html>

For an in-depth explanation to these topics, refer to the book "Real time Volume Graphics"


---

### Answer by username_3 on 2020-11-10. Score: 1

What you're looking for is "volumetric rendering", here is one resource with code that takes data in the form of images of the layers:

[Getting started with Volume Rendering using OpenGL](https://www.codeproject.com/articles/352270/getting-started-with-volume-rendering)

A quick hack would be to use a grid of particles/"billboards", and make them transparent based on the density.


---

