Model simplification method, apparatus, terminal device, and readable storage medium

By obtaining the load information of the terminal device, obtaining or generating the drawing instructions of the second model, and drawing and displaying the second model as the LOD model, the problem of missing or simple LOD models in the application is solved, the application of LOD technology is realized in more scenarios, and the fluency and user experience are improved.

CN114491914BActive Publication Date: 2025-10-24HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202011275338.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-13
Publication Date
2025-10-24
Estimated Expiration
2040-11-13

AI Technical Summary

Technical Problem

In the existing technology, many applications do not provide LOD models corresponding to the models when they are released, or the LOD models provided are simple, resulting in the inability to effectively apply LOD technology and affecting user experience.

Method used

By acquiring the load information of the terminal device, acquiring the corresponding drawing instructions of the second model according to the drawing instructions of the first model, generating or matching the drawing instructions of the second model, drawing and displaying the second model as an LOD model, and realizing the application of LOD technology.

Benefits of technology

While the rendering computing power of the terminal device remains unchanged, the application scenarios of LOD technology have been increased, improving the running smoothness of the application and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114491914B_ABST
    Figure CN114491914B_ABST
Patent Text Reader

Abstract

The application relates to the field of image processing, and provides a model simplification method and device, terminal equipment and a readable storage medium. The model simplification method comprises the following steps: when a target object is drawn, load information when a first model of the target object is drawn is acquired according to drawing instructions of the first model. When the load information meets a preset condition, drawing instructions of an LOD model are acquired according to the drawing instructions of the first model, and then the target object after simplification of the LOD model is drawn and displayed. When the LOD technology is applied, whether an LOD model corresponding to the first model is provided by an application program or not, the LOD model can be acquired according to the drawing instructions of the first model, so that the LOD technology can be effectively applied to each application program, the application scene of the LOD technology is increased, and the fluency of application program running is increased under the condition that the rendering computing power of the terminal equipment is unchanged.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and in particular to a model simplification method and device, a terminal device, and a readable storage medium. BACKGROUND

[0002] A multi-level detail (LOD) technique can determine the level of detail of a model to be rendered according to the position and importance of the vertices of the model in a display environment when the model is rendered and displayed. For example, the number of faces and details of non-important objects can be reduced, thereby reducing the rendering power required to render a picture of the same quality.

[0003] In the prior art, when the LOD technique is used, an additional LOD model needs to be generated for the original model. Then, when the model is rendered, the application determines which level of detail of the model to be drawn and displayed according to the position and importance of the vertices of the model in the display environment.

[0004] However, many applications do not provide LOD models corresponding to the models when they are released, or the provided LOD models are very simple, which leads to the problem that the LOD technique cannot be effectively applied. SUMMARY

[0005] The embodiments of the present application provide a model simplification method, device, terminal device, and readable storage medium, which can solve the problem that the LOD technique cannot be effectively applied due to the fact that the application does not provide LOD models corresponding to the models when it is released, or the provided LOD models are very simple.

[0006] In a first aspect, the embodiments of the present application provide a model simplification method, which includes: obtaining load information when a first model is drawn according to drawing instructions of the first model. When the load information meets a preset condition, obtaining drawing instructions of a second model corresponding to the first model according to the drawing instructions of the first model. Drawing and displaying the second model according to the drawing instructions of the second model.

[0007] The model simplification method provided in the first aspect can be applied to terminal devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) devices, virtual reality (VR) devices, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), and the like. The embodiments of the present application do not limit the specific type of the terminal device.

[0008] The complexity of the second model is less than that of the first model. The complexity of the model can be measured by parameters such as the number of nodes and indexes when the model is drawn.

[0009] In the first aspect, when it is determined that the load information for drawing the first model meets the preset conditions based on the drawing instructions of the first model, the corresponding drawing instructions for the second model can be obtained based on the drawing instructions of the first model. Then, the second model is drawn and displayed based on the drawing instructions of the second model. That is, when applying LOD technology, regardless of whether the application provides an LOD model corresponding to the first model, the drawing instructions for the second model can be obtained based on the drawing instructions of the first model, and the drawn second model can be displayed as the LOD model of the first model. This allows LOD technology to be effectively applied to every application, increases the application scenarios of LOD technology, and increases the smoothness of application operation while maintaining the rendering computing power of the terminal device.

[0010] In some embodiments, obtaining a corresponding drawing instruction for a second model based on a drawing instruction for a first model includes: matching the first model with a corresponding second model, obtaining the drawing instruction for the second model when the matching is successful, and generating the drawing instruction for the second model when the matching fails.

[0011] First, the first model is matched to a corresponding second model. If a match is found, the drawing instructions for the matching second model are directly obtained. If the match fails, the drawing instructions for the second model are generated again. For multiple occurrences of the first model, the drawing instructions for the second model do not need to be generated each time. Instead, the already generated drawing instructions for the second model are used. This saves time waiting for the drawing instructions for the second model, effectively improving model drawing efficiency.

[0012] In some implementations, when the matching fails, generating a drawing instruction for the second model includes: obtaining a model structure category of the first model, and generating a drawing instruction for the second model according to the model structure category and the drawing instruction of the first model.

[0013] In some embodiments, the drawing instruction includes multiple vertices and multiple groups of index sequences, each group of index sequences includes multiple index values ​​arranged in sequence, each index value corresponds to a vertex, and the model structure category includes a mesh structure or a patch structure; obtaining the model structure category of the first model includes: obtaining the index values ​​included in each group of index sequences in the drawing instruction of the first model. Determining whether the model structure of the first model is a mesh structure or a patch structure based on the index values ​​in each group of index sequences.

[0014] In some embodiments, determining the model structure of the first model as a mesh structure or a patch structure according to the index values in each index sequence comprises: if the number of index values in each index sequence is 6, and the 6 index values include 2 pairs of identical index values and 2 index values that are different from the other index values, then determining the model structure as a patch structure. Otherwise, determining the model structure as a mesh structure.

[0015] According to the number of index values in each index sequence and the numerical values of the index values, the model structure can be accurately identified, and different model simplification methods can be adopted for different model structures to simplify the model more targetedly. The rendering instruction of the generated second model has higher rendering efficiency and better visual effect of the rendered model.

[0016] In some embodiments, when the model structure category is a patch structure, each index sequence is used to render a patch.

[0017] According to the model structure category and the rendering instruction of the first model, the rendering instruction of the second model is generated, comprising: when the model structure category is a patch structure, obtaining the distribution characteristics of each patch in the first model according to the rendering instruction of the first model. According to the distribution characteristics and the rendering instruction of the first model, the rendering instruction of the second model is generated.

[0018] In some embodiments, obtaining the distribution characteristics of each patch in the first model comprises: mapping each patch to a spatial grid coordinate system. Obtaining the density of each grid in the spatial grid coordinate system and the number of occurrences of each patch in the grid, the density of each grid comprising the number of patches contained in each grid.

[0019] In some embodiments, generating the rendering instruction of the second model according to the distribution characteristics and the rendering instruction of the first model comprises: sorting the grids according to the density of each grid. Sorting the patches in the i grids with the largest grid density after sorting according to the number of occurrences of the patches. Sparsifying the i grids with the largest grid density after sorting according to the k patches with the most number of occurrences after sorting, reducing the number of patches in each grid to obtain the sparse grid, i and k are integers greater than 1. According to the index sequence corresponding to the patches in each sparse grid, the rendering instruction of the second model is generated.

[0020] In some embodiments, the sparse grid is obtained by sparsifying each grid according to the k most frequently occurring patches after sorting and reducing the number of patches in the grid, wherein j is a natural number.

[0021] When the model structure category is a patch structure, the first model is simplified according to the number of occurrences of each patch in each grid of the spatial grid coordinate system and the density of each grid. That is, the grid with a larger density is sparsified according to the number of occurrences of the patch, so that the density of the grid and the number of occurrences of the patch are relatively average, and the repeated drawing of the patch is reduced. The model simplification is realized on the basis of ensuring the visual effect of the model.

[0022] In some embodiments, the density of each grid in the spatial grid coordinate system is obtained by obtaining feature points of each patch, the feature points of the patch including vertices of the patch and at least one sampling point arranged in the patch, and obtaining the feature points included in the grid and determining the density of the grid according to the patch corresponding to each feature point.

[0023] In some embodiments, the load information when the first model is drawn is obtained by obtaining the number of vertices and / or the number of index values included in the drawing instruction, and the load threshold corresponding to the instruction type of the drawing instruction.

[0024] The load information satisfies the preset condition, including that the number of vertices and / or the number of index values is greater than or equal to the load threshold.

[0025] In some embodiments, the corresponding second model is matched for the first model, including obtaining the vertices and / or index values included in the drawing instruction of the first model, and matching the second model corresponding to the first model in the pre-stored multi-detail level matching table according to the vertices and / or index values, the multi-detail level matching table including the correspondence between the drawing instruction of the first model and the second model.

[0026] In some embodiments, after obtaining the load information when the first model is drawn according to the drawing instruction of the first model, the method further includes drawing and displaying the first model according to the drawing instruction of the first model.

