Tech Demo: Volume Rendering of a Computed Tomography

YouTube Preview Image


Comments: With this tech demo I have wanted to learn how to render volumetric data, such a ct. The algorithm used is pretty simple, an axis aligned box is sliced n times, producing n axis aligned planes. Each of the slices have 3d texture coords. A 3d texture with the volumetric data and a 1D texture with the transfer function are loaded. Then with alpha blending activated the rendering is done trhough a pixel shader. This pixel shader has two texture fetches: one to the 3d texture (wich gives a density) and the other to the 1d texture.

Algorithm: Texture Mapping with axis aligned proxy geometry and a 1d transfer function

Technology: C++, DirectX 9.0c, HlSl, Win32, Visual Studio 2005

Develop/Build/Test Machine Specs

  • Intel Pentium 4, 3000 MHz
  • 1024 MB (PC3200 DDR SDRAM)
  • GeForce 7800 GS (256 MB)
  • DirectX (DirectX 9.0c)


7 Responses to “Tech Demo: Volume Rendering of a Computed Tomography”

  1. Tobias says:

    Hey eso fue muy impresionante, tambien trabajo con este tipo de cosas
    y te quedo muy buenos

  2. pplux says:

    That’s awesome ! How dense is the 3d texture? I used to think that using big 3D textures produces very low performance.

  3. Ruben Penalva says:

    gracias Tobias. Yo tambien trabajo con esto y la verdad es que la visualizacion volumetrica esta muy chula.

    Ey pplux, great blog! I really like the two engineers talk :P The 3d texture has 128x256x256 voxels (widthxheightxdepth), 8 bits per voxel and about 8 mbs of size. Its pretty tiny if you take into account that in medical applications you can see datasets from 300-500mb to gbs. So if you compare with the real volumetric visualization applications, this demo is just a kids play.

    By the way, thanks a lot for the comments. It really helps to keep on working at home on developing new tech demos to show. Thanks!

  4. pplux says:

    Wow, the surface looks rather smooth for such tiny 3d texture, great!. You should definitely post more videos here at your blog, youtube is not that bad for that but is less funnier to comment :)

    Keep on those tech demos!

  5. pplux says:

    I forgot to mention that since few weeks the chapter of GPU gems you mention is available online, here:

  6. Binoy says:

    Have you thought of a GLSL version of this tech demo?
    I really liked your interactive way of building the transfer function with full flexibility.
    Any chance for me to take a look at that part of your implementation?
    I am working on a similar proxy geometry based(view axis aligned) volume visualization using GLSL
    Any recommendations or suggestions on the pros and cons with respect to Raycasting Vs Proxy geometry based implementation are welcome and appreciated.

  7. Ruben Penalva says:

    Hi Binoy,
    thanks for sharing your thoughts. I’m thinking about make a texture based glsl volumetric rendering demo, but not now. Just in case, I published a glsl raycasting test recently with source code. Im sorry but I didnt publish the source code for this demo and Im afraid Im not going to do it. Well, I think the advantages of texture based approaches are built-in filtering, memory bandwith and rasterization speed. Disadvantages are, in my opinion, it depends on geometry (bad for large data sets), its not flexible, it doesnt take samples correctly in a perspective view. In the other hand, raycasting is not geometry bound, take the samples correctly in perspective view, but its not suitable for gpu architecture.

    Ruben Penalva