A three-dimensional resource progressive loading method, system, device, medium and product
Patent Information
- Application Number
- CN202611168825.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-03
- Publication Date
- 2026-10-13
AI Technical Summary
(1)全量加载策略导致首屏白屏时间过长
通过引入内嵌微型事件总线、绑定渲染配置快照指针并封装监听器的虚根节点,实现了三维资源加载与场景渲染的解耦,避免加载阻塞主线程,保障主场景流畅运行。将三维资源按空间结构拆分为子块并构建异步加载队列,采用网络异步请求与解析生成场景子图,大幅降低了单次加载数据量,提升了网络传输与解析效率。依托微型事件总线分发加载事件并以场景子图为载荷,配合监听器实时捕获挂载,实现子块动态增量加载,减少内存占用。通过回溯渲染生态参数并递归注入网格材质对象、更新标识位,驱动着色器引擎提前重编译材质逻辑,确保子图挂载后可快速适配当前渲染环境,消除画面卡顿、材质异常等问题,进而显著提升了三维场景的加载速度、渲染稳定性与交互流畅度。
Smart Images

Figure CN122903094A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of 3D rendering, and in particular to a method, system, device, medium and product for progressive loading of 3D resources. Background Technology
[0002] With the rise of concepts such as metaverse and digital twins, the scale of web browser-based 3D scene applications (hereinafter referred to as "Web3D applications") is becoming increasingly massive. The 3D model files (such as GLTF / GLB formats) of ultra-large-scale Web3D scenes (such as virtual museums and metaverse exhibition halls) often exceed hundreds of megabytes in size, even reaching gigabyte levels. The relevant loading methods include the following three: (1) The full loading strategy of the official GLTFLoader in Three.js. The community version of GLTFLoader in Three.js (version r150 and earlier) adopts a full synchronous loading strategy. All GLTF sub-resources (including bin buffers, texture maps, and primitive geometry) must be downloaded and parsed before the load event is triggered. During the parsing process, the rendering thread is in a severely blocked state. Taking a museum model containing 100 meshes as an example (total size of about 800MB), even if the network bandwidth reaches 500Mbps, the complete download still takes about 13 seconds. In addition, the blocking time of the main thread of JavaScript parsing (usually 3-8 seconds) means that the user's first screen white screen time can span tens of seconds.
[0003] (2) Google Draco Chunk Loading Scheme. The processing tools provided by Google Draco gltf-pipeline support chunking GLTF models. However, although its chunked output scheme implements chunked downloading at the network layer, after each chunk is loaded, it is directly and crudely added to the scene tree using the scene.add() method, without any inheritance protection mechanism for material properties and environment states. This leads to serious problems such as material loss (especially when the main scene has an envMap set, the Mesh.material.envMap of the new chunk is undefined) and lighting discontinuities (light map not applied, castShadow and other properties missing) when the chunks are loaded later.
[0004] (3) Babylon.js's SceneOptimizer class loading scheme. The Babylon.js engine provides performance optimization through the SceneOptimizer class, but its essence is to degrade the LOD performance of the fully loaded scene, rather than mainly targeting the gradual rendering intervention for the long loading period. In addition, although its AssetsLoader supports multi-task loading, the synchronization of task completion mainly relies on manual polling by the developer's business layer, and lacks a general and automated global rendering property inheritance mechanism at the underlying level.
[0005] In summary, the main shortcomings of the existing technology are as follows: (1) The full loading strategy results in an excessively long white screen time on the first screen. Traditional Web3D applications generally adopt a fully synchronous "download-parse-render" serial process. There is no content output before the model is fully parsed, which causes users to wait for a long time and has a very poor experience.
[0006] (2) Simple block loading triggers the dilemma of "inconsistent rendering". In order to avoid a full white screen, the existing "block asynchronous loading" lacks management of the real-time main rendering attribute state stack. Newly added sub-models cannot automatically obtain key configurations such as environmental reflection and shadow sending and receiving, which eventually leads to abrupt and chaotic "dirty frames" or "visual collapse" phenomena.
[0007] (3) Performance jitter is caused by the decoupling of attribute injection timing from loading progress. Some solutions attempt to supplement attribute repair at the end of loading, but because the loading coroutine and the scene graph refresh cycle are in a concurrent state, it is difficult to time the timing accurately. Not only is it often missed, but the large amount of accumulated material and shader recompilation will directly cause the rendering main thread to stutter and suffer serious frame drops.
[0008] (4) The environment map assignment lacks spatial awareness, and local lighting is prone to failure. Even if there is a design to compensate for the deficiency of ambient light, it is only a global "one-size-fits-all" single EnvMap mapping, ignoring the position of model nodes in three-dimensional space (such as different exhibition rooms in a complex interior). The model obtains unreasonable environmental reflection gloss across lighting areas, which greatly reduces the realism and makes it out of place.
[0009] Therefore, there is an urgent need for a dynamic loading technology that can significantly reduce the first screen response time while ensuring the visual continuity of rendering each sub-slice in the entire scene and isolating the underlying network and rendering pipeline. Summary of the Invention
[0010] The purpose of this application is to provide a method, system, device, medium and product for progressive loading of 3D resources, which can decouple 3D resource loading from scene rendering, avoid loading blocking the main thread and ensure the smooth operation of the main scene.
[0011] To achieve the above objectives, this application provides the following solution: Firstly, this application provides a method for progressive loading of three-dimensional resources, including: Create a virtual root node for the target 3D resource in the scene graph; the virtual root node embeds a micro event bus and is bound to a memory pointer pointing to the main scene rendering configuration snapshot, and encapsulates an event listener; Based on the spatial partitioning structure of the target 3D resource, the target 3D resource is divided into several independently loaded sub-blocks and a background loading queue is constructed. Asynchronous network requests are executed on the sub-blocks in the background loading queue in turn, and scene sub-graphs corresponding to each sub-block are generated. For any sub-block, a specific event is distributed through the micro-event bus within the virtual root node, and the scene subgraph corresponding to the sub-block is attached to the specific event as the event payload; The specific event is captured in real time by the event listener of the virtual root node, the corresponding scene subgraph is extracted from the event payload, and the scene subgraph is dynamically attached to the child node array of the virtual root node. The current rendering ecosystem parameters of the main scene are traced back, and a depth-first recursive traversal is performed on the scene subgraph attached to the virtual root node. The current rendering ecosystem parameters are injected into the material object of the mesh node hit by the traversal, and the identifier of the material object is updated after injection to instruct the underlying shader engine pipeline to recompile the material logic before drawing.
[0012] Secondly, this application provides a three-dimensional resource progressive loading system, comprising: The scene placeholder module is used to create virtual root nodes for target 3D resources in the scene graph; the virtual root node embeds a micro event bus and is bound to a memory pointer pointing to the main scene rendering configuration snapshot, and encapsulates an event listener; The block loading scheduling module is used to divide the target 3D resource into several independently loaded sub-blocks according to the spatial partitioning structure of the target 3D resource and build a background loading queue. The module then executes asynchronous network requests for the sub-blocks in the background loading queue in sequence and parses and generates scene sub-graphs corresponding to each sub-block. The event stream communication module is used to distribute a specific event for any sub-block through the micro-event bus in the virtual root node, and attach the scene subgraph corresponding to the sub-block as the event payload to the specific event; The subgraph mounting module is used to capture the specific event in real time through the event listener of the virtual root node, extract the corresponding scene subgraph from the event payload, and dynamically mount the scene subgraph to the child node array of the virtual root node. The recursive attribute synchronization module is used to backtrack the current rendering ecosystem parameters of the main scene and perform a depth-first recursive traversal of the scene subgraph attached to the virtual root node. The current rendering ecosystem parameters are injected into the material object of the mesh node hit by the traversal, and the identifier of the material object is updated after injection to instruct the underlying shader engine pipeline to recompile the material logic before drawing.
[0013] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described three-dimensional resource progressive loading method.
[0014] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described three-dimensional resource progressive loading method.
[0015] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the above-described three-dimensional resource progressive loading method.
[0016] According to the specific embodiments provided in this application, this application has the following technical effects: By introducing an embedded micro-event bus, binding rendering configuration snapshot pointers, and encapsulating the virtual root node of the listener, the decoupling of 3D resource loading and scene rendering is achieved, avoiding loading blocking the main thread and ensuring smooth operation of the main scene. 3D resources are divided into sub-blocks according to their spatial structure and an asynchronous loading queue is built. Asynchronous network requests and parsing are used to generate scene subgraphs, significantly reducing the amount of data loaded per load and improving network transmission and parsing efficiency. Loading events are distributed via the micro-event bus, using scene subgraphs as payloads, and listeners capture and mount them in real time, enabling dynamic incremental loading of sub-blocks and reducing memory usage. By backtracking rendering ecosystem parameters and recursively injecting mesh material objects and updating flag bits, the shader engine is driven to recompile material logic in advance, ensuring that the subgraph can quickly adapt to the current rendering environment after mounting, eliminating issues such as screen stuttering and material anomalies, thereby significantly improving the loading speed, rendering stability, and interactive smoothness of the 3D scene. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1This is a flowchart illustrating a progressive loading method for three-dimensional resources provided in an embodiment of this application.
[0019] Figure 2 This is a schematic diagram of the recursive attribute synchronization process in one embodiment of this application.
[0020] Figure 3 This is a schematic diagram of the functional modules of a three-dimensional resource progressive loading system provided in an embodiment of this application.
[0021] Figure 4 This is an overall architecture diagram of a three-dimensional resource progressive loading system provided in an embodiment of this application. Detailed Implementation
[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0023] The purpose of this application is to provide a progressive loading method and system for 3D resources in ultra-large-scale Web3D scenes, so as to overcome the technical bottlenecks of existing solutions such as system frame drops, local lighting errors and global state tearing caused by crude block division. It is especially suitable for large-scale 3D interactive application scenarios based on WebGL rendering engine, such as metaverse exhibition halls and virtual exhibition halls.
[0024] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0025] In one exemplary embodiment, such as Figure 1 As shown, a method for progressive loading of three-dimensional resources is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, the method is described using a server as an example, and includes the following steps 101 to 105.
[0026] Step 101: Create a virtual root node for the target 3D resource in the scene graph. The virtual root node embeds a micro event bus and binds a memory pointer to the main scene rendering configuration snapshot, and encapsulates an event listener.
[0027] In a specific application example, a dummy root node object is created in the scene graph before the target 3D resource. This node inherits from the framework THREE.Group or its sibling base class, and is unique in that it embeds a micro event bus and is bound to a memory pointer to a persistent snapshot of the main scene rendering configuration. This dummy root node is immediately added to the rendering engine's frame loop tree for real-time scheduling, but no actual drawing is performed to eliminate conventional waiting. Specifically, the dummy root node is included in the rendering engine's real-time rendering loop even before it contains geometric data.
[0028] Step 102: Based on the spatial partitioning structure of the target 3D resource, the target 3D resource is divided into several independently loaded sub-blocks and a background loading queue is constructed. Asynchronous network requests are executed on the sub-blocks in the background loading queue in sequence, and scene sub-graphs corresponding to each sub-block are generated.
[0029] This application employs a camera frustum culling detection algorithm when constructing the background loading queue, prioritizing the addition of sub-blocks located inside the current camera frustum or whose bounding box volume exceeds a preset judgment threshold to the high-priority loading sequence.
[0030] In a specific application example, step 102 involves dividing the target 3D resource into several independently loaded sub-blocks and constructing a background loading queue based on the spatial partitioning structure of the target 3D resource, including steps 21 to 23.
[0031] Step 21: Based on the spatial partitioning structure of the target 3D resource, the target 3D resource is divided into several independently loaded sub-chunks (Model Blocks, also known as Sub-chunks). A sub-chunk is the smallest physical storage unit after the 3D model has been preprocessed and cut.
[0032] This application targets the most widely used 3D transmission format (GL Transmission Format, GLTF) or its binary encapsulation format (GL Binary, GLB) media, and pre-executes multi-sub-block SubGLTF fragmentation. After deployment to a web environment, it supports asynchronous download monitoring of each sub-fragment with the help of an improved and derived third-party loading driver module (such as extended customized loading callback logic).
[0033] Step 22: Based on the current viewpoint parameters of the camera and the spatial coordinates of each sub-block, perform dynamic weight calculation to determine the spatial perception priority of each sub-block.
[0034] Step 23: Construct a background loading queue arranged according to the spatial awareness priority of each sub-block. The dynamic loading scheduling strategy in this application strictly follows the sequential loading of each sub-block within the background loading queue.
[0035] In a specific application example, step 102 involves sequentially executing asynchronous network requests to the sub-blocks in the background loading queue and parsing to generate scene sub-graphs corresponding to each sub-block, including steps 24 to 25.
[0036] Step 24: Extract sub-blocks sequentially from the background loading queue and distribute them to independent background processing threads. Specifically, the scheduler extracts loading tasks sequentially from the background loading queue and distributes them to independent background processing threads (such as Web Workers), achieving underlying hard isolation between loading and parsing tasks and the main rendering loop. That is, by creating independent background threads using Web Workers, underlying hard isolation is achieved, allowing loading and parsing tasks to be physically thread-isolated from the main rendering loop, without occupying the rendering main thread's time slice.
[0037] Step 25: In the background processing thread, binary stream parsing, geometric data calculation, and scene reconstruction of sub-entities are performed on the sub-blocks to generate corresponding scene subgraphs. Sub-entities are the smallest logical 3D objects such as meshes, components, and parts contained within a single sub-block, and are the basic units for constructing scene subgraphs.
[0038] Specifically, a background independent thread deserializes and parses the GLTF / GLB binary fragmented stream corresponding to the Sub-chunk, reconstructs the parent-child hierarchical topology, geometric mesh data, and material reference relationships of the 3D object, instantiates all internal child entities, and finally generates an autonomous scene subgraph with a complete scene tree hierarchical structure, which is directly passed to the main thread as the event payload carrier.
[0039] Once a scene subgraph is parsed, a loading completion event of type subGltfAdded is dispatched to the main thread via an asynchronous communication mechanism, and the parsed scene subgraph is passed as the event payload.
[0040] The detailed process of subGltfAdded is as follows: ① After the background Web Workers thread completes the parsing of a single Sub-chunk and generates a scene subgraph, it sends a parsing completion notification to the rendering main thread through the browser's postMessage thread communication mechanism; ② After receiving the notification, the main thread initializes and creates a custom subGltfAdded event object by the micro event bus embedded in the virtual root node; ③ The constructed scene subgraph is encapsulated and bound as the unique payload of the event, and dispatched by the micro event bus to complete the cross-thread event stream transmission.
[0041] Step 103: For any sub-block, a specific event is distributed through the micro-event bus within the virtual root node, and the scene subgraph corresponding to the sub-block is attached to the specific event as the event payload.
[0042] This application defines a dedicated 3D sub-resource payload event, which is configured to carry the parsed scene subgraph object as the event payload, and establishes a unique binding relationship between the event type and the parsing task. The event payload and the scene subgraph data payload are from the same source and the same data, differing only in naming; essentially, they are both raw scene subgraph data parsed in the background. The scene subgraph-level structure object in the event payload is pre-constructed in the background Web Workers thread.
[0043] Step 104: Capture the specific event in real time through the event listener of the virtual root node, extract the corresponding scene subgraph from the event payload, and dynamically mount the scene subgraph to the child node array of the virtual root node.
[0044] In a specific application example, a resident listener registered on the virtual root node first intercepts the `subGltfAdded` event with a payload in real time, triggering callback logic and switching the processing flow back to the main rendering sequence. Then, the callback logic extracts a reference to the pre-processed scene subgraph from the event payload. The scene subgraph is an autonomous 3D object tree with a complete parent-child hierarchical structure, pre-constructed in a background processing thread based on the logical definition of the sub-blocks. Finally, the rendering engine's node mounting interface is called to directly link the root node of the scene subgraph as a child of the virtual root node, thus merging the pre-constructed subgraph hierarchy into the main scene rendering tree without blocking the rendering loop.
[0045] This application endows the virtual root node with event dispatch capabilities and maintains an event listener mapping table internally for specific loading tasks, constructing it as a miniature event bus center at the scene layer level. Existing browser and engine native persistent listeners can only capture general native events and cannot directly achieve the stripping and precise extraction of 3D scene subgraph objects. This application customizes and encapsulates event listeners within the virtual root node, overloads event callback logic, and achieves targeted stripping, parsing, and extraction of objects within the event payload.
[0046] Whenever the background processing thread completes the parsing of a sub-block and returns the data, the main thread logic does not directly modify the scene tree. Instead, it uses the virtual root node as the distribution target and throws the event payload to the upper layer logic, thereby establishing a precise signal transmission link from the asynchronous loading layer to the rendering mounting layer.
[0047] Step 105: Backtrack the current rendering ecosystem parameters of the main scene, and perform a depth-first recursive traversal of the scene subgraph mounted to the virtual root node. Inject the current rendering ecosystem parameters into the material object of the mesh node hit by the traversal, and update the identifier bit of the material object after injection to instruct the underlying shader engine pipeline to recompile the material logic before drawing.
[0048] Specifically, after the event listener is triggered, an atomic sampling task targeting the main scene rendering environment is immediately initiated. By accessing the global scene manager or tracing upwards to the root node of the scene rendering tree, the current rendering ecosystem parameters of the main scene are extracted in real time. The extracted real-time parameters are then encapsulated into a read-only attribute state snapshot, which serves as the logical benchmark for subsequent recursive synchronous injection operations.
[0049] The method for extracting the current rendering ecosystem parameters of the main scene is as follows: the engine scene tracing method is adopted. By tracing the global scene root node of the WebGL / Three.js rendering engine, the built-in configuration interface of the scene manager is called to traverse layer by layer to read the core ecosystem data such as the global renderer parameters, environment map configuration, lighting rules, and shadow projection status of the current frame. The real-time state is locked in the atomic instantaneous sampling method to avoid interference from changes in rendering parameters between frames.
[0050] The current rendering ecosystem parameters include environmental context data, lighting physics rules, and shadow projection criteria. Environmental context data includes: the currently active global or local environment reflection map (EnvMap) reference and its intensity coefficient. Lighting physics rules include: the intensity multiplier, exposure bias, and material lighting calculation mode of the global / local lightmap (LightMap). Shadow projection criteria include: the enabled state of cast shadow and receive shadow currently being performed by the renderer.
[0051] In a specific application example, the injection of environment reflection map instance attributes for mesh nodes employs a bounding box matching detection strategy based on the world coordinate system. Step 105 injects the current rendering ecosystem parameters into the material object of the traversed mesh nodes, including steps 51 to 53.
[0052] Step 51: Obtain the global world coordinates of the grid node when the traversal is triggered.
[0053] Step 52: Perform intersection operation detection on the global spatial world coordinates of the mesh node and the axis-aligned bounding box group to which the preset multi-point environment map probe belongs, and take the probe map source that includes the coordinates and has the closest spatial distance to the center point as the environment reflection map of the mesh node that is traversed and hit.
[0054] Step 53: Inject the environment reflection map into the material object of the mesh node.
[0055] This application addresses the shortcomings of traditional single global reflection map settings, which often result in localized distortions. When injecting ambient light into nodes, it employs an "AABB Bounding Box algorithm." This involves reserving a database of location information for all environment map probes in the system and calculating the 3D world coordinates of the geometric center of the newly introduced mesh. Using this information, the bounding boxes emitted by surrounding probes are intersected to select the nearest neighboring probe bounding box. This specific map is then assigned to the material object instead of using a global map, thereby giving the model a precisely matched sense of lighting and physics.
[0056] In a specific application example, during the material logic recompilation process, a batch processing smooth distribution strategy is adopted for control. Within a single frame rendering duration, only a preset number of mesh nodes are allowed to perform injection and recompilation flag activation, and the processing actions of excess nodes are deferred. Specifically, the processing actions of excess nodes are deferred to the next stage, or even to multiple consecutive frame calculation slots.
[0057] Specifically, the rendering pipeline shader array batch processing smoothing method (spreading recompilation overhead) is used. If a large number of nodes flood in during a single frame, triggering attribute updates and a massive number of needsUpdate switches, the underlying massive shaders will be required to be recompiled synchronously, which can easily lead to main rendering thread blocking or severe frame drops. This application sets up a batch processing scheduling mechanism: using the aforementioned source code budget pool design, each single frame refresh period is limited to no more than N (e.g., N=3) unit-scale mesh nodes to enable injection, allow recompilation, and the remaining amount is placed in a cache queue and delayed until subsequent rendering frames, thereby effectively spreading the shader compilation overhead, preventing main thread blocking, and ensuring the smoothness of animation rendering.
[0058] This application focuses on performing a depth-first topology traversal of the scene subgraph that has just entered the main storyline. For each encountered mesh node, the following steps are executed: Standard rendering properties contained in the atomically sampled and encapsulated main scene rendering ecosystem snapshot are injected and overwritten with the original material object configuration. The shadow logic markers of the node skeleton dimension are updated and the overall view is synchronized. When ambient light or underlying mapping resource replacement is involved, the `needsUpdate` boolean lock of the target material object is immediately forced to `true`. This instructs the pipeline of underlying rendering engines such as WebGL to discard the old shader program before the next Render Call, and promptly compile and generate GPU-side control metacode adapted to the new mapping rules, thereby breaking down the barriers to state effectiveness.
[0059] This application iteratively executes steps 102 to 105 as described above until all sub-blocks are exhausted, thus ending the progressive loading long-term flow.
[0060] The key concept of this application lies in discovering that the technical root cause of the "visual abrupt change" and "severe frame drops" after asynchronous chunk loading is the decoupling of the underlying network loading coroutine from the main primitive rendering thread. This causes the subsequently loaded chunk objects to be unable to perceive and keep up with the global rendering configuration updates of the main scene in real time. This application uses the collaborative and interconnected technologies of "virtual root node + event bus + recursive traversal + batch processing" to solve the aforementioned root problem.
[0061] Specifically, asynchronous communication locks are coordinated based on virtual root nodes: virtual root nodes not only serve as bounding box placeholders for the scene graph, but also as the only legal "cross-boundary connection bridge" between the loading thread and the rendering thread. By embedding a micro-event bus internally, the two independent threads can communicate in a highly decoupled manner based on a unified event triggering semantic (subGltfAdded), eliminating mutex lock blocking caused by asynchronous loading directly modifying the scene graph from the source.
[0062] The organic combination of event flow mechanism and attribute snapshot: The callback timing of specific event flows constitutes the best and only legal trigger point for capturing the "real-time rendering state snapshot of the main scene". It ensures that even if the main scene undergoes a light change (such as switching from day to night) while waiting for loading, the rendering state snapshot traced back when the sub-graph is connected is absolutely consistent and up-to-date.
[0063] Coordination between recursive traversal and shader lifecycle: After obtaining an accurate state snapshot of the subgraph, the "depth-first recursive traversal" for it is not purely for writing properties, but rather serves as a unified scheduling throttle, centrally and forcibly taking over the shader recompilation control of all rendered objects in this batch (setting needsUpdate), thereby supporting subsequent batch processing optimizations.
[0064] This interconnected integration of technologies breaks the uncontrollable parallel timing of conventional dynamic loading, forming an automated closed-loop rendering constraint link of "thread decoupling communication -> absolute state alignment -> rendering pipeline lifecycle takeover", thus ensuring visual consistency of progressive loading of complex 3D scenes with extremely low performance overhead.
[0065] This application first pre-mounts virtual root nodes in the scene graph (scene rendering tree), enabling the rendering engine to immediately begin the rendering loop without waiting for resources to finish loading; then, it constructs a background loading queue and optimizes the loading order by combining spatial bounding boxes and view frustum culling, sequentially downloading and parsing each sub-block into a scene sub-graph via asynchronous network requests. For example... Figure 2As shown, after each subgraph is parsed, a subGltfAdded event is dispatched through the decoupled event bus at the underlying level. Upon receiving the event, the foreground listener mounts the subgraph to the scene tree and reads a snapshot of the main scene's rendering attributes. Through depth-first recursive traversal, it precisely injects local spatial environment textures, shadow states, and other attributes into the subgraph's mesh nodes and forcibly sets the Shader recompile flag for the next frame. This avoids frame drops and eliminates the lack of lighting and visual abrupt changes in objects caused by chunked loading. This application ensures progressive loading speed and continuous rendering across the entire scene, making it particularly suitable for optimizing ultra-large-scale Web3D network applications such as the Metaverse Exhibition Hall.
[0066] The technical effects and comparative test data of the incremental scheme and the traditional full-load scheme of this application are shown in Table 1.
[0067] Table 1 Comparison of Technical Effects Test Data
[0068] In summary, the beneficial effects of this application include at least the following: (1) Significantly reduced the threshold for first-screen response: After abandoning the traditional fully synchronous blocking waiting mechanism, the real-time mounting scheme based on virtual root nodes enables the model to be initially rendered when it is partially loaded, significantly improving the interactive experience of the first screen.
[0069] (2) Rebuilding solid and reliable visual consistency: Through the closed loop of event-driven and recursive attribute synchronization mechanism, the model sub-blocks can obtain complete and correct shader configuration boundaries the moment they are merged into the scene tree. Historical test data shows that abnormal bright blocks or rendering breaks have basically disappeared.
[0070] (3) The blocking coupling between network I / O and the main rendering thread is removed: the soft isolation caused by the microbus event allows the two to proceed smoothly and asynchronously. In particular, the batch processing valve strategy is coordinated to effectively avoid the surge in computing load caused by large-scale centralized recompilation of shaders, thereby keeping the frame rate fluctuation caused by runtime resource injection within a safe threshold and ensuring an immersive spatial experience.
[0071] Based on the same inventive concept, this application also provides a three-dimensional resource progressive loading system for implementing the aforementioned three-dimensional resource progressive loading method. The solution provided by this system is similar to the implementation described in the above method; therefore, the specific limitations in one or more embodiments of the three-dimensional resource progressive loading system provided below can be found in the limitations of the three-dimensional resource progressive loading method described above, and will not be repeated here.
[0072] In one exemplary embodiment, such as Figure 3 and Figure 4As shown, a three-dimensional resource progressive loading system is provided, which includes the following functional modules.
[0073] The scene placeholder module 301 is used to create virtual root nodes for the target 3D resource in the scene graph. The virtual root node embeds a micro event bus and is bound to a memory pointer pointing to the main scene rendering configuration snapshot, and encapsulates an event listener.
[0074] The block loading scheduling module 302 is used to divide the target 3D resource into several independently loaded sub-blocks according to the spatial partitioning structure of the target 3D resource and build a background loading queue, and sequentially execute asynchronous network requests for the sub-blocks in the background loading queue and parse and generate scene sub-graphs corresponding to each sub-block.
[0075] The event stream communication module 303 is used to distribute a specific event for any sub-block through the micro-event bus in the virtual root node, and attach the scene subgraph corresponding to the sub-block as the event payload to the specific event.
[0076] The subgraph mounting module 304 is used to capture the specific event in real time through the event listener of the virtual root node, extract the corresponding scene subgraph from the event payload, and dynamically mount the scene subgraph to the child node array of the virtual root node.
[0077] The recursive attribute synchronization module 305 is used to backtrack the current rendering ecosystem parameters of the main scene and perform a depth-first recursive traversal of the scene subgraph attached to the virtual root node. The current rendering ecosystem parameters are injected into the material object of the mesh node hit by the traversal, and the identifier bit of the material object is updated after injection to instruct the underlying shader engine pipeline to perform material logic recompilation before drawing call.
[0078] Furthermore, the recursive attribute synchronization module is configured with a spatial matching sub-unit based on a spatial bounding box, which is used to obtain the global spatial world coordinates of the mesh node during traversal, perform intersection operation detection based on the coordinates and the axis-aligned bounding box to which the preset multi-point environment map probe belongs, and take the probe map source that includes the coordinates and has the closest measured distance as the environment reflection map of the mesh node.
[0079] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0080] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0081] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0082] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0083] In this application, all actions to acquire signals, information, or data are carried out in compliance with the relevant data protection laws and policies of the country where the location is situated, and with the authorization granted by the owner of the relevant device.
[0084] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0085] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, etc., and are not limited to these.
[0086] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0087] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for progressive loading of three-dimensional resources, characterized in that, include: Create a virtual root node for the target 3D resource in the scene graph; the virtual root node embeds a micro event bus and is bound to a memory pointer pointing to the main scene rendering configuration snapshot, and encapsulates an event listener; Based on the spatial partitioning structure of the target 3D resource, the target 3D resource is divided into several independently loaded sub-blocks and a background loading queue is constructed. Asynchronous network requests are executed on the sub-blocks in the background loading queue in turn, and scene sub-graphs corresponding to each sub-block are generated. For any sub-block, a specific event is distributed through the micro-event bus within the virtual root node, and the scene subgraph corresponding to the sub-block is attached to the specific event as the event payload; The specific event is captured in real time by the event listener of the virtual root node, the corresponding scene subgraph is extracted from the event payload, and the scene subgraph is dynamically attached to the child node array of the virtual root node. The current rendering ecosystem parameters of the main scene are traced back, and a depth-first recursive traversal is performed on the scene subgraph attached to the virtual root node. The current rendering ecosystem parameters are injected into the material object of the mesh node hit by the traversal, and the identifier of the material object is updated after injection to instruct the underlying shader engine pipeline to recompile the material logic before drawing.
2. The method for progressive loading of three-dimensional resources according to claim 1, characterized in that, Based on the spatial partitioning structure of the target 3D resource, the target 3D resource is divided into several independently loaded sub-blocks, and a background loading queue is constructed, including: Based on the spatial partitioning structure of the target 3D resource, the target 3D resource is divided into several independently loaded sub-blocks; Based on the current viewpoint parameters of the camera and the spatial coordinates of each sub-block, dynamic weight calculation is performed to determine the spatial perception priority of each sub-block. Based on the spatial awareness priority of each sub-block, a background loading queue is constructed and arranged according to the spatial awareness priority.
3. The method for progressive loading of three-dimensional resources according to claim 1, characterized in that, Asynchronous network requests are sequentially executed for the sub-blocks in the background loading queue, and scene sub-graphs corresponding to each sub-block are parsed and generated, including: Sub-blocks are extracted sequentially from the background loading queue, and the sub-blocks are distributed to independent background processing threads; In the background processing thread, binary stream parsing, geometric data calculation, and scene reconstruction of the sub-entities are performed on the sub-blocks to generate corresponding scene sub-graphs.
4. The method for progressive loading of three-dimensional resources according to claim 1, characterized in that, The current rendering ecosystem parameters include environmental context data, lighting physics rules, and shadow projection criteria.
5. The method for progressive loading of three-dimensional resources according to claim 1, characterized in that, Inject the current rendering ecosystem parameters into the material object of the mesh nodes that are traversed, including: Get the global world coordinates of the grid node when the traversal is triggered; The global spatial world coordinates of the mesh node are intersected with the axis-aligned bounding box group to which the preset multi-point environment map probe belongs, and the probe map source that includes the coordinates and has the closest spatial distance to the center point is used as the environment reflection map of the mesh node that is traversed and hit. Inject the environment reflection map into the material object of the mesh node.
6. The method for progressive loading of three-dimensional resources according to claim 1, characterized in that, During the material logic recompilation process, a batch processing smooth distribution strategy is adopted for control. Within a single frame rendering time, only a preset number of mesh nodes are allowed to perform injection and recompilation flag activation. The processing of excess nodes is deferred.
7. A three-dimensional resource progressive loading system, applied to the three-dimensional resource progressive loading method according to any one of claims 1-6, characterized in that, The system includes: The scene placeholder module is used to create virtual root nodes for target 3D resources in the scene graph; the virtual root node embeds a micro event bus and is bound to a memory pointer pointing to the main scene rendering configuration snapshot, and encapsulates an event listener; The block loading scheduling module is used to divide the target 3D resource into several independently loaded sub-blocks according to the spatial partitioning structure of the target 3D resource and build a background loading queue. The module then executes asynchronous network requests for the sub-blocks in the background loading queue in sequence and parses and generates scene sub-graphs corresponding to each sub-block. The event stream communication module is used to distribute a specific event for any sub-block through the micro-event bus in the virtual root node, and attach the scene subgraph corresponding to the sub-block as the event payload to the specific event; The subgraph mounting module is used to capture the specific event in real time through the event listener of the virtual root node, extract the corresponding scene subgraph from the event payload, and dynamically mount the scene subgraph to the child node array of the virtual root node. The recursive attribute synchronization module is used to backtrack the current rendering ecosystem parameters of the main scene and perform a depth-first recursive traversal of the scene subgraph attached to the virtual root node. The current rendering ecosystem parameters are injected into the material object of the mesh node hit by the traversal, and the identifier of the material object is updated after injection to instruct the underlying shader engine pipeline to recompile the material logic before drawing.
8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the three-dimensional resource progressive loading method according to any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the progressive loading method for three-dimensional resources as described in any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the progressive loading method for three-dimensional resources as described in any one of claims 1-6.