Scene rendering method, device, computer equipment and storage medium

By using the historical scene rendering data of the previous frame and the overall scene data of the current frame, opaque objects, specific effect areas and translucent objects are rendered in a single rendering channel, the problem of high consumption of rendering resources in the existing technology is solved, and efficient and accurate rendering effects are achieved.

CN112837402BActive Publication Date: 2025-03-14TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110232439.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-01
Publication Date
2025-03-14
Estimated Expiration
2041-03-14

AI Technical Summary

Technical Problem

The prior art uses a large resource consumption when rendering scenes including opaque objects and translucent objects, resulting in low rendering efficiency.

Method used

By obtaining the historical scene rendering data of opaque objects in the single rendering channel of the previous frame, we determine the historical scene rendering data that matches the historical scene rendering data of a specific effect area in the historical scene rendering data, and based on the overall scene data of the current frame and the matching historical scene rendering data, opaque objects, specific effect areas, and translucent objects in the scene in the current frame are rendered in the single rendering channel.

Benefits of technology

It effectively reduces resource consumption during the rendering process, improves rendering efficiency, and can efficiently and accurately render image frames with specific effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112837402B_ABST
    Figure CN112837402B_ABST
Patent Text Reader

Abstract

The present application relates to a scene rendering method, device, computer equipment and storage medium. The method comprises: when the scene of the current frame to be rendered includes a specific effect area, the historical scene rendering data of the opaque objects in the rendering buffer bound to the single rendering channel corresponding to the previous frame is obtained; the specific effect area is the area corresponding to the target opaque object, and the target opaque object is the opaque object covered by the translucent specific effect object in the current frame; the historical scene rendering data matching the specific effect area in the historical scene rendering data is determined; based on the overall scene data corresponding to the current frame and the matching historical scene rendering data, the opaque objects, the specific effect area and the translucent objects in the scene of the current frame are rendered in the single rendering channel corresponding to the current frame to obtain the overall scene rendering data corresponding to the current frame. The use of this method can effectively reduce resource consumption during the rendering process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a scene rendering method, device, computer equipment and storage medium. Background Art

[0002] Rendering in computer graphics usually refers to the process of projecting a model in a three-dimensional scene into a digital image in two dimensions according to the set environment, lighting, materials and rendering parameters, so as to simulate the display effect of the geometric shape and texture of the three-dimensional space object. Some opaque objects and transparent objects in the three-dimensional scene can be intertwined in space to show the hierarchical relationship between the transparent object material and the object.

[0003] In the related art, for scenes including opaque objects and semi-transparent objects, multiple rendering channels are usually used for rendering in a multi-step rendering manner, where one rendering channel is used to render opaque objects, and another rendering channel is used to render transparent objects, and finally the rendering results of opaque objects and transparent objects are synthesized. However, this method will result in a large consumption of resources during the rendering process. Summary of the invention

[0004] Based on this, it is necessary to provide a scene rendering method, apparatus, computer equipment and storage medium that can effectively reduce resource consumption during the rendering process in order to address the above technical problems.

[0005] A scene rendering method, the method comprising:

[0006] When the scene of the current frame to be rendered includes a special effect area, the special effect area is the area corresponding to the target opaque object, and the target opaque object is the opaque object covered by the semi-transparent special effect object in the current frame, then

[0007] Get the historical scene rendering data of the opaque objects in the single rendering channel corresponding to the previous frame;

[0008] Determine historical scene rendering data that matches the specific effect area in the historical scene rendering data;

[0009] Based on the overall scene data corresponding to the current frame and the matching historical scene rendering data, in a single rendering channel corresponding to the current frame, the opaque objects, the specific effect areas, and the semi-transparent objects in the scene of the current frame are rendered.

[0010] A scene rendering device, comprising:

[0011] A data acquisition module, for, when a scene of a current frame to be rendered includes a specific effect area, the specific effect area is an area corresponding to a target opaque object, and the target opaque object is an opaque object covered by a semi-transparent special effect object in the current frame, then acquiring historical scene rendering data of the opaque object in a single rendering channel corresponding to a previous frame; and determining historical scene rendering data matching the specific effect area in the historical scene rendering data;

[0012] A scene rendering module is used to render the opaque objects, the specific effect areas and the translucent objects in the scene of the current frame in a single rendering channel corresponding to the current frame based on the overall scene data corresponding to the current frame and the matching historical scene rendering data.

[0013] In one embodiment, the data acquisition module is also used to determine the sampling position corresponding to the specific effect area in the previous frame; sample the historical scene rendering data according to the sampling position to obtain the historical scene rendering data that matches the specific effect area in the historical scene rendering data.

[0014] In one embodiment, the data acquisition module is also used to determine the three-dimensional scene position corresponding to the specific effect area according to the projection matrix corresponding to the current frame; perform position transformation according to the three-dimensional scene position and the projection matrix corresponding to the previous frame, and obtain the sampling coordinates corresponding to the remapped specific effect area in the previous frame.

[0015] In one embodiment, the data acquisition module is also used to determine the camera viewing angle in the current frame and the reflection position of the reflection effect area according to the projection matrix corresponding to the current frame when the specific effect area includes a reflection effect area; determine the symmetric reflection ray according to the camera viewing angle in the current frame and the reflection position of the reflection effect area; and determine the three-dimensional scene position corresponding to the reflection effect area according to the symmetric reflection ray.

[0016] In one embodiment, the data acquisition module is also used to determine the sampling coordinate offset according to the camera viewing angle in the current frame and the normal direction corresponding to the refraction effect area when the specific effect area includes a refraction effect area; and determine the sampling position corresponding to the refraction effect area in the previous frame according to the sampling coordinate offset.

[0017] In one embodiment, the data acquisition module is also used to acquire historical scene rendering data of opaque objects in a rendering buffer bound to a single rendering channel corresponding to a previous frame; the above-mentioned scene rendering device also includes a data cache module, which is used to write the overall scene rendering data obtained after rendering the current frame, and the scene rendering data of opaque objects in the overall scene rendering data, into the rendering buffer bound to a single rendering channel corresponding to the current frame.

[0018] In one embodiment, the rendering buffer includes an overall scene buffer and an opaque object buffer; the data acquisition module is also used to obtain the historical scene rendering data of the opaque objects in the previous frame from the opaque object buffer bound to the single rendering channel corresponding to the previous frame; the data caching module is also used to cache the overall scene rendering data obtained after rendering the current frame into the overall scene buffer bound to the single rendering channel of the current frame; and cache the scene rendering data of the opaque objects in the overall scene rendering data into the opaque object buffer bound to the single rendering channel of the current frame.

[0019] In one embodiment, the scene rendering module is also used to render opaque objects in the scene of the current frame in a single rendering channel corresponding to the current frame based on the overall scene data corresponding to the current frame; render the specific effect area in the scene of the current frame in the single rendering channel based on the matching historical scene rendering data; and render semi-transparent objects in the scene of the current frame in the single rendering channel based on the overall scene data to obtain the overall scene rendering data corresponding to the current frame.

[0020] In one embodiment, the data acquisition module is also used to determine preset scene data matching the water surface effect area according to a preset water surface height when the specific effect area includes a water surface effect area; the scene rendering module is also used to render the water surface effect area in the scene of the current frame in the single rendering channel based on the matching historical scene rendering data and the preset scene data when rendering the water surface effect area.

[0021] In one embodiment, the matched historical scene rendering data is the first scene rendering data sampled based on the remapped sampling coordinates; the data acquisition module is also used to obtain the scene data of the current frame corresponding to the specific effect area through the sub-rendering channel if the single rendering channel corresponding to the current frame includes a sub-rendering channel; the scene rendering module is also used to determine the target scene data corresponding to the specific effect area when rendering the specific effect area, according to the scene data in the current frame corresponding to the specific effect area and the first scene rendering data; based on the target scene data, render the specific effect area in the scene of the current frame in the single rendering channel.

[0022] In one embodiment, the scene rendering module is also used to determine the pixel to be corrected corresponding to the first scene rendering data in the rendering buffer when the specific effect area includes a refraction effect area; replace the scene rendering data corresponding to the pixel to be corrected in the first scene rendering data according to the scene data corresponding to the pixel to be corrected in the scene data of the current frame, and obtain the target scene data of the specific effect area.

[0023] In one embodiment, the scene rendering module is also used to determine a first depth difference between a first depth value and a second depth value; based on a sampling coordinate offset, sample second scene rendering data matching the specific effect area from the historical scene rendering data; determine a second depth difference for the same pixel in the first scene rendering data and the second scene rendering data; when the first depth difference is greater than or equal to a first threshold and the second depth difference is greater than or equal to a second threshold, determine that the pixel is a pixel to be corrected.

[0024] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0025] When the scene of the current frame to be rendered includes a special effect area, the special effect area is the area corresponding to the target opaque object, and the target opaque object is the opaque object covered by the semi-transparent special effect object in the current frame, then

[0026] Get the historical scene rendering data of the opaque objects in the single rendering channel corresponding to the previous frame;

[0027] Determine historical scene rendering data that matches the specific effect area in the historical scene rendering data;

[0028] Based on the overall scene data corresponding to the current frame and the matching historical scene rendering data, in a single rendering channel corresponding to the current frame, the opaque objects, the specific effect areas, and the semi-transparent objects in the scene of the current frame are rendered.

[0029] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0030] When the scene of the current frame to be rendered includes a special effect area, the special effect area is the area corresponding to the target opaque object, and the target opaque object is the opaque object covered by the semi-transparent special effect object in the current frame, then

[0031] Get the historical scene rendering data of the opaque objects in the single rendering channel corresponding to the previous frame;

[0032] Determine historical scene rendering data that matches the specific effect area in the historical scene rendering data;

[0033] Based on the overall scene data corresponding to the current frame and the matching historical scene rendering data, in a single rendering channel corresponding to the current frame, the opaque objects, the specific effect areas, and the semi-transparent objects in the scene of the current frame are rendered.

[0034] The above-mentioned scene rendering method, device, computer equipment and storage medium, when the scene of the current frame to be rendered includes a specific effect area, obtains the historical scene rendering data of the opaque object in the single rendering channel corresponding to the previous frame, wherein the specific effect area is the area corresponding to the target opaque object, and the target opaque object is the opaque object covered by the translucent specific effect object in the current frame. By determining the historical scene rendering data that matches the specific effect area in the historical scene rendering data, the historical scene rendering data that matches the specific effect area in the previous frame can be accurately sampled. Then, based on the overall scene data corresponding to the current frame and the matching historical scene rendering data, the opaque objects, the specific effect area and the translucent objects in the scene of the current frame are rendered in the single rendering channel corresponding to the current frame. In this way, the overall scene rendering data with high rendering accuracy can be effectively obtained, and then the image frame with specific effects can be efficiently and accurately rendered, thereby efficiently achieving the rendering of opaque objects, specific effect areas and translucent objects in the same rendering channel, while effectively reducing the bandwidth pressure in the rendering process, thereby effectively reducing the resource consumption in the rendering process. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 An application environment diagram of a scene rendering method in an embodiment;

[0036] Figure 2 A schematic diagram of a flow chart of a scene rendering method in one embodiment;

[0037] Figure 3 It is a schematic diagram of rendering the reflection effect area in one embodiment;

[0038] Figure 4 A schematic diagram of defects generated after rendering a refraction effect area in one embodiment;

[0039] Figure 5 It is a schematic diagram of rendering the refraction effect area in one embodiment;

[0040] Figure 6 A schematic diagram of a projection of a tree on the ground in a rendered image frame in one embodiment;

[0041] Figure 7 A schematic diagram of a projection of a tree on the ground in a rendered image frame in another embodiment;

[0042] Figure 8 A schematic diagram of reading data from a rendering buffer and a schematic diagram in one embodiment;

[0043] Fig. 9 is a schematic diagram of reading scene data from a previous frame in one embodiment;

[0044] Fig.10 A schematic diagram of a water surface rendered using remapped scene data in one embodiment;

[0045] Fig.11 A schematic diagram of a water surface rendered using remapped scene data in another embodiment;

