Book Image

Mastering Unity Scripting

By : Alan Thorn
Book Image

Mastering Unity Scripting

By: Alan Thorn

Overview of this book

Table of Contents (17 chapters)
Mastering Unity Scripting
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Texture painting


There are many practical scenarios where it's necessary to paint pixels onto textures at runtime. Sometimes, the need itself will be trivial, such as displaying a decal texture (such as a foot print or written message) in front of another surface using alpha transparency. In these cases, you can simply workaround the issue with an alpha cut out plane positioned in front of another plane as the background. However, there are times when your needs are more complex, and you actually need to resort to true texture painting. For example, in a street-fighting game, blood splatters from punches and other attacks will fall to the ground and surrounding scenery, and you want to it remain as part of the environment texture. Another example might be a casual make-up artist game where the gamer must paint blusher or eye shadow onto a face mesh.

Here, you don't simply want to paint textured quads in front of the mesh as separate objects to create the appearance of textured decals. Instead...