rem: Color4f selectR(1,0,0,0), selectG(0,1,0,0), selectB(0,0,1,0);
add: Color4f selectR(1,0,0,0), selectG(0,1,0,0), selectB(0,0,1,0), one(1,1,1,1);
context: void setupRegComb(Matrix &m, bool usetex){    // create the RegisterCombiner to do the matrix multiply    // only the first 3 elements are used, no projective color yet        Color4f m1(m[0][0]/2+.5,m[0][1]/2+.5,m[0][2]/2+.5,0),            m2(m[1][0]/2+.5,m[1][1]/2+.5,m[1][2]/2+.5,0),            m3(m[2][0]/2+.5,m[2][1]/2+.5,m[2][2]/2+.5,0),            m4(m[3][0]/2+.5,m[3][1]/2+.5,m[3][2]/2+.5,0);        Color4f selectR(1,0,0,0), selectG(0,1,0,0), selectB(0,0,1,0);     GLenum source = (usetex ? GL_TEXTURE0_ARB : GL_PRIMARY_COLOR_NV);     beginEditCP(rchunk);        rchunk->clearCombiners();    // first combiner: spare0 = dot(col, m1), spare1 = dot(col,m2)               rchunk->setCombinerColors(0, m1, m2);    rchunk->setCombinerRGB( 0,        source,                GL_UNSIGNED_IDENTITY_NV, GL_RGB, // variable A        GL_CONSTANT_COLOR0_NV, GL_EXPAND_NORMAL_NV,     GL_RGB, // variable B        source,                GL_UNSIGNED_IDENTITY_NV, GL_RGB, // variable C        GL_CONSTANT_COLOR1_NV, GL_EXPAND_NORMAL_NV,     GL_RGB, // variable D        GL_SPARE0_NV, GL_SPARE1_NV, GL_DISCARD_NV,   // ABout, CDout, Sumout        GL_NONE, GL_NONE,                            // scale, bias        GL_TRUE, GL_TRUE, GL_FALSE );                // ABdot, CDdot, muxSum    // second combiner: tex0 = dot(col, m3), spare0 = spare0.r           rchunk->setCombinerColors(1, m3, selectR);    rchunk->setCombinerRGB( 1,        source,                GL_UNSIGNED_IDENTITY_NV, GL_RGB, // variable A        GL_CONSTANT_COLOR0_NV, GL_EXPAND_NORMAL_NV,     GL_RGB, // variable B        GL_SPARE0_NV,          GL_UNSIGNED_IDENTITY_NV, GL_RGB, // variable C        GL_CONSTANT_COLOR1_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB, // variable D        GL_TEXTURE0_ARB, GL_SPARE0_NV, GL_DISCARD_NV, // ABout, CDout, Sumout        GL_NONE, GL_NONE,                             // scale, bias        GL_TRUE, GL_FALSE, GL_FALSE );                 // ABdot, CDdot, muxSum    // final combiner         rchunk->setColor0(selectG);    rchunk->setColor1(selectB);        // RGB = D + AB + (1-A)C    rchunk->setFinalCombiner(          GL_CONSTANT_COLOR0_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB, // variable A         GL_SPARE1_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB,            // variable B         GL_E_TIMES_F_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB,       // variable C         GL_SPARE0_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB,          // variable D         GL_CONSTANT_COLOR1_NV, GL_UNSIGNED_IDENTITY_NV, GL_RGB, // variable E         GL_TEXTURE0_ARB, GL_UNSIGNED_IDENTITY_NV, GL_RGB,       // variable F         GL_PRIMARY_COLOR_NV, GL_UNSIGNED_IDENTITY_NV, GL_ALPHA );// variable G    endEditCP(rchunk);}