CPU-based static scene ray tracing chessboard rendering method, system and storage medium

By adopting the CPU-based static scene ray tracing board rendering method in static scene ray tracing rendering, using parity board sampling, CPU parallel computing and boundary bounding box, the problem of high computational cost of static scene ray tracing rendering is solved, and efficient rendering acceleration and real-time interactive performance improvement is achieved.

CN114049421BActive Publication Date: 2025-05-23SUN YAT SEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111395935.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-23
Publication Date
2025-05-23
Estimated Expiration
2041-11-23

AI Technical Summary

Technical Problem

The existing technology has high computational cost when rendering ray tracing in static scenes, resulting in long rendering time and low real-time interactive frame rate. The existing chessboard rendering methods are mainly concentrated in the field of rasterized rendering, and lack research in the field of ray tracing.

Method used

The CPU-based static scene ray tracing board rendering method is adopted to achieve rendering acceleration by building three-dimensional scenes, using parity board sampling, CPU parallel computing and boundary bounding boxes, reducing the amount of rendering calculations and increasing the real-time interactive frame rate.

Benefits of technology

It realizes reducing the amount of rendering calculations, improving real-time interactive frame rate, improving rendering quality, and improving computing efficiency through parallel CPU operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114049421B_ABST
    Figure CN114049421B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer graphics rendering technology, specifically to a CPU-based static scene ray tracing chessboard rendering method, system and storage medium, the method comprising: constructing a three-dimensional scene according to the coordinates of a point light source and a geometric object; setting a historical pixel value buffer and a historical collision point coordinate buffer; calculating the bounding box of each geometric object in the three-dimensional scene; using a programming method to implement odd-even chessboard sampling to obtain sampled pixel points; if the camera is stationary, a chessboard ray tracing algorithm is used in the rendering stage to obtain a half-resolution rendering frame, and then combined with the pixel values ​​of the historical pixel value buffer, a full-resolution target image is obtained by superposition; if the camera moves through user interaction, a full-resolution target image is obtained by an interactive correction algorithm. The present invention constructs a three-dimensional scene, divides the pixel space into blocks, uses CPU parallel computing and bounding boxes to achieve rendering acceleration, and achieves the effect of reducing frame buffers and improving real-time interactive frame rates.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer graphics rendering, and in particular to a CPU-based static scene ray tracing chessboard rendering method, system and storage medium. Background Art

[0002] Ray tracing is a rendering method in 3D computer graphics. As a global illumination rendering technology, it can simulate the physical propagation behavior of light in the real world. Compared with traditional rasterization rendering, ray tracing can achieve higher quality rendering effects, but it requires a large number of rays to traverse the scene geometry, and its computational cost is relatively high. In static scenes, ray tracing treats each ray as an independent ray and needs to be recalculated each time, resulting in a large number of rays that need to be calculated per second. The overall rendering computational cost is high, which leads to problems such as long rendering time and low real-time interactive frame rate.

[0003] Checkerboard rendering is a technique for generating full-resolution pixels. It reduces rendering time and improves real-time interactive performance by halving the amount of computation required for the current frame. Applying checkerboard rendering technology to ray tracing can improve its real-time performance and meet certain real-time interactive performance requirements. However, existing research on checkerboard rendering methods is concentrated in the field of rasterization rendering, and there is a lack of research in the field of ray tracing.

[0004] Due to the improvement of hardware performance in recent years, many GPU-based ray tracing algorithms have emerged. GPUs have strong parallel computing capabilities, high memory bandwidth and fast running speed, which can effectively improve the rendering frame rate. However, GPU-based acceleration methods have high requirements for graphics hardware, do not support dynamic allocation of memory, and do not have good versatility. Summary of the invention

[0005] In order to solve the technical problems existing in the prior art, the present invention provides a CPU-based static scene ray tracing chessboard rendering method, system and storage medium, constructs a three-dimensional scene, divides the pixel space into blocks, uses odd-even chessboard sampling, CPU parallel calculation and boundary bounding box to achieve rendering acceleration, and achieves the technical effect of reducing the amount of rendering calculation and improving the real-time interactive frame rate.

