Realtime Volume Rendering With RayCasting
This is my experiment of 14GB volume data real-time rendering with RayCasting on Consumer PC.
download from my Git page
Multiple ResolutionI 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|
Level Of Detail controlling
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$)
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
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.
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.