[0046] Fig.12 is a schematic diagram of water surface depth in one embodiment;

[0047] Fig.13 is a schematic diagram of water surface depth in another embodiment;

[0048] Fig.14 A schematic diagram of a preset water surface height pre-stored in one embodiment;

[0049] Fig.15 A schematic diagram of a rendered area including a water surface effect in one embodiment;

[0050] Fig.16 A schematic diagram of a rendered area including a water surface effect in another embodiment;

[0051] Fig.17 A schematic diagram of a flow chart of a scene rendering method in another embodiment of an embodiment;

[0052] Fig.18 A schematic diagram of a pixel to be corrected after correction in one embodiment;

[0053] Fig.19 A schematic diagram of selecting a water surface area and then generating an object ghosting defect in one embodiment;

[0054] Fig. 20 is a schematic diagram of removing ghosting defects on a water surface area in one embodiment;

[0055] Fig.21 is a schematic diagram of removing ghosting defects under the water surface area in one embodiment;

[0056] Fig. 22 is a schematic diagram of another embodiment after removing ghosting defects under the water surface area;

[0057] Fig.23 It is a schematic diagram of filling pixels of a dynamic object in a scene in one embodiment;

[0058] Fig.24 It is a schematic diagram of filling pixels of a dynamic object in a scene in another embodiment;

[0059] Fig.25 It is a schematic diagram of rendering an opaque object in a water surface area in one embodiment;

[0060] Fig.26 It is a schematic diagram of rendering an opaque object in a water surface area in another embodiment;

[0061] Fig. 27 It is a schematic diagram of rendering of an object moving at high speed in a water surface area in one embodiment;

[0062] Fig.28 is a structural block diagram of a scene rendering device in one embodiment;

[0063] Fig.29 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0065] The scene rendering method provided in this application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The terminal 102 obtains the scene data required for the scene to be rendered from the server 104. In the process of rendering the scene by the terminal 102, when the scene of the current frame to be rendered includes a specific effect area, the historical scene rendering data of the opaque objects in the single rendering channel corresponding to the previous frame is obtained; wherein the specific effect area is the area corresponding to the target opaque object, and the target opaque object is the opaque object covered by the translucent special effect object in the current frame; determine the historical scene rendering data that matches the specific effect area in the historical scene rendering data. Then, based on the overall scene data corresponding to the current frame and the matching historical scene rendering data, the opaque objects, specific effect areas and translucent objects in the scene of the current frame are rendered in a single rendering channel.

[0066] Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application is not limited here.

[0067] Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources in a wide area network or local area network to achieve data computing, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool that can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The background services of technical network systems require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.

[0068] Computer Vision Technology (Computer Vision, CV) Computer vision is a science that studies how to make machines "see". To put it more concretely, it refers to machine vision such as using cameras and computers to replace human eyes to identify, track and measure targets, and further perform graphics processing to make computer processing into images that are more suitable for human eye observation or transmission to instrument detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multidimensional data. Computer vision technology generally includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, synchronous positioning and map construction, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition. It can be understood that the scene rendering method of the present application is to render the image frames to be rendered based on computer vision technology, which can effectively improve the efficiency of scene rendering.

[0069] In one embodiment, Figure 2 As shown, a scene rendering method is provided, which is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:

[0070] S202, when the scene of the current frame to be rendered includes a specific effect area, the specific effect area is the area corresponding to the target opaque object, and the target opaque object is the opaque object covered by the semi-transparent special effect object in the current frame, then the historical scene rendering data of the opaque object in the single rendering channel corresponding to the previous frame is obtained.

[0071] It can be understood that in computer graphics, rendering refers to the process of projecting the object model in the three-dimensional scene into a digital image in two dimensions according to the set environment, material, lighting and rendering parameters. That is, the process of converting the three-dimensional light energy transfer process into a two-dimensional image. The scenes and entities are represented in three-dimensional form, which is closer to the real world and is easy to manipulate and transform.

[0072] The scene to be rendered may be a three-dimensional scene, for example, a three-dimensional virtual scene. It is understandable that in a three-dimensional scene, the position and viewing angle of the observation point are different, and the corresponding scene images displayed are also different. By displaying the image frames corresponding to the continuous scene images, a dynamic three-dimensional scene or a three-dimensional scene video can be displayed. The current frame to be rendered refers to the image frame that needs to be rendered in the process of displaying the three-dimensional scene. The previous frame refers to the previous frame adjacent to the current frame.

[0073] It can be understood that the special effect area is the area corresponding to the target opaque object, and the target opaque object is the opaque object covered by the semi-transparent special effect object in the current frame, that is, the area corresponding to the special effect that will eventually be displayed on the screen. For example, the special effect can be a special effect that will appear in a pre-drawn three-dimensional virtual scene, that is, a special visual effect will be produced. For example, the semi-transparent special effect object can include at least one of water surface reflection, water surface refraction, rain, glass, soft particles, decals, etc.

[0074] Among them, an opaque object may be an object that cannot be penetrated by colored light, that is, light cannot pass through the object to find the object behind it. A translucent object may be an object that can be penetrated by all colored lights, that is, an object with transparency and physical properties that allow light to pass through the material without dispersion.

[0075] Generally speaking, a translucent object is an object made of a material that allows light to enter. The color of a translucent object is the same as the color of the incident light and is determined by the color of the light that passes through it. The color of an opaque object is determined by the color of the reflected light, and an opaque object only reflects light of the same color as itself.

[0076] It can be understood that the special effect area is the area corresponding to at least part of the opaque object covered by the translucent special effect object in the current frame and used to render the special effect. Usually, the area covered by some specific translucent objects will show special effects. The positions of opaque objects and translucent objects are different, and the final displayed effect may be different. For example, the effect displayed when an opaque object is on a translucent water surface object is different from that when an opaque object is under a translucent water surface object.

[0077] The scene data refers to the data required for rendering the scene, such as at least one of color data, depth data, texture data, vertex data, and lighting data, so as to render the corresponding scene based on the scene data. The historical scene rendering data may refer to the scene data after rendering the objects in the historical frame. The historical scene rendering data of the opaque objects corresponding to the previous frame is the scene data obtained after rendering the opaque objects in the previous frame.

[0078] It is understandable that the scene to be rendered includes at least opaque objects. Some scenes include both opaque objects and translucent objects. When translucent objects are included, specific effect areas may be included, for example, the area covered by the translucent objects may show specific effects. When the scene of the current frame to be rendered includes a specific effect area, the historical scene rendering data of the opaque objects in the previous frame is obtained.

[0079] S204: Determine historical scene rendering data that matches the specific effect area in the historical scene rendering data.

[0080] It can be understood that the historical scene rendering data of the opaque objects in the previous frame can be the historical scene rendering data corresponding to all the opaque objects rendered in the previous frame. Specifically, the historical scene rendering data can be the determined historical scene rendering data that needs to be finally rendered corresponding to all the opaque objects in the previous frame.

[0081] The terminal samples the historical scene rendering data that matches the specific effect area in the historical scene rendering data from the previous frame according to the specific effect area in the current frame. Specifically, the matching historical scene rendering data can be the remapped scene data obtained by sampling at the remapped sampling position, or the scene data obtained by sampling at the sampling position determined in a preset manner.

[0082] S206 , based on the overall scene data corresponding to the current frame and the matching historical scene rendering data, in a single rendering channel corresponding to the current frame, render the opaque objects, specific effect areas, and translucent objects in the scene of the current frame.

[0083] It can be understood that the rendering of a semi-transparent object is essentially to render the color of the transparent object itself, then obtain the existing scene data in the rendering buffer, such as color data, and then mix the two in a preset way. When rendering a semi-transparent object, the rendering buffer has already written the required scene data. Therefore, semi-transparent objects are usually rendered in the last step.

[0084] Among them, the rendering channel, also known as RenderPass, refers to the rendering process of the image frame to be rendered, that is, the set of rendering instructions submitted by the application to the graphics processor at one time. A single rendering channel can be understood as a single run of the rendering pipeline. Which graphics objects are to be rendered by each rendering channel, these rendering channels constitute the rendering pipeline. For example, the rendering channel can include a geometry buffer channel, a lighting shading channel, etc., to realize the rendering processing of the image frame.

[0085] In the process of rendering a scene, a rendering pass can be understood as a series of image rendering processing steps. Objects in a scene usually require one or more rendering operations, and the results of each rendering operation will be accumulated to the final rendering result. If the rendering target bound to the same single rendering pass caches all the scene data required for rendering the current frame to be rendered, such as at least one of color information, depth information, and geometric information. Through this single rendering pass, the rendering process of the current frame can be realized to obtain the final scene rendering result.

[0086] Specifically, after the terminal caches the overall scene data required for the current frame to be rendered and the historical scene rendering data matching the specific effect area into the rendering buffer bound to the single rendering channel corresponding to the current frame, the current frame can be rendered. Specifically, in the same single rendering channel, the terminal renders the opaque objects and translucent objects in the scene of the current frame based on the overall scene data in the rendering buffer, and renders the specific effect area in the scene of the current frame based on the matching historical scene rendering data, thereby obtaining a scene rendering result with a specific effect corresponding to the current frame. By rendering the opaque objects, specific effect areas, and translucent objects in the scene in one rendering channel, the bandwidth consumption during the rendering process can be effectively reduced.

[0087] It is understandable that if the current frame is the initial frame, the terminal directly renders the opaque objects, specific effect areas and translucent objects in the scene of the initial frame in the single rendering channel corresponding to the initial frame based on the overall scene data corresponding to the initial frame. When the terminal is rendering the initial frame, the startup interface of the terminal is still in a state of blocking the scene and will not produce any visual impact. When the terminal renders the next frame, it reads the historical scene rendering data of the opaque objects in the single rendering channel corresponding to the current frame to further render the next frame.

[0088] In one embodiment, the rendering order of the opaque objects, the special effect areas, and the semi-transparent objects may be to render the opaque objects in the scene of the current frame first, then render the special effect areas in the scene of the current frame, and finally render the semi-transparent objects in the scene of the current frame. In this way, the rendering process of some special effects that require scene data, such as color and depth information, can be effectively rendered without splitting the rendering channels of the opaque objects and the semi-transparent objects.

[0089] In one embodiment, a delayed rendering method can be used for image rendering processing, that is, a delayed rendering pipeline is used for image rendering processing. By rendering the scene that does not receive illumination to the geometry buffer first, the geometry buffer can be used to render the scene data to the texture corresponding to the graphic object in the image frame to be rendered. The geometry buffer then renders the scene data to the texture corresponding to the graphic object in the image frame to be rendered, and then performs illumination processing on the scene data rendered to the texture. For scenes with a large number of light sources and objects, the use of a delayed rendering method can greatly reduce the computational pressure of the pixel shader, and can effectively improve the rendering efficiency of multi-light source scenes.

[0090] In the above scene rendering method, when the scene of the current frame to be rendered includes a specific effect area, the terminal obtains the historical scene rendering data of the opaque object in the single rendering channel corresponding to the previous frame. Among them, the specific effect area is the area corresponding to at least part of the opaque object covered by the semi-transparent special effect object in the current frame and used to render the specific effect. By determining the historical scene rendering data that matches the specific effect area in the historical scene rendering data, the terminal can accurately sample the historical scene rendering data that matches the specific effect area in the previous frame. Then, based on the overall scene data corresponding to the current frame and the matching historical scene rendering data, the opaque object, the specific effect area and the semi-transparent object are rendered in the same single rendering channel corresponding to the current frame. In this way, the overall scene rendering data with high rendering accuracy can be effectively obtained, and the overall scene rendering data and the scene rendering data of the opaque object in the overall scene rendering data are written into the rendering buffer bound to the single rendering channel corresponding to the current frame, so that the image frame with the specific effect can be rendered efficiently and accurately, and the bandwidth pressure in the rendering process is effectively reduced, thereby effectively reducing the resource consumption in the rendering process.