[0006] The method of the present invention is implemented by the following technical solution: a CPU-based static scene ray tracing chessboard rendering method, comprising the following steps:

[0007] Step S1, constructing a three-dimensional scene according to the coordinates of the point light source and the geometric object, and initializing the camera position;

[0008] Step S2, setting a historical pixel value buffer and a historical collision point coordinate buffer;

[0009] Step S3, calculating the bounding box of each geometric object in the three-dimensional scene;

[0010] Step S4: In the sampling stage, even-odd chessboard sampling is implemented by programming to obtain sampling pixel points;

[0011] Step S5: If the camera is stationary, in the rendering stage, a half-resolution rendering frame is obtained by using a chessboard ray tracing algorithm, and then combined with the pixel values ​​in the historical pixel value buffer, a full-resolution target image is obtained by superposition;

[0012] Step S6: If the camera moves due to user interaction, a full-resolution target image is obtained through an interaction correction algorithm.

[0013] The system of the present invention is implemented by the following technical solutions: a CPU-based static scene ray tracing chessboard rendering system, comprising:

[0014] The 3D scene construction module constructs the 3D scene based on the coordinates of the point light source and geometric objects and initializes the camera position;

[0015] The buffer setting module sets a historical pixel value buffer and a historical collision point coordinate buffer;

[0016] A bounding box calculation module calculates the bounding box of each geometric object in the three-dimensional scene;

[0017] The odd-even chessboard sampling module uses programming to implement odd-even chessboard sampling and obtain sampling pixel points;

[0018] Tracking rendering module, if the camera is stationary, then in the rendering stage, a chessboard ray tracing algorithm is used to obtain a half-resolution rendering frame, which is then combined with the pixel values ​​in the historical pixel value buffer to obtain a full-resolution target image; if the camera moves through user interaction, an interactive correction algorithm is used to obtain a full-resolution target image.

[0019] The storage medium of the present invention stores computer executable instructions thereon, and when the computer executable instructions are executed by a computer processor, they are used to implement the static scene ray tracing chessboard rendering method of the present invention.

[0020] In the tracking and rendering process of the present invention, if the camera is stationary, the full-resolution target image is obtained through odd-even chessboard sampling, chessboard ray tracing rendering and superposition of previous and next frame images, which can save calculation amount, thereby reducing the image rendering time and improving the frame rate; if the camera is moving, the full-resolution target image is obtained by odd-even chessboard sampling, chessboard ray tracing rendering, reprojection method and eight-neighbor interpolation denoising method, which can improve the real-time interactive frame rate.

[0021] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0022] 1. Compared with the prior art of calculating full-resolution images, the present invention adopts odd-even chessboard sampling and the superposition method of previous and next frame images, which reduces the amount of calculation for ray tracing rendering of each frame of the image, thereby reducing the image rendering time and improving the real-time interactive frame rate.

[0023] 2. Due to the use of ray tracing rendering method, the rendering quality can be improved compared to rasterization rendering.

[0024] 3. Due to the use of a bounding box structure, the intersection operation between the bounding box and the light is fast, and objects that do not intersect with the light can be quickly filtered out, thereby achieving rendering acceleration.

[0025] 4. Due to the use of CPU parallel computing, the efficiency of ray tracing rendering can be improved and the utilization rate of computer resources can be improved.

[0026] 5. Due to the use of reprojection method and eight-neighbor interpolation denoising method, the aliasing problem of chessboard rendering during camera movement is avoided. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 It is a schematic diagram of the ray tracing chessboard rendering principle of the present invention;

[0028] Figure 2 is a flow chart of the ray tracing chessboard rendering method of the present invention;

[0029] Figure 3 It is a schematic diagram of the odd-even chessboard sampling method;

[0030] Figure 4 It is a flowchart of the checkerboard ray tracing algorithm;

[0031] Figure 5 It is a schematic diagram of spatial block parallel computing;

[0032] Figure 6 It is a schematic diagram of the method of superimposing the front and back frames;

[0033] Figure 7 It is the flow chart of the interactive correction algorithm;

