Ambient light shielding method, ambient light shielding processing system and readable storage medium

By using actual attenuation values ​​and preset weights to process the second type of sampling point occlusion information of the shadow area, the problem of insufficient brightness in the shadow part in the prior art is solved, and a more natural shadow effect and higher image quality are achieved.

CN112446945BActive Publication Date: 2025-03-07SHENZHEN VISTANDARD DIGITAL TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011301044.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-19
Publication Date
2025-03-07
Estimated Expiration
2040-11-19

AI Technical Summary

Technical Problem

In computer graphics rendering, the ambient light occlusion degree is calculated by calculating the degree of occlusion of the sampling points and target points in the computer, resulting in excessive unnatural shadows and insufficient brightness.

Method used

The second type of sampling point occlusion information corresponding to the shadow area is calculated by the actual attenuation value and the preset weight, and the second delayed illumination information is obtained, and image display is performed based on the information to enhance the brightness of the shadow part and close to the real indirect illumination.

Benefits of technology

The brightness of the shadow part is improved, making it closer to real indirect lighting, and enhances the sense of layering and contrast of computer images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112446945B_ABST
    Figure CN112446945B_ABST
Patent Text Reader

Abstract

The present application discloses an ambient light shielding method, an ambient light shielding processing system and a readable storage medium. The ambient light shielding method includes: obtaining sampling point occlusion information according to sampling point position information, obtaining first-type sampling point occlusion information and second-type sampling point occlusion information according to the sampling point occlusion information; obtaining first delayed illumination information according to the first-type sampling point occlusion information, first differential solid angle information, and preset radiation brightness; obtaining an offset vector and vector length according to the second-type sampling point occlusion information and sampling point position information to obtain an actual attenuation value; obtaining second delayed illumination information according to the second-type sampling point occlusion information, actual attenuation value, preset weight, and second differential solid angle. The present application can display an image according to the second delayed illumination information, so that the display brightness of the shadow part of the image is enhanced and closer to the real indirect illumination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer graphics rendering, and in particular to an ambient light occlusion method, an ambient light occlusion processing system and a computer-readable storage medium. Background Art

[0002] In the related art, the screen space ambient light is shielded to improve the layering and contrast of computer image rendering.

[0003] However, the degree of primitive occlusion is generally calculated by the change in depth values ​​of the sampling points and the target points, and ambient occlusion processing is performed based on the degree of primitive occlusion. The direct lighting contribution of the sampling points corresponding to the primitives is used as their indirect lighting, which can easily make the shadows of computer images overly unnatural and insufficiently bright. Summary of the invention

[0004] The present invention application aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention application proposes an ambient light occlusion method, an ambient light occlusion processing system and a computer-readable storage medium, which can calculate and process the second type of sampling point occlusion information corresponding to the shadow area through the actual attenuation value and the preset weight to obtain the second delayed illumination information, and display the image according to the second delayed illumination information, so that the display brightness of the shadow part of the image is enhanced and closer to the real indirect illumination.

[0005] According to the first aspect of the present invention, the ambient light shielding method includes: obtaining sampling point occlusion information according to sampling point position information, and obtaining first-category sampling point occlusion information and second-category sampling point occlusion information according to the sampling point occlusion information; obtaining first delayed illumination information according to the first-category sampling point occlusion information, first differential solid angle information, and preset radiation brightness; obtaining an offset vector and a vector length according to the second-category sampling point occlusion information and the sampling point position information to obtain an actual attenuation value; obtaining second delayed illumination information according to the second-category sampling point occlusion information, the actual attenuation value, a preset weight, and a second differential solid angle; and displaying an image according to the first delayed illumination information and the second delayed illumination information.

[0006] The ambient light shielding method according to the embodiment of the present invention has at least the following beneficial effects: the second delayed lighting information is obtained by calculating and processing the occlusion information of the second type of sampling points in the shadow area through the actual attenuation value and the preset weight, so that the display brightness of the shadow part of the image is enhanced and closer to the real indirect lighting.

