Rendering method and device of semitransparent object, computer equipment, medium and program product

By acquiring the effective depth data and initial color of a semi-transparent object, performing depth sorting and color fusion, the problem of high rendering computation and poor effect in existing technologies is solved, achieving more efficient rendering effect and accurate lighting mixing.

CN121544784APending Publication Date: 2026-02-17TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511706478.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-19
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing technologies require a large amount of computation and produce poor results when rendering semi-transparent objects, with hard transitions and jagged edges, and cannot effectively participate in the mixed calculation of delayed lighting.

Method used

By acquiring the effective depth data of each pixel of a semi-transparent object and the object's initial color, depth sorting and color fusion are performed to ensure the correct rendering order, reduce the number of blending operations, and participate in lighting blending calculations.

Benefits of technology

It reduces the computational load for rendering semi-transparent objects, reduces jagged edges, improves rendering effects, and ensures the accuracy of lighting blending and image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121544784A_ABST
    Figure CN121544784A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a rendering method and device of a semitransparent object, computer equipment, a medium and a program product. Effective depth data of all pixel points included in the semitransparent object in a scene and object initial colors corresponding to all the pixel points included in the semitransparent object are obtained. And based on the effective depth data, performing depth sorting on a plurality of pixel points included in the semitransparent object so as to correctly describe the effect of light passing through the semitransparent object through an obtained pixel point depth sequence, and according to the pixel point depth sequence, performing fusion on the object initial colors corresponding to the pixel points included in the semitransparent object so as to obtain the semitransparent object. According to the method, the object color of the semitransparent object is obtained, so that the correct relation between the semitransparent object and the background depth is ensured, the mixing frequency of the semitransparent area is reduced, the calculation amount is reduced, the probability of hard transition of a highlight or shadow edge can be reduced, the sawtooth feeling of the rendered semitransparent object is reduced, and the rendering effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of rendering technology, and in particular to a rendering method, apparatus, computer equipment, medium, and program product for a semi-transparent object. Background Technology

[0002] With the development of image rendering technology, various complex objects in reality can be rendered, providing users with a rich visual experience. These objects can be transparent, opaque, or semi-transparent (such as hair, glass, and complex smoke).

[0003] In related technologies, a binary mask (Mask Blend Mode) is usually used to control the opacity of opaque objects. In a binary mask, 0 indicates that the pixel is completely transparent and 1 indicates that the pixel is completely opaque. That is to say, semi-transparent pixels can only be represented by being completely transparent or completely opaque.

[0004] However, the above method requires multiple color mixing processes for the semi-transparent areas of semi-transparent objects, and cannot directly participate in the mixing calculation of delayed lighting, resulting in hard transitions at the edges and a strong jagged effect. It not only has a large amount of computation but also poor rendering effect. Summary of the Invention

[0005] To address the aforementioned technical problems, this application provides a rendering method, apparatus, computer equipment, medium, and program product for semi-transparent objects, which reduces the computational load of rendering semi-transparent objects and improves the rendering effect.

[0006] The embodiments of this application disclose the following technical solutions:

[0007] On one hand, embodiments of this application provide a rendering method for a semi-transparent object, the method comprising:

[0008] The effective depth data of each pixel of the semi-transparent object in the scene is obtained, and the effective depth data is used to describe the depth of each pixel of the semi-transparent object in the scene.

[0009] Obtain the initial color of each pixel in the semi-transparent object;

[0010] The pixels of the semi-transparent object are sorted by depth based on the effective depth data to obtain a pixel depth sequence. The pixel depth sequence is used to indicate the sequence relationship between the depths of multiple pixels at the same position in the semi-transparent object.

[0011] Based on the pixel depth sequence, the initial colors of each pixel in the semi-transparent object are fused to obtain the object color of the semi-transparent object.

[0012] On the other hand, embodiments of this application provide a rendering apparatus for a semi-transparent object, the apparatus comprising: an acquisition unit, a sorting unit, and a blending unit;

[0013] The acquisition unit is used to acquire the effective depth data of each pixel of the semi-transparent object in the scene, and the effective depth data is used to describe the depth of each pixel of the semi-transparent object in the scene.

[0014] The acquisition unit is also used to acquire the initial color of the object corresponding to each pixel of the semi-transparent object;

[0015] The sorting unit is used to sort the depth of each pixel in the semi-transparent object according to the effective depth data to obtain a pixel depth sequence. The pixel depth sequence is used to indicate the sequence relationship between the depths of multiple pixels at the same position in the semi-transparent object.

[0016] The fusion unit is used to fuse the initial colors of each pixel in the semi-transparent object according to the pixel depth sequence to obtain the object color of the semi-transparent object.

[0017] On the other hand, embodiments of this application provide a computer device, the computer device including a processor and a memory:

[0018] The memory is used to store computer programs and to transfer the computer programs to the processor;

[0019] The processor is configured to execute the methods described above according to instructions in the computer program.

[0020] On the other hand, embodiments of this application provide a computer-readable storage medium for storing a computer program for performing the methods described above.

[0021] On the other hand, embodiments of this application provide a computer program product including a computer program, which, when run on a computer device, causes the computer device to perform the methods described above.

[0022] As can be seen from the above technical solution, obtaining the effective depth data of each pixel in the semi-transparent object within the scene, as well as the initial object color corresponding to each pixel in the semi-transparent object without any other objects, is achieved by disabling color output and calculating only the distance from the pixel to the virtual camera, ensuring the correct rendering order. The initial object color describes the color of the semi-transparent object itself under ideal conditions, providing a correct color basis and ensuring rendering accuracy. Based on the effective depth data, the pixels within the semi-transparent object are sorted by depth, allowing pixels at the same location to be ordered from back to front based on the effective depth data. This allows the obtained pixel depth sequence to correctly describe the effect of light passing through the semi-transparent object. Furthermore, the initial object colors corresponding to each pixel in the semi-transparent object are fused according to the pixel depth sequence to obtain the object color of the semi-transparent object. In other words, the depth information and lighting data are mixed according to the actual occlusion relationship to obtain the object color of the semi-transparent object. In other words, this application utilizes the effective depth data of semi-transparent objects in a scene. This effective depth data is continuous and accurately describes the position of pixels in the scene. By sorting multiple pixels based on this effective depth data, the correct relationship between the depth of the semi-transparent object and the background can be ensured. Moreover, based on this effective depth data, the color of the material can be included in the lighting mixing calculation. This not only reduces the number of mixing operations in the semi-transparent area, thus reducing the computational load, but also reduces the probability of hard transitions at the edges of highlights or shadows, reducing the jaggedness of the semi-transparent object after rendering and improving the rendering effect. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 A schematic diagram of a computer system for a rendering method of a semi-transparent object provided in an embodiment of this application;

[0025] Figure 2 A schematic diagram illustrating an application scenario of a rendering method for a semi-transparent object provided in an embodiment of this application;

[0026] Figure 3 A flowchart illustrating a rendering method for a semi-transparent object provided in an embodiment of this application;

[0027] Figure 4 This is a schematic diagram of the pixel distribution in a semi-transparent object provided in an embodiment of this application;

[0028] Figure 5 This is a rendering diagram of different areas of a semi-transparent object provided in an embodiment of this application;

[0029] Figure 6 This application provides a schematic diagram of the distribution of pixels in a semi-transparent object and scene.

[0030] Figure 7 A schematic diagram of the rendering process for a semi-transparent object provided in an embodiment of this application;

[0031] Figure 8 A flowchart illustrating a sequence-independent transparency preprocessing stage provided in an embodiment of this application;

[0032] Figure 9 A flowchart illustrating a sequence-independent transparency rendering stage provided in an embodiment of this application;

[0033] Figure 10 A flowchart illustrating a semi-transparent processing stage provided in an embodiment of this application;

[0034] Figure 11 A comparative schematic diagram of different types of hair provided for an embodiment of this application;

[0035] Figure 12 A schematic diagram of the structure of a rendering device for a semi-transparent object provided in an embodiment of this application;

[0036] Figure 13 This application provides a schematic diagram of the structure of a server according to an embodiment of the present application.

[0037] Figure 14 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0039] It should be noted that this application may display a prompt interface, pop-up window, or output voice prompts before and during the collection of user-related data (such as effective depth data, initial object color, etc.). These prompt interfaces, pop-ups, or voice prompts are used to inform the user that their relevant data is being collected. This ensures that the application only begins the steps for collecting user-related data after receiving confirmation from the user regarding the prompt interface or pop-up window; otherwise (i.e., without receiving confirmation from the user), the steps for collecting user-related data end, meaning no user-related data is collected. In other words, all user data collected in this application is collected with the user's consent and authorization, and the collection, use, and processing of relevant user data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0040] To facilitate understanding of the technical solutions of this application, some technical terms involved in the embodiments of this application will be briefly introduced below.

[0041] (1) Rendering Pipeline: This is a process for converting a 3D scene into a 2D image, involving a series of sequentially executed graphics processing stages. This process is highly optimized in modern graphics hardware (such as Graphics Processing Unit (GPU)) and game engines (such as Unity and Unreal Engine, UE) to achieve real-time rendering and high-quality visual effects.

[0042] (2) Deferred Shading Pipeline: This is the default rendering path used by UE, especially when dealing with complex lighting and materials. The deferred pipeline is mainly divided into several stages, such as the view initialization stage, preprocessing stage, basic rendering stage, lighting stage, and postprocessing stage.

[0043] (3) Forward Rendering Pipeline: It is the mainstream real-time rendering technology in computer graphics. Its core logic is to closely combine the lighting calculation and geometry rendering of each object, and process the influence of the light source on the object in a pixel-by-pixel (or vertex-by-vertex) manner to finally generate the visible image on the screen.

[0044] A semi-transparent object is one that allows some light to pass through. For example, semi-transparent objects in a rendering scene could be hair, glass objects, or smoke. In related technologies, the binarized mask representation of the semi-transparent areas of a semi-transparent object requires repeatedly performing color blending operations when processing these areas, significantly increasing the overall rendering computation. Furthermore, binarized masks cannot be used in conjunction with the deferred lighting stage, affecting the quality of the final image.

[0045] Based on this, embodiments of this application propose a rendering method, apparatus, computer device, medium, and program product for semi-transparent objects. By sorting pixels by depth based on continuous and accurate depth data that correctly describes their positions in the scene, the depth relationship between the semi-transparent object and the background can be ensured to be correct. This standardizes the measurement of each pixel within the semi-transparent object, reducing the number of blending operations in the semi-transparent area and thus lowering the computational load. Furthermore, by incorporating material color into the lighting blending calculations based on this effective depth data, the rendering of semi-transparent objects can be reduced, improving the rendering effect.

[0046] To facilitate understanding of the rendering method for semi-transparent objects provided in the embodiments of this application, the computer system for the rendering method of semi-transparent objects will be described below.

[0047] See Figure 1 This figure is a schematic diagram of a computer system for a rendering method of a semi-transparent object provided in an embodiment of this application. The computer system 100 includes multiple devices, such as multiple terminal devices 110 and multiple servers 120, etc. The terminal devices 110 and servers 120 can communicate with each other through a communication network.