[0034] Figure 8 This is a schematic diagram of the eight-neighbor interpolation denoising method. DETAILED DESCRIPTION

[0035] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.

[0036] Example 1

[0037] like Figure 1 ,2 As shown, the specific steps of the CPU-based static scene ray tracing chessboard rendering method of this embodiment are as follows:

[0038] Step S1: construct a three-dimensional scene according to the coordinates of the point light source and the geometric object, and initialize the camera position.

[0039] The three-dimensional scene includes all geometric objects such as point light sources, occluders, and scene objects.

[0040] Step S2, set a historical pixel value buffer for storing pixel color values, whose size is half of the number of screen pixels, and the initial value is set to the scene background color; at the same time, set a historical collision point coordinate buffer.

[0041] The scene background color is selected as pure black; the historical collision point coordinate buffer stores the coordinates of the first collision point between the light and the object in the chessboard ray tracing algorithm, as well as the corresponding pixel point coordinates, and its size is half the number of screen pixels.

[0042] Step S3, calculate the bounding box of each geometric object in the three-dimensional scene. The method is to first calculate the center of gravity coordinates O of the geometric object, define the vector from the center of gravity position of the geometric object to the camera position as the positive direction, and then use the center of gravity O of the geometric object as the starting point to project rays P(t)=O+td in the six directions of positive, negative, left, right, up and down, where d is the direction of the ray and t is the time; assume that the unit time is 2ms, calculate the point K reached by the ray every unit time, calculate the plane perpendicular to the ray and passing through point K, and if the plane does not intersect with the geometric object, save the plane as the boundary; finally, planes in six directions are obtained, and the bounding box composed of the boundaries of the six planes is the bounding box.

[0043] The bounding box is a six-sided cuboid that surrounds the object. If the light does not intersect the bounding box, it means that the light will not intersect with the geometric objects in the bounding box. In this embodiment, since the intersection operation of the bounding box and the light is fast, objects that do not intersect with the light can be quickly filtered out.

[0044] Step S4: In the sampling stage, even-odd chessboard sampling is implemented by programming to obtain sampling pixel points.

[0045] like Figure 3As shown, the method is to define the two frames that alternate back and forth as odd frames and even frames respectively, and set an odd-even flag for each frame. If the odd-even flag is 1, it means that the frame is an odd frame, and if the odd-even flag is 0, it means that the frame is an even frame. An odd-numbered frame means that the number of the current frame is odd, such as the first frame is an odd frame; an even-numbered frame means that the number of the current frame is even, such as the second frame is an even frame. When sampling the odd-even chessboard, each row of pixels is traversed. For an odd frame, if it is an odd row, only the pixels with odd numbers in the row are sampled, and if it is an even row, only the pixels with even numbers in the row are sampled; for an even frame, if it is an odd row, only the pixels with even numbers in the row are sampled, and if it is an even row, only the pixels with odd numbers in the row are sampled.

[0046] Step S5: If the camera is stationary, then in the rendering stage, Figure 6 As shown, a half-resolution rendering frame is obtained by using a chessboard ray tracing algorithm, and then combined with the pixel values ​​of the historical pixel value buffer, a full-resolution target image is obtained by superposition.

[0047] The camera is still when the user does not have any real-time interactive behavior. Figure 4 As shown, the specific steps of the chessboard ray tracing algorithm in step S5 are step S51 to step S57.

[0048] Step S51: Figure 5 As shown, the pixel space is divided into blocks to obtain multiple pixel space blocks, each of which is 2*2 in size, that is, each pixel space block contains 4 pixels. The calculation of each pixel space block is assigned to different CPU threads, and each CPU thread performs rendering tasks at the same time.

[0049] The pixel space is the pixel space of the display screen. For example, if the display resolution is 3840*2160, the pixel space contains 3840*2160 pixels. Setting the pixel space block size to 2*2 is conducive to the reconstruction of the chessboard rendering.

[0050] Step S52: The light starts from the camera position, passes through the sampling pixel points determined by the sampling method in step S4, and is emitted into the three-dimensional scene, and the intersection of the boundary bounding box in the three-dimensional scene and the light is determined.

