Overlay Question/Problem

Posted By: CBSection31

Overlay Question/Problem - 08/04/06 23:12

Hello,

I am attempting to create a map entity (WMB file) with partial transparency (textured via a BMP file) using the overlay effect. According to the 3DGS manual, WMB files do support overlay transparency, so I thought that it would be as simple as applying the texture to the model, making a WMB, and importing it into my level.

I created the WMB file and imported it, checked the "Overlay" option for the entity, and then built the level. But when I test the level, the black parts of the texture on the entity are still visible, even though overlay is on.

I first assumed that there was a problem with the texture. So, as a test, I imported the exact texture I used for the entity as a sprite, then built the level and tested it. The sprite worked perfectly, with the proper areas transparent. Yet the same texture does not work with overlay with a WMB file.

Do WMB files not support overlay, as the manual states, or am I doing something wrong? Thanks everyone!
Posted By: Lion_Ts

Re: Overlay Question/Problem - 08/05/06 21:45

Never used that. I'm using models only in my levels.
May be, You have to try 32bit TGA with alpha channel for a transparent entity?
Posted By: CBSection31

Re: Overlay Question/Problem - 08/05/06 23:07

Thanks for the reply. Sadly, I just tried it with a 32-bit TGA and it did not work. If it helps, I could put together a small test file as an example of the problem.
Posted By: Lion_Ts

Re: Overlay Question/Problem - 08/06/06 01:06

Tried too. Had success with overlay=on and DDS (DXT1, ARGB) texture applied to the simple wmb cube.

Posted By: CBSection31

Re: Overlay Question/Problem - 08/06/06 03:28

Forgive my lack of knowledge, but is DDS a file format? I've been using BMPs and TGAs for images. Here are the files I've been using to test: www.upforums.com/test.zip

I created a wmb cube with the texture "test.bmp". The cube's filename is "object.wmb". In the level "test.wmp", I have two versions of the cube. One with overlay on and one with overlay off. They both have the black in them, though. Behind the cubes is the same texture displayed as a sprite with overlay. The overlay works properly on the sprite.

Do I have to use the DDS file format? Thanks again for your time and assistance.
Posted By: Lion_Ts

Re: Overlay Question/Problem - 08/06/06 11:09

Yes, DDS is the file format. I'm using NVidia's plugin for Adobe Photoshop to save in.
May be, I'm doing something wrong too. I tried to save textures in BMP (24bit or 8bit indexed), TGA (24bit or 32bit), DDS (DXT1, DXT3 or DXT5), PCX. Therefore, (You can see it on the sshot) one entity displayed properly (with DDS texture applied), other are not.
Try to play with DDS file format (You have to rename test.jpg to test.dds after download. Download, not open in browser, it isn't jpg! I renamed it to comply rules of ImageCave uploading service): http://usera.imagecave.com/lion_ts/test.jpg
P.S. Apply material to an entity (avoids black outlines):
Code:

material overlayed_block
{
effect = "
texture entSkin1;
technique overlay {
pass P0 {
ZWriteEnable=True;
ZEnable=True;
AlphaBlendEnable=False;
CullMode = none;
Texture[0] = <entSkin1>;
AlphaRef=<200>; //play with it: ~128 or pass this value via mtlskill
AlphaFunc=Greater;
ColorArg1[0] = Texture;
ColorOp[0] = Modulate;
ColorArg2[0] = Diffuse;
}
}
";
}


Posted By: CBSection31

Re: Overlay Question/Problem - 08/07/06 16:45

Okay, I'll give this a try. Thanks!!!
Posted By: Lion_Ts

Re: Overlay Question/Problem - 08/08/06 01:52

You are welcome.
Posted By: CBSection31

Re: Overlay Question/Problem - 08/08/06 17:17

It works great! Even better, this also solved a z-sorting issue I was having with a model. Thanks again.
© 2023 lite-C Forums