[0027] In some embodiments, when the load information satisfies the preset condition, the drawing instruction of the corresponding second model is obtained according to the drawing instruction of the first model, including obtaining the generation state of the drawing instruction of the second model. If the generation state of the drawing instruction of the second model is not completed, the first model is drawn and displayed according to the drawing instruction of the first model.

[0028] When it is not determined whether the first model is simplified or the simplification of the first model has not been completed, the first model is drawn and displayed according to the drawing instruction of the first model, so that the first model in the displayed picture can be normally displayed.

[0029] In some embodiments, when the load information meets the preset condition, the drawing instruction of the corresponding second model is obtained according to the drawing instruction of the first model, including: obtaining the generation state of the drawing instruction of the second model. If the generation state of the drawing instruction of the second model is completed, the corresponding relationship between the drawing instruction of the first model and the second model is generated and stored in the multi-detail level matching table.

[0030] After the simplification of the first model is completed, the corresponding relationship between the drawing instruction of the first model and the second model is generated and stored in the multi-detail level matching table. When the first model needs to be simplified again, the drawing instruction of the second model corresponding to the drawing instruction of the first model can be directly matched and called for drawing, without the need for re-generation, thereby improving the drawing efficiency of the model.

[0031] In some embodiments, the second model is drawn and displayed according to the drawing instruction of the second model, including: the second model is drawn according to the drawing instruction of the second model. The second model is displayed in the display area of the first model.

[0032] In the second aspect, the embodiments of the present application provide a model simplification device, which includes: an obtaining module, configured to obtain load information when the first model is drawn according to the drawing instruction of the first model. The obtaining module is further configured to obtain the drawing instruction of the corresponding second model according to the drawing instruction of the first model when the load information meets the preset condition. A drawing module is configured to draw and display the second model according to the drawing instruction of the second model.

[0033] In some embodiments, the obtaining module is specifically configured to match the corresponding second model for the first model.

[0034] When the matching is successful, the obtaining module is specifically configured to obtain the drawing instruction of the second model.

[0035] When the matching fails, the device further includes a generating module configured to generate the drawing instruction of the second model.

[0036] In some embodiments, when the matching fails, the generating module is specifically configured to obtain the model structure category of the first model. The drawing instruction of the second model is generated according to the model structure category and the drawing instruction of the first model.

[0037] In some embodiments, the drawing instruction includes a plurality of vertices and a plurality of index sequences, each index sequence includes a plurality of index values arranged in sequence, each index value corresponds to a vertex, and the model structure category includes a mesh structure or a patch structure. The generation module is specifically configured to obtain the index values included in each index sequence in the drawing instruction of the first model. According to the index values in each index sequence, it is determined that the model structure of the first model is a mesh structure or a patch structure.

[0038] In some embodiments, the generation module is specifically configured to determine that the model structure is a patch structure if the number of index values in each index sequence is 6, and 2 pairs of index values in the 6 index values are the same and 2 index values are different from the other index values. Otherwise, it is determined that the model structure is a mesh structure.

[0039] In some embodiments, when the model structure category is a patch structure, each index sequence is used to draw a patch.

[0040] The generation module is specifically configured to obtain the distribution characteristics of each patch in the first model according to the drawing instruction of the first model when the model structure category is a patch structure. According to the distribution characteristics and the drawing instruction of the first model, the drawing instruction of the second model is generated.

[0041] In some embodiments, the generation module is specifically configured to map each patch to a spatial grid coordinate system. Obtain the density of each grid in the spatial grid coordinate system and the number of occurrences of each patch in the grid, and the density of each grid includes the number of patches contained in each grid.

[0042] In some embodiments, the generation module is specifically configured to sort the grids according to the density of each grid. According to the number of occurrences of the patch, the patch in the i grids with the largest grid density after sorting is sorted. According to the k patches with the most occurrences after sorting, the i grids with the largest grid density after sorting are sparse, the number of patches in each grid is reduced, and the sparse grid is obtained, i and k are integers greater than 1. According to the index sequence corresponding to the patch in each sparse grid, the drawing instruction of the second model is generated.

[0043] In some embodiments, the generation module is specifically configured to obtain the patches appearing in the j grids with the smallest grid density after sorting, j is a natural number. According to the patches appearing in the j grids with the smallest grid density after sorting, the k patches with the most occurrences after sorting, each grid is sparse, the number of patches in the grid is reduced, and the sparse grid is obtained.

[0044] In some embodiments, the generating module is specifically configured to acquire feature points of each patch, the feature points of the patch including vertices of the patch and at least one sampling point arranged inside the patch. The feature points included in the mesh are acquired, and the density of the mesh is determined according to the patch corresponding to each feature point.

[0045] In some embodiments, the acquiring module is specifically configured to acquire the number of vertices and / or the number of index values included in the rendering instruction, and the load threshold corresponding to the instruction type of the rendering instruction.

[0046] In some embodiments, the load information satisfies a preset condition, including that the number of vertices and / or the number of index values is greater than or equal to the load threshold.

[0047] In some embodiments, the acquiring module is specifically configured to acquire the vertices and / or the index values included in the rendering instruction of the first model. According to the vertices and / or the index values, a second model corresponding to the first model is matched in a pre-stored multi-detail level matching table, and the multi-detail level matching table includes a corresponding relationship between the rendering instruction of the first model and the second model.

[0048] In some embodiments, after the load information of the first model is acquired according to the rendering instruction of the first model, the rendering module is further configured to render and display the first model according to the rendering instruction of the first model.

[0049] In some embodiments, when the load information satisfies the preset condition, the acquiring module is specifically configured to acquire a generation state of the rendering instruction of the second model. If the generation state of the rendering instruction of the second model is not completed, the first model is rendered and displayed according to the rendering instruction of the first model.

[0050] In some embodiments, when the load information satisfies the preset condition, the acquiring module is specifically configured to acquire a generation state of the rendering instruction of the second model. If the generation state of the rendering instruction of the second model is completed, a corresponding relationship between the rendering instruction of the first model and the second model is generated and stored in the multi-detail level matching table.

[0051] In some embodiments, the rendering module is specifically configured to render the second model according to the rendering instruction of the second model. The second model is displayed in the display area of the first model.

[0052] In a third aspect, an embodiment of the present application provides a terminal device, including at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor. The processor executes the computer program to implement the method provided in the first aspect.

[0053] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the method provided in the first aspect.

[0054] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the method provided in the first aspect.

[0055] In a sixth aspect, an embodiment of the present application provides a chip system, which includes a memory and a processor. The processor executes a computer program stored in the memory to implement the method provided in the first aspect.

[0056] In a seventh aspect, an embodiment of the present application provides a chip system, which includes a processor. The processor is coupled with the computer readable storage medium provided in the fourth aspect. The processor executes a computer program stored in the computer readable storage medium to implement the method provided in the first aspect.

[0057] It can be understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description in the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0058] Figure 1 An application scenario diagram of a multi-level refinement technology;

[0059] Figure 2 A structural diagram of a terminal device provided in an embodiment of the present application;

[0060] Figure 3 A software architecture diagram of a terminal device provided in an embodiment of the present application;

[0061] Figure 4 A flow diagram of a model simplification method provided in an embodiment of the present application;

[0062] Figure 5 A diagram of a mesh structure in a model structure;

[0063] Figure 6 A diagram of a face structure in a model structure;

[0064] Figure 7 A diagram of a feature point of a face and a spatial mesh coordinate system in a model simplification method provided in an embodiment of the present application;

[0065] Figure 8 A statistical diagram of a mesh density in a model simplification method provided in an embodiment of the present application;

[0066] Figure 9The grid density statistical chart of the first model after being simplified in the model simplification method provided by the embodiment of the present application;

[0067] Figure 10 The schematic diagram of the first model and the second model in the model simplification method provided by the embodiment of the present application;

[0068] Figure 11 The schematic diagram of the scene when the model simplification method provided by the embodiment of the present application is applied;

[0069] Figure 12 The module timing schematic diagram when the model simplification method provided by the embodiment of the present application is applied;

[0070] Figure 13 The flow schematic diagram of another model simplification method provided by the embodiment of the present application;

[0071] Figure 14 The schematic diagram of the first model and the second model of the patch structure in another embodiment of the present application;

[0072] Figure 15 The schematic diagram of the first model and the second model of the grid structure in another embodiment of the present application;

[0073] Figure 16 The schematic diagram of the first model and the second model of the grid structure in another embodiment of the present application;

[0074] Figure 17 The schematic diagram of the first model and the second model of the grid structure in another embodiment of the present application;

[0075] Figure 18 The structure schematic diagram of a model simplification device provided by the embodiment of the present application;

[0076] Figure 19 The structure schematic diagram of another model simplification device provided by the embodiment of the present application;

[0077] Figure 20 The structure schematic diagram of a terminal device provided by another embodiment of the present application. DETAILED DESCRIPTION

[0078] In the following description, specific details are set forth, such as particular system configurations, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. However, persons skilled in the art will understand that the present application can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known methods, apparatuses, circuits, and methods are omitted in order not to obscure the description of the present application with unnecessary detail.