[0048] The communication network uses standard communication technologies and / or protocols, typically the Internet, but can also be any network, including but not limited to Bluetooth, local area network (LAN), metropolitan area network (MAN), wide area network (WAN), mobile, private network, or any combination of virtual private network. In some embodiments, custom or dedicated data communication technologies may be used to replace or supplement the aforementioned data communication technologies.

[0049] The terminal device can be an electronic device such as a smartphone, wearable device, personal computer (PC), intelligent voice interaction device, smart home appliance, vehicle terminal, aircraft, unmanned vending terminal, extended reality (XR) device, etc. Among them, XR devices can include virtual reality (VR) devices, augmented reality (AR) devices, mixed reality (MR) devices, and other electronic devices. A client application for the target application can be installed and run on the terminal device. This target application can be used to render scenes or objects, or to obtain data required for rendering; this application does not limit its use. Furthermore, this application does not limit the form of the target application, including but not limited to applications (Apps), mini-programs, etc., installed on the terminal device, and can also be in the form of a webpage.

[0050] A server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services such as cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and basic cloud computing services such as big data. The server can be a backend server for the aforementioned target application, providing computing resources for rendering semi-transparent objects.

[0051] To facilitate understanding of the rendering method for semi-transparent objects provided in this application embodiment, the following example uses a server as the execution subject of the rendering method for semi-transparent objects to illustrate the application scenarios of the rendering method for semi-transparent objects.

[0052] See Figure 2 This figure is a schematic diagram illustrating an application scenario of a rendering method for a semi-transparent object provided in an embodiment of this application. Figure 2 In this application scenario, server 210, database 220, and terminal device 230 are used. Server 210 is used to render semi-transparent objects, database 220 is used to provide the data required for rendering by server 210, and terminal device is used to display the semi-transparent objects rendered by server 210. The following explanation uses the rendered semi-transparent object as hair as an example.

[0053] In A1, server 210 can first send a data request instruction to database 230 to obtain the resources needed to render hair.

[0054] In A2, database 230 responds to the data request instruction sent by server 210 by sending to server 210 the effective depth data of each pixel in the hair in the scene, as well as the initial color of the object corresponding to each pixel in the hair.

[0055] In A3, server 210 sorts the depth of each pixel in the hair based on the effective depth data to obtain a pixel depth sequence.

[0056] In A4, server 210 fuses the initial colors corresponding to each pixel in the semi-transparent object according to the pixel depth sequence to obtain the rendered hair, thus completing the hair rendering process.

[0057] In A5, server 210 sends the rendered hair to terminal device 230 so that terminal device 230 can display it.

[0058] It should be noted that, Figure 2 The image does not show hair with color variations, but only the outline of the hair. It can be seen that the hair outline reduces the jaggedness and improves the rendering effect.

[0059] It should be noted that the data required for rendering semi-transparent objects (such as hair) can be stored on server 210, so that server 210 can independently complete the rendering process of semi-transparent objects.

[0060] The rendering method for semi-transparent objects provided in this application embodiment can be executed by a server. However, in other embodiments of this application, the terminal device may also have similar functions to the server to execute the rendering method for semi-transparent objects provided in this application embodiment, or the terminal device and the server may jointly execute the rendering method for semi-transparent objects provided in this application embodiment. This embodiment does not limit this.

[0061] The rendering method for semi-transparent objects provided in this application can be applied to various scenarios, including but not limited to game engines, animation production, virtual reality, and augmented reality. Two scenarios are illustrated below.

[0062] Scenario 1: Game Engine Scene. During gameplay, when semi-transparent objects such as character hair, clothing, glass ornaments, or water surfaces require real-time rendering, the game engine can obtain game resource material packs from the terminal device running the game. These material packs pre-store the effective depth data and initial color of the semi-transparent objects, perform depth sorting and color blending, thereby enabling real-time rendering of semi-transparent objects in the game. This significantly reduces jagged edges on semi-transparent objects during gameplay, providing a better visual experience.

[0063] Scenario 2: Animation Production. During the production of 3D animation or visual effects, the rendering server can execute the semi-transparent object rendering method provided in this application for semi-transparent objects such as smoke, glass windows, fog, and transparent liquids in the scene. The rendering server can sample the semi-transparent objects in the scene, obtain the effective depth data of each pixel in the scene, obtain the initial color of each pixel through lighting rendering, sort multiple pixels in the same viewing direction according to the effective depth data, and perform color fusion based on the depth sorting result to realize the animation rendering process of the semi-transparent objects.

[0064] It should be noted that the above application scenarios are merely examples. The rendering method for semi-transparent objects provided in this embodiment can also be applied to other scenarios, and is not limited here.

[0065] The following describes in detail a rendering method for a semi-transparent object provided in this application through method embodiments.

[0066] See Figure 3 This figure is a schematic flowchart illustrating a rendering method for a semi-transparent object according to an embodiment of this application. For ease of description, the following embodiments use a computer device as the execution subject of this semi-transparent object rendering method, such as the aforementioned terminal device or server. Figure 3 As shown, the rendering method for this semi-transparent object includes the following steps:

[0067] S301: Obtain the effective depth data of each pixel in the scene of the semi-transparent object.

[0068] In this context, the scene refers to the spatial environment in which the semi-transparent object resides during the rendering process. For example, the scene can be a wall, the ground, or the sky. In this embodiment, since the semi-transparent object and the scene are rendered separately, the scene can be considered as a collection of all elements except the semi-transparent object. For example, if the semi-transparent object is a character's hair, the scene can be the character's body, buildings, vegetation, terrain, or other objects that are not semi-transparent.

[0069] In this embodiment, an object is a graphical unit with independent rendering attributes in the rendering scene. An object can be a three-dimensional model, a two-dimensional texture area, or a logical collection composed of multiple pixels. A pixel is the smallest unit constituting an image, and each pixel can possess corresponding attribute information, such as depth and color. Depth data is used to describe the distance from the pixel to the virtual camera; that is, depth data describes the depth of the pixel. The smaller the depth data, the closer the pixel is to the virtual camera; the larger the depth data, the farther the pixel is from the virtual camera.

[0070] It should be noted that an object is actually a rendering target comprising multiple pixels. That is, an object can be a complete entity or a region of an entity; this application does not limit this. For example, complete human hair can be an object, and the surface region and the deep region of the hair can also be different objects.

[0071] Based on whether or not light can pass through, objects can be divided into opaque objects, translucent objects, and transparent objects. Among them, opaque objects completely block light, translucent objects allow some light to pass through, and transparent objects allow light to pass through completely.

[0072] Binary masks are commonly used in related technologies to control the transparency of objects. However, this method requires repeated color blending operations when dealing with semi-transparent areas. Since semi-transparent pixels cannot be accurately represented in a single rendering process, the rendering pipeline has to draw the same area multiple times and repeatedly overlay colors, significantly increasing the overall rendering computation. Furthermore, binarized masks cannot be used in conjunction with the deferred lighting stage, preventing lighting calculations from being completed in one go. This not only adds extra burden to the rendering stage but also easily produces abrupt transitions and noticeable jagged edges at the edges of semi-transparent objects, ultimately affecting the quality of the final image.

[0073] This application addresses the aforementioned problems by introducing effective depth data. Effective depth data describes the depth of each pixel within a semi-transparent object in the scene. Effective depth data provides a unified measurement, allowing for a single expression to describe the depth of each pixel within a semi-transparent object. Compared to expressing pixel depth locally in different areas of a semi-transparent object, this reduces the number of fusion operations between different areas. Furthermore, effective depth data describes the depth of each pixel within the scene, ensuring a clear positional relationship for each pixel during rendering. Based on effective depth data, color fusion can be performed according to the correct occlusion relationship after depth sorting, reducing the additional computational cost of repeated fusion, making lighting mixing more accurate, reducing jagged edges, and improving the final rendered image quality.

[0074] As one possible approach, effective depth data can be determined by measuring the actual position of each pixel in the semi-transparent object within the space of the scene, thus ensuring that the depth of the semi-transparent object is consistent with that of other objects in the scene. This allows for accurate reproduction of the occlusion relationships between the semi-transparent object and other objects in complex scenes, improving the spatial continuity and realism of the rendering results.

[0075] This application does not specifically limit the method of obtaining effective depth data. For example, effective depth data can be obtained directly. Or, effective depth data can be calculated based on the depth of the semi-transparent object and the depth of the scene. The calculation process of effective depth data will be explained in two ways below, see E1-E3 and F1-F2 for details, and will not be repeated here.

[0076] S302: Obtain the initial color of each pixel in the semi-transparent object.

[0077] The initial color of an object is its color before color blending. In other words, the initial color is the color of each pixel within the semi-transparent object itself, unaffected by other factors. For example, the initial color is not influenced by reflected light, refracted light, shadows, ambient light rendering, background color overlay, or post-processing effects from other objects in the scene.

[0078] S303: Sort the depth of each pixel in the semi-transparent object according to the effective depth data to obtain the pixel depth sequence.

[0079] Among them, the pixel depth sequence is used to indicate the sequence relationship between the depths of multiple pixels at the same location in a semi-transparent object.

[0080] Specifically, during the rendering process of projecting a 3D scene onto a 2D image, each ray of light emitted by the virtual camera passes through multiple layers of pixels in a semi-transparent object. Although these pixels map to the same location on the semi-transparent object in the 2D image (or the same location on the screen if the 2D image is displayed on a computer device), they are at different depths in the 3D scene. In other words, multiple pixels at the same location in the semi-transparent object overlap on the 2D screen but are distributed based on depth in 3D space.

[0081] like Figure 4 As shown, a semi-transparent object can be displayed through three data layers. Pixels 1, 2, and 3 are different pixels at the same location within the semi-transparent object. Pixels 1, 2, and 3 have different depths, but their coordinates in the corresponding data layer are all (2, 1). Therefore, pixels 1, 2, and 3 can be considered as pixels at different depths but in the same location. Light emitted from the virtual camera can pass through pixels 1, 2, and 3 sequentially. In subsequent rendering, the colors of the three pixels can be superimposed and blended to obtain the resulting color.

[0082] As mentioned above, effective depth data is used to describe the depth of each pixel within a semi-transparent object in the scene. Depth sorting is used to arrange pixels from far to near or from near to far based on their depth in the scene, thereby determining the rendering order of each pixel and the actual positional relationship between them.

[0083] For example, if pixel A has a depth of 1, pixel B has a depth of 3, and pixel C has a depth of 2, they can be sorted by depth according to their distance from the virtual camera from farthest to closest, resulting in the pixel depth sequence: pixel B, pixel C, pixel A.

[0084] S304: Based on the pixel depth sequence, the initial colors of each pixel in the semi-transparent object are fused to obtain the object color of the semi-transparent object.

[0085] The object color is obtained by blending the colors of each pixel in a semi-transparent object. Based on the depth relationship between multiple pixels described by their depth sequences, the initial colors of multiple pixels are superimposed and mixed to obtain the object color of the semi-transparent object.

