Hi,
Enabling water in Scorched3D causes corruption of all textures and I have tracked it down to interaction between glPopAttrib() and the attributes GL_TEXTURE_GEN_S & GL_TEXTURE_GEN_T.
I using the latest CVS updates of Xorg, Mesa, and r300_driver.

Simplified code from draw() in WaterMap.cpp:
glPushAttrib(GL_TEXTURE_BIT);
        GLState currentState(GLState::TEXTURE_ON | GLState::BLEND_ON);
        waterTexture_->draw();

        glEnable(GL_TEXTURE_GEN_S);
        glEnable(GL_TEXTURE_GEN_T);
        glEnable(GL_TEXTURE_GEN_R);
        glTexGenf(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
        glTexGenf(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
        glTexGenf(GL_R, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);

        // Draw the water
        surround_.draw();
        drawWater();
glPopAttrib();


If I disable GL_TEXTURE_GEN_S & GL_TEXTURE_GEN_T before glPopAttrib() I get no texture corruption. If I remove glPushAttrib() & glPopAttrib() I get no corruption, and of cause doesn't look right.

Are there an easy way to track GL calls down through the layers?


Rune Petersen


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to