How to generate MIP (Maximum Intensity Projection)

Now that I have the 3D Texture mapping working and am able to generate images by passing a plane through the 3D texture map, the next thing I need to do is to figure out how to blend the images together to make a single mip image out of the slices…

This code goes a slice at a time through the 3D texture and produces an image of the slice on the z plane. I need to combine these slices into one slice where the pixel value is the maximum value…

So if I had 16 images then i would look at pixel(0,0,n) where n is the slice number and output a single new pixel at pixel(0,0) of value x where x was the ‘brightest’ pixel.

If I understand glTexGen it does the iterations through the volume for me?

Looking at some of the links dorbie posted on 3D Textures one of them was on MIP

However the EXT functions don’t seem to be known to my version of OpenGL which I believe is 1.4

void display(void)
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    static int slice = 0;
    float z;
    
    z = (1.0/((float) (iDepth-1))) * (float) slice;

    glBegin(GL_QUADS);

        glTexCoord3f(0.0, 0.0, z); glVertex3f(-1.0, -1.0, 0.0);
        glTexCoord3f(1.0, 0.0, z); glVertex3f(-1.0,  1.0, 0.0);
        glTexCoord3f(1.0, 1.0, z); glVertex3f( 1.0,  1.0, 0.0);
        glTexCoord3f(0.0, 1.0, z); glVertex3f( 1.0, -1.0, 0.0);

    glEnd();

    glFlush();
         
    slice = (slice+1) % iDepth;
}

 

hey drbob, minmax was added to the core in version 1.2:
http://www.opengl.org/documentation/spec.html

get your extensions and required headers:
http://oss.sgi.com/projects/ogl-sample/registry/

minmax spec:
http://oss.sgi.com/projects/ogl-sample/registry/EXT/blend_minmax.txt

you need to check the extension string to see if you have it on your card (you should if it’s 1.4 compliant). make sure your drivers are current.

you might find this area helpful in general:
http://www.opengl.org/resources/faq/getting_started.html

correction: added to the spec, not the core. if you look at the end of the spec, you’ll see a list of extensions, grouped by the version current when they were added.

EXT_blend_minmax is supported on all nvidia cards and Radeon 8500+ on OS X.

GL_MAX_EXT should just work. Make sure you #include <OpenGL/glext.h>