Game Development Community

Some Basic Material Questions...

by Sebastian H · in Torque Game Engine Advanced · 04/04/2009 (1:19 pm) · 6 replies

Hi. Im new here, and im really happy so far with my TGEA Engine purchase.
I need some help on the material system.

For glas and stuff like that, how would one define partial transparency.
Been trying different aproaches, but i find that setting translucent true
makes everything behind my glas block turn invisible.

#1
04/04/2009 (1:20 pm)
woops, forgot the, please help me line! :)

Any suggestions would be appreciated...

Thx! in advance!
Seb!
#2
04/04/2009 (1:22 pm)
A standard glass material:
use png with alpha

new Material(glassmat)
{
   mapTo = "glass";
   baseTex[0] = "~/data/shapes/glass";
   translucent = true;
   translucentBlendOp = LerpAlpha;
   translucentZWrite = false;
};
#3
04/08/2009 (4:00 am)
thx... im going to check it out and see what happens!

:)
Seb!
#4
04/08/2009 (9:50 am)
you can add some reflection for your glass:

cubemap data from client/commonMaterialData.cs
I only copied the water sky ref map for test.

new CubemapData( staticRefmap )
{
   cubeFace[0] = "~/data/water/sky_x_pos3";
   cubeFace[1] = "~/data/water/sky_x_neg3";
   cubeFace[2] = "~/data/water/sky_y_pos3";
   cubeFace[3] = "~/data/water/sky_y_neg3";
   cubeFace[4] = "~/data/water/sky_z_pos3";
   cubeFace[5] = "~/data/water/sky_z_neg";
};

and the material:

new Material(glassmat)  
{  
   mapTo = "glass";  
   baseTex[0] = "~/data/shapes/glass";  
   translucent = true;  
   translucentBlendOp = LerpAlpha;  
   translucentZWrite = false;  
   cubemap = staticRefmap;
};
#5
04/11/2009 (12:57 am)
Thx Marton.
Im not at the pc right now, so i'll have to check it out when i get home... thx for your help man!

Seb.
#6
04/11/2009 (1:19 am)
Hey, actually had time to try it out just quick,
and yeah thats perfect, im gonna tweak around with it and see what i can make...

Thanks for the help!

Seb