[0091] In one embodiment, determining historical scene rendering data that matches a specific effect area in historical scene rendering data includes: determining a sampling position corresponding to the specific effect area in a previous frame; sampling the historical scene rendering data according to the sampling position to obtain historical scene rendering data that matches the specific effect area in the historical scene rendering data.

[0092] The sampling position may refer to a sampling position in an image frame where sampling is required. For example, an image frame may be represented as an image matrix, and each pixel in the image frame has a corresponding pixel position. By sampling the image frame through the sampling position, scene data of pixels in the image frame that match the sampling position may be obtained.

[0093] After the terminal obtains the historical scene rendering data of the opaque object in the previous frame, it calculates the sampling position in the previous frame through the corresponding position of the specific effect area in the current frame, and then samples the historical scene rendering data of the corresponding position from the historical scene rendering data of the previous frame according to the sampling position.

[0094] Specifically, after the terminal obtains the historical scene rendering data of the opaque object in the previous frame, it determines the sampling position corresponding to the opaque object in the specific effect area in the previous frame, and then samples the historical scene rendering data according to the sampling position to obtain historical scene rendering data that matches the specific effect area from the historical scene rendering data of the previous frame.

[0095] In another embodiment, after the terminal obtains the historical scene rendering data of the opaque object in the previous frame, it can also determine the sampling position corresponding to the opaque object in the current frame in the previous frame based on the overall area corresponding to the opaque object in the current frame, so as to obtain the historical scene rendering data matching the current frame from the previous frame based on the sampling position.

[0096] Specifically, the terminal may determine the sampling position in different ways according to different specific effect types. For example, the sampling method may include determining the sampling position by remapping the screen position corresponding to the current frame, and determining the sampling position according to the distance or coordinate offset corresponding to the current frame.

[0097] In this embodiment, the terminal determines the sampling position corresponding to the specific effect area in the previous frame, and adopts the historical scene rendering data of the previous frame according to the sampling position, so as to accurately sample the historical scene rendering data that matches the specific effect area in the previous frame.

[0098] In one embodiment, the sampling position includes sampling coordinates; determining the sampling position corresponding to the specific effect area in the previous frame includes: determining the three-dimensional scene position corresponding to the specific effect area according to the projection matrix corresponding to the current frame; performing position transformation according to the three-dimensional scene position and the projection matrix corresponding to the previous frame to obtain the sampling coordinates corresponding to the remapped specific effect area in the previous frame.

[0099] The sampling coordinates may be screen coordinates. It is understood that the screen window used for display on the terminal may be used as a screen coordinate system, and the screen coordinates may be position coordinates in the screen coordinate system. For example, in the screen coordinate system, the x-axis is in the horizontal direction of the view and is positive to the right, the y-axis is in the vertical direction of the view and is positive upward, and the z-axis is perpendicular to the screen.

[0100] It can be understood that remapping may refer to the process of placing a pixel at a position in a source image to a specified position in a target image. Usually, the pixel coordinates of the source image and the target image are not one-to-one corresponding, so it is necessary to obtain the pixel coordinates corresponding to the remapping. In this embodiment, the source image is the previous frame image, and the target image is the current frame image. By establishing a mapping matrix corresponding to the previous frame image and the current frame image, and then performing remapping processing according to the mapping matrix, the historical scene rendering data mapped from the previous frame image is mapped to the current frame image for rendering processing.

[0101] The projection matrix can represent the projection mapping matrix between the three-dimensional coordinates of an object in a three-dimensional space and the two-dimensional projection plane. Therefore, the projection matrix can be used to map the three-dimensional coordinates to the two-dimensional coordinates. The projection matrix can include information such as the projection mapping relationship and mapping parameters.

[0102] It can be understood that the position of a 3D scene may refer to the position of an object in the world coordinate system of the 3D scene. The world coordinate system, also known as the world space, can be used to represent the world space position of each object in the 3D scene. Usually, the world coordinates of each object in the 3D scene are fixed.

[0103] When determining the sampling position corresponding to the specific effect area in the previous frame, the terminal can remap the projection matrix corresponding to the current frame with the projection matrix corresponding to the previous frame to obtain the sampling position corresponding to the previous frame.

[0104] Specifically, the terminal can determine the three-dimensional scene position corresponding to the specific effect area according to the projection matrix corresponding to the current frame, that is, determine the world coordinates of the opaque object in the specific effect area according to the projection matrix of the current frame. The terminal then performs position transformation according to the three-dimensional scene position and the projection matrix corresponding to the previous frame to obtain the sampling coordinates corresponding to the remapped specific effect area in the previous frame. For example, the terminal can obtain the screen coordinates of the opaque object in the previous frame, that is, the position in the screen space, by multiplying the world coordinates of the opaque object in the current frame with the projection matrix of the previous frame. The terminal can then determine the calculated screen coordinates as the sampling coordinates, thereby obtaining the sampling coordinates obtained based on the remapping process.

[0105] In this embodiment, through remapping processing, the world coordinates of the opaque objects in the current frame are calculated according to the projection matrix of the current frame, and the world coordinates of the opaque objects are transformed with the projection matrix of the previous frame, so that the screen coordinates of the opaque objects in the current frame in the previous frame can be accurately obtained.

[0106] In one embodiment, the three-dimensional scene position corresponding to the specific effect area is determined according to the projection matrix corresponding to the current frame, including: when the specific effect area includes a reflection effect area, the camera viewing angle and the reflection position of the reflection effect area in the current frame are determined according to the projection matrix corresponding to the current frame; the symmetric reflection ray is determined according to the camera viewing angle and the reflection position of the reflection effect area in the current frame; and the three-dimensional scene position corresponding to the reflection effect area is determined according to the symmetric reflection ray.

[0107] It can be understood that the reflection effect refers to the effect of reflecting the surrounding environment on the surface of an object with a smooth surface material, that is, it can reflect the reflection of surrounding objects. For example, an object with a smooth surface material may include at least one of a water surface, a smooth ground, a metal surface, etc. In the process of rendering a scene, adding a reflection effect to an object with a smooth surface material can effectively improve the rendering effect and accuracy of the scene.

[0108] Among them, the reflection effect area can refer to the area with a reflective interface in the scene, which can present the special effect of a reflective object. The camera perspective can refer to the perspective of a virtual camera in a three-dimensional scene, or the perspective of an observation point in a three-dimensional scene. The reflection position can refer to the surface of an object with a smooth surface material, such as the position of the water surface. The reflected ray can refer to the light that is reflected at the smooth surface when it is directed to the smooth surface.

[0109] Specifically, for the reflection effect area, the terminal can use the reflection principle of the screen space to determine the camera viewing angle and the reflection position of the reflection effect area in the current frame, as well as the normal direction of the reflection position, according to the projection matrix corresponding to the current frame. According to the camera viewing angle and the reflection position in the current frame, as well as the normal direction of the reflection position, the reflection ray can be obtained. By taking a point at a distance on the reflection ray, a point symmetrical to the objects around the reflection position can be obtained, and then according to the screen coordinates of this point and the projection matrix corresponding to the current frame, the world coordinates of the pixel points that need to be reflected in the reflection effect area can be obtained, that is, the three-dimensional scene position of the pixel points that need to be reflected in the reflection effect area.

[0110] The terminal can then obtain the screen coordinates of the pixel points that need to be reflected in the reflection effect area in the previous frame based on the world coordinates of the pixel points that need to be reflected in the reflection effect area and the projection matrix in the previous frame, and then obtain the screen coordinates of the pixel points that need to be reflected in the reflection effect area in the previous frame.

[0111] For example, when the reflection effect area is a water surface, Figure 3 As shown in FIG. 1 , an image frame rendered in the above manner in a three-dimensional scene is shown. It can be seen from the figure that the scene includes a beach, a person, a water surface area, and a mountain and sky in the distance. Among them, it includes a water surface area 3a, and a reflective object area 3b that needs to reflect the reflection in the water surface area 3a. Since the water surface area is a smooth surface, it is necessary to render the reflection of the objects reflected around the water surface area, which can effectively improve the scene rendering effect.

[0112] In this embodiment, after determining the three-dimensional scene position of the opaque object to be reflected according to the emitted rays corresponding to the reflection area, the remapped scene data can be accurately sampled from the historical scene rendering data in the previous frame. This can effectively reduce the resource consumption in the rendering process to improve the rendering efficiency, and can also effectively improve the accuracy of scene rendering.

[0113] In one embodiment, determining the sampling position corresponding to the specific effect area in the previous frame includes: when the specific effect area includes a refraction effect area, determining the sampling coordinate offset according to the camera viewing angle in the current frame and the normal direction corresponding to the refraction effect area; determining the sampling position corresponding to the refraction effect area in the previous frame according to the sampling coordinate offset.

[0114] It can be understood that the refraction effect may refer to that when light is incident obliquely from one transparent medium into another transparent medium, the propagation direction generally changes, and an effect of refraction phenomenon is presented in the other translucent medium. For example, the refraction effect area may be an object of a transparent material, such as at least one of translucent objects such as water surface and glass.

[0115] Specifically, for the refraction effect area, the terminal can use the reflection principle of the screen space to determine the normal direction corresponding to the camera viewing angle in the current frame and the reflection position of the reflection effect area according to the projection matrix corresponding to the current frame, and a relative offset can be obtained according to the geometric relationship. For example, the relative offset after refraction can be calculated according to the waveform of the reflection position. The terminal determines the obtained relative offset as the sampling coordinate offset for sampling in the previous frame. The terminal then determines the sampling position corresponding to the refraction effect area in the previous frame according to the sampling coordinate offset.

[0116] The terminal can then obtain the screen coordinates of the pixel points that need to be refracted in the refraction effect area in the previous frame according to the sampling position corresponding to the refraction effect area in the previous frame and the projection matrix in the previous frame. Then, the historical scene rendering data of the previous frame is sampled according to the sampling coordinates to obtain the historical scene rendering data that matches the specific effect area from the historical scene rendering data of the previous frame.

[0117] For example, for the refraction effect area in the current frame, such as the water surface area in the scene, the sampling coordinate offset can be determined by ray tracing. Specifically, the incidence angle can be calculated based on the normal, angle and refractive index of the incident plane in the three-dimensional scene, and then the sampling coordinate offset can be calculated based on the incidence angle. Then, the historical scene rendering data of the previous frame can be further sampled based on the sampling coordinate offset to obtain matching historical scene rendering data.

[0118] When rendering based on the overall scene data corresponding to the current frame and the matching historical scene rendering data, the opaque object part is rendered first. When rendering the refraction effect area, for example, when the refraction effect area is a water surface, the sampled pixel position offset is obtained for each pixel according to the screen space normal and other attributes, and the refracted pixel value corresponding to the water surface is obtained, and then mixed with the shading of the water surface itself to render the refraction effect.

[0119] It is understandable that if the remapped historical scene rendering data is used in the refraction scene, that is, the sampling position is determined based on the remapping process, and the historical scene rendering data is sampled from the historical scene rendering data for rendering. After rendering in this way, when the perspective in the three-dimensional scene rotates quickly, such as Figure 4 As shown, refer to Figure 4 The rendered image frame includes the water surface area. Among them, the area 4a in the water surface area is a normal rendering result, but the edge of the water surface area produces a defect area 4b similar to brushing.

[0120] In this embodiment, by sampling the corresponding historical scene rendering data from the previous frame based on the sampling coordinate offset for rendering, the problem of image edge defects when the viewing angle is quickly rotated can be solved. Figure 5 As shown, the rendered image frame will not produce any drawing defects.

[0121] In one embodiment, if Figure 6 As shown in the figure, the projection of the trees on the ground in the rendered image frame is normal. When the perspective in the 3D scene rotates quickly, the scene data of the previous frame that has not been reprojected is used for refraction processing, and there will be a visual shaking delay, which is particularly obvious in shallow water. Figure 7 As shown, the projection of the ground tree in the rendered image frame has a ghosting defect. In another embodiment, if the ghosting defect is large, the refraction rendering process of the water surface may not be performed, and only the reflection rendering process is retained.

