Game Development Reference
In-Depth Information
In addition, enable Alpha is Transparency and disable Generate Mip Maps ,
as shown in the following screenshot:
Configuring textures for texture painting
Now, we'll need to create a texture-painting script that allows us to paint the brush
texture, using the mouse, onto a 3D object in the scene via its UV coordinates.
The script is shown in the following code sample 9-5:
001 //-----------------------------------------------------------
002 using UnityEngine;
003 using System.Collections;
004 //-----------------------------------------------------------
005 public class TexturePainter : MonoBehaviour
006 {
007 //Square texture with alpha
008 public Texture2D BrushTexture = null;
009
010 //Width and height of destination texture
011 public int SurfaceTextureWidth = 512;
 
Search WWH ::




Custom Search