[0007] According to some embodiments of the present invention, the acquiring of initial battery parameters and the obtaining of sampling point occlusion information according to sampling point position information include:

[0008] The sampling point position is obtained according to the target pixel position information and the random variable, and the sampling point position is transformed according to the camera matrix and the projection matrix to obtain the sampling point occlusion information.

[0009] According to some embodiments of the present invention, the sampling point position includes first coordinate information and second coordinate information, and obtaining first-category sampling point occlusion information and second-category sampling point occlusion information according to the sampling point occlusion information includes:

[0010] Sampling the geometry buffer according to the first coordinate information and the second coordinate information to obtain first geometry buffer position information, and obtaining depth information according to the first geometry buffer position information;

[0011] Obtaining an occlusion value according to the depth information;

[0012] The first-category sampling point occlusion information and the second-category sampling point occlusion information are obtained according to the sampling point occlusion information and the occlusion value.

[0013] According to some embodiments of the present invention, obtaining the first delayed illumination information according to the first type of sampling point occlusion information, the first differential solid angle information, and the preset radiation brightness includes:

[0014] Obtaining a first sampling delayed radiance according to the first type of sampling point shading information and the preset radiance;

[0015] Obtaining the first differential solid angle information according to the number of sampling kernels;

[0016] Obtaining a first-class cosine value according to the target pixel position information and the sampling kernel number;

[0017] The first delayed illumination information is obtained according to the first-type sampling point occlusion information, the first sampling delayed radiance, the first differential solid angle information, and the first-type cosine value.

[0018] According to some embodiments of the present invention, obtaining the first delayed illumination information according to the first type of sampling point occlusion information, the first differential solid angle information, and the preset radiation brightness includes:

[0019] Obtaining a first sampling delayed radiance according to the first type of sampling point shading information and the preset radiance;

[0020] Obtaining the first differential solid angle information according to the number of sampling kernels;

[0021] Obtaining a first-class cosine value according to the target pixel position information and the sampling kernel number;

[0022] The first delayed illumination information is obtained according to the first-type sampling point occlusion information, the first sampling delayed radiance, the first differential solid angle information, and the first-type cosine value.

[0023] According to some embodiments of the present invention, obtaining the second delayed illumination information according to the second type of sampling point occlusion information, the actual attenuation value, the preset weight, and the second differential solid angle further includes:

[0024] Obtaining the preset weight according to the component of the actual attenuation value;

[0025] Obtaining a hierarchical coefficient group according to preset spherical harmonic coefficients, and obtaining an actual weight according to the hierarchical coefficients and the preset weights;

[0026] The second delayed illumination information is obtained according to the actual attenuation value, the actual weight, the second type of sampling point occlusion information, and the second differential solid angle.

[0027] According to some embodiments of the present invention, obtaining the first-category sampling point occlusion information and the second-category sampling point occlusion information according to the sampling point occlusion information and the occlusion value further includes:

[0028] A judgment threshold is set according to the occlusion value to obtain an occlusion threshold;

[0029] If the occlusion value is less than or equal to the occlusion threshold, the corresponding sampling point occlusion information is the first type of sampling point occlusion information;

[0030] and\or,

[0031] A judgment threshold is set according to the occlusion value to obtain an occlusion threshold;

[0032] If the occlusion value is greater than the occlusion threshold, the corresponding sampling point occlusion information is the second type of sampling point occlusion information.

[0033] According to some embodiments of the present invention, obtaining a hierarchical coefficient group according to preset spherical harmonic coefficients, and obtaining an actual weight according to the hierarchical coefficient group and the preset weight further includes:

[0034] Obtaining a hierarchical coefficient group according to preset spherical harmonic coefficients, wherein the hierarchical coefficient group is provided with six hierarchical coefficients;