[0122] In this embodiment, for the refraction effect area in the scene, by calculating the sampling coordinate offset corresponding to the refraction effect area, the three-dimensional scene position of the opaque object to be reflected can be determined, and then the matching historical scene rendering data can be accurately sampled from the historical scene rendering data in the previous frame. This can effectively reduce the resource consumption in the rendering process to improve the rendering efficiency, and can also effectively improve the accuracy of scene rendering.

[0123] In one embodiment, obtaining historical scene rendering data of opaque objects in a single rendering channel corresponding to a previous frame includes: obtaining historical scene rendering data of opaque objects in a rendering buffer bound to the single rendering channel corresponding to the previous frame.

[0124] The above-mentioned scene rendering method also includes: writing the overall scene rendering data obtained after rendering the current frame, and the scene rendering data of the opaque objects in the overall scene rendering data, into the rendering buffer bound to the single rendering channel corresponding to the current frame.

[0125] Among them, the rendering buffer, that is, the rendering target (RT, RenderTarget), the rendering target is a video memory buffer used to render pixels, used to record the output results after rendering, and specifically refers to a video memory buffer used to store the information required for drawing when rendering image frames, instead of directly drawing the frame buffer to the screen.

[0126] It is understandable that a render target is essentially a continuous memory area, and multiple such memory areas can exist at the same time, that is, multiple render targets. In the field of 3D (three-dimensional) computer graphics, a render target is used by a graphics processor (GPU, Graphics Processing Unit) to cache scene data during the 3D scene rendering process to an intermediate storage buffer or a render target texture (RTT, RenderTarget Texture), rather than a frame buffer or back buffer. The required information can then be read from the render target through a pixel shader operation, so that other effects can be applied to the final image frame before the final image is displayed. For example, off-screen rendering can be achieved through a render target.

[0127] For example, the graphics card in the terminal uses the information in the rendering buffer to draw the pixels of the scene in a preset manner. Specifically, one or more rendering targets can be created to reserve a new area in the rendering buffer to store the information required for drawing. For example, in some three-dimensional game scenes, a large amount of scene data can be drawn into multiple rendering targets, and the scene data corresponding to different image elements are compiled, and then these image elements are combined to form the final frame buffer for rendering.

[0128] It can be understood that the render buffer is used to cache the scene rendering data required for the image frame being rendered offline. The frame buffer is used to store the color of each pixel, that is, the rendered image frame. The frame buffer is often in the video memory. The graphics card can display the rendered image frame on the terminal screen by continuously reading the rendered image frame in the frame buffer of the video memory.

[0129] Specifically, a single rendering channel can be bound to multiple rendering buffers. Here, multiple means more than two. That is, a single rendering channel can be bound to at least two rendering buffers. For example, the rendering buffer may include at least a color buffer (Color RT) and a depth buffer (Depth RT), and may also include a stencil buffer (Stencil RT). Among them, the depth buffer and the stencil buffer can also be a merged buffer area (Depth & Stencil RT). The color buffer is used to store the color data of the pixel. The depth buffer is used to store the depth data of the pixel, and the depth data reflects the distance from the object to the camera. The stencil buffer can be used to store bitmap marking data, for example, it can be used to achieve special effects for a specific effect area of ​​the mark.

[0130] It can be understood that after the terminal renders the opaque objects, specific effect areas and translucent objects in the scene of the current frame in the single rendering channel corresponding to the current frame, and obtains the overall scene rendering data corresponding to the current frame, the terminal caches the overall scene rendering data and the scene rendering data of the opaque objects in the overall scene rendering data into the rendering buffer bound to the single rendering channel of the current frame.

[0131] The historical scene rendering data of the opaque objects in the rendering buffer bound to the single rendering channel of the current frame can be provided to the single rendering channel corresponding to the next frame for reading, so as to continue rendering the next frame in the above manner.

[0132] If the scene of the current frame to be rendered includes a specific effect area, and the current frame is not the first frame, the terminal reads the historical scene rendering data of the opaque objects in the previous frame from the rendering buffer bound to the single rendering channel corresponding to the previous frame, so as to obtain the matching historical scene rendering data from the historical scene rendering data of the opaque objects in the previous frame. Based on the overall scene data corresponding to the current frame and the matching historical scene rendering data, the terminal renders the opaque objects, specific effect areas, and translucent objects in the scene of the current frame in the single rendering channel corresponding to the current frame. The terminal then writes the overall scene rendering data obtained after rendering the current frame, as well as the scene rendering data of the opaque objects in the overall scene rendering data, into the rendering buffer bound to the single rendering channel corresponding to the current frame.

[0133] In this embodiment, by writing the overall scene rendering data and the scene rendering data of opaque objects in the overall scene rendering data into a rendering buffer bound to a single rendering channel corresponding to the current frame, it is possible to effectively render opaque objects, specific effect areas and translucent objects in one rendering channel, thereby efficiently and accurately rendering image frames with specific effects, effectively reducing resource consumption in the rendering process.

[0134] In one embodiment, the rendering buffer includes an overall scene buffer and an opaque object buffer; obtaining the historical scene rendering data of the opaque objects in the rendering buffer bound to the single rendering channel corresponding to the previous frame includes: obtaining the historical scene rendering data of the opaque objects in the previous frame from the opaque object buffer bound to the single rendering channel corresponding to the previous frame. The step of writing the overall scene rendering data obtained after rendering the current frame and the scene rendering data of the opaque objects in the overall scene rendering data into the rendering buffer bound to the single rendering channel corresponding to the current frame includes: caching the overall scene data obtained after rendering the current frame into the overall scene buffer bound to the single rendering channel of the current frame; caching the scene rendering data of the opaque objects in the overall scene rendering data into the opaque object buffer bound to the single rendering channel of the current frame.

[0135] The overall scene buffer included in the rendering buffer is used to cache the overall scene rendering data of all objects rendered corresponding to the current frame. The opaque object buffer included in the rendering buffer is used to cache the scene rendering data corresponding to the opaque objects in the overall scene rendering data corresponding to the current frame. That is, the overall scene rendering data corresponding to the current frame is cached in the overall scene buffer, and the scene rendering data of the opaque objects in the overall scene rendering data corresponding to the current frame are cached in the opaque object buffer.

[0136] It can be understood that each frame is assigned a corresponding single rendering channel. The single rendering channel corresponding to each frame can be bound to multiple rendering targets, that is, multiple rendering buffers. Specifically, the single rendering channel corresponding to each frame is bound to at least one overall scene buffer and an opaque object buffer.

[0137] After the terminal renders each frame through the shader, the overall scene rendering data obtained after rendering each frame, as well as the scene rendering data corresponding to the opaque objects in the overall scene rendering data, are written into the rendering buffer bound to the single rendering channel corresponding to each frame.

[0138] Specifically, the terminal renders the opaque objects, specific effect areas, and translucent objects in the scene of the current frame in a single rendering channel corresponding to the current frame, and obtains the rendered overall scene rendering data. The terminal caches the overall scene rendering data obtained after rendering the current frame into the overall scene buffer bound to the single rendering channel of the current frame.

[0139] The terminal then caches the scene rendering data corresponding to the opaque objects in the overall scene rendering data into the opaque object buffer bound to the single rendering channel of the current frame. Thus, when the terminal samples from the previous frame according to the sampling position corresponding to the current frame, it reads the historical scene rendering data corresponding to the opaque objects from the opaque object buffer bound to the single rendering channel corresponding to the previous frame.

[0140] Specifically, one RenderPass can be used to bind multiple RTs (RenderTarget, rendering target, also known as rendering buffer), and the rendering buffer can include multiple sub-buffers of different types, such as a color buffer (ColorRT), a depth buffer (Depth RT), and a template buffer (Stencil RT).

[0141] It can be understood that the rendering buffer may include an overall scene buffer and an opaque object buffer. Among them, the overall scene buffer may include a color buffer (ColorRT), a depth buffer (Depth RT) and a template buffer (Stencil RT), and the depth buffer (Depth RT) and the template buffer (Stencil RT) may also be a merged buffer (Depth & Stencil RT), which is used to cache the overall scene rendering data of all objects in the current frame. The overall scene rendering data may include the color information, depth information and Mask mark information of all objects. The opaque object buffer may include a color buffer (Opaque Color RT) and a depth buffer (Opaque DepthRT), which is used to cache the scene rendering data of opaque objects in the overall scene rendering data corresponding to the rendered current frame, which may specifically include the color information and depth information of all opaque objects.

[0142] In a specific embodiment, Figure 8 As shown in the figure, it is a schematic diagram and a data reading diagram of the rendering buffer corresponding to the Nth frame, the N+1th frame and the N+2th frame respectively. Among them, the single rendering channel corresponding to each frame is bound to five rendering targets. Three of them are the overall scene buffers, including the color buffer (Color RT) and the merged buffer (Depth&Stencil RT) including the depth buffer and the template buffer, which are used to cache the color information, depth information and template information of all objects in the current frame. Among them, Stencil is a Mask tag, which occupies 8 bits and is used to achieve some special rendering effects. The other two RTs are opaque object buffers, including a color buffer (Opaque Color RT) and a depth buffer (Opaque Depth RT), which respectively save the color and depth of opaque objects as the input of the next frame.

[0143] Reference Figure 8 , the rendering buffer corresponding to the Nth frame includes the overall scene buffer 80a and the opaque object buffer 80b; the rendering buffer corresponding to the N+1th frame includes the overall scene buffer 81a and the opaque object buffer 81b; the rendering buffer corresponding to the N+2th frame includes the overall scene buffer 82a and the opaque object buffer 82b. When the N+1th frame obtains the historical scene rendering data corresponding to the opaque object from the Nth frame, the required historical scene rendering data is read from the color buffer (Opaque Color RT) and the depth buffer (Opaque Depth RT) in the opaque object buffer 80b. When the N+2th frame obtains the historical scene rendering data corresponding to the opaque object from the N+1th frame, the required historical scene rendering data is read from the color buffer (Opaque Color RT) and the depth buffer (Opaque Depth RT) in the opaque object buffer 81b.

[0144] Since the hardware in the terminal limits the same buffer from being read and written at the same time, the two buffers in the opaque object buffer can be read in a Pingpong manner, which can be expressed as a data reading manner similar to the Ping-Pong attribute. For example, in the current frame, the m buffer can be read and the n buffer can be written, and in the next frame, the n buffer can be read and the m buffer can be written.

[0145] In one embodiment, if Fig. 9 As shown, it is a schematic diagram of reading scene data from the previous frame when processing the current frame. Among them, the Nth frame is the current frame, the N-1th frame is the previous frame, and the rendering buffer bound to the single rendering channel corresponding to the previous frame includes the overall scene buffer 90a and the opaque object buffer 90b. The overall scene buffer 90a caches the overall scene rendering data after rendering corresponding to the previous frame, and the opaque object buffer 90b caches the scene rendering data of the opaque objects in the overall scene rendering data after rendering corresponding to the previous frame. The rendering buffer bound to the single rendering channel corresponding to the current frame includes the overall scene buffer 91a and the opaque object buffer 91b. In the process of rendering the current frame, the terminal reads the historical scene rendering data of the opaque objects in the overall scene rendering data after rendering corresponding to the previous frame from the opaque object buffer 90b corresponding to the previous frame, so as to further remap the read historical scene rendering data of the previous frame. Specifically, when the terminal supports the Subsspass function, that is, when a single rendering channel includes a sub-rendering channel, if the current frame includes a refraction effect area, such as rendering the water surface, the terminal can also read the scene data corresponding to the current frame through the sub-rendering channel to further utilize the scene data corresponding to the current frame to correct the scene data after remapping the historical scene rendering data of the previous frame.

[0146] If the semi-transparent special effect objects in the special effect area included in the current frame include soft particles or decals, if the terminal does not support the Subsspass function, the terminal directly reads the historical scene rendering data of the previous frame for remapping, and uses the remapped historical scene rendering data to render the special effect area. If the terminal supports the Subsspass function, the terminal reads the scene data corresponding to the current frame through the sub-rendering channel to render the special effect area.

