Yeah .. thanks Jason .. some food for thought there ... like you I'm definitely going to have to come up with something because this is a bit of a show stopper at the moment.
I've done some reading up on alpha channels and it would seem that 24 bit picture formats that support a full alpha channel provide 8 bits 0 = transparent to 255 = opaque. The shades in between representing degrees of transparency.
The DarkDGK help documentation shows the transparency function as being:
void dbSetObjectTransparency ( int iObject, bool bFlag )
which would imply that it can be either on or off.
Well documentation is not exactly their strong point
as we all know that there are various modes and the second parameter controls this. Mode 4 is generally regarded as the recommended transparency setting for trees which I have found to be true from experimenting, however, that screws up my alpha blended textures.
Looking at the DBPro help for this command revealed the following documentation on the modes:
0 - draw first no alpha
1 - draw first with alpha masking
2 and 3 - draw second which overlaps solid geometry
4 - draw second alpha test (only render beyond 0x000000CF alpha values)
5 - water line object (separates depth sort automatically)
6 - combination of 3 and 4 (second phase render with alpha blend AND alpha test, used for fading LOD
leaves)
The reason for my problem seems apparent, mode 4 only renders pixels which have an alpha setting greater than 207 which is getting pretty far up the scale to opaque, hence unable to render more subtle graduations of texture blends.
Mode 6 would seem to be tailor made but I can confirm that it behaves no differently from mode 4, at least in my situation.
The other modes 1,2,3 and 5 do all allow some degree of alpha blending (looks well nicer in 3D World Studio though) but suffer from the other problem of having a fringe transparency effect in which it seems to display the texture or colour of the object beneath the terrain. So in the case of trees where you are looking through a large number of leaves towards a terrain it actually looks as if the terrain is transparent and you are seeing what ever is behind it. This does not seem to occur with brush limbs, only terrain.
I have included two example screen dumps to illustrate this.
By the way, for anyone new to using foliage and transparency in GDK, mode 4 and 6 although giving the best rendition of leaves and foliage close up do not employ any kind of LOD (mipmap) compensation, so as you move away from the object you gradually loose the leaves and the overall appearance of a tree!
Modes 1,2,3 and 5 do use mip mapping and retain the general image of the tree canopy even at distance.
No matter how good your code is, someone will improve on it