I was working on a volume rendering application with 8 bit/pixel datasets. I am using post-classification method for transfer function implementation. Now what i want to do is to extend this application for 16 bit datasets. My problem is that how to implement transfer function for 16 bit data.
Previously i was sending 1D texture to my fragment shader right away but now for 16 bit this would be too large.
And i also had a doubt that if all textures are scaled to range [0,1] then my 8 bit transfer function should have worked but it is giving me very bad quality output. (results of 8 bit and 16 bit datasets are attached)
glTexImage in case of 16 bit dataset
float4 main(uniform sampler3D dataTex,
uniform sampler1D tfTex,
float3 texCoord : TEXCOORD0,
float4 color : COLOR) : COLOR
{
float v = tex3D(dataTex,texCoord); // Read 3D data texture and
color = tex1D(tfTex,v); // transfer function texture
return color;
}
dataTex is sampler for dataset
tfTex for transfer function
Your shader looks ok and since the sampler3D type is used the return float will be normalized so it should work with the 8bit tf. Is this a public dataset may be the dataset is like that? Have u tried using volview or another volume rendering pkg to see what u get?
well i dont think so because this is second dataset with which i m trying.With previous one (http://www.cgl.uwaterloo.ca/~iebell/CS788H-0105/cs788.html)(iebellBrain.tar.gz) i didn’t even got any kind of structure but just a volume cube…that dataset i verified with Voreen(which produce so fine results that i feel like a idiot)
You have a 16bit dataset and thus u would need 2^16 entries in ur lookup table which gives u more control on the intensity differences as compared to using the 8bit lut. Ofcourse u can remap the 16bit value to an 8 bit if u want to use the 8bit lut.
ya i understand your point but that would be like 262 MB for a single texture…would not that hinder performance significantly…Isn’t there some another way for implementing this TF…???
2D tf have intensity on the x axis (0-255 for 8bit and 0-65535 for 16bit) and the gradient magnitude on the y axis so it would need more space for 16bit tf as compared to 16bit 1D tf.
The preintegration tf needs a nxnx4 data elements. Value of n for 8 bit lut is 256 and 16bit lut i 65536.