Game Development Community

decals according to texture?

by Brent Brzuchalski · in Torque 3D Professional · 01/30/2010 (2:08 pm) · 2 replies

hi all. ive been messing with the newest torque...pro 1.1 and i was wondering if anyone has any idea how to get different bullet decals on differant things...ie...water spray on water...a hole in metal...a chunk outa bricks etc. thanks a bunch.

#1
02/04/2010 (2:53 pm)
Raycasts return the material you hit, and that's where you'd have to start. Passing this information along when the raycast detects a projectile hit, and using it in the decal placement code to determine which decal to drop.

Then your projectiles would need different decals defined for different states, and you would need an easy way to determine what material each T3D material actually represents. Maybe by naming them in obvious ways, like Mat_Metal_Floor1 or Mat_Wood_Floor1, or by actually having the material datablocks hold a "surface type" value.

This complexity is why it's pretty common to produce "generic" decals for most of the weapons and just go with it. But yeah, it can definitely be done.
#2
02/05/2010 (12:10 am)
hmmm ok sounds like i have some work to do. i like the gears of war tracers and chuncks comein off walls and stuff so who knows mabey ill figure it out. if i get it workin ill post the code. thanks for tellin me where to start!