Transparent object rendering method and device, terminal equipment and storage medium

By determining the rendering accuracy of stacked transparent objects, the problem of low rendering efficiency in the prior art is solved, and the effect of reducing the number of transparent object segments on the basis of ensuring rendering quality is achieved and improving rendering efficiency is improved.

CN118918230APending Publication Date: 2024-11-08GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310514703.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-08
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

When rendering a stacked transparent object, the use of unified and high-precision LOD Mesh in the prior art leads to a decrease in rendering efficiency, an increase in the number of meshes, and affecting the rendering efficiency.

Method used

By determining the stacking relationship of each transparent object in the scene to be rendered, the rendering accuracy is reasonably determined based on the stacking relationship, so that the rendering accuracy of the upper transparent object is higher than that of the lower and obscured transparent object part, thereby rendering.

Benefits of technology

Reduces the number of transparent object fragments after rendering, improves rendering efficiency, and ensures rendering quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118918230A_ABST
    Figure CN118918230A_ABST
Patent Text Reader

Abstract

The embodiment of the invention is suitable for the technical field of image rendering, and provides a transparent object rendering method and device, terminal equipment and a storage medium, and the method comprises the steps: determining the stacking relation of all transparent objects in a first region for the first region in a to-be-rendered scene; wherein the first region comprises a laminated region of each transparent object; based on the stacking relationship, respectively determining rendering information of each transparent object in the first region; wherein the rendering information comprises rendering precision, and in the stacking area, the rendering precision of the transparent object on the upper layer is higher than that of the shielded transparent object part on the lower layer; and rendering each transparent object in the first area according to the rendering information of each transparent object in the first area. By adopting the method, the rendering efficiency of the transparent object can be improved on the basis of ensuring the rendering quality of the rendered transparent object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image rendering technology, and in particular, relates to a method, apparatus, terminal device and storage medium for rendering a transparent object. Background Art

[0002] In the rendering field, when rendering transparent objects, forward rendering is mainly used. Specifically, for each transparent object, a multi-level of detail mesh (LOD Mesh) is first used to divide the transparent object into multiple meshes. Then, the transparent object fragments included in each mesh are colored.

[0003] Currently, when layered transparent objects are divided, a unified and high-precision LOD Mesh is usually used to divide the transparent objects to ensure the display quality of the rendered transparent objects.

[0004] However, when a uniform and high-precision LOD Mesh is used to divide transparent objects, the number of divided meshes will increase, which will increase the number of transparent object fragments that need to be rendered, resulting in a decrease in rendering efficiency when shading each transparent object that needs to be rendered later. Summary of the invention

[0005] The embodiments of the present application provide a method, apparatus, terminal device and storage medium for rendering a transparent object, which can solve the problem of low rendering efficiency when rendering stacked transparent objects in the prior art.

[0006] In a first aspect, an embodiment of the present application provides a method for rendering a transparent object, the method comprising:

[0007] For a first area in a scene to be rendered, determining a stacking relationship of each transparent object in the first area; wherein the first area includes a stacking area of ​​each transparent object;

[0008] Based on the stacking relationship, respectively determine the rendering information of each transparent object in the first area; wherein the rendering information includes rendering accuracy, and in the stacking area, the rendering accuracy of the upper transparent object is higher than the rendering accuracy of the lower and obscured transparent object part;

[0009] Rendering each transparent object in the first area according to the rendering information of each transparent object in the first area.

[0010] In a second aspect, an embodiment of the present application provides a transparent object rendering device, the device comprising:

[0011] A stacking relationship determination module, for determining the stacking relationship of each transparent object in a first area of ​​a scene to be rendered; wherein the first area includes the stacking area of ​​each transparent object;

[0012] A rendering information determination module, configured to determine rendering information of each transparent object in the first area based on the stacking relationship; wherein the rendering information includes rendering accuracy, and in the stacking area, the rendering accuracy of the upper transparent object is higher than the rendering accuracy of the lower and obscured transparent object portion;

[0013] The rendering module is used to render each transparent object in the first area according to the rendering information of each transparent object in the first area.

[0014] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of the first aspect described above when executing the computer program.

[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method of the first aspect described above is implemented.

[0016] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the method of the first aspect.

[0017] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0018] First, determine the first area in the scene to be rendered that contains different transparent objects stacked together, and the stacking relationship between different transparent objects in the first area. Then, reasonably determine the rendering accuracy when rendering each stacked transparent object according to the stacking relationship. Finally, use the rendering accuracy to render each transparent object in the first area. In this way, according to the actual stacking relationship of the transparent objects in the scene to be rendered, select the appropriate rendering accuracy to render the transparent objects. For example, make the rendering accuracy of the upper transparent objects higher than that of the lower transparent objects. Furthermore, there is no need to divide the transparent objects with a uniform and high rendering accuracy, so that on the basis of ensuring the rendering quality of the transparent objects after rendering, the number of transparent object fragments after rendering can be reduced, thereby improving the rendering efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0020] Figure 1 It is a schematic diagram of an application scenario of storing multiple textures when using delayed rendering for an object in the prior art;

[0021] Figure 2 It is a schematic diagram of an application scenario when delayed rendering is used for an object in the prior art;

[0022] Figure 3 This is a flowchart of a method for rendering a transparent object provided in one embodiment of the present application;

[0023] Figure 4 This is a schematic diagram of an application scenario after grid division in a method for rendering a transparent object provided in an embodiment of the present application;

[0024] Figure 5 This is a schematic diagram of an application scenario after grid division in a method for rendering a transparent object provided by another embodiment of the present application;

[0025] Figure 6 This is a schematic diagram of an application scenario for determining a stacking relationship in a method for rendering a transparent object provided in an embodiment of the present application;

[0026] Figure 7 This is a schematic diagram of application scenarios of multiple rendering accuracies in a method for rendering a transparent object provided in an embodiment of the present application;

[0027] Figure 8 This is a schematic diagram of an application scenario after grid division in a method for rendering a transparent object provided in another embodiment of the present application;

[0028] Fig. 9 This is a schematic diagram of an implementation method for rendering a transparent object in a method for rendering a transparent object provided in an embodiment of the present application;

[0029] Fig.10 This is a schematic diagram of an application scenario for determining a target transparent object in a method for rendering a transparent object provided in an embodiment of the present application;

[0030] Fig.11 This is a schematic diagram of an application scenario for determining a target mixed color in a method for rendering a transparent object provided in an embodiment of the present application;

