Game Development Community

Help] Shader decals

by Alex Huck · in Torque Game Engine Advanced · 11/13/2006 (4:38 pm) · 3 replies

I'm trying to implement shaderization to the Decal class. Maybe this is a little bit too far ahead of my experience, I should probably start a lot smaller before trying something this complex (But I think I'm a little over eager at this point, and will try [and probably fail] anyway)

I'm using the "Adding shaders to an arbitrary class" resource as a foundation www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=8835

But I'm having difficulty, namely, I'm not sure how to apply decals to surfaces, is there a console function? If not how would I go about creating one?
I notice DecalData has a image file, so I want to experiment and see if creating a CustomMaterial object mapped to that image would do the job. But I have no way of quickly applying a decal (The only DecalData I see is Footprint in player.cs, and from what I can see the player doesn't leave a footprint at all)

Hopefully if this gets finished it'd make an excellent resource. Usage possibilities are endless:
-Bullet/explosion holes on concrete walls (Using a parallax mapping shader or relief map)
-Transparency (Perhaps a sci-fi gun that shoots on a surface and lets you see through it)
-Mirrors

#1
01/15/2007 (12:07 pm)
Decals are a DTS layer you add them in the 3d model stage as a layer.

Try adding one that way then applying a shader material to it. I have no idea if it would work.

Sorry I know this is old but never hurts to put a note.
#2
01/15/2007 (6:45 pm)
The easiest way to test it would be to turn on footprints (there is a thread documenting that in these forums) and apply a shader to them for testing, or to apply them to your bullets. I did that a while back, and semi-documented it in a thread. For footprints basically the code in in player.cpp now but commented out, you will need to modify it slightly to get them to appear. It's documented in another thread here though.
#3
04/15/2009 (2:57 am)
just create a sgDecalprojector !