[0051] Step S53: If the light ray does not intersect with any bounding box, terminate the tracing of the light ray; otherwise, calculate the intersection of the light ray and the geometric object in the first bounding box. If there is a collision point, record the coordinates of the collision point. Otherwise, calculate the intersection of the light ray and the geometric object in the second bounding box, and so on, until a collision point is found and proceed to step S54. If there is no collision point, terminate the tracing of the light ray and take the corresponding pixel color as the background color.

[0052] Step S54: If there is an obstacle between the collision point and each point light source, the collision point is judged to be in the shadow area, and shadow calculation is performed to obtain the pixel value, otherwise, the process goes to step S55. The shadow calculation equation is as follows:

[0053] L o =L b +0.1*L e +0.5*Σ(I d +I s )

[0054] Among them, L o is the final pixel color, L b is the pure black value, L e is the color value of the object itself, ∑(I d +I s ) is the cumulative lighting contribution value generated by point light sources without obstacles at other distances; I d is the diffuse reflection component of the object under the point light source, I d = l d *m d *max(dot(N,L),0),l d is the diffuse reflectance of the point light source, m d is the diffuse reflection coefficient of the object, N is the normal vector, L is the incident direction vector of the light, and dot is the dot multiplication operation; I s is the highlight component of the object under the point light source, used to show the highlight effect, I s = l s *m s *max(dot(H,N) 12 ,s*2), s is the glossiness of the object, which is used to represent extremely shiny objects because their highlights are very small, such as mirrors, etc. Multiplying by 2 is to improve the fine-tuning of highlights; l s is the specular coefficient of the point light source, m s is the highlight coefficient of the object. The 12th power is calculated to reduce the impact of the highlight on the pixel color value. H is the sight vector.

[0055] Step S55: Calculate the sight line vector and the corresponding normal vector through the collision point coordinates, and store the collision point coordinates in the historical collision point coordinate buffer.

[0056] Each sampled pixel corresponds to a ray; the sight vector is a unit vector starting from the camera and heading toward the collision point.

[0057] Step S56: Calculate the color value of each pixel using a rendering equation. The rendering equation is as follows:

[0058] L o =L e +∑(Id +I s )

[0059] Among them, L o is the final pixel color, L e is the color value of the object itself, ∑(I d +I s ) is the cumulative item of the illumination contribution values ​​generated by different point light sources, I d is the diffuse reflection component of the object under the point light source, I d = l d *m d *max(dot(N,l),0),l d is the diffuse reflectance of the point light source, m d is the diffuse reflection coefficient of the object, N is the normal vector, L is the incident direction vector of the light, and dot is the dot multiplication operation; I s is the highlight component of the object under the point light source, used to show the highlight effect, I s = l s *m s *max(dot(H,N) 12 ,s*2), s is the glossiness of the object, which is used to represent extremely shiny objects because their highlights are very small, such as mirrors, etc. Multiplying by 2 is to improve the fine-tuning of highlights; l s is the specular coefficient of the point light source, m s is the highlight coefficient of the object, and the 12th power is calculated to reduce the influence of the highlight on the color value of the pixel; H is the sight vector calculated in step S55.

[0060] Step S57: Store the color value of the pixel in a historical pixel value buffer and replace the original color value in the buffer.

[0061] Step S6: If the camera moves through user interaction, such as the user controls the movement and zooming of the camera through the mouse and keyboard, an interactive correction algorithm is required to obtain a full-resolution target image.

[0062] In real-time interaction, the display content of the previous and next frames is different from the viewport. If only the rendering method in step S5 is used, aliasing and other problems will occur. The introduction of the interaction correction algorithm can be used to solve these problems. Figure 7 As shown, the specific steps of the interactive correction algorithm in step S6 are as follows:

[0063] Step S61 : Obtain a full-resolution image by the chessboard ray tracing algorithm in step S5 .

[0064] Step S62, traverse each pixel point, take out the historical collision point coordinates corresponding to the pixel point from the historical collision point coordinate buffer, and use the similar triangle method to transform the three-dimensional coordinates of the historical collision point into the UV coordinates in the current frame.

