Program: 70892
Project: 70892
Buggy source:
private void createVBOs(GL3 gl,RenderObject robj,float pointRadius){
  positionPutter=PositionBufferPutter.createDefault();
  normalPutter=NormalBufferPutter.createDefault();
  colorPutter=ColorBufferPutter.createDefault();
  texturePutter=TextureCoordBufferPutter.createDefault();
  final int POSITION_BYTES=positionPutter.bytesPerPosition();
  final int NORMAL_BYTES=normalPutter.bytesPerNormal();
  final int COLOR_BYTES=colorPutter.bytesPerColor();
  final int TEXTURE_BYTES=texturePutter.bytesPerTextureCoord();
  positionInfo=createAttributeInfoArrays(robj.numPositionSets());
  normalInfo=createAttributeInfoArrays(robj.numNormalSets());
  colorInfo=createAttributeInfoArrays(robj.numColorSets());
  textureInfo=createAttributeInfoArrays(robj.numTextureCoordSets());
  pointGroupOffsets=new int[robj.numPointGroups()];
  pointInfo=new AttributeInfo();
  staticVertexSize=0;
  staticMask=0;
  dynamicVertexSize=0;
  dynamicMask=0;
  boolean streaming=robj.isStreaming();
  nVertices=robj.numVertices();
  int numPointsTotal=0;
  for (int pg=0; pg < robj.numPointGroups(); ++pg) {
    pointGroupOffsets[pg]=numPointsTotal;
    numPointsTotal+=robj.numPoints(pg);
  }
  if (robj.hasPositions()) {
    if (!streaming && robj.isPositionsDynamic()) {
      positionInfo[0].offset=dynamicVertexSize;
      dynamicVertexSize+=POSITION_BYTES;
      dynamicMask|=POSITION_FLAG;
    }
 else {
      positionInfo[0].offset=staticVertexSize;
      staticVertexSize+=POSITION_BYTES;
      staticMask|=POSITION_FLAG;
    }
    positionInfo[0].count=numPointsTotal;
    for (int i=1; i < positionInfo.length; ++i) {
      positionInfo[i].offset=(i - 1) * POSITION_BYTES * numPointsTotal;
      positionInfo[i].stride=POSITION_BYTES;
      positionInfo[i].count=numPointsTotal;
    }
  }
  if (robj.hasNormals()) {
    if (!streaming && robj.isNormalsDynamic()) {
      normalInfo[0].offset=dynamicVertexSize;
      dynamicVertexSize+=NORMAL_BYTES;
      dynamicMask|=NORMAL_FLAG;
    }
 else {
      normalInfo[0].offset=staticVertexSize;
      staticVertexSize+=NORMAL_BYTES;
      staticMask|=NORMAL_FLAG;
    }
    normalInfo[0].count=numPointsTotal;
    for (int i=1; i < normalInfo.length; ++i) {
      normalInfo[i].offset=(i - 1) * NORMAL_BYTES * numPointsTotal;
      normalInfo[i].stride=NORMAL_BYTES;
      normalInfo[i].count=numPointsTotal;
    }
  }
  if (robj.hasColors()) {
    if (!streaming && robj.isColorsDynamic()) {
      colorInfo[0].offset=dynamicVertexSize;
      dynamicVertexSize+=COLOR_BYTES;
      dynamicMask|=COLOR_FLAG;
    }
 else {
      colorInfo[0].offset=staticVertexSize;
      staticVertexSize+=COLOR_BYTES;
      staticMask|=COLOR_FLAG;
    }
    colorInfo[0].count=numPointsTotal;
    for (int i=1; i < colorInfo.length; ++i) {
      colorInfo[i].offset=(i - 1) * COLOR_BYTES * numPointsTotal;
      colorInfo[i].stride=COLOR_BYTES;
      colorInfo[i].count=numPointsTotal;
    }
  }
  if (robj.hasTextureCoords()) {
    if (!streaming && robj.isTextureCoordsDynamic()) {
      textureInfo[0].offset=dynamicVertexSize;
      dynamicVertexSize+=TEXTURE_BYTES;
      dynamicMask|=TEXTURE_FLAG;
    }
 else {
      textureInfo[0].offset=staticVertexSize;
      staticVertexSize+=TEXTURE_BYTES;
      staticMask|=TEXTURE_FLAG;
    }
    textureInfo[0].count=numPointsTotal;
    for (int i=1; i < textureInfo.length; ++i) {
      textureInfo[i].offset=(i - 1) * TEXTURE_BYTES * numPointsTotal;
      textureInfo[i].stride=TEXTURE_BYTES;
      textureInfo[i].count=numPointsTotal;
    }
  }
  int staticVBOIdx=0;
  int dynamicVBOIdx=0;
  if (staticVertexSize > 0 && dynamicVertexSize > 0) {
    dynamicVBOIdx=1;
  }
  if (robj.hasPositions()) {
    if (!streaming && robj.isPositionsDynamic()) {
      positionInfo[0].stride=dynamicVertexSize;
      positionInfo[0].vboIndex=dynamicVBOIdx;
    }
 else {
      positionInfo[0].stride=staticVertexSize;
      positionInfo[0].vboIndex=staticVBOIdx;
    }
  }
  if (robj.hasNormals()) {
    if (!streaming && robj.isNormalsDynamic()) {
      normalInfo[0].stride=dynamicVertexSize;
      normalInfo[0].vboIndex=dynamicVBOIdx;
    }
 else {
      normalInfo[0].stride=staticVertexSize;
      normalInfo[0].vboIndex=staticVBOIdx;
    }
  }
  if (robj.hasColors()) {
    if (!streaming && robj.isColorsDynamic()) {
      colorInfo[0].stride=dynamicVertexSize;
      colorInfo[0].vboIndex=dynamicVBOIdx;
    }
 else {
      colorInfo[0].stride=staticVertexSize;
      colorInfo[0].vboIndex=staticVBOIdx;
    }
  }
  if (robj.hasTextureCoords()) {
    if (!streaming && robj.isTextureCoordsDynamic()) {
      textureInfo[0].stride=dynamicVertexSize;
      textureInfo[0].vboIndex=dynamicVBOIdx;
    }
 else {
      textureInfo[0].stride=staticVertexSize;
      textureInfo[0].vboIndex=staticVBOIdx;
    }
  }
  int vboIdx=dynamicVBOIdx + 1;
  if (robj.numPositionSets() > 1) {
    for (int i=1; i < positionInfo.length; ++i) {
      positionInfo[i].vboIndex=vboIdx;
    }
    vboIdx++;
  }
  if (robj.numNormalSets() > 1) {
    for (int i=1; i < normalInfo.length; ++i) {
      normalInfo[i].vboIndex=vboIdx;
    }
    vboIdx++;
  }
  if (robj.numColorSets() > 1) {
    for (int i=1; i < colorInfo.length; ++i) {
      colorInfo[i].vboIndex=vboIdx;
    }
    vboIdx++;
  }
  if (robj.numTextureCoordSets() > 1) {
    for (int i=1; i < textureInfo.length; ++i) {
      textureInfo[i].vboIndex=vboIdx;
    }
    vboIdx++;
  }
  pointInfo.offset=0;
  pointInfo.stride=1 * GLSupport.FLOAT_SIZE;
  pointInfo.count=1;
  pointInfo.vboIndex=vboIdx;
  vboIdx++;
  int nVBOs=vboIdx;
  ByteBuffer[] buffs=new ByteBuffer[nVBOs];
  vboIdx=0;
  if (staticVertexSize > 0) {
    buffs[vboIdx]=ByteBuffer.allocateDirect(numPointsTotal * staticVertexSize);
    buffs[vboIdx].order(ByteOrder.nativeOrder());
    vboIdx++;
  }
  if (!streaming && robj.isDynamic()) {
    buffs[vboIdx]=ByteBuffer.allocateDirect(numPointsTotal * dynamicVertexSize);
    buffs[vboIdx].order(ByteOrder.nativeOrder());
    vboIdx++;
  }
  if (robj.numPositionSets() > 1) {
    buffs[vboIdx]=ByteBuffer.allocateDirect(numPointsTotal * (robj.numPositionSets() - 1) * POSITION_BYTES);
    buffs[vboIdx].order(ByteOrder.nativeOrder());
    vboIdx++;
  }
  if (robj.numNormalSets() > 1) {
    buffs[vboIdx]=ByteBuffer.allocateDirect(numPointsTotal * (robj.numNormalSets() - 1) * NORMAL_BYTES);
    buffs[vboIdx].order(ByteOrder.nativeOrder());
    vboIdx++;
  }
  if (robj.numColorSets() > 1) {
    buffs[vboIdx]=ByteBuffer.allocateDirect(numPointsTotal * (robj.numColorSets() - 1) * COLOR_BYTES);
    buffs[vboIdx].order(ByteOrder.nativeOrder());
    vboIdx++;
  }
  if (robj.numTextureCoordSets() > 1) {
    buffs[vboIdx]=ByteBuffer.allocateDirect(numPointsTotal * (robj.numTextureCoordSets() - 1) * TEXTURE_BYTES);
    buffs[vboIdx].order(ByteOrder.nativeOrder());
    vboIdx++;
  }
  int vidx=0;
  for (int pg=0; pg < robj.numPointGroups(); ++pg) {
    List<int[]> pnts=robj.getPoints(pg);
    for (    int[] pnt : pnts) {
      VertexIndexSet v=robj.getVertex(pnt[0]);
      for (int i=0; i < positionInfo.length; ++i) {
        AttributeInfo ai=positionInfo[i];
        float[] pos=robj.getPosition(i,v.getPositionIndex());
        positionPutter.putPosition(buffs[ai.vboIndex],ai.offset + vidx * ai.stride,pos);
      }
      for (int i=0; i < normalInfo.length; ++i) {
        AttributeInfo ai=normalInfo[i];
        float[] nrm=robj.getNormal(i,v.getNormalIndex());
        normalPutter.putNormal(buffs[ai.vboIndex],ai.offset + vidx * ai.stride,nrm);
      }
      for (int i=0; i < colorInfo.length; ++i) {
        AttributeInfo ai=colorInfo[i];
        byte[] color=robj.getColor(i,v.getColorIndex());
        colorPutter.putColor(buffs[ai.vboIndex],ai.offset + vidx * ai.stride,color);
      }
      for (int i=0; i < textureInfo.length; ++i) {
        AttributeInfo ai=textureInfo[i];
        float[] pos=robj.getTextureCoord(i,v.getTextureCoordIndex());
        texturePutter.putTextureCoord(buffs[ai.vboIndex],ai.offset + vidx * ai.stride,pos);
      }
      vidx++;
    }
  }
  buffs[vboIdx]=ByteBuffer.allocateDirect(1 * GLSupport.FLOAT_SIZE);
  buffs[vboIdx].order(ByteOrder.nativeOrder());
  buffs[vboIdx].putFloat(pointRadius);
  vbos=new BufferObject[nVBOs];
  vboIdx=0;
  if (staticVertexSize > 0) {
    vbos[vboIdx]=new BufferObject(gl);
    buffs[vboIdx].rewind();
    vbos[vboIdx].fill(gl,buffs[vboIdx],GL.GL_ARRAY_BUFFER,getBufferUsage(false,streaming));
    vboIdx++;
  }
  if (!streaming && robj.isDynamic()) {
    vbos[vboIdx]=new BufferObject(gl);
    buffs[vboIdx].rewind();
    vbos[vboIdx].fill(gl,buffs[vboIdx],GL.GL_ARRAY_BUFFER,getBufferUsage(true,streaming));
    vboIdx++;
  }
  if (robj.numPositionSets() > 1) {
    vbos[vboIdx]=new BufferObject(gl);
    buffs[vboIdx].rewind();
    vbos[vboIdx].fill(gl,buffs[vboIdx],GL.GL_ARRAY_BUFFER,getBufferUsage(robj.isPositionsDynamic(),streaming));
    vboIdx++;
  }
  if (robj.numNormalSets() > 1) {
    vbos[vboIdx]=new BufferObject(gl);
    buffs[vboIdx].rewind();
    vbos[vboIdx].fill(gl,buffs[vboIdx],GL.GL_ARRAY_BUFFER,getBufferUsage(robj.isNormalsDynamic(),streaming));
    vboIdx++;
  }
  if (robj.numColorSets() > 1) {
    vbos[vboIdx]=new BufferObject(gl);
    buffs[vboIdx].rewind();
    vbos[vboIdx].fill(gl,buffs[vboIdx],GL.GL_ARRAY_BUFFER,getBufferUsage(robj.isColorsDynamic(),streaming));
    vboIdx++;
  }
  if (robj.numTextureCoordSets() > 1) {
    vbos[vboIdx]=new BufferObject(gl);
    buffs[vboIdx].rewind();
    vbos[vboIdx].fill(gl,buffs[vboIdx],GL.GL_ARRAY_BUFFER,getBufferUsage(robj.isTextureCoordsDynamic(),streaming));
    vboIdx++;
  }
  vbos[vboIdx]=new BufferObject(gl);
  buffs[vboIdx].rewind();
  vbos[vboIdx].fill(gl,buffs[vboIdx],GL.GL_ARRAY_BUFFER,GL.GL_DYNAMIC_DRAW);
  vboIdx++;
}