[0086] It's important to note that color fusion is based on pixel depth sequences determined by effective depth data because pixels at different depths play different roles in the light propagation path, contributing significantly to the object's color. For example, pixels closer to the virtual camera contribute more to the rendering result with their initial object color and typically have higher visibility. Pixels further away have their initial object color superimposed first and then occluded by closer pixels, contributing less to the rendering result. Therefore, if the initial object colors are not superimposed according to the correct depth order, the occlusion relationship of the light will be disrupted, resulting in colors that are too dark, too bright, or have abnormal transparency, leading to a distorted final image.

[0087] Taking multiple pixels at the same location in a semi-transparent object as an example, the initial colors of each pixel can be superimposed in order of depth from high to low, i.e., in order of distance from the virtual camera from farthest to closest, to obtain the initial color of the object at that location. This application does not specifically limit the method of fusing the initial colors of each pixel; two methods are described below as examples.

[0088] The first fusion method involves sequentially overlaying colors of different depths at the same location based on pixel depth, so that colors closer to the virtual camera cover colors further away, thus creating a layered effect in object color. Specifically, different weights can be set based on pixel depth, giving higher initial color weights to pixels closer to the virtual camera and lower initial color weights to pixels further away, followed by weighted fusion.

[0089] The second fusion method involves averaging the initial colors of multiple pixels at the same location to achieve a smooth and natural fusion effect.

[0090] As can be seen from the above technical solution, obtaining the effective depth data of each pixel in the semi-transparent object within the scene, as well as the initial object color corresponding to each pixel in the semi-transparent object without any other objects, is achieved by disabling color output and calculating only the distance from the pixel to the virtual camera, ensuring the correct rendering order. The initial object color describes the color of the semi-transparent object itself under ideal conditions, providing a correct color basis and ensuring rendering accuracy. Based on the effective depth data, the pixels within the semi-transparent object are sorted by depth, allowing pixels at the same location to be ordered from back to front based on the effective depth data. This allows the obtained pixel depth sequence to correctly describe the effect of light passing through the semi-transparent object. Furthermore, the initial object colors corresponding to each pixel in the semi-transparent object are fused according to the pixel depth sequence to obtain the object color of the semi-transparent object. In other words, the depth information and lighting data are mixed according to the actual occlusion relationship to obtain the object color of the semi-transparent object.

[0091] In other words, this application utilizes the effective depth data of semi-transparent objects in a scene. This effective depth data is continuous and accurately describes the position of pixels in the scene. By sorting multiple pixels based on this effective depth data, the correct relationship between the depth of the semi-transparent object and the background can be ensured. Moreover, based on this effective depth data, the color of the material can be included in the lighting mixing calculation. This not only reduces the number of mixing operations in the semi-transparent area, thus reducing the computational load, but also reduces the probability of hard transitions at the edges of highlights or shadows, reducing the jaggedness of the semi-transparent object after rendering and improving the rendering effect.

[0092] When rendering scenes with a high level of detail, semi-transparent objects are computationally expensive, requiring significant computational resources. Using the same rendering pipeline for all objects would result in different object types being rendered with the most complex methods, increasing computational load and reducing overall rendering efficiency. For example, opaque objects are easier to render and require less computation; using the most complex rendering pipeline for semi-transparent objects could significantly increase the computational burden.

[0093] Based on this, various objects in the scene can be distinguished, allowing different types of objects to be rendered using different rendering pipelines, thus reducing unnecessary computational overhead. One method of distinction is explained below; see pages B1-B3 for details:

[0094] B1: Get the opacity data of objects in the scene.

[0095] Opacity data describes the opacity of each pixel within an object. It allows us to acquire the opacity data of various objects in a scene, and thus classify them accordingly.

[0096] B2: If the opacity data of an object is greater than the opacity threshold, then the object is identified as an opaque object.

[0097] The opacity threshold is the dividing line between opaque and semi-transparent objects. If an object's opacity value is greater than the opacity threshold, it indicates that the object has high opacity and can be classified as an opaque object.

[0098] The opacity threshold can be preset or calculated based on the opacity data of various objects in the scene. For example, the threshold can be determined based on the average and variance of the opacity, and its calculation method can be found in the following formula:

[0099]

[0100] in, The opacity threshold. The average opacity. This is a coefficient used to adjust the opacity threshold. The variance of the opacity.

[0101] B3: If the opacity data of an object is less than or equal to the opacity threshold, the object is identified as a semi-transparent object.

[0102] If the opacity data of an object is less than or equal to the opacity threshold, it means that the object has low opacity and can be identified as a semi-transparent object.

[0103] One possible approach is to differentiate objects in the scene based on their opacity data, and then use different rendering pipelines for different types of objects. For example, a front-line rendering pipeline could be used to render semi-transparent objects, while a deferred pipeline could be used to render opaque objects.

[0104] Therefore, by differentiating objects in a scene based on their opacity data, computing devices can select appropriate computational methods for objects with different transparency characteristics. For example, they can choose a rendering pipeline that matches the object's opacity, instead of assigning all objects to the most complex rendering pipeline. This reduces redundant computation caused by using the same rendering pipeline, effectively controlling performance consumption when rendering complex scenes and improving rendering efficiency.

[0105] For the same object, different regions may exhibit different transparency characteristics. For example, region A of the same object may be translucent, while region B may be opaque. Based on this, different regions of an object can be distinguished. The following example, using a target region among multiple regions of an object, illustrates the classification process for the target region; see C1-C2 for details:

[0106] C1: If the opacity data of the target area is greater than the opacity threshold, then the target area is determined to be an opaque object.

[0107] It should be noted that different regions comprised of the same object can also be considered as different objects.

[0108] If the opacity data of the target area is greater than the opacity threshold, it indicates that the opacity of the target area is high, and the target area can be identified as an opaque object. For example, the target area could be the root region of a hair.

[0109] C2: If the opacity data of the target area is less than or equal to the opacity threshold, then the target area is determined as a semi-transparent object.

[0110] If the opacity data of the target area is less than or equal to the opacity threshold, it means that the opacity of the target area is low, and the target area can be identified as a semi-transparent object.

[0111] like Figure 5As shown, hair can comprise different regions. For example, the root region can be opaque, while the hair strands can be translucent. This is determined by lighting characteristics; the root region almost completely blocks light, while the hair strands allow some light to pass through. One possible implementation is to render the root and hair strand regions separately using different rendering pipelines. Rendering the root region using the deferred pipeline yields the rendering result, while rendering the hair strand region using the forward pipeline yields the rendering result. It should be noted that the region definitions in the diagram are only approximate locations and do not specifically define the shape of the region.

[0112] Taking hair as an example, the root area of ​​hair is usually denser and has higher opacity, while the bangs or ends of the hair have higher transparency. If all hair is treated as a semi-transparent object, the root area will also undergo the high-cost rendering operation corresponding to semi-transparent objects, resulting in unnecessary computational consumption. Therefore, by classifying different regions of the same object based on opacity data, the computer can select the corresponding calculation method for regions with different transparency characteristics. For example, a suitable rendering pipeline can be selected at a finer granularity, which can effectively reduce the amount of computation for objects with complex transparency characteristics, further improving the overall rendering efficiency.

[0113] This application does not specifically limit how to obtain the effective depth data of each pixel of the semi-transparent object in the scene. The following description uses one method as an example, namely a specific implementation of S301, as detailed in D1-D2:

[0114] D1: Obtain the depth data of the scene and the depth data of semi-transparent objects in the scene.

[0115] First, we will introduce the first and second coordinate systems.

[0116] The first coordinate system is a unified coordinate system used to represent the positional relationships of various pixels in a scene. For example, the first coordinate system can be the world coordinate system. The first coordinate system can reflect the absolute position of each pixel in the scene; for example, in the first coordinate system, it can indicate the actual distance from a pixel to the virtual camera.

[0117] The second coordinate system is a local coordinate system used to represent the positional relationships of individual pixels within a semi-transparent object. For example, the second coordinate system could be the model coordinate system. The origin and direction axes of the second coordinate system are typically attached to the semi-transparent object itself, used to identify the relative positions of each pixel within the semi-transparent object. The second coordinate system can change with scaling, rotation, or other transformations of the semi-transparent object. In other words, while the second coordinate system can reflect the relative positions of individual pixels within the semi-transparent object, it cannot form a unified measurement with the first coordinate system, and it cannot reflect the absolute positions of the individual pixels within the semi-transparent object within the scene.

[0118] The scene depth data describes the depth of each pixel in the scene within the first coordinate system, while the depth data of the semi-transparent objects in the scene describes the depth of each pixel in the semi-transparent objects within the second coordinate system. The scene depth data can be existing, while the depth data of the semi-transparent objects can be acquired additionally. As one possible implementation, the scene depth data can be obtained through the deferred pipeline, and the depth data of the semi-transparent objects can be obtained through the forward rendering pipeline.

[0119] D2: Based on the depth data of the scene and the depth data of the semi-transparent object, obtain the effective depth data of each pixel of the semi-transparent object in the scene.

[0120] The effective depth data is used to describe the depth of each pixel in the semi-transparent object in the first coordinate system.

[0121] In related technologies, the depth data of a scene and the depth data of a semi-transparent object often come from different coordinate systems. Their reference points, scales, and orientation axes may all be different, making it impossible to directly compare or use them together. In other words, the depth of a semi-transparent object only takes effect within a second coordinate system and cannot participate in depth sorting together with the scene's depth data, thus causing existing depth data to be underutilized.

[0122] For example, in the depth data of a scene, the distance of a pixel from the virtual camera might be described as 5 meters. However, in the depth data of a semi-transparent object, the depth of a pixel might be described as 0.5. It's impossible to directly compare the depth of a pixel based solely on the scene's depth data and the semi-transparent object's depth data. Therefore, the coordinate systems of the scene's depth data and the semi-transparent object's depth data can be unified, with the second coordinate system corresponding to the semi-transparent object's depth data becoming the first coordinate system.

[0123] Based on this, the effective depth data of each pixel within the scene and the semi-transparent object can be determined using the depth data of each pixel within the scene. This transforms the depth data from the second coordinate system to the first coordinate system, ensuring that the depth data of each pixel within the semi-transparent object is aligned with the depth data of all pixels in the scene under a unified spatial reference. After this transformation, effective depth data that accurately describes the true positional relationships of pixels within the entire scene can be obtained, facilitating subsequent steps such as depth sorting and color blending.

[0124] Therefore, when the depth data of the scene and the depth data of the semi-transparent object have inconsistent reference points, a coordinate system transformation is performed on the depth data of the semi-transparent object, allowing depth data from different coordinate systems to be uniformly expressed within the same coordinate system. This enables accurate comparison and judgment of the depth relationship between the semi-transparent object and the scene, yielding effective depth data that truly reflects the spatial positional relationships of each pixel. Based on this unified coordinate system of effective depth data, the rendering quality of semi-transparent objects can be improved. Furthermore, either the scene's depth data or the semi-transparent object's depth data can be directly used, thereby increasing the utilization rate of the scene's depth data.