[0079] It should be understood that the term “and / or” as used herein in the specification and in the claims, if any, means any one of the items, any combination of the items, or all of the items, associated with the term in the respective clause of which the term is used, and that the term should be interpreted in the manner consistent with the meaning of the first usage of the term. It should also be understood that, as used in the specification and in the claims, the singular forms “a,” “an,” and “the” include their plural forms unless the context clearly dictates otherwise.

[0080] As used in the specification and in the claims, the term “if’ can be interpreted as meaning “when,” or “once,” or “in response to a determination,” or “in response to a detection” depending on the context. Similarly, the phrase “if determined” or “if detected” can be interpreted as meaning “once determined” or “in response to a determination,” or “once detected” or “in response to a detection,” depending on the context.

[0081] In addition, in the description and the appended claims of the application, the terms “first,” “second,” “third,” and the like are used merely as labels for convenience, and are not intended to impose numerical or relative importation unless specifically so indicated.

[0082] A reference in the specification to “one embodiment” or “some embodiments” or “an embodiment” or “some implementations” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. The appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in additional embodiments,” and the like in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily referring to some, but not all embodiments, unless otherwise specifically so stated. The terms “including,” “comprising,” “having” and variations thereof herein are meant to be broad and encompass the terms “consisting of” and “consisting essentially of” unless otherwise indicated.

[0083] At present, when running an application program through a terminal device such as a smart phone, a tablet computer, a notebook computer or a personal computer, there can be a scenario that needs to render a model. For example, when running a game application through a terminal device, a large number of models need to be rendered to construct a game scene. In order to obtain a more realistic visual effect, each model is processed in detail when designing the model, and the obtained model has a realistic visual effect but is relatively complex.

[0084] Rendering a large number of complex models will occupy a large amount of resources of a GPU, resulting in an increase in power consumption of the terminal device and a lag. In order to reduce resource occupation during rendering while ensuring a visual effect, a multi-level of detail (LOD) technology can generally be used to process the model. That is, multiple models are constructed for the same object in a scene, and the difference between the models is the degree of detail description. A scene is described by using a model set having a multi-level structure.

[0085] As an example, Figure 1An example of a prior art model rendering using LOD technology is shown.

[0086] With reference to Figure 1 Prior art requires a plurality of LOD models of different levels to be made for a model before using LOD technology, denoted as LODX model, where X is the level of the model, the greater the level, the greater the degree of simplification of the original model, the lower the accuracy of the rendered model, and X is 0, i.e. the original model is rendered without simplification. Figure 1 Referring to the tree model in FIG. 1, model 11 is LOD0, model 12 is LOD1, and model 13 is LOD2.

[0087] When determining the LOD levels of model 11, model 12 and model 13, different levels of simplification can be performed according to the importance of each model in the scene. For example, the importance of a model can be determined according to the distance between the model and the perspective camera in the scene, and the percentage of the screen occupied by the model.

[0088] The perspective camera refers to a virtual camera that can provide the perspective of the screen displayed in the scene. For example, if the running program is a first-person game, the perspective camera is located at the eye position of the virtual character. If the running program is not a first-person game, the perspective camera can be set around the virtual character, and its specific position can be adjusted by receiving user operation instructions.

[0089] When the position or angle of the perspective camera changes, the distance between the model and the perspective camera in the scene, and the percentage of the screen occupied by the model will change accordingly. In this case, the LOD level of each model can be updated according to the importance of the changed model.

[0090] For a model with a patch structure, the accuracy of the model can be reflected by the accuracy and number of patches. When the object is far away, a small number of low-precision patches can be used, and correspondingly, a large number of high-precision patches can be used when the object is close.

[0091] Current LOD technology requires developers to set up a plurality of LOD models of different levels for a model when designing the model, and directly call the LOD models when running the application. However, many developers do not provide corresponding LOD models, or the provided LOD models are relatively simple and have poor visual effects. This results in the LOD technology being unable to be effectively applied to every application that requires LOD, affecting the user experience.

[0092] To this end, the model simplification method itself provides a model simplification method, which comprises: obtaining load information when drawing the first model according to the drawing instruction of the first model. When the load information meets the preset condition, obtaining the drawing instruction of the corresponding second model according to the drawing instruction of the first model. Drawing and displaying the second model according to the drawing instruction of the second model. In order to realize that when the LOD technology is applied, whether the application program provides the LOD model corresponding to the first model, the drawing instruction of the second model can be obtained according to the drawing instruction of the first model, and the second model obtained by drawing is displayed as the LOD model of the first model. So that the LOD technology can be effectively applied to each application program, increase the application scene of the LOD technology, increase the smoothness of the application program running under the condition that the rendering computing power of the terminal device is unchanged, and improve the user experience.

[0093] The model simplification method provided by the embodiments of the present application can be applied to terminal devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. The embodiments of the present application do not make any limitation on the specific type of terminal device.

[0094] Here, the mobile phone is taken as an example to describe the hardware structure of the terminal device.

[0095] As shown in Figure 2 The terminal device can include a processor 110, an audio module 120, a screen 130, a camera module 140, a storage module 150, an interface 160, a power module 170, an input module 180, a communication module 190, a hardware transcoding module 200, etc. Those skilled in the art can understand that Figure 2 The terminal device structure shown in the above description does not constitute a limitation on the terminal device, and can include more or fewer components than shown, or combine certain components, or different component arrangements.

[0096] The following will be described in detail Figure 2 The various constituent components and modules of the terminal device will be described in detail:

[0097] The processor 110 is the control center of the terminal device, and can include a CPU 111 and a GPU 112. The CPU 110 can connect various parts of the terminal device by various interfaces and lines, execute various functions of the terminal device and process data by running or executing software programs and / or modules stored in the storage module 150 and calling data stored in the storage module 150. The GPU 112 is a microprocessor that can perform image and graphics related operations. The GPU 112 can be in various forms, for example, the GPU 112 can be arranged in a graphics card, or integrated in the CPU 111, or in the form of a separate GPU chip.

[0098] When the GPU performs image and graphics rendering, the GPU can render the image or graphics to a buffer. For the GPU arranged in the graphics card, the buffer is the video memory (also called frame buffer) integrated in the graphics card. For the GPU integrated in the CPU or in the form of a separate GPU chip, the buffer can be a part of the running memory of the terminal device, such as a part of the space in the random access memory (RAM).

[0099] In some embodiments, the CPU 111 can include one or more processing units. For example, the CPU 111 can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic component, a discrete hardware component, and the like.

[0100] In some other embodiments, the processor 110 can further integrate a modem processor. The modem processor mainly processes data related to wireless communication. The present application does not make any limitation in this regard.

[0101] The audio module 120 is configured to process audio signals. For example, the audio module 120 can convert an analog audio signal received by the microphone 123 into digital audio data and send the digital audio data to the processor 110. Alternatively, the audio module 120 can convert digital audio data sent by the processor 110 into an analog signal that can be played by the speaker 121 and the receiver 122, and send the analog signal to the speaker 121 or the receiver 122.

[0102] The screen 130 is configured to visually output content output by the terminal device. For example, the screen 130 can display information input by a user, display information provided to the user, display a system interface of the terminal device, and display an interface of an application program running on the terminal device. The screen 130 can be implemented by using a liquid crystal display (LCD), a thin film transistor (TFT), a light-emitting diode (LED), an organic light-emitting diode (OLED), or the like, but is not limited thereto.

[0103] In some embodiments, the screen can further include a touch panel. When the touch panel detects a touch operation thereon or in the vicinity thereof, the touch panel can transmit information about the touch operation to the processor 110 to determine a type of the touch event, and then the processor 110 can provide a corresponding visual output on the display panel according to the type of the touch event. Although the screen and the touch panel (not shown) are implemented as two independent components to provide input and output functions of the terminal device in the above embodiment, in some embodiments, the touch panel can be integrated with the display panel to provide the input and output functions of the terminal device. Figure 2

[0104] The camera module 140 includes at least one camera. The at least one camera can be a front-facing camera 141 or a rear-facing camera 142.

[0105] For example, the terminal device can include a single camera, a dual camera, a triple camera, or a quad camera. For example, the terminal device can include a quad camera including one front-facing camera 141 and three rear-facing cameras 142. The three rear-facing cameras 142 can be cameras having different focal lengths, such as a main camera having an equivalent focal length of 35 mm, a wide-angle camera having an equivalent focal length of 20 mm, and a telephoto camera having an equivalent focal length of 105 mm. Embodiments of the present disclosure are not limited thereto.

[0106] It should be noted that when the terminal device includes multiple cameras, the multiple cameras can be front-facing cameras, rear-facing cameras, or a combination of front-facing cameras and rear-facing cameras. Embodiments of the present disclosure are not limited thereto.

[0107] The storage module 150 includes an internal memory 151 and an external memory interface 152. The internal memory 151 can be a flash memory, a hard disk, or an operating memory. For example, the internal memory 151 can include at least one hard disk or flash memory and one operating memory. The external memory interface 152 is configured to connect an external memory. The external memory can include a memory card, a mobile hard disk, a USB flash drive, an optical disc, or the like.