[0035] The actual weight is obtained according to the level coefficient and the preset weight.

[0036] According to the second aspect of the present invention, the ambient light occlusion processing system includes: a memory on which a computer program is stored; and a processor for executing the computer program in the memory to implement the ambient light occlusion method in any of the above embodiments.

[0037] According to a third aspect of an embodiment of the present invention, a computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to: execute the ambient light shielding method in any of the above embodiments.

[0038] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The present invention will be further described below with reference to the accompanying drawings and embodiments, wherein:

[0040] Figure 1 This is a flow chart of an ambient light shielding method in an embodiment of the present application;

[0041] Figure 2 This is a flow chart of an ambient light shielding method in an embodiment of the present application;

[0042] Figure 3 This is a flow chart of an ambient light shielding method in another embodiment of the present application;

[0043] Figure 4 This is a flow chart of an ambient light shielding method in yet another embodiment of the present application;

[0044] Figure 5 This is a flow chart of an ambient light shielding method in yet another embodiment of the present application. DETAILED DESCRIPTION

[0045] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0046] In the description of the present invention, it should be understood that descriptions involving orientations, such as up, down, front, back, left, right, etc., and orientations or positional relationships indicated are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present invention.

[0047] In the description of the present invention, "several" means more than one, "many" means more than two, "greater than", "less than", "exceed", etc. are understood to exclude the number itself, and "above", "below", "within", etc. are understood to include the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.

[0048] In the description of the present invention, unless otherwise clearly defined, terms such as setting, installing, connecting, etc. should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above terms in the present invention based on the specific content of the technical solution.

[0049] In the description of the present invention, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0050] In related technologies, screen space ambient occlusion processing samples information around pixels and performs simple depth value comparison to calculate the range on the object that ambient light cannot reach, thereby approximately showing the outline shadow of the object under ambient light to improve the layering and contrast of computer image rendering.

[0051] However, in actual processing, the degree of primitive occlusion is calculated by the change in the depth values ​​of the sampling point and the target point, and the degree of primitive occlusion is processed by ambient light occlusion, which can easily make the shadow part of the computer image excessively unnatural and insufficiently bright.

[0052] Based on the above problems, the present application provides an ambient light occlusion method, which calculates and processes the occlusion information of the second type of sampling points in the shadow area through actual attenuation values ​​and preset weights to obtain second delayed lighting information, thereby enhancing the brightness of the shadow part of the image and being closer to real indirect lighting.

[0053] Please refer to Figure 1In some embodiments, the ambient light shielding method includes: step S100, obtaining sampling point occlusion information according to sampling point position information, and obtaining first-category sampling point occlusion information and second-category sampling point occlusion information according to the sampling point occlusion information; step S200, obtaining first delayed illumination information according to the first-category sampling point occlusion information, first differential solid angle information, and preset radiation brightness; step S300, obtaining an offset vector and a vector length according to the second-category sampling point occlusion information and sampling point position information to obtain an actual attenuation value; step S400, obtaining second delayed illumination information according to the second-category sampling point occlusion information, the actual attenuation value, the preset weight, and the second differential solid angle; step S500, displaying an image according to the first delayed illumination information and the second delayed illumination information.

[0054] The sampling point occlusion information is obtained according to the position of the sampling point position information in the coordinate system, and the sampling point occlusion information is used to indicate the degree to which each sampling point is occluded by other primitives. It can be understood that the degree to which each sampling point is occluded by other primitives is obtained according to the position of the sampling point position information in the coordinate system, and the sampling points to be calculated are traversed to obtain the degree to which the pixels corresponding to all sampling points are occluded by other primitives.

[0055] The types of sampling points are distinguished according to the degree to which the pixels are blocked by other primitives to obtain first-class sampling points, second-class sampling points, first-class sampling point blocking information corresponding to the first-class sampling points, and second-class sampling point blocking information corresponding to the second-class sampling points. For example, the corresponding pixels of the first-class sampling points are sampling points whose degree of blocking by other primitives is 0, and the corresponding pixels of the second-class sampling points are sampling points whose degree of blocking by other primitives is not 0.

