Virtual scene rendering method, device and equipment and readable storage medium

By adjusting the lighting information and ambient occlusion in virtual scene rendering and considering the impact of albedo, the problem of color inversion in high dynamic range scenes is solved, and the rendering effect is improved.

CN119722906APending Publication Date: 2025-03-28NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411784132.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The prior art fails to effectively consider the impact of albedo on ambient light occlusion when rendering virtual scenes, resulting in the problem of color inversion in high dynamic range scenes, affecting the rendering effect.

Method used

By obtaining the initial ambient occlusion, initial lighting information, and albedo map of the virtual scene, the lighting information is adjusted to take into account the impact of albedo, and the ambient occlusion is processed based on the adjusted lighting information to avoid color reversal.

Benefits of technology

It effectively expands the range of color expression, avoids the problem of color reversal after rendering, and improves the rendering effect of virtual scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119722906A_ABST
    Figure CN119722906A_ABST
Patent Text Reader

Abstract

The invention provides a virtual scene rendering method, apparatus and device, and a readable storage medium. The method comprises the steps of obtaining initial ambient light shielding, initial illumination information and an albedo map of a virtual scene; adjusting the initial illumination information according to the albedo map and the initial ambient light shielding to obtain target illumination information; processing the initial ambient light shielding based on the target illumination information to obtain adjusted target ambient light shielding; and performing scene rendering on the virtual scene through target ambient light shielding. According to the method, the initial illumination information is adjusted through the albedo map of the virtual scene and the initial ambient light shielding, the ambient light shielding is processed based on the illumination information after color adjustment, and the range of color expression is expanded by increasing the processing flow of the ambient light shielding in the color dimension, so that the processing efficiency is improved. And the visual performance effect of the rendered scene picture is improved.
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 virtual scene rendering method, device, equipment and readable storage medium. Background Art

[0002] Ambient occlusion is a rendering technique used in computer graphics to enhance the realism of a scene. It is used to simulate the shadow effect caused by light being blocked by objects in a virtual scene, thereby improving the three-dimensionality and realism of the scene. Common ambient occlusion only considers the degree to which light is blocked around a point, making corners, cracks, dents and other areas in the scene appear darker due to light blocking. In fact, the blocked areas may also have a certain brightness due to the reflection of light. Therefore, related technologies provide improvements to ambient occlusion through the albedo of objects, thereby improving the actual performance of the scene.

[0003] However, this method does not take into account that reflections will also affect the color performance of the scene, resulting in inversion of colors after rendering in some specific scene images, such as high-dynamic range (HDR) images, thus affecting the rendering effect of the scene. Summary of the invention

[0004] Based on this, it is necessary to provide a virtual scene rendering method, device, equipment and readable storage medium to address the above technical problems, so as to solve the technical problem of poor rendering effect of scenes in related technologies.

[0005] In a first aspect, the present application provides a virtual scene rendering method, comprising:

[0006] Get the initial ambient occlusion, initial lighting information and albedo map of the virtual scene;

[0007] Adjusting the initial lighting information according to the albedo map and the initial ambient occlusion to obtain target lighting information;

[0008] Processing the initial ambient occlusion based on target illumination information to obtain an adjusted target ambient occlusion;

[0009] The virtual scene is rendered by occluding the target ambient light.

[0010] In a second aspect, the present application provides a virtual scene rendering device, comprising:

[0011] An acquisition module, used to obtain the initial ambient occlusion, initial lighting information and albedo map of the virtual scene;

[0012] A processing module, configured to adjust the initial illumination information according to the albedo map and the initial ambient occlusion to obtain target illumination information;

[0013] The processing module is used to process the initial ambient light occlusion based on the target illumination information to obtain an adjusted target ambient light occlusion;

[0014] A rendering module is used to perform scene rendering on the virtual scene through the target ambient light occlusion.

[0015] In a third aspect, the present application further provides a computer device, the computer device comprising:

[0016] one or more processors;

[0017] Memory; and

[0018] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the virtual scene rendering method provided above.

[0019] In a fourth aspect, the present application also provides a computer-readable storage medium on which a computer program is stored, and the computer program is loaded by a processor to execute the virtual scene rendering method provided above.

[0020] In a fifth aspect, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being 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 executes the virtual scene rendering method provided above.

[0021] The virtual scene rendering method provided in the embodiment of the present application adjusts the initial lighting information through the albedo map and initial ambient occlusion of the virtual scene to adjust the color information in the lighting information, and then processes the ambient occlusion considering the lighting information after color adjustment. Compared with processing the ambient occlusion using only the initial albedo, the processing flow of the ambient occlusion in the color dimension is increased, and the range of color expression is expanded. Therefore, when rendering the virtual scene through the adjusted ambient occlusion, color inversion can be avoided, thereby improving the visual expression effect of the rendered scene picture. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 A schematic diagram of the effect of color inversion anomaly that occurs when the ambient occlusion technology provided by the related technology is applied to the rendering of high dynamic range images;

[0024] Figure 2 A schematic diagram of the steps of a virtual scene rendering method provided in an embodiment of the present application;

[0025] Figure 3 A schematic diagram of a flow chart of steps for adjusting lighting information according to an albedo map and ambient occlusion provided in an embodiment of the present application;

[0026] Figure 4a A schematic diagram of a process flow of determining different brightness coefficients to adjust each area respectively provided in an embodiment of the present application;

