Realtime Volume Rendering With RayCasting

Summary

This is my experiment of 14GB volume data real-time rendering with RayCasting on Consumer PC.

Video

sourcecode

download from my Git page

Method

Multiple Resolution

I prepared multiple resolution on offline, and switch the resolution during rendering time.
original resolution 1/2 resolution 1/4 resolution 1/8 resolution 1/16 resolution
level0.png level1.png level2.png level3.png level4.png

Level Of Detail controlling

lod.png

like populaly used in polygon rendering,
I apply LOD control method for volume rendering.
more the data is close to eye position, I use higher resolution data.
I made multiple resolution volume data. Decrease resolution into 1/8 1/8 1/8….(because volume data has 3 dimension that is why the number of 8=$2^3$)
and then,
I divided whole volume into many tiny blocks.
And select the best blocks at a time.

How Can I choose the best resolution?

the best resolution means the highest resolution as possible.
the voxel1 size which is projected on to screen 
and 
pixel size on screen come close. this is the best resolution.
When voxel size on screen became smaller than pixel size on screen, there is no meaning to render this resolution,
so , then, switch to lower resolution data.

View Frustum Culling

I blocked volume data. so, I can do view frustum culling. that is another reason why I made tiny blocks of volume data.
The block who exist in outer side of view frustum is not rendered.
That made accelerate rendering.

RayCasting

raycasting.png

There are several way to render volume data.
I select RayCasting.
This method is most efficient and can take advantage of current good GPU architecture.
The RayCasting is , The ray is the line from eye point to each screen pixels.
along this line, I picked up voxels and add voxel's transparency. and blending result will become color of each pixels.
here is the source code of raycasting of each blocks.

Reference

en.gif en
ja.gif ja


edit
サポートサイト Wikidot.com volumerendering