Game Development Community

Transparency problem with milkshpae

by Laurent Pavet · in Torque Game Engine · 05/29/2002 (7:54 am) · 15 replies

Until now I have exported all the DoP models from milkshape to dts without any trouble, but for my now famous "hole rocket", I need some translucency texture for the "hole" by itself.
I have read carefully the documentation of the milkshape2dts exporter and I think that I have done the texture the right way, but I don't see any translucency effect in game.
Could you help me to solve this problem?

I have make a .PNG file with an alpha channel for the model. (I have done an alpha channel the same way for our contrail's particules, so I know that the alpha work)

#1
05/29/2002 (9:11 am)
This resource should help ya!
#2
05/29/2002 (10:18 am)
I have read this also, but it don't work.

Do you manage to use an alpha channel this way ?
If you manage so, could you post a simple ms3d model (a box for exemple)with an alpha channel?
#3
05/29/2002 (9:04 pm)
Here's a simple box together with texture and output DTS.

Note that these later instructions for working with MS3D and transparency only apply if you have built the latest HEAD version of the exporter.
#4
05/30/2002 (12:59 am)
Laurent has the latest HEAD revision of milkshape exporter. I gave him it ;)
#5
06/03/2002 (1:11 am)
Thank you for your fast answer and sorry for my late reply ;)

I have test your box and it works just fine. So I have use the same way as you to create my object, but in doesn't show any transparency ingame.
I also had a message when I set the texture in Milkshape, when I use a PNG with an alpha map.

What tool do you use to create your PNG ?
Personnaly I use Photoshop 6 with the good (I hope) png plugin.

I will try tonight to apply your texure on my model, and my texture to your model.

I hope it will work.

Thx again for your fast answer.
#6
06/03/2002 (8:12 am)
I think that PNG came out of Photoshop 7 using the default PNG plugin. It's the same method as PS6 - the transparency comes from the layers, not a real alpha channel. I don't like it, but oh well.

The message you're getting from Milkshape is very annoying - that's what you get when you apply a 32-bit PNG. The texture WILL be applied though, you just can't see it. What you can do is save a JPEG version of the texture using the same name as the PNG, and apply that in Milkshape. When a shape is loaded in Torque though, your PNG version of a texture will always be loaded instead of the JPEG.

The alternative that I came up with was using TGAs for textures - I added support for that format to Torque. I keep meaning to clean it up and submit it as a patch, but I haven't gotten around to it yet.
#7
06/03/2002 (2:25 pm)
Well I think I have found the trouble.
When I open your texture, on Photoshop 6 there is an alpha map representing the transparency.
I make the same as you with the transparency in Photoshop 6, but then the PNG didn't get the alpha.
I will try to get photoshop 7, and try the TGA thing.

CU
#8
06/03/2002 (5:09 pm)
Here is a link to the WORKING png exporter that will properly save alpha channels. Works in PS6 and PS7, dunno about any earlier versions. Just replace the old one located at:

Adobe/Photoshop/Plug-Ins/Adobe Photoshop Only/File Formats


here it is, copy and paste


http://home.attbi.com/~nefilim.t2maps/Png.8bi
#9
06/03/2002 (5:13 pm)
Dont forget about sorting, in Max there is a SORT: text appended to any translucent surface. You may need something similar in milkshape.

Phil.
#10
06/11/2002 (2:52 am)
Okay I finally make the test with the good version of the exporter and it works.
I don't use the special plug-in, just the photoshop's tranaparency.
Thank you all, for your help.

CU in the air soon. ;)
#11
06/13/2002 (8:46 am)
Quote:Dont forget about sorting, in Max there is a SORT: text appended to any translucent surface. You may need something similar in milkshape.

Phil.

Phil,

Could you expand on this please. I know we've been having problems with the transparency sort order using Milkshape and would like to overcome it. I've also noticed that the transparencies (tree foilage) used in T2 and Realm Wars still have the sort problem. What does the SORT:text do and how could we apply it to milkshape (since there currently isn't one)?
#12
06/13/2002 (11:16 am)
The max exporter has some code for sorting polygons when creating the .dts. The MS3D exporter doesn't. Some enterprising code twiddler could try and port it over from the max source, I suppose.
#13
06/13/2002 (2:33 pm)
All my test are good now, but I've got now trouble in the environemental map !!!!
This one is harder because it's not so easy to see it.
#14
06/13/2002 (3:48 pm)
Tyler, if you apply the name SORT:: before the name of an object with alpha in the dts shape, the engine will pick that up and apply some sorting to the alpha poly's in the shape.

I guess in theory this isnt Max dependant, because its simply the object name. Give it a try in milkshape, simply appent SORT:: to the front of the object name (I think its :: rather than a single :, but to be sure, check the max dts exporter docs from Joe).

Phil.
#15
06/14/2002 (8:18 am)
Thanks Phil, I went through the docs and did a bunch of tests in MS3D. Still nothing. It's definitely the sort order. Our trees fold inside out visually. Thanks for your help. I guess this is a dead issue until someone tackles it.