Rendering method and system, electronic equipment and computer medium
Patent Information
- Application Number
- CN202280099235.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-25
- Publication Date
- 2025-03-28
AI Technical Summary
Existing 3D simulators lack flexibility in rendering effects and cannot meet the needs of specific scenes. Moreover, the rendering effects are limited, making it difficult to implement efficient distributed simulation and rendering processes.
By parsing the simulation model, converting the CAD model into a format that can be run by the renderer, separating the emulator and renderer, realizing distributed rendering, using dynamic and static object division to reduce computing power requirements, improving rendering efficiency, and saving resources through database storage .
It achieves flexible rendering effects, reduces the computing power requirements of the rendering process, reduces the communication load between devices, increases the synchronization frequency, and meets the needs of a wider range of application scenarios.
Smart Images

Figure CN119731700A_ABST
Abstract
Description
Rendering method, system, electronic device and computer medium Technical Field
[0001] The embodiments of the present application mainly relate to the field of image processing, and in particular to a rendering method, system, electronic device and computer medium. Background Art
[0002] As the foundation of virtual reality, 3D motion simulation is gaining increasing attention and widespread application. Whether in manufacturing, education, the service industry, or public transportation, 3D motion simulation is driving technological development in related fields. As the most crucial component of 3D motion simulation, 3D simulators encompass not only a computing system but also a rendering system, and these two systems are often tightly integrated. However, this approach is not only inflexible, but the rendering effects currently available in nearly all 3D simulators are limited and may not be sufficient for specific scenarios.
[0003] Summary of the Invention
[0004] Embodiments of the present application provide a rendering method, system, and electronic device for conveniently and quickly implementing a distributed simulation process and rendering process.
[0005] In a first aspect, a rendering method is provided, comprising: parsing a first simulation model to obtain a first group of objects in a first scene and their attributes, CAD models corresponding to the first group of objects, an object tree, and operands; wherein the object tree comprises: subordinate relationships between all objects; the operation tree comprises: preset actions for multiple objects among all objects; converting the CAD models corresponding to the first group of objects into a format executable by a first renderer; mapping the first group of objects to a second group of objects; each object in the second group of objects calls the CAD model after format conversion to obtain instances of the second group of objects and a second scene containing instances of the second group of objects; when the simulator performs real-time simulation on the first simulation model, the first renderer renders the second scene.
[0006] In a second aspect, a rendering system is provided, comprising components for executing the steps in the method provided in the first aspect.
[0007] In a third aspect, an electronic device is provided, comprising: at least one memory configured to store computer-readable code; and at least one processor configured to call the computer-readable code and execute each step of the method provided in the first aspect.
[0008] In a fourth aspect, a computer-readable medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor, the processor executes each step in the method provided in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The following figures are intended only to illustrate and explain the embodiments of the present application and are not intended to limit the scope of the embodiments of the present application.
[0010] FIG1 is a flowchart of a rendering method according to an embodiment of the present application;
[0011] FIG2 is a schematic diagram of a rendering system according to an embodiment of the present application;
[0012] FIG3 is a schematic diagram of an electronic device according to an embodiment of the present application.
[0013] Description of Reference Numerals
[0014] 100: Rendering Method 101-105: Method Steps
[0015] 20: Rendering System 21: Emulator 22: Server
[0016] 23: First renderer 300: Electronic device 301: Memory
[0017] 302: Processor DETAILED DESCRIPTION
[0018] The subject matter described herein will now be discussed with reference to example embodiments. It should be understood that discussing these embodiments is merely to enable those skilled in the art to better understand and implement the subject matter described herein, and is not intended to limit the scope of protection, applicability, or examples set forth in the claims. The functions and arrangements of the elements discussed may be changed without departing from the scope of protection of the embodiments of the present application. Various examples may omit, replace, or add various processes or components as needed. For example, the described method may be performed in an order different from the described order, and various steps may be added, omitted, or combined. In addition, the features described relative to some examples may also be combined in other examples.
[0019] As used herein, the term "including" and its variations are open terms meaning "including but not limited to". The term "based on" means "based at least in part on". The terms "one embodiment" and "an embodiment" mean "at least one embodiment". The term "another embodiment" means "at least one other embodiment". The terms "first", "second", etc. may refer to different or the same objects. Other definitions may be included below, whether explicit or implicit. Unless the context clearly indicates otherwise, the definition of a term is consistent throughout the specification.
[0020] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0021] FIG1 is a flowchart of a rendering method according to an embodiment of the present application. As shown in FIG1 , the rendering method 100 includes:
[0022] Step 101: Parse the first simulation model to obtain a first set of objects in the first scene, their attributes, the corresponding CAD models of the first set of objects, an object tree, and operands. The object tree includes the dependencies between all objects. The operation tree includes preset actions for multiple objects in the first set of objects.
[0023] Object attributes include: identity document (ID), name, location, etc. The first group of objects includes all objects in the first scene.
[0024] Alternatively, the preset actions can be related actions in multiple situations. For example, when producing product A, object A performs a first set of actions; when producing product B, object B performs a second set of actions. The preset actions include specific movements, speeds, and directions.
[0025] Step 102: Convert the CAD models corresponding to the first group of objects into a format executable by a first renderer.
[0026] The formats that can be run by the first renderer include: USD format, FBX format or OBJ format.
[0027] Optionally, before step 102, the first group of objects is divided into static objects and dynamic objects. Optionally, the first group of objects can be divided into static objects and dynamic objects based on preset actions of multiple objects in all objects. For example, if the first object, the second object, and the third object in the first group of objects each have a preset action, while the other objects do not, then the objects that have a subordinate relationship with the first object, the second object, or the third object are classified as dynamic objects, and the remaining objects are classified as static objects.
[0028] Step 103: Map the first group of objects to the second group of objects respectively.
[0029] Optionally, the method further includes mapping the ID and name of each object in the first group of objects to a corresponding object in the second group of objects, thereby enabling each object in the second group of objects to be quickly located at the corresponding object in the first group of objects.
[0030] Optionally, the position information of each object in the first group of objects is sent to a corresponding object in the second group of objects to initialize the position of the related objects.
[0031] Optionally, after the first group of objects is divided into static objects and dynamic objects, the object type of each object in the first group of objects is also mapped to a corresponding object in the second group of objects.
[0032] Step 104 : Each object in the second group of objects calls the format-converted CAD model to obtain instances of the second group of objects and a second scene containing the instances of the second group of objects.
[0033] The CAD model in the embodiment of the present application refers to a CAD model file. One object instance corresponds to one CAD model. If there are multiple identical objects in the second group of objects, these identical objects can correspond to one CAD model.
[0034] Step 105 : When the simulator performs real-time simulation on the first simulation model, the first renderer performs rendering on the second scene.
[0035] The embodiment of the present application parses the first simulation model containing the first scene, converts the CAD models corresponding to all the objects therein into a format that can be run by the first renderer, and then calls the converted CAD model for each object in the second group of objects obtained by mapping the first group of objects to instantiate and obtain the second scene that can be run by the first renderer. When real-time simulation is performed on one end of the simulator, the first renderer can perform synchronous rendering for the second scene. The embodiment of the present application realizes the separation of the rendering stage from the simulator side, that is, the simulator side completes the simulation work of the model, and the renderer side completes the synchronous rendering work. Users can conveniently and quickly select a renderer with better visualization quality according to their own needs, and the distributed structure can meet a wider range of application scenarios.
[0036] Optionally, after step 105, the rendered second scene is displayed. When an abnormal object appears in the rendered second scene, the abnormal object is marked.
[0037] In one embodiment, when the simulator performs real-time simulation on the first simulation model, the dynamic rendering engine in the first renderer renders dynamic objects in the second scene in real time, and the static rendering engine in the first renderer renders static objects in the second scene.
[0038] In one embodiment, when the simulator performs real-time simulation on the first simulation model, the first renderer performs real-time rendering on the dynamic objects in the second scene based on the position information of the dynamic objects in the first simulation model. In addition, if the first renderer has completed the rendering of the static objects, when the simulator performs real-time simulation on the first simulation model, the first renderer only needs to perform real-time update rendering on the dynamic objects. The computing power required in the rendering process is greatly reduced by the embodiments of the present application. In addition, compared with the prior art, the first renderer only needs to synchronize the position information of the dynamic objects in the first simulation model in real time to achieve synchronous rendering of the real-time simulation process, which is also conducive to reducing the communication load between devices and further improving the synchronization frequency.
[0039] FIG2 is a schematic diagram of a rendering system 20 according to an embodiment of the present application. As shown in FIG2 , the rendering system 20 includes:
[0040] The simulator 21 is configured to: parse the first simulation model to obtain a first group of objects in the first scene and their attributes, CAD models corresponding to the first group of objects, an object tree, and operands. The object tree includes: subordinate relationships between all objects. The operation tree includes: preset actions for multiple objects in all objects. Convert the CAD models corresponding to the first group of objects into a format executable by the first renderer. Send the converted CAD models to the server 22. Map the first group of objects to a second group of objects in the server 22. Optionally, the object attributes include: ID, name, and location.
[0041] The server 22 is configured to store the first simulation model and send the first simulation model to the simulator 21. Each object in the second group of objects calls the converted CAD model to obtain instances of the second group of objects and a second scene containing the instances of the second group of objects. The second scene is sent to the first renderer.
[0042] The first renderer 23 is configured to render the second scene while the simulator 21 performs real-time simulation on the first simulation model, and optionally display the rendered second scene.
[0043] A distributed system is proposed through the embodiment of the present application, which not only separates the rendering stage from the simulator side, that is, while the simulator side completes the model simulation, the renderer side completes the real-time synchronous rendering work, but also proposes to use the database for data storage in the distributed system, thereby further saving related resources.
[0044] In one embodiment, the simulator 21 is further configured to: divide the first group of objects into static objects and dynamic objects before converting the CAD models corresponding to the first group of objects into a format executable by the first renderer.
[0045] Server 22 includes a dynamic sublayer and a static sublayer. The dynamic sublayer is configured to store dynamic objects in the second group of objects. The static sublayer is configured to store static objects in the second group of objects. By dividing the sublayers into different layers, the slow update speed caused by all being in the same layer can be avoided.
[0046] The first renderer 23 includes a dynamic rendering engine and a static rendering engine. The dynamic rendering engine is configured to render dynamic objects in the second group of objects when the simulator 21 performs real-time simulation on the first simulation model. The static rendering engine is configured to render static objects in the second group of objects when the simulator 21 performs real-time simulation on the first simulation model.
[0047] Optionally, the simulator 21 is further configured to: when the simulator 21 performs real-time simulation on the first simulation model, synchronize the position information of the dynamic objects in the first simulation model with the attributes of the corresponding objects in the dynamic sublayer in the server 22. The first renderer 23 also includes a synchronization module, which is configured to: synchronize the position information of the dynamic objects in the first simulation model through the dynamic sublayer in the server 22.
[0048] In one embodiment, the first renderer 23 is further configured to: when the simulator performs real-time simulation on the first simulation model, perform real-time rendering on the dynamic objects in the second scene according to the position information of the dynamic objects in the first simulation model.
[0049] By separating dynamic objects, the embodiments of the present application significantly reduce the computing power required during the rendering process. Furthermore, compared to existing technologies, the first renderer only needs to synchronize the position information of dynamic objects in the first simulation model in real time to achieve synchronized rendering of the real-time simulation process, which also helps reduce the communication load between devices and further improve the synchronization frequency.
[0050] The present application also provides an electronic device 300. FIG3 is a schematic diagram of electronic device 300 according to an embodiment of the present application. As shown in FIG3 , electronic device 300 includes a processor 302 and a memory 301. Memory 301 stores instructions, wherein the instructions, when executed by processor 302, implement method 100 as described above.
[0051] Among them, at least one processor 302 may include a microprocessor, an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a central processing unit (CPU), a graphics processing unit (GPU), a state machine, etc. Embodiments of computer-readable media include, but are not limited to, floppy disks, CD-ROMs, magnetic disks, memory chips, ROMs, RAMs, ASICs, configured processors, all-optical media, all tapes or other magnetic media, or any other medium from which a computer processor can read instructions. In addition, various other forms of computer-readable media can send or carry instructions to a computer, including routers, private or public networks, or other wired and wireless transmission devices or channels. Instructions may include code in any computer programming language, including C, C++, C language, Visual Basic, Java, and JavaScript.
[0052] In addition, an embodiment of the present application further provides a computer-readable medium having computer-readable instructions stored thereon, and the computer-readable instructions, when executed by the processor, cause the processor to perform the aforementioned rendering method. Embodiments of computer-readable media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROMs, CD-Rs, CD-RWs, DVD-ROMs, DVD-RAMs, DVD-RWs, DVD+RWs), magnetic tapes, non-volatile memory cards, and ROMs. Optionally, computer-readable instructions can be downloaded from a server computer or a cloud via a communication network.
[0053] It should be noted that not all steps and modules in the above processes and system structure diagrams are required, and certain steps or modules can be omitted according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The system structure described in the above embodiments can be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or may be implemented by certain components in multiple independent devices.
Claims
1. A rendering method, comprising: - parsing (101) the first simulation model to obtain a first group of objects in the first scene and their attributes, CAD models corresponding to the first group of objects, an object tree, and operands; wherein the object tree includes: subordinate relationships between all objects; and the operation tree includes: preset actions for multiple objects in all objects; - converting (102) the CAD models corresponding to the first group of objects into a format executable by a first renderer; - mapping (103) the first set of objects to the second set of objects respectively; - Each object in the second group of objects calls (104) the CAD model after format conversion to obtain an instance of the second group of objects and a second scene containing the instance of the second group of objects; -When the simulator performs real-time simulation on the first simulation model, the first renderer performs rendering on the second scene (105).
2. The method according to claim 1, characterized in that - Before converting (102) the CAD models corresponding to the first group of objects into a format executable by the first renderer, the method further comprises: - dividing the first group of objects into static objects and dynamic objects; -When the simulator performs real-time simulation on the first simulation model, the first renderer performs rendering on the second scene (105), including: -When the simulator performs real-time simulation on the first simulation model, the dynamic rendering engine in the first renderer renders the dynamic objects in the second scene in real time, and the static rendering engine in the first renderer renders the static objects in the second scene.
3. The method according to claim 2, characterized in that The dividing the first group of objects into static objects and dynamic objects includes: - According to respective preset actions of multiple objects in all objects, the first group of objects is divided into static objects and dynamic objects.
4. The method according to claim 1, wherein When the simulator performs real-time simulation on the first simulation model, the first renderer performs rendering (105) on the second scene, including: -When the simulator performs real-time simulation on the first simulation model, the first renderer performs real-time rendering on the dynamic objects in the second scene according to the position information of the dynamic objects in the first simulation model.
5. The method according to claim 1, wherein After the first renderer performs rendering on the second scene (105), the method further includes: - Display the rendered second scene; - When an abnormal object appears in the rendered second scene, marking the abnormal object.
6. A rendering system comprising: - Emulator 21, configured to: - parsing the first simulation model to obtain a first group of objects in the first scene and their attributes, CAD models corresponding to the first group of objects, an object tree, and operands; wherein the object tree includes: subordinate relationships between all objects; and the operation tree includes: preset actions for multiple objects among all objects; - converting the CAD models corresponding to the first group of objects into a format that can be run by the first renderer 23; - Sending the format-converted CAD model to the server 22; - mapping the first group of objects to the second group of objects in the server 22 respectively; - The server 22 is configured to: - storing the first simulation model and sending the first simulation model to the simulator 21; - each object in the second group of objects calls the format-converted CAD model to obtain an instance of the second group of objects and a second scene containing the instance of the second group of objects; - sending the second scene to the first renderer 23; The first renderer 23 is configured to: -When the simulator 21 performs real-time simulation on the first simulation model, rendering is performed on the second scene.
7. The system according to claim 6, characterized in that - The simulator 21 is further configured to: - before converting the CAD models corresponding to the first group of objects into a format executable by the first renderer 23, dividing the first group of objects into static objects and dynamic objects; -The server 22 includes a dynamic sublayer and a static sublayer; - the dynamic sublayer is configured to: store dynamic objects in the second group of objects; - the static sublayer is configured to: store static objects in the second group of objects; -The first renderer 23 includes a dynamic rendering engine and a static rendering engine; - the dynamic rendering engine is configured to: render the dynamic objects in the second group of objects when the simulator 21 performs real-time simulation on the first simulation model; The static rendering engine is configured to render static objects in the second group of objects when the simulator 21 performs real-time simulation on the first simulation model.
8. The system according to claim 6, wherein: - The simulator 21 is further configured to: - when the simulator 21 performs real-time simulation on the first simulation model, synchronizing the position information of the dynamic objects in the first simulation model to the attributes of the corresponding objects in the dynamic sublayer in the server 22; The first renderer 23 further includes a synchronization module, which is configured to: - Synchronizing the position information of dynamic objects in the first simulation model through the dynamic sublayer in the server 22.
9. An electronic device, characterized in that: include: at least one memory (301) configured to store computer-readable code; At least one processor (302) is configured to call the computer-readable code to execute the steps in the method according to any one of claims 1 to 5.
10. A computer-readable medium, characterized in that The computer-readable medium stores computer-readable instructions, which, when executed by a processor, cause the processor to perform the steps of the method according to any one of claims 1 to 5.