three 优化压缩

GeometryCompressionUtils

来源 import { GeometryCompressionUtils } from './jsm/utils/GeometryCompressionUtils.js'
  • GeometryCompressionUtils.compressPositions(mesh) 压缩法向量
GeometryCompressionUtils.compressPositions(mesh,  'NormEncodingMethods')  // 第二个参数可为 OCT1Byte, CT2Byte, DEFAULT, ANGLES // 压缩法向量
  • 压缩UV映射
GeometryCompressionUtils.compressUvs( mesh );

估算 geometry 内存占有量

来源 import { BufferGeometryUtils } from './jsm/utils/BufferGeometryUtils.js'
BufferGeometryUtils.estimateBytesUsed( mesh.geometry )

 

单位是 bytes
 
三种压缩加起来 内存可以压缩 20%
posted @ 2021-05-20 10:59  随遇丿而安  阅读(258)  评论(0编辑  收藏  举报