Sign in to follow this  

Question about implementing surface appendants (things like bullet holes etc.)

This topic is 3664 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 all, I have a question about implementing surface appendants (things like bullet holes, scorch marks etc.). Ok, so currently I implement surface appendants as 2-tri textured quads that append at the point of collision and face along the normal vector. This works fine for very small appendants such as bullet holes etc. The problem I am faced with is that if I implement any appendant that is larger than a very small quad (such as a large blast mark) than unconvincing visual problems occur. In theory I would like to have appendants such as blast marks and scorch marks that can easily become relatively large quads due to the size of the appendant. As an example of the problems that occur with having appendants larger than VERY small quads is as follows: Say the point of collision is right at the corner of a wall. The center of the appendant then is right on the edge and the textured quad will be approximately half way floating and dangling in space. For VERY small appendants this is not really a problem since they are so small but for anything even mediocre in size this is unconvincing and visual problems occur. I am wondering if any of you know of a way to properly implement large appendants such as blast marks on polygonal models so that dangling does not occur. Perhaps a way to apply a scorch mark texture map that is blended with the model when rendered? I think that may be a better solution than the oriented quad solution but it would be difficult to calculate proper texture coords I think. Any help on this task would be appreciated. Thank you, Jeremy (grill8)

Share this post


Link to post
Share on other sites
Decals, is their name :)

Often in older games, like Half-Life, sometimes when you shot a rocket at a wall, it'd stick the decal half floating in space.

Not the best effect :P

You can crop the quad to the model.

Or you can draw the decal on the model's texture.

There are probably more ways, but they're the first 2 that spring to mind.

Share this post


Link to post
Share on other sites
Nightcabbage -
Thank you for your advice.

All -
It seems cheesy having floating quads and mapping the decal to the geometry seems unnecessarily complicated and likely inefficient....so....blending a decal with the model's diffuse texture might be a good solution. Does anybody know a good way to do this? I could probably figure it out but if somebody knows a good way to do this it would save a lot of time.

Thanks, Jeremy (grill8)

Share this post


Link to post
Share on other sites
Determine the range of the uv coordinates you want the texture to cover, then use uv scaling and offsets to transform that range to the [0,1] range. Draw the geometry using these uv coordinates and the decal. Make the edges of the decal transparent and clamp the texture (as opposed to wrapping it).

For example, say you determine that the scorch mark should approximately cover the rectangular patch whose min and max uv coordinates are (.2,.5) and (.4,.6). You want to transform the range [.2,.4] in the u dimension to [0,1], so subtract .2 from the u values and then multiply by 5 (or multiply by 5 then subtract 1). Similiarly subtract .5 from the v values and multiply by 10. Now the patch you want to texture has uv coordinates (0,0) to (1,1), and coordinates outside that area will be clamped to the border which should be transparent.

The only tricky thing left is figuring out what uv range the decal should cover. Once that's done the hardware handles the low level mapping of the decal to the geometry.

Share this post


Link to post
Share on other sites

This topic is 3664 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.

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