[0056] Further, the first delayed illumination information is obtained according to the first type of sampling point occlusion information, the first differential solid angle information, and the preset radiation brightness. The first delayed illumination information is obtained according to the first differential solid angle information corresponding to the first type of sampling point occlusion information and the preset radiation brightness. The first delayed illumination information is used to display the non-shadow part of the computer image, and the degree of occlusion of the non-shadow part by other primitives is 0.

[0057] Furthermore, the offset vector is obtained according to the occlusion information of the second-category sampling point and the sampling point position information, and the actual attenuation value is obtained by the vector length. The second-category sampling point corresponding to the occlusion information of the second-category sampling point, and the sampling point whose degree of occlusion of the pixel or center point corresponding to the second-category sampling point by other primitives is not 0. The degree of occlusion of the primitive corresponding to the second-category sampling point by other primitives is obtained according to the occlusion information of the second-category sampling point, and the offset vector is obtained according to the sampling point position information corresponding to the second-category sampling point. The offset vector is used to represent the offset amount and offset direction between the second-category sampling point and the center point corresponding to the second-category sampling point. The actual attenuation value of the radiant brightness is obtained according to the offset vector to obtain the attenuation degree of the global illumination brightness of the shadow part of the computer image.

[0058] Further, the second delayed illumination information is obtained according to the occlusion information of the second type of sampling points, the actual attenuation value, the preset weight, and the second differential solid angle. It can be understood that the second delayed illumination information is obtained according to the attenuation degree of the global illumination brightness of the shadow part of the computer image, the preset weight, the second differential solid angle, and the position of the second type of sampling points. The first delayed illumination information is used to display the shadow part of the computer image, and the degree to which the shadow part is occluded by other primitives is not zero.

[0059] The image is displayed according to the first delayed lighting information and the second delayed lighting information to obtain a global image. It can be understood that the screen space is shaded according to the first delayed lighting information and the second delayed lighting information to increase the brightness of the shadow part of the computer image and make the lighting effect of the computer image closer to the real indirect lighting.

[0060] The above ambient light occlusion method can be applied to scenes such as three-dimensional game real-scene rendering and indoor scene refinement.

[0061] In some embodiments, the pixel point corresponding to the sampling point is P, and the occlusion function of the pixel point P is V(P), where V(P) is used to indicate the degree to which the pixel point is occluded.

[0062]

[0063] Among them, 0 means not blocked, and 1 means blocked.

[0064] In some embodiments, step S100, obtaining sampling point occlusion information according to sampling point position information, and obtaining first-category sampling point occlusion information and second-category sampling point occlusion information according to the sampling point occlusion information, include: step S101, obtaining the sampling point position according to target pixel position information and random variables, and transforming the sampling point position according to the camera matrix and the projection matrix to obtain the sampling point occlusion information.

[0065] The position of the current target pixel is obtained according to the target pixel position information, and the sampling point position is obtained according to the position of the current target pixel and the random vector in the sampling kernel; the sampling point position is transformed according to the camera matrix and the projection matrix to obtain the sampling point occlusion information.

[0066] For example, sampling point position = current target pixel position + random vector in sampling kernel. That is, the sampling point position is calculated by taking the position of the current target pixel in the coordinate system (coordinate point) as the starting point and the random vector in the sampling kernel as the offset of the starting point.

[0067] Among them, the sampling point position is transformed according to the camera matrix and the projection matrix to obtain the sampling point occlusion information, which can be specifically performed in the following steps:

[0068] The sampling point position is converted to the Normalized Device Coordinates (NDC space) through the camera matrix view and the projection matrix project, and the sampling point position is limited to a preset range.

