PDA

View Full Version : Sort of sorting probbie with sprites



runggu
06-04-2002, 11:29 PM
I have an sorting problem with sprites, when sprite with bigger z value is drawn AFTER sprite with smaller z value, the sprite with bigger z doesn´t be fully drawn.

http://www.poweronion.cjb.net/poem4.png

dorbie
06-05-2002, 01:55 AM
Even transparent fragments write to the zbuffer. If you can't sort then using alpha testing on fragments can fix problems like yours.

glAphaFunc(GL_GREATER, 0.0f);
glEnable(GL_ALPHA_TEST);

It's good practice to disable it when you're done, but don't enable it and disable it between each tree or anything silly like that.

runggu
06-05-2002, 03:45 AM
wow, thanks