[0125] This application does not specifically limit how to obtain the effective depth data of each pixel of the semi-transparent object in the scene based on the depth data of the scene and the depth data of the semi-transparent object. The following describes two methods as examples, namely two specific implementations of D2. The first method is described in E1-E3, and the second method is described in F1-F2. The first method will be introduced first.

[0126] E1: Determine the maximum and minimum scene values ​​in the scene's depth data, and determine the maximum and minimum object values ​​in the depth data of the semi-transparent object.

[0127] The maximum value of a scene is the largest depth in the scene's depth data, and the minimum value of a scene is the smallest depth in the scene's depth data. The maximum value of an object is the largest depth in the semi-transparent object's depth data, and the minimum value of an object is the smallest depth in the semi-transparent object's depth data.

[0128] E2: Determine the transformation relationship between the first coordinate system and the second coordinate system based on the scene maximum value, scene minimum value, object maximum value, and object minimum value.

[0129] The transformation relationship between the first and second coordinate systems is used to identify the depth data of semi-transparent objects and the depth data of the scene.

[0130] In one possible implementation, the transformation relationship between the first and second coordinate systems can be characterized by the following formula:

[0131] ;

[0132] in, The depth of the pixel in the first coordinate system. The depth of the pixel in the second coordinate system. The minimum value in the scenario. This represents the maximum value in the scene. The minimum value of the object. This is the minimum value of the object.

[0133] E3: Convert the depth data of the semi-transparent object according to the conversion relationship to obtain the effective depth data.

[0134] Taking a single pixel within a semi-transparent object as an example, the depth of that pixel in the second coordinate system can be determined based on the object's depth data. Then, a transformation can be performed using a transformation relationship (such as substituting the values ​​in the formula above). ), to obtain the depth of the pixel in the first coordinate system.

[0135] Then, the above transformation steps are performed on each pixel of the semi-transparent object to realize the transformation of the depth data of the semi-transparent object, and obtain the depth corresponding to each pixel of the semi-transparent object in the first coordinate system, thus obtaining the effective depth data.

[0136] Therefore, the depth data of a semi-transparent object in the second coordinate system can be transformed to the first coordinate system, realizing the transformation of pixel positions from relative to absolute positions and obtaining effective depth data with a unified metric. Compared with the rendering method of sorting depth and blending colors based on depth data in different coordinate systems, sorting depth based on effective depth data is more convenient, requires less computation, and can more accurately and objectively reflect the actual position of each pixel of the semi-transparent object, thus improving the accuracy of the image.

[0137] After introducing the first method, the second method will be introduced below. Please refer to F1-F2 for details:

[0138] F1: Get the opacity data of a semi-transparent object.

[0139] Opacity describes the degree to which light is blocked when passing through an object. Opacity values ​​typically range from 0 to 1, where 0 represents complete transparency (light can pass through the object completely), and 1 represents complete opacity (light cannot pass through the object). Values ​​between 0 and 1 represent different degrees of translucency; the higher the opacity, the more light is blocked when passing through the object. Opacity data for translucent objects is used to describe the opacity of these objects.

[0140] F2: Using the opacity data of the semi-transparent object as weights, determine the effective depth data based on the depth of the semi-transparent object and the depth of the scene.

[0141] In this embodiment of the application, the opacity data of the semi-transparent object can be used as a weight to participate in the calculation of the effective depth data, so that the effective depth data can reflect the visibility contribution of the semi-transparent object to the image.

[0142] Taking object occlusion as an example (i.e., the line of sight emitted by the virtual camera passes through the object before passing through the scene), the higher the transparency of the object, the less impact it has on the final visible image, and its depth can be given a lower weight during fusion. On the other hand, the higher the opacity of the object, the greater its impact on the final visible image, and its depth should be given a higher weight.

[0143] If an object's opacity is 1, its depth in the effective depth data can be the object's actual depth, because the semi-transparent object completely obscures the scene behind it. If the object's opacity is 0, its depth in the effective depth data can be the scene's depth, because the object is completely transparent and does not obscure the scene. If the object's opacity is between 0 and 1, its depth in the effective depth data can be a weighted average of the object's depth and the scene's depth, reflecting the impact of the object's semi-transparency on depth.

[0144] As one possible implementation, D2 can be executed with reference to the following formula:

[0145]

[0146] in, This represents the depth of the opaque object within the valid depth data. The opacity of an opaque object (which can be determined using opacity data). The depth of the opaque object. The depth of the scene.

[0147] It should be noted that the above calculation process is explained using a semi-transparent object as a whole, and this process can also be applied to pixel-level depth calculations. That is, the opacity data of the semi-transparent object can be used to describe the opacity of each pixel within the semi-transparent object. The depth of each pixel within the semi-transparent object in the effective depth data can be calculated using the above method. For example, taking pixel A, the depth of the semi-transparent object can be replaced with the depth of pixel A within the semi-transparent object, and the depth of the scene is the depth of pixel B within the scene. Furthermore, the same line of sight emitted by the virtual camera first passes through pixel A within the semi-transparent object and then through pixel B within the scene.

[0148] Therefore, by using the opacity of semi-transparent objects as a weight in the calculation of effective depth data, the effective depth data can reflect both the true spatial location of the semi-transparent objects and their contribution to the actual visibility of the image. Areas with high opacity are closer to the scene's depth data in the calculation, while areas with low opacity are closer to the semi-transparent object's depth data. This allows the effective depth data to more accurately represent the occlusion relationship between the semi-transparent object and the scene, improving the usability of the depth data and providing a more accurate basis for subsequent depth sorting and color fusion, resulting in a more natural and realistic final rendered image.

[0149] The data layer is a layer divided based on depth data. Pixels within the same data layer have the same depth, while pixels in different data layers have different depths. If a semi-transparent object is divided into multiple data layers in the scene, this application embodiment also provides a specific implementation method for obtaining the opacity data and depth data of the semi-transparent object to reduce storage requirements. See G1-G4 for details.

[0150] G1: Get multiple target pixels of a semi-transparent object.

[0151] The target pixel is the pixel included in the semi-transparent object. Multiple target pixels are used to describe the same position of the semi-transparent object, and different target pixels are located in different data layers.

[0152] G2: Obtain the opacity data and depth data corresponding to multiple target pixels respectively.

[0153] G3: Determine the first target pixel with the largest opacity data and the second target pixel with the smallest opacity data.

[0154] The first target pixel is the one with the highest opacity, indicating that it is the layer with the strongest ability to block light. The second target pixel is the one with the lowest opacity, indicating that it is the layer with the weakest ability to block light.

[0155] After acquiring the opacity and depth data of multiple target pixels, sorting methods such as bubble sort and selection sort can be used to sort the target pixels in descending or ascending order of opacity data. After sorting, only the first target pixel with the largest opacity data (i.e., the brightest target pixel) and the second target pixel with the smallest opacity data (i.e., the darkest target pixel) can be retained, thus avoiding the need to save the depth data of target pixels from all layers.

[0156] G4: Based on the depth data of the first target pixel and the depth data of the second target pixel, determine the depth data corresponding to the multiple target pixels of the semi-transparent object.

[0157] Based on the first and second target pixels, the ranges of opacity and depth data for multiple target pixels can be determined, allowing for inference of the depth data for other target pixels. For example, linear interpolation or opacity-weighted interpolation can be used to determine the depth data for each of the multiple target pixels of a semi-transparent object. This ensures that the depth data of multiple target pixels maintains a continuous distribution even when only the depth data of the first and second target pixels is stored.

[0158] Therefore, by storing only the two depth data layers with the highest and lowest opacity, the storage amount of depth data for multiple layers of semi-transparent objects can be significantly reduced. Based on this, the depth data of other layers can be derived using the depth data of these two layers, allowing for the reconstruction of continuous depth data with correct spatial distribution without needing to store the depth data of all layers. This reduces the storage and transmission overhead of depth data while ensuring spatial consistency of multi-layered semi-transparent objects in subsequent depth sorting and color blending, thus reducing storage overhead while maintaining rendering quality.

[0159] The foregoing embodiments illustrate the rendering process for semi-transparent objects. Based on this, it can also be combined with scene rendering, as detailed below. That is, the following steps can be executed after S301-S304, see S305-S306 for details:

[0160] S305: Get the initial color of the scene.

[0161] The initial scene color is the color of the scene before it is blended with the semi-transparent objects. In other words, the initial scene color is the color of each pixel in the scene itself, and is not affected by other factors. For example, the initial scene color is not affected by reflected light, refracted light, shadow casting, ambient light rendering, color overlay with objects, post-processing effects, etc.

[0162] S306: Based on the effective depth data, the initial scene color and object color are blended to obtain the object rendering color of the semi-transparent object in the scene.

[0163] The object's rendered color is the color obtained after blending the semi-transparent object with the initial color of the scene.

[0164] It's important to note that the reason for basing the initial scene color and object color on effective depth data is that this data first determines the depth of each pixel of a semi-transparent object within the scene. This allows us to determine which pixels the virtual camera's line of sight passes through sequentially. Pixels at different depths play different roles in the light propagation path, resulting in significantly different contributions to the rendered color. For example, pixels closer to the virtual camera contribute more to the rendering result and typically have higher visibility. Pixels further away are initially overlaid and occluded by closer pixels, contributing less to the rendering. Furthermore, the initial scene color of pixels can be altered by light transmission. Therefore, if the initial object and scene colors are not overlaid in the correct depth order, the occlusion and transmission relationships of light will be disrupted, leading to colors that are too dark, too bright, or have abnormal transparency, resulting in a distorted final image.

[0165] Taking a semi-transparent object and multiple pixels at the same location in the scene as an example, the object color or the initial color of the scene can be superimposed on each pixel in order of depth from high to low, that is, in order of distance from the virtual camera from far to near, so as to obtain the object rendering color at that location.

[0166] like Figure 6 As shown, pixels 1, 2, and 3 are different pixels at the same location in a semi-transparent object, and pixel 4 is the pixel in the scene corresponding to pixels 1, 2, and 3. Pixels 1, 2, 3, and 4 have different depths, but their coordinates in the corresponding data layer are all (2, 1). Therefore, pixels 1, 2, 3, and 4 can be considered as pixels at different depths but in the same location. The light emitted by the virtual camera can pass through pixels 1, 2, 3, and 4 in sequence. Thus, in the subsequent rendering process, the colors of the four pixels can be superimposed and blended to obtain the rendered color of the object after color blending.

[0167] Therefore, by obtaining the initial color of the scene and then fusing the object's color with the initial scene color based on effective depth data, the final presentation of the semi-transparent object in the scene can better match its realistic light transmission and occlusion characteristics. This results in a more natural and accurate rendered color that aligns with the scene's features. Furthermore, the effective depth data reveals the true occlusion relationships between other elements in the scene and the semi-transparent object, and even the semi-transparent object itself, ensuring that the depth order is no longer disordered. This further aligns with the characteristics of the semi-transparent object in the scene, significantly improving the accuracy and realism of rendering the semi-transparent object and the scene together.

