Sign in to follow this  
avianRR

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

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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. ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this