[0147] In one embodiment, the color buffer may use the RGB565 image data format to store the color information of the opaque object. It is understandable that the RGB565 image data format does not require high color accuracy, for example, it can be used for reflection rendering and refraction rendering of the water surface. The depth buffer may use the R16f image data format to store the depth information of the opaque object.

[0148] Since different types of graphics interfaces have different support compatibility for the buffer in the graphics processor, for example, in most mainstream graphics interfaces, the support compatibility for DepthBufferFetch (depth buffer read attribute) is not as good as ColorBuffer (color buffer read attribute), such as Metal type graphics interface does not support DepthBufferFetch (depth buffer read attribute). Therefore, in this embodiment, by binding a color buffer (Opaque Color RT) and a depth buffer (Opaque Depth RT) in the rendering channel, the color information and depth information read from the previous frame are cached in the color buffer and the depth buffer respectively, which can effectively solve the problem of support compatibility of different types of graphics interfaces. And the depth buffer can also cache some other information, for example, the depth of a dynamic object or the depth of a static object can be distinguished by a positive and negative sign.

[0149] In this embodiment, by binding multiple buffers to a single rendering channel corresponding to each frame, the overall scene rendering data of the current frame and the scene rendering data of opaque objects in the overall scene rendering data can be cached in the rendering buffer bound to the single rendering channel of the current frame, thereby efficiently rendering opaque objects, specific effect areas and translucent objects in the same rendering channel.

[0150] In one embodiment, based on the overall scene data corresponding to the current frame and the matching historical scene rendering data, the step of rendering opaque objects, specific effect areas and semi-transparent objects in the scene of the current frame in a single rendering channel corresponding to the current frame includes: based on the overall scene data corresponding to the current frame, rendering the opaque objects in the scene of the current frame in the single rendering channel corresponding to the current frame; based on the matching historical scene rendering data, rendering the specific effect areas in the scene of the current frame in the single rendering channel; based on the overall scene data, rendering the semi-transparent objects in the scene of the current frame in the single rendering channel to obtain the overall scene rendering data corresponding to the current frame.

[0151] When the terminal renders each image frame in the three-dimensional scene, it can perform rendering processing through the rendering engine. In the rendering process, the rendering engine needs to use the scene data related to each image frame cached in the rendering buffer. For example, it is necessary to specify how many scene data such as color and depth in the color and depth buffer will be used, how many samplers are used, and how to handle the related content in the entire rendering operation.

[0152] In this embodiment, the scene data required for each image frame can be encapsulated into the object of the rendering channel corresponding to each image frame. Specifically, multiple rendering buffers are bound to the rendering channel, and the scene rendering data corresponding to each rendered image frame is cached in the corresponding rendering buffer. Therefore, in the process of rendering the next frame, the required historical scene rendering data is read from the buffer bound to the single rendering channel corresponding to the current frame to continue rendering the next frame.

[0153] After the terminal obtains the overall scene data required for the current frame to be rendered and the historical scene rendering data matching the specific effect area, the current frame can be rendered.

[0154] Specifically, the terminal first renders the opaque objects in the same single rendering channel, then renders the special effect objects according to the matching historical scene rendering data of the remapped opaque objects, and then renders the translucent objects to obtain the rendering result corresponding to the current frame. Specifically, the terminal renders the opaque objects in the scene of the current frame according to the overall scene data corresponding to the current frame in the same single rendering channel. Then, based on the matching historical scene rendering data, the specific effect area in the scene of the current frame is rendered. Finally, based on the overall scene data, the translucent objects in the scene of the current frame are rendered, so that rendering can be performed efficiently in the same single rendering channel, and the overall scene rendering data corresponding to the current frame can be obtained, and then image frames with specific effects can be efficiently rendered.

[0155] In this embodiment, by rendering opaque bodies, specific effect areas, and translucent objects in the same single rendering channel based on the overall scene data in the rendering buffer and the matching historical scene rendering data in the previous frame, image frames with specific effects can be rendered efficiently, and bandwidth consumption in the rendering process can be effectively reduced.

[0156] In one embodiment, the scene rendering method further includes: when the specific effect area includes a water surface effect area, determining preset scene data matching the water surface effect area according to a preset water surface height. Based on the overall scene data corresponding to the current frame and the matching historical scene rendering data, in a single rendering channel corresponding to the current frame, rendering the opaque objects, the specific effect area, and the semi-transparent objects in the scene of the current frame to obtain the overall scene rendering data corresponding to the current frame includes: when rendering the water surface effect area, based on the matching historical scene rendering data and the preset scene data, rendering the water surface effect area in the scene of the current frame in a single rendering channel.

[0157] The water surface effect area refers to the scene including the water surface in the current frame. The color and transparency of the water surface refer to the color corresponding to the water surface area and the transparency of the water surface area. The preset water surface height may refer to generating corresponding preset water surface height data according to the water surface scene in the pre-set three-dimensional scene.

[0158] Specifically, when the specific effect area includes a water surface effect area, the terminal can directly determine the preset scene data matching the water surface effect area according to the preset water surface height. The preset scene data can specifically be the color and depth of the water surface obtained from the preset water surface height according to the water surface height.

[0159] When rendering the water effect area, the terminal can render the water effect area in the scene of the current frame in a single rendering channel according to the matching historical scene rendering data and preset scene data in the rendering buffer. This makes it possible for the color and transparency of the water effect area in the scene to not depend on the real-time depth, and the water effect area can be rendered more accurately and effectively.

[0160] It is understandable that the color and transparency of the water surface are dependent on the depth. Usually, the color and transparency of the water surface at different depths are different. Therefore, when rendering the water surface effect area using the historical scene rendering data remapped from the previous frame, obvious visual errors may occur. Fig.10 As shown, it is a schematic diagram of a water surface rendered using remapped historical scene rendering data in one embodiment. It can be seen that Fig.10 The visual defect of the water surface edge area 10a is more obvious. Fig.11As shown, it is a schematic diagram of a water surface rendered using remapped historical scene rendering data in one embodiment. It can be seen that Fig.11 Some ghost areas 11a appear in the upper body of the person in the water area in the image.

[0161] Specifically, the color and transparency of the water surface effect area are determined by a pre-generated water surface height map. The water surface color and transparency do not depend on the real-time depth, but are calculated by a pre-generated water surface height map.

[0162] like Fig.12 , which is a schematic diagram of the water surface depth in one embodiment. When the sight direction 1202 corresponding to the camera angle 1201 is toward the water surface 1203 and the ground 1204 under the water surface 1203, the traditional method is to calculate the water surface color and transparency based on the depth difference between the ground 1204 pointed by the sight direction 1202 and the water surface 1203. Fig.13 As shown, it is a schematic diagram of determining the depth of the water surface in this embodiment. Since the height difference between the static object and the water surface is stored in advance. When the sight direction 1302 corresponding to the camera angle of view 1301 is toward the water surface 1303, and points to the ground 1304 under the water surface 1303, the corresponding query coordinates are calculated according to the angle between the camera angle of view 1301 and the water surface 1303 of the current frame. According to this query coordinate, the water surface height corresponding to the water surface position can be obtained from the preset water surface height data, and the vertical height difference 1304 between the water surface and the ground is obtained. The length 1305 of the projection of this height difference in the sight direction is different from the length in the actual sight direction. By obtaining the color depth information that matches the water surface position from the preset water surface height and rendering, it can be ensured that the rendering result of the water surface effect area is more accurate.

[0163] The terminal can pre-store the height difference between the static object and the water surface, such as Fig.14 FIG. 1 is a schematic diagram of a preset water surface height pre-stored in one embodiment. Fig.14 The middle is a scene including water area and island map. In the water height map in the map, the darker the color, the shallower the water surface height, and the lighter the color, the deeper the water surface height. Among them, because there may be dynamic objects with water surface, the color of pure land is also light.

[0164] In a specific embodiment, Fig.15 As shown in FIG. 1 , a schematic diagram of a water surface effect area rendered using a traditional method is shown. It can be seen that there are defects in the refraction effect of the water surface and the effect of the edge of the water surface. Fig.16 As shown, it is a schematic diagram of the water surface effect area rendered by the above method. It can be seen that the refraction effect of the water surface and the effect of the water surface edge are better.

[0165] In this embodiment, by searching the preset scene data matching the water surface effect area from the preset water surface height data according to the viewing angle in the current frame and the angle of the water surface, that is, the water surface color and depth information, the water surface effect area in the scene of the current frame is rendered in a single rendering channel. As a result, the color and transparency corresponding to the water surface effect area in the scene do not need to depend on the real-time depth, and the water surface effect area can be rendered more accurately and effectively.

[0166] In one embodiment, Fig.17 As shown, another scene rendering method is provided, which specifically includes the following steps:

[0167] S1702, when the scene of the current frame to be rendered includes a specific effect area, the specific effect area is the area corresponding to the target opaque object, and the target opaque object is the opaque object covered by the semi-transparent special effect object in the current frame, then the historical scene rendering data of the opaque object in the rendering buffer bound to the single rendering channel corresponding to the previous frame is obtained.

[0168] S1704, determining historical scene rendering data that matches the specific effect area in the historical scene rendering data; the matched historical scene rendering data is the first scene rendering data sampled based on the remapped sampling coordinates.

[0169] S1706: If the single rendering channel corresponding to the current frame includes a sub-rendering channel, obtain scene data of the current frame corresponding to the specific effect area through the sub-rendering channel.

[0170] S1708 , based on the overall scene data corresponding to the current frame, render the opaque objects in the scene of the current frame in a single rendering channel.

[0171] S1710, when rendering the specific effect area, determine target scene data corresponding to the specific effect area according to scene data of the current frame corresponding to the specific effect area and first scene rendering data.

[0172] S1712: Render a specific effect area in the scene of the current frame in a single rendering pass based on the target scene data.

[0173] S1714: Render the semi-transparent objects in the scene of the current frame in a single rendering pass based on the overall scene data.

[0174] S1716, writing the overall scene rendering data obtained after rendering the current frame and the scene rendering data of the opaque objects in the overall scene rendering data into the rendering buffer bound to the single rendering channel corresponding to the current frame.

[0175] Among them, a sub-rendering channel can refer to a rendering channel attached to a single rendering channel, and a sub-rendering channel can also realize the functions of a single rendering channel. For example, for rendering engines corresponding to different types of graphics interfaces and different types of graphics processors, some rendering engines can support opening sub-rendering channels in a single rendering channel for rendering processing, while some cannot support the function of sub-rendering channels.

[0176] For example, for a rendering engine corresponding to a Vulkan-type graphics interface, the Subpass function can be enabled in a single RenderPass rendering channel, but it does not really open a separate Pass, but is still in this RenderPass. However, through this Subpass, scene data such as the depth and color information of the current frame and the current rendered pixel can be obtained, and some functions that require another Pass to be realized can be realized. In this embodiment, the Subpass sub-rendering channel can be used to perform corrections simultaneously during the rendering process.

[0177] When the terminal is rendering an image frame, when the scene of the current frame to be rendered includes a specific effect area, the terminal obtains the first scene rendering data sampled based on the remapped sampling coordinates from the historical scene rendering data of the opaque object in the previous frame, and caches the first scene rendering data in a rendering buffer bound to the single rendering channel of the current frame.

[0178] In the case of having a sub-rendering channel function, the terminal can obtain the scene data of the current frame corresponding to the specific effect area through the sub-rendering channel. The terminal can also obtain the scene data of the current pixel required in the current frame through the sub-rendering channel.

[0179] The terminal then renders the opaque objects, specific effect areas and translucent objects in the scene of the current frame in a single rendering channel based on the overall scene data and the first scene rendering data corresponding to the current frame, and the scene data of the current frame corresponding to the specific effect area.

[0180] Specifically, the terminal first renders the opaque objects in the scene of the current frame in a single rendering pass according to the overall scene data in the rendering buffer.