[0027] Figure 4b A schematic diagram of a color brightness chart provided in an embodiment of the present application;

[0028] Figure 4c A schematic diagram of the effect of different colors after the brightness of the colors is offset, provided in an embodiment of the present application;

[0029] Figure 5a A schematic diagram of the effect of a rendered image obtained by rendering a virtual scene through initial ambient light occlusion provided for related technologies;

[0030] Figure 5b A schematic diagram of the effect of ambient occlusion based on albedo improvement on a rendered image rendered by a virtual scene provided by the related technology;

[0031] Figure 5c A schematic diagram of the effect of a rendered image obtained by rendering a virtual scene provided in an embodiment of the present application;

[0032] Figure 6 A schematic diagram of the structure of a virtual scene rendering device provided in an embodiment of the present application;

[0033] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0035] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "plurality" means two or more, unless otherwise clearly and specifically defined.

[0036] In the description of the present application, the word "for example" is used to mean "used as an example, illustration or explanation". Any embodiment described as "for example" in the present application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is given to enable any technician in the field to implement and use the present invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present invention can be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid obscuring the description of the present invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.

[0037] To facilitate understanding of the virtual scene rendering method provided in the embodiment of the present application, some technical terms in the field of virtual scene rendering are first explained. In particular, the relevant technical terms provided in the embodiment of the present application can refer to the following description.

[0038] Ambient occlusion is a technique used to simulate the shadow effect caused by light being blocked by objects. It mainly focuses on the area on the surface of an object where the ambient light received is reduced due to its own shape or the occlusion of surrounding objects. It usually simulates the effect of global illumination by calculating the degree of light blocked around a point, so that the corners, cracks, dents and other areas in the scene appear darker due to light blocking, thereby increasing the three-dimensional sense and realism of the scene. Specifically, ambient occlusion can usually be obtained by pre-baking or real-time rendering through screen space ambient occlusion (SSAO), horizontal axis-based masking algorithm (HBAO), ground truth ambient occlusion (GTAO), etc. Among them, the map form of ambient occlusion can be obtained by pre-baking for use in the rendering process. At this time, the pixel value of the pixel point in the map usually reflects the ambient occlusion of the corresponding area in the virtual scene. For example, when the pixel value is 0, it means that the ambient light of the corresponding area is completely blocked, that is, the area is usually rendered as completely dark.

[0039] Albedo is usually represented by a diffuse map, also known as an albedo map, in which the map usually defines the color of the diffuse light, that is, the inherent color of the object's surface, and the corresponding reflection intensity.

[0040] Lighting information, generally global illumination, refers to a type of algorithm in computer graphics that can add more realistic lighting to three-dimensional scenes. It usually takes into account the light directly from the light source (i.e. direct lighting) and the light reflected by other surfaces in the scene (i.e. indirect lighting). Global illumination information usually includes the location of the light source, light intensity, color and other attribute information. Similar to ambient occlusion, global illumination can usually also be stored in the form of a map for use in the rendering process. The pixel value of the pixel in the map usually reflects the lighting information of the corresponding area in the virtual scene.

[0041] High dynamic range is a set of technologies used to achieve a larger exposure dynamic range than ordinary digital imaging technology, that is, a larger difference between light and dark (usually described by the ratio of the brightest area to the darkest area in the virtual scene), thereby improving the performance of the virtual scene.

[0042] On the basis of the above, if only ambient occlusion is used to render the scene, the completely blocked areas will be rendered completely dark. In fact, the blocked areas usually have some light reflection. Therefore, the related art proposes a method to improve ambient occlusion by albedo, that is, an ambient occlusion interreflection model is proposed, in which the improved ambient occlusion A' ρThe calculation formula is as follows:

[0043]

[0044] Among them, A is the initial ambient occlusion, which is generally the information directly stored in the ambient occlusion map, and ρ is the albedo, which can usually be obtained from the albedo map. It can be seen that in the above formula model, when the albedo ρ is zero, the ambient occlusion remains unchanged from the original A, because in the absence of light reflection, the occluded area is still black. As the albedo ρ increases, the received ambient occlusion tends to decrease, that is, materials with high albedo may reflect more light. Therefore, the improved ambient occlusion A' ρ tends towards 1. This means that materials with high albedo will appear visually brighter because they reflect light more efficiently, reducing the effect of ambient occlusion.

[0045] Through the above-mentioned related technologies, since the albedo is used to represent the factor of the intrinsic color of the object surface, the adjusted ambient occlusion is not only brighter, but also usually carries rich color information.

[0046] However, in practice, it is found that with the development of high dynamic range technology, when the albedo is used to improve the ambient occlusion in the above manner, it often leads to the improved ambient occlusion A' ρ Expanding to outside the [0,1] interval causes color inversion problems in the rendered scene, for example Figure 1 As shown, Figure 1 A schematic diagram of the effect of color inversion anomaly when the ambient light occlusion technology provided by the related technology is applied to the rendering of high dynamic range images. It should be noted that since the grayscale image cannot clearly reflect the color inversion anomaly in the image, Figure 1 The original image with color information is used. It can be seen that Figure 1 In the provided image, after rendering, a large amount of abnormal green appears in the ambient occlusion area. In other words, the above-mentioned technology for improving ambient occlusion is not ideal when applied to scenes with high dynamic range colors with strong color styles.

