Jump to content
  • Advertisement
Sign in to follow this  
grill8

Questions about how to do decals (blast marks etc.) in a game engine.

This topic is 3173 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

Hello, I have questions about how to do decals (blast marks etc.) in a game engine. Basically I need to have bullet holes, blast marks, blood splatters etc. happen in real time and am having difficulties finding information on the subject on the internet. The decals need to be mapped to more than one triangle/plane etc. for example, wrapped around an arbitrary mesh (terrain/model etc.) and not just the mapping of a quad to a plane. Mapping a blast mark to an arbitrary mesh becomes complicated. The only solution I can come up with on my own right now is to: 1) Determine what object(s) collide with a sphere representing the blast radius at the time of collision. This could also be a cube for footprints etc. Basically a geometric region in the world that could affect the decal. 2) Then, render the object(s) that that geometric shape collides with to a depth buffer from the point of view of the trajectory of the missile (or as needed) at the time of collision backed up by ... say ... a predefined depth. 3) Use this depth buffer to construct a fine mesh of triangles/uv coordinates etc. using the depths from the depth buffer for their depths/vertex positions. These should be offset to avoid z fighting. 4) Render decal meshs AFTER rendering the objects in the scene. I cannot find information on this ANYWHERE. If anyone has information on this or links to tutorials I would greatly appreciate it. Jeremy

Share this post


Link to post
Share on other sites
Advertisement
Check out this article: How to Project Decals. It describes the basic procedure for determining which meshes intersect the decal and computing the proper texture coordinates. Then you just re-render the new decal mesh over the world.

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!