[0108] ​The storage module 150 can be used to store software programs and modules, and the processor 110 executes various function applications and data processing of the terminal device by running the software programs and modules stored in the storage module 150. The storage module 150 can mainly include a storage program area and a storage data area. The storage program area is usually located on the internal memory 151, and can store an operating system and at least one application program required by a function (such as a sound playing function, a touch response function). The storage data area can be located on the internal memory 151, or on an external memory connected with the external memory interface 152, or on both the internal memory and the external memory. The storage data area can store data created according to the use of the mobile phone (such as audio data, image data, video data).

[0109] The interface 160 includes but is not limited to a Subscriber Identity Module (SIM) card interface 161, a USB interface 162, and a headset interface 163. The SIM card interface is used to insert a SIM card provided by an operator, so that when the terminal device is connected with a base station through the mobile communication module 191, the user identity is identified and verified, and after verification, the base station is sent a call request, a data request, and receives a call, data, and short message forwarded by the base station.

[0110] The USB interface 162 can connect the terminal device with a computer through a USB data line to exchange data. At the same time, the USB interface 162 is connected with the power module 170, and the USB data line can transmit input power to the power module 170 when connected with the computer or a charging socket to charge the terminal device. The USB interface 162 can be micro-USB, mini-USB, USB Type-c, etc., which is not limited here.

[0111] The headset interface 163 is used to connect a headset. The headset interface 163 can be a separate interface, for example, the headset interface 163 can be a 3.5mm headset jack. Alternatively, the headset interface 163 can be integrated into the USB interface 162, for example, the headset interface can be integrated into the USB Type-c. When a headset is inserted into the headset interface 163, the audio module 120 can no longer send the output analog audio signal to the loudspeaker 121 or the receiver 122, but send the output analog audio signal to the headset through the headset interface 163 to play the audio through the headset. When the headset is inserted, if it is detected that the headset does not include a microphone, the audio module still receives the analog audio signal sent by the microphone 123. If it is detected that the headset includes a microphone, the audio module receives the analog audio signal sent by the headset microphone, processes it and sends it to the processor 110.

[0112] The terminal device also includes a power module 170 that supplies power to various components. The power module may include a battery, a power management module, etc. The power management module may be logically connected to the processor 110, thereby managing battery charging, discharging, and power consumption through the power management module.

[0113] The input module 180 may be configured to receive input information and key signals. The input information may include digital or character information, touch information, etc. The key signals may include physical key pressing signals, virtual key pressing signals, etc.

[0114] In one embodiment, the input module 180 may include a touch panel and other input devices. The touch panel and the screen 130 may form a touch screen. The touch panel may collect user touch operations on or near it (such as operations performed by the user using a finger, stylus, or other object or accessory that can generate a touch signal on the touch panel on the touch panel or near the touch screen), and execute corresponding functions according to a pre-set program drive. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch direction, detects the signal caused by the touch operation, and transmits the signal to the touch controller. The touch controller receives the touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 110. The processor 110 receives the sent touch point coordinates, converts them into touch instructions and executes them. The touch panel can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. Other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick.

[0115] The communication module 190 includes a mobile communication module 191 and a wireless communication module 192. The mobile communication module 191 can support any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), Time-Division WCDMA (TD-WCDMA), Time-Division LTE (TD-LTE), the 5th generation New Radio (5G NR), etc. The wireless communication module 192 can support Bluetooth, Wireless Fidelity (Wi-Fi), Near Field Communication (NFC), etc.

[0116] The mobile communication module 191 can be used to connect with a communication base station through an antenna to establish a call link between the terminal device and other terminal devices, and to transmit and receive call audio. The wireless communication module 192 is used to wirelessly connect with an external device, which can be a Bluetooth headset, a Bluetooth speaker, etc. with sound playing and receiving functions, or a Bluetooth mouse, a Bluetooth keyboard, etc. for input, without limitation.

[0117] The hardware transcoding module 200 can be a hardware transcoding chip, a hardware transcoding gateway, or a module providing hardware transcoding function in a CPU, etc.

[0118] The software system of the terminal device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The present embodiment takes an Android system with a layered architecture as an example to exemplarily illustrate the software structure of the terminal device.

[0119] Figure 3 is a software structure block diagram of the terminal device of the present embodiment.

[0120] A layered architecture divides software into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system can be divided into four layers, from top to bottom, the application layer (APP), the application framework layer (FWK), the system runtime library layer, and the kernel layer.

[0121] As shown in Figure 3 the application layer can be a series of application packages, which can include short message, calendar, camera, video, navigation, gallery, call, game, etc.

[0122] The window manager is used to manage the window program. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, and intercept the screen, etc.

[0123] The content provider is used to store and obtain data, and make the data accessible to the application. The data can include video, image, audio, dialing and answering phone, browsing history and bookmark, phone book, etc.

[0124] The view system includes visual controls, such as controls that display text, controls that display pictures, etc. The view system can be used to build an application. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view that displays text and a view that displays pictures.

[0125] The phone manager is used to provide the communication function of the terminal device. For example, the management of the call state (including connection, hang up, etc.).

[0126] The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc.

[0127] The notification manager allows the application to display notification information in the status bar, which can be used to convey messages of the notification type, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the completion of the download, message reminder, etc. The notification manager can also be a notification in the form of a chart or a scroll bar text appearing in the top status bar of the system, such as a notification of an application running in the background, and also a notification in the form of a dialog window appearing on the screen. For example, prompting text information in the status bar, issuing a prompt sound, electronic device vibration, indicator light blinking, etc.

[0128] The system library layer includes system libraries and an Android runtime. The Android runtime includes core libraries and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core libraries include two parts: one part is a function function that the java language needs to call, and the other part is the core library of Android.

[0129] The application program layer and the application program framework layer run in the virtual machine. The virtual machine executes the java files of the application program layer and the application program framework layer into binary files. The virtual machine is used to perform functions such as management of object life cycle, stack management, thread management, security and exception management, and garbage collection.

[0130] The system library can include a plurality of function modules. For example, the conventional function modules can include a surface manager, media libraries, a three-dimensional graphics processing library (for example: OpenGL ES), a 2D graphics engine (for example: SGL), and the like. In the present application, the system library can also include a command stream dynamic reconstruction (CSDR) module and a real-time simplification module, which are used to implement the model simplification method provided in the present application.

[0131] The instruction reconstruction module is used to capture the instructions of the APP calling the graphics interface API and perform dynamic optimization. The optimization operation can include various possible adjustment operations, such as reorganization, merging, etc. Among them, the graphics interface API can implement related operations based on the open graphics library (OpenGL) or Vulkan and other graphics programming interface (API). Since the standard API is referred to, the technical solution of the embodiments of the present application can obtain the related information of the model by using the parameters of the standard API.

[0132] The real-time simplification module can include an identification module, a simplification module, a replacement module, and a database.

[0133] The identification module is used to identify whether to simplify the drawing instructions received in the instruction reconstruction module, that is, whether to simplify the model corresponding to the drawing instructions.

[0134] If simplification is performed, the simplification module is used to perform simplification processing on the drawing instructions to obtain the simplified drawing instructions.

[0135] Then the replacement module is used to replace the drawing instructions received in the instruction reconstruction module with the simplified drawing instructions.

[0136] Finally, the simplified rendering instructions are sent to the graphics processor for rendering by the instruction reorganization module.

[0137] The database can store data such as a multi-detail level matching table, etc., to provide data support for the identification module, the simplification module, and / or the replacement module.

[0138] The surface manager is used to manage the display subsystem and provides fusion of 2D and 3D layers for multiple applications.

[0139] The media library supports playback and recording of various commonly used audio, video formats, and static image files, etc. The media library can support various audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0140] The three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing, etc.

[0141] The 2D graphics engine is a drawing engine for 2D drawing.

[0142] The kernel layer is a layer between hardware and software. The kernel layer at least includes display drivers, camera drivers, audio drivers, sensor drivers, etc.

[0143] In the present application, the kernel layer also includes a graphics processor (GPU) driver. The GPU driver is used to receive the rendering instructions sent by the instruction reorganization module and call the GPU for model rendering according to the rendering instructions.

[0144] Figure 4 A schematic flowchart of a model simplification method provided by the present application is shown, which can be applied to the terminal device described above as an example but not limitation.

[0145] Referring to Figure 4 The method comprises:

[0146] S301, according to the rendering instructions of the first model, obtaining the load information when the first model is rendered.

[0147] Referring to Figure 3 When the first model is rendered, the APP sends the rendering instructions of the first model to the GPU driver through the graphics API, and then the GPU driver renders and displays according to the received rendering instructions. In the present application, the CSDR module can intercept the rendering instructions of the first model sent by the API to the GPU driver.

[0148] In some embodiments, the drawing instruction includes multiple vertices and multiple groups of index sequences, each group of index sequences includes multiple index values ​​arranged in sequence, and each index value corresponds to a vertex. By connecting and drawing the vertices corresponding to the index values ​​according to the order of the index values, the corresponding model can be obtained. The more index values ​​or vertices there are, the more complex the drawn model is. Correspondingly, the greater the load when drawing the model. Therefore, at least one of the number of vertices and the number of index values ​​can be used as load information when drawing the model. For example, if the drawing instruction of the first model includes 5235 index values, "5235 index values" can be used as load information.

