Revision ae71f169
Added by Leszek Koltunski over 1 year ago
src/main/java/org/distorted/library/mesh/MeshBase.java | ||
---|---|---|
811 | 811 |
|
812 | 812 |
int index1 = mVBO1.createImmediatelyFloat(mNumVertices*VERT1_SIZE, mVertAttribs1); |
813 | 813 |
int index2 = mVBO2.createImmediatelyFloat(mNumVertices*VERT2_SIZE, mVertAttribs2); |
814 |
int[] attr = program.mAttribute; |
|
814 | 815 |
|
815 | 816 |
GLES30.glBindBuffer(GLES30.GL_ARRAY_BUFFER, index1 ); |
816 |
GLES30.glVertexAttribPointer(program.mAttribute[0], POS_DATA_SIZE, GLES30.GL_FLOAT, false, VERT1_SIZE, OFFSET_POS);
|
|
817 |
GLES30.glVertexAttribPointer(program.mAttribute[1], NOR_DATA_SIZE, GLES30.GL_FLOAT, false, VERT1_SIZE, OFFSET_NOR);
|
|
817 |
GLES30.glVertexAttribPointer(attr[0], POS_DATA_SIZE, GLES30.GL_FLOAT, false, VERT1_SIZE, OFFSET_POS);
|
|
818 |
GLES30.glVertexAttribPointer(attr[1], NOR_DATA_SIZE, GLES30.GL_FLOAT, false, VERT1_SIZE, OFFSET_NOR);
|
|
818 | 819 |
GLES30.glBindBuffer(GLES30.GL_ARRAY_BUFFER, index2 ); |
819 |
GLES30.glVertexAttribPointer(program.mAttribute[2], TEX_DATA_SIZE, GLES30.GL_FLOAT, false, VERT2_SIZE, OFFSET_TEX); |
|
820 |
GLES30.glVertexAttribPointer(program.mAttribute[3], COM_DATA_SIZE, GLES30.GL_FLOAT, false, VERT2_SIZE, OFFSET_COM); |
|
820 |
GLES30.glVertexAttribPointer(attr[2], TEX_DATA_SIZE, GLES30.GL_FLOAT, false, VERT2_SIZE, OFFSET_TEX); |
|
821 |
|
|
822 |
// if we are not using component centers and there are no vertex effects enabled, |
|
823 |
// then this attribute does not exist in the Vertex Shader |
|
824 |
if( attr.length>=4 ) |
|
825 |
{ |
|
826 |
GLES30.glVertexAttribPointer(attr[3], COM_DATA_SIZE, GLES30.GL_FLOAT, false, VERT2_SIZE, OFFSET_COM); |
|
827 |
} |
|
828 |
|
|
821 | 829 |
GLES30.glBindBuffer(GLES30.GL_ARRAY_BUFFER, 0); |
822 | 830 |
} |
823 | 831 |
|
Also available in: Unified diff
Finally fix the reason foor 'incorrect vertex attribute' message spamming the Log of the Emulator.