Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
r-hummingbird opened this issue Mar 17, 2022 · 5 comments
Open

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

r-hummingbird opened this issue Mar 17, 2022 · 5 comments

Comments

@r-hummingbird
Copy link

使用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
Copy link
Owner

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

@r-hummingbird
Copy link
Author

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 = "gltf_decoded_" + attributeSemantic;
var decodedAttributeVarName = attributeVarName.replace(
"a_",
"gltf_a_dec_"
);
就是这一段的replace可能是attributeVarName得不到
Uploading 1647570711(1).png…
我也不知道为什么会这样

@Lshanny
Copy link

Lshanny commented Jul 12, 2022

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

@r-hummingbird
Copy link
Author

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

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

@Lshanny
Copy link

Lshanny commented Jul 12, 2022

感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants