Transparent rendering method and device based on weight mixing order independent transparent rendering
Through the weight mixing order-independent transparent rendering method, the weighted accumulation and deep feedback fusion mechanism are used to solve the problems of large sorting overhead, high rendering defects and high video memory usage in the existing transparent rendering technology, and efficient and clear transparent object rendering effect is achieved.
Patent Information
- Application Number
- CN202510726384.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2045-06-03
AI Technical Summary
The existing transparent rendering technology has problems such as large sorting overhead, rendering flaws, reduced frame rate and high memory usage, especially in complex scenes and multi-layer transparent objects.
The weight-mixed order-independent transparent rendering method is adopted, and the total opacity and background data of transparent objects are calculated through weighted accumulation and depth information preprocessing, combined with the depth feedback fusion mechanism, and the output image is formed.
While maintaining rendering accuracy, it improves rendering efficiency and visual effects, reduces artifacts and color drifts, and improves user experience.
Smart Images

Figure CN120259523A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of data processing, and more particularly to a transparent rendering method, apparatus, device, and computer-readable storage medium based on weighted blending order-independent transparent rendering. Background Art
[0002] The current mainstream transparent rendering technology is mainly divided into order-dependent transparent rendering and order-independent transparent rendering. For the traditional method, there are the following problems: Alpha blending: It needs to be strictly sorted from back to front, which generates O(nlogn) sorting overhead in dynamic scenes and causes rendering defects due to cross occlusion and other problems; Depth Peeling[1]: Multiple layers of peeling result in O(kn) complexity (k is the number of peeling layers). Multiple peelings require the scene to be rendered repeatedly, resulting in a serious drop in frame rate, which is 20%-30% of the original frame rate. In addition, the effect is poor for scenes with many transparent objects. Linked list-based OIT[3]: Video memory consumption is proportional to the number of fragments. There are synchronization issues in the GPU. The video memory occupancy rate is high. At 1080p resolution, the video memory occupancy exceeds 500MB when recording multiple layers of transparent information. Summary of the invention
[0003] According to an embodiment of the present application, a transparent rendering scheme based on weighted blending order-independent transparent rendering is provided, which utilizes a strategy combining weighted blending with depth information preprocessing to improve the depth relationship enhancement of transparent objects while maintaining rendering accuracy, avoids artifacts and color drift phenomena common in traditional sorting algorithms, and greatly improves the user experience.
[0004] In a first aspect of the present application, a transparent rendering method based on weighted blending order-independent transparent rendering is provided. The method comprises: Obtaining the three-dimensional scene data to be rendered; By weighted accumulation, in the constructed auxiliary buffer, the total opacity of transparent objects in the three-dimensional scene data is calculated; in the constructed main frame buffer, the background data of opaque objects in the three-dimensional scene data is calculated; The total opacity is combined with the background data to form an output image to complete the rendering.
[0005] Furthermore, the calculating the total opacity of the transparent objects in the three-dimensional scene data in the constructed auxiliary buffer by weighted accumulation includes: The information of each transparent fragment in the three-dimensional scene data is weighted and accumulated into the constructed auxiliary buffer to obtain the total opacity; Among them, based on the depth value and material properties of each transparent fragment, its local weighting coefficient is determined.
[0006] Further, the information of each transparent fragment in the three-dimensional scene data is weighted and then accumulated into the constructed auxiliary buffer, and obtaining the total opacity includes: By means of parallel per-pixel calculation, the information of each transparent fragment in the three-dimensional scene data is weighted and then accumulated into the constructed auxiliary buffer to obtain the total opacity.
[0007] Further, it further includes: Dynamically adjust the weight factor of the transparent fragment through the object material properties, light intensity, and / or viewing angle in the three-dimensional scene data.
[0008] Further, it further includes: Through the depth feedback fusion mechanism, compare the deviation between the current pixel depth and the global scene depth, and correct the weighting parameters in real time.
[0009] Further, the combining the total opacity and the background data to form an output image includes: ; Wherein, is the color of the transparent fragment; is the weight of the transparent fragment; is the transparency of the transparent fragment; is the background color.
[0010] Further, it further includes: Optimize the output image by means of anti-aliasing and / or color correction.
[0011] In the second aspect of the present application, a transparent rendering device based on weight mixing order-independent transparency rendering is provided. The device includes: An acquisition module, configured to acquire three-dimensional scene data to be rendered; A processing module, configured to calculate the total opacity of the transparent objects in the three-dimensional scene data in a weighted accumulation manner in the constructed auxiliary buffer; and calculate the background data of the opaque objects in the three-dimensional scene data in the constructed main frame buffer; An output module, configured to combine the total opacity and the background data to form an output image to complete the rendering.
[0012] In a third aspect of the present application, an electronic device is provided. The electronic device includes: a memory and a processor, where a computer program is stored on the memory, and when the processor executes the program, the methods described above are implemented.
[0013] In a fourth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method according to the first aspect of the present application is implemented.
[0014] The transparent rendering method based on weighted mixed order-independent transparency rendering provided by the embodiments of the present application includes: obtaining three-dimensional scene data to be rendered; calculating the total opacity of transparent objects in the three-dimensional scene data in an auxiliary buffer that has been constructed by means of weighted accumulation; calculating background data of opaque objects in the three-dimensional scene data in a main frame buffer that has been constructed; combining the total opacity and the background data to form an output image to complete the rendering, which can significantly improve the rendering efficiency and visual effect in complex scenes.
[0015] It should be understood that the content described in the summary of the invention section is not intended to limit the key or important features of the embodiments of the present application, nor to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In combination with the drawings and with reference to the following detailed description, the above and other features, advantages, and aspects of the embodiments of the present application will become more apparent. In the drawings, the same or similar reference numerals represent the same or similar elements, where: Figure 1 is a flowchart of a transparent rendering method based on weighted mixed order-independent transparency rendering according to an embodiment of the present application; Figure 2 is a schematic diagram of a depth feedback fusion mechanism process of a transparent rendering method based on weighted mixed order-independent transparency rendering according to an embodiment of the present application; Figure 3 is a block diagram of a transparent rendering device based on weighted mixed order-independent transparency rendering according to an embodiment of the present application; Figure 4 is a schematic diagram of the structure of a terminal device or a server suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0017] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.
[0018] In addition, the term "and / or" in this document is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally represents an "or" relationship between the associated objects before and after.
[0019] Figure 1 The flowchart of a transparent rendering method based on weighted mixed order-independent transparency rendering according to an embodiment of the present disclosure is shown. The method includes: S110, obtaining three-dimensional scene data to be rendered.
[0020] In some embodiments, the execution entity (such as a server, etc.) of the present disclosure may obtain the three-dimensional scene data sent by an electronic device communicatively connected thereto, or may also be the three-dimensional scene data pre-stored locally; the three-dimensional scene data is usually the scene data under a complex scene.
[0021] S120, calculating the total opacity of the transparent objects in the three-dimensional scene data in the constructed auxiliary buffer in a weighted accumulation manner; and calculating the background data of the opaque objects in the three-dimensional scene data in the constructed main frame buffer.
[0022] In some embodiments, two buffers may be constructed in the following manner: Main frame buffer: Used to render opaque objects, it can output the background part of the final image in a general manner, and the opaque rendering writes the result into this part for subsequent steps to use.
[0023] Auxiliary buffer: Used to process transparent objects. It is constructed using a dual-buffer architecture, that is, a separated blending strategy, and includes: Accumulative color buffer: AccumColor: in RGBA32F format, used to store the weighted color accumulation value; Weight accumulative buffer: AccumWeight: in R32F format, used to store the weight accumulation value; Accumulative color buffer: Used to store the color accumulation value after weighting of the transparent fragments; Weight accumulation buffer: Used to record the "contribution weights" accumulated by all transparent fragments, and its value is related to the alpha value and depth of the fragments.
[0024] It should be noted that before starting the rendering, the above auxiliary buffers need to be cleared to ensure that the accumulation starts from the initial state.
[0025] In some embodiments, for opaque objects in the three-dimensional scene data, all opaque objects can be first drawn into the main frame buffer according to the standard rendering pipeline. The opaque part serves as the basic background (opaque background) of the final image and will be synthesized with transparent objects in subsequent steps. Whether each subsequent transparent object is occluded can be determined through depth information.
[0026] For transparent objects in the three-dimensional scene data, in the present disclosure, instead of using the traditional source / target alpha blending, the information of each transparent fragment is weighted and accumulated into the auxiliary buffer to avoid order dependence. The weight factor, accumulated weight, and transparent color of each transparent fragment are calculated separately. The weight coefficient can be dynamically adjusted according to the object material properties, light intensity, and viewing angle. And through the depth feedback fusion mechanism, the deviation between the current pixel depth and the global scene depth is compared to correct the weighting parameters in real time to ensure that the image presents natural and realistic. To ensure the correctness of disordered transparent rendering, pixel-by-pixel parallel computing based on the fragment shader can be used to accumulate the color information of each transparent layer to generate the accumulated color, that is, the finally calculated transparent color.
[0027] Specifically, the weight of the transparent fragment can be dynamically adjusted through the following standard depth-weighted blending model: ; where k is the control for the near-view attenuation rate; β is to adjust the far-view smoothness; Furthermore, the weights of light and position information are also added to dynamically update the weight function. Specifically, through the normalized direction vector calculated from the position of the light source and the object , the normalized direction vector calculated from the object position and the camera position , dot product calculation , through as the weight multiplication of the light part is accumulated on to make the part with stronger light have a higher weight; For each fragment of a transparent object, the local weighting coefficient α can be calculated according to its depth value and material properties. Specifically, the refractive index is usually present in the material properties of the transparent object , combined with to calculate the reflection coefficient , and then the depth value is added to modify the weight to obtain the calculated , where, is the locally weighted coefficient of the original setting. After calculation, it can make the weights of objects with strong reflections higher.
[0028] Furthermore, to improve the mixing precision, for the accumulation results of different depth layers, an adaptive normalization technique can be adopted to ensure that the color distribution is uniform and realistic.
[0029] In some embodiments, after weighted mixing is completed, due to certain differences in depth among different fragments, color mixing may deviate. Therefore, in the present disclosure, a depth feedback fusion mechanism is designed to solve this problem, including: As Figure 2 shown in the pseudocode in, the depth information obtained in the opaque rendering stage can be used to verify the current pixel depth. If it is detected that the depth deviation exceeds a preset threshold, the corresponding weighted parameter is automatically adjusted, and the color value of this pixel is recalculated; the threshold can be preset according to the application scenario.
[0030] Furthermore, an iterative correction method can be adopted to make the color distribution of the entire scene reach global consistency within a limited number of iterations.
[0031] S130, combine the total opacity and the background data to form an output image to complete the rendering.
[0032] In some embodiments, the finally calculated transparent color and the previously drawn opaque background can be combined through weights by the following formula to form the final output image: ; where is the color of the transparent fragment; is the weight of the transparent fragment; is the transparency of the transparent fragment; is the background color; is the total opacity after the superposition of all transparent layers. When all ( →0), this term approaches 0 (completely transparent); when all ( →1), this term approaches 1 (completely opaque); is the product of the penetration rates of all transparent layers, indicating the remaining contribution of the background light energy after passing through all transparent layers; is the background contribution term.
[0033] Furthermore, it also includes: After the rendering is completed, effects can also be added through post-processing. For example, the output image can be processed for anti-aliasing, color correction, etc., and finally the rendering result is output to the display device. Parameters can be adjusted according to different application scenarios (such as scientific visualization) to improve the user experience, that is, to reflect the scalability of the present application.
[0034] According to the embodiments of the present disclosure, the following technical effects are achieved: The transparent rendering weight calculation method of the present disclosure can dynamically set the weighting factor according to the object material properties, lighting conditions, and viewing angle information, improving the accuracy of rendering the color of each transparent object; The depth feedback fusion mechanism adopts an iterative correction method, which can make the global color distribution tend to be uniform within a limited number of iterations, making the occlusion relationship between different transparent objects clearer. Even in the case of a large number of transparent objects, the front-back relationship can still be reflected, realizing efficient transparent rendering and greatly improving the user experience. See Table 1: Table 1 ; It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0035] The above is the introduction of the method embodiments. The following further illustrates the solution of the present application through device embodiments.
[0036] Figure 3 FIG. 300 shows a block diagram of a transparent rendering device for weight-mixed order-independent transparent rendering according to an embodiment of the present application, as Figure 3 shown including: An acquisition module 310, configured to acquire three-dimensional scene data to be rendered; A processing module 320, configured to calculate the total opacity of transparent objects in the three-dimensional scene data in a weighted accumulation manner in a constructed auxiliary buffer; calculate background data of opaque objects in the three-dimensional scene data in a constructed main frame buffer; An output module 330, configured to combine the total opacity and the background data to form an output image to complete the rendering.
[0037] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the described modules can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.
[0038] Figure 4 The structure diagram of a terminal device or a server suitable for implementing the embodiments of the present application is shown.
[0039] As Figure 4 shown, the terminal device or the server includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 402 or the program loaded from the storage section 408 into the random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the terminal device or the server are also stored. The CPU 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. The input / output (I / O) interface 405 is also connected to the bus 404.
[0040] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as required. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as required, so that the computer program read from it can be installed into the storage section 408 as required.
[0041] Specifically, according to the embodiments of the present application, the above method flow steps can be implemented as a computer software program. For example, the embodiments of the present application include a computer program product, which includes a computer program carried on a machine-readable medium, and the computer program includes program codes for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication section 409, and / or installed from the removable medium 411. When the computer program is executed by the central processing unit (CPU) 401, the above functions defined in the system of the present application are executed.
[0042] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this application, a computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in conjunction with an instruction execution system, apparatus, or device. And in this application, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, and this computer-readable medium can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0043] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram can represent a module, a program segment, or a part of code, and the foregoing module, program segment, or part of code contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0044] The units or modules involved in the embodiments described in this application can be implemented in software or in hardware. The described units or modules can also be provided in a processor. Among them, the names of these units or modules do not, in some cases, constitute a limitation on the units or modules themselves.
[0045] As another aspect, this application also provides a computer-readable storage medium. The computer-readable storage medium can be included in the electronic device described in the foregoing embodiments; or it can exist separately without being assembled into the electronic device. The foregoing computer-readable storage medium stores one or more programs, and when the foregoing programs are executed by one or more processors, they implement the methods described in this application.
[0046] The above description is only a preferred embodiment of this application and an explanation of the technical principles applied. Those skilled in the art should understand that the scope of the application involved in this application is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the foregoing application concept. For example, the technical solutions formed by mutually replacing the above features with other technical features (but not limited to) having similar functions in this application.
Claims
1. A transparent rendering method based on weight-mixed order-independent transparency rendering, characterized in that, Including: Obtain the three-dimensional scene data to be rendered; In the constructed auxiliary buffer, calculate the total opacity of the transparent objects in the three-dimensional scene data by means of weighted accumulation; in the constructed main frame buffer, calculate the background data of the opaque objects in the three-dimensional scene data; Combine the total opacity and the background data to form an output image to complete the rendering.
2. The method according to claim 1, characterized in that, The calculating the total opacity of the transparent objects in the three-dimensional scene data in the constructed auxiliary buffer by means of weighted accumulation includes: Weight the information of each transparent fragment in the three-dimensional scene data and accumulate it into the constructed auxiliary buffer to obtain the total opacity; Among them, based on the depth value and material properties of each transparent fragment, determine its local weighting coefficient.
3. The method according to claim 2, wherein The weighting the information of each transparent fragment in the three-dimensional scene data and accumulating it into the constructed auxiliary buffer to obtain the total opacity includes: By means of per-pixel parallel calculation, weight the information of each transparent fragment in the three-dimensional scene data and accumulate it into the constructed auxiliary buffer to obtain the total opacity.
4. The method according to claim 3, characterized in that It also includes: Dynamically adjust the weight factor of the transparent fragment through the object material properties, light intensity and / or viewing angle in the three-dimensional scene data.
5. The method according to claim 4, wherein It also includes: Through the depth feedback fusion mechanism, compare the deviation between the current pixel depth and the global scene depth, and correct the weighting parameters in real time.
6. The method according to claim 5, wherein The combining the total opacity and the background data to form an output image includes: ; Among them, is the color of the transparent fragment; is the weight of the transparent fragment; is the transparency of the transparent fragment; is the background color.
7. The method according to claim 1, characterized in that It also includes: Optimize the output image by means of anti-aliasing and / or color correction.
8. A transparent rendering device based on weight-mixed order-independent transparency rendering, characterized in that, Including: An acquisition module, configured to obtain the three-dimensional scene data to be rendered; A processing module, configured to calculate the total opacity of the transparent objects in the three-dimensional scene data by means of weighted accumulation in the constructed auxiliary buffer; In the constructed main frame buffer, calculate the background data of the opaque objects in the three-dimensional scene data; An output module, configured to combine the total opacity and the background data to form an output image to complete the rendering.
9. An electronic device, comprising a memory and a processor, wherein a computer program is stored on the memory, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Scene rendering method and device
CN116246004A
Image processing method and device, image rendering method and device, equipment and medium
CN116342720A
Transparent rendering complex scene depth estimation method and device based on octree
CN116402936A
Sequence-independent transparent rendering method and system for Internet three-dimensional map
CN117095110A
OpenGL-based order-independent transparency image rendering method
CN117315123A
Cited By
Three-dimensional model lightweight compression method and system based on layered depth image
CN121767570A
Transparent model rendering method and system
CN121810905A