Fixed version (ground truth):
private void createVBOs(GL3 gl,RenderObject robj,float pointRadius){
  positionPutter=PositionBufferPutter.createDefault();
  normalPutter=NormalBufferPutter.createDefault();
  colorPutter=ColorBufferPutter.createDefault();
  texturePutter=TextureCoordBufferPutter.createDefault();
  final int POSITION_BYTES=positionPutter.bytesPerPosition();
  final int NORMAL_BYTES=normalPutter.bytesPerNormal();
  final int COLOR_BYTES=colorPutter.bytesPerColor();
  final int TEXTURE_BYTES=texturePutter.bytesPerTextureCoord();
  positionInfo=createAttributeInfoArrays(robj.numPositionSets());
  normalInfo=createAttributeInfoArrays(robj.numNormalSets());
  colorInfo=createAttributeInfoArrays(robj.numColorSets());
  textureInfo=createAttributeInfoArrays(robj.numTextureCoordSets());
  pointGroupOffsets=new int[robj.numPointGroups() + 1];
  pointInfo=new AttributeInfo();
  staticVertexSize=0;
  staticMask=0;
  dynamicVertexSize=0;
  dynamicMask=0;
  boolean streaming=robj.isStreaming();
  nVertices=robj.numVertices();
  int numPointsTotal=0;
  for (int pg=0; pg < robj.numPointGroups(); ++pg) {
    pointGroupOffsets[pg]=numPointsTotal;
    numPointsTotal+=robj.numPoints(pg);
  }
  pointGroupOffsets[robj.numPointGroups()]=numPointsTotal;
  if (robj.hasPositions()) {
    if (!streaming && robj.isPositionsDynamic()) {
      positionInfo[0].offset=dynamicVertexSize;
      dynamicVertexSize+=POSITION_BYTES;
      dynamicMask|=POSITION_FLAG;
    }
 else {
      positionInfo[0].offset=staticVertexSize;
      staticVertexSize+=POSITION_BYTES;
      staticMask|=POSITION_FLAG;
    }
    positionInfo[0].count=numPointsTotal;
    for (int i=1; i < positionInfo.length; ++i) {
      positionInfo[i].offset=(i - 1) * POSITION_BYTES * numPointsTotal;
      positionInfo[i].stride=POSITION_BYTES;
      positionInfo[i].count=numPointsTotal;
    }
  }
  if (robj.hasNormals()) {
    if (!streaming && robj.isNormalsDynamic()) {
      normalInfo[0].offset=dynamicVertexSize;
      dynamicVertexSize+=NORMAL_BYTES;
      dynamicMask|=NORMAL_FLAG;
    }
 else {
      normalInfo[0].offset=staticVertexSize;
      staticVertexSize+=NORMAL_BYTES;
      staticMask|=NORMAL_FLAG;
    }
    normalInfo[0].count=numPointsTotal;
    for (int i=1; i < normalInfo.length; ++i) {
      normalInfo[i].offset=(i - 1) * NORMAL_BYTES * numPointsTotal;
      normalInfo[i].stride=NORMAL_BYTES;
      normalInfo[i].count=numPointsTotal;
    }
  }
  if (robj.hasColors()) {
    if (!streaming && robj.isColorsDynamic()) {
      colorInfo[0].offset=dynamicVertexSize;
      dynamicVertexSize+=COLOR_BYTES;
      dynamicMask|=COLOR_FLAG;
    }
 else {
      colorInfo[0].offset=staticVertexSize;
      staticVertexSize+=COLOR_BYTES;
      staticMask|=COLOR_FLAG;
    }
    colorInfo[0].count=numPointsTotal;
    for (int i=1; i < colorInfo.length; ++i) {
      colorInfo[i].offset=(i - 1) * COLOR_BYTES * numPointsTotal;
      colorInfo[i].stride=COLOR_BYTES;
      colorInfo[i].count=numPointsTotal;
    }
  }
  if (robj.hasTextureCoords()) {
    if (!streaming && robj.isTextureCoordsDynamic()) {
      textureInfo[0].offset=dynamicVertexSize;
      dynamicVertexSize+=TEXTURE_BYTES;
      dynamicMask|=TEXTURE_FLAG;
    }
 else {
      textureInfo[0].offset=staticVertexSize;
      staticVertexSize+=TEXTURE_BYTES;
      staticMask|=TEXTURE_FLAG;
    }
    textureInfo[0].count=numPointsTotal;
    for (int i=1; i < textureInfo.length; ++i) {
      textureInfo[i].offset=(i - 1) * TEXTURE_BYTES * numPointsTotal;
      textureInfo[i].stride=TEXTURE_BYTES;
      textureInfo[i].count=numPointsTotal;
    }
  }
  int staticVBOIdx=0;
  int dynamicVBOIdx=0;
  if (staticVertexSize > 0 && dynamicVertexSize > 0) {
    dynamicVBOIdx=1;
  }
  if (robj.hasPositions()) {
    if (!streaming && robj.isPositionsDynamic()) {
      positionInfo[0].stride=dynamicVertexSize;
      positionInfo[0].vboIndex=dynamicVBOIdx;
    }
 else {
      positionInfo[0].stride=staticVertexSize;
      positionInfo[0].vboIndex=staticVBOIdx;
    }
  }
  if (robj.hasNormals()) {
    if (!streaming && robj.isNormalsDynamic()) {
      normalInfo[0].stride=dynamicVertexSize;
      normalInfo[0].vboIndex=dynamicVBOIdx;
    }
 else {
      normalInfo[0].stride=staticVertexSize;
      normalInfo[0].vboIndex=staticVBOIdx;
    }
  }
  if (robj.hasColors()) {
    if (!streaming && robj.isColorsDynamic()) {
      colorInfo[0].stride=dynamicVertexSize;
      colorInfo[0].vboIndex=dynamicVBOIdx;
    }
 else {
      colorInfo[0].stride=staticVertexSize;
      colorInfo[0].vboIndex=staticVBOIdx;
    }
  }
  if (robj.hasTextureCoords()) {
    if (!streaming && robj.isTextureCoordsDynamic()) {
      textureInfo[0].stride=dynamicVertexSize;
      textureInfo[0].vboIndex=dynamicVBOIdx;
    }
 else {
      textureInfo[0].stride=staticVertexSize;
      textureInfo[0].vboIndex=staticVBOIdx;
    }
  }
  int vboIdx=dynamicVBOIdx + 1;
  if (robj.numPositionSets() > 1) {
    for (int i=1; i < positionInfo.length; ++i) {
      positionInfo[i].vboIndex=vboIdx;
    }
    vboIdx++;
  }
  if (robj.numNormalSets() > 1) {
    for (int i=1; i < normalInfo.length; ++i) {
      normalInfo[i].vboIndex=vboIdx;
    }
    vboIdx++;
  }
  if (robj.numColorSets() > 1) {
    for (int i=1; i < colorInfo.length; ++i) {
      colorInfo[i].vboIndex=vboIdx;
    }
    vboIdx++;
  }
  if (robj.numTextureCoordSets() > 1) {
    for (int i=1; i < textureInfo.length; ++i) {
      textureInfo[i].vboIndex=vboIdx;
    }
    vboIdx++;
  }
  pointInfo.offset=0;
  pointInfo.stride=1 * GLSupport.FLOAT_SIZE;
  pointInfo.count=1;
  pointInfo.vboIndex=vboIdx;
  vboIdx++;
  int nVBOs=vboIdx;
  ByteBuffer[] buffs=new ByteBuffer[nVBOs];
  vboIdx=0;
  if (staticVertexSize > 0) {
    buffs[vboIdx]=ByteBuffer.allocateDirect(numPointsTotal * staticVertexSize);
    buffs[vboIdx].order(ByteOrder.nativeOrder());
    vboIdx++;
  }
  if (!streaming && robj.isDynamic()) {
    buffs[vboIdx]=ByteBuffer.allocateDirect(numPointsTotal * dynamicVertexSize);
    buffs[vboIdx].order(ByteOrder.nativeOrder());
    vboIdx++;
  }
  if (robj.numPositionSets() > 1) {
    buffs[vboIdx]=ByteBuffer.allocateDirect(numPointsTotal * (robj.numPositionSets() - 1) * POSITION_BYTES);
    buffs[vboIdx].order(ByteOrder.nativeOrder());
    vboIdx++;
  }
  if (robj.numNormalSets() > 1) {
    buffs[vboIdx]=ByteBuffer.allocateDirect(numPointsTotal * (robj.numNormalSets() - 1) * NORMAL_BYTES);
    buffs[vboIdx].order(ByteOrder.nativeOrder());
    vboIdx++;
  }
  if (robj.numColorSets() > 1) {
    buffs[vboIdx]=ByteBuffer.allocateDirect(numPointsTotal * (robj.numColorSets() - 1) * COLOR_BYTES);
    buffs[vboIdx].order(ByteOrder.nativeOrder());
    vboIdx++;
  }
  if (robj.numTextureCoordSets() > 1) {
    buffs[vboIdx]=ByteBuffer.allocateDirect(numPointsTotal * (robj.numTextureCoordSets() - 1) * TEXTURE_BYTES);
    buffs[vboIdx].order(ByteOrder.nativeOrder());
    vboIdx++;
  }
  int vidx=0;
  for (int pg=0; pg < robj.numPointGroups(); ++pg) {
    List<int[]> pnts=robj.getPoints(pg);
    for (    int[] pnt : pnts) {
      VertexIndexSet v=robj.getVertex(pnt[0]);
      for (int i=0; i < positionInfo.length; ++i) {
        AttributeInfo ai=positionInfo[i];
        float[] pos=robj.getPosition(i,v.getPositionIndex());
        positionPutter.putPosition(buffs[ai.vboIndex],ai.offset + vidx * ai.stride,pos);
      }
      for (int i=0; i < normalInfo.length; ++i) {
        AttributeInfo ai=normalInfo[i];
        float[] nrm=robj.getNormal(i,v.getNormalIndex());
        normalPutter.putNormal(buffs[ai.vboIndex],ai.offset + vidx * ai.stride,nrm);
      }
      for (int i=0; i < colorInfo.length; ++i) {
        AttributeInfo ai=colorInfo[i];
        byte[] color=robj.getColor(i,v.getColorIndex());
        colorPutter.putColor(buffs[ai.vboIndex],ai.offset + vidx * ai.stride,color);
      }
      for (int i=0; i < textureInfo.length; ++i) {
        AttributeInfo ai=textureInfo[i];
        float[] pos=robj.getTextureCoord(i,v.getTextureCoordIndex());
        texturePutter.putTextureCoord(buffs[ai.vboIndex],ai.offset + vidx * ai.stride,pos);
      }
      vidx++;
    }
  }
  buffs[vboIdx]=ByteBuffer.allocateDirect(1 * GLSupport.FLOAT_SIZE);
  buffs[vboIdx].order(ByteOrder.nativeOrder());
  buffs[vboIdx].putFloat(pointRadius);
  vbos=new BufferObject[nVBOs];
  vboIdx=0;
  if (staticVertexSize > 0) {
    vbos[vboIdx]=new BufferObject(gl);
    buffs[vboIdx].rewind();
    vbos[vboIdx].fill(gl,buffs[vboIdx],GL.GL_ARRAY_BUFFER,getBufferUsage(false,streaming));
    vboIdx++;
  }
  if (!streaming && robj.isDynamic()) {
    vbos[vboIdx]=new BufferObject(gl);
    buffs[vboIdx].rewind();
    vbos[vboIdx].fill(gl,buffs[vboIdx],GL.GL_ARRAY_BUFFER,getBufferUsage(true,streaming));
    vboIdx++;
  }
  if (robj.numPositionSets() > 1) {
    vbos[vboIdx]=new BufferObject(gl);
    buffs[vboIdx].rewind();
    vbos[vboIdx].fill(gl,buffs[vboIdx],GL.GL_ARRAY_BUFFER,getBufferUsage(robj.isPositionsDynamic(),streaming));
    vboIdx++;
  }
  if (robj.numNormalSets() > 1) {
    vbos[vboIdx]=new BufferObject(gl);
    buffs[vboIdx].rewind();
    vbos[vboIdx].fill(gl,buffs[vboIdx],GL.GL_ARRAY_BUFFER,getBufferUsage(robj.isNormalsDynamic(),streaming));
    vboIdx++;
  }
  if (robj.numColorSets() > 1) {
    vbos[vboIdx]=new BufferObject(gl);
    buffs[vboIdx].rewind();
    vbos[vboIdx].fill(gl,buffs[vboIdx],GL.GL_ARRAY_BUFFER,getBufferUsage(robj.isColorsDynamic(),streaming));
    vboIdx++;
  }
  if (robj.numTextureCoordSets() > 1) {
    vbos[vboIdx]=new BufferObject(gl);
    buffs[vboIdx].rewind();
    vbos[vboIdx].fill(gl,buffs[vboIdx],GL.GL_ARRAY_BUFFER,getBufferUsage(robj.isTextureCoordsDynamic(),streaming));
    vboIdx++;
  }
  vbos[vboIdx]=new BufferObject(gl);
  buffs[vboIdx].rewind();
  vbos[vboIdx].fill(gl,buffs[vboIdx],GL.GL_ARRAY_BUFFER,GL.GL_DYNAMIC_DRAW);
  vboIdx++;
}