Rendering image processing method, device, electronic device and medium
By pre-baking the preset sampling points of the virtual scene before rendering, obtaining automatic exposure data and exposing control in the post-rendering process stage, the problem of poor rendering of the picture on high-consumable terminal devices is solved, and the authenticity and clarity are improved.
Patent Information
- Application Number
- CN202111679748.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2041-12-31
AI Technical Summary
The prior art has poor rendering of pictures on high-consumable terminal devices, especially in the post-processing stage of the rendering pipeline, which results in unrealistic pictures and increased power consumption.
By pre-baking the preset sampling points of the virtual scene before rendering, obtaining automatic exposure data, and exposing control is performed according to the position and observation direction of the virtual camera during the post-rendering process stage, reducing video memory consumption and calculation amount.
While keeping the frame rate unchanged, the authenticity and clarity of the rendered picture are improved, the memory consumption is reduced, and the human-eye adaptive screen display on high-energy-consuming mobile devices is realized.
Smart Images

Figure CN114359021B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image technology, and in particular to a method for processing a rendered image, a device for processing a rendered image, a corresponding electronic device, and a corresponding computer-readable storage medium. Background Art
[0002] In the game rendering pipeline, the automatic exposure function has also been widely used. It can simulate the human eye and automatically adjust the amount of light entering the pupil in different brightness environments, so as to adapt to the function of seeing the details of the picture clearly.
[0003] In the prior art, the automatic exposure function is usually implemented by calculating the game screen to be output in the post-processing stage of the rendering pipeline. However, the calculation method in the post-processing stage of the rendering pipeline requires multiple reading and writing of RT (RenderTexture, which refers to the storage structure of color data when rendering the current screen color). Based on the required amount of calculation and the bandwidth and video memory consumption, the final rendered picture effect is poor for high-consumption terminal devices. Summary of the Invention
[0004] In view of the above problems, embodiments of the present invention are proposed to provide a method for processing a rendered image, a device for processing a rendered image, a corresponding electronic device, and a corresponding computer-readable storage medium that overcome the above problems or at least partially solve the above problems.
[0005] An embodiment of the present invention discloses a method for processing a rendered image, wherein a display component of a terminal renders and generates a rendered image obtained by capturing a virtual scene with a virtual camera. The method includes:
[0006] Acquire automatic exposure data pre-baked based on preset sampling points in the virtual scene; the automatic exposure data is determined based on the brightness of the rendered image captured by the virtual camera at the preset sampling points;
[0007] Determining target exposure data of the current frame rendering picture from the automatic exposure data of each preset sampling point according to the virtual camera position and current viewing direction of the current frame rendering picture;
[0008] The exposure of the rendered virtual scene is controlled according to the target exposure data to obtain a final rendered image.
[0009] Optionally, it also includes:
[0010] Pre-baking the automatic exposure data based on the preset sampling points in the virtual scene;
[0011] The automatic exposure data includes exposure data of the rendered image collected based on different sampling directions of preset sampling points; the automatic exposure data is obtained by pre-baking based on the preset sampling points in the virtual scene, including:
[0012] Setting a plurality of preset sampling points for determining automatic exposure data in a virtual scene;
[0013] When performing the pre-baking, each preset sampling point is traversed, and based on the rendered images acquired at different sampling directions of each preset sampling point, exposure data corresponding to the acquired rendered images based on different acquisition directions of each preset sampling point is calculated.
[0014] Optionally, the rendered images acquired based on different sampling directions of the preset sampling points correspond to rendered images acquired based on different angles of the preset sampling points; acquiring rendered images based on different sampling directions of each preset sampling point, and calculating exposure data for the acquired rendered images based on different acquisition directions of each preset sampling point include:
[0015] Rendering images at several different angles centered at each preset sampling point are collected, and exposure data of the collected rendering images at several different angles are calculated.
[0016] Optionally, determining target exposure data of the current frame rendering picture from the automatic exposure data of each preset sampling point according to the virtual camera position and the current viewing direction includes:
[0017] According to the virtual camera position of the current frame rendering picture, the target sampling point data corresponding to the current virtual camera position is obtained from the automatic exposure data of each preset sampling point;
[0018] Target exposure data of the current frame rendering picture is determined according to the current observation direction of the current frame rendering picture and the target sampling point data.
[0019] Optionally, acquiring target sampling point data corresponding to the current virtual camera position from the sampling point data of each preset sampling point according to the virtual camera position of the current frame rendering picture includes:
[0020] Obtain any two preset sampling points from each preset sampling point, and obtain intersection information of the virtual camera position and the straight line between the any two preset sampling points;
[0021] Based on the positional relationship between the intersection information and the straight line between the arbitrary two preset sampling points, and the distance relationship between the virtual camera position and the straight line between the arbitrary two preset sampling points, a target sampling point is determined between the arbitrary two preset sampling points, and sampling point data of the target sampling point is determined as the target sampling point data of the current virtual camera position.
[0022] Optionally, the target sampling point data includes exposure data of the rendered image collected based on different sampling directions of the target sampling point; and determining the target exposure data of the rendered image of the current frame according to the current observation direction of the rendered image of the current frame and the target sampling point data includes:
[0023] Determining, according to a current viewing direction of the current frame rendering image, an exposure contribution weight of each sampling direction based on different sampling directions of the target sampling point;
[0024] Calculate target exposure data of the current frame rendering picture in the current observation direction based on the exposure contribution weights of each sampling direction and exposure data of the rendering picture collected based on different sampling directions of the target sampling point.
[0025] Optionally, the calculating target exposure data of the current frame rendering picture in the current observation direction includes:
[0026] The exposure contribution weights of the respective sampling directions are used to perform integration or spherical interpolation processing on the exposure data of the rendered image collected in the corresponding sampling directions, so as to obtain the target exposure data of the target sampling point in the current observation direction.
[0027] The embodiment of the present invention further discloses a processing device for a rendered image, which generates a rendered image obtained by capturing a virtual scene with a virtual camera through rendering by a display component of a terminal. The device includes:
[0028] An automatic exposure data acquisition module is used to acquire automatic exposure data pre-baked based on preset sampling points in a virtual scene; the automatic exposure data is determined based on the brightness of the rendered image captured by the virtual camera at the preset sampling points;
[0029] a target exposure data determination module, configured to determine target exposure data of the current frame rendering picture from the automatic exposure data of each preset sampling point according to the virtual camera position and current observation direction of the current frame rendering picture;
[0030] The exposure control module is used to control the exposure of the rendered virtual scene according to the target exposure data to obtain a final rendered image.
[0031] Optionally, the device further comprises:
[0032] A data baking module is used to pre-bake automatic exposure data based on preset sampling points in the virtual scene;
[0033] The automatic exposure data includes exposure data of the rendered image collected based on different sampling directions of preset sampling points; the data baking module includes:
[0034] A preset sampling point setting submodule is used to set a number of preset sampling points for determining automatic exposure data in a virtual scene;
[0035] The data baking submodule is used to traverse each preset sampling point during the pre-baking process, and based on the rendered images acquired at different sampling directions of each preset sampling point, calculate the exposure data corresponding to the rendered images acquired at different sampling directions of each preset sampling point.
[0036] Optionally, the rendered images collected based on different sampling directions of the preset sampling points correspond to rendered images based on different angles of the preset sampling points; and the data baking submodule includes:
[0037] The data baking unit is used to collect rendering images at several different angles centered on each preset sampling point, and calculate exposure data of the collected rendering images at several different angles.
[0038] Optionally, the target exposure data determination module includes:
[0039] The target sampling point data acquisition submodule is used to acquire the target sampling point data of the current virtual camera position from the automatic exposure data of each preset sampling point according to the virtual camera position of the current frame rendering picture;
[0040] The target exposure data determination submodule is configured to determine the target exposure data of the current frame rendering picture according to the current observation direction of the current frame rendering picture and the target sampling point data.
[0041] Optionally, the target sampling point data acquisition submodule includes:
[0042] An intersection information obtaining unit, configured to obtain any two preset sampling points from the preset sampling points, and obtain intersection information between the virtual camera position and a straight line between the any two preset sampling points;
[0043] a target sampling point data determining unit, configured to determine a target sampling point between the arbitrary two preset sampling points based on a positional relationship between the intersection point information and the straight line between the arbitrary two preset sampling points, and a distance relationship between the virtual camera position and the straight line between the arbitrary two preset sampling points, and determine the sampling point data of the target sampling point as the target sampling point data for the current virtual camera position.
[0044] Optionally, the target sampling point data includes exposure data of the rendered image collected based on different sampling directions of the target sampling point; and the target exposure data determination submodule includes:
[0045] a contribution weight determination unit, configured to determine, according to a current viewing direction of the current frame rendering picture, an exposure contribution weight of each sampling direction based on different sampling directions of the target sampling point;
[0046] The target exposure data calculation unit is used to calculate the target exposure data of the current frame rendering picture in the current observation direction based on the exposure contribution weights of each sampling direction and the exposure data of the rendering picture collected based on different sampling directions of the target sampling point.
[0047] Optionally, the target exposure data calculation unit includes:
[0048] The target exposure data calculation subunit is used to use the exposure contribution weights of each sampling direction to integrate or spherically interpolate the exposure data of the rendering image collected in the corresponding sampling direction to obtain the target exposure data of the target sampling point in the current observation direction.
[0049] An embodiment of the present invention further discloses an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the steps of any one of the methods for processing a rendered image when executed by the processor.
[0050] The embodiment of the present invention further discloses a computer program stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of any one of the methods for processing a rendered image are implemented.
[0051] The embodiments of the present invention include the following advantages:
[0052] In an embodiment of the present invention, the automatic exposure data is pre-baked by utilizing a space-for-time method, so that when the pre-baked automatic exposure data is directly read and used in the post-rendering processing stage, the exposure data used for exposure control is calculated based on the camera position and direction. While reducing video memory consumption and the amount of calculation based on the pre-baked data, the calculation based on the direct reading of the exposure data makes the final rendered image on the device more realistic and clearer, and realizes the display of human eye-adaptive images on high-energy-consuming mobile devices, and realizes the automatic exposure effect of the rendering results while keeping the frame rate unchanged; and when pre-baking the data, there is no need to consider the problem of local overbrightness or overdarkness, and it only needs to be baked based on relatively correct lighting. It can be applied later based on the exposure data fitted with the virtual camera position and observation direction. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is a flowchart of a method for processing a rendered image according to an embodiment of the present invention;
[0054] Figure 2 It is a flowchart of another embodiment of a method for processing a rendered image according to the present invention;
[0055] Figures 3A to 3B is a schematic diagram of pre-baking exposure data provided by an embodiment of the present invention;
[0056] Figure 4 This is a flowchart of another embodiment of a method for processing a rendered image according to the present invention;
[0057] Figures 5A to 5C is a schematic diagram of determining target sampling point data provided by an embodiment of the present invention;
[0058] Figure 6 is a schematic diagram of spherical interpolation calculation provided by an embodiment of the present invention;
[0059] Figure 7 It is a structural block diagram of an embodiment of a processing device for rendering a picture of the present invention. DETAILED DESCRIPTION
[0060] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0061] In the real world, when the intensity of the light source in the environment the human eye encounters changes, the human eye adapts to that change, allowing it to obtain a visual response consistent with everyday experience. This occurs primarily because when the light level decreases, the human eye perceives it as being higher than the actual light intensity, while when the light level increases, it perceives it as being lower than the actual light intensity. This phenomenon is often simulated by cameras in everyday photography, and this simulated human eye adaptation is known as the auto-exposure function in photography.
[0062] Specifically, in today's realistic game rendering pipelines, the automatic exposure function has been widely used. Taking Unreal Engine 4 as an example, this engine can simulate the human eye in different brightness environments and automatically adjust the amount of light entering the pupil to adapt to seeing the details of the picture clearly, thereby obtaining a more correct and reasonable picture effect.
[0063] In the prior art, the implementation of the automatic exposure function, taking mainstream engines such as Unreal Engine 4 and Unity (a game engine) as examples, is usually implemented in the post-processing stage of the rendering pipeline. The rendering pipeline refers to the computer's computational pipeline from data to image, and the post-processing stage refers to the stage of processing the image generated by the computational results after the entire scene is calculated. The game screen is calculated and output while the game is running. Before the post-processing stage, there may also be lighting processing of the virtual scene in the game screen based on lighting processing models or lighting processing special effects, using lighting information and / or shadow information. Among them, the processing object of the post-processing stage is screen pixels. In terms of performance, it is the brightness and darkness changes of the entire screen, brightening or darkening the whole screen. It does not process the brightness of local areas. Lighting processing is the influence of light on the virtual scene under the current lighting environment in the virtual scene. It is fixed and processes the local brightness and darkness within the lighting range. Generally speaking, whether using rendering model processing or special effects processing, it includes lighting processing before the post-processing stage and exposure processing in the post-processing stage. The two processing purposes are different and cannot replace each other.
[0064] In the automatic exposure processing, the main thing is to calculate the game screen to be output, obtain the exposure of the screen and then apply the exposure back to the original screen. The exposure obtained and applied can be the degree of automatic exposure, so that the screen is in a relatively reasonable brightness range and obtain the effect of automatic exposure.
[0065] Among them, the exposure calculation of the picture in the post-processing stage of the rendering pipeline mainly uses the average brightness of the required rendered picture, that is, the average brightness of the current lake surface to calculate the exposure.
[0066] Specifically, we first need to obtain the color of any pixel of RT, and calculate the pixel brightness L of the screen based on the obtained pixel color. At this time, assuming that the three-channel colors of the pixel are RGB, the formula for calculating the brightness L can be L=0.2125R+0.7154G+0.0721B.
[0067] For all pixels in RT, the average brightness L needs to be calculated avg , to use the average brightness L avg The specific formula used to calculate the exposure H is:
[0068]
[0069]
[0070]
[0071] Where S is the sensor sensitivity, which describes the maximum acceptable brightness, and K is the illumination calibration. Usually, both S and K are constants.
[0072] Among them, for the average brightness of all pixels in RT, L avg The solution can be achieved through the minimum information loss principle or histogram equalization.
[0073] The principle of minimum information loss mainly involves performing multiple calculations on the image. Data can be filtered out during each calculation, and as much data as possible is retained, so that the data retained after multiple calculations is relatively average data. The principle of minimum information loss can generally be achieved by downsampling or image compression.
[0074] The downsampling method is performed in the post-processing stage of the rendering pipeline, and it mainly performs sampling after reducing the RT resolution. Specifically, the RT of the current picture can be obtained first, and the smaller Mip of the RT (refers to the MipMap of the color data stored in the RT, which is a multi-level asymptotic texture with a series of textures. It can obtain the mean of all colors in an area based on areas of different pixel levels, and each texture is a representation of the same image with gradually decreasing resolution) is continuously used to output it to a new RT, while continuously reducing the resolution of the new RT, and using the obtained new RT as input to continue to output the new RT with the Mip of this new RT smaller level, until the resolution is reduced to 1 pixel, the pixel color is read and converted into brightness output to obtain the average brightness of a picture.
[0075] Image data decomposition is a method of image compression that primarily uses a block-based graphics compression algorithm to continuously compress the image until the average brightness of the image is achieved when the block size meets the requirements. Specifically, the RT of the current image is first obtained. The image is then compressed using the currently preset block size to obtain the color of the lossy image after compression. A determination is then made as to whether the current block size meets the requirements. If so, the compressed image color is output as the average brightness of the image. If not, the block size needs to be continuously changed to achieve a lower bitrate. After changing the block size, the image is compressed using the same block size until the current block size meets the requirements.
[0076] Histogram equalization mainly uses image learning algorithms, which is manifested in the statistical evaluation of the current picture data when processing the image, so as to obtain the average brightness of the picture. Specifically, it may include the histogram solving process and the histogram equalization process. For the histogram solving process, the color data in RT can be converted into brightness. After the conversion, the number of pixels with the same brightness value in RT can be counted, and all pixels with a brightness of 0 can be excluded. At this time, the equalization operation can be performed. First, the brightness values can be sorted from small to large and the number of brightness occurrences can be accumulated in order. Assuming that the minimum brightness is L min , the maximum brightness is L max , L min The number of occurrences is cdf min , L max The number of occurrences is cdf max , the number of occurrences of any pixel brightness L is cdf, then after brightness L is equalized, it should be:
[0077]
[0078] Then, the obtained H can be converted into RT color and written into the original RT output. In the histogram equalization method, all RT pixels need to be read once in the process of obtaining the histogram, and all RT pixels need to be read again in the process of equalizing the histogram. That is, this method requires sampling RT at least twice.
[0079] The above-mentioned methods of solving the average brightness of the picture using the minimum information loss principle and histogram equalization respectively increase bandwidth usage and video memory consumption. Among them, the minimum information loss principle method is performed in the post-processing stage of the rendering pipeline. It requires multiple reading and writing of the storage RT. Therefore, its bandwidth and video memory are limited when the GPU (Graphics Processing Unit) is working. On GPUs with relatively poor bandwidth and video memory, especially mobile GPUs, it will cause a large video memory overhead. Repeated reading and writing on mobile GPUs will also increase power consumption, further reducing GPU performance. Histogram equalization mainly relies on image statistical algorithms. In addition to multiple reading and writing of RT, data needs to be transferred back and forth between the GPU and CPU (Central Processing Unit). Moreover, because the mathematical method obtains mathematically correct results, in some special environments, the equalized results are not aesthetically pleasing and may be significantly different from the actual impression, resulting in erroneous visual effects to the user's senses.
[0080] Based on the performance overhead and hardware requirements on the mobile device and the details of the original automatic exposure solution, the embodiment of the present invention determines that the main performance consumption of picture rendering is spent on the real-time calculation of the brightness of each frame. The core idea of the embodiment of the present invention is to pre-calculate and store the automatic exposure data that needs to be calculated in real time by utilizing the method of exchanging space for time, so that the pre-calculated exposure can be directly read in the post-rendering processing stage, and the exposure data fitted based on the virtual camera position and observation direction is directly read and applied to the current rendering result when the game is running. While reducing video memory consumption and calculation amount based on pre-baked data, the calculation implementation based on direct reading of exposure data makes the final rendered picture on the device more realistic and clearer, realizing the display of human eye-adaptive pictures on high-energy-consuming mobile devices, and achieving automatic exposure effect of the rendering results while keeping the frame rate unchanged.
[0081] Reference Figure 1 , shows a flowchart of a method for processing a rendered image according to an embodiment of the present invention, which may specifically include the following steps:
[0082] Step 101, obtaining automatic exposure data pre-baked based on preset sampling points in a virtual scene;
[0083] A virtual scene is a fictional scene that does not exist in the real world and may include multiple rendered images. These images are primarily generated by rendering on a terminal's display component, using a virtual camera to capture the virtual scene. The virtual scene can be a movie, a computer animation, a mobile game, or a PC game, without limitation in this embodiment of the present invention.
[0084] Taking a virtual scene in a game as an example, in response to the game running, the automatic exposure data pre-baked based on the preset sampling points in the virtual scene can be obtained. In actual applications, the automatic exposure data can be obtained after the virtual scene is illuminated.
[0085] Specifically, after performing lighting processing using lighting information and / or shadow information based on a lighting processing model or lighting processing effects, that is, rendering virtual objects or local areas affected by lighting in a virtual scene according to the lighting information and / or shadow information, the pre-baked automatic exposure data can be obtained to subsequently perform exposure control on the virtual scene after lighting processing.
[0086] In an embodiment of the present invention, by utilizing the method of exchanging space for time, the automatic exposure data obtained is pre-baked, which can be determined based on the brightness of the picture captured by the preset sampling point. The brightness of the picture can be represented by the exposure value (i.e., brightness). Then the automatic exposure data can refer to the exposure of the rendered picture used. At this time, the exposure that can be used for exposure control is pre-calculated to achieve subsequent exposure control of the rendering results.
[0087] Specifically, during the automatic exposure data baking process, the automatic exposure data can be pre-baked based on preset sampling points in the virtual scene. This process occurs before the game is rendered, not during the rendering phase. This prevents the calculation of automatic exposure data during the game from occupying the bandwidth required to render the game scene.
[0088] During this process, the virtual scene needs to be rendered. Conventional auto-exposure solutions can be employed, such as downsampling based on the principle of minimum information loss. This virtual scene rendering can be considered virtual rendering, not rendering during the game itself. The auto-exposure data is calculated based on this virtual rendering. While the downsampling method requires multiple reads and writes to the storage RT, it does not occur during the post-processing phase of the rendering pipeline during game runtime. This means the calculations are not performed during the actual rendering process, and therefore do not affect the bandwidth and video memory usage during actual rendering.
[0089] Step 102 , determining target exposure data of the current frame rendering image from the automatic exposure data of each preset sampling point according to the virtual camera position and current viewing direction of the current frame rendering image;
[0090] After pre-calculating and storing the automatic exposure data that needs to be calculated in real time by using the space-for-time method, in the post-rendering processing stage, the target exposure data for subsequent exposure control can be obtained from the pre-baked and stored automatic exposure data based on the virtual camera position and observation direction.
[0091] The target exposure data obtained for exposure control may be exposure data fitted based on the virtual camera position and observation direction.
[0092] Specifically, the virtual camera position and current viewing direction of each rendered frame can be obtained, and exposure data for exposure control of each rendered frame can be determined based on the camera position and current viewing direction. The determined exposure data can be used to adjust the brightness of each rendered frame at runtime. Specifically, when determining the exposure data for each rendered frame, the virtual camera position and current viewing direction of the current frame are mainly used, based on the contribution weight of the pre-baked automatic exposure data to the current virtual camera position, and the spherical interpolation calculation of the current viewing direction in the direction of each sampling point based on the pre-baked automatic exposure data.
[0093] It should be noted that when performing spherical interpolation calculations, the sampling direction can refer to the exposure of a preset sampling point calculated by integrating or spherically interpolating the exposure in six directions: up, down, left, right, front, and back. However, in actual applications, the viewing angle is mostly swaying left and right, and looking up or down is rare. The up and down exposure contributes less to the image, while the horizontal direction requires more data to improve accuracy. That is, in actual baking, the up and down exposure can be sampled separately, while the horizontal exposure, for a preset sampling point, can be sampled at a fixed angle based on the exposure of a circle around this preset sampling point. This is not limited in the embodiments of the present invention.
[0094] Step 103 : performing exposure control on the rendered virtual scene according to the target exposure data to obtain a final rendered image.
[0095] The exposure control of the rendered virtual scene is manifested as the adjustment of the overall brightness of the virtual scene, such as brightening or darkening the overall picture. At this time, the exposure data fitted based on the virtual camera position and observation direction is applied to the current rendering result. While pre-baking data is used to reduce video memory consumption and reduce the amount of calculation, the calculation based on direct reading of the exposure data makes the final rendered picture on the device more realistic and clearer, so that the user can feel the correct and reasonable picture effect and enhance the user's visual experience.
[0096] Exposure control of the virtual scene occurs in the post-processing stage of rendering, that is, the stage of processing the generated image. At this stage, the object processed by exposure control is the pixels of the screen. That is, at this time, the rendering results obtained before the post-rendering stage can be adjusted according to the automatic exposure data, such as the brightness of the screen display pixels of the rendered virtual scene. In the specific implementation, the exposure of each frame can be controlled according to the automatic exposure data to obtain the final rendered image.
[0097] In an embodiment of the present invention, pre-baked automatic exposure data can be obtained during rendering. The obtained pre-baked automatic exposure data can be determined based on the brightness of a rendered image captured by a virtual camera at preset sampling points in a virtual scene. When the pre-baked automatic exposure data is used, the target exposure data of the current frame of the rendered image can be determined from the automatic exposure data of each preset sampling point according to the virtual camera position and current viewing direction of the current frame of the rendered image, so that the exposure of the rendered virtual scene can be controlled using the obtained automatic exposure data to obtain a final rendered image after exposure control. By using a space-for-time method to pre-bake the automatic exposure data, when the pre-baked automatic exposure data is directly read and used in the post-rendering processing stage, the exposure data used for exposure control is calculated based on the camera position and direction. While using the pre-baked data to reduce video memory consumption and computational complexity, the calculation based on the direct reading of the exposure data makes the final rendered image on the device more realistic and clearer, realizing human eye-adaptive image display on high-energy-consuming mobile devices, and achieving an automatic exposure effect on the rendering result while maintaining a constant frame rate.
[0098] Reference Figure 2 , shows a flowchart of another embodiment of a method for processing a rendered image according to the present invention, which mainly involves the pre-baking process of automatic exposure data, focusing on the calculation and storage of the pre-baked automatic exposure data, and may specifically include the following steps:
[0099] Step 201, setting a number of preset sampling points for determining automatic exposure data in a virtual scene;
[0100] In an embodiment of the present invention, automatic exposure data can be pre-baked based on preset sampling points of the virtual scene before rendering, and the pre-baked automatic exposure data can be stored, so that when the game is subsequently run, the pre-stored automatic exposure data can be directly read during the run process to control the exposure of the rendered virtual scene, that is, based on the pre-calculated and stored exposure, the computational complexity of the rendering process is reduced.
[0101] Automatic exposure data can be pre-baked based on preset sampling points in the virtual scene.
[0102] Specifically, when calculating the automatic exposure data of a virtual scene, several preset sampling points for calculating the automatic exposure data may be set in the virtual scene. The preset sampling points may refer to the positions of the virtual cameras when baking the automatic exposure data. The calculated automatic exposure data are mainly based on the exposure data of the rendered images collected at different sampling directions of the preset sampling points. The sampling directions of the preset sampling points may refer to the directions facing the virtual cameras when baking the automatic exposure. One sampling direction may correspond to collecting an image at one angle. At this time, the automatic exposure data of several rendered images at different angles collected in a circle around the preset sampling points may be calculated.
[0103] In this process, several preset sampling points for calculating the automatic exposure data can be set in the virtual scene. The preset sampling points can refer to the position of the virtual camera when baking the automatic exposure data. For example, the preset sampling points can be evenly arranged in the area where the road can be walked, for example, every 3-5 meters. Or Figure 3B As shown, the road area can be divided based on waypoints. In this case, the preset sampling points can be arranged based on the waypoints. This embodiment of the present invention does not limit this.
[0104] Step 202 , traverses each preset sampling point during pre-baking, and calculates exposure data corresponding to the rendered images acquired based on different sampling directions of each preset sampling point based on the rendered images acquired based on different sampling directions of each preset sampling point.
[0105] The calculation method of automatic exposure data can be mainly manifested as traversing each preset sampling point in a preset order during baking, and collecting rendering images based on different sampling directions of each preset sampling point, and calculating the exposure data for the collected rendering images. At this time, the exposure data calculated from the rendered image in the corresponding sampling direction can be stored so that it can be directly read and used later during the game running process, thereby reducing the consumption of video memory and the amount of calculation based on the pre-baked data.
[0106] In one embodiment of the present invention, the automatic exposure data calculated for the rendered screen may include exposure data of the rendered screen collected based on different sampling directions of each preset sampling point. This can be mainly manifested as after sampling each rendered screen based on different sampling directions of each preset sampling point, for the sampling point data of any preset sampling point, the exposure data of the rendered screen sampled based on different sampling directions collected based on this preset sampling point can be calculated. At this time, the exposure data calculated from the rendered screen in the corresponding sampling direction can be stored so that it can be directly read and used later during operation.
[0107] Specifically, the rendered images collected based on different sampling directions of the preset sampling points can correspond to rendered images at different angles based on the preset sampling points. In actual applications, for any preset sampling point, it is possible to collect rendered images at several different angles centered on each preset sampling point, and calculate the exposure data of the collected rendered images at several different angles. Specifically, during baking, the preset sampling points can be traversed sequentially, with each preset sampling point as the center of a circle, to sample images at several angles, and then use an implemented automatic exposure solution for rendering and calculating the exposure of the rendered images. The aforementioned pipeline of image rendering and exposure calculation is executed until the exposure of all images is calculated.
[0108] In actual application, before baking the automatic exposure data, it is necessary to fully produce the effect in the art scene. Figures 3A to 3B , showing a schematic diagram of baking automatic exposure data provided by an embodiment of the present invention. When running a game, you can open the TA (Technical Artist) command in the GM (Game Master) command, which is a game management command that can perform some special operations in the game. According to the required implementation of the relevant special commands, there is no need to slowly experience to achieve a certain goal in the game, which is more convenient for game testing. Figure 3A As shown, the TA command control interface opened can provide functions such as entering the automatic exposure baking scene, starting automatic exposure baking, and saving automatic exposure data. In this control end interface, a command display area and a status display area can also be presented to the user.
[0109] To create the effect in the art scene, click Figure 3A Enter the automatic exposure baking scene as shown, enter the corresponding scene number and then click Send Control / Component. At this time, you can use the existing conventional automatic exposure solution, such as the downsampling implementation in the minimum information loss principle, to render the virtual scene to be rendered. The status of the "auto_exposure_baking" automatic exposure can be displayed in the status display area; after loading the scene based on the entered scene number and entering the game, you can click Figure 3A As shown, the automatic exposure baking is started and sent. The status display area can display the status of "start_exposure_baking" starting the exposure baking. At this time, the camera lens will automatically rotate. The rotation of the lens can be based on the observation direction changed according to the position of the camera in the virtual game world, and can move forward according to the waypoints. The waypoints can be equivalent to the preset sampling points. That is, the current screen brightness value can be calculated based on the waypoints. The calculated display result can be a solid color, such as Figure 3B As shown in the preview result, the A, B, C, D, E, F, G, H positions in the current screen can be displayed in green after calculation, the B, C, E, I positions can be displayed in blue, and the D, F, H positions can be displayed in red. Each different pure color can be used to represent a different brightness. After waiting for the input number scene to end, the current screen can be displayed as a normal scene effect. At this time, you can Figure 3A Click Save Auto-Exposure Data in the TA command shown and send the command. The status of "save_exposure_baking" storing auto-exposure data can be displayed in the status display area. The baking is completed by saving the final data in a folder. The folder where the data is stored can be the Exposure Data folder under the game installation package Package, so as to ensure that the auto-exposure data can take effect when the game is running later.
[0110] Among them, when pre-baking data, there is no need to consider the problem of local over-brightness or over-darkness. It only needs to be baked according to relatively correct lighting. It can be applied based on the exposure data after fitting the virtual camera position and observation direction in the future, and can be based on Figure 3B As shown, the automatic exposure preview function is turned on. After the above automatic exposure scene is completed, you can directly run the game to use the pre-baked exposure data.
[0111] It should be noted that for the storage of automatic exposure data in the game installation package, the memory occupied by a single scene is relatively small, and multiple downsampling or compression is not required during subsequent game operation. It is only necessary to read the pre-baked data and pass it into the rendering pipeline according to the direction interpolation for subsequent calculation to obtain the automatic exposure effect, eliminating all repeated sampling and RT reading and writing processes, saving GPU bandwidth, and for mobile terminals, it can obtain a complete automatic exposure effect without sacrificing any frame rate, that is, without affecting the number of images (frames) displayed per second.
[0112] In an embodiment of the present invention, automatic exposure data is pre-baked by utilizing a space-for-time method, so that when the pre-baked automatic exposure data is directly read and used in the post-rendering processing stage, the exposure data used for exposure control is calculated based on the camera position and direction. While reducing video memory consumption and the amount of calculation based on the pre-baked data, the calculation based on the direct reading of the exposure data makes the final rendered image on the device more realistic and clearer, realizing the display of human eye-adaptive images on high-energy-consuming mobile devices, and achieving the automatic exposure effect of the rendering results while maintaining the frame rate unchanged.
[0113] Reference Figure 4 , shows a flowchart of another embodiment of a method for processing a rendered image according to the present invention, focusing on the application process of pre-baked automatic exposure data, which may specifically include the following steps:
[0114] Step 401, obtaining the virtual camera position and current viewing direction of the current frame rendering image;
[0115] In an embodiment of the present invention, the exposure is pre-calculated by utilizing a space-for-time method, so that the pre-calculated exposure can be directly read and applied to the current rendering image during subsequent rendering, thereby reducing the computational complexity of the rendering process.
[0116] Specifically, in the method of utilizing space for time, it is necessary to calculate the exposure, which may include the calculation and storage process of pre-baked automatic exposure data. After storing the automatic exposure data of the rendered screen collected by each preset sampling point in different sampling directions, the rendering process during the running game may be executed, that is, the application process of the pre-baked automatic exposure data. During rendering, the pre-calculated exposure can be read and applied to the current rendered screen, eliminating the steps of repeated sampling and RT reading and writing during rendering, thereby achieving the automatic exposure effect while reducing the amount of calculation, bandwidth occupancy, and video memory overhead.
[0117] In one embodiment of the present invention, the camera position and current viewing direction of the current rendering screen during game operation can be obtained to determine target exposure data from the automatic exposure data corresponding to the rendering screen collected from different sampling directions based on each preset sampling point.
[0118] Step 402 : determining target exposure data of the current frame rendering image from the sampling point data of each preset sampling point according to the virtual camera position and the current viewing direction, and performing exposure control on the current frame rendering image using the target exposure data.
[0119] In an embodiment of the present invention, the calculation based on the direct reading of exposure data makes the final rendered image on the device more realistic and clearer, thereby achieving the display of human eye-adaptive images on high-energy-consuming mobile devices.
[0120] Exposure control of the virtual scene occurs in the post-processing stage of rendering, that is, the stage of processing the generated image. At this stage, the object processed by exposure control is the pixels of the screen, that is, the brightness of the screen display pixels of the rendered virtual scene can be adjusted according to the automatic exposure data. It should be noted that since the object processed is the screen pixels of the rendering result, even if the brightness of the scene under the current lighting environment in the scene is processed, after obtaining the model rendering effect of the lighting processing, the target exposure data can be used to adjust the brightness of the picture of this model rendering effect, that is, exposure control can occur in any model processing and special effects processing.
[0121] In one embodiment of the present invention, the stored automatic exposure data includes sampling point data of each preset sampling point. At this time, after obtaining the virtual camera position and the current observation direction when running the game, the exposure required for the current rendering picture at runtime can be determined based on the virtual camera position and the current observation direction. The exposure of each frame to be rendered can be obtained based on the camera position, and then the exposure can be passed into the rendering pipeline to obtain the final automatic exposure effect, and the final automatic exposure effect can be output to the final color of RT.
[0122] When determining the target exposure data for the current rendering screen from the sampling point data of each preset sampling point based on the virtual camera position and the current observation direction, the target sampling point data for the current virtual camera position can be obtained from the sampling point data of each preset sampling point based on the virtual camera position of the current rendering screen, and then the target exposure data of the current rendering screen can be determined based on the current observation direction and target sampling point data of the current rendering screen.
[0123] In determining the target sampling point data, any two preset sampling points can be obtained from each preset sampling point, and the intersection information between the virtual camera position and the straight line between the any two preset sampling points can be obtained. Then, based on the positional relationship between the intersection information and the straight line between the any two preset sampling points, and the distance relationship between the virtual camera position and the straight line between the any two preset sampling points and the straight line between the any two preset sampling points, the target sampling point is determined between the any two preset sampling points, and the sampling point data of the target sampling point is determined as the target sampling point data of the current virtual camera position. The determined target sampling point data can be used for subsequent calculation of target exposure data.
[0124] Specifically, refer to Figures 5A to 5C, which shows a schematic diagram of determining target sampling point data provided by an embodiment of the present invention. During rendering, any two preset sampling points in space, such as points A and C, can be selected. In this case, a perpendicular line can be drawn from the virtual camera position E to the straight line AC between the two preset sampling points, and the intersection point is taken as D. The target sampling point is determined based on the positional relationship between the intersection point D and the straight line AC, and the distance relationship between the perpendicular line DE and the straight line AC.
[0125] In one case, such as Figure 5A As shown, when the intersection point D is on the straight line AC, assuming that the distance |DE| is greater than the distance |AC|, it can be considered that E escapes the effective range. At this time, the sampling point data closer to the virtual camera can be selected as the exposure or the default value can be used, that is, the preset sampling point closer to the camera is determined as the target sampling point, and the automatic exposure data of the target sampling point can be the target sampling data.
[0126] In another case, such as Figure 5B As shown, when the intersection point D is on the straight line AC, the distance |DE| is less than the distance |AC|. Then, the distances |AD| and |CD| can be calculated based on the intersection point D, and then The exposure weight is the exposure weight, and the exposures of the preset sampling point A and the preset sampling point C are mixed based on the exposure weight, and the calculated exposure is used as the target sampling data.
[0127] In another case, if Figure 5C As shown, when the intersection point D is outside the line segment AC, the sampling point data closer to the virtual camera position can be used as the exposure, that is, the preset sampling point closer to the virtual camera is determined as the target sampling point, and the automatic exposure data of the target sampling point can be the target sampling data.
[0128] In one embodiment of the present invention, the target sampling point data may include exposure data of the rendering picture collected based on different sampling directions of the target sampling point. When determining the target exposure data of the current rendering picture, the exposure contribution weights of each sampling direction based on different sampling directions of the target sampling point can be determined according to the current observation direction of the current rendering picture. For example, the exposure data in the sampling direction closer to the current observation direction has a larger contribution weight in this observation direction, etc. At this time, the target exposure data of the current rendering picture in the current observation direction can be calculated based on the exposure contribution weights of each sampling direction and the exposure data of the rendering picture collected based on different sampling directions of the target sampling point.
[0129] The target exposure data may be exposure data fitted based on the virtual camera position and observation direction.
[0130] Among them, the exposure contribution weights of each sampling direction can be used to integrate or perform spherical interpolation processing on the exposure data of the rendered image collected in the corresponding sampling direction, respectively, to obtain the target exposure data of the target sampling point in the current observation direction, and to realize the exposure data calculation of the current image. Spherical interpolation processing can refer to a method for calculating the data change of automatic exposure data from one direction to another. Specifically, for any preset sampling point, this preset sampling point can be a target sampling point determined based on the camera position. At this time, the target sampling point data of the target sampling point can be obtained. Assuming that the exposure calculated for the six directions of +X, -X, +Y, -Y, +Z, and -Z of the target sampling point has been determined in the above-mentioned baking data process, when the current observation direction is known, for the calculation of the automatic exposure data of the current observation direction, a spatial coordinate system can be first established. The three axes of the spatial coordinate system are XYZ, such as Figure 6 As shown, taking the coordinate system established by +X, +Y and +Z as an example, assume that the current observation direction is vector F. Since vector F is located in the spatial coordinate system, the automatic exposure data can be determined with the help of the projection of vector F on the two-dimensional plane. Usually, the exposure in the up and down directions contributes less to the picture, while the horizontal direction requires higher and more data to improve accuracy. The selected two-dimensional plane can be the XZ plane.
[0131] Specifically, we can take the projection Fa of vector F on the XZ plane and calculate the unit vector Fan of Fa. On the XZ plane, we can draw a circle with the origin O as the center and Fan as the radius. It is currently known that any direction on the XZ plane must fall into the quadrant formed by the four directions +X, -X, +Z, and -Z. Fan also conforms to this principle. Therefore, we can first calculate the quadrant where the Fan vector is located, and then know the automatic exposure data on the two adjacent axes. We can then determine the contribution of the exposure of different sampling directions on this vector Fan. The automatic exposure data of the two adjacent axes can then be the sampling directions that have an exposure impact on the current observation direction. At this time, the automatic exposure data in the current Fan direction, that is, the exposure data in the horizontal direction, can be calculated using the spherical linear interpolation formula.
[0132] In the specific implementation, such as Figure 6 As shown, the Fan vector is located in the first quadrant of the XZ plane. At this time, the exposure interpolation value of the Fan vector in any direction on the XZ plane can be obtained based on the angle w as a parameter. Assuming that w1 is the angle between the vector Fan and +X, that is, ∠BOX, and w2 is the angle between the vector Fn and Fan, that is, ∠AOB, then the automatic exposure data in the current Fan direction can be:
[0133]
[0134] When the Fan vector is located in other quadrants, it can also be processed according to a formula similar to the above, and this embodiment of the present invention does not limit this.
[0135] After determining the exposure data in the horizontal direction with the help of the projection of vector F on the two-dimensional plane, the unit vector Fn of F can be calculated. The unit vector Fn and Fan can also form a plane. At this time, the exposure data in the Fan direction is E, and the exposure data in the +Y and -Y directions are known. The spherical linear interpolation formula can be calculated on the plane formed by Fn-original-Fan using the angle between Fn and Fan as a parameter. The parameters may include w2 and w3, where w2 can be the angle ∠AOB between the vectors Fn and Fan, and w3 can be the angle ∠AOY between the vectors Fn and +Y.
[0136] The exposure data Exp in the F direction is obtained based on a formula similar to the above, which can be specifically:
[0137]
[0138] The calculated exposure data Exp is the final exposure synthesis result, that is, the target exposure data of the target sampling point in the current observation direction, which is used as the exposure of the current frame rendering picture.
[0139] When running the game, each frame can obtain the exposure according to the camera position using the above method, and pass the exposure to the rendering pipeline to obtain the final automatic exposure effect, and then output the final automatic exposure effect to the final color of RT.
[0140] In an embodiment of the present invention, automatic exposure data is pre-baked by utilizing a space-for-time method, so that when the pre-baked automatic exposure data is directly read and used in the post-rendering processing stage, the exposure data used for exposure control is calculated based on the camera position and direction. While reducing video memory consumption and the amount of calculation based on the pre-baked data, the calculation based on the direct reading of the exposure data makes the final rendered image on the device more realistic and clearer, realizing the display of human eye-adaptive images on high-energy-consuming mobile devices, and achieving the automatic exposure effect of the rendering results while maintaining the frame rate unchanged.
[0141] In a preferred embodiment, the automatic exposure data pre-baked in the rendering picture processing method proposed in the embodiment of the present invention can also be used to process the special effect brightness in the rendering result.
[0142] In scenes that process special effects brightness, after automatic exposure is applied to special effects in dark environments, the automatic exposure process processes the overall brightness of the rendered image, and the brightness of the special effects will be brighter than the original, which does not meet the expected effect in the rendered scene. In this case, based on the pre-baked automatic exposure data, the special effects brightness coefficient is calculated at the same time as the target exposure data for exposure control. This is used to further influence the special effects brightness based on the special effects brightness coefficient, correcting the abnormal special effects brightness effect, so that the scene brightness and special effects brightness can be simultaneously maintained in a visually balanced effect that meets the user's needs.
[0143] Among them, the added special effect brightness coefficient can be used to directly control all brightness special effects. After running the game, when determining the target exposure data of the current frame rendering picture from the automatic exposure data of each preset sampling point based on the virtual camera position and the current observation direction, the special effect brightness coefficient of the special effect in the rendering picture can be calculated based on the numerical value of the pre-exposed automatic exposure data in real time fitting, so that based on the calculated target exposure data, while controlling the overall exposure of the rendered virtual scene, the brightness of the special effects contained in the rendered virtual scene can be adjusted based on the calculated special effect brightness coefficient, thereby realizing human eye adaptation of the rendering picture and the special effect brightness.
[0144] Specifically, the special effect brightness coefficient can be obtained by fitting the pre-baked automatic exposure data based on an equation. The fitting relationship can be obtained based on the actual experience of artistic effects. The appropriate coefficient can be manually adjusted at different exposure values according to different types of special effects. The corresponding equation can be fitted using multiple sets of data, so that the special effect brightness coefficient corresponding to the current exposure value can be directly determined based on the input exposure value.
[0145] In one embodiment of the present invention, multiple sets of data are used to fit the corresponding equations. Different brightness special effects, such as special effects covering commonly used high brightness, medium brightness, and low brightness, can be used as a reference system. The values of the corresponding special effect high brightness coefficients are adjusted at different stages of exposure, and it is ensured that the high, medium, and low brightness special effects achieve the desired effect. Then, based on this set of empirical data, the corresponding mathematical fitting curve equation can be calculated, and the correct brightness effect can be adjusted in real time during game operation.
[0146] In scenarios where special effects brightness is processed, the special effects performance can be unified based on the special effects brightness coefficient, further affecting the special effects brightness and correcting the problem of excessive brightness differences in special effects in different environments, so that the scene brightness and special effects brightness can be maintained at the same time to match the user's visual balance.
[0147] It should be noted that for the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0148] Reference Figure 7 , shows a structural block diagram of an embodiment of a processing device for a rendered image according to the present invention, wherein a rendered image obtained by capturing a virtual scene with a virtual camera is generated by rendering a display component of a terminal, and specifically includes the following modules:
[0149] The automatic exposure data acquisition module 701 is used to acquire automatic exposure data pre-baked based on preset sampling points in the virtual scene; the automatic exposure data is determined based on the brightness of the rendered image captured by the virtual camera at the preset sampling points;
[0150] The target exposure data determination module 702 is configured to determine the target exposure data of the current frame rendering picture from the automatic exposure data of each preset sampling point according to the virtual camera position and current observation direction of the current frame rendering picture;
[0151] The exposure control module 703 is configured to perform exposure control on the rendered virtual scene according to the target exposure data to obtain a final rendered image.
[0152] In one embodiment of the present invention, the apparatus may further include the following modules:
[0153] A data baking module is used to pre-bake automatic exposure data based on preset sampling points in the virtual scene;
[0154] The automatic exposure data includes exposure data of the rendered image collected based on different sampling directions of preset sampling points; the data baking module may include the following submodules:
[0155] A preset sampling point setting submodule is used to set a number of preset sampling points for determining automatic exposure data in a virtual scene;
[0156] The data baking submodule is used to traverse each preset sampling point during the pre-baking process, and based on the rendered images acquired at different sampling directions of each preset sampling point, calculate the exposure data corresponding to the rendered images acquired at different sampling directions of each preset sampling point.
[0157] In one embodiment of the present invention, the rendered images acquired based on different sampling directions of the preset sampling points correspond to rendered images based on different angles of the preset sampling points; and the data baking submodule may include the following units:
[0158] The data baking unit is used to collect rendering images at several different angles centered on each preset sampling point, and calculate exposure data of the collected rendering images at several different angles.
[0159] In one embodiment of the present invention, the target exposure data determination module may include the following submodules:
[0160] The target sampling point data acquisition submodule is used to obtain the target sampling point data of the current required camera position from the automatic exposure data of each preset sampling point according to the virtual camera position of the current frame rendering picture;
[0161] The target exposure data determination submodule is configured to determine the target exposure data of the current frame rendering picture according to the current observation direction of the current frame rendering picture and the target sampling point data.
[0162] In one embodiment of the present invention, the target sampling point data acquisition submodule may include the following units:
[0163] An intersection information obtaining unit, configured to obtain any two preset sampling points from the preset sampling points, and obtain intersection information between the virtual camera position and a straight line between the any two preset sampling points;
[0164] a target sampling point data determining unit, configured to determine a target sampling point between the arbitrary two preset sampling points based on a positional relationship between the intersection point information and the straight line between the arbitrary two preset sampling points, and a distance relationship between the virtual camera position and the straight line between the arbitrary two preset sampling points, and determine the sampling point data of the target sampling point as the target sampling point data for the current virtual camera position.
[0165] In one embodiment of the present invention, the target sampling point data includes exposure data of the rendered image collected based on different sampling directions of the target sampling point; the target exposure data determination submodule may include the following units:
[0166] a contribution weight determination unit, configured to determine, according to a current viewing direction of the current frame rendering picture, an exposure contribution weight of each sampling direction based on different sampling directions of the target sampling point;
[0167] The target exposure data calculation unit is used to calculate the target exposure data of the current frame rendering picture in the current observation direction based on the exposure contribution weights of each sampling direction and the exposure data of the rendering picture collected based on different sampling directions of the target sampling point.
[0168] Optionally, the target exposure data calculation unit includes:
[0169] The target exposure data calculation subunit is used to use the exposure contribution weights of each sampling direction to integrate or spherically interpolate the exposure data of the rendering image collected in the corresponding sampling direction to obtain the target exposure data of the target sampling point in the current observation direction.
[0170] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0171] An embodiment of the present invention further provides an electronic device, including:
[0172] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned rendering image processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0173] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned rendering screen processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they will not be described here.
[0174] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0175] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, apparatus, or computer program products. Thus, embodiments of the present invention may take the form of a fully hardware embodiment, a fully software embodiment, or an embodiment combining software and hardware. Furthermore, embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0176] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the process in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0177] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0178] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0179] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0180] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.
[0181] The above is a detailed introduction to the rendering image processing method, device, electronic device and medium provided by the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method and core ideas of the present invention. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A method for processing a rendering image, characterized in that: The method of generating a rendering image obtained by capturing a virtual scene with a virtual camera by rendering a display component of a terminal includes: Acquire automatic exposure data pre-baked based on preset sampling points in the virtual scene; the automatic exposure data is determined based on the brightness of the rendered image captured by the virtual camera at the preset sampling points; Obtain any two preset sampling points from each preset sampling point, and obtain intersection information of the virtual camera position and the straight line between the any two preset sampling points; Based on the positional relationship between the intersection information and the straight line between the arbitrary two preset sampling points, and the distance relationship between the virtual camera position and the straight line between the arbitrary two preset sampling points, a target sampling point is determined between the arbitrary two preset sampling points, and sampling point data of the target sampling point is determined as the target sampling point data of the current virtual camera position; Determining target exposure data of the current frame rendering picture according to the current observation direction of the current frame rendering picture and the target sampling point data; The exposure of the rendered virtual scene is controlled according to the target exposure data to obtain a final rendered image.
2. The method according to claim 1, characterized in that Also includes: Pre-baking the automatic exposure data based on the preset sampling points in the virtual scene; The automatic exposure data includes exposure data of the rendering image collected based on different sampling directions of preset sampling points; The step of pre-baking the automatic exposure data based on the preset sampling points in the virtual scene includes: Setting a plurality of preset sampling points for determining automatic exposure data in a virtual scene; When performing the pre-baking, each preset sampling point is traversed, and based on the rendered images acquired at different sampling directions of each preset sampling point, exposure data corresponding to the acquired rendered images based on different acquisition directions of each preset sampling point is calculated.
3. The method according to claim 2, characterized in that The rendered images collected based on different sampling directions of the preset sampling points correspond to rendered images based on different angles of the preset sampling points; collecting rendered images based on different sampling directions of each preset sampling point, and calculating exposure data for the collected rendered images based on different collection directions of each preset sampling point, include: Rendering images at several different angles centered at each preset sampling point are collected, and exposure data of the collected rendering images at several different angles are calculated.
4. The method according to claim 1, wherein The target sampling point data includes exposure data of the rendered image collected based on different sampling directions of the target sampling point; and determining the target exposure data of the rendered image of the current frame according to the current observation direction of the rendered image of the current frame and the target sampling point data includes: Determining, according to a current viewing direction of the current frame rendering image, an exposure contribution weight of each sampling direction based on different sampling directions of the target sampling point; Calculate target exposure data of the current frame rendering picture in the current observation direction based on the exposure contribution weights of each sampling direction and exposure data of the rendering picture collected based on different sampling directions of the target sampling point.
5. The method according to claim 4, characterized in that The calculating target exposure data of the current frame rendering picture in the current observation direction includes: The exposure contribution weights of the respective sampling directions are used to perform integration or spherical interpolation processing on the exposure data of the rendered image collected in the corresponding sampling directions, so as to obtain the target exposure data of the target sampling point in the current observation direction.
6. A processing device for rendering a picture, characterized in that: The device generates a rendering image obtained by capturing a virtual scene with a virtual camera through a display component of a terminal, and the device includes: An automatic exposure data acquisition module is used to acquire automatic exposure data pre-baked based on preset sampling points in a virtual scene; the automatic exposure data is determined based on the brightness of the rendered image captured by the virtual camera at the preset sampling points; An intersection information obtaining unit, configured to obtain any two preset sampling points from the preset sampling points, and obtain intersection information between the virtual camera position and a straight line between the any two preset sampling points; a target sampling point data determining unit, configured to determine a target sampling point between the arbitrary two preset sampling points based on a positional relationship between the intersection information and the straight line between the arbitrary two preset sampling points, and a distance relationship between the virtual camera position and the straight line between the arbitrary two preset sampling points, and determine the sampling point data of the target sampling point as the target sampling point data of the current virtual camera position; a target exposure data determination submodule, configured to determine target exposure data of the current frame rendering picture according to the current observation direction of the current frame rendering picture and the target sampling point data; The exposure control module is used to control the exposure of the rendered virtual scene according to the target exposure data to obtain a final rendered image.
7. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of the method for processing a rendered image according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for processing a rendered image according to any one of claims 1 to 5 are implemented.