[0031] Fig.12This is a schematic diagram of an application scenario after mixed rendering of multiple transparent objects in a transparent object rendering method provided by an embodiment of the present application;

[0032] Fig.13 It is a structural schematic diagram of a transparent object rendering device provided by an embodiment of the present application;

[0033] Fig.14 It is a structural diagram of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0034] In the following description, specific details such as specific system structures, technologies, etc. are provided for illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0035] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0036] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0037] In the drawings of the present application specification, different grays represent different colors, which are used to distinguish multiple objects in the drawings.

[0038] In the field of rendering, forward rendering and deferred rendering are usually used to render objects.

[0039] Specifically, when forward rendering an object, for each object, a unified and high-precision LOD Mesh is first used to divide the object into multiple meshes. Each mesh includes a transparent object fragment. After that, each object fragment to be rendered and each light source are iterated, and the fragment shader is run multiple times for each vertex of each object fragment to color the object fragment.

[0040] Deferred rendering moves most of the computationally intensive rendering to the later stage for processing, so that each pixel on the screen can only run the fragment shader once. Specifically, deferred rendering can be divided into two stages. In the first geometry processing stage, the scene can be rendered once. After that, various geometric information of the object is obtained and stored in a series of G-buffer textures.

[0041] Specifically, the geometric information includes various information such as position texture, normal texture, and color texture. Figure 1 , Figure 1 This is a schematic diagram of an application scenario in which multiple textures are stored when delayed rendering is used on an object in the prior art. Figure 1 The image in the upper left area represents the position texture (POSITION) of the object; the image in the upper right area represents the normal texture (NORMALS) of the object; the images in the lower left and lower right areas represent the color texture of the object when it is illuminated. Among them, the color texture is divided into the diffuse reflection texture of the object during diffuse reflection and the specular texture of the object during specular reflection. In the actual processing process, the diffuse reflection texture (ALBEDO) and the specular texture (SPECULAR) can be combined and stored in one texture.

[0042] In the second lighting processing stage, a screen-sized area can be rendered using the texture data in the G-buffer. Afterwards, the scene lighting corresponding to each fragment is calculated separately using the geometry data in the G-buffer, and the G-buffer is iterated at each pixel. Based on this, the rendering process can be decoupled, and high-level fragment processing can be moved to the later stage instead of directly bringing each object from the vertex shader to the fragment shader. Furthermore, when calculating lighting, input variables can be obtained from the corresponding G-buffer instead of the vertex shader. At this point, the terminal device can use the fragment in the G-buffer as the top-level fragment to ensure that each pixel only needs to be processed once in the lighting processing stage, avoiding useless rendering.

[0043] Specifically, refer to Figure 2 , Figure 2 Schematic diagram of an application scenario when delayed rendering is used for an object in the prior art. Figure 2 In the above, the left image represents the geometry of the object to be rendered; the right image represents the texture data of the G buffer corresponding to the object to be rendered. Figure 1 The texture data shown. Figure 2 The MRT in it is Multiple Render Target technology.

[0044] It should be noted that when the object is transparent, there may be multiple transparent objects stacked in the scene. However, because all data in the G-buffer is obtained from a single fragment, stacked transparent objects need to operate on the combination of multiple fragments. Therefore, traditional deferred rendering cannot support stacked rendering. Based on this, when the object is an opaque object, deferred rendering can be used, but when the object is a transparent object, forward rendering needs to be used.

[0045] However, in the process of forward rendering, if a uniform and high-precision LOD Mesh is used to divide transparent objects, the number of divided meshes will increase, which will increase the number of transparent object fragments to be rendered, resulting in a decrease in rendering efficiency when shading each transparent object to be rendered later.

[0046] Based on this, in order to improve the rendering efficiency of rendering multiple stacked transparent objects, an embodiment of the present application provides a method for rendering a transparent object.

[0047] See also Figure 3 , Figure 3 A flowchart of a method for rendering a transparent object provided in an embodiment of the present application is shown, and the method comprises the following steps:

[0048] S301. Determine, for a first area in a scene to be rendered, a stacking relationship of transparent objects in the first area; wherein the first area includes a stacking area of ​​transparent objects.

[0049] In one embodiment, the scene to be rendered is a scene containing transparent objects to be rendered. The terminal device mainly renders scenes with multiple stacked transparent objects, so there are multiple transparent objects.

[0050] The first area includes a stacked area where a plurality of transparent objects are stacked. The first area may be an area covered by the transparent objects in the grid area.

[0051] Specifically, the terminal device may divide the scene to be rendered into grids to obtain multiple area blocks. Afterwards, the terminal device may determine, among the multiple area blocks, an area block containing a stacked area as a first area. And, among the multiple area blocks, an area block containing a transparent object and the transparent objects contained therein are not stacked with each other is determined as a second area.

[0052] In one embodiment, since the scene to be rendered is mainly displayed on the display screen of the terminal device, when the scene to be rendered is grid-divided, the display screen can be grid-divided based on a preset grid-division strategy to divide it into a plurality of area blocks of the same size. The preset grid-division strategy can be set according to actual conditions and is not limited thereto.

[0053] It should be noted that the first area is a region block including a plurality of stacked transparent objects, and the second area may be a region including only one transparent object, or including a plurality of transparent objects that are not stacked with each other.

[0054] Specifically, refer to Figure 4 , Figure 4 FIG. 1 is a schematic diagram of an application scenario after grid division in a method for rendering a transparent object provided in an embodiment of the present application. Figure 4 It can be seen that after the division, only some of the area blocks contain overlapping areas of two or more transparent objects at the same time. Therefore, the area blocks containing overlapping areas can be determined as the first area, and some of the area blocks contain only one transparent object, and the terminal device can determine the area blocks as the second area.

[0055] It should be noted that after the scene to be rendered is divided, it may include multiple first areas. At this time, the terminal device needs to execute the above transparent object rendering method for each transparent object in each first area. In this embodiment, for the convenience of explanation, one of the first areas is used for explanation.