[0181] It can be understood that the target scene data may refer to the scene data ultimately used to render the specific effect area. When rendering the specific effect area, the terminal determines the target scene data corresponding to the specific effect area based on the scene data of the current frame corresponding to the specific effect area and the first scene rendering data. Specifically, the error pixels in the first scene rendering data may be corrected using the scene data corresponding to the specific effect area in the current frame, thereby obtaining the target scene data corresponding to the specific effect area.

[0182] The terminal then renders the specific effect area in the scene of the current frame in a single rendering pass based on the target scene data. Finally, according to the overall scene data, the terminal renders the semi-transparent objects in the scene of the current frame in a single rendering pass.

[0183] In one of the embodiments, when the specific effect area in the current frame includes a water surface reflection area, the water surface reflection area can be directly rendered according to the first scene rendering data sampled based on the remapped sampling coordinates. When the specific effect area in the current frame includes a water surface refraction area, the target scene data corresponding to the water surface refraction area is determined according to the scene data of the current frame corresponding to the specific effect area and the remapped first scene rendering data, so as to render the water surface refraction area according to the target scene data.

[0184] In this embodiment, when a single rendering channel includes a sub-rendering channel, the scene data of the current frame corresponding to the specific effect area is obtained through the sub-rendering channel, and the target scene data of the specific effect area is determined in combination with the first scene rendering data obtained based on remapping sampling from the historical data in the previous frame, so as to render the specific effect area. This can not only effectively reduce the bandwidth consumption during the rendering process, but also effectively improve the rendering accuracy of the specific effect area.

[0185] In one embodiment, the step of determining target scene data corresponding to a specific effect area based on scene data of a current frame corresponding to the specific effect area and first scene rendering data includes: when the specific effect area includes a refraction effect area, determining the pixel to be corrected corresponding to the first scene rendering data; replacing the scene data corresponding to the pixel to be corrected in the first scene rendering data with the scene data corresponding to the pixel to be corrected in the scene data of the current frame corresponding to the specific effect area, to obtain the corresponding target scene data of the specific effect area.

[0186] Among them, the pixels to be corrected may refer to the pixels with defects in the rendering result of rendering a specific effect area based on the first scene rendering data, such as pixels with defects such as missing pixels and object ghosting. These pixels are the pixels to be corrected that need to be corrected.

[0187] It is understandable that, since the rendering process of the refraction effect area is relatively special, when the specific effect area includes the refraction effect area, there may be defects in rendering the refraction effect area using the first scene rendering data obtained by remapping the previous frame.

[0188] After the terminal obtains the scene data of the current frame corresponding to the specific effect area through the sub-rendering channel in the single rendering channel, the terminal determines the target scene data corresponding to the specific effect area based on the first scene rendering data obtained by remapping the previous frame and the scene data of the current frame corresponding to the specific effect area. For example, the terminal can use the scene data of the current frame corresponding to the specific effect area to correct the pixel points to be corrected that have errors in the remapped first scene rendering data.

[0189] Specifically, the terminal may first determine the scene data of each pixel in the specific effect area using the first scene rendering data obtained by remapping the previous frame. The terminal then detects the pixel to be corrected that has defects in each pixel in the specific effect area. Then, the scene data corresponding to the pixel to be corrected in the scene data of the current frame corresponding to the specific effect area is used to replace the scene data corresponding to the pixel to be corrected in the first scene rendering data, and obtain the target scene data corresponding to the specific effect area.

[0190] In another embodiment, the terminal may also first render the specific effect area using the first scene rendering data obtained based on the remapping of the previous frame to obtain a preliminary rendering result corresponding to the specific effect area. The terminal then detects the pixel points to be corrected that have defects in the preliminary rendering result. The terminal then replaces the scene data corresponding to the pixel points to be corrected in the first scene rendering data with the scene data corresponding to the pixel points to be corrected in the scene data of the current frame corresponding to the specific effect area, obtains the target scene data corresponding to the specific effect area, and then uses the target scene data to render the specific effect area to obtain the final scene rendering data corresponding to the specific effect area.

[0191] In one of the embodiments, when the terminal detects that there are pixels to be corrected that are defective in the preliminary rendering results, after obtaining the pixels corresponding to the specific effect area in the current frame based on the remapped first scene rendering data, the pixel to be corrected in the current frame can be determined by detecting the screen coordinates corresponding to each pixel in the current frame and judging the screen coordinate values ​​corresponding to each pixel. For example, when the screen coordinates corresponding to the pixel in the current frame are less than 0 or greater than 1, it indicates that the pixel is in the wrong position, and the pixel is determined as the pixel to be corrected. For example, referring to the above Figure 4 In the water scene in the video, there are wire-drawing defects at the edge of the water surface, indicating that the pixel positions of these pixels are wrong. In this case, the terminal can use the scene data corresponding to the current frame to fill in the pixels to be corrected, that is, replace these pixels with the scene data at the corresponding position in the current frame.

[0192] like Fig.18FIG. 1 is a schematic diagram of correcting the corresponding pixels to be corrected in the area 18a and the area 18b where the pixel positions in the water surface area are wrong by using the method of this embodiment, referring to FIG. Fig.18 The edge of the water surface area is marked with dark colors, which is the effect after the scene data at the corresponding position in the current frame is filled in.

[0193] In this embodiment, by using the scene data of the current frame corresponding to the specific effect area, the pixel points to be corrected that have defects in the first scene rendering data based on remapping are corrected, which can effectively improve the accuracy of scene rendering.

[0194] In one embodiment, determining the pixel to be corrected corresponding to the first scene rendering data in the rendering buffer includes: when the first depth value is greater than the second depth value, determining that the pixel is a pixel to be corrected; wherein the first depth value is the depth value of the pixel in the first scene rendering data; and the second depth value is the depth value of the refraction interface in the scene data of the current frame corresponding to the specific effect area.

[0195] The first depth value refers to the depth value of the refraction interface pixel in the first scene rendering data obtained by remapping from the historical scene rendering data in the previous frame. The second depth value refers to the depth value of the refraction interface in the scene data of the current frame corresponding to the specific effect area. For example, the refraction interface may include scenes such as water surface.

[0196] It is understandable that the rendering buffer may include a depth buffer. The depth buffer stores the depth information of the pixel, which reflects the distance from the object to the observation point and can be used to calculate the occlusion between objects. During the rendering process, the interpolated depth of each pixel can be calculated. Before rendering the pixel, this depth value is compared with the depth value of the pixel in the depth buffer. If the new depth is farther from the observation point than the existing value, it means that this part of the pixel may have defects, and the new pixel needs to be discarded.

[0197] When detecting pixels to be corrected that have defects among the pixels in the specific effect area, the terminal determines the pixels to be corrected in the specific effect area according to the first depth value and the second depth value.

[0198] Specifically, when the first depth value is greater than the second depth value, it means that the depth value of the refraction interface pixel in the remapped first scene rendering data is closer than the depth value of the refraction interface in the scene data of the current frame corresponding to the specific effect area, indicating that this part of the pixels should be above the refraction interface and should not be refracted. Therefore, the terminal determines the part of the pixels whose first depth value is greater than the second depth value as the pixels to be corrected. Then, the scene data of the current frame corresponding to the specific effect area is used to replace this part of the pixels to be corrected, so as to obtain the target scene data of the specific effect area with higher rendering accuracy.

[0199] In one embodiment, determining a pixel to be corrected corresponding to first scene rendering data in a rendering buffer includes: determining a first depth difference between a first depth value and a second depth value; sampling second scene rendering data matching a specific effect area from historical scene rendering data based on a sampling coordinate offset; determining a second depth difference between the first scene rendering data and the second scene rendering data for the same pixel; and determining that the pixel is a pixel to be corrected when the first depth difference is greater than or equal to a first threshold and the second depth difference is greater than or equal to a second threshold.

[0200] The depth difference may refer to an error value obtained by comparing two depth information.

[0201] It can be understood that the first scene rendering data is historical scene rendering data matching the specific effect area obtained by sampling from the historical scene rendering data in the previous frame based on remapping. The second scene rendering data is historical scene rendering data matching the specific effect area sampled from the historical scene rendering data based on the sampling coordinate offset.

[0202] When the terminal detects pixels to be corrected that have defects in the pixels of a specific effect area, it can also compare the first scene rendering data and the second scene rendering data obtained by sampling from the previous frame in different ways with the depth value of the scene data in the current frame to determine the pixels to be corrected in the specific effect area.

[0203] It can be understood that the first threshold and the second threshold may be the same or different.

[0204] Specifically, the terminal may first determine the first depth difference between the first depth value and the second depth value, and then determine the second depth difference of the same pixel in the first scene rendering data and the second scene rendering data. The terminal further judges the first depth difference and the second depth difference. Specifically, when the first depth difference is greater than or equal to the first threshold, and the second depth difference is greater than or equal to the second threshold, it means that the depth value in the first scene rendering data is much closer than the depth value in the scene data of the current frame corresponding to the specific effect area, indicating that ghosting occurs in this part of the pixels, and then this part of the pixels is determined to be the pixels to be corrected. And when the second depth difference is greater than or equal to the second threshold, it means that the degree of distortion of this part of the pixels is not enough, and then this part of the pixels is determined to be the pixels to be corrected. If the second depth difference is not large enough, it means that the contour of the object corresponding to this part of the pixels is distorted, and the pixels with distorted contours may not be determined as pixels to be corrected.

[0205] In this embodiment, by utilizing the scene data corresponding to the specific effect area in the current frame, the pixel points to be corrected that have defects in the first scene rendering data based on remapping are corrected. This not only can accurately correct the pixel points with defects, but also can effectively render the contour distortion effect of the refraction effect area, which can effectively improve the accuracy of scene rendering.

[0206] In a specific embodiment, when the specific effect area includes a refraction effect area, if the refraction effect area is rendered based on first scene rendering data remapped from historical scene rendering data in a previous frame, erroneous object ghosting may occur.

[0207] For example, taking the refraction effect area as the water surface effect area, the first scene rendering data obtained by remapping the historical scene rendering data in the previous frame is used to render the water surface effect area. Fig.19 As shown, the water surface effect area includes characters, underwater ground and water surface, and an erroneous object ghosting area 19a appears in the rendered water surface area.

[0208] In this case, the terminal can use the scene data of the current frame to fill in the erroneous pixels. For example, the defective pixels to be corrected can be corrected step by step by step filling.

[0209] (1) First, remove the ghost image of the part of the opaque object on the horizontal plane.

[0210] Specifically, the terminal first determines which pixels are the pixels to be corrected. The ghosting pixels on the horizontal plane can be determined by the following expression:

[0211] bool miss=deviceReprojZ>waterZ;

[0212] Wherein, bool miss represents the pixel to be corrected, deviceReprojZ represents the depth value of the refraction interface pixel in the first scene rendering data remapped from the historical scene rendering data in the previous frame, and waterZ represents the depth value of the refraction interface in the scene data corresponding to the current frame.

[0213] When deviceReprojZ is greater than waterZ, it means that the depth value obtained based on the remapped first scene rendering data is closer to the depth value of the water surface pixel, indicating that this part should be on the water surface and should not be refracted, and it is determined to be a pixel to be corrected. And the scene data of the pixel to be corrected is replaced with the scene data of the corresponding position in the current frame to remove the ghost on the water surface. Fig. 20 FIG. 2 is a schematic diagram showing the removal of the ghost image defect on the water surface, but there is still a partial ghost image area 20 a of the object below the horizontal plane.

[0214] (2) Then, the terminal further removes the ghost of the object below the horizontal plane. The pixel points of the ghost below the horizontal plane can be determined by the following expression:

[0215] miss||=(deviceReprojZ–deviceZ)>Threshold;

[0216] Among them, miss represents the pixel to be corrected, and Threshold is a preset threshold value, which is used to determine the difference between the depth value of the refraction interface pixel in the remapped first scene rendering data and the depth value of the refraction interface in the scene data corresponding to the current frame.

[0217] If the difference between deviceReprojZ and deviceZ is greater than the preset threshold, that is, the depth value obtained based on the remapped scene data is much closer than the depth value in the scene data of the current frame, it means that this pixel should have been withdrawn in the previous frame, and this part of the pixels to be corrected needs to be removed. Fig.21 , which is a schematic diagram after removing the ghost area 21a under the water surface. However, after removing the ghost in this way, the lower body area 22a of the dynamic object may be incomplete, such as Fig. 22 shown.

