Translucent material - what's the secret?
by Andy Hawkins · in Torque Game Engine Advanced · 06/21/2008 (1:17 am) · 10 replies
I have this material which should work but doesn't. How do I make it transparent/translucent? Currently it is just opaque. I have a png with 50% alpha in it. For a test I added the glow at one stage and that didn't work.
Other materials that have normal maps in them even on my buildings work. The only thing I can think maybe the problem is that the object I'm mapping it to is AIFlyingVehicle and it has 3 textures on it, hud, hudUnit and HarrierAv8b. When mapping to difs and static shapes there is no problem.
Other materials that have normal maps in them even on my buildings work. The only thing I can think maybe the problem is that the object I'm mapping it to is AIFlyingVehicle and it has 3 textures on it, hud, hudUnit and HarrierAv8b. When mapping to difs and static shapes there is no problem.
new Material(Hud)
{
mapTo = hud_glass_transparent;
baseTex[0] = "hud_glass_transparent.png";
translucent = true;
translucentBlendOp = LerpAlpha;
//glow[0] = true;
};
#2
06/21/2008 (10:15 am)
I don't know much more as you, because I ask for the same problem this morning and didn't got an aswer. But when you're using an AIFlyingVehicle you're using a normal dts shape I think... And as far as I know it should work on dts shapes...
#3
06/21/2008 (2:11 pm)
Just wanted to tell you that there is a sample on this in the barricade demo. Just download it and see how it works.
#4
How are you creating your PNGs? Photoshop's PNG exporter is flawed, and does not export alpha channels in a way that Torque can use.
06/21/2008 (6:11 pm)
Hi Andy,How are you creating your PNGs? Photoshop's PNG exporter is flawed, and does not export alpha channels in a way that Torque can use.
#5
Also if I am using the PNG's alpha to set the transparency in texture, how do I then set the specularity?
06/21/2008 (8:08 pm)
I'm using GIMP - it appears to be outputting 32 bit png's (8bit alpha)Also if I am using the PNG's alpha to set the transparency in texture, how do I then set the specularity?
#6
I troubleshooted the problem by making a test cube, mapped my glass to it and got it to work. Now I applied the same material to the hud glass and it worked. I delete the test cube, make changes to the hud glass like add scratches and it doesn't change.
I have to apply the changes to the test cube, have it in the scene and then it works on my hud - Wack!
Here's a screenie anyway - polishing all the graphics now
06/21/2008 (10:50 pm)
Man this is wack! Listen to this.I troubleshooted the problem by making a test cube, mapped my glass to it and got it to work. Now I applied the same material to the hud glass and it worked. I delete the test cube, make changes to the hud glass like add scratches and it doesn't change.
I have to apply the changes to the test cube, have it in the scene and then it works on my hud - Wack!
Here's a screenie anyway - polishing all the graphics now
#7
Can you post a step by step solution.
Im not able to get this to work.
I want to have clear material on a DIF,
should work with a PNG right?
07/28/2008 (8:28 pm)
O.k Now Im going crazy.Can you post a step by step solution.
Im not able to get this to work.
I want to have clear material on a DIF,
should work with a PNG right?
#8
1. Your mapTo is the same name of your texture minus the extension (minus .png)
2. Your png has to be 32 bit. If you are using Photoshop either Save For Web and make sure it's 32 bit with transparency, or get the SuperPNG for Photoshop, or use GIMP to export your PNG
Here's mine to test
www.drewfx.com/Torque/glass_test.png
07/28/2008 (10:06 pm)
Here's what I have working for the glass above. The confusion comes from two aspects1. Your mapTo is the same name of your texture minus the extension (minus .png)
2. Your png has to be 32 bit. If you are using Photoshop either Save For Web and make sure it's 32 bit with transparency, or get the SuperPNG for Photoshop, or use GIMP to export your PNG
Here's mine to test
www.drewfx.com/Torque/glass_test.png
new Material(Hud)
{
mapTo = glass_test;
baseTex[0] = "glass_test.png";
translucent = true;
translucentBlendOp = LerpAlpha;
};
#9
Thanks for the link too, im suspicious of my own PNG.
This should work on a DIF object right?
Not just a DTS?
07/29/2008 (5:06 am)
Thanks for the info Andy , It was driving my crazy last night.Thanks for the link too, im suspicious of my own PNG.
This should work on a DIF object right?
Not just a DTS?
#10
07/29/2008 (8:44 am)
I am pretty sure. When I was testing materials I was applying it to a footpath that was a DIF. I believe the principal is that the texture receives the processing regardless of what it is mapped to.
Associate Andy Hawkins
DrewFX