I've optimized the glAccum function for the following common scenario:

glAccum(GL_LOAD, w);   // or glAccum(GL_ACCUM, w) on a zeroed buffer
glAccum(GL_ACCUM, w);
...
glAccum(GL_ACCUM, w);
glAccum(GL_RETURN, 1.0);

Where w = 1/n and n = number of images to blend.

This is the usual sequence of commands for full-scene antialiasing.
Basically, I store unscaled integer color components in the accum
buffer instead of scaled pseudo-floats.  This avoids a _lot_ of
int->float->int conversions.  A lookup table avoids integer divides
in GL_RETURN.

Benchmarking on my IRIX system I've found a 33% speed improvement.
That is, if the old implmentation took 3 seconds to execute glAccum,
the new code should take about 2 seconds.  Speed-up on other kinds
of CPUs should be at least as good.

I encourage anyone with a program that uses glAccum to test this
optimization.

-Brian

----------------------------------------------------------------------
Brian Paul        Avid Technology / Softimage      [EMAIL PROTECTED]


_______________________________________________
Mesa-dev maillist  -  [EMAIL PROTECTED]
http://lists.mesa3d.org/mailman/listinfo/mesa-dev

Reply via email to