[0056] In one embodiment, the above stacking relationship is used to characterize the stacking or blocking conditions between the transparent objects in the first area. Figure 5 , Figure 5 Schematic diagram of an application scenario after grid division in a method for rendering a transparent object provided by another embodiment of the present application. Figure 5, 1, 2, 3 and 4 represent different transparent objects respectively, and the numbered chain list is used to represent the stacking relationship of each transparent object. Among them, in the numbered chain list, 1 represents that in the second area, the transparent object 1 is not stacked with other transparent objects or has only one transparent object 1. 2—>1 represents that the first area contains a stacking area where transparent objects 1 and transparent objects 2 are stacked, and transparent object 2 blocks transparent object 1. 3—>2—>1, represents that the first area contains a stacking area where transparent objects 1, transparent objects 2 and transparent objects 3 are stacked, and transparent object 3 blocks transparent object 2, and transparent object 2 blocks transparent object 1. 4—>3—>2—>1, represents that the first area contains a stacking area where transparent objects 1, transparent objects 2, transparent objects 3 and transparent objects 4 are stacked, and transparent object 4 blocks transparent object 3, transparent object 3 blocks transparent object 2, and transparent object 2 blocks transparent object 1.

[0057] In summary, it can be considered that the above stacking relationship can be used to characterize the occlusion situation between the transparent objects in the first area.

[0058] It should be noted that the scene to be rendered in the current frame is generated by observing the camera perspective of the current frame. Therefore, the stacking relationship between each transparent object can be determined according to the distance between each transparent object and the camera.

[0059] Specifically, the terminal device can use the preset observation point as the light source to generate a shadow map of each transparent object in the scene to be rendered. After that, the depth distance between each transparent object and the preset observation point is determined respectively, so as to determine the stacking relationship of each transparent object in the first area according to the depth distance and the shadow map. Among them, the shadow map is used to characterize the occlusion of the transparent object.

[0060] In one embodiment, since the scene to be rendered in the current frame is generated by observing the camera perspective of the current frame, the location of the preset observation point can be considered as the location of the camera. The depth distance is the distance between the transparent object and the preset observation point, which can directly determine the vertical distance between each pixel point where the transparent object is located and the camera plane when the camera is a depth camera.

[0061] It should be noted that when the preset observation point and the light source are at the same position, it can be considered that the brightness of the place where the light can reach will be higher than the place where the light cannot reach, and the place where the light cannot reach is the shadow, so the above shadow map can be generated. After that, for each pixel point corresponding to the transparent object, multiple pixel points with the same horizontal coordinate x and vertical coordinate y can be determined first. Then, the depth distance z in the multiple pixel points is compared to determine the stacking relationship between the transparent objects.

[0062] It is understandable that the scene to be rendered is a 3D scene, and the position of each pixel of a transparent object in the 3D scene can be represented by xyz. Among them, z can be considered as the depth distance between the pixel and the preset observation point. Based on this, the terminal device can determine the stacking relationship of each transparent object in the first area according to the depth distance z and the above shadow map.

[0063] In a specific embodiment, when there are multiple transparent objects in the scene to be rendered, the terminal device can shoot the multiple transparent objects with a depth camera to determine the color of each transparent object and the z value of each transparent object at the same pixel point with the same horizontal coordinate x and vertical coordinate y. Figure 6 , Figure 6 1 is a schematic diagram of an application scenario for determining a stacking relationship in a method for rendering a transparent object provided in an embodiment of the present application. Figure 6 The first leftmost figure is a stereoscopic image of a plurality of transparent objects; Figure 6 The second leftmost figure is a top view of a plurality of transparent objects; Figure 6 The color-buffer in the G-buffer is the color buffer in the G-buffer, which is used to cache the color texture of transparent objects; the z-buffer is the depth buffer in the G-buffer, which is used to buffer the depth distance of each transparent object.

[0064] S302. Based on the stacking relationship, respectively determine the rendering information of each transparent object in the first area; wherein the rendering information includes rendering accuracy. In the stacking area, the rendering accuracy of the upper transparent object is higher than the rendering accuracy of the lower and obscured transparent object part.

[0065] In one embodiment, the rendering accuracy is the accuracy of the LOD Mesh when the first area is meshed. Different rendering accuracies usually result in different numbers of sub-areas after the first area is divided. Figure 7 , Figure 7 This is a schematic diagram of an application scenario of multiple rendering accuracies in a method for rendering a transparent object provided in an embodiment of the present application. Among them, w in LODw represents the level of rendering accuracy, and w can be set according to actual conditions. In this embodiment, w is 5, namely LOD0 to LOD4. Tris represents the specific rendering accuracy. Based on Figure 7 It can be seen that the larger w is, the lower the rendering accuracy of LODw is.

[0066] Based on this, in order to ensure the rendering quality of the rendered transparent objects and reduce the number of divided grids, in this embodiment, the rendering accuracy of each transparent object in the first area can be determined according to the following multiple scenarios.

[0067] The first scenario:

[0068] The terminal device may determine the rendering accuracy of each transparent object according to the occlusion level of each transparent object in the first area.

[0069] Among them, based on the above Figure 5 It can be seen from the explanation that each first area has a numbered linked list for characterizing the stacking relationship of each transparent object. For example, 2—>1. Based on this, when determining the rendering accuracy of transparent object 1 in the first area, the occlusion level of transparent object 1 in the first area is the second level. Therefore, the terminal device can determine the rendering accuracy corresponding to the second level as the rendering accuracy of transparent object 1 in the first area. And, determine the rendering accuracy corresponding to the first level as the rendering accuracy of transparent object 2 in the first area.

[0070] It should be noted that in different first regions, the occlusion level of the transparent object 1 may be different. Therefore, in different first regions, the rendering precision used for the same transparent object may also be different. For example, if the stacking relationship corresponding to the first region is 3—>2—>1, the rendering precision of the transparent object 1 in the first region is the rendering precision corresponding to the third level.

[0071] Based on this, it can be understood that when transparent objects at different occlusion levels are rendered using a uniform rendering precision or based on the depth distance of the transparent objects, although the rendering quality can be improved, due to the existence of occluded transparent objects, even with a higher rendering precision, the final display effect is still relatively blurry. Therefore, by determining the rendering precision of transparent objects based on the occlusion level, the number of grids after the occluded transparent objects are rendered can be reduced while ensuring that the rendering quality of the final occluded transparent objects is similar to that after rendering with a higher rendering precision. That is, the rendering efficiency is improved while ensuring the rendering quality.

[0072] It should be noted that a transparent object may be partially obscured in a first area, while other parts of the transparent object are not obscured. Therefore, when rendering the transparent objects in the first area in the first scenario, the unobstructed parts can be displayed intuitively. Therefore, if the entire transparent object in the first area is rendered based only on the occlusion level, the display effect of the unobstructed parts after rendering may be reduced. Based on this, the terminal device can also determine the rendering accuracy of each transparent object based on the following second scenario.