[0168] Anti-aliasing is used to indicate stepped artifacts in lines within an image, especially for semi-transparent objects with complex lines such as hair, smoke, and gauze. Their edges are often composed of numerous pixels with varying opacities, which can result in harsh transitions and stepped edge breaks in the final image, leading to a lack of detail and realism. Therefore, this application proposes an anti-aliasing method after color blending, as detailed in H1-H2, where H1-H2 is a specific implementation of S304.

[0169] H1: Based on the pixel depth sequence and the initial color of each pixel in the semi-transparent object, the undetermined color of the semi-transparent object in the scene is obtained by fusion.

[0170] The color to be determined is the color obtained by blending the pixels of the semi-transparent object before anti-aliasing.

[0171] For relevant details, please refer to the aforementioned S304, which will not be repeated here.

[0172] H2: Anti-aliasing is applied to the desired color to obtain the color of a semi-transparent object.

[0173] Anti-aliasing is used to mitigate the stepped artifacts at the edges caused by pixel discretization, resulting in smoother lines.

[0174] During anti-aliasing, the color relationship between pixels and their neighboring pixels can be analyzed to perform smoothing calculations on edge transition areas composed of discrete pixels. This reduces stair-step artifacts caused by limited pixel sampling resolution and decreases jagged edges. When rendering semi-transparent objects, pixels with different transparency often exhibit complex and fragmented color and transparency distributions at the edges. Directly outputting this result can easily lead to discontinuous edge structures. By performing anti-aliasing on specific colors, edge pixels can be optimized without disrupting the depth and transparency relationships between pixels, resulting in a more natural color transition in space and thus a smoother, more realistic object color.

[0175] Therefore, for complex objects such as hair, smoke, gauze, and glass, which are formed by the superposition of a large number of pixels with different opacities, the color to be determined is determined by color fusion based on the pixel depth sequence, which follows the real occlusion relationship. Furthermore, anti-aliasing is performed on the color to make the gradient transition between pixels smoother and reduce the jaggedness. As a result, the lines and contours of semi-transparent objects present a more natural and delicate effect, thereby improving the realism and visual effect of the overall image rendering.

[0176] The following section introduces two anti-aliasing methods.

[0177] Anti-aliasing Method 1: Temporal Anti-Aliasing (TAA): This is a time-based anti-aliasing algorithm. During each frame rendering process, the virtual camera slightly jitters the sampling position of each pixel and blends the color of the previous frame with the color of the current frame after motion vector correction. Because multiple consecutive frames participate in the sampling accumulation of the same pixel, it effectively increases the pixel sampling density, thereby smoothing high-frequency jagged edges.

[0178] Anti-aliasing Method Two: Temporal Super Sampling (TSA): A technique that improves image resolution and quality by accumulating multi-frame sampling information over time. By using different sampling distribution patterns (e.g., interleaved sampling) across multiple frames, more sampling values ​​are continuously superimposed over time, resulting in final pixel color results that more closely resemble the quality of high-resolution rendering. TSA is essentially supersampling in the temporal dimension, distributing the extremely high GPU computational overhead of Super Sampling Anti-Aliasing (SSAA) across multiple frames, thereby improving image detail and clarity without significantly increasing the computational load per frame.

[0179] In related technologies, in rendering scenes of semi-transparent objects, dithering is used to achieve a semi-transparent effect. Dithering is used to selectively adjust the transparency of pixels (instead of directly using a single transparency value), taking advantage of the persistence of vision in the human eye, to combine multiple semi-transparent pixels into a smoother transparent transition effect, thus achieving the fading of semi-transparent objects.

[0180] Therefore, both TAA and TSA rely on historical frame information to increase the sampling density of the current frame, achieving smooth edges and improved image quality by accumulating sampling results across multiple frames. However, in dynamic scenes, due to drastic changes in content between frames, historical frames, after motion vector correction, may not accurately align with the pixels of the current frame. When motion vector estimation is inaccurate, the shape of semi-transparent objects changes significantly, or the background moves quickly, the colors of historical frames may be incorrectly superimposed onto the current frame, resulting in residual color at the same pixel. As multiple historical frames continue to accumulate, this error-free state may be further amplified, ultimately manifesting as object edge blur, ghosting, or semi-transparent residual outlines, producing a ghosting phenomenon. Ghosting refers to residual images or blurry artifacts caused by improper temporal sampling blending in dynamic scenes.

[0181] Based on this, an anti-aliasing method not based on temporal relationships can be used to process the undetermined color of a semi-transparent object in the scene. The following explanation uses one such anti-aliasing method as an example, see I1, where I1 is a specific implementation of H2:

[0182] I1: By rapidly expanding anti-aliasing, the desired color is processed to obtain the object color of a semi-transparent object.

[0183] Fast Approximate Anti-Aliasing (FXAA) is a screen-space anti-aliasing technique. FXAA directly detects image edges based on the brightness gradient of the current frame, using first or second derivatives to determine the presence of jagged boundaries. It then performs blur interpolation on these high-contrast pixels locally, creating a smooth color transition at the edges. Because FXAA is calculated in screen space and relies solely on data from the current frame, without temporal accumulation or motion vector correction, it avoids historical frame alignment errors and does not retain colors from the previous frame.

[0184] It should be noted that the embodiments in this application only use FXAA as an example for illustration. Other non-temporal anti-aliasing processing methods that do not involve historical frames can also be applied to the processing of a specific color in order to reduce the ghosting phenomenon that occurs in dynamic image rendering.

[0185] Therefore, by employing fast-expanding anti-aliasing to process the specific color, the smoothing of the edges of semi-transparent objects no longer relies on historical frame information. In dynamic scenes, object deformation, viewpoint changes, or rapid camera movement can all cause historical frame misalignment in time-accumulated anti-aliasing, resulting in ghosting phenomena such as trailing, ghosting, or edge residue. Fast-expanding anti-aliasing relies only on the pixel color and gradient information of the current frame, avoiding the involvement of historical frames in the calculation. This allows it to maintain stable edge quality and reduce ghosting in fast-moving or frequently changing dynamic scenes. Furthermore, fast-expanding anti-aliasing calculations are performed only in screen space, featuring low overhead and good real-time performance. It can smooth the edges of semi-transparent objects without increasing the rendering burden, resulting in a more delicate and natural final image.

[0186] In one possible implementation, a forward rendering pipeline can be inserted into the Unreal Engine deferred pipeline. The forward rendering pipeline is used to perform the steps of obtaining the effective depth data of each pixel of the semi-transparent object in the scene, as well as subsequent steps.

[0187] The Unreal Engine Deferred Pipeline is a default rendering method used in Unreal Engine. It involves writing scene set information into multiple buffers (G-Buffers) and then processing it uniformly in subsequent stages.

[0188] In traditional rendering workflows, the deferred pipeline is often used to process a large number of objects. This involves writing the object's surface properties into multiple geometry buffers and then performing unified calculations during the deferred lighting stage. However, for semi-transparent objects such as hair, veils, and smoke, the deferred pipeline has inherent limitations that are difficult to avoid structurally, making it unsuitable for rendering complex semi-transparent objects. Therefore, this application does not use the deferred pipeline to directly render semi-transparent objects for the following reasons:

[0189] First, the deferred pipeline relies on a depth buffer to record pixel depth data to determine the rendering order. Taking hair as an example, in the commonly used mask blending mode for hair, transparent areas do not write depth data to the depth buffer; only opaque parts are written. Therefore, the same hair appears as discontinuous depth recording at the pixel level, disrupting the depth relationship between semi-transparent objects and the scene. This leads to errors such as chaotic occlusion relationships and objects intersecting, failing to achieve the correct depth ordering. Blending modes define how materials interact with the background, controlling transparency and rendering logic. Mask blending mode is a type of blending mode that uses a binary mask (0 or 1) to control whether pixels are completely transparent or completely opaque.

[0190] Secondly, mask blending modes control pixel visibility through binarized transparency, while semi-transparent areas in the deferred pipeline require multiple blendings of object and scene colors. Furthermore, surface materials cannot directly participate in deferred lighting calculations. The material domain represents the material's purpose category, determining its behavior and interaction within the rendering pipeline. Surface material is a material domain that refers to the default mode applied to an object's surface—the standard surface material—accounting for 99% of material types in a project. Therefore, fine semi-transparent objects like hair will exhibit discontinuities or hard boundaries in lighting transitions, shadow edges, and highlight areas, resulting in noticeably jagged visual artifacts that severely impact the smoothness and realism of semi-transparent edges.

[0191] Furthermore, the deferred pipeline itself struggles to support the storage of multiple layers of depth and opacity data required for semi-transparent materials. Relying on a single-layer depth geometry buffer, the deferred pipeline cannot represent the multi-layer occlusion relationships of semi-transparent objects like hair at the pixel level. Moreover, the deferred pipeline has a limited number of geometry buffers, high bandwidth consumption, and cannot handle the depth ordering of semi-transparent objects, making it more prone to ghosting in dynamic scenes. Due to these structural limitations, the deferred pipeline cannot meet the rendering requirements of semi-transparent objects like hair. Therefore, this embodiment employs a forward rendering pipeline to render semi-transparent objects, achieving more accurate depth relationships, more natural transparency transitions, and more stable dynamic image performance.

[0192] In other words, the aforementioned S101-S104, B1-B3, C1-C2, D1-D2, E1-E3, F1-F2, G1-G4, H1-H2, and I1 can all be performed in the forward rendering pipeline without needing to be performed in the Unreal Engine deferred pipeline. This allows the process of performing anti-aliasing on the desired color through the forward rendering pipeline to obtain the object color of a semi-transparent object.

[0193] Therefore, by inserting a forward rendering pipeline into the Unreal Engine's deferred pipeline, the depth sorting, color blending, and anti-aliasing of translucent objects can be completed within the forward rendering pipeline, without relying on the Unreal Engine's deferred pipeline's post-processing. This allows for anti-aliasing optimization of the target color before the translucent object blends with the scene, meaning anti-aliasing is performed separately for the translucent object. This improves the targeting and accuracy of anti-aliasing for translucent objects, reduces scene interference with anti-aliasing, and enhances overall image accuracy.

[0194] Regarding the object colors rendered by the forward rendering pipeline, this application provides an implementation method for overlaying the separately rendered object colors back into the Unreal Engine deferred pipeline, as detailed in J1-J2:

[0195] J1: Based on the effective depth data, the initial scene color and object color are blended to obtain the scene rendering color.

[0196] The scene rendering color is the color obtained by blending the initial scene color with the object color of the semi-transparent object. The scene rendering color includes the object rendering color of the semi-transparent object in the scene.

[0197] Effective depth data can describe the depth of each pixel in a semi-transparent object within the scene. The object color is the result of rendering the semi-transparent object separately, which allows the initial scene color and the object color to be blended so that the object color can be superimposed back into the initial scene color in the Unreal Engine's deferred pipeline in the correct depth order.

