Game Development Community

Edited: Weirdness with transparency (Resolved)

by Mitovo · in Torque 3D Beginner · 05/30/2011 (2:05 pm) · 7 replies

This post was originally an issue with getting transparency to work on PNGs.

Issue's been resolved per a reminder to check the settings in the material editor that didn't seem to be having an effect initially.

#1
05/30/2011 (2:18 pm)
I can answer your transperancy problem.

You need a material.cs file.

new Material(shrub) // Give your material a unique name
{
   diffuseMap[0] = "shrub"; // Name of your png/dds

   translucent = true;
   translucentBlendOp = LerpAlpha;
   translucentZWrite = true;
   alphaRef = 20;
};
Place the material.cs file in the same folder as your texture.
#2
05/30/2011 (4:03 pm)
Actually, playing around 5 minutes with the material editor would result in a material of that description, I dont think that would be the problem(?)
#3
05/30/2011 (4:31 pm)
Quote:
Actually, playing around 5 minutes with the material editor would result in a material of that description, I dont think that would be the problem(?)

It looks like he is using TGEA which does not have a material editor.

Mike, Torque 3D is a vast improvement in usability of the engine, like adding the GUI Material Editor, greatly increases development time. I think that most people can relate to TGEA being difficult out of the box. Torque 3D eases that transition.
#4
05/30/2011 (4:46 pm)
Hey guys...

Thanks for the replies, even given the nature of my post.

That was posted in complete frustration because, frankly, in many ways I *love* this engine. I just can never seem to get anywhere with it lol. It's like sitting behind the wheel of a sweet car, turning on the ignition, and it doesn't want to get into gear, and you can't figure out why.

I used to attribute a lot of the headaches to the fact that GG worked pretty much exclusively with proprietary formats (DIF, DTS, etc). But in this case, it's a very common and pretty much universally supported format. My concern is that if it has trouble dealing with PNG files that even the cheapest, simplest applications can handle just fine... what other headaches is it going to cause? In all, the asset pipeline for the Torque line of engines has always been its weakest aspect, in my experience.

Anyway!

In this case, I'm actually using the T3D demo (am/was intending to buy a full license in the next week or two). I gave up on TGEA since I've been told that it's pretty much "defunct".

I suppose I could try using another format, though I'm really partial to PNG. Maybe DDS?
#5
05/30/2011 (5:26 pm)
I tried everything again from scratch. This time I tried saving as 8-bit, 24-bit and 32-bit for the PNG. The only difference I have now from before is the transparent spots are solid black instead of solid white.

And just in case anyone thinks I'm nuts...

Here's a compilation of images showing the tree in Blender, Wings3D and in T3D. Same model. Same texture images. Nothing is different.

img.photobucket.com/albums/v634/Lupine73/T3DTransparencyProblem.png
#6
05/30/2011 (5:31 pm)
Perhaps reading the documentation on using the Material Editor and playing with it's various (realtime updating) settings for transparency would help.
#7
05/30/2011 (5:41 pm)
Okay... well now it's working.

I'd checked the docs the first time and set everything (Transparency on the Advanced (all layers) section), and that didn't make any difference the first time. I'd made sure to save the materials after making the changes, etc...

In fact, I saw those settings the first time and thought "a ha! That's the problem". Except it wasn't, and I kept getting the white in place of the transparency with streaks of green from the leaves.

Anyway...

This time it did. So I got it working. Thankfully lol. Hopefully it'll work consistently from here on out.

Thanks for the feedback again all :). Much appreciated.