[0065] Step S63: In the camera coordinate system, the camera, the historical collision point and the pixel space plane are connected to form a similar triangle, and then the x-coordinate and y-coordinate of the collision point in the pixel screen are calculated using the distance from the camera to the pixel plane. The color value of the current pixel is obtained according to the x-coordinate, the y-coordinate and the historical pixel value buffer.

[0066] The above two steps are the reprojection method.

[0067] Step S64: After processing each pixel, a new full-resolution image is obtained.

[0068] Step S65: For the full-resolution image obtained in step S64, the target image is obtained by using the eight-neighbor interpolation denoising method. Figure 8 As shown, the method is to traverse each pixel. If the pixel is the background color and the pixel colors in the four basic adjacent directions are not the background color, then calculate the average color value of the eight pixels around the pixel, and then calculate the color difference between these eight pixel values ​​and the average value, take the four adjacent pixels with the smallest color difference and calculate the average value again, and the final color value of the pixel is taken as the final average value.

[0069] Example 2

[0070] Based on the same inventive concept as Embodiment 1, this embodiment provides a CPU-based static scene ray tracing chessboard rendering system, which includes:

[0071] A three-dimensional scene construction module, used to implement step S1 of embodiment 1, construct a three-dimensional scene according to the coordinates of the point light source and the geometric object, and initialize the camera position;

[0072] A buffer setting module, used to implement step S2 of embodiment 1, setting a historical pixel value buffer and a historical collision point coordinate buffer;

[0073] A bounding box calculation module, used to implement step S3 of embodiment 1, calculating a bounding box of each geometric object in the three-dimensional scene;

[0074] An even-odd chessboard sampling module is used to implement step S4 of embodiment 1, and implement even-odd chessboard sampling in a programming manner to obtain sampling pixel points;

[0075] The tracking rendering module is used to implement step S5 and step S6 of embodiment 1. If the camera is stationary, then in the rendering stage, a half-resolution rendering frame is obtained by using a chessboard ray tracing algorithm, and then combined with the pixel values ​​of the historical pixel value buffer, a full-resolution target image is obtained by superposition; if the camera moves through user interaction, an interactive correction algorithm is used to obtain a full-resolution target image.

[0076] Among them, the historical pixel value buffer is used to store pixel color values, its size is half the number of screen pixels, and the initial value is set to the scene background color; the historical collision point coordinate buffer is used to store the coordinates of the first collision point between the light and the object in the chessboard ray tracing algorithm, as well as the corresponding pixel point coordinates, its size is half the number of screen pixels.

[0077] The calculation method of the bounding box of each geometric object is as follows: first calculate the coordinates O of the center of gravity of the geometric object, define the vector from the center of gravity position of the geometric object to the camera position as the positive direction, and then use the center of gravity O of the geometric object as the starting point to project a ray P(t)=O+td in six directions: positive, negative, left, right, up, and down, where d is the direction of the ray and t is the time; suppose the unit time is 2ms, calculate the point K reached by the ray every unit time, calculate the plane perpendicular to the ray and passing through point K, and if the plane does not intersect with the geometric object, save the plane as the boundary; finally, planes in six directions are obtained, and the bounding box composed of the boundaries of the six planes is the bounding box.

[0078] The odd-even chessboard sampling method is as follows: define the two frames that alternate back and forth as odd frames and even frames respectively, set an odd-even flag for each frame, the odd-numbered frame's odd-even flag is 1, and the even-numbered frame's odd-even flag is 0; traverse each row of pixels during sampling, for an odd-numbered frame, if it is an odd-numbered row, only sample the pixels with odd numbers in the row, if it is an even-numbered row, only sample the pixels with even numbers in the row; for an even-numbered frame, if it is an odd-numbered row, only sample the pixels with even numbers in the row, if it is an even-numbered row, only sample the pixels with odd numbers in the row.

[0079] Example 3

[0080] Based on the same inventive concept as Embodiment 1, this embodiment provides a storage medium having computer executable instructions stored thereon, and when the computer executable instructions are executed by a computer processor, they are used to implement the static scene ray tracing chessboard rendering method of Embodiment 1. The storage medium may be any of various types of memory devices or storage devices.