[0149] S302. When the load information does not meet the preset condition, execute S306. When the load information meets the preset condition, execute S303.

[0150] When determining whether the load information of the first model meets the preset conditions, the type of the drawing instruction of the first model can be first obtained. Different types of drawing correspond to different load thresholds, and the corresponding load threshold can be determined based on the type of the drawing instruction of the first model. For example, the glDrawElements instruction in the OpenGL for embedded systems (GLES) can be used to draw a mesh model containing an index. The glDrawElementInstanced instruction is used to simultaneously draw multiple models containing the same index or vertex. For example, the glDrawElementInstanced instruction can be used to draw trees, grass, flowers, stones, etc.

[0151] For example, when using the glDrawElementInstanced instruction as a drawing instruction, the drawing instruction includes the number of indices required to draw a model and the number of models to be drawn. The load threshold corresponding to the instruction can be determined based on the number of indices and the number of models to be drawn.

[0152] For example, if a drawing instruction instructs to draw five models with an index value of 1500, the load information of the drawing instruction is 7500 index values. Based on the hardware parameters and operating status of the terminal device, it can be determined that drawing models with 7500 index values ​​will cause a large load. In this case, the load threshold can be set to 4500 to simplify the first model and reduce the load.

[0153] When the load information of the first model acquired in S301 is greater than the corresponding load threshold, it is determined that the load information of the first model meets the preset condition.

[0154] In one example, referring to the example in S301, if the load information of the first model is "5235 index values", and the corresponding load threshold is 4500 index values. The load information of the first model is greater than the corresponding load threshold (5235 > 4500), that is, the load information of the first model meets the preset condition. The first model needs to be simplified.

[0155] In another example, if the load information of the first model is "3324 index values", and the corresponding load threshold is "4500 index values", then the load information of the first model is less than the corresponding load threshold (3324 < 4500), that is, the load information of the first model does not meet the preset condition. The first model does not need to be simplified, and the first model can be directly used for display.

[0156] It should be noted that in this application, model simplification refers to generating an LODX model of the first model according to the rendering instructions of the first model. For example, if the original first model is LOD0, the model simplification can generate an LOD1 model of the first model. Alternatively, an LOD2 model, an LOD3 model, etc. can also be generated, and the number of generated LOD models is not limited herein. Among them, the LODX model can be generated at one time, so as to facilitate subsequent use, or the corresponding LOD model can be generated when needed, and the application also does not limit this.

[0157] S303, match the corresponding second model for the first model, if the matching is successful, execute S304; if the matching fails, execute S305 and S306.

[0158] S304, obtain the rendering instructions of the second model.

[0159] In some embodiments, matching the corresponding second model for the first model can first obtain the vertex and / or index value included in the rendering instructions of the first model. Then, according to the vertex and / or index value, match the second model corresponding to the first model in the pre-stored multi-detail level matching table.

[0160] It should be noted that the multi-detail level matching table includes the correspondence between the rendering instructions of the first model and the second model. The multi-detail level matching table can be stored in the database shown in FIG. 1, and the database can be a database local to the terminal device or a database set on another device, such as a server-side database or a cloud-side database, etc. Figure 3

[0161] If the second model corresponding to the first model is matched in the multi-detail level matching table, it indicates that the rendering instructions of the second model corresponding to the first model are pre-stored in the database. In this case, the rendering instructions of the second model can be found and obtained in the database.

[0162] ​In a possible implementation, one first model can correspond to multiple second models, each of which is a LODX model corresponding to the first model, and a LOD level of the first model can be determined according to a calling strategy of the LOD.

[0163] For example, if a distance between the first model and a perspective camera in a scene is less than 20 meters, the LOD level of the first model can be determined as LOD0; if the distance between the first model and the perspective camera in the scene is greater than 20 meters and less than 100 meters, the LOD level of the first model can be determined as LOD1; and if the distance between the first model and the perspective camera in the scene is greater than 100 meters, the LOD level of the first model can be determined as LOD2.

[0164] Optionally, when determining the LOD level, a proportion of pixels occupied by the first model in all pixels of a display screen, a display time length of the first model, and the like can be considered, which are not limited in the present application.

[0165] In some embodiments, if the matching fails, a model structure category of the first model is further obtained, so as to generate the drawing instruction of the second model according to the model structure category of the first model.

[0166] The model structure category includes a mesh structure or a patch structure. The model of the mesh structure is a model established by using a mesh to draw a surface shape of the model. For example, referring to a canyon model shown in FIG. 1, a surface terrain of the canyon is drawn by using a mesh, and a map corresponding to the terrain is rendered on the mesh, so as to obtain the canyon model. Figure 5 The model of the patch structure is a model obtained by drawing multiple independent patches and then aggregating the multiple patches into one model. For example, referring to a tree model shown in FIG. 2, a map of a tree leaf is rendered on a drawn patch, and each patch is aggregated on a trunk and branches, so as to obtain the tree model.

[0167] The model of the patch structure is a model obtained by drawing multiple independent patches and then aggregating the multiple patches into one model. For example, referring to a tree model shown in FIG. 2, a map of a tree leaf is rendered on a drawn patch, and each patch is aggregated on a trunk and branches, so as to obtain the tree model. Figure 1 The model of the patch structure is a model obtained by drawing multiple independent patches and then aggregating the multiple patches into one model. For example, referring to a tree model shown in FIG. 2, a map of a tree leaf is rendered on a drawn patch, and each patch is aggregated on a trunk and branches, so as to obtain the tree model.

[0168] In a possible implementation, the model structure of the first model can be determined according to index values in each index sequence in the drawing instruction of the first model. Since the first model is drawn according to the index values to find corresponding vertices and then drawn according to the vertices, the number of the index values and the numerical relationship between the index values can be used to identify the model structure of the first model.

[0169] In one implementation, if the number of index values in each group of index values in the index sequence is 6, and the 6 index values include 2 pairs of identical index values and 2 index values that are different from the other index values, then the model structure is determined to be a patch structure. Otherwise, the model structure is determined to be a mesh structure.

[0170] As an example, reference can be made to Figure 6 As shown in the patch structure, 1, 2, 3, and 4 are four vertices of the patch structure. Since only triangular faces can be drawn when drawing a model, a patch structure needs to be composed of two triangular faces. When drawing, the index sequence of the patch is "1-2-3-1-3-4", that is, it includes 2 "1"s, 2 "3"s, 1 "2", and 1 "4". That is, a model whose index sequence conforms to this rule can be determined to be a patch structure model, otherwise, it is determined to be a mesh structure model.

[0171] S305, generating drawing instructions of the second model according to the drawing instructions of the first model.

[0172] In some embodiments, if no second model corresponding to the first model is matched in the multi-detail level matching table, it indicates that there is no drawing instruction of the second model corresponding to the first model in the database. In this case, the drawing instructions of the second model can be generated according to the drawing instructions of the first model.

[0173] It should be noted that when generating the drawing instructions of the second model, the LOD level of the generated second model can be determined according to the calling strategy of the LOD, and the LODX model of the corresponding level can be generated. Alternatively, a plurality of second models can also be generated, each corresponding to an LOD model of a different level, such as two second models, one being an LOD1 model and the other being an LOD2 model. When generating a plurality of LOD models, the LODX model that needs to be called can be generated first according to the calling strategy of the LOD, and then the remaining LODX models can be generated when idle. For example, if the calling strategy of the LOD determines that the LOD1 model needs to be displayed, the LOD1 model can be generated first when generating a plurality of second models, and then the LOD2 model can be generated when idle.

[0174] Here, the generation of the drawing instructions of one second model according to the drawing instructions of the first model is taken as an example for description, and it should be clear to those skilled in the art that the generation of a plurality of second models can also be implemented according to the following method.

[0175] When generating the drawing instructions of the second model, the model structure of the first model needs to be considered. Different simplification methods will be adopted for mesh structures or patch structures.

[0176] In some embodiments, when the model structure category is a mesh structure, a three-dimensional mesh simplification algorithm can be used to simplify the mesh surface. In the simplification process, the vertex values are not changed, and only the index values are simplified. Thus, in the instruction reconstruction layer, new vertices do not need to be created, and only new index sequences need to be created, which can improve the drawing efficiency and make the generated database smaller.

[0177] In some other embodiments, when the model structure category is a patch structure, a simplification method based on spatial density can be used to simplify the first model and obtain the drawing instructions of the second model.

[0178] In some embodiments, the spatial density refers to the distribution density of the patch in the first model. In order to quantify the spatial density, the distribution characteristics of each patch in the first model can be obtained, which are used to represent the distribution of the patch in the first model.

[0179] In some embodiments, with reference to Figure 7 Each patch can be mapped into a spatial grid coordinate system (X, Y, Z). In some embodiments, the spatial grid coordinate system is a three-dimensional coordinate system, and the grid is a three-dimensional grid. Figure 7 The first patch 71, the second patch 72, and the third patch 73 are shown. In order to quantify more clearly, the feature points of each patch need to be obtained, which include the vertices of the patch and at least one sampling point arranged in the patch. As an example, three sampling points 712 can be arranged in the first patch 71. The feature points of the first patch include the four vertices 711 of the first patch 71 and the three sampling points 712.