[0047] Precisely in order to solve the problem of poor color performance of ambient occlusion in related technologies, the present application provides a virtual scene rendering method, apparatus, device and readable storage medium, which aims to adjust the initial lighting information through the albedo and initial ambient occlusion of the virtual scene to adjust the color information in the lighting information, and then improve the ambient occlusion considering the lighting information after color adjustment. Compared with processing the ambient occlusion using only the initial albedo, the processing flow of ambient occlusion in the color dimension is added, thereby expanding the range of color performance, so that when rendering the virtual scene through the adjusted ambient occlusion, color inversion can be avoided, thereby improving the visual performance of the rendered scene.

[0048] The virtual scene rendering solution provided by this application will be described in detail below.

[0049] See also Figure 2 , Figure 2 A schematic flow chart of a virtual scene rendering method provided in an embodiment of the present application, specifically, comprising steps S210 to S240:

[0050] S210, obtaining initial ambient occlusion, initial lighting information, and albedo map of the virtual scene.

[0051] For the description of ambient occlusion, lighting information and albedo map, please refer to the description of the aforementioned related technical terms, and this embodiment will not be repeated here. Specifically, the initial ambient occlusion and initial lighting information here can all exist in the form of maps, that is, the ambient occlusion map of the virtual scene, and the global illumination map, etc. Normally, the initial ambient occlusion, initial lighting information and albedo map usually correspond to the virtual scene, that is, the information of different pixels in the map can respectively describe the ambient occlusion, lighting and albedo information of the corresponding area of ​​the virtual scene.

[0052] S220: Adjust the initial lighting information according to the albedo map and the initial ambient occlusion to obtain target lighting information.

[0053] Considering that the albedo map usually contains diffuse reflection information of the virtual scene, which is used to describe the light reflection of the virtual scene and express the color effect, the initial lighting information usually also includes attribute information such as the color of the light source. In addition, the color of the obscured dark area in the ambient occlusion usually affects the color perception of the picture in the virtual scene. Therefore, in this embodiment, considering introducing the processing of ambient occlusion in the color dimension, the albedo map and the initial ambient occlusion are first used to adjust the initial lighting information to obtain the target lighting information adjusted in the color dimension, such as suppressing color brightness or increasing the color expression range.

[0054] Specifically, considering that different colors usually have different brightness information, for example, yellow and green hues usually have relatively high brightness, while blue and purple usually have relatively low brightness. Therefore, in order to avoid the compensation of color dimension in high dynamic range color scenes, which will cause oversaturation of color and affect the rendering effect of the scene, as a feasible embodiment of the present application, the initial lighting information will be adjusted in the color dimension based on the albedo map to suppress the oversaturation of color. In addition, considering from the perspective of art style, the color of the dark area occluded by ambient light actually has a greater impact on the color perception of the scene picture. Therefore, as another feasible embodiment of the present application, the color adjustment range can also be controlled in the color dimension based on the corresponding weight.

[0055] Specifically, to facilitate understanding of the above content, as a feasible embodiment of the present application, please refer to Figure 3 , Figure 3 A schematic flow chart of a step of adjusting lighting information according to an albedo map and ambient occlusion provided in an embodiment of the present application, specifically, comprising steps S310 to S320:

[0056] S310: Process the initial illumination information according to a dot product result of the albedo in the albedo map and a preset brightness coefficient to obtain first illumination information.

[0057] Combined with the above-mentioned related description, it can be known that in order to suppress the oversaturation tendency of some colors, in this embodiment, the initial illumination information is adjusted according to the dot product result of the albedo in the albedo map and the preset brightness coefficient, that is, the oversaturation tendency of the color is offset by multiplying the albedo brightness coefficient term in the global illumination part. Specifically, to facilitate understanding of the above content, the illumination information after adjustment, that is, the calculation formula of the first illumination information Ψ′ is usually as follows:

[0058]

[0059] Among them, Ψ′ is the initial lighting information, ρ is the reflectivity of the virtual scene, which can usually be obtained from the reflectivity map, and That is, the preset brightness coefficient for adjusting the brightness of the albedo, which can usually be a linear brightness coefficient for achieving linear adjustment of the brightness. Specifically, the brightness coefficient can be understood as the weight coefficient of each pixel of the image in different color channels. For example, taking the common RGB (red green blue, the three primary colors of red, green and blue light) image as an example, the preset brightness coefficient can be regarded as the coefficient on the red, green and blue color channels. In order to achieve color oversaturation suppression, considering that the human eye is most sensitive to green light, followed by red, and blue is the lowest, therefore, under normal circumstances, the preset brightness coefficient can give the green channel a higher weight to reduce the oversaturation phenomenon that occurs after oversaturation suppression. Among them, the brightness coefficient, that is, the weight coefficient of each color channel, has different determination methods. For example, as a common feasible implementation scheme, the weight of the R color channel can be set to 0.2126, the weight of the G color channel can be set to 0.7152, and the weight of the B color channel can be set to 0.0722, or, the weight of the R color channel can be set to 0.299, the weight of the G color channel can be set to 0.587, and the weight of the B color channel can be set to 0.114, or, the weight of the R color channel can be set to 0.2627, the weight of the G color channel can be set to 0.6780, and the weight of the B color channel can be set to 0.0593. That is to say, there are the following representation results:

