Re: [PyOpenGL-Users] volume rendering
Brought to you by:
mcfletch
From: Dirk R. <di...@li...> - 2008-12-08 14:40:38
|
Hi Andrew, I'm not really an expert in volume rendering, but an interesting problem nonetheless... Andrew Wilson wrote: > Hello, > I've got an opengl question, figured there are a few experts on this > list. I'm generating a 3D volume render using 3d textures and would like to > setup multiple regions of interest (ROIs) where only the volume data within > the ROI is displayed (everything else is transparent). This is rather easy > using the clipping planes for rectangular shaped ROI's and can be faked for > ellipsoidal ROIs with the stenil buffer. The tricky part is to render > multiple ROI's simultaneously without much performance hit. I'm having a > hardtime doing this elegantly. Some ideas are: Basic question: how are you doing the volume rendering? Texture slicing or shader-based ray marching? > 1. Clip the actual 3d texture to the different ROI's using a binary mask > and reload the texture to the GPU. This becomes problematic for > non-rectangular ROIs as the ROIs will look "voxelated" but is nice because > it is a single pass for all rendering all ROIs. You can avoid the voxelisation by not storing a bit but a plane equation in the voxel. That would allow fairly high precision clipping, even for an 4x8 bit texture. But it really is only necessary if your volumes are small, so that a voxel is blown to many pixels. Is that the case? > 2. For each ROI, render the 3d texture clipped with that ROI's bounds. > This require multiple renderings and would slow down quite a bit for many > ROI's, this will look the best but is not all that elegant. Nope, and pretty slow to boot, and I'm not sure if you can make it work for overlapping ROIs. You'd have to do some solid model operations to make it clean. > 3. Use a shader to clip the ROI's That sounds like the best idea, IMHO, as long as you have a relatively small number of ROIs. How many are you expecting? > Any other obvious solutions or ticks that would do this? Any help is much > appreciated. Nothing obvious, sorry. :( Yours Dirk |