[0069] Among them, the Normalized Device Coordinates (NDC space) refers to the point in the homogeneous coordinate system obtained after the vertex P is transformed by the world matrix, camera matrix, and projection matrix, which is recorded as P'=(x / w, y / w, z / w, w / w), that is, P'=(x / w, y / w, z / w, 1).

[0070] In some embodiments, the sampling point position is converted to the normalized device coordinates by using the camera matrix view and the projection matrix project, and the range of the sampling point position is limited to [0.0, 1.0] by using the clamp function.

[0071] The sampling point position is limited to [0.0, 1.0] to prevent the sampling point position from exceeding the processable range.

[0072] Please refer to Figure 2In some embodiments, the sampling point position includes first coordinate information and second coordinate information. Step S100, obtaining sampling point occlusion information according to the sampling point position information, and obtaining first-category sampling point occlusion information and second-category sampling point occlusion information according to the sampling point occlusion information, includes: step S110, sampling the geometric buffer according to the first coordinate information and the second coordinate information to obtain first geometric buffer position information, and obtaining depth information according to the first geometric buffer position information; step S120, obtaining occlusion value according to the depth information; step S130, obtaining first-category sampling point occlusion information and second-category sampling point occlusion information according to the sampling point occlusion information and the occlusion value.

[0073] The first coordinate information and the second coordinate information in the sampling point position (sample Position) are converted into coordinate systems to obtain the geometric coordinates in the geometry buffer, and the position in the geometry buffer is sampled to obtain the first geometry buffer position information (Geometry Buffer Position, denoted as GBufferPos).

[0074] The depth value of the preset sampling point is equal to the first geometric buffer position (which can be understood as: depth=GBufferPos.z, depth is the depth value), and the depth information is obtained through the first geometric buffer position information.

[0075] Further, the occlusion value is obtained according to the depth information. Wherein, V(P) = Z of the sampling point position > depth. Z of the sampling point position is the Z coordinate of the position.

[0076] Furthermore, first-category sampling point occlusion information and second-category sampling point occlusion information are obtained according to the sampling point occlusion information and the occlusion value.

[0077] Please refer to Figure 3 In some embodiments, step S200, obtaining first delayed illumination information according to first-category sampling point occlusion information, first differential solid angle information, and preset radiant brightness, includes: step S210, obtaining first sampled delayed radiant brightness according to first-category sampling point occlusion information and preset radiant brightness; step S220, obtaining first differential solid angle information according to sampling kernel times; step S230, obtaining first-category cosine value according to target pixel position information and sampling kernel times; step S240, obtaining first delayed illumination information according to first-category sampling point occlusion information, first sampled delayed radiant brightness, first differential solid angle information, and first-category cosine value.

[0078] The first type of sampling point occlusion information includes position information of the first type of sampling points whose occlusion degree by other primitives is 0.

[0079] Since the first type of sampling point is blocked by other primitives to a degree of 0, V(P) is 0. The preset radiance is the radiance stored in the light buffer obtained by delayed lighting calculation.

[0080] The first sampled delayed radiance (sampled light buffer (UV)) is obtained according to the shading information of the first type of sampling points and the preset radiance.

[0081] The first differential solid angle information is obtained according to the sampling kernel times, and the preset hemispherical sampling kernel times is N, then the first differential solid angle information is Δω=2π / N. The first differential solid angle information is the differential term of the solid angle corresponding to the first type of sampling points.

[0082] Furthermore, the first delayed illumination information is obtained according to the first type of sampling point occlusion information, the first sampling delayed radiance, the first differential solid angle information, and the first type of cosine value. The specific calculation formula is as follows:

[0083] GI+=(1-V(P))×radiance×cos(N,P)×□ω

[0084] Among them, GI+ is the first delayed illumination information (radiance corresponding to the first type of sampling points), V(P) is the occlusion function, radiance is the preset radiance, Δω is the first differential solid angle information, and cos(N,P) is the first type of cosine value obtained according to the preset hemispherical sampling kernel number N and point P position.