[0060] 0.2126×R+0.7152×G+0.0722×B;

[0061] 0.299×R+0.587×G+0.114×B;

[0062] 0.2627×R+0.6780×G+0.0593×B;

[0063] At this time, the first illumination information obtained by processing the initial illumination information also corresponds to the following calculation formula:

[0064]

[0065] Of course, the above-mentioned solution is only an example, and other weights determined based on the demand for color oversaturation suppression are also feasible, and the present application does not limit this.

[0066] By multiplying the global illumination part by the brightness coefficient term of the albedo, it is possible to suppress the areas with oversaturation tendency that may appear in the adjusted first illumination information, thereby improving the effect of subsequent rendering of the scene.

[0067] For more information, please refer to Figure 4b , Figure 4b The schematic diagram of the color brightness chart provided in the embodiment of the present application is used to indicate the brightness corresponding to different hues. It can be seen that Figure 4b In the color brightness chart shown, yellow, green, and cyan tend to have relatively high brightness and are more prone to oversaturation, while blue, purple, and other colors with relatively low brightness are less likely to be oversaturated.

[0068] See also Figure 4c , Figure 4c A schematic diagram of the effect of different colors after the brightness of the colors is offset provided in an embodiment of the present application. Specifically, it can be seen that in the original image on the left, there are multiple areas with prominent color brightness, and after the oversaturation of the colors is suppressed by the solution provided in this embodiment, the areas with prominent brightness in the image are obviously blurred, thereby reducing the probability of oversaturation in the area.

[0069] Of course, considering that the main purpose of this embodiment is to achieve brightness offset of some colors that have a tendency to be oversaturated to avoid oversaturation of such colors, therefore, as a further feasible implementation scheme of this application, the preset brightness coefficient can also be based on different areas in the virtual scene, and the brightness can be adjusted based on the brightness coefficient corresponding to its color, so as to avoid oversaturation. Specifically, for easy understanding of the above content, please refer to Figure 4a , Figure 4a A schematic flow chart of a step of determining different brightness coefficients to adjust each region respectively provided in an embodiment of the present application, specifically including steps S410 to S430:

[0070] S410: Determine color information of each area in the virtual scene based on the albedo map.

[0071] In this embodiment, since the albedo map includes the color of diffuse reflected light and is usually used to describe the intrinsic color of the surface of an object in a virtual scene, the color information of each area in the virtual scene can be preliminarily determined based on the albedo map.

[0072] S420, determining a preset brightness coefficient corresponding to each area based on brightness information corresponding to different colors and color information of each area in the virtual scene.

[0073] Taking into account the color information of each area in the virtual scene, for example, the color values ​​of the three RGB channels are different, and combined with the above description, it can be seen that different hues reflect different brightness, that is, the degree to which oversaturation tends to occur is different. Therefore, as a further optional implementation scheme of the present application, the corresponding brightness coefficient can be set for each area based on the brightness information corresponding to different colors and the color information of each area in the virtual scene. Among them, the area here can be each pixel, or a combination of multiple pixels, such as an area described by a 3×3 pixel combination, which is not limited in the present application. Specifically, the mapping relationship between the color and the set brightness coefficient can also be set based on the color provided above and the degree of oversaturation, so as to maximize the effect of suppressing the oversaturation of the color and reduce the occurrence of abnormal scenes of oversaturation.

[0074] S430: According to the dot product result of the corresponding preset brightness coefficient and the albedo of each area, the initial illumination information of each area is processed respectively to obtain first illumination information.

[0075] In this embodiment, after the corresponding brightness coefficient is determined based on the color information of different areas, the dot product result of the brightness coefficient and the albedo can be used as the brightness coefficient item of the albedo to process the lighting information of the corresponding areas in the virtual scene respectively, so that the obtained first lighting information can be further used for subsequent processing and after the rendering of the scene is completed, it can effectively suppress the color brightness in the scene.

[0076] Of course, in addition to the implementation scheme provided above, as a further feasible implementation scheme of the present application, it is also possible to further determine the target color that needs to be oversaturated suppressed based on the brightness information corresponding to different colors, for example, usually a color with higher brightness, such as a color greater than a certain brightness, such as yellow, green, etc., and further combine the albedo map to determine the target area corresponding to the target color in the virtual scene, so that in the subsequent process of adjusting the lighting information of the virtual scene, only the lighting information of the target area is processed to obtain the corresponding adjusted lighting information.

[0077] Through the solution provided in this embodiment, when considering adjusting the ambient light occlusion in the color dimension, it is possible to effectively avoid the abnormality of over-saturated colors in the rendered scene, thereby further improving the rendering effect of the virtual scene.

[0078] S320: Perform weighted processing on the first illumination information based on a weight coefficient corresponding to the initial ambient occlusion to obtain the target illumination information.

[0079] Furthermore, after the color oversaturation is suppressed by the aforementioned method and the first illumination information is obtained, considering that from the perspective of art style, the color of the ambient occlusion has a relatively large impact on the color perception of the scene image, therefore, in this embodiment, a method is also proposed to perform weighted processing on the first illumination information based on the weight coefficient corresponding to the initial ambient light occlusion, so as to further obtain the global illumination result after the color range is adjusted. Specifically, the global illumination result after adjustment, that is, the calculation formula of the target illumination information Ψ″ is as follows:

