Sign in to follow this  
jad_salloum

making a hole in the wall

Recommended Posts

hi guys i am trying to make hole when a bullet hits wall or any thing such as car , ground , and anything so what i was thinking about is 2 things : 1- to get the texture pixel at which the bullet hits the wall and change the color of the texture pixels around the hit gradually from dark to lighter. 2- to render texture of the bullet to texture of the wall on the point of hitting . can anybody advice me which way to use and give some hint how to apply it ?? thanks in advance

Share this post


Link to post
Share on other sites
Changing the texture could be a problem, especially if the texture is used in other places or you wrap around, repeat the texture etc. For example if you hit a car and change the texture all other cars' textures will also be changed.

Adding a quad with a bullet texture above the place the bullet hit is a pretty standard way to do it. This is called decals, you can also do stuff like actually create a hole, like mentioned in the article 3D Decals (the article uses OpenGL, but if you know the basics of the stencil buffer you should have no trouble following, even if you don't use OpenGL). If you want more information search google for decals.

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