[0180] After each patch is mapped into the spatial grid coordinate system, the feature points of the patch are distributed in multiple grids of the spatial grid coordinate system. Then, the density of each grid in the spatial grid coordinate system and the number of occurrences of each patch in the grid can be obtained as parameters for quantifying the spatial density.

[0181] In some embodiments, the density of each grid includes the number of patches contained in each grid. In obtaining the density of the grid, the density of the grid can be determined according to the feature points included in each grid in the grid coordinate system and the patch corresponding to each feature point. Correspondingly, after obtaining all the grid densities, the number of occurrences of each patch in the grid can also be counted.

[0182] As an example, there are 21 grids in the spatial grid coordinate system, and there are 11 patches, and the patch labels are patch 0 to patch 11. In the grid density statistics, the grid density statistics table shown in Table 1 can be obtained.

[0183] Table 1

[0184]

[0185]

[0186] According to the statistics in Table 1, the following can be obtained Figure 8 The statistical chart is shown. Referring to Table 1 and Figure 8 It can be obtained that the grid density of grid 0 is the smallest, in which there is only one patch 5, and the grid density of grid 4 and grid 14 is the largest, which includes 9 different patches. That is, in grid 4 and grid 14, multiple drawings will be performed, and the patches drawn repeatedly overlap each other, and there is a repeated drawing.

[0187] In some embodiments, the grid can be simplified in a recursive culling manner.

[0188] In a possible embodiment, the grids can be sorted according to the density of each grid. Then, the patches in the i grids with the largest grid density after sorting are sorted according to the number of occurrences of the patches. Finally, the grids are thinned according to the k patches with the largest number of occurrences after sorting and the patches in the j grids with the smallest grid density after sorting, to reduce the number of patches in each grid, to obtain the thinned grids, i and k are integers greater than 1, and j is a natural number.

[0189] It should be noted that when thinning, the patches in the j grids with the smallest grid density after sorting can be retained to prevent empty grids from appearing in the thinned grids.

[0190] In the recursive culling, the degree of thinning of the grids can be controlled to obtain models of different LOD levels. As an example, 1-3 patches are retained in each grid to generate an LOD1 model. 0-2 patches are retained in each grid to generate an LOD2 model. The relationship between the number of patches retained in the grid and the LOD level is only an example, which is not limited herein.

[0191] As an example, referring to Table 1 and Figure 8 The grid densities in Table 1 are arranged to obtain Table 2.

[0192] In Table 2, the grids are thinned, taking LOD1 as an example.

[0193] Table 2

[0194]

[0195]

[0196] In this embodiment, k is 7, i is 10, and j is 3. Then, the first 10 rows of grids are counted to obtain Table 3, and the last 3 rows of grids are counted to obtain Table 4:

[0197] Table 3

[0198] Patch Label Number of occurrences in the first 10 rows 7 10 2 9 3 9 5 9 4 8 1 7 6 7 8 6 9 6 10 3 0 2

[0199] Table 4

[0200]

[0201]

[0202] In an implementation, the patches appearing in the last three rows (mesh 3, mesh 6 and mesh 0) can be retained, so that after sparsification, the patches in mesh 3, mesh 6 and mesh 0 are not deleted, resulting in no patches in mesh 3, mesh 6 and mesh 0, which affects the visual effect of the model.

[0203] In this case, the patches appearing most frequently after sorting are patch 7, patch 2, patch 3, patch 5, patch 4, patch 1, patch 6, patch 8, patch 9, patch 10 and patch 0. The patches to be retained are patch 4, patch 5, patch 6 and patch 7. Therefore, patch 2, patch 3, patch 5, patch 1, patch 8, patch 9 and patch 10 in the mesh can be removed. It should be noted that patch 0 can not be removed because of its low frequency of appearance.

[0204] After removing the patches in the mesh, Table 5 can be obtained.

[0205] Table 5

[0206] Grid number Patch Label Patch Label Patch Label Patch Label Density 0 5 1 1 4 1 2 4 6 5 7 4 3 4 7 2 4 6 5 4 7 4 5 5 4 7 3 6 5 4 7 0 4 7 5 4 7 6 4 8 6 7 2 9 5 1 10 4 7 5 6 4 11 6 7 5 3 12 6 7 5 4 4 13 5 7 2 14 7 4 5 0 4 15 5 7 6 4 4 16 5 6 2 17 6 5 4 3 18 7 0 6 3 19 6 5 7 3 20 6 1

[0207] According to the statistics in Table 5, it can be obtained that Figure 9 the statistical chart shown. It can be seen that Figure 9 the mesh density in the second model is more uniform, and the number of patches in the high-density mesh is significantly reduced.

[0208] Finally, the rendering instructions of the second model can be generated according to the index order of the patches in each sparsified mesh.

[0209] In some implementations, reference can be made to Figure 10 which includes the first model 1001 and the second model 1002 obtained by simplifying the first model 1001 based on the spatial density simplification method. It can be clearly seen from Figure 10 that the contour of the second model 1002 is close to that of the first model 1001, but its interior is more sparse than that of the first model 1001. The boundary structure of the tree leaves is preserved as much as possible while reducing the sparseness of the tree leaves, so that the tree leaves have good visual effects.

[0210] In some embodiments, when generating the drawing instructions for the second model, the generation status of the drawing instructions for the second model may be obtained first. If the generation status of the drawing instructions for the second model is incomplete, the first model is continuously drawn according to the drawing instructions for the first model and displayed. If the generation status of the drawing instructions for the second model is completed, a correspondence between the drawing instructions for the first model and the second model is generated and stored in a multi-level-of-detail matching table.

[0211] In this embodiment, simplifying the first model and obtaining the drawing instructions for the second model takes a certain amount of time. During this process, the camera's perspective may change, such as by turning and / or moving. When the camera's perspective changes, the position of the model in the scene also changes. This necessitates redrawing the first model. Before redrawing the first model, the generation status of the drawing instructions for the second model is obtained. If the generation status has not yet occurred, the drawing of the first model continues. If the generation status has already occurred, a correspondence between the drawing instructions for the first model and the second model is generated and stored in a multi-level-of-detail matching table before executing subsequent steps.

[0212] S306: Draw the first model according to the drawing instruction of the first model and display it.

[0213] In some embodiments, since it has not yet been determined whether the first model requires model simplification during scene rendering, the first model may be rendered and displayed first to present the complete scene. If it is determined that the load information of the first model does not meet the preset conditions, i.e., the first model does not require model simplification, the first model continues to be used for display.

[0214] S307: Draw the second model according to the drawing instruction of the second model.

[0215] S308: Display the second model in the display area of ​​the first model.

[0216] In some embodiments, reference Figure 11 , Figure 11 Figure a shows a scene before replacement, which includes two first models 1001. The two first models are at different distances from the view camera, but the LOD models corresponding to the first models were not obtained when the scene was created. Therefore, the LOD technology cannot be used to simplify the first model 1001 that is farther away.

[0217] In this embodiment, after obtaining the drawing instruction of the second model, the second model is drawn according to the drawing instruction of the second model. After the second model is drawn, the drawing of the first model to be replaced (such as Figure 11 The first model 1001 is shown as the farther one in a). Then the second model that has been rendered is replaced to the display area of ​​the first model that needs to be replaced.Figure 11 In b, after the replacement is completed, the first model 1001 that was originally farther away has been replaced by the second model 1002.

[0218] Figure 12 A schematic diagram of an application scenario of the model simplification method provided in this application is shown.

[0219] In some embodiments, reference Figure 3 and Figure 12 , model simplification is applied to the recognition module, the streamlined module, and the replacement module. Among them, steps S301-S304 and S306 can be performed by the recognition module, and the recognition module runs in the main thread, that is, S301-S304 and S306 are executed by the main thread. The main thread refers to the thread occupied by the APP that performs model drawing, and the main thread can run in the CPU's large core.

[0220] S305 is executed by the simplification module. When executing the method in S305, the simplification module can first establish a simplified model thread specifically for simplifying the first model. The simplified model thread can run in the small core of the CPU. The established simplified model thread accepts the model simplification request sent by the main thread, and then simplifies the first model according to the model simplification request to obtain the drawing instructions for the second model. The model simplification request may include the drawing instructions for the first model and the model structure type of the first model. Finally, after obtaining the drawing instructions for the second model, the simplification module sends the drawing instructions for the second model to the replacement module.

[0221] In some implementations, after the simplification module completes simplification of the first model, the simplified model thread may be destroyed and the simplified model thread may be re-established until model simplification is performed again.

[0222] After receiving the drawing instructions for the second model, the replacement module executes the methods in S307 and S308. The replacement module also runs on the main thread. The replacement module first sends the drawing instructions for the second model to the instruction reassembly module. The instruction reassembly module optimizes and reassembles the instructions based on the received drawing instructions for the second model, then sends them to the GPU driver for rendering, resulting in the second model. Finally, the replacement module replaces the second model into the scene based on parameters such as the second model's LOD level and the distance between the camera and the model.

[0223] like Figure 12 As shown, after the second model is replaced into the scene, the frames per second (FPS) of the terminal device when displaying the picture is effectively improved, that is, the displayed picture is smoother.