[0080] Ψ″=(1-A)×Ψ′+A;

[0081] Wherein, A is the initial ambient occlusion, and Ψ″ is the first lighting information obtained by processing the initial lighting information through the albedo map mentioned above.

[0082] Specifically, when the initial ambient occlusion is close to 1, the weight coefficient of the first illumination information is relatively lower, and at this time, the target illumination information has a relatively higher color influence range. On the contrary, when the initial ambient occlusion is close to 0, the weight coefficient of the first illumination information is higher, and usually, the target illumination information has a relatively lower color influence range. Through the above scheme, the color feeling of the rendered scene image can be effectively adjusted through the shaded dark area in the virtual scene.

[0083] On this basis, further, as a feasible embodiment of the present application, weighted processing is performed on the first illumination information based on the weight coefficient corresponding to the initial ambient light occlusion to obtain the target illumination information, and processing can also be performed on the shaded dark area in the virtual scene. That is, weighted processing is performed on the first illumination information based on the weight coefficient corresponding to the initial ambient light occlusion to obtain the target illumination information, including:

[0084] Determining an occluded area in the virtual scene based on an initial ambient occlusion of the virtual scene;

[0085] The first illumination information in the occluded area is weighted according to the weight coefficient corresponding to the initial ambient light occlusion to obtain the target illumination information.

[0086] Among them, the occluded area in the virtual scene usually refers to the area where the corresponding initial ambient light occlusion is less than a certain threshold. Under normal circumstances, this occluded area will be rendered as a dark color. The solution provided in this embodiment can be used to adjust the color influence range of the global illumination information in the occluded area, which can effectively adjust the color influence range of the area, thereby effectively improving the color perception of the scene image obtained by subsequent rendering.

[0087] S230: Process the initial ambient occlusion based on the target illumination information to obtain an adjusted target ambient occlusion.

[0088] In the present embodiment, after the adjustment of the lighting information in the color dimension is completed by using the albedo map and the initial ambient occlusion as mentioned above, the initial ambient occlusion is further processed using the adjusted target lighting information. Compared with the single adjustment of the initial ambient occlusion through albedo, by adding the processing in the color dimension, the color expression range of the virtual scene is expanded while avoiding color oversaturation. Therefore, when the scene rendering of the virtual scene is completed by using the adjusted target ambient occlusion, the visual effect expression of the rendered scene image is effectively improved.

[0089] Specifically, to facilitate understanding of the implementation scheme for processing the initial ambient light occlusion based on the target illumination information provided by the present application, in the present embodiment, the update amount of the ambient light occlusion is determined by the target illumination information and the preset brightness coefficient, and the initial ambient light occlusion is processed based on the update amount of the ambient light occlusion to obtain the adjusted target ambient light occlusion, that is, the initial ambient light occlusion is processed based on the target illumination information to obtain the adjusted target ambient light occlusion, specifically including:

[0090] Determining an update amount of ambient occlusion based on the target lighting information and a preset brightness coefficient;

[0091] The initial ambient occlusion is processed according to the update amount to obtain an adjusted target ambient occlusion.

[0092] The preset brightness coefficient used in determining the update amount of ambient occlusion is usually related to the preset brightness coefficient used in the aforementioned step S310, and may be specifically determined by the color information in the target illumination information.

[0093] Furthermore, to facilitate understanding of the above solution, the adjusted target ambient occlusion A′ Ψ″ The calculation formula is as follows:

[0094]

[0095] Among them, Ψ″ is the target lighting information after the color adjustment of the initial lighting information through the albedo map and the initial ambient light occlusion, and It can be understood as the update amount of ambient light occlusion determined based on the target lighting information and the preset brightness coefficient, and on the basis of the initial ambient light occlusion A, the adjusted target ambient light occlusion A′ can be obtained by adding the update amount. Ψ″ .

[0096] S240: Rendering the virtual scene by using the target ambient light occlusion.

[0097] By updating the ambient occlusion in the manner provided above, the target ambient occlusion adjusted in the color dimension is obtained. In the subsequent scene rendering process of the virtual scene based on the target ambient occlusion, the color expression range of the rendered scene image can be effectively expanded, thereby enhancing the expressiveness of the visual effect.

[0098] In addition, it should be noted that the virtual scene rendering method provided by the present application is particularly suitable for virtual scenes with strong color styles, that is, high dynamic range colors. It can effectively avoid the expansion of ambient light occlusion caused by the introduction of albedo to update ambient light occlusion outside the [0,1] interval, thereby causing the rendered scene image to have abnormal inversion color problems. That is to say, in the process of the virtual scene rendering method provided by the embodiment of the present application, the dynamic range of the virtual scene can also be determined by detecting the initial lighting information of the virtual scene, and when it is confirmed that the virtual scene is a high dynamic range, that is, when the problem of abnormal inversion color may occur after rendering, the initial lighting information is adjusted by the albedo map and the initial ambient light occlusion, and the adjusted target lighting information is obtained for the improvement of ambient light occlusion, thereby improving the final rendering effect. That is to say, the initial lighting information is adjusted according to the albedo map and the initial ambient light occlusion. Before obtaining the target lighting information, the virtual scene rendering method also includes:

[0099] Determining a dynamic range of the virtual scene according to the initial illumination information;

