An adaptive screen space ambient occlusion method for dense strip scenes
By using ambient light occlusion method using adaptive sampling and spatial multiplexing strategies in dense strip scenes, the problem of degradation of rendering accuracy in the prior art is solved, and higher rendering accuracy and visual quality are achieved.
Patent Information
- Application Number
- CN202510162630.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-14
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-02-14
AI Technical Summary
When the existing screen space ambient occlusion algorithm deals with dense strip scenes, the rendering accuracy drops by more than 30%, resulting in inaccurate occlusion effect.
By extracting the information of the depth map, vector field direction map and V-Buffer buffer in the rendered feature map, the adaptive sampling direction and step size strategy are adopted, and the ambient light occlusion value is calculated in combination with the adaptive spatial multiplexing strategy.
It significantly improves the rendering accuracy of ambient light occlusion in dense strip scenes, improves the realism and detail performance of the image, reduces unnecessary computing overhead and reduces picture noise.
Smart Images

Figure CN119625152B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of rendering of computer graphics, and in particular relates to an adaptive screen space ambient light occlusion method for dense strip scenes. Background Art
[0002] Ambient Occlusion (AO) is a key technology to improve image realism and visual quality. It is widely used in games, film and television, and visualization. It simulates the interaction between light and the surface of objects to enhance shadow effects and the sense of depth of the scene. With the increase in scene complexity, especially in the context of the increasing popularity of dense strip structures (such as coniferous grass, cartoon hair, lines, etc.), the rendering accuracy of existing ambient occlusion algorithms has significantly decreased when processing these complex geometric forms, affecting the user's visual experience. Therefore, proposing an algorithm that better adapts to these special scenes has become the main challenge facing current rendering technology.
[0003] Existing screen space ambient occlusion algorithms, such as SSAO, HBAO, LineAO, and SDAO, are widely used in 3D rendering to enhance the depth and details of the scene. However, when dealing with dense strip scenes, the rendering accuracy of these methods usually drops by more than 30%. This is mainly because dense strip scenes have complex occlusion relationships, and screen space algorithms are prone to lose key information in such scenes; in addition, since existing algorithms fail to fully utilize the geometric features in the scene, the occlusion effect is often inaccurate. Therefore, this application aims to improve the accuracy of the screen space ambient occlusion algorithm in these special scenes by reasonably utilizing the geometric characteristics of dense strip scenes. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide an adaptive screen space ambient occlusion method for dense strip scenes. The method improves the rendering accuracy of ambient occlusion in dense strip scenes by rationally utilizing strip geometric features, thereby enhancing the realism and detail expression of the image.
[0005] In order to solve the above technical problems, the present invention is implemented in the following ways:
[0006] An adaptive screen space ambient occlusion method for dense strip scenes, the specific process includes the following steps:
[0007] S1, feature extraction stage: obtain the rendering feature map used for subsequent calculations from the rendering process;
[0008] S2, sampling stage: according to the rendering feature map obtained in step S1, the ambient light occlusion value is calculated by using the adaptive sampling direction strategy and the adaptive sampling step strategy;
[0009] S3, reuse stage: Calculate the appropriate reuse weights based on the information provided by the V-Buffer, use the adaptive spatial reuse strategy for post-processing noise reduction, and output the ambient occlusion result map.
[0010] Furthermore, the rendering feature map in step S1 includes a depth map generated based on the rendering process. D o 、Vector field pattern F And the buffer of V-Buffer V b , the buffer V b It is a two-channel texture, the first channel of which stores the geometry number and the second channel stores the cross-sectional width of the geometry in screen space. R s .
[0011] Preferably, the specific method of the feature extraction stage in step S1 is as follows:
[0012] Generate a depth map of the scene through the rendering interface of the graphics rendering pipeline D o , the depth map records the depth value between each pixel and the observation point in the screen space, and the generated depth map is stored in the video memory in the form of a texture for rapid access and operation by subsequent processing modules;
[0013] In the geometry shader stage of the rendering pipeline, for the triangular mesh of the strip geometry in the scene, the growth direction of the strip geometry is calculated using the positional relationship between the midpoint of the base of the triangle and its vertex. The local growth trend of the strip geometry is extracted and converted into a direction vector and stored in the vector field direction map. F In the , vector field direction map is a screen space texture, which provides a reference for the subsequent cross-section width calculation;
[0014] Based on vector field pattern F The growth direction in the screen space is used to perform a step search perpendicular to the direction, starting from the initial pixel and gradually searching for pixels on the geometric boundary on both sides until the two end pixel positions of the cross section are reached. D o Calculate the cross-sectional width R s , the resulting cross-sectional width R s Recording to V-Buffer V b middle.
[0015] Furthermore, the sampling phase of step S2 includes:
[0016] Adaptive directional sampling: according to the vector field direction map F, Generates an ellipse sampling extent for each pixel on the geometry, with the minor axis of the ellipse aligned with the vector direction , Constrain the sampling direction of each pixel through the elliptical sampling range;
[0017] Adaptive step sampling: according to the vector field direction map F, Generate an elliptical sampling range for each pixel on the geometry, with the major axis of the ellipse aligned with the vector direction, and then combine it with the depth map D o The depth information provided is used to evaluate the step size of each sampling using an adaptive step sampling strategy;
[0018] Then calculate the ambient occlusion (AO) value of the pixel based on the sampling result and write it into the intermediate result O i .
[0019] Preferably, the specific method of the adaptive direction sampling is as follows:
[0020] In the fragment shader that calculates ambient occlusion, an elliptical sampling range is generated for each pixel on the geometry according to the vector field direction map. The minor axis of the ellipse is aligned with the vector direction. Uniform directional sampling may produce invalid samples. If this sampling point is located on the same geometry as the current pixel, the sampling point is an invalid sampling point for the current pixel. When generating samples for the current pixel, more sampling is required along the direction approximate to the major axis of the ellipse, and the sampling direction of each pixel is constrained by the elliptical range.
[0021] The sampling direction is generated along the direction of the major axis of the ellipse according to the ellipse sampling range, and the calculated sampling direction is assigned to the corresponding variable, which will be used to determine the specific sampling position and sampling value in the subsequent rendering process.
[0022] Preferably, the specific method of the adaptive step sampling is as follows:
[0023] In the fragment shader that calculates ambient occlusion, the depth information provided by the depth map is combined, and the sampling step size of each sampling is evaluated using an adaptive step sampling strategy and assigned to a variable; the sampling strategy is as follows:
[0024] Through the expression Get the initial step size, where represents the initial step length, R p represents the sampling radius, N s Indicates the number of samples along the current sampling direction, R sThe function is to prevent the initial step length from exceeding the width of the geometric body where the pixel is located. If an invalid pixel is sampled, the next sampling step length is increased to quickly skip the invalid pixel area and sample the valid sampling points. If a valid pixel is sampled, in order to avoid the loss of adjacent valid pixels due to the previous sampling step length being too large, the next sampling step length is reduced to the initial step length value.
[0025] Determine the pixel position of each sampling point in the screen space by combining the sampling direction and sampling step size, and calculate the position of the sampling point in the three-dimensional space based on the depth map information; for each sampling point, calculate the angle between it and the tangent plane where the pixel whose AO value needs to be calculated is located, and use the angle value to evaluate the occlusion effectiveness of the sampling point;
[0026] The expression of the AO value is as follows:
[0027]
[0028] in, θ represents the azimuth of the spherical coordinate system, whose zenith axis is consistent with the line of sight, A(θ) represents the linear decay function, Indicates the approximate value of the angle;
[0029] As the distance from the sampled pixel to the current pixel increases, the ambient occlusion value decreases, and the distance term is used to adjust the sampling step size. The specific distance term expression is as follows:
[0030]
[0031]
[0032] in, r(θ) Indicates the distance between the current pixel and the sampling pixel, L a represents the actual sampling step size, g represents the distance attenuation term, L c Indicates the current sampling step.
[0033] Preferably, the specific method of the multiplexing stage in step S3 is as follows:
[0034] In the fragment shader for post-processing, a diamond sampling range is generated for each pixel on the geometric figure according to the vector field direction map. The short axis of the diamond is aligned with the vector direction. The pixels located in the same geometric body corresponding to the current pixel are valid reused pixels, and the pixels in different geometric bodies are invalid reused pixels. In order to reuse as many valid samples as possible, a diamond area is set to limit the reuse range. The long axis of the diamond is consistent with the direction of the geometric body corresponding to the current pixel.
[0035] Determine the intermediate result of ambient occlusion within the reuse range based on the diamond area O i The pixel position of the texture and obtains the similarity corresponding to the current pixel from the V-Buffer buffer. The specific similarity expression is as follows:
[0036]
[0037] in, p Indicates the pixel for which the occlusion value needs to be calculated. p i Represents the sampled pixels, similarity results S p From V b Get from
[0038] The directional guidance weight value is then used to weight the mixed ambient occlusion intermediate result O i , the specific direction-oriented weight expression is as follows:
[0039]
[0040] in, Represents the normal vector value corresponding to the pixel, F ( p ) represents the growth direction of the pixel for which the occlusion value needs to be calculated. F ( p i ) represents the growth direction corresponding to the sampled pixel;
[0041] Weighted blending adjusts the influence of each sampling value according to the similarity between pixels, obtains the final AO value of the pixel through weighted calculation, and stores it in the result buffer for use in subsequent rendering stages; the expression for weighted blending to calculate ambient occlusion is as follows:
[0042]
[0043] in, p i yes p The adjacent pixels in the 4×4 square kernel Ω, S r represents the similarity function, G s represents the screen space proximity function, which are common functions in bilateral filtering.
[0044] Compared with the prior art, the present invention has the following beneficial effects:
[0045] The ambient light occlusion method proposed in the present invention solves the problem that the existing ambient light occlusion method cannot fully utilize the geometric characteristics of the strip structure, resulting in a decrease of more than 30% in the accuracy and visual effect of the rendering results when processing these complex scenes; the existing method ignores the local occlusion relationship and the particularity of the geometric shape in dense strip scenes, resulting in a blurred or unnatural occlusion effect, which affects the rendering quality.
[0046] By making full use of the geometric characteristics of the strip structure, the rendering accuracy and visual quality are effectively improved. The proposed adaptive step sampling strategy can dynamically adjust the sampling density according to the distribution characteristics of the strip structure, significantly reducing unnecessary computational overhead; the adaptive direction sampling strategy can more accurately capture key occlusion information in complex occlusion relationships; the adaptive spatial multiplexing strategy can significantly reduce image noise while retaining edge clarity by intelligently filtering and reusing the occlusion information of adjacent pixels. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is a schematic diagram of the process of the present invention;
[0048] Figure 2 It is a schematic diagram of the adaptive direction strategy of the present invention;
[0049] Figure 3 Schematic diagram of the adaptive step size strategy of the present invention;
[0050] Figure 4 Schematic diagram of the adaptive spatial multiplexing strategy of the present invention;
[0051] Figure 5 This is the effect diagram of the adaptive spatial reuse strategy of the present invention;
[0052] Figure 6 This is a rendering effect diagram of the present invention in a sheet scene;
[0053] Figure 7 This is a rendering effect diagram of the present invention in a tubular scene. DETAILED DESCRIPTION
[0054] The specific implementation of the present invention is further described in detail below with reference to the accompanying drawings and specific examples.
[0055] like Figure 1 As shown, an adaptive screen space ambient light occlusion method for dense strip scenes, the specific process includes the following steps:
[0056] S1, feature extraction stage: obtain the rendering feature map used for subsequent calculations from the rendering process;
[0057] The rendering feature map includes a depth map generated based on the rendering process Do 、Vector field pattern F And the buffer of V-Buffer V b , the buffer V b It is a two-channel texture, the first channel of which stores the geometry number and the second channel stores the cross-sectional width of the geometry in screen space. R s .
[0058] The specific method of the feature extraction stage in step S1 is as follows:
[0059] Generate a depth map of the scene through the rendering interface of the graphics rendering pipeline D o The depth map records the depth value between each pixel and the observation point in the screen space. The depth map reflects the geometric structure of the scene and provides key spatial position information for subsequent occlusion calculation and geometric analysis. The generated depth map is stored in the video memory in the form of a texture for rapid access and operation by subsequent processing modules.
[0060] In the geometry shader stage of the rendering pipeline, for the triangular mesh of the strip geometry in the scene, the growth direction of the strip geometry is calculated using the positional relationship between the midpoint of the base of the triangle and its vertex. The local growth trend of the strip geometry is extracted and converted into a direction vector and stored in the vector field direction map. F In the , vector field direction map is a screen space texture, which is used to record the local direction information of each area in the scene and provide a reference for the subsequent cross-section width calculation;
[0061] Based on vector field pattern F In the growth direction of the image, a step search is performed perpendicular to the direction in the screen space, starting from the initial pixel and gradually searching for pixels on the boundary of the geometric body on both sides, that is, searching on both sides in a step-by-step manner: searching at intervals of 1, 2, 4, 8... If the pixel is outside the geometric body, it starts again at an interval of 1 until the pixel is outside the geometric body again, in which case the pixel is considered to be an endpoint pixel; until the two endpoint pixel positions of the cross section are reached, combined with the depth map D o Calculate the width of the cross section R s , the resulting cross-sectional width R s Recording to V-Buffer V b middle.
[0062] S2, sampling stage: According to the rendering feature map obtained in step S1, the ambient light occlusion value is calculated using the adaptive sampling direction strategy and the adaptive sampling step strategy. The sampling stage includes:
[0063] Adaptive directional sampling: according to the vector field direction map F, Generates an ellipse sampling extent for each pixel on the geometry, with the minor axis of the ellipse aligned with the vector direction , Constrain the sampling direction of each pixel through the elliptical sampling range;
[0064] Adaptive step sampling: according to the vector field direction map F, Generate an elliptical sampling range for each pixel on the geometry, with the major axis of the ellipse aligned with the vector direction, and then combine it with the depth map D o The depth information provided is used to evaluate the step size of each sampling using an adaptive step sampling strategy;
[0065] Then calculate the ambient occlusion (AO) value of the pixel based on the sampling result and write it into the intermediate result O i .
[0066] The specific method of the adaptive direction sampling is as follows:
[0067] In the fragment shader that calculates ambient occlusion, an elliptical sampling range is generated for each pixel on the geometry based on the vector field direction map, with the minor axis of the ellipse aligned with the vector direction, such as Figure 2 As shown, uniform directional sampling may produce invalid samples if the sampling point p 6 With the current pixel p m Located on the same geometry s1, the sampling point p 6 For the current pixel p m It is an invalid sampling point; it is the current pixel point p m When generating samples, more sampling is required along the direction approximate to the major axis of the ellipse, and the sampling direction of each pixel is constrained by the ellipse range;
[0068] The sampling direction is generated along the direction of the major axis of the ellipse according to the sampling range of the ellipse. The calculated sampling direction is assigned to the corresponding variable, which will be used to determine the specific sampling position and sampling value in the subsequent rendering process. The variable here stores the sampling direction, which is used for the direction of the step strategy to offset. The step sampling will sample specific pixels. The 3D space coordinates corresponding to the pixels can be calculated based on the depth information of the pixels. The coordinates can be used to determine whether the pixels are blocked, thereby determining whether the sampled pixels are valid.
[0069] Preferably, the specific method of the adaptive step sampling is as follows:
[0070] In the fragment shader that calculates ambient occlusion, the depth information provided by the depth map is combined, and the adaptive step sampling strategy is used to evaluate the size of each sampling step and assign it to a variable; Figure 3 As shown, the sampling strategy is as follows:
[0071] Through the expression Get the initial step size, where represents the initial step length, R p represents the sampling radius, N s Indicates the number of samples along the current sampling direction, R s The function is to prevent the initial step length from exceeding the width of the geometric body where the pixel is located. The blue area represents the invalid strip geometry with low AO contribution. If an invalid pixel point p4 is sampled, the next sampling step length is increased, and the invalid pixel area is quickly skipped to sample the valid sampling point p5; if a valid pixel point is sampled, in order to avoid the loss of adjacent valid pixels due to the previous sampling step length being too large, the next sampling step length is reduced to the initial step length value;
[0072] Determine the pixel position of each sampling point in the screen space by combining the sampling direction and sampling step size, and calculate the position of the sampling point in the three-dimensional space based on the depth map information; for each sampling point, calculate the angle between it and the tangent plane where the pixel whose AO value needs to be calculated is located, and use the angle value to evaluate the occlusion effectiveness of the sampling point;
[0073] The expression of the AO value is as follows:
[0074]
[0075] in, θ represents the azimuth of the spherical coordinate system, whose zenith axis is consistent with the line of sight, A(θ) represents the linear decay function, Indicates the approximate value of the angle;
[0076] As the distance from the sampled pixel to the current pixel increases, the ambient occlusion value decreases, and the distance term is used to adjust the sampling step size. The specific distance term expression is as follows:
[0077]
[0078]
[0079] in, r(θ) Indicates the distance between the current pixel and the sampling pixel, La represents the actual sampling step size, g represents the distance attenuation term, L c Indicates the current sampling step.
[0080] S3, reuse stage: calculate the appropriate reuse weight according to the information provided by the V-Buffer buffer, use the adaptive spatial reuse strategy for post-processing noise reduction, and output the ambient occlusion result map. The specific method of the reuse stage is as follows:
[0081] In the post-processing fragment shader, a diamond sampling range is generated for each pixel on the geometry according to the vector field direction map, and the short axis of the diamond is aligned with the vector direction, such as Figure 4 As shown, the current pixel p a The corresponding pixel points of the same geometric body p b To effectively reuse pixels, pixels of different geometric shapes p c In order to reuse invalid pixels and reuse valid samples as much as possible, a diamond area is set to limit the reuse range, and the long axis of the diamond is aligned with the current pixel. p a The corresponding geometric bodies have the same direction;
[0082] Determine the intermediate result of ambient occlusion within the reuse range based on the diamond area O i The pixel positions of the texture, for which sampling operations are performed to obtain the intermediate results of ambient occlusion (AO) for each pixel. The similarity corresponding to the current pixel is obtained from the V-Buffer buffer. The specific similarity expression is as follows:
[0083]
[0084] in, p Indicates the pixel for which the occlusion value needs to be calculated. p i Represents the sampled pixels, similarity results S p From V b Because the scene is composed of many independent geometric meshes, in V b The drawing sequence number of each grid is written in , and the result in screen space is that the pixels corresponding to the same grid have the same sequence number, and pixels with the same sequence number are considered similar.
[0085] The directional guidance weight value is then used to weight the mixed ambient occlusion intermediate result O i, the specific direction-oriented weight expression is as follows:
[0086]
[0087] in, Represents the normal vector value corresponding to the pixel, F ( p ) represents the growth direction of the pixel for which the occlusion value needs to be calculated. F ( p i ) represents the growth direction corresponding to the sampled pixel;
[0088] Weighted blending adjusts the influence of each sampling value according to the similarity between pixels, obtains the final AO value of the pixel through weighted calculation, and stores it in the result buffer for use in subsequent rendering stages; the expression for weighted blending to calculate ambient occlusion is as follows:
[0089]
[0090] in, p i yes p The adjacent pixels in the 4×4 square kernel Ω, S r represents the similarity function, G s represents the screen space proximity function, which are common functions in bilateral filtering. Example
[0091] Experimental hardware and software environment: The algorithm is implemented on a laptop equipped with an NVIDIA GeForce RTX 3070Ti Laptop GPU, a 12thGen Intel(R) Core(TM) i7-12700H CPU, and 16G memory. The software used is Unity 2020.3.13f1c1, and the algorithm is based on Unity's SRP function. All results are rendered at a resolution of 1920 × 1080.
[0092] like Figure 5 As shown, the present invention uses the open source model Hariball, and the number of grids in this scene is 1000; Figure 6 As shown in the figure, the scene used is a sheet scene: the first scene is sparse grass, the number of scene grids is 204; the second scene is dense grass, the number of scene grids is 675, both of which are from the open source asset library from Blender Eevee; the third scene is short hair, the number of scene grids is 7425; the fourth scene is long hair, the number of scene grids is 1600, both of which are from the open source asset library Blender Hair LibraryStandard Bv4. Figure 7As shown in the figure, the experimental scenarios are mainly tubular scenarios: the first scene is a steady-state vortex with a scene grid number of 98; the second scene is a tornado vortex with a scene grid number of 98; the third scene is an ABC flow with a scene grid number of 2859, all of which are derived from public streamline data models; the fourth scene is a ball of yarn with a scene grid number of 1000, which is a network open source model.
[0093] The above description is only an implementation mode of the present invention. It is stated again that for ordinary technicians in this technical field, several improvements can be made to the present invention without departing from the principle of the present invention. These improvements are also included in the protection scope of the claims of the present invention.
Claims
1. An adaptive screen space ambient light occlusion method for dense strip scenes, characterized by: The specific process includes the following steps: S1, feature extraction stage: obtain the rendering feature map used for subsequent calculations from the rendering process; S2, sampling stage: according to the rendering feature map obtained in step S1, the ambient light occlusion value is calculated by using the adaptive sampling direction strategy and the adaptive sampling step strategy; S3, reuse stage: calculate the appropriate reuse weight according to the information provided by the V-Buffer buffer, use the adaptive spatial reuse strategy for post-processing noise reduction, and output the ambient occlusion result map; The rendering feature map in step S1 includes a depth map D generated based on the rendering process o , vector field direction map F and V-Buffer buffer V b , the buffer V b It is a two-channel texture, the first channel of which stores the geometry number, and the second channel stores the cross-sectional width R of the geometry in screen space. s ; The sampling phase of step S2 includes: Adaptive directional sampling: According to the vector field direction map F, an elliptical sampling range is generated for each pixel on the geometric figure. The minor axis of the ellipse is aligned with the vector direction, and the sampling direction of each pixel is constrained by the elliptical sampling range; Adaptive step sampling: According to the vector field direction map F, an elliptical sampling range is generated for each pixel on the geometric figure. The major axis of the ellipse is aligned with the vector direction, and then combined with the depth map D o The depth information provided is used to evaluate the step size of each sampling using an adaptive step sampling strategy; Then calculate the ambient occlusion value of the pixel based on the sampling result and write it into the intermediate result O i ; The specific method of the multiplexing stage in step S3 is as follows: In the fragment shader for post-processing, a diamond sampling range is generated for each pixel on the geometric figure according to the vector field direction map. The short axis of the diamond is aligned with the vector direction. The pixels located in the same geometric body corresponding to the current pixel are valid reused pixels, and the pixels in different geometric bodies are invalid reused pixels. A diamond area is set to limit the reuse range. The long axis of the diamond is consistent with the direction of the geometric body corresponding to the current pixel. Determine the ambient light occlusion intermediate result O within the reuse range according to the diamond area i The pixel position of the texture and obtains the similarity corresponding to the current pixel from the V-Buffer buffer. The specific similarity expression is as follows: Among them, p represents the pixel for which the occlusion value needs to be calculated, p i Represents the sampled pixels, similarity result S p From V b Get from The directional weight value is then used to weight the mixed ambient occlusion intermediate result O i , the specific direction-oriented weight expression is as follows: Among them, n represents the normal vector value corresponding to the pixel, F(p) represents the growth direction corresponding to the pixel for which the occlusion value needs to be calculated, and F(p i ) represents the growth direction corresponding to the sampled pixel; Weighted blending adjusts the influence of each sampling value according to the similarity between pixels, obtains the final AO value of the pixel through weighted calculation, and stores it in the result buffer for use in subsequent rendering stages; the expression for weighted blending to calculate ambient occlusion is as follows: Among them, S r represents the similarity function, G s Represents the screen-space proximity function.
2. The method of adaptive screen space ambient light occlusion for dense strip scenes according to claim 1, characterized in that: The specific method of the feature extraction stage in step S1 is as follows: Generate the scene's depth map D through the rendering interface of the graphics rendering pipeline o , the depth map records the depth value between each pixel and the observation point in the screen space, and the generated depth map is stored in the video memory in the form of a texture; In the geometry shader stage of the rendering pipeline, for the triangular mesh of the strip geometry in the scene, the growth direction of the strip geometry is calculated using the positional relationship between the midpoint of the base of the triangle and its vertex. The local growth trend of the strip geometry is extracted and converted into a direction vector and stored in the vector field direction map F. Based on the growth direction in the vector field direction map F, a step search perpendicular to the direction is performed in the screen space, starting from the initial pixel and gradually searching for pixels on the geometric boundary on both sides until the two end pixel positions of the cross section are reached, combined with the depth map D o Calculate the cross-sectional width R s , the cross-sectional width R s Record to V-Buffer b middle.
3. The method of adaptive screen space ambient light occlusion for dense strip scenes according to claim 1, characterized in that: The specific method of the adaptive direction sampling is as follows: In the fragment shader that calculates ambient occlusion, an elliptical sampling range is generated for each pixel on the geometry according to the vector field direction map. The minor axis of the ellipse is aligned with the vector direction. If this sampling point is located on the same geometry as the current pixel, the sampling point is an invalid sampling point for the current pixel. When generating samples for the current pixel, more sampling is required along the direction approximate to the major axis of the ellipse, and the sampling direction of each pixel is constrained by the elliptical range. The sampling direction is generated along the direction of the major axis of the ellipse according to the ellipse sampling range, and the calculated sampling direction is assigned to the corresponding variable, which will be used to determine the specific sampling position and sampling value in the subsequent rendering process.
4. The method of adaptive screen space ambient light occlusion for dense strip scenes according to claim 1, characterized in that: The specific method of the adaptive step sampling is as follows: In the fragment shader that calculates ambient occlusion, the depth information provided by the depth map is combined, and the sampling step size of each sampling is evaluated using an adaptive step sampling strategy and assigned to a variable; the sampling strategy is as follows: Through the expression Get the initial step length, where L represents the initial step length, R p Represents the sampling radius, N s Indicates the number of samples along the current sampling direction. If an invalid pixel is sampled, the next sampling step is increased; if a valid pixel is sampled, the next sampling step is reduced to the initial step value. Determine the pixel position of each sampling point in the screen space by combining the sampling direction and sampling step size, and calculate the position of the sampling point in the three-dimensional space based on the depth map information; for each sampling point, calculate the angle between it and the tangent plane where the pixel whose AO value needs to be calculated is located, and use the angle value to evaluate the occlusion effectiveness of the sampling point; The expression of the AO value is as follows: Where θ represents the azimuth of the spherical coordinate system, whose zenith axis is consistent with the line of sight, A(θ) represents the linear attenuation function, and (sin(h(θ))-sin(t(θ))) represents the approximate value of the angle; As the distance from the sampled pixel to the current pixel increases, the ambient occlusion value decreases, and the distance term is used to adjust the sampling step size. The specific distance term expression is as follows: L a =g·L c Among them, r(θ) represents the distance between the current pixel and the sampling pixel, L a represents the actual sampling step length, g represents the distance attenuation term, L c Indicates the current sampling step.
Citation Information
Patent Citations
Self-adaptive screen space ambient occlusion method
CN102592305A
Image processing method, image processing device and computer equipment
CN104134230A