fanvanzh / 3dtiles

The fastest tools for 3dtiles convert in the world!
Apache License 2.0
1.97k stars 594 forks source link

转换成b3dm后使用draco压缩无法显示 #221

Open r-hummingbird opened 2 years ago

r-hummingbird commented 2 years ago

使用3dtiles转化出的b3dm经过draco压缩后无法进行展示,提示 CesiumWidget.js?1343:688 An error occurred while rendering. Rendering has stopped. TypeError: Cannot read property 'replace' of undefined TypeError: Cannot read property 'replace' of undefined at Object.ModelUtility.modifyShaderForDracoQuantizedAttributes (webpack-internal:///./node_modules/cesium/Source/Scene/ModelUtility.js:706:56) at modifyShaderForQuantizedAttributes (webpack-internal:///./node_modules/cesium/Source/Scene/Model.js:2469:74) at createResources (webpack-internal:///./node_modules/cesium/Source/Scene/Model.js:4234:25) at Model.update (webpack-internal:///./node_modules/cesium/Source/Scene/Model.js:5441:9) at Batched3DModel3DTileContent.update (webpack-internal:///./node_modules/cesium/Source/Scene/Batched3DModel3DTileContent.js:480:9) at Cesium3DTile.process (webpack-internal:///./node_modules/cesium/Source/Scene/Cesium3DTile.js:1951:17) at processTiles (webpack-internal:///./node_modules/cesium/Source/Scene/Cesium3DTileset.js:2335:14) at Cesium3DTileset.prePassesUpdate (webpack-internal:///./node_modules/cesium/Source/Scene/Cesium3DTileset.js:2197:3) at PrimitiveCollection.prePassesUpdate (webpack-internal:///./node_modules/cesium/Source/Scene/PrimitiveCollection.js:398:17) at prePassesUpdate (webpack-internal:///./node_modules/cesium/Source/Scene/Scene.js:3788:14)

使用cesiumlab转换的b3dm可以压缩并且展示,不知道是哪里出了问题

fanvanzh commented 2 years ago

什么对象有个 replace 属性? 好像不是 b3dm 里的内容,感觉像 tileset.json 里的

r-hummingbird commented 2 years ago

tileset.json 在经过draco压缩的时候不会改变,draco针对的是b3dm中的glb,但是经过3dtiles转换后的b3dm使用draco压缩后会报错,cesiumlab转换后的好像没有,relace这个是cesium在解码压缩的时候进行的 if (!Object(_Core_defined_js__WEBPACK_IMPORTED_MODULE_5__["default"])(quantizedUniforms[decodeUniformVarName])) { var newMain = "gltfdecoded" + attributeSemantic; var decodedAttributeVarName = attributeVarName.replace( "a_", "gltf_adec" ); 就是这一段的replace可能是attributeVarName得不到 ![Uploading 1647570711(1).png…]() 我也不知道为什么会这样

Lshanny commented 2 years ago

请教下b3dm使用draco压缩的方法?谢谢

r-hummingbird commented 2 years ago

请教下b3dm使用draco压缩的方法?谢谢

可以看我的仓库,compress压缩,但是还有bug最近我没时间修改,最好是使用ceiumlab转换的3dtiles,因为我还没对osgb转换做处理

Lshanny commented 2 years ago

感谢!