[0085] In some embodiments, step S300, obtaining an offset vector and an actual attenuation value based on the second type of sampling point occlusion information and the sampling point position information, includes: step S310, obtaining a center point based on the second type of sampling point occlusion information, and obtaining an offset vector based on the center point and the sampling point position information; step S320, obtaining the second geometric buffer position information based on the offset, and obtaining the vector length based on the second geometric buffer position information; step S330, normalizing the vector length to obtain a normalized vector length; step S340, obtaining an initial attenuation value based on the normalized vector length, the maximum attenuation distance, and a preset value function; step S350, obtaining an actual attenuation value based on the initial attenuation value and a preset step size.

[0086] The center point is obtained according to the second type of sampling point occlusion information, and the center point coordinates and the sampling point coordinates are obtained according to the center point and sampling point position information. An offset vector is obtained according to the center point coordinates and the sampling point coordinates. The second geometric buffer position information is obtained according to the offset, and the vector length is obtained according to the second geometric buffer position information. The normalized vector length is obtained by normalizing the vector length.

[0087] Furthermore, the initial attenuation value is obtained according to the normalized vector length, the maximum attenuation distance, and the preset value function. The initial attenuation value is calculated as follows:

[0088] attenuation = 1-saturate (distance / maximum attenuation distance)

[0089] Among them, attenuation is the initial attenuation value, distance is the vector length, and saturate(x) is the return function. The function of saturate(x): if the value of x is less than 0, the return value is 0; if the value of x is greater than 1, the return value is 1; if x is between 0 and 1, the value of x is directly returned.

[0090] The actual attenuation value is obtained according to the initial attenuation value and the preset step size. The specific calculation method is as follows:

[0091] attenuation=attenuation*attenuation*step(0.01,theta)

[0092] Among them, theta is the dot product value between the normal vector normal and the offset vector.

[0093] Please refer to Figure 5 In some embodiments, step S400, obtaining the second delayed lighting information according to the second type of sampling point occlusion information, the actual attenuation value, the preset weight, and the second differential solid angle, also includes: step S410, obtaining the preset weight according to the component of the actual attenuation value; step S420, obtaining the level coefficient group according to the preset spherical harmonic coefficient, and obtaining the actual weight according to the level coefficient and the preset weight; step S430, obtaining the second delayed lighting information according to the actual attenuation value, the actual weight, the second type of sampling point occlusion information, and the second differential solid angle.

[0094] The preset weight Weight is obtained according to the components of the actual attenuation value, wherein the preset weight Weight=(10, 10, 10, 2). The level coefficient group is obtained according to the preset spherical harmonic coefficients, and the actual weight is obtained according to the level coefficients and the preset weights.

[0095] Preset weight Weight factor: Weight = Weight * (non-zero SH coefficient).

[0096] Further, the second delayed illumination information is obtained according to the actual attenuation value, the actual weight, the occlusion information of the second type of sampling points, and the second differential solid angle. The specific calculation is as follows:

[0097] GI+=(attenuation*Weight*V(p)*□ω)

[0098] Among them, GI+ is the second delayed lighting information (the radiant brightness corresponding to the second type of sampling points), attenuation is the initial attenuation value, Weight is the preset weight, V(P) is the occlusion function, Δω is the second differential solid angle information, which is Δω=2π / N, and the second differential solid angle information is the solid angle differential term corresponding to the second type of sampling points.

[0099] In some embodiments, step S130, obtaining first-category sampling point occlusion information and second-category sampling point occlusion information according to the sampling point occlusion information and the occlusion value, further includes: step S131, setting a judgment threshold according to the occlusion value to obtain an occlusion threshold; step S132, if the occlusion value is less than or equal to the occlusion threshold, then the corresponding sampling point occlusion information is the first-category sampling point occlusion information; and\or, step S133, setting a judgment threshold according to the occlusion value to obtain an occlusion threshold; step S134, if the occlusion value is greater than the occlusion threshold, then the corresponding sampling point occlusion information is the second-category sampling point occlusion information.

