Game Development Community

Glass shader

by CodingChris · in Torque Game Engine Advanced · 12/30/2007 (2:16 am) · 3 replies

Hi,
I know this should be very easy, but I have to say, I don't know how to do a simple glass material in tgea.... How do you do a transparent material like this?

#1
02/05/2008 (12:00 pm)
Use a Custom Material with RayTracing.
In fragment shader use refract() with an index of refraction 1.52 (glass IOR).
#2
02/06/2009 (4:21 pm)
well when i needed glass i just defined a slightly white material, with a pretty low alpha value, exported it as png,

and then applied it to my mesh

made a custom material, and set trans[pass number] = true;

i think its the command... jsut look in the doc

hope it helps

-tom-
#3
02/06/2009 (8:53 pm)
If you were just trying to take a normal material and make it transparent you'd just set it as Translucent = true; in the material definition and you might want to change the alphablendmode also depending on your material. It should be noted that if your setting translucent then its not a per pass setting, so it wouldn't be translucent[0] = true; it would just be translucent = true;