Method, system, electronic device and storage medium for rendering thickness of three-dimensional model
By obtaining the status information of the three-dimensional model and using spherical harmonic parameter processing, combined with the preset viewing angle to obtain the thickness value, the problem in the existing technology that the transparency of the three-dimensional model cannot meet any viewing angle change is solved, and the rendering effect is improved.
Patent Information
- Application Number
- CN202011095604.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-14
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-10-14
AI Technical Summary
The transparency of the three-dimensional model obtained in the existing technology cannot meet the problem of the transparency change at a certain point of the model at any viewing angle, resulting in poor rendering effects.
By obtaining the status information of the target to be rendered, including the preset position, normal and angle of view, the spherical harmonic parameters are obtained through pre-calculation processing and saved in the vertex color value. The thickness value is obtained by combining the preset angle of view during rendering. Achieve correct rendering of 3D models.
It achieves the correct expression of the model thickness value under different viewing angles, improves the rendering effect, and solves the problem in the existing technology that the thickness value does not change with the viewing angle, resulting in poor rendering effect.
Smart Images

Figure CN112288839B
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a method, system, electronic device and storage medium for rendering the thickness of a three-dimensional model. Background Art
[0002] Model rendering is widely used in the film, animation, game and other industries. With the development of image processing technology and the improvement of computer performance, users' requirements for rendering effects have also increased. Among them, in the rendering process, the rendering method of the transparency of 3D models plays a key role in related technologies.
[0003] In the related art, Figure 1 It is a schematic diagram of the change of model thickness with viewing angle in the related art, such as Figure 1 As shown, the gray area represents the model to be rendered, point P is a certain position on the model, and V is a certain preset viewing angle passing through point P. In the related art, an average thickness value is generally pre-baked at a certain position P on the model, and the transparency of the position in the three-dimensional model is simulated according to the average thickness value. The subsequent rendering process is performed based on the transparency. This method cannot meet the change of the thickness of the model at point P under any viewing angle V.
[0004] Currently, there is no effective solution to the problem that the model transparency obtained in related technologies cannot meet the transparency change of a certain point in the model under any viewing angle. Summary of the invention
[0005] The embodiments of the present application provide a method, device, system, electronic device and storage medium for rendering the thickness of a three-dimensional model, so as to at least solve the problem that the model transparency obtained in the related art cannot satisfy the transparency change of a certain point of the model at any viewing angle.
[0006] In a first aspect, an embodiment of the present application provides a method for rendering the thickness of a three-dimensional model, the method comprising: obtaining state information of a target to be rendered, the state information comprising a first preset position, a normal, and a preset viewing angle; based on the state information, obtaining spherical harmonic parameters of the thickness at the first preset position through pre-calculation processing, saving the spherical harmonic parameters in the vertex color values, and when rendering, obtaining a thickness value by combining the preset viewing angle and the spherical harmonic parameters; and rendering the three-dimensional model instance based on the thickness value.
[0007] In some embodiments, obtaining the thickness value by combining the preset viewing angle and the spherical harmonic parameters includes: obtaining the thickness value by performing a dot product calculation on the spherical harmonic parameters and the preset viewing angle.
[0008] In some embodiments, the spherical harmonic parameters of the thickness at the first preset position are obtained through pre-calculation processing based on the state information, including: moving along the normal at the first preset position to obtain a second preset position, wherein the second preset position is inside the model to be rendered; generating a cubic mapping through the camera at the second preset position, and generating a direction set through Monte Carlo random sampling; obtaining the depth value of the cubic mapping of the model on the direction set, obtaining the initial spherical harmonic parameters corresponding to each direction by substituting the depth value into the spherical harmonic formula, and then integrating the initial spherical harmonic parameters to obtain the spherical harmonic parameters.
[0009] In a second aspect, an embodiment of the present application provides a system for rendering the thickness of a three-dimensional model, the system comprising: an acquisition module for acquiring status information of a target three-dimensional model; a processing module for calculating and processing the status information to obtain spherical harmonic parameters and combining the spherical harmonic parameters with a preset perspective to obtain a thickness value; and a rendering module for rendering the three-dimensional model based on the thickness value.
[0010] In some embodiments, the processing module obtains the thickness value by performing a dot product calculation on the spherical harmonic parameter and the preset viewing angle.
[0011] In some of the embodiments, a saving module and a graphics generation module are provided, wherein the saving module saves the spherical harmonic parameters in vertex colors, and the graphics generation module is used to generate display graphics based on various rendering results of the three-dimensional model.
[0012] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a method for rendering the thickness of a three-dimensional model as described in the first aspect above is implemented.
[0013] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for rendering the thickness of a three-dimensional model as described in the first aspect above.
[0014] Compared with the related technology, the embodiment of the present application provides a method for rendering the thickness of a three-dimensional model. By saving the second-order spherical harmonic parameters in the vertex color, the thickness of the model at a preset position at different angles is obtained, which solves the problem that the model transparency obtained in the prior art cannot meet the transparency change of a certain point of the model at any viewing angle. It achieves the correct expression of the model thickness value at different viewing angles and improves the subsequent rendering effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0016] Figure 1 It is a schematic diagram of the variation of model thickness with viewing angle according to the related art;
[0017] Figure 2 is a schematic diagram of an application environment of the method for rendering the thickness of a three-dimensional model according to an embodiment of the present application;
[0018] Figure 3 is a flow chart of a method for rendering thickness of a three-dimensional model according to an embodiment of the present application;
[0019] Figure 4 is a flow chart of a method for rendering thickness of a three-dimensional model based on obtaining spherical harmonic parameters according to an embodiment of the present application;
[0020] Figure 5 is a flowchart of a method for rendering the thickness of a three-dimensional model based on second-order spherical harmonic parameters according to an embodiment of the present application
[0021] Figure 6 is a structural block diagram of a system for rendering thickness of a three-dimensional model according to an embodiment of the present application;
[0022] Figure 7 is a schematic diagram of thickness generated by a system for rendering thickness of a three-dimensional model based on spherical harmonic parameters according to an embodiment of the present application;
[0023] Figure 8 It is a rendering effect diagram generated by a system for rendering the thickness of a three-dimensional model based on spherical harmonic parameters according to an embodiment of the present application;
[0024] Fig. 9 is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0026] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.
[0027] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0028] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation, and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0029] The method for rendering the thickness of a three-dimensional model provided in this application can be applied to Figure 2 In the application environment shown, Figure 2is a schematic diagram of an application environment of the method for rendering the thickness of a three-dimensional model according to an embodiment of the present application, such as Figure 2 As shown, the terminal 20 communicates with the server 21 through a network, and the user interacts with the terminal 20 through the display on the terminal 20, wherein the terminal 20 may be a smart phone, a tablet computer, a desktop computer, a laptop computer, or other terminals operated by a client for displaying a three-dimensional scene, etc.; wherein the client may be an application client or a web client, and the three-dimensional scene may be displayed in a program window or on a web page, and the server 21 provides the terminal 20 with three-dimensional model data of the three-dimensional model for rendering, as well as data including spherical harmonic parameters and preset viewing angles. Through the interaction between the terminal 20 and the server 21, the thickness value of the three-dimensional model at a preset angle will be obtained and applied to the rendering process and presented to the user accordingly, including but not limited to the game scene photo.
[0030] This application provides a method for rendering a three-dimensional model. Figure 3 is a flow chart of a method for rendering thickness of a three-dimensional model according to an embodiment of the present application. Figure 3 As shown, the flow chart includes the following steps:
[0031] S301, the terminal obtains state information of the model to be rendered, the state information including: a first preset position, a normal and a preset viewing angle; wherein the state information is used to describe the three-dimensional model created for the three-dimensional scene. It should be noted that the three-dimensional scene is a virtual environment composed of three-dimensional models of various styles, such as a map scene, a game scene, etc. Correspondingly, the three-dimensional model is an element constituting the three-dimensional scene and can be displayed in the three-dimensional scene through rendering, including but not limited to buildings, animals, plants, people, etc. When rendering the three-dimensional model, the first preset position can be the position of any point on the model to be rendered, and the normal is determined based on the first preset position;
[0032] S302, based on the state information, obtain the spherical harmonic parameters of the thickness at the first preset position through pre-calculation processing, wherein the thickness is used to represent the transparency of the model to be rendered (such as jade, amber, frosted glass, etc.). Furthermore, since the data of the three-dimensional model is static at the first preset position, but the thickness changes dynamically with respect to the viewing angle, it is impossible to store the thickness of the three-dimensional model at different viewing angles through the existing method. Therefore, the spherical harmonic parameters are introduced to correctly express the thickness value of the three-dimensional model at different viewing angles during real-time rendering. Generally, the thickness of the object does not need to be very precise, and the spherical harmonic parameters are saved as little as possible (the higher the order, the more accurate the result and the more parameters). Optionally, the embodiment of the present application uses second-order spherical harmonic parameters to simulate the thickness of the model.
[0033] S303, storing the spherical harmonic parameters in the vertex color value, and obtaining the thickness value by combining the preset viewing angle and the spherical harmonic parameters during rendering. It should be noted that independent storage spaces are used in the vertex color of the three-dimensional model to respectively store the spherical harmonic parameters under different viewing angles, and the way of combining the preset viewing angle with the spherical harmonic parameters includes but is not limited to dot product. It should be noted that the data of the three-dimensional model also includes position, normal data and texture coordinate data, wherein the coordinate data is used to represent the position of the three-dimensional model in the three-dimensional scene, the normal data is used to represent the normal of the three-dimensional model in the three-dimensional scene, and the texture coordinate data is used to represent the position of the map drawn on the three-dimensional model;
[0034] S304, rendering the three-dimensional model instance based on the thickness value. Specifically, the thickness value of the three-dimensional model introduced by the spherical harmonic parameter meets the rendering requirements at different viewing angles. This technology achieves a relatively good effect and can correctly express the thickness value of the model at different viewing angles during real-time rendering. The implementation process is relatively simple and only one dot product command needs to be executed to obtain the thickness, which is highly efficient.
[0035] Through the above steps S301 to S304, compared with the method in the prior art of simulating three-dimensional transparency by pre-baking an average thickness value at a preset position and then performing subsequent rendering, this technology saves the second-order spherical harmonic parameters in the vertex color, and then combines the spherical harmonic parameters with the preset perspective to obtain the thickness value of the model at a preset position under any perspective. This method solves the problem in the prior art that the thickness value does not change with the perspective, resulting in poor rendering effect, achieves the correct expression of the model thickness value at different perspectives, and improves the subsequent rendering effect.
[0036] In some embodiments, the method of obtaining the thickness value by combining the preset viewing angle and the spherical harmonic parameters includes calculating by the following dot product formula: Dv=dot(float4(Vx,Vy,Vz),1), SH), as shown in the formula, Dv is the thickness value of the model to be rendered at the preset viewing angle and the first preset position, dot represents dot product, for example: dot(a,b)=ax*b.x+ay*b.y+az*b.z+aw*bw, float4(Vx,Vy,Vz,1) is the spherical harmonic parameter, and SH is the corresponding spherical harmonic parameter;
[0037] In some of these embodiments, Figure 41 is a flowchart of a method for rendering the thickness of a three-dimensional model based on obtaining spherical harmonic parameters according to an embodiment of the present application. It should be understood that for a three-dimensional model, the state information of the same position at different viewing angles cannot be exactly the same, which will inevitably make the thickness of the same position of the three-dimensional model at different viewing angles different. In other words, it is necessary to obtain a thickness expression value that can meet the preset position at different viewing angles, such as Figure 4 As shown, the process includes the following steps:
[0038] S401, moving along the normal line at the first preset position to obtain a second preset position, wherein the second preset position is inside the model to be rendered, wherein the second preset position may be any position inside the three-dimensional model along the normal line of the first preset position, and is not particularly limited herein;
[0039] S402, setting a camera at the second preset position, obtaining a cubic map by rendering the depth of the model through the camera, and generating a direction set through Monte Carlo random sampling; it should be noted that the number of random sampling is determined according to actual rendering requirements and is not limited here, as long as it can meet the actual rendering requirements of the model;
[0040] S403, obtaining the depth value of the cubic mapping of the model to be rendered on the direction set, substituting the depth value into the spherical harmonic formula to obtain the initial spherical harmonic parameters corresponding to each direction, and then integrating the initial spherical harmonic parameters to obtain the spherical harmonic parameters. For example, the mathematical calculation expression of the spherical harmonic parameters can be expressed by the following formula: SH=4*PI*SH[0-m] / M, wherein SH represents the spherical harmonic parameter, 4*PI represents the unit sphere area, SH[0-m] represents the sum, and M is the actual number of sampling times;
[0041] Through the above steps S401 to S403, compared with the method of simulating the transparency of the three-dimensional model by baking the average thickness value in the prior art, this technology obtains the depth value of the cubic mapping inside the model in each direction, and then combines the depth value with the thickness value of the preset perspective, so as to obtain the thickness value that satisfies any perspective, thereby solving the problem that the thickness value obtained in the prior art cannot correctly represent the thickness value at different perspectives, and realizing the acquisition of the thickness of the three-dimensional model at a preset position that satisfies different perspectives.
[0042] In some of the embodiments, when rendering the thickness of a three-dimensional model, the second-order spherical harmonic parameters can already meet the requirements for rendering the three-dimensional model and can achieve better rendering effects. It should be noted that the spherical harmonic parameters and the spherical harmonic function are the Fourier transform of a sphere, and the parameters can be understood as constants of the Fourier transform. Generally speaking, the first-order spherical harmonic parameters are a constant number C, and the second-order spherical harmonic parameters are an array sh1.x, sh1.y, sh1.z. The higher the order of the spherical harmonic parameters, the more corresponding parameters they are, the more accurate the precision is, and the better the actual rendering effect.
[0043] This application provides a method for rendering a three-dimensional model. Figure 5 is a flow chart of a method for rendering the thickness of a three-dimensional model based on second-order spherical harmonic parameters according to an embodiment of the present application, such as Figure 5 As shown, the flow chart includes the following steps:
[0044] S501, obtaining state information of a model to be rendered, the state information including: a first preset position, a normal, and a preset viewing angle, wherein the first preset position may be any point on the surface of the model, and the normal passes through the first preset position, wherein the state information is used to describe a three-dimensional model created for a three-dimensional scene. It should be noted that a three-dimensional scene is a virtual environment composed of three-dimensional models of various styles, such as a map scene, a game scene, etc. Correspondingly, a three-dimensional model is an element constituting the three-dimensional scene and can be displayed in the three-dimensional scene through rendering, including but not limited to buildings, animals, plants, people, etc.;
[0045] S502, determining a second preset position based on the first preset position and the normal, wherein the second preset position may be any position inside the three-dimensional model along the normal of the first preset position, and is not particularly limited herein;
[0046] S503, a cubic map is obtained by rendering the depth of the model by a camera set at a second preset position, and a direction set is generated by Monte Carlo random sampling; it should be noted that the number of random samplings is determined according to actual rendering requirements and is not limited here, as long as it can meet the actual rendering requirements of the model;
[0047] S504, obtaining a depth value of the cubic mapping of the model to be rendered on the direction set, and obtaining a second-order initial spherical harmonic parameter corresponding to each direction by substituting the depth value into the spherical harmonic formula. For example, the mathematical calculation expression of the spherical harmonic parameter can be expressed by the following formula: SH=4*PI*SH[0-m] / M, wherein SH represents the spherical harmonic parameter, 4*PI represents the unit sphere area, SH[0-m] represents the sum, and M is the actual number of sampling times;
[0048] S505, integrating the initial spherical harmonic parameters to obtain second-order spherical harmonic parameters, and saving the second-order spherical harmonic parameters to the vertices;
[0049] S506, obtaining a thickness value by combining the second-order spherical harmonic parameter and the viewing direction, wherein a method for obtaining the thickness value includes but is not limited to dot product, for example:
[0050] S507, input the thickness value into the rendering module to participate in the following rendering calculation. This technology has achieved relatively good results and can correctly express the thickness value of the model under different viewing angles in the real-time rendering process. The implementation process is relatively simple and only one dot product command needs to be executed to obtain the thickness, which is highly efficient.
[0051] Through the above steps S501 to S507, compared with the method in the prior art of simulating three-dimensional transparency by pre-baking an average thickness value at a preset position and then performing subsequent rendering, this technology saves the second-order spherical harmonic parameters in the vertex color, and then combines the spherical harmonic parameters with the preset perspective to obtain the thickness value of the model at a preset position that can meet any perspective. This method solves the problem in the prior art that the thickness value obtained does not change with the perspective, resulting in poor rendering effect, achieves the correct expression of the model thickness value at different perspectives, and improves the subsequent rendering effect.
[0052] This application provides a system for rendering the thickness of a three-dimensional model. Figure 6 is a structural block diagram of a system for rendering the thickness of a three-dimensional model according to an embodiment of the present application, such as Figure 6 As shown, the system includes an acquisition module 60, a processing module 61 and a rendering module 62, wherein the acquisition module 60 is used to acquire state information of the target three-dimensional model, the state information including a first preset position, a normal and a preset viewing angle, the processing module 61 is used to calculate and process the state information to obtain spherical harmonic parameters and combine the spherical harmonic parameters with the preset viewing angle to obtain a thickness value; the rendering module 62 is used to render and color the three-dimensional model based on the thickness value;
[0053] In some embodiments, Figure 7 is a schematic diagram of thickness generated by a system for rendering thickness of a three-dimensional model based on spherical harmonic parameters according to an embodiment of the present application, such as Figure 7 As shown, the left side of the figure is a schematic diagram of thickness generated by first-order spherical harmonic parameters, and the right side is a schematic diagram of thickness generated by second-order spherical harmonic parameters. As shown in the figure, it can be seen that the model thickness value generated by second-order spherical harmonics can better express the transparency of the model;
[0054] In some embodiments, Figure 8 is a rendering effect diagram generated by a system for rendering the thickness of a three-dimensional model based on spherical harmonic parameters according to an embodiment of the present application, such as Figure 8As shown, compared with the prior art, the present application obtains the thickness of the model at a preset position at different angles by saving the second-order spherical harmonic parameters in the vertex color, thereby solving the problem that the model transparency obtained in the prior art cannot satisfy the transparency change of a certain point of the model at any viewing angle, and realizes the correct expression of the model thickness value at different viewing angles, thereby improving the subsequent rendering effect.
[0055] The present application provides an electronic device, Fig. 9 is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application, such as Fig. 9 As shown, an electronic device is provided, which may be a server, and its internal structure diagram may be as shown in Fig. 9 As shown; the electronic device includes a processor, a memory, a network interface and a database connected through a system bus; wherein the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory; the non-volatile storage medium stores an operating system, a computer program and a database; the internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium; the database of the electronic device is used to store data; the network interface of the electronic device is used to communicate with an external terminal through a network connection, and the computer program is executed by the processor to implement a method for rendering the thickness of a three-dimensional model.
[0056] Those skilled in the art will understand that Figure 6 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0057] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods; wherein, any reference to memory, storage, database or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memory; non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory; volatile memory can include random access memory (RAM) or external cache memory; as an illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0058] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for rendering the thickness of a three-dimensional model, characterized in that: include: Acquire state information of a target to be rendered, the state information comprising a first preset position, a normal line, and a preset viewing angle, wherein the normal line passes through the first preset position; Based on the state information, deriving spherical harmonic parameters of the thickness at the first preset position through pre-calculation processing, specifically comprising: moving along the normal line at the first preset position to obtain a second preset position, wherein the second preset position is inside the three-dimensional model; Generate a cubic map by using the camera at the second preset position, and generate a direction set by using Monte Carlo random sampling; Obtaining a depth value of the cubic mapping of the three-dimensional model on the direction set, obtaining an initial spherical harmonic parameter corresponding to each direction by substituting the depth value into a spherical harmonic formula, and then integrating the initial spherical harmonic parameter to obtain the spherical harmonic parameter; The spherical harmonic parameters are stored in the vertex color values, and when rendering, the thickness value is obtained by combining the preset viewing angle and the spherical harmonic parameters; The three-dimensional model instance is rendered based on the thickness value.
2. The method according to claim 1, characterized in that The obtaining of the thickness value by combining the preset viewing angle and the spherical harmonic parameters includes: obtaining the thickness value by performing a dot product calculation on the spherical harmonic parameters and the preset viewing angle.
3. The method according to any one of claims 1 to 2, characterized in that: When rendering the thickness of a three-dimensional model, the spherical harmonic parameters are selected as second-order spherical harmonic parameters.
4. A system for rendering thickness of a three-dimensional model, characterized in that: The system comprises: an acquisition module, a processing module and a rendering module, wherein: The acquisition module is used to acquire state information of a target to be rendered, wherein the state information includes a first preset position, a normal line, and a preset viewing angle, wherein the normal line passes through the first preset position; The processing module is used to obtain the spherical harmonic parameters of the thickness at the first preset position through pre-calculation processing based on the state information, specifically including: moving along the normal line at the first preset position to obtain a second preset position, wherein the second preset position is inside the three-dimensional model, And, generating a cubic mapping by the camera at the second preset position, and generating a direction set by Monte Carlo random sampling; And, obtaining the depth value of the cubic mapping of the three-dimensional model on the direction set, obtaining the initial spherical harmonic parameters corresponding to each direction by substituting the depth value into the spherical harmonic formula, and then integrating the initial spherical harmonic parameters to obtain the spherical harmonic parameters; saving the spherical harmonic parameters in the vertex color values, and obtaining the thickness value by combining the preset viewing angle and the spherical harmonic parameters during rendering; The rendering module is used to render the three-dimensional model instance based on the thickness value.
5. The system according to claim 4, characterized in that the system further comprises: The processing module calculates a thickness value by performing a dot product calculation on the spherical harmonic parameter and the preset viewing angle.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, a method for rendering the thickness of a three-dimensional model according to any one of claims 1 to 3 is implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a method for rendering the thickness of a three-dimensional model as claimed in any one of claims 1 to 3 is implemented.