[0100] The pixel point corresponding to the sampling point is P, the occlusion function of the pixel point is V(P), and V(P) is used to indicate the degree to which the pixel point is occluded.

[0101]

[0102] Among them, 0 means not blocked, and 1 means blocked.

[0103] An occlusion threshold is set for V(P) according to the occlusion function, and occlusion information of the first type of sampling points and occlusion information of the second type of sampling points are obtained according to the occlusion threshold.

[0104] In some embodiments, a hierarchical coefficient group is obtained according to preset spherical harmonic coefficients, and actual weights are obtained according to the hierarchical coefficient group and preset weights, which also includes: obtaining a hierarchical coefficient group according to preset spherical harmonic coefficients, the hierarchical coefficient group having six hierarchical coefficients; and obtaining actual weights according to the hierarchical coefficients and preset weights.

[0105] The hierarchical coefficient group is obtained according to the preset spherical harmonic coefficients (SH coefficients). The definitions of the 6 hierarchical coefficients are:

[0106]

[0107] In some embodiments, an ambient light occlusion processing system includes: a memory on which a computer program is stored; and a processor for executing the computer program in the memory to implement the ambient light occlusion method in any of the above embodiments.

[0108] The ambient occlusion processing system displays an image according to the first delayed lighting information and the second delayed lighting information to obtain a global image. It can be understood that the screen space is shaded according to the first delayed lighting information and the second delayed lighting information to increase the brightness of the shadow part of the computer image and make the computer closer to real indirect lighting.

[0109] In some embodiments, a computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to: execute the ambient light shielding method in any of the above embodiments.

[0110] The computer-readable storage medium performs the ambient light occlusion method in any of the above embodiments to display an image according to the first delayed lighting information and the second delayed lighting information to obtain a global image. It can be understood that the screen space is shaded according to the first delayed lighting information and the second delayed lighting information to increase the brightness of the shadow part of the computer image and make the computer image closer to the real indirect lighting.

[0111] The embodiments of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in the relevant technical field without departing from the purpose of the present invention. In addition, the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.

Claims

1. An ambient light occlusion method, characterized in that: include: Obtaining sampling point occlusion information according to the sampling point position information, and obtaining first-category sampling point occlusion information and second-category sampling point occlusion information according to the sampling point occlusion information; wherein the first-category sampling points are sampling points whose corresponding pixels are occluded by other primitives to a degree of 0, and the second-category sampling points are sampling points whose corresponding pixels or center points are occluded by other primitives to a degree not of 0, the first-category sampling point occlusion information represents sampling point occlusion information corresponding to the first-category sampling points, and the second-category sampling point occlusion information represents sampling point occlusion information corresponding to the second-category sampling points; Obtaining first delayed illumination information according to the first type of sampling point occlusion information, the first differential solid angle information, and the preset radiation brightness; Obtaining an offset vector according to the second type of sampling point occlusion information and the sampling point position information, and obtaining an actual attenuation value according to a vector length corresponding to the offset vector; Obtaining second delayed illumination information according to the second type of sampling point occlusion information, the actual attenuation value, the preset weight, and the second differential solid angle; An image is displayed according to the first delayed illumination information and the second delayed illumination information.

2. The ambient light shielding method according to claim 1, characterized in that: The obtaining the sampling point occlusion information according to the sampling point position information includes: The sampling point position is obtained according to the target pixel position information and the random variable, and the sampling point position is transformed according to the camera matrix and the projection matrix to obtain the sampling point occlusion information.

