When I was playing around with the bullet holes, something I definitely wanted to do was cause them to fade out over time rather than just disappear immediately. The effect is slow and subtle so won't pull people out of the immersion of the game unlike constantly destroying the texture instantly would. After a bit I research I discovered that textures have an alpha setting along with the RGB settings. Alpha is the transparency of the texture, so in order to get my bullet hole texture to fade I needed to adjust the alpha setting over time. The way I thought of doing this was to use the interpolation mechanic I'd been taught the other week, to slowly adjust the setting from max to 0 over the course of three seconds.
 |
Fading alpha interpolation code |
After figuring all of this out and getting it to work I added it to my prototype scene to show it off.
 |
Bullet hole partially faded |
No comments:
Post a Comment