[0081] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. CPU-based static scene ray tracing chessboard rendering method, It is characterized in that The following steps are involved: Step S1, constructing a three-dimensional scene according to the coordinates of the point light source and the geometric object, and initializing the camera position; Step S2, setting a historical pixel value buffer and a historical collision point coordinate buffer; Step S3, calculating the bounding box of each geometric object in the three-dimensional scene; Step S4: In the sampling stage, even-odd chessboard sampling is implemented by programming to obtain sampling pixel points; Step S5: If the camera is stationary, in the rendering stage, a half-resolution rendering frame is obtained by using a chessboard ray tracing algorithm, and then combined with the pixel values ​​in the historical pixel value buffer, a full-resolution target image is obtained by superposition; Step S6: If the camera moves due to user interaction, a full-resolution target image is obtained by using an interactive correction algorithm; The calculation method of the bounding box of each geometric object is as follows: first calculate the coordinates O of the center of gravity of the geometric object, define the vector from the center of gravity of the geometric object to the camera position as the positive direction, then use the center of gravity O of the geometric object as the starting point, and project a ray P(t)=O+td in the six directions of positive, negative, left, right, up, and down, where d is the direction of the ray and t is the time; calculate the point K reached by the ray every unit time, calculate the plane perpendicular to the ray and passing through the point K, and if the plane does not intersect with the geometric object, save the plane as the boundary; finally, planes in six directions are obtained, and the bounding box composed of the boundaries of the six planes is the bounding box; Step S5 includes the following steps: Step S51, dividing the pixel space into blocks to obtain a plurality of pixel space blocks, assigning calculation of each pixel space block to a different CPU thread, and each CPU thread performs a rendering task simultaneously; Step S52: The light starts from the camera position, passes through the sampling pixel points determined by the sampling method in step S4, and is emitted into the three-dimensional scene, and the intersection of the boundary bounding box in the three-dimensional scene and the light is determined; Step S53, if the light does not intersect with any bounding box, then the tracing of the light is terminated; otherwise, the intersection of the geometric object in the first bounding box and the light is calculated, and if there is a collision point, the coordinates of the collision point are recorded; otherwise, the intersection of the geometric object in the second bounding box and the light is calculated, and so on, until a collision point is found and the process proceeds to step S54, if there is no collision point, then the tracing of the light is terminated and the corresponding pixel color is taken as the background color; Step S54: if there is an obstacle between the collision point and each point light source, the collision point is determined to be in the shadow area, and shadow calculation is performed to obtain the color value of the pixel point; otherwise, the process proceeds to step S55; Step S55, calculating the sight line vector and the corresponding normal vector through the collision point coordinates, and storing the collision point coordinates in the historical collision point coordinate buffer; each sampling pixel corresponds to a ray; the sight line vector is a unit vector starting from the camera and heading toward the collision point; Step S56, calculating the color value of each pixel through the rendering equation; Step S57: Store the color value of the pixel in a historical pixel value buffer and replace the original color value of the pixel in the buffer.

2. The static scene ray tracing chessboard rendering method according to claim 1, It is characterized in that The odd-even chessboard sampling method in step S4 is: define the two frames that alternate back and forth as odd frames and even frames respectively, set an odd-even flag for each frame, the odd-even flag of the odd frame is 1, and the odd-even flag of the even frame is 0; traverse each row of pixels during sampling, for an odd frame, if it is an odd row, only sample the pixels with odd numbers in the row, if it is an even row, only sample the pixels with even numbers in the row; for an even frame, if it is an odd row, only sample the pixels with even numbers in the row, if it is an even row, only sample the pixels with odd numbers in the row.