[0073] Second scenario:

[0074] For each transparent object in the first area, the terminal device may first determine the occlusion level of the first part that is occluded in the transparent object and the depth distance of the second part that is not occluded based on the stacking relationship. Then, the rendering accuracy of the first part is determined according to the occlusion level of the first part, and the rendering accuracy of the second part is determined according to the depth distance of the second part.

[0075] For example, Figure 5 For example, the first region A in the figure includes a stacking region with a stacking relationship of 2—>1 and a stacking region with a stacking relationship of only 1. At this time, the stacking region with a stacking relationship of 2—>1 is the first part of the transparent object 1 that is blocked, and the first part has a blocking level of 2 and the stacking region with a stacking relationship of 1 is the second part of the transparent object 1 that is not blocked.

[0076] Based on this, when determining the rendering accuracy of the transparent object 1 in the first area, the terminal device can determine the rendering accuracy of the first part based on the occlusion level, and determine the rendering accuracy of the second part according to the depth distance.

[0077] It should be noted that, although transparent object 2 is stacked with transparent object 1, based on the stacking relationship 2->1, it can be seen that transparent object 2 is at the top layer in the first area. That is, transparent object 2 is not blocked. Therefore, the rendering accuracy of transparent object 2 can be determined based on the depth distance; the rendering accuracy of the blocking level 1 (top layer) can also be determined as the rendering accuracy of transparent object 2, and there is no limitation on this.

[0078] Determining the rendering accuracy according to the depth distance may be: the terminal device pre-stores the association between different depth distance ranges and corresponding rendering accuracy. Afterwards, the terminal device may directly determine the corresponding rendering accuracy based on the depth distance range of the transparent object, which will not be described in detail.

[0079] Based on this, it can be understood that compared with the method of determining rendering accuracy in the first scenario, the second scenario can be more refined based on the stacking relationship (occlusion level and depth distance) of the transparent object in the first area, and reasonably determine the rendering accuracy of the first part of the transparent object that is occluded, and the rendering accuracy of the second part that is not occluded. In this way, on the basis of ensuring the rendering quality, the number of meshes generated after mesh division can be further reduced, and the rendering efficiency can be improved.

[0080] It should be noted that for the first part and the second part of the transparent object in the same first area, since the rendering accuracy of the first part is determined based on the occlusion level, and the rendering accuracy of the second part is determined based on the depth distance, the rendering accuracy of the first part may be the same as or different from the rendering accuracy of the second part, and this is not limited.

[0081] It should be noted that, for the above two scenarios, when there is a first part composed of obstructed transparent objects and a second part of transparent objects that are not obstructed in the first area, using the first scenario method to determine the rendering accuracy will make the rendering accuracy of the first part and the second part of the transparent object consistent in the first area. However, although this method reduces the display effect of the unobstructed second part of the transparent object after rendering, it is more efficient in determining the rendering accuracy of each transparent object in the first area.

[0082] Furthermore, if the second scenario is used to determine the rendering accuracy of transparent objects, although the rendering accuracy of transparent objects at different occlusion levels can be reasonably determined, so that the boundary between the occluded first part and the unoccluded second part of the rendered transparent object is clear, the efficiency in determining the rendering accuracy of transparent objects in the first area is low.

[0083] For example, Figure 5 and Figure 8 Take the first area B in the fourth row and third column as an example. In the first area B, it includes the edges of multiple transparent objects, for example, the edges of transparent object 1, transparent object 3 and transparent object 4. At this time, when determining the occlusion level of the first part of each transparent object that is obscured, the first part will be divided into multiple sub-areas, and the sub-numbering linked list corresponding to each sub-area can be 2—>1, 3—>2—>1, 4—>3—>2—>1 and other situations. Afterwards, it is necessary to establish sub-areas corresponding to each other transparent object, for example, 3—>2, 4—>3—>2,..., and other numbering linked lists. At this time, for each sub-area, the rendering accuracy needs to be determined according to the steps corresponding to the second scenario mentioned above.

[0084] However, although this method can reasonably select the rendering accuracy of each part of the transparent object in the first area according to the level, so that the boundary of the rendered transparent object is clear, the efficiency of determining the rendering accuracy of each transparent object will be reduced. If the rendering accuracy of each transparent object in the first area B is determined directly based on the first scenario, it only needs to be determined according to the numbering chain table 4->3->2->1 corresponding to the first area.

[0085] Based on this, in order to strike a balance between the rationality of the rendering accuracy and the efficiency of determining each part of a transparent object, the second scene determination method can be selected for the first area that meets the preset conditions, and the first scene determination method can be selected for the first area that does not meet the preset conditions.

[0086] Specifically, for the first area that meets the preset conditions, the terminal device can determine the rendering accuracy of each transparent object in each sub-area based on the stacking relationship of the sub-areas in the first area; wherein the preset conditions include: the number of transparent objects contained is greater than or equal to a preset threshold, and there are at least two sub-areas, and the transparent objects contained in different sub-areas are not all the same.

[0087] In one embodiment, when the transparent objects contained in different sub-areas are not all the same, it can be determined that there are multiple transparent objects in the first area, including the edges of one or more transparent objects. That is, the first area meets the preset condition. The preset threshold can be set according to actual conditions. For example, the preset threshold can be 4.

[0088] In one embodiment, the sub-regions may be divided according to the edges of the transparent objects in the first region, so that when describing the stacking relationship (or numbering chain list) between the transparent objects in the first region, the sub-stacking relationship (or sub-numbering chain list) of each sub-region may be used for description. Figure 8 Explanation of the first area B in .

[0089] It should be added that, for the first area that does not meet the preset conditions, for example, the number of transparent objects in the first area is less than the preset threshold, or there is only one sub-area, or, when there are multiple sub-areas, the transparent objects contained in the multiple sub-areas are the same, or the number of transparent objects is less than the preset threshold.