[0198] In other words, the initial colors of the objects at the same location of the semi-transparent object can be blended in the forward rendering pipeline to obtain the object color of the semi-transparent object. Then, the blending process of the object color and the initial scene color is executed in the Unreal Engine deferred pipeline to obtain the scene rendering color of the scene.

[0199] J2: Anti-aliasing is applied to the scene rendering colors through the Unreal Engine's deferred pipeline to obtain the final scene colors.

[0200] The final color of the scene is the color obtained by performing anti-aliasing processing on the scene rendering colors. This application embodiment does not specifically limit the anti-aliasing processing method used in J2, for example, it can be TAA, TSA or FXAA.

[0201] In other words, anti-aliasing is performed during rendering before blending with the scene colors. This ensures that the edge smoothing calculations for translucent objects are based solely on their own color, depth, and transparency information, unaffected by scene colors, depth-of-field blur, global illumination, or other post-processing operations. Furthermore, because it ensures that the edges of translucent objects are accurately restored before entering the subsequent blending stage, the smoothing of their outlines is more reliable.

[0202] Therefore, by rendering the object color of a semi-transparent object independently in the forward rendering pipeline and then overlaying it back into the Unreal Engine deferred pipeline using effective depth data, and continuing to use the existing post-processing workflow of the Unreal Engine deferred pipeline (such as anti-aliasing and depth of field calculation), it is possible to ensure the consistency of the final image while avoiding significant modifications to the Unreal Engine deferred pipeline to adapt to semi-transparent objects, thus reducing the modification and maintenance costs of the Unreal Engine rendering pipeline.

[0203] After introducing the process of blending semi-transparent objects with the initial color of the scene, the blending method can be further differentiated in the Unreal Engine deferred pipeline based on different rendering modes (such as pre-depth-of-field rendering or post-depth-of-field rendering). The following is a detailed explanation, see K1-K5, where K1 is the rendering method used for pre-depth-of-field rendering, and K2-K5 are the rendering methods used for post-depth-of-field rendering:

[0204] K1: If the rendering order is pre-depth rendering, then the steps of blending the initial scene color and object color based on the effective depth data to obtain the scene rendering color, and subsequent steps, are executed.

[0205] If the rendering order is depth-of-field calculation before rendering, it means that the rendering process is executed before the depth-of-field calculation. Therefore, J1 and subsequent steps can be executed directly first, followed by steps such as depth-of-field calculation for scene rendering colors.

[0206] As one possible implementation, K1 could be the default rendering method.

[0207] K2: If the rendering order is depth of field followed by rendering, then obtain valid depth data.

[0208] If the rendering order is depth-of-field rendering first, it means that the rendering process is executed after depth-of-field calculation, thus obtaining effective depth data. This effective depth data is used to determine the positional relationship between various objects in the scene and the semi-transparent objects. For example, some objects in the scene are closer to the virtual camera relative to the semi-transparent objects, while others are farther away from the virtual camera. This plays a decisive role in determining which objects to blur during the depth-of-field calculation process.

[0209] K3: Based on the effective depth data, the semi-transparent object is layered to obtain the first object to be rendered in front of the semi-transparent object and the second object to be rendered behind the semi-transparent object.

[0210] The first object to be rendered is at least one object located in front of the semi-transparent object. In the effective depth data, the depth of the first object to be rendered is less than the depth of the semi-transparent object, that is, it is closer to the virtual camera.

[0211] The second object to be rendered is at least one object located behind the semi-transparent object. In the effective depth data, the depth of the second object to be rendered is greater than the depth of the semi-transparent object, that is, it is farther away from the virtual camera.

[0212] K4: Render the first object to be rendered to obtain the color before the separation of depth of field, and render the second object to be rendered to obtain the basic color of the scene.

[0213] The Separate BeforeDOF Color is the color obtained after rendering the first object to be rendered.

[0214] The scene base color is the color obtained by rendering the second object to be rendered. During the depth of field calculation, the scene base color can be regarded as the base color of the background in the distance.

[0215] K5: Based on the effective depth data, the initial scene color, object color, color before separation of depth of field, and basic scene color are blended to obtain the scene rendering color.

[0216] Based on the effective depth data, the depth order of each object and scene, including semi-transparent objects, can be determined. This determines the color blending order of the initial scene color, object color, color before depth separation, and scene base color. The initial scene color, object color, color before depth separation, and scene base color are then blended according to the color blending order to obtain the scene rendering color.

[0217] For example, the scene rendering color can be obtained by sequentially overlaying the initial scene color, the basic scene color, the object color, and the color before separating the depth of field, from far to near.

[0218] Therefore, by selecting different data for rendering based on different rendering modes (such as pre-depth-of-field rendering or post-depth-of-field rendering), in pre-depth-of-field rendering mode, the initial scene color and object color can be quickly blended directly based on the effective depth data, and then post-processing operations such as depth calculation are performed through the deferred pipeline. In post-depth-of-field rendering mode, objects are layered and rendered separately using the effective depth data, and then blended together with the object color and the initial scene color according to the depth order. This effectively avoids problems such as excessive blurring and incorrect layering of semi-transparent objects like hair during depth calculation. This allows the rendering results of semi-transparent objects output from the forward rendering pipeline to be more naturally integrated into the deferred pipeline rendering process, improving the rendering effect. Furthermore, because it is adapted for two different depth calculation methods, the commercial value of the rendering pipeline is enhanced, providing richer rendering effects.

[0219] The depth-of-field function is used to perform depth-of-field calculations. The rendering process described above only assumes that the depth-of-field function is enabled. In one possible approach, different processes can be executed depending on whether the depth-of-field function is enabled or not. Details are provided below; please refer to L1-L2:

[0220] L1: If the depth-of-field function is enabled, the scene rendering color is obtained by fusing the depth parameters, initial scene color, and object color corresponding to the depth-of-field function based on the effective depth data.

[0221] Depth of field calculation refers to the parameters required during the depth of field calculation process. When the depth of field function is enabled, the virtual camera blurs pixels at different depths during rendering based on depth of field parameters such as focal plane position, blur radius, and defocus curve. This ensures that pixels closer to the focal point remain sharp, while pixels farther from the focal point appear blurred. In this case, depth of field parameters need to be considered during color blending to maintain the correct foreground / background relationship and blur effect between translucent objects and the scene in depth space.

[0222] This application does not specifically limit how the depth-of-field function is enabled. For example, it can be preset by the user, or it can be automatically enabled based on the game's photography mode (such as automatically enabling the depth-of-field function in cutscenes, or automatically disabling the depth-of-field function when the player controls the camera). It can also be enabled based on the performance of the computer device. If the performance parameters of the computer device are greater than the preset parameter threshold, then the depth-of-field function is enabled.

[0223] L2: If the depth of field function is not enabled, the initial color of the scene and the color of the objects are blended based on the effective depth data to obtain the scene rendering color.

[0224] If the depth-of-field function is not enabled and is in the off state, the rendering process does not need to consider depth-of-field parameters such as focal length and blur radius. All pixels can be blended in depth order based on the effective depth data to complete the rendering process.

[0225] The initial scene color and object color can be blended based on the effective depth data to obtain the scene's rendered color. See J1 above for relevant details, which will not be repeated here.

[0226] To facilitate a further understanding of the technical solutions provided in the embodiments of this application, the following description takes the execution subject of the rendering method for a semi-transparent object provided in the embodiments of this application as a server, and the first image as a facial sketch image and the second image as a facial photograph image as an example, to provide an overall exemplary introduction to the rendering method for the semi-transparent object.

[0227] Therefore, different rendering processes can be selected depending on whether the depth-of-field function is enabled, making the overall rendering process more flexible. This allows it to be compatible with high-quality cinematic visuals and performance-oriented real-time rendering scenarios, thus expanding the application scope of the rendering process.

[0228] Order-Independent Transparency (OIT) is a technical framework for rendering semi-transparent objects. OIT primarily aims to achieve correct transparency overlay results without requiring the sorting of semi-transparent pixels. This application scenario will be illustrated using the rendering of hair with OIT, which involves three stages.

[0229] like Figure 7 As shown in the diagram, this illustration represents a rendering workflow comprising three stages: Order-Independent Transparency Prepass (OIT Prepass), Order-Independent Transparency Rendering (OIT Pass), and Translucency Process Pass. The Prepass stage is a crucial phase in the rendering workflow, primarily used to render the depth of opaque objects.

[0230] OIT PrePass is a preprocessing stage used to disable color output, write valid depth data for the hair, and then sort the depth from back to front by calculating the physical distance to the virtual camera to ensure the correct rendering order of each pixel.

[0231] OIT Pass is used to obtain valid depth data from the previous stage and combine it with lighting data to perform color mixing to obtain the object color of hair, and then perform anti-aliasing processing.

[0232] The Translucency Process Pass is a stage in the rendering pipeline used to process translucent objects. It utilizes pre-anti-aliased physical colors to blend the scene with the hair, resulting in more accurate anti-aliasing compared to related technologies that directly output the final rendering result through anti-aliasing (such as TAA and TSA).

[0233] OIT PrePass: such as Figure 8 As shown, an OIT prepass shader can be added at this stage to obtain the depth data required for the next stage calculation. Two layers of depth and opacity data with an opacity greater than 0.78 can be stored. For example, first, determine the first target pixel with the largest opacity and the second target pixel with the smallest opacity. Then, store the depth data of the first target pixel and the depth and opacity data of the second target pixel in the form of a texture array. The texture array can be a 2x2, single-channel 32-bit array, with the first 24 bits storing the depth data and the last 8 bits storing the opacity data. See G1-G4 for related details.

[0234] The scene's depth data can then be obtained from the deferred pipeline. The depth calculation phase is the core phase in the rendering pipeline used to calculate and generate scene depth information. During the OIT depth calculation phase, culling depth is calculated based on opacity data. This culling is used to remove objects that will not be blended into the final rendering result, resulting in the scene's depth data and the depth data of semi-transparent objects. See sections B1-B3 above for related details.

[0235] OIT Pass: such as Figure 9 As shown, in this stage, forward rendering is performed through the OIT TranslucencyPass stage, and all rendered pixels are stored in the hair depth map (OIT Depth). The hair depth map can be used to store the effective depth data of the hair, and at the same time, the hair color map (OIT ColorTexture) can be obtained. The hair color map can be used to store the initial color of each pixel of the object included in the hair.

[0236] Then, the OIT Combine Pass can be used to perform depth sorting and color fusion on each pixel to obtain the desired color of the hair and the OIT Packed Depth Texture. Then, anti-aliasing is performed using FXAA to obtain the object color of the hair. For related details, please refer to the aforementioned S301-S304, H1-H2, and I1, which will not be repeated here.

[0237] Translucency Process Pass: Such as Figure 10 As shown, in this stage, the object color of the hair is blended with the initial color of the scene, and depth of field functionality is supported.

[0238] Based on the different rendering order, depth-of-field (DOF) can be divided into the Before DOF Pass and the After DOF Pass. The Before DOF Pass is the rendering stage before the Depth of Field (DOF) calculation is performed. The After DOF Pass is the rendering stage after the depth of field (DOF) calculation is performed.