3. The ambient light shielding method according to claim 2, characterized in that: The sampling point position includes first coordinate information and second coordinate information, and obtaining first-category sampling point occlusion information and second-category sampling point occlusion information according to the sampling point occlusion information includes: Sampling the geometry buffer according to the first coordinate information and the second coordinate information to obtain first geometry buffer position information, and obtaining depth information according to the first geometry buffer position information; Obtaining an occlusion value according to the depth information; The first-category sampling point occlusion information and the second-category sampling point occlusion information are obtained according to the sampling point occlusion information and the occlusion value.

4. The ambient light shielding method according to claim 2, characterized in that: The obtaining of the first delayed illumination information according to the first type of sampling point occlusion information, the first differential solid angle information, and the preset radiation brightness includes: Obtaining a first sampling delayed radiance according to the first type of sampling point shading information and the preset radiance; Obtaining the first differential solid angle information according to the number of sampling kernels; Obtaining a first-class cosine value according to the target pixel position information and the sampling kernel number; The first delayed illumination information is obtained according to the first-type sampling point occlusion information, the first sampling delayed radiance, the first differential solid angle information, and the first-type cosine value.

5. The ambient light shielding method according to claim 1, characterized in that: The step of obtaining an offset vector according to the second type of sampling point occlusion information and the sampling point position information, and obtaining an actual attenuation value according to a vector length corresponding to the offset vector, includes: Obtaining a center point according to the occlusion information of the second type of sampling points, and obtaining an offset vector according to the center point and the position information of the sampling points; wherein the offset vector includes an offset between the second type of sampling points and the center point corresponding to the second type of sampling points; Obtaining second geometry buffer position information according to the offset, and obtaining the vector length according to the second geometry buffer position information; Normalizing the vector length to obtain a normalized vector length; Obtaining an initial attenuation value according to the normalized vector length, the maximum attenuation distance, and a preset value function; The actual attenuation value is obtained according to the initial attenuation value and the preset step size.

6. The ambient light shielding method according to claim 3, characterized in that: The method of obtaining the second delayed illumination information according to the second type of sampling point occlusion information, the actual attenuation value, the preset weight, and the second differential solid angle further includes: Obtaining the preset weight according to the component of the actual attenuation value; Obtain a hierarchical coefficient group according to preset spherical harmonic coefficients, and obtain actual weights according to the hierarchical coefficients and the preset weights; The second delayed illumination information is obtained according to the actual attenuation value, the actual weight, the second type of sampling point occlusion information, and the second differential solid angle.

7. The ambient light shielding method according to claim 3, characterized in that: The method of obtaining the first type of sampling point occlusion information and the second type of sampling point occlusion information according to the sampling point occlusion information and the occlusion value further includes: A judgment threshold is set according to the occlusion value to obtain an occlusion threshold; If the occlusion value is less than or equal to the occlusion threshold, the corresponding sampling point occlusion information is the first type of sampling point occlusion information; and\or, A judgment threshold is set according to the occlusion value to obtain an occlusion threshold; If the occlusion value is greater than the occlusion threshold, the corresponding sampling point occlusion information is the second type of sampling point occlusion information.

8. The ambient light shielding method according to claim 6, characterized in that: The step of obtaining a hierarchical coefficient group according to the preset spherical harmonic coefficients and obtaining an actual weight according to the hierarchical coefficient group and the preset weights further includes: Obtaining a hierarchical coefficient group according to preset spherical harmonic coefficients, wherein the hierarchical coefficient group is provided with six hierarchical coefficients; The actual weight is obtained according to the level coefficient and the preset weight.

9. An ambient light occlusion processing system, characterized in that: It comprises: a memory having a computer program stored thereon; and a processor for executing the computer program in the memory to implement: the ambient light shielding method as described in any one of claims 1 to 8.

10. A computer-readable storage medium storing computer-executable instructions for: Execute the ambient light shielding method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • AO (ambient occlusion) method based on screen space

    CN104517313A

  • Illumination rendering method and device

    CN111760277A