cocos-engine
cocos-engine copied to clipboard
Runtime GLB File Loading Support for Dynamic 3D Models in Cocos Creator
Use Case
I am currently developing a web-based virtual showroom project that enables users to upload and showcase their 3D Products in GLB (GLTF) format. The virtual showroom provides a platform for users to personalize their space and interact with their 3D models. However, I've encountered a limitation in Cocos Creator, as it does not support the runtime loading of GLB files. This hinders the dynamic and user-driven nature of the virtual showroom, limiting the flexibility for users to seamlessly upload and display their 3D Products.
Problem Description
The main challenge I'm facing is the lack of support for runtime GLB file loading in Cocos Creator. This limitation restricts the real-time customization and dynamic content addition within the virtual showroom. Without the ability to load GLB files at runtime, users are constrained to a predefined set of 3D models, hampering the immersive and personalized experience that the virtual showroom aims to provide.
Proposed Solution
To address this issue, I propose incorporating a runtime GLB file loading feature into Cocos Creator. This enhancement would empower developers to enable users to upload and display their 3D models on-the-fly, enhancing the virtual showroom's interactivity and user engagement. The solution should include an API or workflow that seamlessly integrates with Cocos Creator's existing framework, allowing for the dynamic loading of GLB files during runtime.
How it works
The proposed solution involves extending Cocos Creator's capabilities to support the runtime loading of GLB files. A new API or workflow can be introduced.
const path = 'https://raw.githubusercontent.com/MrZak-dev/MrZak-dev/main/fridge.glb';
assetManager.loadRemote(path, {}, (error, data) => {
// Instantiate the downloaded glb file as a Prefab
node.addChild(data);
});
Alternatives Considered
I have no idea about alternative ways of achieving this.
Additional Information
No response
目前我们做Playable时也是有类似的需求。 我们是把GLB文件在发布后,由客户自己来替换项目中的GLB文件。 比喻:我们有一个跑酷类游戏,角色是一个小男孩,道路上有一些汉堡类道具可以吃。但在客户投放后,觉得这个小男孩不吸引人,想要改成一个魔法师,汉堡改成青蛙。但因为客户拿到的是发布后的项目,无法修改,而我们自然也没有提供替换资源重新打包这种服务,所以目前的办法是只能把这个魔法师和青蛙也一起提前做到游戏当中,然后写一个变量来切换。但这样会导致包体变大,加载时间变长。