0

I have a 3D image just defined by its voxels. This image is a grey-scale image. I need to render it in false colors. The idea is to write shader implementing something like the Phong model. On Internet I found different shaders. But all of them use known-normals on rendered points. So, when the Phong model is applied, the OpenGL pipe-line has already performed a lot of things.

Unfortunately, as my image is directly a voxel image. I have no information on normals. Moreover the image is directly stored as a 3D texture. Hence, to apply the Phong model I cannot benefit of the OpenGL pipe-line.

So, does someone know how to perform a Phong model in this case?

genpfault
  • 51,148
  • 11
  • 85
  • 139
  • The phong model is a surface related lighting model. To use that you could convert the volume into an isosurface representation, e.g. using a marching cubes algorithm, and then calculate surface normals and apply the phong model. If you do not want an isosurface representation you probably want some sort of intensity projection, which is a different thing (look for volume rendering methods). And what do you mean by "false colors" in your case? – Thomas Feb 12 '15 at 16:17
  • You can calculate gradients for your 3D-texture by using finite differences and use them as normals for your illumination model. – BDL Feb 13 '15 at 08:29
  • The structure I have in the image is quite complex. So "marching cube" approach is a little bit complicated. Moreover, what I have is textured volumes. Hence finding initial points for the marching cube, and be sure to cover all the objects (some of them can be so closed that it is difficult to separate them), seems too complex. –  Feb 13 '15 at 13:04
  • Alain, you said you have an grey-scale image defined by voxels. I interpreted this as having a regular grid (x,y,z) in Z³, where, for each coordinate (x,y,z), F(x,y,z) is a scalar value. For such a grid the coordinate points themselves naturally provide the corner points of the cubes in the marching cubes (MC) algorithm. Also MC does not get more complicated if structures are complex.The issue of close objects and the ambiguity (connect object or separate) can be resolved with a topologically correct MC, which has a larger lookup-table (google for "topologically correct MC"). – Thomas Feb 14 '15 at 23:29

0 Answers0