[0218] (3) In this case, the terminal can further fill in the missing parts of the dynamic object. Specifically, the missing pixels of the dynamic object can be determined by the following expression:

[0219] miss||=deviceReprojZ <deviceZ;

[0220] When deviceReprojZ is less than deviceZ, it means that the depth value obtained based on the remapped first scene rendering data is farther than the depth value in the scene data of the current frame, indicating that this part of the pixels is missing, and it is necessary to use the scene data of the corresponding pixels in the current frame to fill them. Fig.23 As shown in FIG. 1 , it is a schematic diagram of filling the pixels of dynamic objects in the scene. However, after filling the dynamic objects in this way, Fig.24 As shown, the distortion effect of this object may be weakened when it is stationary, that is, the outline underwater will not be distorted.

[0221] (4) In order to improve the contour distortion effect, the terminal can modify step (2) and add a judgment condition so that the pixels with distorted object contours are not judged as pixels to be corrected. Specifically, the judgment can be made through the following expression:

[0222] miss||=(deviceReprojZ–deviceZ)>Threshold

[0223] &&abs(deviceLastZ-deviceReprojZ)>Threshold;

[0224] Among them, deviceLastZ represents the depth value of the historical scene rendering data matching the specific effect area sampled from the historical scene rendering data based on the sampling coordinate offset, that is, the depth value of the second scene rendering data. deviceReprojZ is the depth value of the first scene rendering data. Threshold is the preset threshold.

[0225] If the first depth difference between the first depth value and the second depth value is greater than a preset threshold, it means that the depth value in the first scene rendering data is much closer than the depth value in the scene data of the current frame, indicating that ghosting occurs in these pixels. If the second depth difference between the depth value of the second scene rendering data and the depth value of the first scene rendering data is not large enough, it is a distortion of the contour. The terminal will determine the pixels that meet both conditions as pixels to be corrected. Fig.25 As shown in the figure, the distortion effect obtained by traditional rendering is shown. Fig.26 As shown, this is the rendering effect obtained by rendering in the manner of this embodiment.

[0226] Furthermore, if Fig. 27FIG. 1 is a schematic diagram of an object in high-speed motion on the water surface after rendering in one embodiment. When an object with animation moves at high speed and the frame rate is low, a small-scale residual image will appear under the water surface. Thus, even when the object moves at high speed and the frame rate is low, a high-precision overall rendering effect can be rendered.

[0227] The present application also provides an application scenario, which is a three-dimensional game scene, and the game scene applies the above-mentioned scene rendering method. Specifically, a three-dimensional game application can be run in the terminal, and when the three-dimensional game application is running, the terminal renders continuous image frames in the three-dimensional game scene. Among them, the three-dimensional game scene can be a three-dimensional virtual scene, which may include scenes such as opaque objects, translucent objects, and special effect areas. The special effect area is the area corresponding to the target opaque object, and the target opaque object is the opaque object covered by the translucent special effect object in the current frame. For example, the specific effects of the game scene may include at least one of water surface reflection, water surface refraction, rain, glass, soft particles, decals, etc.

[0228] Specifically, when the three-dimensional game scene of the current frame to be rendered includes a specific effect area, the historical scene rendering data of the opaque objects in the single rendering channel corresponding to the previous frame is obtained. By determining the historical scene rendering data that matches the specific effect area in the historical scene rendering data, the historical scene rendering data that matches the specific effect area in the previous frame can be accurately sampled.

[0229] By rendering the opaque objects, specific effect areas, and translucent objects in the scene in one rendering channel, it is possible to efficiently render all objects in the scene in the same rendering channel, thereby effectively obtaining the overall scene rendering data with high rendering accuracy, and writing the overall scene rendering data and the scene rendering data of the opaque objects in the overall scene rendering data into the rendering buffer bound to the single rendering channel corresponding to the current frame, thereby efficiently and accurately rendering image frames with specific effects. At the same time, it effectively reduces the bandwidth pressure in the rendering process, thereby effectively reducing the resource consumption in the game operation and picture rendering process, and can also effectively improve the operation efficiency of three-dimensional game applications.

[0230] The present application also provides an application scenario, which is a three-dimensional environment demonstration scene, such as a tourism environment demonstration scene, a building demonstration scene, etc., and the three-dimensional environment demonstration scene applies the above scene rendering method. The three-dimensional environment demonstration scene can be rendered by a terminal or a demonstration screen with an image rendering function.

[0231] Specifically, the three-dimensional demonstration scene can be pre-loaded locally in the terminal and then rendered, or it can be obtained from the server in real time and rendered. The three-dimensional environment demonstration scene can include continuous image frames with a preset frame sequence, or it can render image frames of any scene by controlling the virtual perspective in the three-dimensional environment demonstration scene. Among them, the three-dimensional environment demonstration scene can also include scenes such as opaque objects, translucent objects, and special effect areas. The special effect area is the area corresponding to the target opaque object, and the target opaque object is the opaque object covered by the translucent special effect object in the current frame. For example, the specific effects in the game scene can include at least one of water surface reflection, water surface refraction, rain, glass, soft particles, decals, etc.

[0232] Specifically, when the three-dimensional environment demonstration scene of the current frame to be rendered includes a specific effect area, the historical scene rendering data of the opaque object in the previous frame is obtained. By determining the historical scene rendering data that matches the specific effect area in the historical scene rendering data, the historical scene rendering data that matches the specific effect area in the previous frame can be accurately sampled.

[0233] By rendering the opaque objects, specific effect areas, and translucent objects in the scene in one rendering channel, it is possible to efficiently render all objects in the scene in the same rendering channel, thereby effectively obtaining the overall scene rendering data with high rendering accuracy, and writing the overall scene rendering data and the scene rendering data of the opaque objects in the overall scene rendering data into the rendering buffer bound to the single rendering channel corresponding to the current frame, thereby efficiently and accurately rendering image frames with specific effects. This can effectively ensure the rendering accuracy of the three-dimensional environment demonstration scene while effectively reducing the bandwidth pressure in the rendering process, thereby effectively reducing the resource consumption in the rendering process.

[0234] It should be understood that although Figure 2 , 17 The steps in the flowchart are shown in sequence as indicated by the arrows, but the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of the steps, and the steps can be executed in other orders. Moreover, Figure 2 , 17 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0235] In one embodiment, Fig.28 As shown, a scene rendering device 2800 is provided. The device can adopt a software module or a hardware module, or a combination of the two to become a part of a computer device. The device specifically includes: a data acquisition module 2802 and a scene rendering module 2804, wherein:

[0236] Data acquisition module 2802 is used to obtain historical scene rendering data of the opaque object in a single rendering channel corresponding to the previous frame when the scene of the current frame to be rendered includes a specific effect area, the specific effect area is the area corresponding to the target opaque object, and the target opaque object is the opaque object covered by the semi-transparent special effect object in the current frame; determine the historical scene rendering data that matches the specific effect area in the historical scene rendering data.

[0237] The scene rendering module 2804 is used to render the opaque objects, specific effect areas and translucent objects in the scene of the current frame in a single rendering channel corresponding to the current frame based on the overall scene data corresponding to the current frame and the matching historical scene rendering data.

[0238] In one embodiment, the data acquisition module 2802 is also used to determine the sampling position corresponding to the specific effect area in the previous frame; sample the historical scene rendering data according to the sampling position to obtain the historical scene rendering data that matches the specific effect area in the historical scene rendering data.

[0239] In one embodiment, the data acquisition module 2802 is also used to determine the three-dimensional scene position corresponding to the specific effect area based on the projection matrix corresponding to the current frame; perform position transformation based on the three-dimensional scene position and the projection matrix corresponding to the previous frame to obtain the sampling coordinates corresponding to the remapped specific effect area in the previous frame.

[0240] In one embodiment, the data acquisition module 2802 is also used to determine the camera viewing angle and the reflection position of the reflection effect area in the current frame according to the projection matrix corresponding to the current frame when the specific effect area includes a reflection effect area; determine the symmetric reflection ray according to the camera viewing angle and the reflection position of the reflection effect area in the current frame; and determine the three-dimensional scene position corresponding to the reflection effect area according to the symmetric reflection ray.

[0241] In one embodiment, the data acquisition module 2802 is also used to determine the sampling coordinate offset according to the camera viewing angle in the current frame and the normal direction corresponding to the refraction effect area when the specific effect area includes a refraction effect area; and determine the sampling position corresponding to the refraction effect area in the previous frame according to the sampling coordinate offset.

[0242] In one embodiment, the data acquisition module 2802 is also used to obtain historical scene rendering data of opaque objects in the rendering buffer bound to the single rendering channel corresponding to the previous frame; the above-mentioned scene rendering device also includes a data cache module, which is used to write the overall scene rendering data obtained after rendering the current frame, and the scene rendering data of the opaque objects in the overall scene rendering data, into the rendering buffer bound to the single rendering channel corresponding to the current frame.

[0243] In one embodiment, the rendering buffer includes an overall scene buffer and an opaque object buffer; the data acquisition module 2802 is also used to obtain the historical scene rendering data of the opaque objects in the previous frame from the opaque object buffer bound to the single rendering channel corresponding to the previous frame; the data cache module 2706 is also used to cache the overall scene rendering data obtained after rendering the current frame into the overall scene buffer bound to the single rendering channel of the current frame; and cache the scene rendering data of the opaque objects in the overall scene rendering data into the opaque object buffer bound to the single rendering channel of the current frame.

[0244] In one embodiment, the scene rendering module 2804 is also used to render opaque objects in the scene of the current frame in a single rendering channel corresponding to the current frame based on the overall scene data corresponding to the current frame; render specific effect areas in the scene of the current frame in a single rendering channel based on the matching historical scene rendering data; and render semi-transparent objects in the scene of the current frame in a single rendering channel based on the overall scene data to obtain the overall scene rendering data corresponding to the current frame.

[0245] In one embodiment, the data acquisition module 2802 is also used to determine the preset scene data matching the water surface effect area according to the preset water surface height when the specific effect area includes a water surface effect area; the scene rendering module 2804 is also used to render the water surface effect area in the scene of the current frame in a single rendering channel based on the matching historical scene rendering data and the preset scene data when rendering the water surface effect area.

[0246] In one embodiment, the matched historical scene rendering data is the first scene rendering data sampled based on the remapped sampling coordinates; the data acquisition module 2802 is also used to obtain the scene data of the current frame corresponding to the specific effect area through the sub-rendering channel if the single rendering channel corresponding to the current frame includes a sub-rendering channel; cache the scene data of the current frame in the rendering buffer; the scene rendering module 2804 is also used to determine the target scene data corresponding to the specific effect area when rendering the specific effect area, according to the scene data in the current frame corresponding to the specific effect area and the first scene rendering data; based on the target scene data, render the specific effect area in the scene of the current frame in the single rendering channel.

[0247] In one embodiment, the scene rendering module 2804 is also used to determine the pixel points to be corrected corresponding to the first scene rendering data when the specific effect area includes a refraction effect area; replace the scene data corresponding to the pixel points to be corrected in the first scene rendering data according to the scene data corresponding to the pixel points to be corrected in the scene data of the current frame corresponding to the specific effect area, and obtain the target scene data of the specific effect area.

[0248] In one embodiment, the scene rendering module 2804 is also used to determine a first depth difference between a first depth value and a second depth value; based on a sampling coordinate offset, sample second scene rendering data that matches a specific effect area from historical scene rendering data; determine a second depth difference between the first scene rendering data and the second scene rendering data for the same pixel; when the first depth difference is greater than or equal to a first threshold and the second depth difference is greater than or equal to a second threshold, determine that the pixel is a pixel to be corrected.

[0249] For the specific definition of the scene rendering device, please refer to the definition of the scene rendering method above, which will not be repeated here. Each module in the above-mentioned scene rendering device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0250] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.29 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a scene rendering method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0251] Those skilled in the art will understand that Fig.29The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0252] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0253] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0254] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.

