i need to simulate a 3d volume where every voxel has a color value and an alpha value; i need to add and multiplicate these values. i was thinking to use 3d texture approach but i don’t know how to manipulate the data. (f.e. how i can add all the values along the z assix?) suggestions?
I will assume that you want to use shaders to do it on GPU.
First you need to figure out how you want to handle your data and load into 3D textures - bricked or not? That would define how you are going to load data.
Load data into 3D texture
Perform actual rendering via proxy geometry.
–render each plane (quad)
----read value from bound 3D texture
----perform operation (add etc.)
----write into destination texture (if you using multiple render targer or to depth buffer etc.).
Read back destination texture
This is very rough outline and some of the issues to watch for:
– Depending on the format and precision used for destination target, you will have precision issues.
This is assuming that you are doing something like vol rendering else you may want to look at this nice tutorial by Dominik on GPGPU to do computation : http://www.mathematik.uni-dortmund.de/~goeddeke/gpgpu/tutorial.html
If you are starting into 3D volume rendering then take a look here: http://www.real-time-volume-graphics.org/?page_id=14