- Home /
Question by
Wesley_Yeo · Mar 17, 2015 at 02:04 PM ·
graphicsoptimizationprogramming
How to use additionalVertexStreams?
Hi, having problems using the new additionVertexStreams, it doesnt seem to be sending any data down to my surface shaders, pretty sure my shaders are working. Here is a snippet of my code.
MeshFilter mf = GetComponent<MeshFilter>();
if(mf != null){
Vector2 [] testUV = new Vector2[mf.sharedMesh.vertexCount];
for(int i = 0; i < mf.sharedMesh.vertexCount; ++i){
testUV[i] = new Vector2(1.0f, 1.0f);
}
//mf.mesh.uv3 = testUV;
testRenderer = GetComponent<MeshRenderer>();
Mesh testMesh = new Mesh();
testMesh.vertices = mf.sharedMesh.vertices;
testMesh.uv3 = testUV;
testRenderer.additionalVertexStreams = testMesh;
}
currently displaying the UVs as color to confirm data values, displays correct values when I uncomment mf.mesh.uv3, but nothing appears when it is commented which means data is not being sent down with the additional vertex streams. would be great if anyone can point me in the right direction.
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Would learning some GLSL help with Unity Shading? 1 Answer
Canvas UI Draw Calls 0 Answers
Is it possible to calculate batch count of each material ? 0 Answers