Alpha transparency for DirectX

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

Alpha transparency for DirectX // Game Development

1  |  

Post by clintonman // Aug 6, 2008, 5:30pm

clintonman
Total Posts: 304
pic
I was playing around with Virtual Earth and discovered how to get transparency with the directX export using directX(direct3d?) material. The trick is that the color shader texture has to be 32 bit with the alpha in the extra 8 bits. When exporting from truespace I got alpha when exporting tga, dds and bmp files. The png file exported seemed to loose the alpha information and comes out as a 24 bit file. The exporter ignores the alpha shader which is where I was trying to get the alpha before.

Post by jamesmc // Aug 6, 2008, 6:25pm

jamesmc
Total Posts: 2566
Yeah, for some reason, there has been an on going feud between Microsoft and PNG format in 32 bit.

Glad you solved which formats to use, will be very helpful in future development. :)

Post by Eagle // Aug 7, 2008, 4:11am

Eagle
Total Posts: 221
pic
this is really good to know! Thanks Clintonman~


Always~

Vickie ;)

Post by TomG // Aug 7, 2008, 5:01am

TomG
Total Posts: 3397
Interesting! I thought transparency wasn't possible in Virtual Earth, going to be checking this out for sure!


Thanks!

Tom

Post by TomG // Oct 24, 2008, 6:39am

TomG
Total Posts: 3397
I can't get this to work repeatably, got it once by accident but never been able to get it back again! Can you share settings, either screen grabs or saved scenes (or a combo of both, to show what settings were used on VE export etc)?


Thanks!

Tom

Post by Délé // Oct 24, 2008, 11:49am

Délé
Total Posts: 1374
pic
Thanks for the info Clinton. It works good for me. :) Attached is a simple DX shader that allows you to see the alpha in tS when using a color map with an alpha channel.

I didn't include a normal map input in the shader because they seem to be useless in VE. I think VE would need to support specular for the normal maps to actually work. Without specular highlights to accentuate the bumps, the normal maps just make the object darker. It doesn't give the illusion of bump like it's supposed to.

I've also been playing around with baking AO into the color maps with 3d Coat. VE lighting is very flat and can wash out objects. So far, the AO baking seems to make a big improvement. Still have to test it more though. The only limitation with baking AO is that you need a single color map. You can't use multiple materials. That might mean using a larger map instead of a few smaller tiled ones. Still, it looks like it might work good in some scenarios. :)

Post by clintonman // Oct 25, 2008, 6:44am

clintonman
Total Posts: 304
pic
I can't get this to work repeatably, got it once by accident but never been able to get it back again! Can you share settings, either screen grabs or saved scenes (or a combo of both, to show what settings were used on VE export etc)?


Thanks!

Tom

I can't add anything to what I already said, except that I was trying to get trees into VE and they didn't look good. From certain angles it looked ok. From other angles the transparency didn't work and it looked aweful. My guess is that VE may have trouble with intersecting planes which is what I was using for the trees.

Post by clintonman // Oct 30, 2008, 6:51am

clintonman
Total Posts: 304
pic
I just finished a test and intersecting planes wasn't the problem. It looks like transparency is single sided in virtual earth. You can see both sides of a face color but only one side transparent.
Also note no transparent shadows limitation.

Post by TomG // Oct 30, 2008, 7:55am

TomG
Total Posts: 3397
Its more complex than that - I had two cubes in an X formation, all faces painted with the same transparent texture. I can see through Cube A, and then through Cube B just fine. But looking through Cube B, I just see the background and see nothing of Cube A as if it was not there. Note that I could see through both sides of both cubes, just that looking through one cube showed the other (and the background through that), and looking through another cube just showed the background or (perhaps tellingly) any non-transparent object in the scene.


I wonder if there is a sort order of some sort that determines transparency?


Tom
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2021. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn