It has been a while since my last post but that does not mean I have not been busy. The last few days I have been updating the rendering routines for transparent objects. They can now be rendered on top of each other without causing wrong drawing order. I have split up the map objects into two lists, opaque and transparent objects. The first list is sorted by texture and rendered using alpha testing. The second list is sorted by its position on the map. OpenGL, or any other 3D API for that matter, can not sort blended objects - no z-buffer information. I use a fairly simple equation to calculate the sorting value:
sortValue=zpos*1000;
sortValue+=xpos;
sortValue+=ypos;
I could take into account the size of the object too but I think this will do for my purposes. This allows for such wonderful things as layering of water tiles with white smoke puffs above and below it: (woho!)
I have also been redesigning the picking routine. It is not finished yet but when it is, it should speed up the picking/selection of objects a great deal. I will not be relying on glReadPixels any more :-)