[0224] Figure 13A flowchart showing another model simplification method is shown.

[0225] Reference Figure 13 In this embodiment, the model simplification method comprises:

[0226] S1301, obtaining the rendering instruction of the first model.

[0227] S1302, obtaining the number of index values in the rendering instruction of the first model according to the rendering instruction of the first model.

[0228] S1303, whether the number of index values is greater than or equal to a preset threshold, if greater than or equal to, executing S1304; if less than, executing S1305.

[0229] S1304, in the multi-detail level matching table, whether the corresponding second model is matched according to the rendering instruction of the first model, if matched, executing S1310; if not matched, executing S1305 and S1306.

[0230] S1305, rendering and displaying the first model according to the rendering instruction of the first model.

[0231] S1306, obtaining the model structure of the first model according to the rendering instruction of the first model.

[0232] S1307, whether the model structure of the first model is a facet structure, if yes, executing S1308, if not, executing S1309.

[0233] S1308, simplifying the first model by the simplification method based on spatial density, generating the rendering instruction of the second model, and executing S1311.

[0234] S1309, simplifying the first model by the three-dimensional mesh simplification algorithm, generating the rendering instruction of the second model, and executing S1311.

[0235] S1310, obtaining the rendering instruction of the second model.

[0236] S1311, rendering the second model according to the rendering instruction of the second model.

[0237] S1312, stopping rendering the first model.

[0238] S1313, displaying the second model in the display area of the first model.

[0239] Among them, the implementation of each step method in S1301-S1313 is the same as that in S301-S309, which will not be repeated here.

[0240] Based on S1301-S1313, the model simplification method provided in this application is further explained by taking game applications as an example.

[0241] In some implementations, specific load information and mesh structure determination criteria can be added for different game applications and the engines used in developing them. This allows for more accurate determinations of whether model simplification is necessary and whether the model is a mesh structure. For example, for the NeoX engine, index count and draw call offset can be added as load information. The glDarwElementInstanced function can also be used to assist in determining whether the model structure is a mesh structure.

[0242] As an example, when simplifying the first model, taking the tree model as an example, the patch culling rate can be set to 16%, that is, 16% of high-frequency patches are eliminated. The spatial grid size is set to 24*48*24, and 26 sampling points are set on each patch, that is, each patch includes 30 feature points.

[0243] refer to Figure 14 , Figure 14 The a in the figure is the first model, which includes 5235 index values. After removing 16% of the faces, the index value is 4389, which is Figure 14 The second model shown in b.

[0244] Correspondingly, for the grid structure model, you can refer to Figure 15 、 Figure 16 ,as well as Figure 17 .

[0245] in, Figure 15 The a in the figure is the first model, which includes 6144 index values. After removing 16% of the faces, the index values ​​are 2316, which is Figure 15 The second model shown in b.

[0246] Figure 16 The a in the figure is the first model, which includes 23070 index values. After removing 16% of the faces, the index value is 9642, which is Figure 16 The second model shown in b.

[0247] Figure 17 The a in the figure is the first model, which includes 6702 index values. After removing 16% of the faces, the index values ​​are 3486, which is Figure 17 The second model shown in b.

[0248] After the game application is processed by the model simplification method provided in the application, the face elimination rate of the game application is in the range of 15% to 17%, and the frame rate of the game picture is increased by 7% to 10%.

[0249] It should be understood that the size of the serial number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the application.

[0250] According to the method provided in the above embodiment, Figure 18 The structural block diagram of the model simplification device provided in the embodiments of the application is shown, and only the parts related to the embodiments of the application are shown for the convenience of description.

[0251] With reference to Figure 18 The device comprises:

[0252] The acquisition module 1801 is configured to acquire load information when the first model is rendered according to rendering instructions of the first model.

[0253] The acquisition module 1801 is further configured to acquire rendering instructions of a corresponding second model according to the rendering instructions of the first model when the load information meets a preset condition.

[0254] The rendering module 1802 is configured to render and display the second model according to the rendering instructions of the second model.

[0255] In some embodiments, the corresponding second model is matched for the first model.

[0256] When the matching is successful, the acquisition module 1801 is specifically configured to acquire the rendering instructions of the second model.

[0257] When the matching fails, with reference to Figure 19 The device further comprises a generation module 1803 configured to generate the rendering instructions of the second model.

[0258] In some embodiments, when the matching fails, the generation module 1803 is specifically configured to acquire a model structure category of the first model. The rendering instructions of the second model are generated according to the model structure category and the rendering instructions of the first model.

[0259] In some embodiments, the rendering instructions comprise a plurality of vertices and a plurality of index sequences, each index sequence comprises a plurality of index values arranged in sequence, each index value corresponds to a vertex, and the model structure category comprises a mesh structure or a face structure.

[0260] The generation module 1803 is specifically configured to acquire the index values included in each index sequence in the rendering instructions of the first model. According to the index values in each index sequence, it is determined that the model structure of the first model is a mesh structure or a face structure.

[0261] In some embodiments, the generation module 1803 is specifically configured to determine that the model structure is a patch structure if the number of index values in each group of index sequences is 6, and the 6 index values include 2 pairs of identical index values and 2 index values that are different from each other. Otherwise, it is determined that the model structure is a mesh structure.

[0262] In some embodiments, when the model structure category is a patch structure, each group of index sequences is used to draw a patch.

[0263] The generation module 1803 is specifically configured to, when the model structure category is a patch structure, obtain the distribution characteristics of each patch in the first model according to the drawing instruction of the first model. According to the distribution characteristics and the drawing instruction of the first model, the drawing instruction of the second model is generated.

[0264] In some embodiments, the generation module 1803 is specifically configured to map each patch to a spatial mesh coordinate system. The density of each mesh in the spatial mesh coordinate system and the number of occurrences of each patch in the mesh are obtained, and the density of each mesh includes the number of patches contained in each mesh.

[0265] In some embodiments, the generation module 1803 is specifically configured to sort the meshes according to the density of each mesh. The patches in the i meshes with the largest mesh density after sorting are sorted according to the number of occurrences of the patches. The i meshes with the largest mesh density after sorting are sparsified according to the k patches with the most occurrences after sorting, to reduce the number of patches in each mesh, to obtain the sparsified meshes, and i and k are integers greater than 1. According to the index sequence corresponding to the patches in each sparsified mesh, the drawing instruction of the second model is generated.

[0266] In some embodiments, the generation module 1803 is specifically configured to obtain the patches that occur in the j meshes with the smallest mesh density after sorting, and j is a natural number. Each mesh is sparsified according to the patches that occur in the j meshes with the smallest mesh density and the k patches with the most occurrences after sorting, to reduce the number of patches in the mesh, to obtain the sparsified meshes.

[0267] In some embodiments, the generation module 1803 is specifically configured to obtain the feature points of each patch, and the feature points of the patch include the vertices of the patch and at least one sampling point arranged inside the patch. The feature points included in the mesh are obtained, and the density of the mesh is determined according to the patches corresponding to each feature point.

[0268] In some embodiments, the acquisition module 1801 is specifically configured to obtain the number of vertices and / or the number of index values included in the drawing instruction, and the load threshold corresponding to the instruction type of the drawing instruction.

[0269] The load information satisfies a preset condition, including: the number of vertices and / or the number of index values is greater than or equal to a load threshold.

[0270] In some embodiments, the obtaining module 1801 is specifically configured to obtain the vertices and / or the index values included in the rendering instruction of the first model. According to the vertices and / or the index values, a second model corresponding to the first model is matched in a pre-stored multi-detail level matching table, and the multi-detail level matching table includes a corresponding relationship between the rendering instruction of the first model and the second model.

[0271] In some embodiments, after obtaining the load information when rendering the first model according to the rendering instruction of the first model, the rendering module 1802 is further configured to render and display the first model according to the rendering instruction of the first model.

[0272] In some embodiments, when the load information satisfies the preset condition, the obtaining module 1801 is specifically configured to obtain a generation state of the rendering instruction of the second model. If the generation state of the rendering instruction of the second model is incomplete, the first model is rendered and displayed according to the rendering instruction of the first model.

[0273] In some embodiments, when the load information satisfies the preset condition, the obtaining module 1801 is specifically configured to obtain a generation state of the rendering instruction of the second model. If the generation state of the rendering instruction of the second model is complete, a corresponding relationship between the rendering instruction of the first model and the second model is generated and stored in the multi-detail level matching table.

[0274] In some embodiments, the rendering module 1801 is specifically configured to render the second model according to the rendering instruction of the second model. The rendering of the first model is stopped. The second model is displayed in the display area of the first model.

[0275] It should be noted that the information interaction, execution process and the like between the above modules are based on the same concept as the method embodiments of the present application, and the specific functions and technical effects brought by them can be referred to the method embodiment part. Therefore, details are not repeated here.

[0276] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0277] Figure 20 This is a schematic diagram of the structure of a terminal device provided in one embodiment of the present application. Figure 20 As shown, the terminal device 20 of this embodiment includes: at least one processor 2001 ( Figure 20 Only one processor is shown in the figure), a memory 2002, and a computer program 2003 stored in the memory 2002 and executable by at least one processor 2001. The processor 2001 executes the computer program 2003 to implement the steps in the above method embodiment.