[0239] First, the data required for rendering at this stage can be obtained through OIT Pass and OIT PrePass.

[0240] In addition, this stage can also obtain the nearest depth of objects with an opacity greater than 0.01, which can be used to layer objects in the Before DOF Translucency Pass.

[0241] If the rendering order is pre-depth rendering, then the effective depth data, initial scene color, and object color can be obtained through OIT Pass. Then, the steps of blending the initial scene color and object color based on the effective depth data to obtain the scene rendering color and subsequent steps can be performed.

[0242] If the rendering order is depth-of-field rendering followed by rendering, effective depth data can be obtained through OIT PrePass. This effective depth data can be stored using a single-channel 32-bit texture array, and pixels with an opacity below 0.01 are discarded and not included in the rendering process.

[0243] In the Before DOF Translucency Pass, hair can be layered based on effective depth data, resulting in a first object to be rendered in front of the hair and a second object to be rendered behind the hair. The first object is rendered to obtain its pre-depth-of-field color, and the second object is rendered to obtain its base scene color. Based on the effective depth data, the initial scene color, object color, pre-depth-of-field color, and base scene color are blended to obtain the scene's rendered color. See K1-K5 for related details.

[0244] Specifically, different rendering processes can be executed depending on whether the depth-of-field feature is enabled. If the depth-of-field feature is enabled, the depth parameters corresponding to the depth-of-field feature, the initial scene color, and the object color can be blended based on the effective depth data during the depth-of-field calculation stage to obtain the scene's rendered color. Anti-aliasing can be performed using TSS or TSA.

[0245] If the depth-of-field feature is not enabled, the initial scene color and object color are blended based on the effective depth data to obtain the scene's rendered color. See L1-L2 above for related details.

[0246] After the above rendering process is completed, other post-processing stages can be performed. Post-processing refers to techniques that further process the results after the basic process is completed, aiming to optimize, enhance, or correct the final output. For example, post-processing stages may include flooding, tone mapping, and automatic exposure.

[0247] like Figure 11 As shown in the figure, the hair obtained after applying the rendering method of the semi-transparent object of the present application embodiment, and the hair rendered in the related technology, and a magnified illustration of a part of the hair. Compared with the hair rendered by the related technology, the hair rendered by applying the present application has almost no jagged edges and the lines are smoother.

[0248] In addition to the rendering method for semi-transparent objects described above, this application also provides a corresponding rendering apparatus for semi-transparent objects, so that the above-described rendering method for semi-transparent objects can be applied and implemented in practice.

[0249] See Figure 12 This figure is a schematic diagram of the structure of a rendering device for a semi-transparent object provided in an embodiment of this application. Figure 12 As shown, the rendering device 1200 for the semi-transparent object includes: an acquisition unit 1201, a sorting unit 1202, and a blending unit 1203;

[0250] The acquisition unit 1201 is used to acquire the effective depth data of each pixel of the semi-transparent object in the scene, and the effective depth data is used to describe the depth of each pixel of the semi-transparent object in the scene.

[0251] The acquisition unit 1201 is also used to acquire the initial color of the object corresponding to each pixel of the semi-transparent object.

[0252] The sorting unit 1202 is used to sort the depth of each pixel in the semi-transparent object according to the effective depth data to obtain a pixel depth sequence. The pixel depth sequence is used to indicate the sequence relationship between the depths of multiple pixels at the same position in the semi-transparent object.

[0253] The fusion unit 1203 is used to fuse the initial colors of each pixel in the semi-transparent object according to the pixel depth sequence to obtain the object color of the semi-transparent object.

[0254] As one possible implementation, the device 1200 further includes an object classification unit for:

[0255] Obtain the opacity data of objects in the scene;

[0256] If the opacity data of the object is greater than the opacity threshold, then the object is identified as the opaque object;

[0257] If the opacity data of the object is less than or equal to the opacity threshold, then the object is determined to be the semi-transparent object.

[0258] As one possible implementation, if the object comprises multiple regions, the device 1200 further includes a region classification unit for a target region among the multiple regions, used for:

[0259] If the opacity data of the target area is greater than the opacity threshold, then the target area is identified as the opacity object;

[0260] If the opacity data of the target area is less than or equal to the opacity threshold, then the target area is determined to be the semi-transparent object.

[0261] As one possible implementation, if the effective depth data is used to describe the depth of each pixel point included in the semi-transparent object in the first coordinate system, then the acquisition unit 1201 is specifically used for:

[0262] The depth data of the scene and the depth data of the semi-transparent object in the scene are obtained. The depth data of the scene is used to describe the depth of each pixel in the scene in the first coordinate system, and the depth data of the semi-transparent object is used to describe the depth of each pixel in the semi-transparent object in the second coordinate system.

[0263] Based on the depth data of the scene and the depth data of the semi-transparent object, the effective depth data of each pixel of the semi-transparent object in the scene is obtained.

[0264] As one possible implementation, the acquisition unit 1201 is specifically used for:

[0265] Determine the maximum and minimum values ​​of the scene in the depth data of the scene, and determine the maximum and minimum values ​​of the object in the depth data of the semi-transparent object;

[0266] Based on the maximum value of the scene, the minimum value of the scene, the maximum value of the object, and the minimum value of the object, determine the transformation relationship between the first coordinate system and the second coordinate system;

[0267] The depth data of the semi-transparent object is converted according to the conversion relationship to obtain the effective depth data.

[0268] As one possible implementation, the acquisition unit 1201 is specifically used for:

[0269] Obtain the opacity data of the semi-transparent object;

[0270] Using the opacity data of the semi-transparent object as a weight, the effective depth data is determined based on the depth of the semi-transparent object and the depth of the scene.

[0271] As one possible implementation, if the translucent object is divided into multiple data layers in the scene, then the acquisition unit 1201 is specifically used for:

[0272] Multiple target pixels of the semi-transparent object are obtained, and the multiple target pixels are used to describe the same position of the semi-transparent object, and different target pixels are located in different data layers;

[0273] Obtain the opacity data and depth data corresponding to the multiple target pixels respectively;

[0274] Determine the first target pixel with the largest opacity data and the second target pixel with the smallest opacity data;

[0275] Based on the depth data of the first target pixel and the depth data of the second target pixel, the depth data corresponding to the multiple target pixels of the semi-transparent object are determined respectively.

[0276] As one possible implementation, the device 1200 further includes a scene fusion unit, used for:

[0277] Obtain the initial color of the scene;

[0278] Based on the effective depth data, the initial color of the scene and the color of the object are blended to obtain the object rendering color of the semi-transparent object in the scene.

[0279] As one possible implementation, the fusion unit 1203 is specifically used for:

[0280] Based on the pixel depth sequence and the initial color of each pixel in the semi-transparent object, the undetermined color of the semi-transparent object in the scene is obtained by fusion.

[0281] The color to be determined is subjected to anti-aliasing processing to obtain the object color of the semi-transparent object.

[0282] As one possible implementation, the fusion unit 1203 is specifically used for:

[0283] The color of the semi-transparent object is obtained by rapidly expanding the anti-aliasing to perform anti-aliasing processing on the color to be determined.

[0284] As one possible implementation, the device 1200 further includes an insertion pipeline unit for:

[0285] In the Unreal Engine deferred pipeline, a forward rendering pipeline is inserted, which is used to perform the step of obtaining the effective depth data of each pixel of the semi-transparent object in the scene and subsequent steps.

[0286] As one possible implementation, the device 1200 further includes a final fusion unit for:

[0287] Based on the effective depth data, the initial color of the scene and the color of the object are fused to obtain the scene rendering color of the scene, which includes the object rendering color of the semi-transparent object in the scene.

[0288] The scene rendering colors are anti-aliased using the Unreal Engine deferred pipeline to obtain the final scene colors.

[0289] As one possible implementation, the final fusion unit is specifically used for:

[0290] If the rendering order is pre-depth rendering, then the following steps are executed: blending the initial scene color and the object color according to the effective depth data to obtain the scene rendering color of the scene, and subsequent steps.

[0291] If the rendering order is depth-of-field rendering, then obtain effective depth data; based on the effective depth data, layer the semi-transparent object to obtain a first object to be rendered in front of the semi-transparent object and a second object to be rendered behind the semi-transparent object; render the first object to be rendered to obtain the pre-depth-of-field color, and render the second object to be rendered to obtain the scene base color; based on the effective depth data, blend the scene initial color, the object color, the pre-depth-of-field color, and the scene base color to obtain the scene rendering color of the scene.

[0292] As one possible implementation, the final fusion unit is specifically used for:

[0293] If the depth-of-field function is enabled, the depth parameters corresponding to the depth-of-field function, the initial scene color, and the object color are fused according to the effective depth data to obtain the scene rendering color of the scene.

[0294] If the depth-of-field function is not enabled, the initial color of the scene and the color of the object are blended based on the effective depth data to obtain the scene rendering color of the scene.

[0295] This application also provides a computer device, which can be a server or a terminal device. The computer device provided in this application will be described below from a hardware implementation perspective. Figure 13 The diagram shown is a structural schematic of the server. Figure 14 The diagram shown is a structural schematic of the terminal device.

[0296] See Figure 13This figure is a schematic diagram of a server structure provided in an embodiment of this application. The server 1400 can vary considerably due to different configurations or performance. It may include one or more processors 1422, such as a central processing unit (CPU), memory 1432, and one or more storage media 1430 (e.g., one or more mass storage devices) for application programs 1442 or data 1444. The memory 1432 and storage media 1430 can be temporary or persistent storage. The program stored in the storage media 1430 may include one or more modules (not shown in the figure), each module may include a series of instruction operations on the server. Furthermore, the processor 1422 may be configured to communicate with the storage media 1430 and execute the series of instruction operations in the storage media 1430 on the server 1400.

[0297] Server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input / output interfaces 1458, and / or one or more operating systems 1441, such as Windows Server. TM Mac OS X TM Unix TM Linux TM FreeBSD TM etc.

[0298] The steps performed by the server in the above embodiments can be based on this Figure 13 The server structure shown.

[0299] The processor 1422 is used to perform the following steps:

[0300] The effective depth data of each pixel of the semi-transparent object in the scene is obtained, and the effective depth data is used to describe the depth of each pixel of the semi-transparent object in the scene.

[0301] Obtain the initial color of each pixel in the semi-transparent object;

[0302] The pixels of the semi-transparent object are sorted by depth based on the effective depth data to obtain a pixel depth sequence. The pixel depth sequence is used to indicate the sequence relationship between the depths of multiple pixels at the same position in the semi-transparent object.

[0303] Based on the pixel depth sequence, the initial colors of each pixel in the semi-transparent object are fused to obtain the object color of the semi-transparent object.

[0304] Optionally, the processor 1422 may also execute method steps of any specific implementation of the test method in the embodiments of this application.

