Game Development Community

A Quick Custom Material question

by Ron Nelson · in Torque Game Engine Advanced · 03/12/2008 (9:22 pm) · 2 replies

Could someone please provide me with an example of bump mapping used in a Custom Material?

Thanks in advance.

#1
03/13/2008 (3:56 am)
Hey Ron,
I don't have any of the code handy but I do know that the TGEA demo has some which uses custom materials like that.
#2
03/16/2008 (1:18 pm)
Ron, use the dot3 bump code:

in fragment shader:

float diffuse_color = lightDirection.z > 0 ? saturate(dot(bump_color, lightDirection)) : 0;

diffuse_color is your diffuse map
bump_color is your bump map