[0278] The terminal device 20 can be a mobile phone, desktop computer, notebook, PDA, cloud server, etc. The terminal device may include, but is not limited to, a processor 2001 and a memory 2002. Those skilled in the art will understand that Figure 11 This is merely an example of the terminal device 20 and does not constitute a limitation on the terminal device 20 . The terminal device 20 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0279] The processor 2001 can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0280] The memory 2002 can be an internal storage unit of the terminal device 20, such as a hard disk or a memory of the terminal device 20 in some embodiments. The memory 2002 can also be an external storage device of the terminal device 20, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 20 in some other embodiments. Further, the memory 2002 can include both the internal storage unit and the external storage device of the terminal device 20. The memory 2002 is used to store an operating system, an application program, a boot loader, data, and other programs, such as program codes of computer programs, etc. The memory 2002 can also be used to temporarily store data that has been output or is to be output.

[0281] The embodiments of the present application further provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the steps in the above various method embodiments.

[0282] The embodiments of the present application provide a computer program product. When the computer program product is run on a mobile terminal, the mobile terminal is caused to implement the steps in the above various method embodiments.

[0283] The embodiments of the present application provide a chip system. The chip system includes a memory and a processor. The processor executes a computer program stored in the memory to implement the steps in the above various method embodiments.

[0284] The embodiments of the present application provide a chip system. The chip system includes a processor. The processor is coupled with the above computer readable storage medium. The processor executes a computer program stored in the computer readable storage medium to implement the steps in the above various method embodiments.

[0285] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the present application can implement all or part of the processes in the above-mentioned embodiment methods through a computer program to instruct related hardware to complete, and the computer program can be stored in a computer readable storage medium. When the processor executes the computer program, the steps of each method embodiment described above can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms. The computer readable medium at least includes any entity or device capable of carrying the computer program code to the terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, according to legislation and patent practice, the computer readable medium can not be an electrical carrier signal and a telecommunication signal.

[0286] The embodiment of the present application provides a chip system, and the chip system includes a memory and a processor. The processor executes a computer program stored in the memory to implement the steps in each method embodiment described above.

[0287] The embodiment of the present application provides a chip system, and the chip system includes a processor. The processor is coupled with a computer readable storage medium. The processor executes a computer program stored in the computer readable storage medium to implement the steps in each method embodiment described above.

[0288] In the above embodiments, the description of each embodiment has its own focus. The parts not described or recorded in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0289] Those skilled in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0290] In the embodiments of the present disclosure, it should be understood that the disclosed method, device and terminal equipment can be implemented in other ways. For example, the device embodiments described above are only schematic. The division of the modules or units is only a logical function division. There can be another division during actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between the units can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or in other forms.

[0291] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e. can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.

[0292] Finally, it should be noted that: the above description is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any change or replacement within the technical scope disclosed in the present application should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A model reduction method, characterized by, The method comprises: obtaining load information when rendering the first model according to rendering instructions of the first model; when the load information meets a preset condition, obtaining rendering instructions of a corresponding second model according to the rendering instructions of the first model; rendering and displaying the second model according to the rendering instructions of the second model; when the model structure category of the first model is a patch structure, the obtaining of the rendering instructions of the second model according to the rendering instructions of the first model comprises: mapping each patch in the first model to a spatial grid coordinate system according to the rendering instructions of the first model; obtaining the density of each grid in the spatial grid coordinate system, wherein the density of each grid comprises the number of patches contained in each grid; sorting the grids according to the density of each grid; sorting the patches in the i grids with the largest grid density after sorting according to the number of occurrences of the patches; obtaining the patches occurring in the j grids with the smallest grid density after sorting, j being a natural number; sparsifying each grid according to the patches occurring in the j grids with the smallest grid density and the k patches with the largest number of occurrences after sorting, reducing the number of patches in the grid, to obtain a sparse grid, wherein the sparse grid does not include the patches with a number of occurrences greater than a preset number of occurrences and not occurring in the j grids with the smallest grid density; i and k are integers greater than 1; and generating the rendering instructions of the second model according to the index order of the patches in each sparse grid.

2. The method of claim 1, wherein, The obtaining of the rendering instructions of the second model according to the rendering instructions of the first model comprises: matching the first model with a corresponding second model; when the matching is successful, obtaining the rendering instructions of the second model; when the matching fails, generating the rendering instructions of the second model.

3. The method of claim 2, wherein, The generating of the rendering instructions of the second model when the matching fails comprises: obtaining the model structure category of the first model; generating the rendering instructions of the second model according to the model structure category and the rendering instructions of the first model.

4. The method of claim 3, wherein, The rendering instructions comprise a plurality of vertices and a plurality of index orders, each index order comprises a plurality of index values arranged in order, each index value corresponds to a vertex, and the model structure category comprises a grid structure or a patch structure; the obtaining of the model structure category of the first model comprises: obtaining the index values included in each index order in the rendering instructions of the first model; determining the model structure of the first model to be the grid structure or the patch structure according to the index values in each index order.

5. The method of claim 4, wherein, The determining of the model structure of the first model to be the grid structure or the patch structure according to the index values in each index order comprises: if the number of index values in each index order is 6, and 2 pairs of index values in the 6 index values are the same and 2 index values are different from other index values, then the model structure is determined to be a patch structure; otherwise, the model structure is determined to be a grid structure.

6. The method of claim 1, wherein, The acquiring the density of each grid in the space grid coordinate system comprises: Acquiring feature points of each of the patches, the feature points of the patch comprising vertices of the patch and at least one sampling point arranged inside the patch; Acquiring the feature points included in the grid, and determining the density of the grid according to the patch corresponding to each of the feature points.

7. The method of claim 1, wherein, The acquiring the load information when the first model is drawn comprises: Acquiring a vertex quantity and / or an index value quantity included in the drawing instruction, and a load threshold corresponding to an instruction type of the drawing instruction; The load information satisfies a preset condition, which comprises: The vertex quantity and / or the index value quantity is greater than or equal to the load threshold.

8. The method of claim 2, wherein, The matching the corresponding second model for the first model comprises: Acquiring a vertex and / or an index value included in the drawing instruction of the first model; Matching the second model corresponding to the first model in a pre-stored multi-detail level matching table according to the vertex and / or the index value, the multi-detail level matching table comprising a corresponding relationship between the drawing instruction of the first model and the second model.

9. The method according to any one of claims 1 to 8, characterized in that, After the acquiring the load information when the first model is drawn according to the drawing instruction of the first model, the method further comprises: Drawing and displaying the first model according to the drawing instruction of the first model.

10. The method of claim 9, wherein, When the load information satisfies the preset condition, the acquiring the drawing instruction of the corresponding second model according to the drawing instruction of the first model comprises: Acquiring a generation state of the drawing instruction of the second model; If the generation state of the drawing instruction of the second model is not completed, drawing and displaying the first model according to the drawing instruction of the first model.

11. The method of claim 9, wherein, When the load information satisfies the preset condition, the acquiring the drawing instruction of the corresponding second model according to the drawing instruction of the first model comprises: Acquiring a generation state of the drawing instruction of the second model; If the generation state of the drawing instruction of the second model is completed, generating a corresponding relationship between the drawing instruction of the first model and the second model, and storing the corresponding relationship in a multi-detail level matching table.

12. The method according to claim 10 or 11, characterized in that, The drawing and displaying the second model according to the drawing instruction of the second model comprises: Drawing the second model according to the drawing instruction of the second model; Displaying the second model in a display area of the first model.

13. A model reduction apparatus, characterized by, The device comprises: An acquiring module, configured to acquire load information when a first model is drawn according to a drawing instruction of the first model; The acquiring module is further configured to acquire a drawing instruction of a corresponding second model according to the drawing instruction of the first model when the load information satisfies a preset condition; A drawing module, configured to draw and display the second model according to the drawing instruction of the second model. The generating module is configured to, when the model structure category of the first model is a patch structure, map each patch in the first model into a spatial grid coordinate system according to drawing instructions of the first model; obtain a density of each grid in the spatial grid coordinate system, the density of each grid including a number of patches contained in each grid; sort the grids according to the density of each grid; sort patches in i grids with the largest grid density after sorting according to the number of occurrences of the patches; obtain patches occurring in j grids with the smallest grid density after sorting, j being a natural number; sparsify each grid according to the patches occurring in the j grids with the smallest grid density and k patches with the largest number of occurrences after sorting, reduce the number of patches in the grid, and obtain a sparse grid, the sparse grid not including patches in the k patches with a number of occurrences greater than a preset number of occurrences and not occurring in the j grids with the smallest grid density; i and k are integers greater than 1; and generate drawing instructions of the second model according to an index order of the patches in each sparse grid.

14. A terminal device comprising at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the computer program comprises instructions for causing the at least one processor to perform the method according to any one of claims 1 to 13. The computer program is executed by the processor to implement the method of any one of claims 1 to 12.

15. A computer program product, the computer program product storing a computer program, characterized in that, The computer program is executed by the processor to implement the method of any one of claims 1 to 12.

Citation Information

Patent Citations

  • Image drawing method and image drawing device

    CN111476872A