[0090] When the number of transparent objects is less than a preset threshold, for example, Figure 5 The first area A corresponding to the first area can be considered to have a lower occlusion level in the hierarchical relationship corresponding to the first area, with only two occlusion levels. Based on this, when the rendering accuracy of each transparent object is determined by the first scenario, even if the first area contains the boundary of the transparent object 2, however, because the occlusion level of the transparent object is low, even if the rendering accuracy of the first obscured part of the transparent object 1 and the rendering accuracy of the unobstructed second part are unified by the determination method of the first scenario, the first part and the second part of the transparent object 1 can be made relatively clear (that is, the boundary of the transparent object 2 can be clearly displayed), thereby ensuring the rendering quality of each transparent object and improving the efficiency of determining the rendering accuracy.

[0091] Based on this, it can be seen from the above description that for the first area that does not meet the preset conditions, the first scenario mentioned above can be used to determine the rendering accuracy of each transparent object, and the first area that meets the preset conditions can use the second scenario mentioned above to determine the rendering accuracy of each transparent object, so as to balance the rationality and efficiency of determining the rendering accuracy of each part of the transparent object.

[0092] It should be added that, for the above-mentioned transparent objects (for example, Figure 5 In the case of the first areas corresponding to the numbers 5 in the figure), it has been described in S101 that the area including only one transparent object or multiple transparent objects without overlapping each other is the second area, and the method for determining the rendering accuracy of the transparent object can be similar to the method for determining the rendering accuracy according to the depth distance of the second part of the transparent object that is not blocked in the second scenario mentioned above; the transparent object can also be rendered with a preset rendering accuracy, which is not limited.

[0093] In summary, this is an example of determining the rendering accuracy of transparent objects in each first area and second area based on the stacking relationship. It can be understood that for each transparent object in the first area, since the upper transparent object is blocked by fewer levels in the stacking relationship, the rendering accuracy of the upper transparent object needs to be higher than the rendering accuracy of the lower transparent object that is blocked.

[0094] In another embodiment, a transparent object may be blocked by other opaque objects or translucent objects. For transparent objects blocked by opaque objects, the terminal device may not need to perform rendering processing on them. However, for transparent objects blocked by translucent objects, when determining that the transparent object is blocked by the translucent object, the blocking level of the transparent object can be increased, and then when determining the rendering accuracy, a lower rendering accuracy can be used. While ensuring the rendering quality of the blocked transparent object, the number of grids generated subsequently is reduced.

[0095] S303: Render each transparent object in the first area according to the rendering information of each transparent object in the first area.

[0096] In one embodiment, after determining the rendering accuracy of each transparent object in the first area, the following method can be used: Figure 7 The corresponding rendering accuracy is used to divide transparent objects with different stacking relationships into multi-detail levels of meshes to reduce the number of generated meshes and improve rendering efficiency.

[0097] In this embodiment, a first area in the scene to be rendered containing different transparent objects stacked together, and the stacking relationship of different transparent objects in the first area are first determined. Then, the rendering accuracy when rendering each stacked transparent object is reasonably determined according to the stacking relationship. Finally, each transparent object in the first area is rendered using the rendering accuracy. In this way, according to the actual stacking relationship of the transparent objects in the scene to be rendered, a suitable rendering accuracy can be selected to render the transparent objects. For example, the rendering accuracy of the upper transparent objects is higher than that of the lower transparent objects. Furthermore, there is no need to divide the transparent objects using a uniform and high rendering accuracy, so that on the basis of ensuring the rendering quality of the transparent objects after rendering, the number of transparent object fragments after rendering can be reduced, thereby improving the rendering efficiency.

[0098] It should be added that the above S301-S303 are examples of determining the rendering accuracy of each transparent object and dividing the transparent objects based on the rendering accuracy. In actual scenarios, after the transparent objects are divided into multi-detail level grids, it is also necessary to perform pixel-by-pixel color rendering on the transparent object parts contained in the divided grids to obtain the final rendered transparent objects. Fig. 9 S901-S902 shown renders each transparent object. The details are as follows:

[0099] S901. Perform multi-level-of-detail mesh division on each transparent object in the first area according to the rendering accuracy of each transparent object in the first area.

[0100] In one embodiment, the multi-level-of-detail meshing of each transparent object in the first region has been explained above, and will not be described in detail. At this time, each grid after the multi-level-of-detail meshing contains transparent object fragments.

[0101] S902: Based on the color attributes of each target transparent object in the first area, perform mixed color rendering on the overlapping transparent object parts; wherein the depth distance of the target transparent object is less than a preset depth threshold.

[0102] In one embodiment, the target transparent object may be a transparent object whose depth distance is less than a preset depth distance among all transparent objects included in the first area. The preset depth threshold may be set according to actual conditions. It is understandable that the greater the depth distance, the lower the visibility of the transparent object in the scene to be rendered. Based on this, a transparent object whose depth distance is less than the preset depth threshold may be determined as a target transparent object to participate in the determination process of the target mixed color.

[0103] In another embodiment, when the stacking relationship of transparent objects is the first level, even if the depth distance of the transparent objects is large, since the transparent objects at the top layer are not blocked, the transparent objects at the top layer can be considered as visible transparent objects in the scene to be rendered. Based on this, determining the target transparent objects that need to participate in the subsequent target mixed color processing only based on the depth distance will result in poor final rendering quality.

[0104] Based on this, in order to reduce the number of target transparent objects that need to participate in subsequent mixed color rendering and ensure rendering quality, when determining the target transparent object, it is also possible to comprehensively determine whether it is a target transparent object based on the occlusion level and depth distance of the transparent object.

[0105] Specifically, the terminal device can determine the target depth threshold corresponding to the transparent object according to the occlusion level where the transparent object is located. Then, when the depth distance of the transparent object is less than the corresponding target depth threshold, the transparent object is determined to be the target transparent object. Among them, the target depth thresholds corresponding to different occlusion levels are usually different, and the target depth threshold corresponding to the previous occlusion level is usually greater than the target depth threshold corresponding to the next occlusion level.

[0106] For example, refer to Fig.10 , Fig.10 1 is a schematic diagram of an application scenario for determining a target transparent object in a method for rendering a transparent object provided in an embodiment of the present application. Fig.10 In the example, the first area includes multiple transparent objects, and the terminal device needs to determine the target transparent object according to the depth distance of each transparent object. Among them, the High Range sequence, the Middle Range sequence, and the Low Range sequence are used to characterize the proportion of the target transparent object to all transparent objects in the first area.

