PDA

View Full Version : slices in volume rendering



alark
08-08-2003, 10:27 AM
hi,
i have a 3d texture mapped volume renderer and for rotation I keep the eye constant and rotate the 3d texture, so that the slices are always orthogonal to the view vector and the texture can be mapped to the slices. But, for some reason after rotation i always see slices instead of a clean blended volume. please help.
thanks,
alark

dorbie
08-08-2003, 04:57 PM
Try more slices with lower alpha values.

ffish
08-11-2003, 12:45 AM
I did a similar thing a couple of years ago, Alark. It sounds like there's a problem with your rotation code. If your slices are (supposedly) always orthogonal to the view vector and you're rotating the texture, but you're seeing slices, then you must be making a mistake and (accidentally) rotating the slices somewhere.

Try drawing just the slices in a flat colour (without the texture volume) and seeing if they rotate when you "move" in the application. If so, there's your problem.

Hope that helps.

dorbie
08-11-2003, 05:28 AM
"so that the slices are always orthogonal to the view"

Assuming this is true it's the slice count & transparency that's the problem.

gumby
08-11-2003, 07:30 AM
If you use a perspective projection you may still see edges of slices, even with view aligned slices. Try an ortho view.

alark
08-11-2003, 07:59 AM
Thanks for all your replies. I am NOT using automatic texture generation and think that the problem lies therein. I think that even though the texture is rotated the tex coords still have (0,0,..) .. coords for the view aligned slices. Please let me know what u think.
thanks,
alark

dorbie
08-11-2003, 08:37 AM
It may not be the tex coord generation, 3D texture would sample OK even with misoriented coordinates, it would just look incorrectly rotated, any errors would be pretty obvious IMHO. OTOH undersampling in eye Z would lead to slice artifacts so if you've squeezed your texture you may have a problem.

Pick your problem apart and make sure each stage is correct. Draw just the slices and see if they work, then add texture then play with the number of slices.

Send a link to a sceenshot for a better diagnosis, we're graphics guys we like pictures.

[This message has been edited by dorbie (edited 08-11-2003).]

alark
08-11-2003, 10:23 AM
hi,
here is the image of a chair volume which as obvious slices. in this case the number of slices are few but this is generally the type of slices that are observed during the rendering of medical volumes even when using a large number of slices.

http://www.geocities.com/alark_j/chairslices.jpg

please let me know what you think might be the problem.
alark

kz
08-11-2003, 03:45 PM
please let me know what you think might be the problem.
alark[/B]

These are "normal" artifacts that are typical for 3D volume rendering. Increase the sampling rate (to a very high rage) or use pre-integrated rendering
(http://wwwvis.informatik.uni-stuttgart.de/~engel/pre-integrated/paper_GraphicsHardware2001.pdf)
to get rid of the artifacts.

dorbie
08-11-2003, 03:51 PM
Go with my original suggestion and it will fix your problem.

You may also have an alpha test going on, reduce the alpha ref for the test to soften the edge.

I suspect you are not reducing the alpha of the slices as you add more slices, this is advisable but depends to an extent on your intent. If you intend solid rendering you will have to reduce that alpha ref.

[This message has been edited by dorbie (edited 08-11-2003).]

dorbie
08-11-2003, 08:41 PM
P.S. the other problem is your data, as your data becomes transparend it also becomes dark, this may be because of the way you construct your LUT from the data, it's not always a given that this is how data should be represented and can exaggerate your kind of artifacts.

kz
08-12-2003, 04:54 AM
In spite of Angus' suggestions, I suspect
that your code is correct. These artifacts are to be expected with a 'standard' implementation of 3D texturing. You can
reduce them by
1) increasing sampling rate (while reducing
alpha) - will not quite get rid of them
though
2) pre-integrated rendering.
The latter gives an amazing improvement in image quality.

dorbie
08-12-2003, 07:59 AM
Let me assure the original poster that my suggestions will mitigate the problem. I don't mind you making your own suggestions, but it's wrong to imply what I've written won't work, it does and will, it helps to aid understanding of these artifacts, yes they are common in hardware volume rendering (actually some are some aren't fragment alpha testing with such an obviously high threshold is not so common IMHO), and they have common solutions. If you look at the original screenshot there's clear evidence of alpha testing, discrete slices and black alpha 0 texels.

There may be other solutions (I'm aware of some, mainly multiple texture tap & dependent texture based stuff) it may even be a better way on some hardware with the right features or resources (QED), but it doesn't mean that it can't be solved the usual ways, and probably should be before a more advanced approach is taken. It would be difficult & expensive to integrate that alpha text function at every pixel with the approaches I'm aware of, and that's close to what it would take.

P.S. If you're using the fragment alpha test to perform some volume outline you should move to a LUT based approach and adjust the texel transparency & color even if it's pre load without a real LUT, this will soften the edge.

[This message has been edited by dorbie (edited 08-12-2003).]

alark
08-12-2003, 08:34 AM
Hi all,
thanks a lot for your replies. I did notices those effect 'reducing' a little after the number of slices were increased. And as kz mentioned, I too think that they are normal, but for my assignment I 'have' to fix it.
Here is another screenshot. Please note the two lines going diagonally across the rendered volume. Only when the image plane is perfectly orthogonal to the view, no such slices are observed.
hope this helps. thanks. http://www.geocities.com/alark_j/abd.jpg


-alark

[This message has been edited by alark (edited 08-12-2003).]

[This message has been edited by alark (edited 08-12-2003).]

alark
08-12-2003, 08:45 AM
here is an image which shows the EXACT problem. here the number of slices are 200, so undersampling is definitely not the problem.
thanks,
alark

http://www.geocities.com/alark_j/abd1.jpg

dorbie
08-12-2003, 10:53 AM
This is slice clipping at a non transparent boundary, either your volume brick is not surrounded by alpha = 0 data (alternatively texture border has alpha = 0 would be the simplest fix) or you are clipping using an arbitrary plane without the normal slice that's used to reconstruct the clipped surface. You could use a soft clip with a 1D alpha texture in the clip transition to compensate for this. However if your chair is anything to go by then the problem is still alpha testing because that shot was the same issue with no obvious clip transition.

These problems are normal yes, but that doesn't mean they can't be mitigated.

You always need transparent border fragments from your texture operations or clipping with this simple volume rendering approach.

This IS your problem and it doesn't have to look as bad as your demo, what else is there to say?.... You have to understand that those edges are caused by either geometric clipping or fragment alpha clipping and the fix for the artifact is to soften that clip. I've explained how. Without much more fundamental modifications to your rendering method this is the fix, it's simple and it's not up for debate as far as I'm concerned. Take it or leave it.

In technical terms you are reducing the frequency of your clip or border transition in 3D to match your sampling rate. IT WORKS!


[This message has been edited by dorbie (edited 08-12-2003).]

kz
08-12-2003, 12:02 PM
I agree with Angus, the artifacts in the CT images are due to clipping at the volume boundary and he suggested several valid approaches to solving that problem.

The artifacts in the image you posted earlier (the chair) were caused by undersampling (you see the slices even in the "center" of the volume).

Getting rid of volume clipping problems is easier said than done. May the force be with you.