I rendering a volume, that I writing a shader for coloring the volume. The volume is a sampler3D and a transfer function is a sampler3D, but I don’t success, because all a cube is colored, ex. gray, I dicovered that lack a composition
Any idea for implementing a blending in my shader ?
Blending is usually ordering dependent, i.e. you need to make sure that you render either from front to back or back to front. The usual way to get this for volume rendering is to just draw the front faces of a cube. In the fragment shader for each fragment reconstruct where the ray from the eye position enters and leaves the volume and manually (i.e. with a loop in the fragment shader) trace that ray through the volume.
Since you are moving along a view ray and basically sample the volume at various points you can easily do this from the furthest to the closest point and blend the values accordingly.