标签:技术 mirror 遇到 tran cin index update border material
public class GpuInstancingTest : MonoBehaviour {
public Mesh mesh;
public Material material;
List<Matrix4x4> matrices = new List<Matrix4x4>();
void Start()
{
if (!material.enableInstancing || !SystemInfo.supportsInstancing)
{
enabled = false;
return;
}
for (int i = 0; i < 10; ++i)
{
Matrix4x4 mt = Matrix4x4.TRS(transform.position + (i * 1.1f) * Vector3.up, transform.rotation, Vector3.one);
matrices.Add(mt);
}
}
// Update is called once per frame
void Update () {
Graphics.DrawMeshInstanced(mesh, 0, material, matrices);
}
}
public class GpuInstancingTest : MonoBehaviour {
public Mesh mesh;
public Material material;
List<Matrix4x4> matrices = new List<Matrix4x4>();
void Start()
{
if (!material.enableInstancing || !SystemInfo.supportsInstancing)
{
enabled = false;
return;
}
for (int i = 0; i < 10; ++i)
{
Matrix4x4 mt = Matrix4x4.TRS(transform.position + (i * 1.1f) * Vector3.up, transform.rotation, Vector3.one);
matrices.Add(mt);
}
}
// Update is called once per frame
void Update () {
Graphics.DrawMeshInstanced(mesh, 0, material, matrices);
}
}
标签:技术 mirror 遇到 tran cin index update border material
原文地址:http://www.cnblogs.com/Hichy/p/7730353.html