[0107] Exemplarily, the High Range sequence can represent that the proportion of the target transparent object in all transparent objects in the first area is greater than or equal to the first preset proportion; the Middle Range sequence can represent that the proportion of the target transparent object in all transparent objects in the first area is greater than the second preset proportion and less than or equal to the first preset proportion; the Low Range sequence can represent that the proportion of the target transparent object in all transparent objects in the first area is less than the second preset proportion. Among them, the first preset proportion and the second preset proportion can be set according to actual conditions. Exemplarily, the first preset proportion can be 1, and the second preset proportion can be 0.5.

[0108] by Fig.10 For example, when the transparent object is at a large occlusion level (e.g. Fig.10When the transparent object is blocked by multiple transparent objects, the depth distance may be greater than or equal to the target depth threshold corresponding to the blocking level. Therefore, the terminal device does not need to determine it as a target transparent object.

[0109] Similarly, when transparent objects are at a smaller occlusion level (e.g. Fig.10 When the transparent object is not blocked by a transparent object, although the depth distance of the transparent object is large, the transparent object is visible. At this time, when the depth distance is less than the target depth threshold corresponding to the occlusion level, the terminal device can still determine it as a target transparent object.

[0110] It should be noted that the topmost transparent object is usually a visible object in the scene to be rendered, so the target depth threshold corresponding to the topmost transparent object can be infinite. That is, the topmost transparent object can be considered as a target transparent object that needs to participate in the subsequent target mixed color processing.

[0111] It is understandable that after obtaining the target mixed color of the target transparent object in the overlapping part, although the non-target transparent objects in the overlapping part do not participate in the target mixed color processing, since the non-target transparent objects are usually blocked by layers in the scene to be rendered, or the depth distance is large, the non-target transparent objects are usually invisible. Therefore, rendering the entire transparent object in the overlapping part based on the target mixed color can reduce the number of target transparent objects that need to participate while ensuring the rendering quality of the overlapping part, thereby improving rendering efficiency.

[0112] The color attributes may include the transparency of the transparent object and its own color.

[0113] In a specific embodiment, when determining the target mixed color of the overlapping portion, the target mixed color of the overlapping portion may be determined based on the color attributes of all lower layer target transparent objects after mixing and the color attributes of the top layer target transparent object.

[0114] It should be noted that when the overlapping part contains two target transparent objects, the color attributes of all the lower target transparent objects after mixing are the color attributes of the bottom target transparent objects. Also, when the overlapping part contains three or more target transparent objects, the color attributes of all the lower target transparent objects after mixing need to be determined based on each color attribute of all the lower target transparent objects. Finally, the terminal device needs to determine the target mixed color based on the mixed color attributes and the color attributes of the top target transparent objects.

[0115] Specifically, the terminal device may calculate a first product between the top color and the top transparency of the top target transparent object, and a second product between the mixed color and the mixed transparency in the mixed color attribute, and then determine the sum of the first product and the second product as the target mixed color of the overlapping portion.

[0116] In one embodiment, the color attributes of each layer of target transparent objects are known and are stored in the G buffer as color textures during the first geometry processing stage.

[0117] In one embodiment, the first product between the top layer color and the top layer transparency can be used to represent the actual color of the top layer target transparent object when it is rendered. The second product of the mixed color and the mixed transparency is used to represent the actual mixed color when all the lower layer target transparent objects are rendered. Afterwards, the terminal device can determine the sum of the two colors as the target mixed color.

[0118] Specifically, the terminal device can use the following formula to determine the target mixed color:

[0119] Dn=An*Cn+(1-An)*Dn-1;

[0120] Among them, the above Dn is the mixed color after all target transparent objects in layers 1 to n are mixed; An is the transparency of the target transparent object in the nth layer; Cn is the color of the target transparent object in the nth layer; Dn-1 is the mixed color after all target transparent objects in layers 1 to n-1 are mixed. Among them, n is an integer between 1, .., K, and K is the top target transparent object. That is, when n is K, Dk is the target mixed color; Ak is the top transparency of the top target transparent object; Ck is the top color of the top target transparent object; Dk-1 is the mixed color after all lower target transparent objects are mixed.

[0121] It should be noted that the above method is to calculate the target mixed color of the mixed transparent objects, and the number of transparent objects is at least 2. That is, n should be greater than or equal to 2. When it is necessary to calculate the rendering color of D1, it can be considered that the transparent object is not blocked. At this time, the rendering color of D1 can be the color C1 of the transparent object itself, or the product of its own color and transparency. That is, A1*C1, which is not limited to this.

[0122] For example, refer to Fig.11 , Fig.11 1 is a schematic diagram of an application scenario for determining a target mixed color in a method for rendering a transparent object provided in an embodiment of the present application. Fig.11 There are 5 layers of target transparent objects in total, D4 represents the target mixed color of the top layer of target transparent objects, and C4A4 represents the actual color of the top layer of target transparent objects when rendered.

[0123] Based on the above formula and Fig.11 It can be seen that this formula can be used to calculate the mixed color when each layer of target transparent objects is mixed with all the target transparent objects in the lower layer, until the target mixed color of the top layer of target transparent objects is obtained.

[0124] It is understandable that when viewing all lower layer target transparent objects, it is necessary to see through the top layer target transparent object. Therefore, for ease of processing, the terminal device can determine the difference between 1 and the top layer transparency as the mixed transparency of all lower layer target transparent objects.

[0125] In another embodiment, when calculating the target mixed color of the top layer target transparent object, it can also be determined based on the transparency and color of the next layer target transparent object. For example, An and Cn in the above formula are replaced by An-1 and Cn-1 respectively to calculate the target mixed color. In this embodiment, the method for calculating the target mixed color is not limited.

[0126] It is understandable that, for the non-overlapping transparent object parts, the color rendering can be performed directly on the non-overlapping transparent object parts according to the product of the transparency and the color of the non-overlapping transparent object parts. Figure 5 In the second area covered by the transparent object 5, the color of rendering the transparent object 5 can be determined by using the color and transparency corresponding to the transparent object 5.

[0127] Based on the above description, it can be known that the target mixed color is calculated based on the color attributes of all target transparent objects in the overlapping part. Therefore, it can be considered that the color rendering of all transparent objects in the overlapping part can be completed by using the target mixed color to perform color rendering on the overlapping part once. In this way, the terminal device does not need to run multiple fragment shaders for each layer of transparent object fragments after division, which can improve the rendering efficiency while ensuring the rendering quality. For details, refer to Fig.12 , Fig.12 It is a schematic diagram of an application scenario after mixed rendering of multiple transparent objects in a transparent object rendering method provided in an embodiment of the present application.

[0128] See also Fig.13 , Fig.13 1 is a structural block diagram of a transparent object rendering device provided in an embodiment of the present application. The transparent object rendering device in this embodiment includes modules for executing Figure 1 or Fig. 9 For details, please refer to the steps in the corresponding embodiment. Figure 1 or Fig. 9 as well as Figure 1 or Fig. 9For the convenience of explanation, only the parts related to this embodiment are shown. Fig.13 , the transparent object rendering device 1300 may include: a stacking relationship determination module 1310, a rendering information determination module 1320 and a rendering module 1330, wherein:

[0129] The stacking relationship determination module 1310 is used to determine the stacking relationship of each transparent object in the first area of ​​the scene to be rendered; wherein the first area includes the stacking area of ​​each transparent object.

[0130] The rendering information determination module 1320 is used to determine the rendering information of each transparent object in the first area based on the stacking relationship; wherein the rendering information includes rendering accuracy. In the stacking area, the rendering accuracy of the upper transparent object is higher than the rendering accuracy of the lower and obscured transparent object part.

[0131] The rendering module 1330 is used to render each transparent object in the first area according to the rendering information of each transparent object in the first area.

[0132] In one embodiment, the transparent object rendering device 1300 further includes:

[0133] The grid division module is used to grid the scene to be rendered to obtain a plurality of area blocks; wherein the first area is a region block including a stacked area among the plurality of area blocks.

[0134] In one embodiment, the transparent object rendering device 1300 further includes:

[0135] The second area rendering module is used to render each transparent object in the second area with a preset rendering accuracy for the second area; wherein the second area is an area block among multiple area blocks, which contains transparent objects and the transparent objects contained are not overlapped with each other.

[0136] In one embodiment, the stacking relationship determination module 1310 is further configured to:

[0137] Taking the preset observation point as the light source, a shadow map of each transparent object in the scene to be rendered is generated; the shadow map is used to characterize the occlusion of the transparent object; the depth distance between each transparent object and the preset observation point is determined respectively; according to the depth distance and the shadow map, the stacking relationship of each transparent object in the first area is determined.

[0138] In one embodiment, the stacking relationship includes the occlusion level of each transparent object; the rendering information determination module 1320 is further used to:

[0139] The rendering accuracy of each transparent object is determined according to the occlusion level of each transparent object in the first area.

[0140] In one embodiment, the stacking relationship includes the occlusion level and depth distance of each transparent object; the rendering information determination module 1320 is further used to:

[0141] For any transparent object, the occlusion level of the first part that is occluded in the transparent object and the depth distance of the second part that is not occluded are determined based on the stacking relationship; the rendering accuracy of the first part is determined according to the occlusion level of the first part; and the rendering accuracy of the second part is determined according to the depth distance of the second part.

[0142] In one embodiment, the rendering information determination module 1320 is further configured to:

[0143] For the first area that meets the preset conditions, the rendering accuracy of each transparent object in each sub-area is determined separately based on the stacking relationship of each sub-area in the first area; wherein the preset conditions include: the number of transparent objects contained is greater than or equal to a preset threshold, and there are at least two sub-areas, and the transparent objects contained in different sub-areas are not all the same.

[0144] In one embodiment, the rendering information further includes the color attributes of each transparent object; the stacking relationship includes the depth distance of each transparent object; the rendering module 1330 is further used to:

[0145] According to the rendering accuracy of each transparent object in the first area, each transparent object in the first area is divided into a multi-detail level grid; based on the color attributes of each target transparent object in the first area, the overlapping transparent object parts are rendered in mixed colors; wherein the depth distance of the target transparent object is less than a preset depth threshold.

[0146] In one embodiment, the rendering module 1330 is further configured to:

[0147] Based on the color attributes of each overlapping target transparent object, a target mixed color of each overlapping part is determined; and each overlapping part is rendered with a mixed color using the target mixed color; wherein the color attributes include: color and transparency.

[0148] In one embodiment, the rendering module 1330 is further configured to:

[0149] For the overlapping part containing two target transparent objects, the target mixed color of the overlapping part is determined according to the color attributes of the bottom target transparent object in the overlapping part and the color attributes of the top target transparent object; for the overlapping part containing three or more target transparent objects, the target mixed color of the overlapping part is determined according to the color attributes of all the lower target transparent objects in the overlapping part after mixing and the color attributes of the top target transparent object.

[0150] In one embodiment, the rendering module 1330 is further configured to:

[0151] Calculate a first product of the top layer color and the top layer transparency of the top layer target transparent object, and a second product of the mixed color and the mixed transparency in the mixed color attribute; determine the sum of the first product and the second product as the target mixed color of the overlapping part; wherein the mixed color is obtained based on the color attributes of all lower layer target transparent objects in the overlapping part; and the mixed transparency is obtained based on the top layer transparency.

[0152] When it is understood that Fig.13 In the structural block diagram of the transparent object rendering device shown in FIG. Figure 1 or Fig. 9 The steps in the corresponding embodiments, and for Figure 1 or Fig. 9 Each step in the corresponding embodiment has been explained in detail in the above embodiment. Figure 1 or Fig. 9 as well as Figure 1 or Fig. 9 The relevant descriptions in the corresponding embodiments are not repeated here.

[0153] Fig.14 1 is a block diagram of a terminal device provided by an embodiment of the present application. Fig.14 As shown, the terminal device 1400 of this embodiment includes: a processor 1410, a memory 1420, and a computer program 1430 stored in the memory 1420 and executable on the processor 1410, such as a program of a method for rendering a transparent object. When the processor 1410 executes the computer program 1430, the steps of each embodiment of the method for rendering a transparent object are implemented, such as Figure 3 Alternatively, the processor 1410 implements the above when executing the computer program 1430 Fig.13 The functions of each module in the corresponding embodiment are, for example, Fig.13 For details on the functions of modules 1310 to 1330, please refer to Fig.13 Related description in the corresponding embodiment.

[0154] Exemplarily, the computer program 1430 may be divided into one or more modules, one or more modules are stored in the memory 1420, and are executed by the processor 1410 to implement the transparent object rendering method provided in the embodiment of the present application. One or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 1430 in the terminal device 1400. For example, the computer program 1430 may implement the transparent object rendering method provided in the embodiment of the present application.

[0155] The terminal device 1400 may include, but is not limited to, a processor 1410 and a memory 1420. Those skilled in the art will appreciate that Fig.14 It is only an example of the terminal device 1400 and does not constitute a limitation of the terminal device 1400. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.

[0156] The processor 1410 may be a central processing unit, or other general-purpose processors, digital signal processors, application-specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0157] The memory 1420 may be an internal storage unit of the terminal device 1400, such as a hard disk or memory of the terminal device 1400. The memory 1420 may also be an external storage device of the terminal device 1400, such as a plug-in hard disk, a smart memory card, a flash memory card, etc. equipped on the terminal device 1400. Further, the memory 1420 may also include both an internal storage unit of the terminal device 1400 and an external storage device.

[0158] 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 perform the method for rendering a transparent object in each of the above embodiments.

[0159] 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 for rendering a transparent object in each of the above embodiments.

[0160] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for rendering a transparent object, characterized in that: include: For a first area in a scene to be rendered, determining a stacking relationship of each transparent object in the first area; wherein the first area includes a stacking area of ​​each transparent object; Based on the stacking relationship, respectively determine the rendering information of each of the transparent objects in the first area; wherein the rendering information includes rendering accuracy, and in the stacking area, the rendering accuracy of the upper transparent object is higher than the rendering accuracy of the lower and obscured transparent object part; Rendering each of the transparent objects in the first area is performed according to the rendering information of each of the transparent objects in the first area.

2. The rendering method according to claim 1, characterized in that: Before determining the stacking relationship of the transparent objects in the first area, the method further includes: The scene to be rendered is divided into grids to obtain a plurality of area blocks; wherein the first area is a area block including the stacked area among the plurality of area blocks.

3. The rendering method according to claim 2, characterized in that: The method further comprises: For the second area, each transparent object in the second area is rendered using a preset rendering accuracy; wherein the second area is an area block among the multiple area blocks, which contains transparent objects and the transparent objects contained therein are not overlapped with each other.

4. The rendering method according to any one of claims 1 to 3, characterized in that: The determining the stacking relationship of the transparent objects in the first area includes: Using a preset observation point as a light source, generating a shadow map of each transparent object in the scene to be rendered; the shadow map is used to characterize the occlusion of the transparent object; Respectively determining the depth distance between each of the transparent objects and the preset observation point; The stacking relationship of each of the transparent objects in the first area is determined according to the depth distance and the shadow map.

5. The rendering method according to any one of claims 1 to 3, characterized in that: The stacking relationship includes the occlusion level of each of the transparent objects; and the determining, based on the stacking relationship, the rendering information of each of the transparent objects in the first area includes: The rendering accuracy of each of the transparent objects is determined according to the occlusion level of each of the transparent objects in the first area.

6. The rendering method according to any one of claims 1 to 3, characterized in that: The stacking relationship includes the occlusion level and depth distance of each of the transparent objects; and the determining, based on the stacking relationship, the rendering information of each of the transparent objects in the first area includes: For any of the transparent objects, determining an occlusion level of an occluded first portion of the transparent object and a depth distance of an unoccluded second portion based on the stacking relationship; Determining a rendering accuracy of the first part according to an occlusion level of the first part; The rendering accuracy of the second part is determined according to the depth distance of the second part.

7. The rendering method according to any one of claims 1 to 3, characterized in that: The determining, based on the stacking relationship, respectively the rendering information of each of the transparent objects in the first area includes: For the first region that meets the preset condition, based on the stacking relationship of each sub-region in the first region, respectively determine the rendering accuracy of each transparent object in each of the sub-regions; The preset conditions include: the number of the transparent objects is greater than or equal to a preset threshold, and there are at least two sub-areas, and the transparent objects contained in different sub-areas are not all the same.

8. The rendering method according to any one of claims 1 to 3, characterized in that: The rendering information further includes a color attribute of each of the transparent objects; the stacking relationship includes a depth distance of each of the transparent objects; and the rendering of each of the transparent objects in the first area according to the rendering information of each of the transparent objects in the first area includes: According to the rendering accuracy of each transparent object in the first area, each transparent object in the first area is divided into multiple detail level grids; Based on the color attributes of each target transparent object in the first area, the overlapping transparent object parts are rendered in mixed colors; wherein the depth distance of the target transparent object is less than a preset depth threshold.

9. The rendering method according to claim 8, characterized in that: The mixed color rendering of the overlapping transparent object parts based on the color attributes of each target transparent object in the first area includes: Determining a target mixed color of each overlapping portion based on color attributes of each of the overlapping target transparent objects; The target mixed color is used to perform mixed color rendering on each of the overlapping parts; wherein the color attributes include: color and transparency.

10. The rendering method according to claim 9, characterized in that: The step of determining the target mixed color of each overlapping part based on the color attributes of each overlapping target transparent object comprises: For an overlapping portion including two target transparent objects, determining a target mixed color of the overlapping portion according to a color attribute of a bottom target transparent object in the overlapping portion and a color attribute of a top target transparent object; For an overlapping portion containing three or more target transparent objects, the target mixed color of the overlapping portion is determined according to the mixed color attributes of all lower-layer target transparent objects in the overlapping portion and the color attributes of the top-layer target transparent object.

11. The rendering method according to claim 10, characterized in that: The step of determining the target mixed color of the overlapping portion according to the mixed color attributes of all lower layer target transparent objects in the overlapping portion and the color attributes of the top layer target transparent object comprises: Calculating a first product of the top layer color and the top layer transparency of the top layer target transparent object, and a second product of the mixed color and the mixed transparency in the mixed color attribute; The sum of the first product and the second product is determined as the target mixed color of the overlapping part; wherein the mixed color is obtained based on the color attributes of all the lower target transparent objects in the overlapping part; and the mixed transparency is obtained based on the top layer transparency.

12. A rendering device for a transparent object, characterized in that: The device comprises: A stacking relationship determination module, used to determine the stacking relationship of each transparent object in a first area of ​​a scene to be rendered; wherein the first area includes the stacking areas of each transparent object; A rendering information determination module, configured to determine the rendering information of each of the transparent objects in the first area based on the stacking relationship; wherein the rendering information includes rendering accuracy, and in the stacking area, the rendering accuracy of the upper transparent object is higher than the rendering accuracy of the lower and obscured transparent object portion; A rendering module is used to render each of the transparent objects in the first area according to the rendering information of each of the transparent objects in the first area.

13. A terminal 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, the method according to any one of claims 1 to 11 is implemented.

14. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.