Decals (footprints, bullet holes, etc...)

Started by
0 comments, last by snake5 14 years, 3 months ago
I'm looking for tutorials or ideas on how to do this. So far I haven't found anything good. I want to add footprints to the sand on my terrain, bullet holes to walls, etc... For the terrain I'm using the alpha channel of the texture to hold a value of how well the footprint would appear. Since the terrain is always solid. So it would not appear at all on rock and would be very clear on sand. Since the alpha fades as the textures fade together the footprints will fade as you move from one surface to another. My problem is I'm not sure how to actually render the footprints. Same goes for bullet holes, craters, etc... I'm developing the app in XNA but DX or even OGL tutorials that showed how to do this would be helpfull to.
------------------------------Piggies, I need more piggies![pig][pig][pig][pig][pig][pig]------------------------------Do not invoke the wrath of the Irken elite. [flaming]
Advertisement
If you need to make a decal:
-find the triangles which intersect the projector (the triangles which would show up in the screen if you drew the scene with the projector's matrices)
-copy and clip them
-generate new texcoords, push the original texcoords to another slot
If you need to render that decal:
-set the decal texture as the first texture and the terrain texture (which contains the other alpha channel)
multiply both alphas either using the texture stage states or in the shader

Remember that you have many texture slots / texcoord channels that you can use for many things. ;)

This topic is closed to new replies.

Advertisement