Textures bring your Meshes, Particles, and interfaces to life! They are image or movie files that you lay over or wrap around your objects. As they are so important, they have a lot of properties. If you are reading this for the first time, jump down
1.把纹理载入进OpenGL中 我们的第一个任务就是把一个图像文件的数据载入到一个OpenGL的纹理中. 作为開始.让我们又一次舍弃第二篇的框架.又一次创建一个程序,新建一个util工具包,在该包下创建一个新类TextureHelper,我们将以以下的方法签名開始: public static int loadTexture(Context context,int resourceId){} 这种方法会把Android上下文.和资源ID作为输入參数,并返回载入图像的OpenGL纹理的ID.開始时
创建一个脚本 附加到一个游戏体上 using UnityEngine;using System.Collections; public class ProceduralTexture : MonoBehaviour{#region Public Variables //纹理的宽高 public int widthHeight = 512; //程序生成的纹理 public Texture2D generaterdTexture;#endregion #region Private Variabl