Game Development Reference
In-Depth Information
The MatScroller class works with any MeshRenderer component
and Quad object. A complete scrolling-texture project can be found in
the topic's companion iles (code bundle).
Attach this script to your Quad object and tweak its scrolling speed to produce the
results you need, as shown in the following screenshot. This will be useful to create
animated sky backgrounds and backgrounds for side-scrolling shooter or platform
games. It can also be useful to create flowing waterfalls and volumetric lighting
when combined with transparency!
Tweaking texture-scrolling fields from the Object Inspector
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.
 
Search WWH ::




Custom Search