[0100] In the case where the dynamic range is a high dynamic range, the step of adjusting the initial lighting information according to the albedo map and the initial ambient occlusion to obtain target lighting information is performed.

[0101] In addition, when the dynamic range of the virtual scene is determined to be a low dynamic range according to the initial illumination information, the initial ambient occlusion may be adjusted directly based on the albedo map to render the virtual scene using the adjusted ambient occlusion.

[0102] Specifically, in order to facilitate understanding of the effects achieved by the virtual scene rendering method provided in the embodiments of the present application, please refer to Figure 5a to Figure 5c , are schematic diagrams of the effects of rendering images obtained by initial ambient occlusion, ambient occlusion based on albedo improvement, and the virtual scene rendering method provided in an embodiment of the present application on the same virtual scene, which are described in detail as follows.

[0103] See also Figure 5a,After the rendering of the virtual scene is completed through the conventional initial ambient occlusion, it can be seen that the color of the occluded area is relatively darker, while in contrast, Figure 5b The improved initial ambient occlusion based on albedo shown in FIG. 1 fully considers the light reflection phenomenon in the virtual scene because the albedo, a factor representing the intrinsic color of the object surface, is introduced, making the color of the occluded area relatively brighter. Figure 5c In the virtual scene rendering method provided by the embodiment of the present application, since the ambient light occlusion is improved in the color dimension, the range of color expression is expanded, so that the color information of the scene image obtained after rendering is richer, and the visual effect is improved.

[0104] The virtual scene rendering method provided in the embodiment of the present application adjusts the initial lighting information through the albedo map and initial ambient occlusion of the virtual scene to adjust the color information in the lighting information, and then processes the ambient occlusion considering the lighting information after color adjustment. Compared with processing the ambient occlusion using only the initial albedo, the processing flow of the ambient occlusion in the color dimension is increased, and the range of color expression is expanded. Therefore, when rendering the virtual scene through the adjusted ambient occlusion, color inversion can be avoided, thereby improving the visual expression effect of the rendered scene picture.

[0105] In order to better implement the virtual scene rendering method provided in the embodiment of the present application, on the basis of the virtual scene rendering method provided in the embodiment of the present application, a virtual scene rendering device is also provided in the embodiment of the present application, such as Figure 6 As shown, the virtual scene rendering device 600 includes:

[0106] An acquisition module 610 is used to acquire initial ambient occlusion, initial lighting information and albedo map of a virtual scene;

[0107] A processing module 620 is used to adjust the initial illumination information according to the albedo map and the initial ambient occlusion to obtain target illumination information;

[0108] The processing module 620 is used to process the initial ambient light occlusion based on the target illumination information to obtain an adjusted target ambient light occlusion;

[0109] The rendering module 630 is used to perform scene rendering on the virtual scene by using the target ambient light occlusion.

[0110] In some embodiments of the present application, the processing module 620 is also used to process the initial lighting information according to the dot product result of the albedo and the preset brightness coefficient in the albedo map to obtain the first lighting information; and to weight the first lighting information based on the weight coefficient corresponding to the initial ambient occlusion to obtain the target lighting information.

[0111] In some embodiments of the present application, the processing module 620 is also used to determine the color information of each area in the virtual scene based on the albedo map; determine the preset brightness coefficient corresponding to each area based on the brightness information corresponding to different colors and the color information of each area in the virtual scene; and process the initial lighting information of each area according to the dot product result of the corresponding preset brightness coefficient of each area and the albedo to obtain the first lighting information.

[0112] In some embodiments of the present application, the processing module 620 is also used to determine the target color based on brightness information corresponding to different colors, and to determine the target area corresponding to the target color in the virtual scene; and to process the initial lighting information of the target area according to the dot product result of the preset brightness coefficient corresponding to the target area and the albedo to obtain the first lighting information.

[0113] In some embodiments of the present application, the processing module 620 is also used to determine the shielded area in the virtual scene based on the initial ambient light occlusion of the virtual scene; and weightedly process the first lighting information in the shielded area according to the weight coefficient corresponding to the initial ambient light occlusion to obtain the target lighting information.

[0114] In some embodiments of the present application, the processing module 620 is further used to determine an update amount of ambient light occlusion based on the target lighting information and a preset brightness coefficient; and process the initial ambient light occlusion according to the update amount to obtain an adjusted target ambient light occlusion.

[0115] In some embodiments of the present application, the processing module 620 is also used to determine the dynamic range of the virtual scene based on the initial lighting information; when the dynamic range is a high dynamic range, the initial lighting information is adjusted according to the albedo map and the initial ambient occlusion to obtain target lighting information.

[0116] In some embodiments of the present application, the processing module 620 is further used to adjust the initial ambient occlusion according to the albedo map when the dynamic range is a low dynamic range, and to perform scene rendering on the virtual scene according to the adjusted ambient occlusion.

[0117] For the specific definition of the virtual scene rendering device, please refer to the definition of the virtual scene rendering method above, which will not be repeated here. Each module in the above virtual scene rendering device can be implemented in whole or in part by software, hardware and a combination thereof. The above 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.

[0118] The virtual scene rendering method provided in the embodiment of the present application adjusts the initial lighting information through the albedo map and initial ambient occlusion of the virtual scene to adjust the color information in the lighting information, and then processes the ambient occlusion considering the lighting information after color adjustment. Compared with processing the ambient occlusion using only the initial albedo, the processing flow of the ambient occlusion in the color dimension is increased, and the range of color expression is expanded. Therefore, when rendering the virtual scene through the adjusted ambient occlusion, color inversion can be avoided, thereby improving the visual expression effect of the rendered scene picture.

