• Register
Post news RSS Blood...Dracula would be proud of...

Something I've been working on: Added Blood to the game!

Posted by on

One tech thing I've had on the back-burner for a while was adding a better decal method to the burns.

I spent the last week or so trying a few different methods, and I think I’ve settled on the final tech.

Here’s a little info on the technique. I have a decal renderer object and what it does is raycast in a certain direction. Now if there is a contact Unity allows you to get back the uv coords at that point. What I’ve done is map out a flowing uv map onto the second uv channel and then the raycast will tell me where on that uv the hit was. I then rotate and scale the burn/blood texture into that second uv map. And finally a composite shader overlays the uv2 mapped burn textures onto the original texture.

The result is burns that hug the geometry.

One of my favourite benefits of doing the burns/blood this way is that I can leave a ton of burns/blood all over the battlefield for the whole match with basically no performance hits. Since the only real performance hit is when you Blit the texture into the final texture.

This means the longer your matches go on. The more carnage will be all over the place.

Let me know what you think about it!

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.