@Override public void glVertexAttribDivisor (int index, int divisor) { GL33.glVertexAttribDivisor(index, divisor); }
@Override public void glVertexAttribDivisor (int index, int divisor) { GL33.glVertexAttribDivisor(index, divisor); }
@Override public void glVertexAttribDivisor (int index, int divisor) { GL33.glVertexAttribDivisor(index, divisor); }
@Override public void glVertexAttribDivisor (int index, int divisor) { GL33.glVertexAttribDivisor(index, divisor); }
@Override public void glVertexAttribDivisor (int index, int divisor) { GL33.glVertexAttribDivisor(index, divisor); }
@Override public void glVertexAttribDivisor(int index, int divisor) { GL33.glVertexAttribDivisor(index, divisor); }
@Override public void glVertexAttribDivisor (int index, int divisor) { GL33.glVertexAttribDivisor(index, divisor); }
stride, offset); GL33.glVertexAttribDivisor(box_index.intValue(), divisor); return Unit.unit();
stride, offset); GL33.glVertexAttribDivisor(box_index.intValue(), divisor); return Unit.unit();
stride, off); GL33.glVertexAttribDivisor(box_index.intValue(), divisor); return Unit.unit();
for (int i = 0; i < 4; i++) { glVertexAttribPointer(start, 4, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); start++; strideStart += VECTOR4F_SIZE_BYTES; glVertexAttribDivisor(start, 1); start++; strideStart += VECTOR4F_SIZE_BYTES; glVertexAttribDivisor(start, 1); strideStart += FLOAT_SIZE_BYTES * 2; start++; glVertexAttribDivisor(start, 1); start++;
for (int i = 0; i < 4; i++) { glVertexAttribPointer(start, 4, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); start++; strideStart += VECTOR4F_SIZE_BYTES; glVertexAttribDivisor(start, 1); start++; strideStart += VECTOR4F_SIZE_BYTES; glVertexAttribDivisor(start, 1); strideStart += FLOAT_SIZE_BYTES * 2; start++; glVertexAttribDivisor(start, 1); start++;
public InstancedMesh(float[] positions, float[] textCoords, float[] normals, int[] indices, int numInstances) { super(positions, textCoords, normals, indices, createEmptyIntArray(MAX_WEIGHTS * positions.length / 3, 0), createEmptyFloatArray(MAX_WEIGHTS * positions.length / 3, 0)); this.numInstances = numInstances; glBindVertexArray(vaoId); instanceDataVBO = glGenBuffers(); vboIdList.add(instanceDataVBO); instanceDataBuffer = MemoryUtil.memAllocFloat(numInstances * INSTANCE_SIZE_FLOATS); glBindBuffer(GL_ARRAY_BUFFER, instanceDataVBO); int start = 5; int strideStart = 0; // Model matrix for (int i = 0; i < 4; i++) { glVertexAttribPointer(start, 4, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); start++; strideStart += VECTOR4F_SIZE_BYTES; } // Texture offsets glVertexAttribPointer(start, 2, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); strideStart += FLOAT_SIZE_BYTES * 2; start++; // Selected or Scaling (for particles) glVertexAttribPointer(start, 1, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); start++; glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); }
public InstancedMesh(float[] positions, float[] textCoords, float[] normals, int[] indices, int numInstances) { super(positions, textCoords, normals, indices, createEmptyIntArray(MAX_WEIGHTS * positions.length / 3, 0), createEmptyFloatArray(MAX_WEIGHTS * positions.length / 3, 0)); this.numInstances = numInstances; glBindVertexArray(vaoId); instanceDataVBO = glGenBuffers(); vboIdList.add(instanceDataVBO); instanceDataBuffer = MemoryUtil.memAllocFloat(numInstances * INSTANCE_SIZE_FLOATS); glBindBuffer(GL_ARRAY_BUFFER, instanceDataVBO); int start = 5; int strideStart = 0; // Model matrix for (int i = 0; i < 4; i++) { glVertexAttribPointer(start, 4, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); start++; strideStart += VECTOR4F_SIZE_BYTES; } // Texture offsets glVertexAttribPointer(start, 2, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); strideStart += FLOAT_SIZE_BYTES * 2; start++; // Selected or Scaling (for particles) glVertexAttribPointer(start, 1, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); start++; glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); }
public InstancedMesh(float[] positions, float[] textCoords, float[] normals, int[] indices, int numInstances) { super(positions, textCoords, normals, indices, createEmptyIntArray(MAX_WEIGHTS * positions.length / 3, 0), createEmptyFloatArray(MAX_WEIGHTS * positions.length / 3, 0)); this.numInstances = numInstances; glBindVertexArray(vaoId); // Model View Matrix instanceDataVBO = glGenBuffers(); vboIdList.add(instanceDataVBO); instanceDataBuffer = MemoryUtil.memAllocFloat(numInstances * INSTANCE_SIZE_FLOATS); glBindBuffer(GL_ARRAY_BUFFER, instanceDataVBO); int start = 5; int strideStart = 0; for (int i = 0; i < 4; i++) { glVertexAttribPointer(start, 4, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); start++; strideStart += VECTOR4F_SIZE_BYTES; } // Light view matrix for (int i = 0; i < 4; i++) { glVertexAttribPointer(start, 4, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); start++; strideStart += VECTOR4F_SIZE_BYTES; } // Texture offsets glVertexAttribPointer(start, 2, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); }
public InstancedMesh(float[] positions, float[] textCoords, float[] normals, int[] indices, int numInstances) { super(positions, textCoords, normals, indices, createEmptyIntArray(MAX_WEIGHTS * positions.length / 3, 0), createEmptyFloatArray(MAX_WEIGHTS * positions.length / 3, 0)); this.numInstances = numInstances; glBindVertexArray(vaoId); instanceDataVBO = glGenBuffers(); vboIdList.add(instanceDataVBO); instanceDataBuffer = MemoryUtil.memAllocFloat(numInstances * INSTANCE_SIZE_FLOATS); glBindBuffer(GL_ARRAY_BUFFER, instanceDataVBO); int start = 5; int strideStart = 0; // Model matrix for (int i = 0; i < 4; i++) { glVertexAttribPointer(start, 4, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); start++; strideStart += VECTOR4F_SIZE_BYTES; } // Texture offsets glVertexAttribPointer(start, 2, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); strideStart += FLOAT_SIZE_BYTES * 2; start++; // Selected or Scaling (for particles) glVertexAttribPointer(start, 1, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); start++; glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); }
public InstancedMesh(float[] positions, float[] textCoords, float[] normals, int[] indices, int numInstances) { super(positions, textCoords, normals, indices, createEmptyIntArray(MAX_WEIGHTS * positions.length / 3, 0), createEmptyFloatArray(MAX_WEIGHTS * positions.length / 3, 0)); this.numInstances = numInstances; glBindVertexArray(vaoId); // Model View Matrix instanceDataVBO = glGenBuffers(); vboIdList.add(instanceDataVBO); instanceDataBuffer = MemoryUtil.memAllocFloat(numInstances * INSTANCE_SIZE_FLOATS); glBindBuffer(GL_ARRAY_BUFFER, instanceDataVBO); int start = 5; int strideStart = 0; for (int i = 0; i < 4; i++) { glVertexAttribPointer(start, 4, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); start++; strideStart += VECTOR4F_SIZE_BYTES; } // Light view matrix for (int i = 0; i < 4; i++) { glVertexAttribPointer(start, 4, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); start++; strideStart += VECTOR4F_SIZE_BYTES; } // Texture offsets glVertexAttribPointer(start, 2, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); }
public InstancedMesh(float[] positions, float[] textCoords, float[] normals, int[] indices, int numInstances) { super(positions, textCoords, normals, indices, createEmptyIntArray(MAX_WEIGHTS * positions.length / 3, 0), createEmptyFloatArray(MAX_WEIGHTS * positions.length / 3, 0)); this.numInstances = numInstances; glBindVertexArray(vaoId); instanceDataVBO = glGenBuffers(); vboIdList.add(instanceDataVBO); instanceDataBuffer = MemoryUtil.memAllocFloat(numInstances * INSTANCE_SIZE_FLOATS); glBindBuffer(GL_ARRAY_BUFFER, instanceDataVBO); int start = 5; int strideStart = 0; // Model matrix for (int i = 0; i < 4; i++) { glVertexAttribPointer(start, 4, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); start++; strideStart += VECTOR4F_SIZE_BYTES; } // Texture offsets glVertexAttribPointer(start, 2, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); strideStart += FLOAT_SIZE_BYTES * 2; start++; // Selected or Scaling (for particles) glVertexAttribPointer(start, 1, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); start++; glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); }
public InstancedMesh(float[] positions, float[] textCoords, float[] normals, int[] indices, int numInstances) { super(positions, textCoords, normals, indices, createEmptyIntArray(MAX_WEIGHTS * positions.length / 3, 0), createEmptyFloatArray(MAX_WEIGHTS * positions.length / 3, 0)); this.numInstances = numInstances; glBindVertexArray(vaoId); // Model View Matrix instanceDataVBO = glGenBuffers(); vboIdList.add(instanceDataVBO); instanceDataBuffer = MemoryUtil.memAllocFloat(numInstances * INSTANCE_SIZE_FLOATS); glBindBuffer(GL_ARRAY_BUFFER, instanceDataVBO); int start = 5; int strideStart = 0; for (int i = 0; i < 4; i++) { glVertexAttribPointer(start, 4, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); start++; strideStart += VECTOR4F_SIZE_BYTES; } // Light view matrix for (int i = 0; i < 4; i++) { glVertexAttribPointer(start, 4, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); start++; strideStart += VECTOR4F_SIZE_BYTES; } // Texture offsets glVertexAttribPointer(start, 2, GL_FLOAT, false, INSTANCE_SIZE_BYTES, strideStart); glVertexAttribDivisor(start, 1); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); }
public InstancedMesh(float[] positions, float[] textCoords, float[] normals, int[] indices, int numInstances) { super(positions, textCoords, normals, indices, createEmptyIntArray(MAX_WEIGHTS * positions.length / 3, 0), createEmptyFloatArray(MAX_WEIGHTS * positions.length / 3, 0)); this.numInstances = numInstances; glBindVertexArray(vaoId); // Model View Matrix modelViewVBO = glGenBuffers(); vboIdList.add(modelViewVBO); this.modelViewBuffer = MemoryUtil.memAllocFloat(numInstances * MATRIX_SIZE_FLOATS); glBindBuffer(GL_ARRAY_BUFFER, modelViewVBO); int start = 5; for (int i = 0; i < 4; i++) { glVertexAttribPointer(start, 4, GL_FLOAT, false, MATRIX_SIZE_BYTES, i * VECTOR4F_SIZE_BYTES); glVertexAttribDivisor(start, 1); start++; } // Light view matrix modelLightViewVBO = glGenBuffers(); vboIdList.add(modelLightViewVBO); this.modelLightViewBuffer = MemoryUtil.memAllocFloat(numInstances * MATRIX_SIZE_FLOATS); glBindBuffer(GL_ARRAY_BUFFER, modelLightViewVBO); for (int i = 0; i < 4; i++) { glVertexAttribPointer(start, 4, GL_FLOAT, false, MATRIX_SIZE_BYTES, i * VECTOR4F_SIZE_BYTES); glVertexAttribDivisor(start, 1); start++; } glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); }