[0305] See Figure 14 This figure is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. The description will be based on a smartphone as an example. Figure 14 The diagram shown is a block diagram of a portion of the structure of the smartphone, which includes: a radio frequency (RF) circuit 1510, a memory 1520, an input unit 1530, a display unit 1540, a sensor 1550, an audio circuit 1560, a Wi-Fi module 1570, a processor 1580, and a power supply 1590, among other components. Those skilled in the art will understand that... Figure 13 The smartphone structure shown does not constitute a limitation on smartphones and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0306] The following is combined Figure 14 A detailed introduction to the various components of a smartphone:

[0307] The RF circuit 1510 can be used to receive and transmit signals during information transmission or calls. In particular, it receives downlink information from the base station and processes it with the processor 1580; in addition, it transmits uplink data to the base station.

[0308] The memory 1520 can be used to store software programs and modules, and the processor 1580 runs the software programs and modules stored in the memory 1520 to realize various functions and data processing of the smartphone.

[0309] The input unit 1530 can be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the smartphone. Specifically, the input unit 1530 may include a touch panel 1531 and other input devices 1532. The touch panel 1531, also known as a touch screen, can collect touch operations from the user on or near it and drive corresponding connected devices according to a pre-set program. In addition to the touch panel 1531, the input unit 1530 may also include other input devices 1532. Specifically, other input devices 1532 may include, but are not limited to, one or more of the following: a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, a joystick, etc.

[0310] The display unit 1540 can be used to display information input by the user or information provided to the user, as well as various menus of a smartphone. The display unit 1540 may include a display panel 1541, which may optionally be configured as a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0311] Smartphones may also include at least one sensor 1550, such as a light sensor, a motion sensor, and other sensors. Other sensors that smartphones may also be equipped with, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be detailed here.

[0312] Audio circuit 1560, speaker 1561, and microphone 1562 provide an audio interface between the user and the smartphone. Audio circuit 1560 converts received audio data into electrical signals and transmits them to speaker 1561, where speaker 1561 converts them into sound signals for output. On the other hand, microphone 1562 converts collected sound signals into electrical signals, which are received by audio circuit 1560, converted into audio data, and then processed by processor 1580 before being transmitted via RF circuit 1510 to, for example, another smartphone, or the audio data can be output to memory 1520 for further processing.

[0313] The processor 1580 is the control center of the smartphone, connecting various parts of the smartphone through various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 1520, and by calling data stored in the memory 1520. Optionally, the processor 1580 may include one or more processing units.

[0314] The smartphone also includes a power supply 1590 (such as a battery) that supplies power to various components. Preferably, the power supply can be logically connected to the processor 1580 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.

[0315] Although not shown, smartphones may also include a camera, Bluetooth module, etc., which will not be described in detail here.

[0316] In this embodiment of the application, the memory 1520 included in the smartphone can store computer programs and transmit the computer programs to the processor.

[0317] The processor 1580 included in the smartphone can execute the test methods provided in the above embodiments according to the instructions in the computer program.

[0318] This application also provides a computer-readable storage medium for storing a computer program that executes the test method provided in the above embodiments.

[0319] On the other hand, embodiments of this application provide a computer program product including a computer program, which, when run on a computer device, causes the computer device to perform the testing methods provided in various optional implementations of the above aspects.

[0320] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium can be at least one of the following media: read-only memory (ROM), RAM, magnetic disk or optical disk, and other media that can store computer programs.

[0321] The terms “first,” “second,” “third,” “fourth,” etc., as used in this application (if applicable), are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “corresponding,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0322] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0323] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects detailed in this application.

[0324] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used herein are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items. Depending on the context, the word “if,” as used herein, can be interpreted as “when,” “in response to a determination,” or “when…”.

[0325] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0326] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods.

Claims

1. A method of rendering a translucent object, characterized by, The method comprises: obtaining effective depth data of each pixel point included in the semi-transparent object in the scene, the effective depth data being used to describe depth of each pixel point included in the semi-transparent object in the scene; obtaining initial object color corresponding to each pixel point included in the semi-transparent object; performing depth sorting on each pixel point included in the semi-transparent object according to the effective depth data, to obtain a pixel point depth sequence, the pixel point depth sequence being used to indicate a sequence relationship between depths of multiple pixel points at the same position in the semi-transparent object; performing fusion on the initial object color corresponding to each pixel point included in the semi-transparent object according to the pixel point depth sequence, to obtain object color of the semi-transparent object.

2. The method of claim 1, wherein, The method further comprises: obtaining opacity data of an object in the scene; if the opacity data of the object is greater than an opacity threshold, determining the object as the opaque object; if the opacity data of the object is less than or equal to the opacity threshold, determining the object as the semi-transparent object.

3. The method of claim 2, wherein, If the object includes multiple regions, for a target region in the multiple regions, the method further comprises: if the opacity data of the target region is greater than an opacity threshold, determining the target region as the opaque object; if the opacity data of the target region is less than or equal to the opacity threshold, determining the target region as the semi-transparent object.

4. The method of claim 1, wherein, If the effective depth data is used to describe depth of each pixel point included in the semi-transparent object in the first coordinate system, the obtaining of the effective depth data of each pixel point included in the semi-transparent object in the scene comprises: obtaining depth data of the scene and depth data of the semi-transparent object in the scene, the depth data of the scene being used to describe depth of each pixel point included in the scene in the first coordinate system, the depth data of the semi-transparent object being used to describe depth of each pixel point included in the semi-transparent object in the second coordinate system; obtaining the effective depth data of each pixel point included in the semi-transparent object in the scene according to the depth data of the scene and the depth data of the semi-transparent object.

5. The method of claim 4, wherein, The obtaining of the effective depth data according to the depth data of the scene and the depth data of the semi-transparent object comprises: determining a scene maximum value and a scene minimum value in the depth data of the scene, and determining an object maximum value and an object minimum value in the depth data of the semi-transparent object; determining a conversion relationship of the first coordinate system and the second coordinate system according to the scene maximum value, the scene minimum value, the object maximum value and the object minimum value; performing conversion on the depth data of the semi-transparent object according to the conversion relationship, to obtain the effective depth data.

6. The method of claim 4, wherein, The obtaining of the effective depth data according to the depth data of the scene and the depth data of the semi-transparent object comprises: obtaining opacity data of the semi-transparent object; The opacity data of the semi-transparent object is taken as a weight to determine the effective depth data according to the depth of the semi-transparent object and the depth of the scene.

7. The method of claim 6, wherein, If the semi-transparent object is divided into multiple data layers in the scene, the opacity data of the semi-transparent object and the depth data of the semi-transparent object are obtained as follows: A plurality of target pixel points of the semi-transparent object are obtained, the plurality of target pixel points are used to describe the same position of the semi-transparent object, and different target pixel points are located in different data layers. The opacity data and the depth data corresponding to each of the plurality of target pixel points are obtained. A first target pixel point with the maximum opacity data and a second target pixel point with the minimum opacity data are determined. The depth data corresponding to each of the plurality of target pixel points of the semi-transparent object is determined based on the depth data of the first target pixel point and the depth data of the second target pixel point.

8. The method of claim 1, wherein, The method further comprises: A scene initial color of the scene is obtained. The scene initial color and the object color are fused according to the effective depth data to obtain an object rendering color of the semi-transparent object in the scene.

9. The method of claim 1, wherein, The method further comprises: A scene initial color of the scene is obtained. The scene initial color and the object color are fused according to the effective depth data to obtain an object rendering color of the semi-transparent object in the scene.

10. The method of claim 9, wherein, The method further comprises: A scene initial color of the scene is obtained.

11. The method of claim 9, wherein, The scene initial color and the object color are fused according to the effective depth data to obtain an object rendering color of the semi-transparent object in the scene. The method further comprises:

12. The method of claim 11, wherein, A scene initial color of the scene is obtained. The scene initial color and the object color are fused according to the effective depth data to obtain an object rendering color of the semi-transparent object in the scene. The method further comprises:

13. The method of claim 12, wherein, A scene initial color of the scene is obtained. The scene initial color and the object color are fused according to the effective depth data to obtain an object rendering color of the semi-transparent object in the scene. The method further comprises: A forward rendering pipeline is inserted in a Unreal Engine deferred pipeline, the forward rendering pipeline is used to perform the step of obtaining the effective depth data of each pixel point of the semi-transparent object in the scene and subsequent steps. The method further comprises: The scene initial color and the object color are fused according to the effective depth data to obtain a scene rendering color of the scene, the object rendering color of the semi-transparent object in the scene is included in the scene rendering color; The scene rendering color is anti-aliasing processed by the Unreal Engine deferred pipeline to obtain a final color of the scene. The method further comprises: If the rendering order is a depth-first rendering, the step of fusing the scene initial color and the object color according to the effective depth data to obtain the scene rendering color of the scene and subsequent steps are performed. The method further comprises: If the rendering order is a depth-first rendering, the step of fusing the scene initial color and the object color according to the effective depth data to obtain the scene rendering color of the scene and subsequent steps are performed. If the rendering order is depth post-rendering, valid depth data is obtained; the semi-transparent object is layered according to the valid depth data, to obtain a first to-be-rendered object in front of the semi-transparent object and a second to-be-rendered object behind the semi-transparent object; the first to-be-rendered object is rendered to obtain a separated depth pre-color, and the second to-be-rendered object is rendered to obtain a scene base color; the scene initial color, the object color, the separated depth pre-color and the scene base color are fused according to the valid depth data, to obtain a scene rendering color of the scene.

14. The method of claim 12, wherein, The fusing the scene initial color and the object color according to the valid depth data to obtain a scene rendering color of the scene comprises: If the depth function is enabled, the depth parameter corresponding to the depth function, the scene initial color and the object color are fused according to the valid depth data, to obtain a scene rendering color of the scene; If the depth function is not enabled, the scene initial color and the object color are fused according to the valid depth data, to obtain a scene rendering color of the scene.

15. An apparatus for rendering a translucent object, characterized by The device comprises an obtaining unit, an ordering unit and a fusing unit. The obtaining unit is configured to obtain valid depth data of each pixel point included in a semi-transparent object in a scene, the valid depth data being used to describe the depth of each pixel point included in the semi-transparent object in the scene; The obtaining unit is further configured to obtain an object initial color corresponding to each pixel point included in the semi-transparent object; The ordering unit is configured to perform depth ordering on each pixel point included in the semi-transparent object according to the valid depth data, to obtain a pixel point depth sequence, the pixel point depth sequence being used to indicate the sequence relationship between the depths of multiple pixel points at the same position in the semi-transparent object; The fusing unit is configured to fuse the object initial color corresponding to each pixel point included in the semi-transparent object according to the pixel point depth sequence, to obtain an object color of the semi-transparent object.

16. A computer device, comprising: The computer device comprises a processor and a memory: The memory is configured to store a computer program and transmit the computer program to the processor; The processor is configured to execute the method according to any one of claims 1-14 according to the computer program.

17. A computer-readable storage medium, characterized in that, The computer readable storage medium is configured to store a computer program, the computer program being used to execute the method according to any one of claims 1-14.

18. A computer program product comprising a computer program, characterised in that, When it runs on a computer device, it makes the computer device execute the method according to any one of claims 1-14.