[0119] In some embodiments of the present application, the virtual scene rendering device 600 can be implemented in the form of a computer program. The computer program can be used in Figure 7 The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the virtual scene rendering device 600, for example, Figure 6 The acquisition module 610, processing module 620 and rendering module 630 are shown. The computer program composed of various program modules enables the processor to execute the steps of the virtual scene rendering method of each embodiment of the present application described in this specification.

[0120] For example, Figure 7 The computer device shown can be Figure 6 The acquisition module 610 in the virtual scene rendering device 600 shown executes step S210. The computer device can execute steps S220 and S230 through the processing module 620. The computer device can execute step S240 through the rendering module 630. The computer device includes a processor, a memory and a network interface 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 network interface of the computer device is used to communicate with an external computer device through a network connection. When the computer program is executed by the processor, a virtual scene rendering method is implemented.

[0121] Those skilled in the art will understand that Figure 7 The 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.

[0122] In some embodiments of the present application, a computer device is provided, comprising one or more processors; a memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the following steps:

[0123] Get the initial ambient occlusion, initial lighting information and albedo map of the virtual scene;

[0124] Adjusting the initial lighting information according to the albedo map and the initial ambient occlusion to obtain target lighting information;

[0125] Processing the initial ambient occlusion based on target illumination information to obtain an adjusted target ambient occlusion;

[0126] The virtual scene is rendered by occluding the target ambient light.

[0127] In some embodiments of the present application, the processor also implements the following steps when executing the computer program: processing the initial lighting information according to the dot product result of the albedo and the preset brightness coefficient in the albedo map to obtain first lighting information; weighting the first lighting information based on the weight coefficient corresponding to the initial ambient occlusion to obtain the target lighting information.

[0128] In some embodiments of the present application, the processor also implements the following steps when executing the computer program: determining the color information of each area in the virtual scene based on the albedo map; determining a preset brightness coefficient corresponding to each area based on brightness information corresponding to different colors and the color information of each area in the virtual scene; and processing the initial lighting information of each area separately according to the dot product result of the corresponding preset brightness coefficient of each area and the albedo to obtain first lighting information.

[0129] In some embodiments of the present application, the processor also implements the following steps when executing the computer program: determining the target color based on brightness information corresponding to different colors, and determining the target area corresponding to the target color in the virtual scene; processing the initial lighting information of the target area according to the dot product result of the preset brightness coefficient corresponding to the target area and the albedo to obtain first lighting information.

[0130] In some embodiments of the present application, the processor further implements the following steps when executing a computer program: determining a shielded area in the virtual scene based on the initial ambient light occlusion of the virtual scene; performing weighted processing on the first lighting information in the shielded area according to a weight coefficient corresponding to the initial ambient light occlusion to obtain the target lighting information.

[0131] In some embodiments of the present application, when the processor executes the computer program, it also implements the following steps: determining an update amount of ambient light occlusion based on the target lighting information and a preset brightness coefficient; processing the initial ambient light occlusion according to the update amount to obtain an adjusted target ambient light occlusion.

[0132] In some embodiments of the present application, when the processor executes the computer program, the following steps are also implemented: determining the dynamic range of the virtual scene based on the initial lighting information; when the dynamic range is a high dynamic range, adjusting the initial lighting information according to the albedo map and the initial ambient occlusion to obtain target lighting information.

[0133] In some embodiments of the present application, when the processor executes the computer program, the following steps are also implemented: when the dynamic range is a low dynamic range, adjusting the initial ambient occlusion according to the albedo map, and performing scene rendering on the virtual scene according to the adjusted ambient occlusion.

[0134] In some embodiments of the present application, a computer-readable storage medium is provided, which stores a computer program. The computer program is loaded by a processor, so that the processor performs the following steps:

[0135] Get the initial ambient occlusion, initial lighting information and albedo map of the virtual scene;

[0136] Adjusting the initial lighting information according to the albedo map and the initial ambient occlusion to obtain target lighting information;

[0137] Processing the initial ambient occlusion based on target illumination information to obtain an adjusted target ambient occlusion;

[0138] The virtual scene is rendered by occluding the target ambient light.

[0139] In some embodiments of the present application, the processor also implements the following steps when executing the computer program: processing the initial lighting information according to the dot product result of the albedo and the preset brightness coefficient in the albedo map to obtain first lighting information; weighting the first lighting information based on the weight coefficient corresponding to the initial ambient occlusion to obtain the target lighting information.

[0140] In some embodiments of the present application, the processor also implements the following steps when executing the computer program: determining the color information of each area in the virtual scene based on the albedo map; determining a preset brightness coefficient corresponding to each area based on brightness information corresponding to different colors and the color information of each area in the virtual scene; and processing the initial lighting information of each area separately according to the dot product result of the corresponding preset brightness coefficient of each area and the albedo to obtain first lighting information.

[0141] In some embodiments of the present application, the processor also implements the following steps when executing the computer program: determining the target color based on brightness information corresponding to different colors, and determining the target area corresponding to the target color in the virtual scene; processing the initial lighting information of the target area according to the dot product result of the preset brightness coefficient corresponding to the target area and the albedo to obtain first lighting information.