[0255] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0256] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0257] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A scene rendering method, characterized in that: The method comprises: When the scene of the current frame to be rendered includes a special effect area, the special effect area is the area corresponding to the target opaque object, and the target opaque object is the opaque object covered by the semi-transparent special effect object in the current frame, then Obtaining historical scene rendering data of the opaque objects in the previous frame from the opaque object buffer bound to the single rendering channel corresponding to the previous frame; Determine historical scene rendering data that matches the specific effect area in the historical scene rendering data; Based on the overall scene data corresponding to the current frame and the matched historical scene rendering data, in a single rendering channel corresponding to the current frame, rendering the opaque objects, the specific effect area, and the semi-transparent objects in the scene of the current frame, including: based on the overall scene data corresponding to the current frame, rendering the opaque objects in the scene of the current frame in the single rendering channel corresponding to the current frame; based on the matched historical scene rendering data, rendering the specific effect area in the scene of the current frame in the single rendering channel; based on the overall scene data, rendering the semi-transparent objects in the scene of the current frame in the single rendering channel, to obtain the overall scene rendering data corresponding to the current frame; The overall scene rendering data is cached in an overall scene buffer bound to a single rendering channel of the current frame, and the scene rendering data of opaque objects in the overall scene rendering data is cached in an opaque object buffer bound to a single rendering channel of the current frame.

2. The method according to claim 1, characterized in that The determining the historical scene rendering data matching the specific effect area in the historical scene rendering data includes: Determine a sampling position corresponding to the specific effect area in the previous frame; The historical scene rendering data is sampled and processed according to the sampling position to obtain historical scene rendering data matching the specific effect area in the historical scene rendering data.

3. The method according to claim 2, characterized in that The sampling position includes a sampling coordinate; and determining the sampling position corresponding to the specific effect area in the previous frame includes: Determine the three-dimensional scene position corresponding to the specific effect area according to the projection matrix corresponding to the current frame; A position transformation is performed according to the three-dimensional scene position and the projection matrix corresponding to the previous frame to obtain the sampling coordinates corresponding to the remapped specific effect area in the previous frame.

4. The method according to claim 3, characterized in that The determining, according to the projection matrix corresponding to the current frame, a three-dimensional scene position corresponding to the specific effect area includes: When the specific effect area includes a reflection effect area, determining the camera viewing angle in the current frame and the reflection position of the reflection effect area according to the projection matrix corresponding to the current frame; Determining a symmetrical reflection ray according to the camera viewing angle in the current frame and the reflection position of the reflection effect area; A three-dimensional scene position corresponding to the reflection effect area is determined according to the symmetrical reflection ray.

5. The method according to claim 2, characterized in that: The determining of the sampling position corresponding to the specific effect area in the previous frame includes: When the specific effect area includes a refraction effect area, determining a sampling coordinate offset according to the camera viewing angle in the current frame and a normal direction corresponding to the refraction effect area; The sampling position corresponding to the refraction effect area in the previous frame is determined according to the sampling coordinate offset.

6. The method according to claim 1, characterized in that The method further comprises: When the specific effect area includes a water surface effect area, determining preset scene data matching the water surface effect area according to a preset water surface height; The rendering of the opaque objects, the specific effect areas, and the semi-transparent objects in the scene of the current frame in a single rendering channel corresponding to the current frame based on the overall scene data corresponding to the current frame and the matched historical scene rendering data includes: When rendering the water surface effect area, the water surface effect area in the scene of the current frame is rendered in the single rendering channel based on the matched historical scene rendering data and the preset scene data.

7. The method according to claim 6, characterized in that The step of determining preset scene data matching the water surface effect area according to the preset water surface height includes: According to the angle between the camera viewing angle in the current frame and the water surface in the water surface effect area, preset scene data matching the water surface effect area is determined from the preset water surface height.

8. The method according to claim 1, characterized in that The matched historical scene rendering data is first scene rendering data sampled based on the remapped sampling coordinates; the method further includes: If the single rendering pass corresponding to the current frame includes a sub-rendering pass, acquiring scene data of the current frame corresponding to the specific effect area through the sub-rendering pass; The rendering of the opaque objects, the specific effect areas, and the semi-transparent objects in the scene of the current frame in a single rendering channel corresponding to the current frame based on the overall scene data corresponding to the current frame and the matched historical scene rendering data includes: When rendering the specific effect area, determining target scene data corresponding to the specific effect area according to the scene data of the current frame corresponding to the specific effect area and the first scene rendering data; Based on the target scene data, the specific effect area in the scene of the current frame is rendered in the single rendering pass.

9. The method according to claim 8, characterized in that The determining, according to the scene data of the current frame corresponding to the specific effect area and the first scene rendering data, target scene data corresponding to the specific effect area comprises: When the specific effect area includes a refraction effect area, determining a pixel point to be corrected corresponding to the first scene rendering data; According to the scene data corresponding to the pixel to be corrected in the scene data of the current frame corresponding to the specific effect area, the scene rendering data corresponding to the pixel to be corrected in the first scene rendering data is replaced to obtain the target scene data corresponding to the specific effect area.

10. The method according to claim 9, characterized in that The determining the pixel point to be corrected corresponding to the first scene rendering data includes: Determine a first depth difference between a first depth value and a second depth value; the first depth value is a depth value of a pixel point in the first scene rendering data, and the second depth value is a depth value of a refraction interface in the scene data of the current frame corresponding to the specific effect area; Based on the sampling coordinate offset, sampling second scene rendering data matching the specific effect area from the historical scene rendering data; Determine a second depth difference between the pixel point in the first scene rendering data and the second scene rendering data; When the first depth difference is greater than or equal to a first threshold and the second depth difference is greater than or equal to a second threshold, the pixel is determined to be a pixel to be corrected.

11. The method according to claim 9, characterized in that The determining the pixel point to be corrected corresponding to the first scene rendering data includes: When the first depth value is greater than the second depth value, the first depth value is the depth value of the pixel point in the first scene rendering data, and the second depth value is the depth value of the refraction interface in the scene data of the current frame corresponding to the specific effect area, then the pixel point is determined to be a pixel point to be corrected.

12. The method according to claim 9, characterized in that The determining the pixel point to be corrected corresponding to the first scene rendering data includes: determining the pixel point to be corrected corresponding to the first scene rendering data according to the screen coordinates corresponding to the pixel point in the first scene rendering data.

13. A scene rendering device, characterized in that: The device comprises: A data acquisition module, for, when a scene of a current frame to be rendered includes a specific effect area, the specific effect area is an area corresponding to a target opaque object, and the target opaque object is an opaque object covered by a semi-transparent special effect object in the current frame, then acquiring historical scene rendering data of the opaque object in the previous frame from an opaque object buffer bound to a single rendering channel corresponding to the previous frame; and determining historical scene rendering data that matches the specific effect area in the historical scene rendering data; A scene rendering module, for rendering, in a single rendering channel corresponding to the current frame, opaque objects, the specific effect area, and translucent objects in the scene of the current frame based on the overall scene data corresponding to the current frame and the matched historical scene rendering data, comprising: rendering the opaque objects in the scene of the current frame in the single rendering channel corresponding to the current frame based on the overall scene data corresponding to the current frame; rendering the specific effect area in the scene of the current frame in the single rendering channel based on the matched historical scene rendering data; rendering the translucent objects in the scene of the current frame in the single rendering channel based on the overall scene data, to obtain the overall scene rendering data corresponding to the current frame; A data caching module is used to cache the overall scene rendering data in an overall scene buffer bound to the single rendering channel of the current frame, and cache the scene rendering data of opaque objects in the overall scene rendering data in an opaque object buffer bound to the single rendering channel of the current frame.

14. The device according to claim 13, characterized in that The data acquisition module is also used for: Determine a sampling position corresponding to the specific effect area in the previous frame; The historical scene rendering data is sampled and processed according to the sampling position to obtain historical scene rendering data matching the specific effect area in the historical scene rendering data.

15. The device according to claim 14, characterized in that The data acquisition module is also used for: Determine the three-dimensional scene position corresponding to the specific effect area according to the projection matrix corresponding to the current frame; A position transformation is performed according to the three-dimensional scene position and the projection matrix corresponding to the previous frame to obtain the sampling coordinates corresponding to the remapped specific effect area in the previous frame.

16. The device according to claim 15, characterized in that The data acquisition module is also used for: When the specific effect area includes a reflection effect area, determining the camera viewing angle in the current frame and the reflection position of the reflection effect area according to the projection matrix corresponding to the current frame; Determining a symmetrical reflection ray according to the camera viewing angle in the current frame and the reflection position of the reflection effect area; A three-dimensional scene position corresponding to the reflection effect area is determined according to the symmetrical reflection ray.

17. The device according to claim 14, characterized in that The data acquisition module is also used for: When the specific effect area includes a refraction effect area, determining a sampling coordinate offset according to the camera viewing angle in the current frame and a normal direction corresponding to the refraction effect area; The sampling position corresponding to the refraction effect area in the previous frame is determined according to the sampling coordinate offset.

18. The device according to claim 13, characterized in that The data acquisition module is also used for: When the specific effect area includes a water surface effect area, determining preset scene data matching the water surface effect area according to a preset water surface height; The scene rendering module is also used for: When rendering the water surface effect area, the water surface effect area in the scene of the current frame is rendered in the single rendering channel based on the matched historical scene rendering data and the preset scene data.

19. The device according to claim 18, characterized in that The data acquisition module is also used for: According to the angle between the camera viewing angle in the current frame and the water surface in the water surface effect area, preset scene data matching the water surface effect area is determined from the preset water surface height.

20. The device according to claim 13, characterized in that The matched historical scene rendering data is the first scene rendering data sampled based on the remapped sampling coordinates; the data acquisition module is also used for: If the single rendering pass corresponding to the current frame includes a sub-rendering pass, acquiring scene data of the current frame corresponding to the specific effect area through the sub-rendering pass; The scene rendering module is also used for: When rendering the specific effect area, determining target scene data corresponding to the specific effect area according to the scene data of the current frame corresponding to the specific effect area and the first scene rendering data; Based on the target scene data, the specific effect area in the scene of the current frame is rendered in the single rendering pass.

21. The device according to claim 20, characterized in that The scene rendering module is also used for: When the specific effect area includes a refraction effect area, determining a pixel point to be corrected corresponding to the first scene rendering data; According to the scene data corresponding to the pixel to be corrected in the scene data of the current frame corresponding to the specific effect area, the scene rendering data corresponding to the pixel to be corrected in the first scene rendering data is replaced to obtain the target scene data corresponding to the specific effect area.

22. The device according to claim 21, characterized in that The scene rendering module is also used for: Determine a first depth difference between a first depth value and a second depth value; the first depth value is a depth value of a pixel point in the first scene rendering data, and the second depth value is a depth value of a refraction interface in the scene data of the current frame corresponding to the specific effect area; Based on the sampling coordinate offset, sampling second scene rendering data matching the specific effect area from the historical scene rendering data; Determine a second depth difference between the pixel point in the first scene rendering data and the second scene rendering data; When the first depth difference is greater than or equal to a first threshold and the second depth difference is greater than or equal to a second threshold, the pixel is determined to be a pixel to be corrected.

23. The device according to claim 21, characterized in that The scene rendering module is also used for: When the first depth value is greater than the second depth value, the first depth value is the depth value of the pixel point in the first scene rendering data, and the second depth value is the depth value of the refraction interface in the scene data of the current frame corresponding to the specific effect area, then the pixel point is determined to be a pixel point to be corrected.

24. The device according to claim 21, characterized in that The scene rendering module is also used for: The pixel point to be corrected corresponding to the first scene rendering data is determined according to the screen coordinates corresponding to the pixel point in the first scene rendering data.

25. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.

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

Citation Information

Patent Citations

  • Method and apparatus for rendering image data

    US20150091892A1

  • Methods and systems for real-time, interactive image composition

    US7113183B1