Game Development Reference
In-Depth Information
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, you really need to paint
a source texture (such as a brush) onto a destination texture as applied to a mesh.
Here, the painting does not just happen between two independent textures but with
a mesh and its UV mapping intervening between them. In other words, a source
texture must be applied or projected onto a mesh surface in the scene, and then,
the brush pixels must be unprojected back onto the destination texture through the
mesh UV mapping. This ensures that the brush pixels are painted to the correct place
within the destination texture, as shown in the following screenshot. This method,
therefore, allows any source texture of any size to be painted onto any 3D surface
and its destination texture of any size via UV mapping.
In this section, we'll explore how this is achieved practically and effectively. Before
getting started, however, it should be mentioned that texture painting in this way
should be pursued as a last resort when alternative methods (such as cut out quads)
are not adequate. This is because true texture painting is computationally expensive.
Real-time painting of textured brushes onto other textures via a mesh and its UV mapping
A complete texture painting project can be found in the topic's
companion files (code bundle).
 
Search WWH ::




Custom Search