func (gm *GeoMipMap) buildLODIndices(dev g3.GraphicsDevice) { gm.lodIndices = make([][]g3.IndexBuffer, numCrackTypes) for i, _ := range gm.lodIndices { gm.lodIndices[i] = make([]g3.IndexBuffer, gm.maxLOD) } indicesChannel := make(chan generatedLODIndices) numMipMaps := createAllLODIndices(gm.maxLOD, indicesChannel) for i := uint(0); i < numMipMaps; i++ { c := <-indicesChannel gm.lodIndices[c.crackIndex][c.lod] = dev.NewIndexBuffer(c.indices) } }