Model rendering method, electronic equipment and storage medium
By acquiring and managing model structure data and detecting the existence of target part models, the rendering lag issue caused by downloading part models was resolved, improving rendering speed and quality.
Patent Information
- Application Number
- CN202511170185.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-20
- Publication Date
- 2025-11-07
AI Technical Summary
In modern computer graphics and virtual reality applications, rendering stutters caused by downloading part models result in poor rendering quality.
By acquiring model structure data, the existence of the target part model is detected. If it does not exist, the target part model is downloaded from the server and a mesh component is created. If it exists, the mesh component is copied, and the object to be rendered is rendered based on the mesh component and model structure data.
It reduces the impact of network latency, avoids network congestion caused by repeated downloads, and improves rendering speed and quality.
Smart Images

Figure CN120912752A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a model rendering method, an electronic device and a storage medium. BACKGROUND
[0002] In modern computer graphics and virtual reality applications, the complexity and data volume of 3D models are increasing. A project can be rendered by a whole model assembled by thousands of small models of parts. In the whole model rendering process, a small model is first created for each part, and the small model is stored in a server. When rendering is needed, the small model of each part is downloaded one by one, so as to display the whole model.
[0003] Due to the influence of network speed, equipment and other factors in the downloading process, the rendering process may be stuck, resulting in poor rendering effect. SUMMARY
[0004] The present application provides a model rendering method, an electronic device and a storage medium, to solve the problem of poor rendering effect caused by the sticking of downloading part models in the prior art.
[0005] According to a first aspect of the embodiments of the present application, a model rendering method is provided, comprising:
[0006] Obtaining model structure data required for creating a to-be-rendered object, wherein the model structure data comprises target configuration information of target parts constituting the to-be-rendered object;
[0007] For each target part, detecting whether a target part model corresponding to the target part exists;
[0008] If not, downloading the target part model corresponding to the target part from a server based on the target configuration information, and creating a mesh component of the target part model;
[0009] If it exists, copying the mesh component as a mesh component of the target part;
[0010] Rendering the to-be-rendered object based on the mesh component and the model structure data.
[0011] Optionally, obtaining the model structure data required for creating the to-be-rendered object comprises:
[0012] Creating a hierarchical structure of at least one parent of the to-be-rendered object;
[0013] According to the association relationship between the parts in the to-be-rendered object, determining a target part belonging to a child of the parent;
[0014] Obtaining target configuration information of the target part;
[0015] store the target configuration information of the target part of the sub-level in the corresponding parent-level hierarchy of the target part, to obtain the model structure data.
[0016] Optionally, the target configuration information of the target part comprises:
[0017] determining the target part from a candidate part set and obtaining initial configuration information of the target part;
[0018] obtaining update information of the modification to the initial configuration;
[0019] updating the initial configuration information based on the update information to obtain the target configuration information.
[0020] Optionally, the target configuration information comprises scheduling attribute information of the target part, the scheduling attribute information being used to indicate a download priority of a target part model;
[0021] After obtaining the model structure data required for creating the object to be rendered, the method further comprises:
[0022] determining a target part model set to be downloaded preferentially based on the scheduling attribute information, the target part model set being a set of a first predetermined number of target part models with high priority, and target part models in the target part model set being non-repetitive;
[0023] downloading target part models in the target part model set from the server and creating mesh components of the target part models.
[0024] Optionally, after obtaining the model structure data required for creating the object to be rendered, the method further comprises:
[0025] sending the model structure data to the server, so that the server performs lightweight processing on initial part models corresponding to the target part based on the model structure data.
[0026] Optionally, the process of performing lightweight processing on the initial part models corresponding to the target part based on the model structure data by the server comprises:
[0027] traversing the model structure data to determine whether there is a model resource locator in the model structure data;
[0028] if there is, compressing the initial part models based on a compression rate in the target configuration information, and storing target part models obtained after compression.
[0029] Optionally, before obtaining the model structure data required for creating the object to be rendered, the method further comprises:
[0030] obtain a candidate part model of a candidate part, and configure initial configuration information of the candidate part model, the candidate part including the target part;
[0031] store the candidate part model and the initial configuration information corresponding to each other to the server.
[0032] Optionally, the model structure data includes a parent level and a child level; and the rendering of the object to be rendered based on the mesh component and the model structure data includes:
[0033] perform material merging and / or geometry merging on the mesh components belonging to the same parent level to obtain a merged mesh component;
[0034] invoke a rendering tool to render the merged mesh component.
[0035] According to a second aspect of the embodiments of the present application, a model rendering apparatus is provided, including:
[0036] a obtaining unit configured to obtain model structure data required for creating an object to be rendered, the model structure data including target configuration information of a target part constituting the object to be rendered;
[0037] a detecting unit configured to detect, for each target part, whether a target part model corresponding to the target part exists;
[0038] a downloading unit configured to, if the target part model does not exist, download the target part model corresponding to the target part from a server based on the target configuration information, and create a mesh component of the target part model;
[0039] a copying unit configured to, if the target part model exists, copy the mesh component as a mesh component of the target part;
[0040] a rendering unit configured to render the object to be rendered based on the mesh component and the model structure data.
[0041] According to a third aspect of the embodiments of the present application, an electronic device is provided, including a memory and a processor;
[0042] the memory is connected with the processor, and is configured to store a program;
[0043] the processor is configured to realize the model rendering method according to the first aspect by running the program in the memory.
[0044] According to a fourth aspect of the embodiments of the present application, a storage medium is provided, and the storage medium stores a computer program, and the computer program is run by a processor to realize the model rendering method according to the first aspect.
[0045] According to a fifth aspect of the embodiments of the present application, a computer program product is provided, comprising computer program instructions which, when executed by a processor, cause the processor to perform the model rendering method according to the first aspect.
[0046] The above technical solution provided by the embodiments of the present application has the following advantages compared with the prior art: the method provided by the embodiments of the present application acquires model structure data required for creating a to-be-rendered object, the model structure data comprising target configuration information of target parts constituting the to-be-rendered object; for each target part, it is detected whether a target part model corresponding to the target part exists; if not, the target part model corresponding to the target part is downloaded from a server based on the target configuration information, and a mesh component of the target part model is created; if it exists, the mesh component is copied as a mesh component of the target part; and the to-be-rendered object is rendered based on the mesh component and the model structure data. In this way, for repeated target part models, there is no need to download each from the server, which on the one hand can reduce the influence of network delay and avoid network congestion and the like caused by repeated downloading, and on the other hand, directly copying the mesh component of the target part model that has been downloaded can improve rendering speed, thereby improving rendering effect. BRIEF DESCRIPTION OF DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort on the basis of the provided drawings.
[0048] FIG. 1 A flowchart of a model rendering method is provided for an embodiment of the present application;
[0049] FIG. 2 A flowchart of a model rendering method is provided for another embodiment of the present application;
[0050] FIG. 3 A flowchart of a model rendering method is provided for another embodiment of the present application;
[0051] FIG. 4 A flowchart of a model rendering method is provided for another embodiment of the present application;
[0052] FIG. 5 A structural diagram of an electronic device is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0053] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments of the present application, all the other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0054] Example implementation environment
[0055] The model rendering method according to the embodiments of the present application can be executed by an electronic device such as a terminal device or a server. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The server can be a standalone physical server, a server cluster composed of multiple physical servers, or a cloud server capable of cloud computing. The method can be realized by a processor calling computer readable program instructions stored in a memory. The present application takes the case that the model rendering method is executed by a server as an example for explanation and illustration, but does not limit this.
[0056] Example method
[0057] Please refer to FIG. 1 In an exemplary embodiment, a model rendering method is provided, comprising:
[0058] In step 101, model structure data required for creating a to-be-rendered object is obtained, wherein the model structure data includes target configuration information of target parts constituting the to-be-rendered object.
[0059] In some embodiments, the to-be-rendered object can be an object that a user wants to display on a page. The to-be-rendered object can be a vehicle, or a part of a vehicle, such as a vehicle seat, a vehicle engine, etc.
[0060] The creation of the to-be-rendered object requires multiple parts. For example, in the case that the to-be-rendered object is a vehicle, it includes at least four doors, a roof, and a chassis, which are six parts, and each part includes multiple parts. Therefore, the model structure data can be obtained based on the target configuration information of the parts required by the to-be-rendered object.
[0061] The target configuration information can include, but is not limited to, an assembly matrix of the target part model (a vector matrix containing model position, scaling size, displacement range, etc., used to determine the rendering position of the part model in the whole model), whether the model is compressed (default compression, some parts that users are most concerned about, such as handlebars, can be set to not be compressed), model compression rate (default compression 0.6, 1 for non-compression, the compression ratio can be adjusted as needed), model importance level (determine whether the part needs to be pre-rendered according to the importance level, such as high level, the model is preloaded in the background when the page is opened, so that users can see important parts faster).
[0062] The model rendering method can be applied to a model rendering platform, and a plurality of part selection buttons can be set on the model rendering platform. The target part required by the object to be rendered can be selected by clicking. For each part on the model rendering platform, the configuration information of each part is stored in the database of the platform. After the target part is selected, the target configuration information of the target part can be obtained from the database, and the set of target configuration information is used as the model structure data.
[0063] In an optional embodiment, before obtaining the model structure data required for creating the object to be rendered, the method further comprises:
[0064] Obtaining a candidate part model of a candidate part, and configuring initial configuration information of the candidate part model, wherein the candidate part includes the target part;
[0065] Storing the candidate part model and the initial configuration information corresponding to the candidate part model in the server.
[0066] In some embodiments, users can set corresponding candidate models for different candidate parts according to needs, and configure initial configuration information for the candidate part models. After the configuration is completed, a unique part identifier of each candidate part can be generated. After obtaining the candidate part models, the initial configuration information and the part identifiers of the candidate parts, a part model library is obtained. Since the part models occupy a large space, the above information is uploaded to the server for storage, and a resource locator (URL) of the part models in the server is obtained through feedback of the server. The server can be a cloud server or a local server of the model rendering platform.
[0067] For example, referring to FIG. 2 The specific implementation process of establishing the part model library includes:
[0068] The single part model is added, the assembly matrix, compression rule and important level of the part model are configured, the part model is uploaded to the server, the part model address URL is generated in the server, and the unique part identification key of the part model is generated. Further, it is judged whether the model needs to be edited. If not, it is stored in the model part library. If needed, a single part model is added again.
[0069] It can be understood that the part model refers to a 3D model of a part. The candidate part is a candidate part of the to-be-rendered object, so that the target part required by the to-be-rendered object can be selected from the candidate part when the to-be-rendered object is created.
[0070] In an optional embodiment, the model structure data required for creating the to-be-rendered object is obtained, including:
[0071] The hierarchical structure of at least one parent of the to-be-rendered object is created;
[0072] According to the association relationship between the parts in the to-be-rendered object, the target part belonging to the child of the parent is determined;
[0073] The target configuration information of the target part is obtained;
[0074] The target configuration information of the target part of the child is stored in the hierarchical structure of the corresponding parent, and the model structure data is obtained.
[0075] In some embodiments, in order to facilitate management of the target configuration information of the target part, facilitate searching or editing, and user interaction with the whole, a hierarchical structure can be set for the target configuration information, and the target configuration information belonging to the same part is set under the same parent.
[0076] The hierarchical structure of the parent can be created by creating a new way on the model rendering platform, and the corresponding category information of the created parent is configured, for example, the name of the parent is configured. After the hierarchical structure of the parent is created, the parts belonging to the parent can be dragged into the hierarchical structure on the platform.
[0077] For example, if the left door is composed of 50 part models, the parent of the left door is first created, and then the 50 corresponding parts are dragged under the parent to become its child. After the hierarchical structure is created, the user can interact with the whole, for example, the parent of the left door can be quickly found according to the name, and the door handle is clicked on the platform to realize the operation of opening the door.
[0078] In an optional embodiment, the target configuration information of the target part is obtained, including:
[0079] determine the target part from the candidate part set, and obtain initial configuration information of the target part;
[0080] obtain update information of the modification to the initial configuration;
[0081] update the initial configuration information based on the update information to obtain the target configuration information.
[0082] In some embodiments, for each part on the platform, the configured initial configuration information can not meet the needs of the object to be rendered, and therefore, after the target part is selected, the configuration information thereof can be displayed for the user to select whether to modify, and when modification is needed, the modification content can be input at the corresponding position, so as to obtain the target configuration information of the target part.
[0083] For example, when the initial configuration information of the target part is changed, the user can judge whether the attributes of the part, such as the assembly matrix, the importance level, etc., need to be changed, and if so, the configuration information of the target part this time is modified (for example, the position of the handle in the part library is A1, and the position of the door handle in the B project is moved forward to become B1, and then the assembly matrix parameter can be modified accordingly), without affecting the configuration of the part in the part library.
[0084] In an optional embodiment, after obtaining the model structure data required for creating the object to be rendered, the method further includes: sending the model structure data to the server, so that the server performs lightweight processing on the initial part model corresponding to the target part based on the model structure data.
[0085] In some embodiments, after obtaining the model structure data, before downloading the target part model, the model structure data can be sent to the server, and the server performs lightweight processing on the stored initial part model, so as to reduce the data amount of the part model and improve the download efficiency.
[0086] After generating the model structure data, a batch lightweight button can be clicked on the model rendering platform to directly execute: calling an API to pass the model structure data to the server, and the server calling a lightweight batch processing tool to perform lightweight batch processing on the batch part models in the model structure data. It can be understood that a timing lightweight processing operation can also be set, for example, setting 12 o'clock every night to automatically traverse the rendering object to perform a batch lightweight operation.
[0087] In an optional embodiment, the process in which the server performs lightweight processing on the initial part model corresponding to the target part based on the model structure data includes:
[0088] traversing the model structure data to determine whether there is a model resource locator in the model structure data;
[0089] If the target configuration information exists, compressing the initial part model based on the compression rate in the target configuration information, and storing the target part model obtained after compression.
[0090] In some embodiments, by traversing the model structure data in a loop, since the model structure data is a hierarchical structure including parent and child, for the target configuration information including multiple target parts in the child, in the facilitating process, it is judged whether the traversed model structure data exists model URL, if not, it means that it is the hierarchical structure of the parent, and no compression is needed; if it exists, it means that the data is child data, that is, the target configuration information of the target part, which needs to be compressed according to the compression rate in the target configuration information. If the initial part model does not need to be compressed, the loop is exited.
[0091] Among them, the compression of the initial part model can adopt Draco Decoder compression algorithm and Ext_meshopt compression algorithm. After compression, the compressed model is stored by OSS, and the URL address of the compressed model is updated, and then the model structure data is updated.
[0092] In an optional embodiment, the target configuration information includes scheduling attribute information of the target part, and the scheduling attribute information is used to indicate the download priority of the target part model.
[0093] After obtaining the model structure data required for creating the object to be rendered, the method further includes:
[0094] Based on the scheduling attribute information, a target part model set to be downloaded preferentially is determined, the target part model set is a set of the first preset number of target part models with high priority, and the target part models in the target part model set are not repeated.
[0095] Downloading the target part models in the target part model set from the server, and creating a mesh component of the target part model.
[0096] In some embodiments, the scheduling attribute information can be determined by the importance level of the target part and the historical use frequency of the target part. The higher the importance level and the higher the historical use frequency, the earlier the download order and the more the part model needs to be downloaded preferentially. The importance level and the historical use frequency can be weighted and summed, and the sum result is taken as the scheduling attribute information. The larger the scheduling attribute information, the higher the download priority of the target part model.
[0097] Based on the scheduling attribute information, a target part model set to be preferentially downloaded can be selected from the plurality of target part models, and a preset number of target part models with high priority are downloaded first, so that target part models with high importance level and high use frequency are downloaded first, and the rendering effect is improved. The preset number can be set based on actual conditions, for example, it can be 100.
[0098] For example, when the page is opened, the interface is requested, and the corresponding target part model is downloaded according to the URL. The target part model other than the target part model set can be downloaded in multiple threads. Generally, the size of a part is between several tens of kb and 2 mb, and the platform encapsulates a thread pool download method, and at most 500 models are downloaded at a time. The thread pool manages multiple download tasks to ensure efficient parallel download. Error handling mechanisms can also be added during the download process to ensure the stability and reliability of the download task.
[0099] Step 102, for each target part, it is detected whether the target part model corresponding to the target part exists. If not, step 103 is performed, otherwise, step 104 is performed.
[0100] In some embodiments, after determining the target part, the target part model corresponding to the target part can be downloaded from the server based on the target configuration information of the target part. Since there can be multiple target parts in the object to be rendered, to reduce the network impact on the download effect, when downloading the target part model, it can be detected whether the target part model corresponding to the target part exists, that is, whether the target part model has been downloaded.
[0101] The part identifier of the target part model can be used for detection. When a target part needs to be downloaded, the part identifier of the target part is searched locally first to determine whether the part identifier exists. If it exists, it indicates that the target part model corresponding to the target part exists, otherwise, it indicates that it does not exist, and then the resource locator in the target configuration information can be used to download from the server.
[0102] Step 103, downloading the target part model corresponding to the target part from the server based on the target configuration information, and creating a mesh component of the target part model.
[0103] In some embodiments, the target configuration information includes the target part identifier of the target part, and the target part model and its part identifier are stored in the server. Therefore, the target part model corresponding to the target part identifier can be determined based on the target part identifier, and the target part model is downloaded.
[0104] The process of creating a mesh component of a 3D model is a process of converting an abstract shape into computer-recognizable geometric data, and the core is to use vertices, edges and faces to form a continuous polygon mesh, and generate model materials in the process of generating a mesh component.
[0105] For example, referring to FIG. 3 The process of creating and lightweight processing of the rendering object can include:
[0106] Creating a project (i.e., a rendering object), configuring project basic information (including project name, etc.), selecting associated model parts from the part model library, dragging and configuring the hierarchical relationship of the parts, judging whether the assembly matrix of the parts needs to be changed, if so, modifying the assembly matrix, judging whether the importance level of the parts changes, if so, modifying the importance level, generating the model data structure of the project after the modification is completed, and enabling batch lightweight processing. Call the server lightweight processing program, judge whether the part configuration is executed compression, if so, compress according to the compression rate of the part configuration, the compression algorithm can use DracoDecoder compression algorithm and Ext_meshopt compression algorithm, after compression, store the compressed model in OSS, and update to the server, and update the URL of the compressed model, and then obtain the compressed data structure.
[0107] Step 104, copying the mesh component as the mesh component of the target part.
[0108] In some embodiments, in the case where a target part model corresponding to a target part already exists, the target part model can not be downloaded in the server, but the mesh component of the target part model can be directly copied, so that the process of generating a mesh component for the target part model can be saved, and the rendering effect can be improved.
[0109] Step 105, rendering the rendering object based on the mesh component and the model structure data.
[0110] In some embodiments, after all target parts have created mesh components, rendering is performed based on the mesh components, wherein in the case where the model structure data is a hierarchical structure of parent and child, rendering can be performed according to the hierarchical structure.
[0111] For example, for the parent in the model structure data, a group can be created and bound with the corresponding information of the parent (such as the name of the parent) during rendering, and for the child (with a model URL address, representing a specific part) in the model structure data, rendering is performed according to the created mesh component.
[0112] The target configuration information of the model structure data includes an assembly matrix of the target part model, i.e., the position, scaling size, displacement range, and the like of the model, so that the target part model is rendered to the corresponding position according to the information in the assembly matrix when rendering.
[0113] It can be understood that the rendering button on the model rendering platform can be triggered when the object to be rendered is rendered, and the rendering tool (for example, requestFrame) can be called for rendering when the rendering button is triggered.
[0114] In an optional embodiment, the model structure data includes a parent and a child; and the rendering of the object to be rendered based on the mesh component and the model structure data includes:
[0115] The mesh components belonging to the same parent are subjected to material merging and / or geometry merging to obtain a merged mesh component;
[0116] The rendering tool is called to render the merged mesh component.
[0117] In some embodiments, to improve the rendering efficiency, a plurality of target part models (for example, all part models under a car door) under one parent are subjected to geometry merging and material merging to improve the rendering efficiency.
[0118] The geometry merging can merge the geometry data (vertices, patches, and the like) of a plurality of target part models into one large geometry. The vertex index optimization is used to reduce the number of redundant vertices.
[0119] The material merging can merge the material information of a plurality of target part models and generate a unified material atlas (Texture Atlas). The UV coordinate mapping is used to ensure that the material atlas is correctly applied to the merged geometry.
[0120] Further, to make the rendering process of the object to be rendered next time faster, or the rendering process of other objects having the same parts of the object to be rendered faster, a multi-level cache mechanism can be used. Through the multi-level cache mechanism, the target part models of frequently used parts are cached in the memory of the platform, so as to reduce the time of repeated downloading and loading.
[0121] The cache strategy can include an LRU (Least Recently Used) cache to retain the N most frequently used models, and a TTL (Time To Live) cache to set the survival time of each cache entry and automatically delete the cache entry after the survival time expires.
[0122] For example, referring to FIG. 4 The process of rendering the part model can include:
[0123] The compressed model data structure is acquired, a weighted algorithm is used according to the importance level and the use frequency of the part model, a new data structure is obtained, a most important batch of part models is preloaded based on the new data structure, and other part models can be acquired by using a multi-threaded downloading mode, so that the part models are acquired, it is judged whether the same module key is contained in the loaded part models, if yes, the part model is copied, and if not, the part model is downloaded from the server. According to the hierarchical relationship of the part models, the part models are loaded into corresponding model groups, the part models are loaded according to the assembly matrix, and dynamic rendering is performed. Further, the user can interact with the rendered model in a clicking, rotating and the like mode, the use frequency of the part model is recorded, and the part model is subjected to multi-level caching.
[0124] The model rendering method of the application, through the creation and management process of the model structure data, the modification of parts in the model is more convenient, and the overall large model does not need to be modified for a small number of part modifications. And the batch small models can be freely combined into a new large model in the system, which greatly improves the reuse rate. According to the importance level or the use frequency of the small model, the more important parts are preferentially loaded, so that the user can see the model after the complete loading of all parts, and the user experience is better. Through the lightweight tool, the model can be automatically compressed, the redundant parts in the model can be automatically identified and optimized, the data amount is significantly reduced while the visual effect is maintained, and the rendering performance of the overall model is improved.
[0125] The problems of high-complexity 3D models in real-time rendering, network transmission and storage are solved. A part model library is created, a project model is configured, a part structure tree and attribute information are maintained, when rendering, whether to download or clone a part is determined according to a unique key identifier of the part, and Mesh blocks are merged from the perspective of the part, so that the downloading speed and the rendering speed are efficiently improved.
[0126] Example apparatus
[0127] Correspondingly, the application also provides a model rendering device, which comprises:
[0128] An acquisition unit is configured to acquire model structure data required for creating a to-be-rendered object, wherein the model structure data comprises target configuration information of target parts constituting the to-be-rendered object;
[0129] A detection unit is configured to detect, for each target part, whether a target part model corresponding to the target part exists;
[0130] A downloading unit is configured to, if the target part model does not exist, download the target part model corresponding to the target part from a server based on the target configuration information, and create a mesh component of the target part model;
[0131] a copying unit, configured to copy the mesh component as a mesh component of the target part if the mesh component already exists;
[0132] a rendering unit, configured to render the object to be rendered based on the mesh component and the model structure data.
[0133] The model rendering apparatus provided by the embodiment is of the same application concept as the model rendering method provided by the embodiments of the present application, can execute the method provided by any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of the execution method. Technical details not described in the embodiment can be found in the specific processing content of the model rendering method provided by the embodiments of the present application, which will not be described here.
[0134] The functions implemented by the units in the above model rendering apparatus can be respectively implemented by the same or different processors, which are not limited in the embodiments of the present application.
[0135] It should be understood that each unit in the above apparatus can be implemented in the form of processor calling software. For example, the apparatus includes a processor connected with a memory, the memory stores instructions, and the processor calls the instructions stored in the memory to implement any of the above methods or to implement the functions of the units of the apparatus, where the processor can be a general processor such as a CPU or a microprocessor, and the memory can be an internal memory of the apparatus or an external memory of the apparatus. Alternatively, the units in the apparatus can be implemented in the form of hardware circuit. The functions of some or all of the units can be implemented by designing the hardware circuit. The hardware circuit can be understood as one or more processors. For example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the units are implemented by designing the logical relationship of elements in the circuit. For another example, in another implementation, the hardware circuit can be implemented by a PLD. Taking an FPGA as an example, it can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by a configuration file, so as to implement the functions of some or all of the units. All the units of the above apparatus can be implemented in the form of processor calling software, or all the units can be implemented in the form of hardware circuit, or part of the units are implemented in the form of processor calling software, and the remaining part is implemented in the form of hardware circuit.
[0136] In the embodiments of the present application, the processor is a circuit with signal processing capability. In one implementation, the processor can be a circuit with instruction reading and running capability, such as a CPU, a microprocessor, a GPU, or a DSP, etc. In another implementation, the processor can implement certain functions through a logic relationship of a hardware circuit, which is fixed or can be reconfigured. For example, the processor is an ASIC or a PLD implemented hardware circuit, such as an FPGA, etc. In the reconfigurable hardware circuit, the processor loads a configuration document to implement the hardware circuit configuration. It can be understood that the processor loads instructions to implement the functions of the above units.
[0137] It can be seen that each unit in the above apparatus can be one or more processors (or processing circuits) configured to implement the above methods, such as a CPU, a GPU, an NPU, a TPU, a DPU, a microprocessor, a DSP, an ASIC, an FPGA, or a combination of at least two of these processor forms.
[0138] In addition, each unit in the above apparatus can be integrated together or can be independently implemented. In one implementation, the units are integrated together to implement a SOC. The SOC can include at least one processor for implementing any of the above methods or the functions of the units of the apparatus. The at least one processor can be different, such as including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
[0139] Example electronic device
[0140] Another embodiment of the present application also provides an electronic device, as shown in FIG. 5 The device includes:
[0141] a memory 500 and a processor 510;
[0142] The memory 500 is connected with the processor 510, and is configured to store programs.
[0143] The processor 510 is configured to implement the model rendering method disclosed in any of the above embodiments by running the programs stored in the memory 500.
[0144] Specifically, the above model rendering device can further include a bus, a communication interface 520, an input device 530, and an output device 540.
[0145] The processor 510, the memory 500, the communication interface 520, the input device 530 and the output device 540 are connected with each other through a bus. Among them:
[0146] The bus can include a path for transmitting information between various components of the computer system.
[0147] The processor 510 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or can be an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of programs of the present application. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a ready-to-use programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0148] The processor 510 can include a main processor, and can also include a baseband chip, a modem, etc.
[0149] The memory 500 stores programs for executing the technical solutions of the present application, and can also store operating systems and other key services. Specifically, the program can include program code, and the program code includes computer operation instructions. More specifically, the memory 500 can include read-only memory (ROM), other types of static storage devices that can store static information and instructions, random access memory (RAM), other types of dynamic storage devices that can store information and instructions, disk storage, flash, etc.
[0150] The input device 530 can include a device that receives data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer or a gravity sensor, etc.
[0151] The output device 540 can include a device that allows information to be output to a user, such as a display screen, a printer, a speaker, etc.
[0152] The communication interface 520 can include a device using any transceiver, such as an Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc., to communicate with other devices or communication networks.
[0153] The processor 510 executes the programs stored in the memory 500, and calls other devices, which can be used to implement each step of any one of the model rendering methods provided by the embodiments of the present application.
[0154] Example computer program product and storage medium
[0155] In addition to the method and device described above, the embodiments of the present application can also be a computer program product, which includes computer program instructions, which, when executed by a processor, causes the processor to perform the steps in the model rendering method according to various embodiments of the present application described in any of the embodiments in the specification.
[0156] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of the present application, including an object-oriented programming language, such as Java, C++, and the like, and a conventional procedural programming language, such as the "C" language or a similar programming language. The program code can be executed entirely on a user computing device, partially on a user device, as an independent software package, partially on a user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0157] In addition, the embodiments of the present application can also be a storage medium, which stores a computer program, and the computer program is executed by a processor to perform the steps in the model rendering method according to various embodiments of the present application described in any of the embodiments in the specification. The following steps can be implemented:
[0158] Obtaining model structure data required for creating an object to be rendered, the model structure data including target configuration information of a target part constituting the object to be rendered;
[0159] For each target part, detecting whether a target part model corresponding to the target part exists;
[0160] If not, downloading the target part model corresponding to the target part from a server based on the target configuration information, and creating a mesh component of the target part model;
[0161] If it exists, copying the mesh component as a mesh component of the target part;
[0162] Rendering the object to be rendered based on the mesh component and the model structure data.
[0163] For each of the foregoing method embodiments, in order to simply describe, they are all expressed as a combination of a series of actions, but those skilled in the art should know that the present application is not limited by the order of the described actions, because according to the present application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0164] It should be noted that each of the embodiments in the specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between embodiments can be mutually referred to.
[0165] The steps in the method of each embodiment of the application can be adjusted, combined and deleted in sequence according to actual needs. The technical features described in each embodiment can be replaced or combined.
[0166] The modules and sub-modules in the device and terminal in each embodiment of the application can be combined, divided and deleted according to actual needs.
[0167] In several embodiments provided by the application, it should be understood that the disclosed terminal, device and method can be implemented by other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or sub-modules is only a logical function division, and other division manners can be adopted in actual implementation, for example, a plurality of sub-modules or modules can be combined or integrated into another module, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed mutual elements can be indirect coupling or communication connection through some interfaces, devices or modules, and can be electrical, mechanical or other forms.
[0168] The modules or sub-modules described as separate components can or can not be physically separated, and the components of the modules or sub-modules can or can not be physical modules or sub-modules, that is, they can be located in one place, or can be distributed on a plurality of network modules or sub-modules. Part or all of the modules or sub-modules can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0169] In addition, each functional module or sub-module in each embodiment of the application can be integrated in one processing module, or each module or sub-module can exist physically, or two or more modules or sub-modules can be integrated in one module. The integrated module or sub-module can be realized in the form of hardware or in the form of software functional module or sub-module.
[0170] Those skilled in the art will further appreciate that the units and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various examples have been described herein in terms of their functionality, their composition, and their manner of operation. Whether such functionality is implemented in hardware or software depends on the particular application and design constraints imposed on the overall system. Skilled persons can implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
[0171] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in random access memory (RAM), flash memory, read-only memory (ROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0172] Finally, it should be noted that the terms "first", "second", and the like, herein do not denote any order, quantity, combination, or importance, but rather are used to distinguish one element from another, and are more especially used for the purpose of identification in claims. In addition, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. In addition, the terms "includes", "including", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus.
[0173] The above description of disclosed embodiments provides enabling disclosure sufficient for others to practice the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and generic principles defined herein can be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A model rendering method, characterized by, The method comprises the following steps: obtaining model structure data required for creating a to-be-rendered object, wherein the model structure data comprises target configuration information of target parts constituting the to-be-rendered object; for each target part, detecting whether a target part model corresponding to the target part exists; if not, downloading the target part model corresponding to the target part from a server based on the target configuration information, and creating a mesh component of the target part model; if the target part model exists, copying the mesh component as a mesh component of the target part; based on the mesh component and the model structure data, rendering the to-be-rendered object.
2. The method of claim 1, wherein, Obtaining model structure data required for creating a to-be-rendered object comprises: creating a hierarchical structure of at least one parent of the to-be-rendered object; determining a target part belonging to a child of the parent according to an association relationship between parts in the to-be-rendered object; obtaining target configuration information of the target part; storing the target configuration information of the target part of the child in the hierarchical structure of the corresponding parent to obtain the model structure data.
3. The method of claim 2, wherein, Obtaining target configuration information of the target part comprises: determining the target part from a candidate part set and obtaining initial configuration information of the target part; obtaining update information modified from the initial configuration; updating the initial configuration information based on the update information to obtain the target configuration information.
4. The method of claim 1, wherein, The target configuration information comprises scheduling attribute information of the target part, and the scheduling attribute information is used to indicate a download priority of a target part model; After obtaining the model structure data required for creating a to-be-rendered object, the method further comprises: based on the scheduling attribute information, determining a target part model set to be preferentially downloaded, the target part model set being a set of a first predetermined number of target part models with high priority, and target part models in the target part model set being non-repetitive; downloading target part models in the target part model set from the server and creating mesh components of the target part models.
5. The method of claim 1, wherein, After obtaining the model structure data required for creating a to-be-rendered object, the method further comprises: sending the model structure data to the server, so that the server performs lightweight processing on an initial part model corresponding to the target part based on the model structure data.
6. The method of claim 5, wherein, The process of performing lightweight processing on the initial part model corresponding to the target part based on the model structure data by the server comprises: traversing the model structure data to determine whether a model resource locator exists in the model structure data; if so, compressing the initial part model based on a compression rate in the target configuration information, and storing a target part model obtained after compression.
7. The method of claim 1, wherein, Before obtaining the model structure data required for creating a to-be-rendered object, the method further comprises: obtaining a candidate part model of a candidate part and configuring initial configuration information of the candidate part model, wherein the candidate part comprises the target part; storing the candidate part model and the initial configuration information corresponding to each other in the server.
8. The method of claim 1, wherein, The model structure data comprises a parent and a child; and rendering the object to be rendered based on the mesh component and the model structure data comprises: performing material merging and / or geometry merging on the mesh components belonging to the same parent to obtain a merged mesh component; calling a rendering tool to render the merged mesh component.
9. An electronic device, comprising: comprise a memory and a processor; the memory is connected with the processor and is configured to store a program; the processor is configured to realize the model rendering method according to any one of claims 1 to 8 by running the program in the memory.
10. A storage medium, characterized by The storage medium has a computer program stored thereon, and the computer program, when being run by a processor, realizes the model rendering method according to any one of claims 1 to 8.