Menu

Using Alpha Textures

I got a simple demo with alpha textures working, using a PNG with RGBA, PyOpenGL with the Numeric extentions. I'm going to work on making the map render correctly now.

You'll need to install NumPy, PIL, and PyOpenGL to get the demo working. You have to make sure that PyOpenGL compiles with Numeric inside, or else some necessary functions won't show up.
It exposed some problems I didn't anticipate, namely the fact that you have to render in the following sequence.

1) Turn on depth buffering testing, allow writing to the depth buffer, then render all the solid objects.

2) Keep depth testing on, and but turn off writing to the depth buffer, and render all the stuff to be alpha blend from front to back.

This doesn't look too bad. At least the first step is going to be more intensive eventually anyways.

Posted by Jonathan Gardner 2001-08-01

Log in to post a comment.