[0142] In some embodiments of the present application, the processor further implements the following steps when executing a computer program: determining a shielded area in the virtual scene based on the initial ambient light occlusion of the virtual scene; performing weighted processing on the first lighting information in the shielded area according to a weight coefficient corresponding to the initial ambient light occlusion to obtain the target lighting information.

[0143] In some embodiments of the present application, when the processor executes the computer program, it also implements the following steps: determining an update amount of ambient light occlusion based on the target lighting information and a preset brightness coefficient; processing the initial ambient light occlusion according to the update amount to obtain an adjusted target ambient light occlusion.

[0144] In some embodiments of the present application, when the processor executes the computer program, the following steps are also implemented: determining the dynamic range of the virtual scene based on the initial lighting information; when the dynamic range is a high dynamic range, adjusting the initial lighting information according to the albedo map and the initial ambient occlusion to obtain target lighting information.

[0145] In some embodiments of the present application, when the processor executes the computer program, the following steps are also implemented: when the dynamic range is a low dynamic range, adjusting the initial ambient occlusion according to the albedo map, and performing scene rendering on the virtual scene according to the adjusted ambient occlusion.

[0146] 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. Any reference to memory, storage, information library or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may 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).

[0147] 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.

[0148] The above is a detailed introduction to a virtual scene rendering method, device, equipment and readable storage medium provided in the embodiments of the present application. 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 of the present invention and its core idea. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A virtual scene rendering method, characterized in that: include: Get the initial ambient occlusion, initial lighting information and albedo map of the virtual scene; Adjusting the initial lighting information according to the albedo map and the initial ambient occlusion to obtain target lighting information; Processing the initial ambient occlusion based on target illumination information to obtain an adjusted target ambient occlusion; The virtual scene is rendered by occluding the target ambient light.

2. The method according to claim 1, characterized in that The adjusting the initial illumination information according to the albedo map and the initial ambient occlusion to obtain target illumination information includes: Processing the initial illumination information according to a dot product result of the albedo in the albedo map and a preset brightness coefficient to obtain first illumination information; The first illumination information is weighted based on a weight coefficient corresponding to the initial ambient occlusion to obtain the target illumination information.

3. The method according to claim 2, characterized in that The processing of the initial illumination information according to the dot product result of the albedo and the preset brightness coefficient in the albedo map to obtain the first illumination information includes: Determining color information of each area in the virtual scene based on the albedo map; Determine a preset brightness coefficient corresponding to each area based on brightness information corresponding to different colors and color information of each area in the virtual scene; According to the dot product result of the corresponding preset brightness coefficient and the albedo of each area, the initial illumination information of each area is processed respectively to obtain the first illumination information.

4. The method according to claim 3, characterized in that The method further comprises: Determining a target color based on brightness information corresponding to different colors, and determining a target area corresponding to the target color in the virtual scene; The initial illumination information of each region is processed according to the dot product result of the corresponding preset brightness coefficient and the albedo of each region to obtain the first illumination information, including: The initial illumination information of the target area is processed according to a dot product result of a preset brightness coefficient corresponding to the target area and the albedo to obtain first illumination information.

5. The method according to claim 2, characterized in that: The step of performing weighted processing on the first illumination information based on the weight coefficient corresponding to the initial ambient light occlusion to obtain the target illumination information includes: Determining an occluded area in the virtual scene based on an initial ambient occlusion of the virtual scene; The first illumination information in the occluded area is weighted according to the weight coefficient corresponding to the initial ambient light occlusion to obtain the target illumination information.

6. The method according to claim 1, characterized in that The processing of the initial ambient occlusion based on the target illumination information to obtain an adjusted target ambient occlusion includes: Determining an update amount of ambient occlusion based on the target lighting information and a preset brightness coefficient; The initial ambient occlusion is processed according to the update amount to obtain an adjusted target ambient occlusion.

7. The method according to claim 6, characterized in that The preset brightness coefficient is determined based on color information in the target lighting information.

8. The method according to any one of claims 1 to 7, characterized in that: Before adjusting the initial illumination information according to the albedo map and the initial ambient occlusion to obtain target illumination information, the method further includes: Determining a dynamic range of the virtual scene according to the initial illumination information; In the case where the dynamic range is a high dynamic range, the step of adjusting the initial lighting information according to the albedo map and the initial ambient occlusion to obtain target lighting information is performed.

9. The method according to claim 8, characterized in that The method further comprises: In a case where the dynamic range is a low dynamic range, the initial ambient occlusion is adjusted according to the albedo map, and scene rendering is performed on the virtual scene according to the adjusted ambient occlusion.

10. A virtual scene rendering method, characterized in that: include: An acquisition module, used to obtain the initial ambient occlusion, initial lighting information and albedo map of the virtual scene; A processing module, configured to adjust the initial illumination information according to the albedo map and the initial ambient occlusion to obtain target illumination information; The processing module is used to process the initial ambient light occlusion based on the target illumination information to obtain an adjusted target ambient light occlusion; A rendering module is used to perform scene rendering on the virtual scene through the target ambient light occlusion.

11. A computer device, characterized in that: The computer device comprises: one or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the virtual scene rendering method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is loaded by a processor to execute the virtual scene rendering method according to any one of claims 1 to 10.