示例#1
0
文件: geo.go 项目: chsc/g3
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)
	}
}