Jump to content
  • Advertisement
Sign in to follow this  
avianRR

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

This topic is 3159 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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. ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!