3. The static scene ray tracing chessboard rendering method according to claim 1, It is characterized in that The calculation equation of the shadow in step S54 is: L o = L b + 0.1 * L e + 0.5 * ∑(I d + I s ) Among them, L o is the final pixel color value, L b is the pure black value, L e is the color value of the object itself, ∑(I d +I s ) is the cumulative lighting contribution value generated by point light sources without obstacles at other distances; I d is the diffuse reflection component of the object under the point light source, I d = l d *m d *max(dot(N,L),0),l d is the diffuse reflectance of the point light source, m d is the diffuse reflection coefficient of the object, N is the normal vector, L is the incident direction vector of the light, and dot is the dot multiplication operation; I s is the highlight component of the object under the point light source, I s = l s *m s *max(dot(H,N) 12 ,s*2), s is the glossiness of the object; l s is the specular coefficient of the point light source, m s is the object’s highlight coefficient; H is the sight vector.

4. The static scene ray tracing chessboard rendering method according to claim 1, It is characterized in that The rendering equation in step S56 is: L o =L e +Σ(I d +I s ) Among them, L o is the final pixel color value, L e is the color value of the object itself, ∑(I d +I s ) is the cumulative item of the illumination contribution values ​​generated by different point light sources, I d is the diffuse reflection component of the object under the point light source, I d = l d *m d *max(dot(N,L),0),l d is the diffuse reflectance of the point light source, m d is the diffuse reflection coefficient of the object, N is the normal vector, L is the incident direction vector of the light, and dot is the dot multiplication operation; I s is the highlight component of the object under the point light source, I s = l s *m s *max(dot(H,N) 12 ,s*2), s is the glossiness of the object; l s is the specular coefficient of the point light source, m s is the highlight coefficient of the object; H is the sight vector calculated in step S55.

5. The static scene ray tracing chessboard rendering method according to claim 1, It is characterized in that Step S6 includes the following steps: Step S61, obtaining a full-resolution image by the chessboard ray tracing algorithm in step S5; Step S62, traverse each pixel point, take out the historical collision point coordinates corresponding to the pixel point from the historical collision point coordinate buffer, and use the similar triangle method to transform the three-dimensional coordinates of the historical collision point into the UV coordinates in the current frame; Step S63, in the camera coordinate system, connect the camera, the historical collision point and the pixel space plane to form a similar triangle, and then use the distance from the camera to the pixel plane to calculate the x coordinate and y coordinate of the collision point in the pixel screen; obtain the color value of the current pixel according to the x coordinate, y coordinate and the historical pixel value buffer; Step S64: After processing each pixel, a new full-resolution image is obtained; Step S65: For the full-resolution image obtained in step S64, an eight-neighbor interpolation denoising method is used to obtain a target image.

6. The static scene ray tracing chessboard rendering method according to claim 5, It is characterized in that The process of using the eight-neighbor interpolation denoising method in step S65 is as follows: traverse each pixel, if the pixel is the background color, and the pixel colors in the four adjacent directions are not the background color, then calculate the average color value of the eight pixels around the pixel, and then calculate the color difference between the eight pixel color values ​​and the average value, take the four adjacent pixel points with the smallest color difference and calculate the average value again, and the final color value of the pixel is taken as the final average value.

7. CPU-based static scene ray tracing chessboard rendering system, It is characterized in that The static scene ray tracing chessboard rendering method according to claim 1 is implemented, comprising: The 3D scene construction module constructs the 3D scene based on the coordinates of the point light source and geometric objects and initializes the camera position; The buffer setting module sets a historical pixel value buffer and a historical collision point coordinate buffer; A bounding box calculation module calculates the bounding box of each geometric object in the three-dimensional scene; The odd-even chessboard sampling module uses programming to implement odd-even chessboard sampling and obtain sampling pixel points; Tracking rendering module, if the camera is stationary, then in the rendering stage, a chessboard ray tracing algorithm is used to obtain a half-resolution rendering frame, which is then combined with the pixel values ​​in the historical pixel value buffer to obtain a full-resolution target image; if the camera moves through user interaction, an interactive correction algorithm is used to obtain a full-resolution target image.

8. A storage medium having computer executable instructions stored thereon, It is characterized in that When the computer executable instructions are executed by a computer processor, they are used to implement the static scene ray tracing chessboard rendering method described in any one of claims 1-6.

Citation Information

Patent Citations

  • Rapid rendering method based on panoramic pre-baking and visual imaging system

    CN111798364A

  • Method and device for displaying cloud in game and electronic terminal

    CN113516751A