Shadow rendering method and apparatus, computer device, and storage medium

Obtaining light source contact information for shadow rendering through the ray tracing algorithm solves the problem of high computational complexity of traditional shadow mapping methods in complex scenes, improves shadow rendering efficiency and hardware resource utilization, and enhances the realism of rendering results.

WO2024183288A1PCT designated stage expired Publication Date: 2024-09-12TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Application Number
PCT/CN2023/125911
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-08
Filing Date
2023-10-23
Publication Date
2024-09-12

AI Technical Summary

Technical Problem

The traditional shadow map rendering method has high computational complexity in complex scenes, resulting in low shadow rendering efficiency and waste of hardware resources, and cannot effectively support the rendering requirements of high-complexity scenes.

Method used

By obtaining the world space position of each pixel in the screen space in the virtual scene, the illumination areas of multiple light sources are determined, and the light source contact information is obtained based on the ray tracing algorithm, and shadow rendering is performed to improve efficiency.

Benefits of technology

It reduces the computational complexity of shadow rendering, improves rendering efficiency, saves hardware computer resources, and enhances the layering and realism of the rendering results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023125911_12092024_PF_FP_ABST
    Figure CN2023125911_12092024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the fields of rendering and games, and relates to a shadow rendering method and apparatus, a computer device, and a storage medium. The method comprises: acquiring a position of each pixel point in a screen space in a world space where a virtual scene is located, to obtain a world space position of each pixel point (202); for each pixel point, determining, from a plurality of light sources in the virtual scene, a light source of which an illumination area comprises a world space position of the pixel point, to obtain a target light source corresponding to the pixel point (204); acquiring a position of the target light source in the world space to obtain a world space position of the target light source (206); performing ray tracing on the basis of the world space position of the target light source and the world space position of the pixel point to obtain light source access information of the target light source for the pixel point, the light source access information representing whether the target light source is illuminated to the world space position of the pixel point (208); and performing shadow rendering on the virtual scene on the basis of the light source access information to obtain a shadow rendering result (210).
Need to check novelty before this filing date? Find Prior Art

Description

Shadow rendering method, device, computer equipment and storage medium

[0001] Related applications

[0002] This application claims priority to Chinese patent application number 202310258041X, filed on March 8, 2023, entitled “Shadow rendering method, device, computer equipment and storage medium,” the entire text of which is hereby incorporated by reference. Technical Field

[0003] The present application relates to the field of rendering technology, and in particular to a shadow rendering method, apparatus, computer equipment, and storage medium. Background Art

[0004] With the development of computer technology, shadow rendering technology has emerged. Shadow rendering technology is used to render shadows to enhance the realism of rendering results.

[0005] Traditionally, shadow maps are used to render shadows. The computational complexity of shadow map-based rendering methods is closely related to the complexity of the scene being rendered. The more complex the scene, the higher the performance requirements.

[0006] Therefore, when the scene complexity is high, for example, when there are many light sources in the scene, the rendering method based on shadow mapping has the problem of high computational complexity, resulting in low shadow rendering efficiency and requiring more hardware computer resources, resulting in a waste of hardware computer resources used to support shadow rendering.

[0007] Summary of the Invention

[0008] According to various embodiments provided in the present application, a shadow rendering method, apparatus, computer device, computer-readable storage medium, and computer program product are provided.

[0009] On the one hand, the present application provides a shadow rendering method. Executed by a computer device, the method includes: obtaining the position of each pixel point in the screen space in the world space where the virtual scene is located, obtaining the world space position of each pixel point; for each pixel point, determining, from multiple light sources in the virtual scene, a light source whose illumination area includes the world space position of the pixel point, obtaining a target light source corresponding to the pixel point; obtaining the position of the target light source in the world space, obtaining the world space position of the target light source; performing ray tracing based on the world space position of the target light source and the world space position of the pixel point, obtaining light source contact information of the target light source for the pixel point, the light source contact information indicating whether the target light source generates illumination for the world space position of the pixel point; and performing shadow rendering on the virtual scene based on the light source contact information, obtaining a shadow rendering result.

[0010] On the other hand, the present application also provides a shadow rendering device. The device includes: a first position determination module, which is used to obtain the position of each pixel point in the screen space in the world space where the virtual scene is located, and obtain the world space position of each pixel point; a light source determination module, which is used to determine, for each pixel point, from multiple light sources in the virtual scene, the light source whose illumination area includes the world space position of the pixel point, and obtain the target light source corresponding to the pixel point; a second position determination module, which is used to obtain the position of the target light source in the world space, and obtain the world space position of the target light source; an information acquisition module, which is used to perform ray tracing based on the world space position of the target light source and the world space position of the pixel point, and obtain the light source contact information of the target light source for the pixel point; the light source contact information indicates whether the target light source generates illumination for the world space position of the pixel point; and a shadow rendering module, which is used to perform shadow rendering on the virtual scene based on the light source contact information, and obtain a shadow rendering result.

[0011] In another aspect, the present application further provides a computer device comprising a memory and one or more processors, wherein the memory stores computer-readable instructions, and when the processors execute the computer-readable instructions, the processors execute the shadow rendering method.

[0012] In another aspect, the present application further provides one or more non-volatile computer-readable storage media having computer-readable instructions stored thereon, which, when executed by one or more processors, cause the one or more processors to implement the above-mentioned shadow rendering method.

[0013] In another aspect, the present application further provides a computer program product, comprising computer-readable instructions, which implement the above-mentioned shadow rendering method when executed by a processor.

[0014] The details of one or more embodiments of the present application are set forth in the following drawings and description. Other features, objects, and advantages of the present application will become apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0016] FIG1 is a diagram illustrating an application environment of a shadow rendering method in some embodiments;

[0017] FIG2 is a schematic diagram of a flow chart of a shadow rendering method in some embodiments;

[0018] FIG3A is a schematic diagram of a two-dimensional grid in some embodiments;

[0019] FIG3B is a schematic diagram illustrating the intersection of a projection area and a cell in some embodiments;

[0020] FIG4 is a real-time rendering image obtained without rendering shadows in some embodiments;

[0021] FIG5 is a real-time rendering image obtained by rendering shadows in some embodiments;

[0022] FIG6 is a schematic diagram of a process for determining light source reach information in some embodiments;

[0023] FIG7 is a schematic diagram of a flow chart of a shadow rendering method in some embodiments;

[0024] FIG8 is a block diagram of a shadow rendering apparatus in some embodiments;

[0025] FIG9 is a diagram illustrating the internal structure of a computer device in some embodiments; and

[0026] FIG10 is a diagram illustrating the internal structure of a computer device in some embodiments. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0028] The shadow rendering method provided in the embodiments of the present application can be applied in the application environment shown in FIG1 . In this embodiment, terminal 102 communicates with server 104 via a network. A data storage system can store data that server 104 needs to process. The data storage system can be integrated with server 104 or placed in the cloud or on another server.

[0029] Specifically, the terminal 102 can obtain a virtual scene from the server 104. For each pixel in the screen space, the terminal 102 can determine the light source whose illumination area includes the world space position of the pixel from multiple light sources in the virtual scene, and obtain the target light source corresponding to the pixel. The terminal 102 can perform ray tracing based on the world space position of the target light source and the world space position of the pixel to obtain light source contact information of the target light source for the pixel. The light source contact information indicates whether the target light source generates light at the world space position of the pixel. The virtual scene is shadow rendered based on the light source contact information to obtain a shadow rendering result. The terminal 102 can display the shadow rendering result or send the shadow rendering result to the server 104.

[0030] Among them, the terminal 102 can be, but is not limited to, various desktop computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, cloud security, host security and other network security services, CDN, as well as basic cloud computing services such as big data and artificial intelligence platforms. The terminal 102 and the server 104 can be directly or indirectly connected through wired or wireless communication, and this application does not impose any restrictions on this.

[0031] In some embodiments, as shown in FIG2 , a shadow rendering method is provided. The method may be executed by a terminal or a server, or may be executed jointly by the terminal and the server. The method is described by taking the application of the method to the terminal 102 in FIG1 as an example, and includes the following steps:

[0032] Step 202 : Obtain the position of each pixel point in the screen space in the world space where the virtual scene is located, and obtain the world space position of each pixel point.

[0033] Specifically, for each pixel point, the terminal can obtain the position of the pixel point in the screen space, convert the position of the pixel point in the screen space into the position in the world space, and use the position obtained by the conversion as the world space position of the pixel point.

[0034] Step 204 : For each pixel, determine the light source whose illumination area includes the world space position of the pixel from multiple light sources in the virtual scene, and obtain the target light source corresponding to the pixel.

[0035] A virtual scene is a virtual scene displayed (or provided) when an application is running on a terminal. This virtual scene can be a simulation of the real world, a semi-simulated, semi-imaginary three-dimensional environment, or a purely imaginary three-dimensional environment. The virtual scene can be any of two-dimensional, 2.5-dimensional, and three-dimensional.

[0036] A light source is an object that can emit its own light and is currently emitting light, such as the sun, electric lights, or burning substances. A light source in a virtual scene is a set of lighting data that can realistically simulate the lighting effects of a real-world light source. The illumination area of ​​a light source refers to the area that the light source can illuminate. The illumination area of ​​a light source can be either spherical or conical. If the illumination area of ​​a light source is spherical, it can be called the light source's range sphere. The target light source corresponding to a pixel is the light source whose illumination area includes the world space position of the pixel.

[0037] World space refers to the three-dimensional space in which the virtual scene resides. The size of world space can be customized. For example, world space is a three-dimensional space with a length of 100 meters, a width of 100 meters, and a height of 100 meters. World space position refers to the position within world space. Screen space refers to the two-dimensional space of the screen. The size of screen space is the size of the screen, measured in pixels.

[0038] Specifically, the terminal can distribute a two-dimensional grid on a preset plane in the world space where the virtual scene is located, and the position of the two-dimensional grid on the preset plane can be updated in real time. For example, in real-time rendering, the position of the two-dimensional grid on the preset plane can be updated in real time according to the real-time switching of the screen, so that the light sources in the target light source cluster obtained by clustering the two-dimensional grid can cover the light sources participating in the real-time rendering. The multiple light sources in the virtual scene can be all or part of the light sources in the virtual scene, for example, they can be the light sources in the virtual scene whose projection area intersects with the two-dimensional grid. The projection area of ​​the light source refers to the projection area of ​​the illumination area of ​​the light source on the preset plane. The multiple light sources in the virtual scene can be stored in the buffer of the GPU (graphics processing unit), and the two-dimensional grid can also be stored in the GPU.

[0039] The preset plane can be set as needed. For example, the virtual scene includes the ground, which can also be called a horizontal plane. The preset plane can be a plane parallel to the horizontal plane, and the horizontal plane can be used as the preset plane. The preset plane can also be a plane with a preset angle to the horizontal plane. The preset angle can be set as needed, for example, it can be 0-90 degrees, and the size of the preset angle is not limited here. The two-dimensional grid has a certain size and shape. The size and shape of the two-dimensional grid can be preset as needed. For example, the shape of the two-dimensional grid is rectangular, and the length and width of the two-dimensional grid can be set as needed. The two-dimensional grid includes multiple cells, and the shape of the cells includes but is not limited to at least one of a rectangle or a triangle. The size of each cell in the two-dimensional grid can be the same or different. As shown in Figure 3A, a schematic diagram of a two-dimensional grid is shown. The two-dimensional grid in Figure 3A has a total of 16 cells. The position of the cell can be represented by rows and columns. The number in each cell represents the cell position. For example, "0-0" represents the cell in row 0 and column 0, and "1-1" represents the cell in row 1 and column 1.

[0040] In some embodiments, the terminal can determine the projection areas of the illumination areas of the multiple light sources on the preset plane, and for each cell in the two-dimensional grid, obtain the target light source cluster corresponding to the cell based on the light sources whose projection areas intersect with the cell. As shown in Figure 3B, a schematic diagram of the intersection of the projection area of ​​the light source and the cell in the two-dimensional grid is shown. Each circle in Figure 3B represents the projection area of ​​a light source, and the solid point in the circle represents the center point of the circle. The center point of the circle is the projection position of the world space position of the light source on the preset plane. L0-L5 represent 5 light sources, and the number following L can be called the index of the light source. The number after the colon represents the brightness. For example, 100 in L4:100 represents the brightness. For example, the terminal can select all or part of the light sources from the light sources whose projection areas intersect with the cell to form the target light source cluster corresponding to the cell. A light source cluster refers to a set of light sources, and a target light source cluster is a light source cluster obtained by clustering multiple light sources in a virtual scene. The terminal can determine a matching light source cluster that has an illumination effect on the pixel from the target light source clusters corresponding to each cell, and then determine the target light source corresponding to the pixel from the matching light source clusters that have an illumination effect on the pixel. The matching light source cluster that has an illumination effect on the pixel can be referred to as the matching light source cluster for the pixel, and the target light source corresponding to the pixel refers to the light source whose illumination area includes the world space position of the pixel.

[0041] In some embodiments, a unit column is generated for each cell. The unit column of a cell is a column with the cell as its cross-section, perpendicular to the preset plane, and with a height greater than a preset height. The terminal can obtain a target light source cluster corresponding to the cell based on the light sources whose illumination area intersects with the unit column. The unit column can also be called a light source cluster column. The terminal can select all or some of the light sources from the light sources whose illumination area intersects with the unit column to form the target light source cluster corresponding to the cell.

[0042] In some embodiments, the terminal may determine the cell to which the projection position of the pixel's world space position on the preset plane belongs, obtain a target cell, and determine the target light source cluster corresponding to the target cell as the matching light source cluster that has an illumination effect on the pixel. The terminal may determine, from the matching light source cluster that has an illumination effect on the pixel, a light source whose illumination area includes the pixel's world space position, to obtain the target light source corresponding to the pixel.

[0043] Step 206: Acquire the position of the target light source in the world space to obtain the world space position of the target light source.

[0044] Step 208 , performing ray tracing based on the world space position of the target light source and the world space position of the pixel point, to obtain light source contact information of the target light source for the pixel point; the light source contact information indicates whether the target light source generates light for the world space position of the pixel point.

[0045] Ray tracing can be implemented based on the Screen Space Ray Tracing and Screen Space Shadow algorithms. Screen Space Ray Tracing is a common real-time computer graphics algorithm that uses a pixel shader or compute shader to access the scene depth buffer to determine whether two points in space are blocked by a pixel in screen space in the corresponding world space. The Screen Space Shadow algorithm calculates whether a pixel will cast a shadow under the light source by tracing screen space rays between the pixel to be drawn and the light source.

[0046] The light source's reach information for a pixel indicates whether the light source illuminates the pixel's world-space position. The light source reach information is one of a first preset value and a second preset value. The first preset value indicates that the light source does not illuminate the pixel's world-space position; the second preset value indicates that the light source illuminates the pixel's world-space position. The first preset value and the second preset value are different. The first preset value and the second preset value can be represented by different numerical values, for example, the first preset value is 1 and the second preset value is 0. Of course, the first preset value and the second preset value can also be other numerical values, which are not specifically limited here.

[0047] Specifically, for any light source in the matching light source cluster of a pixel point, when the illumination area of ​​the light source includes the world space position of the pixel point, that is, when the light source is the target light source corresponding to the pixel point, the terminal can perform ray tracing based on the world space position of the target light source and the world space position of the pixel point to obtain the light source reach information of the target light source for the pixel point.

[0048] In some embodiments, for any light source in the matching light source cluster of a pixel point, if the illumination area of ​​the light source does not include the world space position of the pixel point, the terminal uses the first preset value as the light source reach information of the light source for the pixel point.

[0049] In some embodiments, for any light source in the matching light source cluster for a pixel, if the distance between the target light source and the observation position is greater than a distance threshold, the terminal can obtain light source contact information for the pixel. The distance threshold can be set as needed, and the observation position refers to the position of the virtual camera currently observing the virtual scene.

[0050] In some embodiments, when the light source reach information of each light source in the matching light source cluster for a pixel point is obtained, before shadow rendering, the terminal can combine the light source reach information of each light source in the matching light source cluster for the pixel point to form the cluster reach information of the pixel point.

[0051] Step 210 , shadow rendering is performed on the virtual scene based on the light source reach information to obtain a shadow rendering result.

[0052] Specifically, the terminal can determine the target light source corresponding to the pixel point from multiple light sources of the virtual scene in turn, determine a different target light source each time, and when obtaining the light source contact information of the target light source for the pixel point, the terminal performs shadow rendering on the virtual scene based on the light source contact information until the multiple light sources are traversed to obtain the final shadow rendering result. Alternatively, the terminal can determine the cluster contact information of each pixel point before rendering. When performing shadow rendering, for each pixel point in the screen space, when the matching light source cluster of the pixel point includes the light source participating in shadow rendering, the light source contact information of the light source participating in shadow rendering for the pixel point is obtained from the cluster contact information of the pixel point, and shadow rendering is performed based on the light source contact information of the light source participating in shadow rendering for the pixel point to obtain the shadow rendering result. Among them, there can be one or more light sources participating in shadow rendering. For each light source participating in shadow rendering, shadow rendering can be performed using the method provided in this embodiment. The light source participating in shadow rendering refers to the light source actually to be drawn in the GPU delay pipeline.

[0053] In some embodiments, for each pixel in the screen space, the terminal can generate a corresponding bit string for the pixel. The bit string is a string consisting of at least one of 0 or 1. The length of the bit string is a fixed value, and the fixed value is greater than or equal to the maximum length of the light source list used to store the light source cluster. The actual form of the bit string can be a 32-bit integer, etc. The terminal can store the cluster contact information of the pixel in the form of a bit string. For example, different bits in the bit string represent different light source contact information in the cluster contact information. Before determining the light source contact information, the terminal can generate a bit string for the pixel and initialize the characters of each bit in the bit string to a second preset value, such as 0. If the light source contact information of the light source for the pixel is determined to be the first preset value, the bit corresponding to the light source in the bit string is updated to the first preset value, such as 1. If the light source contact information of the light source for the pixel is determined to be the second preset value, the bit string remains unchanged. The terminal can create a buffer in the GPU, which can be called a screen pixel shadow mask buffer, and store the bit string of each pixel in the buffer. When performing shadow rendering, the terminal can read the light source contact information of the light source for the pixel from the buffer.

[0054] In the above shadow rendering method, the position of each pixel point in the screen space in the world space where the virtual scene is located is obtained, and the world space position of each pixel point is obtained. For each pixel point in the screen space, the light source whose illumination area includes the world space position of the pixel point is determined from multiple light sources in the virtual scene, and the target light source corresponding to the pixel point is obtained. Ray tracing is performed based on the distance between the target light source and the pixel point in the world space to obtain the light source contact information of the target light source for the pixel point. The light source contact information represents whether the target light source generates light for the world space position of the pixel point, and the virtual scene is shadow rendered based on the light source contact information. Since shadow rendering is performed based on the light source contact information determined by ray tracing, shadow rendering can be quickly implemented in the case where there are many light sources in the virtual scene, thereby improving the efficiency of shadow rendering, reducing the computational complexity, saving hardware computer resources used to support shadow rendering, reducing the waste of hardware computer resources, and improving the utilization rate of hardware computer resources.

[0055] The shadow rendering method provided in the present application can be applied to real-time rendering to add a stronger sense of layering and realism to the rendered picture through shadows. As shown in FIG4 , a real-time rendering picture obtained without rendering the shadows is shown. As shown in FIG5 , a real-time rendering picture obtained after rendering the shadows is shown. Obviously, compared with FIG4 , the real-time rendering picture of FIG5 has a stronger sense of layering and realism. Real-time rendering of more light sources requires the cooperation of real-time rendering of shadows of more light sources to achieve realistic real-time rendering under more light sources. The shadow rendering method provided in the present application can make the performance of rendering of more light sources independent of the scene scale and the number of light sources, thereby improving the rendering efficiency of more light sources in scenes with more light sources, so that the rendering of shadows of more light sources can achieve real-time performance.

[0056] In some embodiments, ray tracing is performed based on the world space position of the target light source and the world space position of the pixel point to obtain light source contact information of the target light source for the pixel point, including: determining the ray tracing start position and the ray tracing end position based on the world space position of the target light source and the world space position of the pixel point; determining the number of ray tracing steps according to the ray tracing start position and the ray tracing end position; performing ray tracing according to the number of ray tracing steps to obtain light source contact information of the target light source for the pixel point.

[0057] The world space position of the target light source refers to the position of the target light source in world space. The starting position of ray tracing is the world space position of the pixel point.

[0058] Specifically, the terminal may determine the world space position of the pixel as the starting position for ray tracing. The terminal may determine the direction from the world space position of the pixel to the world space position of the target light source to obtain the ray tracing direction, and determine the position where the distance between the ray tracing direction and the world space position of the pixel is equal to a preset tracing distance as the ray tracing termination position. The preset tracing distance may be set as needed, for example, based on the length of a shadow, where the preset tracing distance is greater than or equal to the length of the shadow.

[0059] In some embodiments, the terminal can determine the tracing step factor based on the ray tracing starting position and the ray tracing ending position, and determine the ray tracing steps based on the tracing step factor and the tracing step threshold. When the depth difference at any sampling position is less than or equal to the depth difference threshold, the light source contact information of the target light source for the pixel point is determined to be a first preset value; when the depth difference at each sampling position is greater than the depth difference threshold, the light source contact information of the target light source for the pixel point is determined to be a second preset value. The depth difference threshold can be preset, or the depth difference threshold can be determined based on the depth value of the ray tracing starting position and the depth value of the ray tracing ending position.

[0060] In this embodiment, the number of ray tracing steps is determined based on the ray tracing starting position and the ray tracing ending position, so that the number of ray tracing steps can be reasonably limited, the ray tracing efficiency is improved, and the hardware computer resources used to support shadow rendering are saved.

[0061] In some embodiments, the starting position and the ending position of ray tracing are determined based on the world space position of the target light source and the world space position of the pixel point, including: determining the direction from the world space position of the pixel point to the world space position of the target light source to obtain the ray tracing direction; determining the world space position of the pixel point as the starting position of ray tracing; and determining the ending position of ray tracing based on the ray tracing direction and a preset tracing distance.

[0062] The preset tracing distance can be set as needed. For example, it can be determined based on the length of the shadow, and the preset tracing distance is greater than or equal to the shadow length. The ray tracing direction refers to the direction from the world space position of the pixel to the world space position of the target light source. The ray tracing direction can be represented by a direction vector. This direction vector is a unit vector that points from the world space position of the pixel to the world space position of the target light source.

[0063] Specifically, the terminal can calculate the product of the preset tracking distance and the direction vector, add the result of the product to the world space position of the pixel, and use the result of the addition as the end position. For example, if the preset tracking distance is L, the direction vector is (x1, y1, z1), and the world space position of the pixel is (x2, y2, z2), then the end position = (x2, y2, z2) + L*(x1, y1, z1).

[0064] In this embodiment, the ray tracing termination position is determined based on the ray tracing direction and the preset tracing distance, thereby limiting the ray tracing distance, improving the ray tracing efficiency, and saving hardware computer resources used to support shadow rendering.

[0065] In some embodiments, determining the number of ray tracing steps based on the ray tracing starting position and the ray tracing ending position includes: converting the ray tracing starting position to a preset two-dimensional space to obtain a converted starting position, where the preset two-dimensional space is either a texture space or a screen space; converting the ray tracing ending position to a preset two-dimensional space to obtain a converted ending position; determining the distance between the converted starting position and the converted ending position; determining a tracing step factor based on the distance between the converted starting position and the converted ending position; and determining the number of ray tracing steps based on the tracing step factor and the tracing step threshold.

[0066] The preset two-dimensional space is either texture space (i.e., UV space) or screen space. Texture space is a unit square area, with texture coordinates represented by (u, v), where 0 <= u <= 1 and 0 <= v <= 1. The tracing step threshold can be pre-set as needed. The tracing step factor reflects the screen area occupied by the line segment between the ray tracing start position and the ray tracing end position in screen space. The larger the tracing step factor, the larger the screen area occupied in screen space.

[0067] Specifically, when the preset two-dimensional space is a texture space, the terminal can determine the position corresponding to the ray tracing start position after being converted to the texture space, and use the determined position as the starting position after the conversion, and determine the position corresponding to the ray tracing end position after being converted to the texture space, and use the determined position as the ending position after the conversion. Similarly, when the preset two-dimensional space is a screen space, the terminal can determine the position corresponding to the ray tracing start position after being converted to the screen space, and use the determined position as the starting position after the conversion, and determine the position corresponding to the ray tracing end position after being converted to the screen space, and use the determined position as the ending position after the conversion.

[0068] In some embodiments, the distance between the converted starting position and the converted ending position is positively correlated with the tracking step factor. The number of ray tracing steps is positively correlated with the tracking step factor and the tracking step threshold. For example, the terminal can calculate the distance between the converted starting position and the converted ending position and determine the calculated distance as the tracking step factor.

[0069] In some embodiments, the tracking step threshold may include a minimum tracking step and a maximum tracking step, and the minimum tracking step and the maximum tracking step may be preset as needed. The terminal may calculate the product of the tracking step factor and the maximum tracking step, and use the result of the product as a candidate tracking step. When the candidate tracking step is less than the minimum tracking step, the minimum tracking step is used as the ray tracing step. When the candidate tracking step is greater than the maximum tracking step, the maximum tracking step is used as the ray tracing step. When the candidate tracking step is greater than or equal to the minimum tracking step and the candidate tracking step is less than or equal to the maximum tracking step, the candidate tracking step is used as the ray tracing step. In this embodiment, since the tracking step threshold includes a preset minimum tracking step and a preset maximum tracking step, the ray tracing step can be quickly and accurately determined based on the minimum tracking step and the maximum tracking step, thereby improving the utilization rate of the hardware computer resources used to support shadow rendering.

[0070] In this embodiment, the tracing step factor reflects the screen area occupied by the line segment between the starting position of ray tracing and the ending position of ray tracing in the screen space. The larger the occupied screen area, the closer the distance between the camera and the pixel point and the light source is. Conversely, the farther the distance between the camera and the pixel point and the light source is. Therefore, the ray tracing steps are positively correlated with the tracing step factor, so that the closer the pixel point and the light source are to the camera, the more ray tracing steps are taken. Conversely, the fewer ray tracing steps are taken. This makes ray tracing more reasonable, improves the efficiency of ray tracing, saves hardware computer resources used to support shadow rendering, and improves the utilization rate of hardware computer resources.

[0071] In some embodiments, ray tracing is performed according to the number of ray tracing steps to obtain light source contact information of the target light source for the pixel point, including: determining the ray tracing step size based on a preset tracing distance and the number of ray tracing steps; starting from the world space position of the pixel point, sampling is performed at intervals of the ray tracing step size along the ray tracing direction to obtain multiple sampling positions; obtaining the depth value of each sampling position; obtaining the depth value of the screen space position corresponding to each sampling position; for each sampling position, determining the difference between the depth value of the sampling position and the depth value of the corresponding screen space position to obtain the depth difference of the sampling position; according to the depth difference of each sampling position, obtaining the light source contact information of the target light source for the pixel point.

[0072] The multiple sampling positions refer to the number of sampling positions of the ray tracing steps. For example, if the number of ray tracing steps is 6, the multiple sampling positions refer to 6 sampling positions.

[0073] Specifically, the terminal may calculate the ratio of a preset tracing distance to the number of ray tracing steps and determine the calculated ratio as the ray tracing step size. A screen space position is the position of a pixel in screen space, and a depth value of a screen space position is the depth value of the pixel. The terminal may store the depth value of each pixel in screen space. Starting from the world space position of the pixel, the terminal may determine multiple sampling positions along the ray tracing direction; the distance between two adjacent sampling positions in the ray tracing direction is the ray tracing step size, and the number of sampling positions is the ray tracing step size. The terminal may determine the depth value of the sampling position to obtain a first depth value, calculate the pixel corresponding to the sampling position in screen space, obtain the depth value of the corresponding pixel to obtain a second depth value, and calculate the difference between the first depth value and the second depth value to obtain a depth difference value for the sampling position. The depth value reflects the distance between the world space position and the observation position, while the depth value of the pixel reflects the distance between the world space position of the pixel and the observation position. A larger depth value indicates a greater distance from the observation position. In some embodiments, when the depth difference at any sampling position is less than or equal to the depth difference threshold, the terminal can determine that the light source contact information of the target light source for the pixel point is a first preset value, and when the depth difference at each sampling position is greater than the depth difference threshold, the terminal can determine that the light source contact information of the target light source for the pixel point is a second preset value. The depth difference threshold can be set as needed, or the depth difference threshold can be determined based on the depth value of the starting position of the ray tracing and the depth value of the ending position of the ray tracing. As shown in Figure 6, a flow chart for determining light source contact information is shown. The "light tracing steps" in Figure 6 refers to the ray tracing steps, and "whether the tracing result pixel and the light source are blocked" is used to determine whether the light source is blocked. When the depth difference at any sampling position is less than or equal to the depth difference threshold, it is determined that the light source is blocked. When the depth difference at each sampling position is greater than the depth difference threshold, it is determined that the light source is not blocked.

[0074] In this embodiment, the light source triggering information is determined by the depth value, which improves the accuracy and efficiency of determining the light source triggering information, saves hardware computer resources used to support shadow rendering, and improves the utilization rate of hardware computer resources.

[0075] In some embodiments, the light source touch information of the target light source for the pixel point is obtained according to the depth difference of each sampling position, including: determining the depth difference threshold based on the depth value of the starting position of the ray tracing and the depth value of the ending position of the ray tracing; when the depth difference of any sampling position is less than or equal to the depth difference threshold, determining the light source touch information of the target light source for the pixel point to be a first preset value; the first preset value indicates that the target light source does not generate illumination for the world space position of the pixel point; when the depth difference of each sampling position is greater than the depth difference threshold, determining the light source touch information of the target light source for the pixel point to be a second preset value; the second preset value indicates that the target light source generates illumination for the world space of the pixel point.

[0076] Specifically, the terminal can determine the depth value of the starting position of ray tracing to obtain the starting depth value, and determine the depth value of the ending position of ray tracing to obtain the ending depth value, determine the difference between the starting depth value and the ending depth value to obtain the total depth difference, and determine the depth difference threshold based on the total depth difference and the number of ray tracing steps. For example, the terminal can calculate the ratio of the total depth difference to the number of ray tracing steps, and determine the calculated ratio as the depth difference threshold. The depth difference threshold can also be called the step depth.

[0077] In this embodiment, when the depth difference at any sampling position is less than or equal to the depth difference threshold, the light source contact information of the target light source for the pixel point is determined to be a first preset value. When the depth difference at each sampling position is greater than the depth difference threshold, the light source contact information of the target light source for the pixel point is determined to be a second preset value. This improves the accuracy of the light source contact information, saves hardware computer resources used to support shadow rendering, and improves the utilization rate of hardware computer resources.

[0078] In some embodiments, determining the depth difference threshold based on the depth value of the starting position of ray tracing and the depth value of the ending position of ray tracing includes: using the depth value of the starting position of ray tracing as the starting depth value, and using the depth value of the ending position of ray tracing as the ending depth value; determining the difference between the starting depth value and the ending depth value to obtain a total depth difference; and determining the depth difference threshold based on the total depth difference and the number of ray tracing steps.

[0079] Specifically, the depth difference threshold is positively correlated with the total depth difference, and negatively correlated with the number of ray tracing steps. For example, the terminal may calculate the ratio of the total depth difference to the number of ray tracing steps and determine the calculated ratio as the depth difference threshold.

[0080] In this embodiment, the depth difference threshold is determined based on the total depth difference and the number of ray tracing steps, thereby improving the accuracy of the depth difference threshold.

[0081] In some embodiments, from multiple light sources in a virtual scene, a light source whose illumination area includes the world space position of the pixel point is determined to obtain a target light source corresponding to the pixel point, including: distributing a two-dimensional grid on a preset plane in the world space, the two-dimensional grid including a plurality of cells; obtaining the projection areas of the illumination areas of each of the multiple light sources in the virtual scene on the preset plane; for each of the cells, obtaining a light source whose projection area intersects with the cell from the multiple light sources to obtain a target light source cluster corresponding to the cell; determining a matching light source cluster that has an illumination effect on the pixel point from the target light source clusters corresponding to each cell; and determining the target light source corresponding to the pixel point from the matching light source clusters that have an illumination effect on the pixel point.

[0082] Specifically, the number of light sources included in the target light source cluster is less than or equal to a preset number. The terminal may select light sources less than or equal to the preset number from the light sources whose projection area intersects the cell to form the target light source cluster corresponding to the cell. Alternatively, the terminal may select light sources less than or equal to the preset number from the light sources whose illumination area intersects the cell column to form the target light source cluster corresponding to the cell.

[0083] In some embodiments, the terminal can initialize a light source cluster for each cell. The initialized light source cluster contains no light sources and can accommodate at most a preset number of light sources. For example, an empty list of fixed length can be initialized as the initialized light source cluster. The fixed-length empty list can store at most the preset number of light sources. It should be noted that storing light sources in the light source cluster refers to storing the identifiers of the light sources, not the light sources themselves. The current light source cluster is initially the initialized light source cluster. When traversing the multiple light sources, light sources can be added to the current light source cluster. The terminal can sequentially determine candidate light sources from the multiple light sources, and determine cells in each cell of the two-dimensional grid that intersect with the candidate light sources on a preset plane. If the number of light sources included in the current light source cluster of the determined cell is less than the preset number, the candidate light source is added to the current light source cluster of the determined cell, and the step of sequentially determining candidate light sources from the multiple light sources is returned until the multiple light sources are traversed. After traversing the multiple light sources, the terminal can determine the current light source cluster of each cell in the two-dimensional grid as the target light source cluster for each cell. The candidate light source is any light source from the multiple light sources. During the traversal of the multiple light sources, a different light source can be selected as a candidate light source each time. A cell intersecting a candidate light source on a preset plane refers to a cell intersecting with the projection area of ​​the candidate light source's illumination area on the preset plane. During the process of traversing the multiple light sources, the current light source cluster of a cell may be constantly changing. Before starting to traverse the multiple light sources, the current light source cluster of the cell may not include any light sources, that is, the current light source cluster is initialized to a light source cluster that does not include any light sources. During the process of traversing the multiple light sources, light sources are added to the current light source cluster.

[0084] In this embodiment, since the light sources are clustered and shadow rendering is performed based on the matching light source clusters of pixel points, shadow rendering can be quickly achieved when there are many light sources in the virtual scene, thereby improving the shadow rendering efficiency, saving hardware computer resources used to support shadow rendering, and improving the utilization rate of hardware computer resources.

[0085] In some embodiments, the number of light sources in each target light source cluster is less than or equal to a preset number.

[0086] The preset number can be set as needed, for example, 20 or 50. When the projection area of ​​the illumination area of ​​the light source on the preset plane intersects with the cell, it is considered that the light source has an intersection relationship with the cell.

[0087] Specifically, for each cell, the terminal can determine the intersecting light sources of the cell from multiple light sources. The intersecting light sources of a cell refer to the light sources whose projection area of ​​the illumination area on a preset plane intersects with the cell. The number of intersecting light sources of a cell can be one or more, and "multiple" means at least two. If the number of intersecting light sources of the cell is less than or equal to the preset number, the terminal can group the individual intersecting light sources of the unit into a target light source cluster corresponding to the cell.

[0088] In some embodiments, when the number of intersecting light sources in the cell is greater than the preset number, the terminal can calculate the influence representation value of each intersecting light source on the cell, and select a preset number of intersecting light sources from the intersecting light sources of the cell in order of the influence representation values ​​from large to small, and form the selected intersecting light sources into a target light source cluster corresponding to the cell.

[0089] In some embodiments, the value representing the degree of influence of a light source on a cell can be determined using at least one of a distance quantization value or an attribute quantization value. The value representing the degree of influence is negatively correlated with the distance quantization value. The distance quantization value represents the distance between the light source and the cell. The distance between the light source and the cell can be the distance between the light source's world-space position and the cell's center, or the distance between the light source's projected position and the cell's center. The projected position of the light source refers to the position of the projection of the light source's world-space position onto the preset plane. The attribute quantization value is determined based on the properties of the light source, where the light source properties include, but are not limited to, at least one of the light source's brightness or intensity. Brightness is calculated based on the light source's color. The attribute quantization value is positively correlated with both the light source's brightness and intensity. The attribute quantization value can also be related to the light source's decay rate: a faster decay rate corresponds to a smaller attribute quantization value, while a slower decay rate corresponds to a larger attribute quantization value. The value representing the degree of influence is positively correlated with the attribute quantization value. For example, the terminal can calculate the ratio of the attribute quantization value to the distance quantization value and determine this ratio as the value representing the degree of influence of the intersecting light source on the cell.

[0090] In this embodiment, since the number of light sources in the target light source cluster is less than or equal to the preset number, the impact of the number of light sources on the rendering performance is alleviated. When there are many light sources in the virtual scene, the rendering performance and efficiency can be improved, the hardware computer resources used to support shadow rendering are saved, and the utilization rate of hardware computer resources is improved.

[0091] In some embodiments, obtaining a target light source cluster corresponding to the cell from the multiple light sources, including: initializing the light source cluster of the cell; determining a light source having an intersecting relationship between the projection area and the cell from the multiple light sources, to obtain the intersecting light source of the cell; if the number of light sources included in the light source cluster of the cell does not reach the preset number, adding the intersecting light source to the light source cluster of the cell; if the number of light sources included in the light source cluster of the cell reaches the preset number, determining an influence degree characterization value of the intersecting light source of the cell on the cell, searching for a light source to be replaced from the light source cluster of the cell, and replacing the light source to be replaced in the light source cluster of the cell with the intersecting light source, wherein the influence degree characterization value of the light source to be replaced on the cell is less than the influence degree characterization value of the intersecting light source on the cell; returning to the step of determining a light source having an intersecting relationship between the projection area and the cell from the multiple light sources to obtain the intersecting light source of the cell, until the multiple light sources are traversed; and, if the multiple light sources are traversed, determining the light source cluster of the cell as the target light source cluster corresponding to the cell.

[0092] Specifically, the terminal can determine the intersecting light sources of the cell from multiple light sources in turn; the intersecting light sources of the cell refer to the light sources whose projection area of ​​the illumination area on the preset plane intersects with the cell; when the number of light sources included in the current light source cluster of the cell is less than the preset number, the intersecting light sources are added to the current light source cluster of the cell; return to the step of determining the intersecting light sources of the cell from multiple light sources in turn until multiple light sources are traversed; when multiple light sources are traversed, the current light source cluster of the cell is determined as the target light source cluster of the cell.

[0093] In some embodiments, when the number of light sources included in the current light source cluster of the cell reaches a preset number, the terminal can determine the influence degree characterization value of the intersecting light source of the cell on the cell, and search for the first light source to be replaced from the current light source cluster of the cell, and the influence degree characterization value of the first light source to be replaced on the cell is less than the influence degree characterization value of the intersecting light source on the cell. For example, the terminal can determine the minimum influence degree characterization value from the various influence degree characterization values ​​corresponding to the current light source cluster of the cell. The various influence degree characterization values ​​refer to the influence degree characterization values ​​of the various light sources in the current light source cluster of the cell for the cell. The terminal can compare the influence degree characterization value of the intersecting light source on the cell with the minimum influence degree characterization value. When the influence degree characterization value of the intersecting light source on the cell is greater than the minimum influence degree characterization value, the light source corresponding to the minimum influence degree characterization value is determined as the first light source to be replaced found. Thereby, the light source with a larger influence degree characterization value is retained in the target light source cluster of the cell, which is conducive to accurate rendering and improves the rendering effect.

[0094] In some embodiments, the terminal may remove the first light source to be replaced from the current light source cluster of the cell, add the intersecting light source to the current light source cluster of the cell, and return to the step of sequentially determining the intersecting light sources of the cell from multiple light sources until multiple light sources are traversed. In the case of traversing multiple light sources, the current light source cluster of the cell is determined as the target light source cluster of the cell. If the impact degree representation value of the intersecting light source on the cell is less than or equal to the minimum impact degree representation value, the terminal determines that the first light source to be replaced has not been found, and returns to the step of sequentially determining the intersecting light sources of the cell from multiple light sources.

[0095] In some embodiments, the terminal can determine candidate light sources from multiple light sources in sequence, determine cells that intersect with the candidate light source on a preset plane from each cell of the two-dimensional grid, and when the number of light sources included in the current light source cluster of the determined cell is less than the preset number, add the candidate light source to the current light source cluster of the determined cell. When the number of light sources included in the current light source cluster of the determined cell reaches the preset number, the terminal determines the influence representation value of the candidate light source on the determined cell, searches for a second light source to be replaced from the current light source cluster of the determined cell, and the influence representation value of the second light source to be replaced on the determined cell is less than the influence representation value of the candidate light source on the determined cell. The found second light source to be replaced is removed from the current light source cluster of the determined cell, and the candidate light source is added to the current light source cluster of the determined cell, and returns to the step of determining candidate light sources from multiple light sources in sequence until multiple light sources are traversed. After traversing multiple light sources, the terminal can determine the current light source cluster of each cell in the two-dimensional grid as the target light source cluster of each cell.

[0096] Specifically, the terminal can determine the minimum influence degree characterization value from the various influence degree characterization values ​​corresponding to the current light source cluster of the determined cell. The various influence degree characterization values ​​refer to the influence degree characterization values ​​of the various light sources in the current light source cluster of the determined cell for the determined cell. The terminal can compare the influence degree characterization value of the candidate light source for the determined cell with the minimum influence degree characterization value. When the influence degree characterization value of the candidate light source for the determined cell is greater than the minimum influence degree characterization value, the light source corresponding to the minimum influence degree characterization value is determined as the second light source to be replaced that has been found. When the influence degree characterization value of the candidate light source for the determined cell is less than or equal to the minimum influence degree characterization value, the terminal determines that the second light source to be replaced has not been found. Since the influence representation value of the second light source to be replaced on the determined cell is smaller than the influence representation value of the candidate light source on the determined cell, the second light source to be replaced is removed from the current light source cluster of the determined cell, and the candidate light source is added to the current light source cluster of the determined cell. The light sources in the current light source cluster can be updated in the direction of increasing the influence representation value, so that the light source with a larger influence representation value is retained in the target light source cluster of the cell, which is conducive to accurate rendering and improves the rendering effect.

[0097] In some embodiments, the clustering method includes at least one of a first clustering method and a second clustering method, the first clustering method being different from the second clustering method, and the first clustering method and the second clustering method being respectively applicable to a situation where there are relatively few light sources or the GPU has relatively strong parallel computing capabilities, and a situation where there are particularly many light sources or the GPU has slightly weak parallel computing capabilities. Before clustering, the terminal may determine a selected clustering method, and the selected clustering method may be automatically selected by the terminal based on the number of light sources or the GPU's parallel computing capabilities, or may be manually selected.

[0098] Among them, when the selected clustering method is the first clustering method, for each cell in the two-dimensional grid, the terminal can determine the intersecting light source of the cell from multiple light sources in turn. The intersecting light source of the cell refers to the light source whose projection area of ​​the illumination area on the preset plane intersects with the cell. When the number of light sources included in the current light source cluster of the cell is less than the preset number, the intersecting light source is added to the current light source cluster of the cell, and the step of determining the intersecting light source of the cell from multiple light sources in turn is returned until multiple light sources are traversed. When multiple light sources are traversed, the current light source cluster of the cell is determined as the target light source cluster of the cell.

[0099] Among them, when the selected clustering method is the second clustering method, the terminal can determine the candidate light source from multiple light sources in turn, and determine the cells that have an intersecting relationship with the candidate light source on the preset plane from each cell of the two-dimensional grid. When the number of light sources included in the current light source cluster of the determined cell is less than the preset number, the candidate light source is added to the current light source cluster of the determined cell, and the step of determining the candidate light source from multiple light sources in turn is returned until multiple light sources are traversed. After traversing multiple light sources, the current light source cluster of each cell in the two-dimensional grid is respectively determined as the target light source cluster of each cell.

[0100] In this embodiment, the target light source cluster of the cell is quickly determined by traversing the light sources, which improves clustering efficiency, saves hardware computer resources used to support shadow rendering, and improves the utilization rate of hardware computer resources.

[0101] In some embodiments, a matching light source cluster that has an illumination effect on a pixel point is determined from the target light source clusters corresponding to each cell, including: obtaining the projection position of the world space position of the pixel point on a preset plane; determining the cell to which the projection position belongs to obtain the target cell; and determining the target light source cluster corresponding to the target cell as the matching light source cluster that has an illumination effect on the pixel point.

[0102] The area occupied by the target cell on the preset plane includes the projection position of the world space position of the pixel point on the preset plane.

[0103] In this embodiment, the matching light source cluster having illumination influence on the pixel point is accurately and efficiently determined through the projection position, thereby saving hardware computer resources for supporting shadow rendering and improving the utilization rate of hardware computer resources.

[0104] In some embodiments, the method also includes: forming the cluster touch information of the pixel point with the light source touch information of each light source in the matching light source cluster of the pixel point for the pixel point during the rendering process, and determining the light sources participating in shadow rendering; for each pixel point in the screen space, when the matching light source cluster of the pixel point includes at least one light source participating in shadow rendering, obtaining the light source touch information of at least one light source participating in shadow rendering for the pixel point from the cluster touch information of the pixel point; performing shadow rendering based on the light source touch information of at least one light source participating in shadow rendering for the pixel point, and obtaining a shadow rendering result.

[0105] The cluster reach information of the pixel point includes the light source reach information of each light source in the matching light source cluster of the pixel point for the pixel point. The cluster reach information of the pixel point is generated before shadow rendering. There can be one or more light sources participating in shadow rendering. For each light source participating in shadow rendering, shadow rendering can be performed using the method provided in this embodiment. The light source participating in shadow rendering refers to the light source actually to be drawn in the GPU delay pipeline.

[0106] Specifically, before performing shadow rendering, for each pixel, the terminal can combine the light source contact information of each light source in the pixel's matching light source cluster with the pixel's cluster contact information. When performing shadow rendering, the terminal obtains the light source contact information of the light source participating in the shadow rendering with the pixel from the cluster contact information of the pixel, and performs shadow rendering based on the light source contact information of the light source participating in the shadow rendering with the pixel to obtain the shadow rendering result.

[0107] In some embodiments, when the light source contact information of a light source participating in shadow rendering for a pixel is a first preset value, it is determined that the pixel has a shadow under the light source participating in shadow rendering. When the light source contact information of the light source participating in shadow rendering for the pixel is a second preset value, it is determined that the pixel has no shadow under the light source participating in shadow rendering.

[0108] In this embodiment, the light source contact information of the light source participating in shadow rendering for the pixel point is obtained from the cluster contact information of the pixel point, so that the light source contact information can be obtained quickly, which improves the rendering efficiency, saves the hardware computer resources used to support shadow rendering, and improves the utilization rate of the hardware computer resources.

[0109] In some embodiments, as shown in FIG7 , a shadow rendering method is provided. The method may be executed by a terminal or jointly by a terminal and a server. The method is described using the terminal as an example, including the following steps:

[0110] Step 702: Distribute two-dimensional grids on a preset plane in the world space where the virtual scene is located.

[0111] Step 704 : Clustering the multiple light sources in the virtual scene according to the cells in the two-dimensional grid to obtain target light source clusters corresponding to the cells.

[0112] There is an intersection relationship between the projection area of ​​the illumination area of ​​the light source in the target light source cluster on the preset plane and the corresponding cell.

[0113] Step 706 : for each pixel in the screen space, determine a matching light source cluster having an illumination effect on the pixel from multiple target light source clusters, and determine a target light source corresponding to the pixel from the matching light source clusters having an illumination effect on the pixel.

[0114] Step 708 : For each pixel point in the screen space, determine the direction from the world space position of the pixel point to the world space position of the target light source to obtain the ray tracing direction.

[0115] Among them, the light source reach information represents whether the target light source generates illumination for the world space position of the pixel point.

[0116] In step 710 , the world space position of the pixel point is determined as the starting position of ray tracing, and the ending position of ray tracing is determined based on the ray tracing direction and the preset tracing distance.

[0117] Step 712: determine the number of ray tracing steps based on the ray tracing start position and the ray tracing end position, and determine the ray tracing step length based on the preset tracing distance and the number of ray tracing steps.

[0118] The preset tracing distance is the distance between the starting position of the ray tracing and the ending position of the ray tracing.

[0119] Step 714 : Starting from the world space position of the pixel point, determine multiple sampling positions along the ray tracing direction.

[0120] The length of the interval between two adjacent sampling positions in the ray tracing direction is the ray tracing step length, and the number of sampling positions is the ray tracing step number.

[0121] Step 716 : For each sampling position, determine the difference between the depth value of the sampling position and the depth value of the screen space position corresponding to the sampling position to obtain the depth difference of the sampling position.

[0122] Step 718: Obtain the light source contact information of the target light source for the pixel point based on the depth difference of each sampling position.

[0123] In step 720, shadow rendering is performed on the virtual scene based on the target light source's pixel light source reach information, yielding a shadow rendering result. In this embodiment, light source reach information is determined based on ray tracing, and light sources in the virtual scene are clustered. This allows for rapid shadow rendering in the presence of multiple light sources, thereby improving shadow rendering efficiency.

[0124] The shadow rendering method provided in this application can be applied to any scene that requires shadow rendering, especially scenes with multiple light sources, including but not limited to scenes such as film and television special effects, games, mirror simulation, visual design, VR (Virtual Reality), industrial simulation, and digital cultural creation. The shadow rendering method provided in this application can improve shadow rendering efficiency in scenes such as film and television special effects, visual design, games, mirror simulation, VR, industrial simulation, and digital cultural creation.

[0125] The shadow rendering method provided by this application is applied to digital cultural creation, and can simulate things with cultural significance, especially things illuminated by multiple light sources. For example, it can simulate the Great Wall. There are usually many lights on the Great Wall, and lights are usually installed around the Great Wall. By rendering the shadows produced by multiple lights, the real lighting effect of the Great Wall under the illumination of multiple lights can be reflected. Specifically, for each pixel in the screen space, the target light source corresponding to the pixel is determined from the multiple light sources in the digital Great Wall scene. Ray tracing is performed based on the world space position of the target light source and the world space position of the pixel to obtain the light source contact information of the target light source for the pixel. Based on the light source contact information, the digital Great Wall scene is shadow rendered to obtain the shadow rendering result of the digital Great Wall. Therefore, the shadow rendering method provided by this application not only presents the real lighting effect of the digital Great Wall under the illumination of multiple lights, but also improves the efficiency of shadow rendering in the digital Great Wall.

[0126] For each pixel in the game scene, the terminal can determine the target light source corresponding to the pixel from multiple light sources in the game scene. The pixel's world space position in the game scene's world space is located within the illumination area of ​​the target light source corresponding to the pixel. Ray tracing is performed based on the world space position of the target light source and the world space position of the pixel to obtain the target light source's light source contact information for the pixel. The light source contact information indicates whether the target light source generates light at the pixel's world space position. Based on the light source contact information, shadow rendering is performed on the game scene to obtain the shadow rendering result. This improves the rendering efficiency of shadows in the game scene.

[0127] For optimized rendering of VR scenes, the terminal can determine the target light source corresponding to each pixel in the screen space from multiple light sources in the VR scene. The pixel's world space position in the world space where the VR scene is located is within the illumination area of ​​the target light source corresponding to the pixel. Ray tracing is performed based on the world space position of the target light source and the world space position of the pixel to obtain the light source contact information of the target light source for the pixel. The light source contact information indicates whether the target light source generates light at the world space position of the pixel. Based on the light source contact information, shadow rendering is performed on the VR scene to obtain the shadow rendering result. This improves the rendering efficiency of shadows in VR scenes.

[0128] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0129] Based on the same inventive concept, embodiments of the present application also provide a shadow rendering device for implementing the aforementioned shadow rendering method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more shadow rendering device embodiments provided below can be found in the above-described limitations of the shadow rendering method and will not be further elaborated here.

[0130] In some embodiments, as shown in FIG8 , a shadow rendering apparatus is provided, including: a first position determination module 802 , a light source determination module 804 , a second position determination module 806 , an information acquisition module 808 , and a shadow rendering module 810 , wherein:

[0131] The first position determination module 802 is configured to obtain the position of each pixel point in the screen space in the world space where the virtual scene is located, and obtain the world space position of each pixel point.

[0132] The light source determination module 804 is configured to determine, for each pixel point, from a plurality of light sources in the virtual scene, a light source whose illumination area includes the world space position of the pixel point, and obtain a target light source corresponding to the pixel point.

[0133] The second position determination module 806 is configured to obtain the position of the target light source in the world space, and obtain the world space position of the target light source.

[0134] The information acquisition module 808 is used to perform ray tracing based on the world space position of the target light source and the world space position of the pixel point to obtain the light source contact information of the target light source for the pixel point; the light source contact information indicates whether the target light source generates light for the world space position of the pixel point.

[0135] The shadow rendering module 810 is used to perform shadow rendering on the virtual scene based on the light source contact information to obtain a shadow rendering result.

[0136] In some embodiments, the information acquisition module 806 is also used to determine the starting position and the ending position of ray tracing based on the world space position of the target light source and the world space position of the pixel point; determine the number of ray tracing steps according to the starting position and the ending position of ray tracing; perform ray tracing according to the number of ray tracing steps to obtain the light source contact information of the target light source for the pixel point.

[0137] In some embodiments, the information acquisition module 806 is also used to determine the direction from the world space position of the pixel point to the world space position of the target light source to obtain the ray tracing direction; determine the world space position of the pixel point as the starting position of the ray tracing; and determine the ending position of the ray tracing based on the ray tracing direction and the preset tracing distance.

[0138] In some embodiments, the information acquisition module 806 is also used to convert the ray tracing starting position to a preset two-dimensional space to obtain a converted starting position, where the preset two-dimensional space is a texture space or any one of the screen spaces; convert the ray tracing ending position to a preset two-dimensional space to obtain a converted ending position; determine the distance between the converted starting position and the converted ending position; determine the tracing step factor based on the distance between the converted starting position and the converted ending position; and determine the ray tracing steps according to the tracing step factor and the tracing step threshold.

[0139] In some embodiments, the tracking step threshold includes a preset minimum tracking step and a preset maximum tracking step. The information obtaining module 806 is further used to multiply the tracking step factor by the maximum tracking step, and use the multiplication result as a candidate tracking step; when the candidate tracking step is less than the minimum tracking step, use the minimum tracking step as the ray tracing step; and, when the candidate tracking step is greater than the maximum tracking step, use the maximum tracking step as the ray tracing step.

[0140] In some embodiments, the information acquisition module 806 is further used to determine the ray tracing step size based on a preset tracing distance and the number of ray tracing steps; starting from the world space position of the pixel point, sampling is performed at intervals of the ray tracing step size along the ray tracing direction to obtain multiple sampling positions; obtaining the depth value of each sampling position; obtaining the depth value of the screen space position corresponding to each sampling position; for each of the sampling positions, determining the difference between the depth value of the sampling position and the depth value of the corresponding screen space position to obtain the depth difference of the sampling position; and, based on the depth difference of each sampling position, obtaining the light source contact information of the target light source for the pixel point.

[0141] In some embodiments, the information acquisition module 806 is also used to determine a depth difference threshold based on the depth value of the starting position of the ray tracing and the depth value of the ending position of the ray tracing; when the depth difference at any sampling position is less than or equal to the depth difference threshold, the light source contact information of the target light source for the pixel point is determined to be a first preset value; the first preset value indicates that the target light source does not generate illumination for the world space position of the pixel point; when the depth difference at each sampling position is greater than the depth difference threshold, the light source contact information of the target light source for the pixel point is determined to be a second preset value; the second preset value indicates that the target light source generates illumination for the world space of the pixel point.

[0142] In some embodiments, the information acquisition module 806 is further used to use the depth value of the starting position of ray tracing as the starting depth value, and the depth value of the ending position of ray tracing as the ending depth value; determine the difference between the starting depth value and the ending depth value to obtain the total depth difference; and determine the depth difference threshold based on the total depth difference and the number of ray tracing steps.

[0143] In some embodiments, the light source determination module 804 is also used to distribute a two-dimensional grid on a preset plane in the world space, wherein the two-dimensional grid includes multiple cells; obtain the projection areas of the illumination areas of the multiple light sources in the virtual scene on the preset plane respectively; for each of the cells, obtain the light source whose projection area intersects with the cell from the multiple light sources to obtain the target light source cluster corresponding to the cell; determine the matching light source cluster that has an illumination effect on the pixel point from the target light source clusters corresponding to each cell; and determine the target light source corresponding to the pixel point from the matching light source clusters that have an illumination effect on the pixel point.

[0144] In some embodiments, the light source determination module 804 is also used to initialize the light source cluster of the cell; determine the light source between the projection area and the cell intersecting the light source from the multiple light sources to obtain the intersecting light source of the cell; if the number of light sources included in the light source cluster of the cell does not reach the preset number, add the intersecting light source to the light source cluster of the cell; if the number of light sources included in the light source cluster of the cell reaches the preset number, determine the influence degree representation value of the intersecting light source of the cell on the cell, and search for the light source to be replaced from the light source cluster of the cell, and use the intersecting light source to replace the light source to be replaced in the light source cluster of the cell, the light source whose influence degree representation value of the light source to be replaced on the cell is less than the influence degree representation value of the intersecting light source on the cell; return to the step of determining the light source between the projection area and the cell intersecting the light source from the multiple light sources to obtain the intersecting light source of the cell, until the multiple light sources are traversed; and, when the multiple light sources are traversed, determine the light source cluster of the cell as the target light source cluster corresponding to the cell.

[0145] In some embodiments, the light source determination module 804 is further used to obtain the projection position of the world space position of the pixel point on a preset plane; determine the cell to which the projection position belongs to obtain the target cell; and determine the target light source cluster corresponding to the target cell as the matching light source cluster that has an illumination effect on the pixel point.

[0146] In some embodiments, the device is also used to: combine the light source contact information of each light source in the matching light source cluster of the pixel point for the pixel point into cluster contact information of the pixel point; during the rendering process, determine the light sources participating in shadow rendering; for each pixel point in the screen space, when the matching light source cluster of the pixel point includes at least one light source participating in shadow rendering, obtain the light source contact information of at least one light source participating in shadow rendering for the pixel point from the cluster contact information of the pixel point; perform shadow rendering based on the light source contact information of at least one light source participating in shadow rendering for the pixel point, and obtain a shadow rendering result.

[0147] Each module in the shadow rendering device described above can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0148] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in Figure 9. The computer device includes a processor, memory, an input / output (I / O) interface, and a communication interface. The processor, memory, and I / O interface are connected via a system bus, and the communication interface is connected to the system bus via the I / O interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer-readable instructions, and a database. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium. The database of the computer device is used to store data involved in a shadow rendering method. The I / O interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals via a network connection. When executed by the processor, the computer-readable instructions implement a shadow rendering method.

[0149] In some embodiments, a computer device is provided, which may be a terminal. Its internal structure diagram may be as shown in Figure 10. The computer device includes a processor, memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer-readable instructions. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals via wired or wireless communication, where the wireless communication may be achieved via Wi-Fi, a mobile cellular network, NFC (near-field communication), or other technologies. When executed by the processor, the computer-readable instructions implement a shadow rendering method. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0150] Those skilled in the art will understand that the structures shown in Figures 9 and 10 are merely block diagrams of partial structures related to the solution of the present application, and do not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figures, or combine certain components, or have a different component arrangement.

[0151] In some embodiments, a computer device is provided, including a memory and one or more processors, wherein the memory stores computer-readable instructions, and the processor implements the above-mentioned shadow rendering method when executing the computer-readable instructions.

[0152] In some embodiments, one or more readable storage media are provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor, the above-mentioned shadow rendering method is implemented.

[0153] In some embodiments, a computer program product is provided, comprising computer-readable instructions, which implement the above shadow rendering method when executed by one or more processors.

[0154] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions.

[0155] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through computer-readable instructions. The computer-readable instructions can be stored in a non-volatile computer-readable storage medium. When the computer-readable instructions are executed, they can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0156] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0157] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A shadow rendering method, performed by a computer device, the method comprising: Obtaining the position of each pixel point in the screen space in the world space where the virtual scene is located, and obtaining the world space position of each pixel point; For each pixel point, determine, from a plurality of light sources in the virtual scene, a light source whose illumination area includes the world space position of the pixel point, to obtain a target light source corresponding to the pixel point; Acquire the position of the target light source in the world space to obtain the world space position of the target light source; Performing ray tracing based on the world space position of the target light source and the world space position of the pixel point to obtain light source contact information of the target light source for the pixel point, wherein the light source contact information indicates whether the target light source generates illumination for the world space position of the pixel point; and Shadow rendering is performed on the virtual scene based on the light source reach information to obtain a shadow rendering result.

2. The method according to claim 1, wherein the performing ray tracing based on the world space position of the target light source and the world space position of the pixel point to obtain the light source contact information of the target light source for the pixel point comprises: Determine a ray tracing start position and a ray tracing end position based on the world space position of the target light source and the world space position of the pixel point; Determining the number of ray tracing steps according to the ray tracing starting position and the ray tracing ending position; and, Ray tracing is performed according to the ray tracing steps to obtain light source contact information of the target light source for the pixel point.

3. The method according to claim 2, wherein determining the ray tracing start position and the ray tracing end position based on the world space position of the target light source and the world space position of the pixel point comprises: Determine a direction from the world space position of the pixel point to the world space position of the target light source to obtain a ray tracing direction; Determining the world space position of the pixel as the ray tracing start position; and, The ray tracing termination position is determined based on the ray tracing direction and the preset tracing distance.

4. The method according to claim 3, wherein determining the number of ray tracing steps according to the ray tracing starting position and the ray tracing ending position comprises: Converting the ray tracing starting position to a preset two-dimensional space to obtain a converted starting position; Converting the ray tracing end position to the preset two-dimensional space to obtain a converted end position; Determining a distance between the converted starting position and the converted ending position; Determining a tracking step factor based on a distance between the converted starting position and the converted ending position; and, The number of ray tracing steps is determined according to the tracing step factor and the tracing step threshold.

5. The method according to claim 4, wherein the tracing step threshold comprises a preset minimum tracing step and a preset maximum tracing step, and determining the ray tracing steps according to the tracing step factor and the tracing step threshold comprises: Multiplying the tracking step number factor by the maximum tracking step number, and using the multiplication result as a candidate tracking step number; When the candidate tracing step number is less than the minimum tracing step number, the minimum tracing step number is used as the ray tracing step number; and, When the candidate tracing step number is greater than the maximum tracing step number, the maximum tracing step number is used as the ray tracing step number.

6. The method according to any one of claims 3 to 5, wherein performing ray tracing according to the ray tracing steps to obtain light source contact information of the target light source for the pixel point comprises: Determine a ray tracing step length based on the preset tracing distance and the ray tracing step number; Starting from the world space position of the pixel point, sampling is performed along the ray tracing direction at intervals of the ray tracing step length to obtain a plurality of sampling positions; Obtaining a depth value of each of the sampling positions; Obtaining a depth value of a screen space position corresponding to each sampling position; For each of the sampling positions, determining a difference between a depth value of the sampling position and a depth value of a corresponding screen space position, to obtain a depth difference of the sampling position; and, According to the depth difference of each of the sampling positions, light source contact information of the target light source for the pixel point is obtained.

7. The method according to claim 6, wherein obtaining the light source contact information of the target light source for the pixel point according to the depth difference of each sampling position comprises: Determining a depth difference threshold based on the depth value of the ray tracing start position and the depth value of the ray tracing end position; When the depth difference at any of the sampling positions is less than or equal to the depth difference threshold, determining that the light source contact information of the target light source for the pixel point is a first preset value; The first preset value indicates that the target light source does not illuminate the world space position of the pixel point; and When the depth difference at each sampling position is greater than the depth difference threshold, it is determined that the light source reach information of the target light source for the pixel point is a second preset value; the second preset value represents that the target light source generates illumination for the world space of the pixel point.

8. The method according to claim 7, wherein determining the depth difference threshold based on the depth value of the ray tracing start position and the depth value of the ray tracing end position comprises: The depth value of the starting position of the ray tracing is used as the starting depth value, and the depth value of the ending position of the ray tracing is used as the ending depth value; Determine the difference between the starting depth value and the ending depth value to obtain a total depth difference; and, A depth difference threshold is determined based on the total depth difference and the number of ray tracing steps.

9. The method according to any one of claims 1 to 8, wherein determining, from a plurality of light sources in the virtual scene, a light source whose illumination area includes the world space position of the pixel point, and obtaining a target light source corresponding to the pixel point comprises: Distributing a two-dimensional grid on a preset plane in the world space, the two-dimensional grid comprising a plurality of cells; Obtain projection areas of illumination areas of each of a plurality of light sources in the virtual scene on the preset plane; For each of the cells, a light source having an intersection relationship between a projection area and the cell is obtained from the multiple light sources to obtain a target light source cluster corresponding to the cell; Determine a matching light source cluster having an illumination effect on the pixel point from the target light source clusters corresponding to each of the cells; and A target light source corresponding to the pixel point is determined from a matching light source cluster having an illumination influence on the pixel point. 10 . The method according to claim 9 , wherein the number of light sources in each of the target light source clusters is less than or equal to a preset number.

11. The method according to claim 10, wherein acquiring, from the plurality of light sources, a light source having an intersection relationship between a projection area and the cell to obtain a target light source cluster corresponding to the cell comprises: Initialize the light source cluster of the cell; Determine, from the multiple light sources, a light source having an intersection relationship between a projection area and the cell, to obtain an intersection light source of the cell; When the number of light sources included in the light source cluster of the cell does not reach the preset number, adding the intersecting light source to the light source cluster of the cell; In the case that the number of light sources included in the light source cluster of the cell reaches the preset number, determining the influence degree characterization value of the intersecting light sources of the cell on the cell, searching for a light source to be replaced from the light source cluster of the cell, and using the intersecting light source to replace the light source to be replaced in the light source cluster of the cell, the influence degree characterization value of the light source to be replaced on the cell being less than the influence degree characterization value of the intersecting light source on the cell; Returning to the step of determining a light source having an intersection relationship between a projection area and the cell from among the multiple light sources, and obtaining the intersecting light source of the cell, until the multiple light sources are traversed; and, In the case of traversing the multiple light sources, the light source cluster of the cell is determined as the target light source cluster corresponding to the cell.

12. The method according to any one of claims 9 to 11, wherein determining a matching light source cluster having an illumination effect on the pixel point from the target light source clusters corresponding to each of the cells comprises: Obtaining the projection position of the world space position of the pixel point on the preset plane; Determine the cell to which the projection position belongs, and obtain the target cell; and, The target light source cluster corresponding to the target cell is determined as a matching light source cluster having an illumination influence on the pixel point.

13. The method according to any one of claims 1 to 12, further comprising: The light source contact information of each light source in the matching light source cluster of the pixel point is respectively used to form the cluster contact information of the pixel point; During the rendering process, determine the light sources involved in shadow rendering; For each pixel point in the screen space, when the matching light source cluster of the pixel point includes at least one light source participating in shadow rendering, obtaining light source contact information of the at least one light source participating in shadow rendering for the pixel point from the cluster contact information of the pixel point; and, Based on the at least one light source participating in the shadow rendering, shadow rendering is performed respectively for the light source reach information of the pixel point to obtain a shadow rendering result.

14. A shadow rendering device, the device comprising: A first position determination module is used to obtain the position of each pixel point in the screen space in the world space where the virtual scene is located, and obtain the world space position of each pixel point; A light source determination module is used to determine, for each pixel point, from a plurality of light sources in the virtual scene, a light source whose illumination area includes the world space position of the pixel point, and obtain a target light source corresponding to the pixel point; A second position determination module, used to obtain the position of the target light source in the world space, and obtain the world space position of the target light source; An information obtaining module, configured to perform ray tracing based on the world space position of the target light source and the world space position of the pixel point, to obtain light source contact information of the target light source for the pixel point; The light source reach information indicates whether the target light source illuminates the world space position of the pixel point; and A shadow rendering module is used to perform shadow rendering on the virtual scene based on the light source reach information to obtain a shadow rendering result.

15. A computer device comprising a memory and one or more processors, wherein the memory stores computer-readable instructions, and the processors execute the method according to any one of claims 1 to 13 when executing the computer-readable instructions.

16. One or more readable storage media having computer readable instructions stored thereon, wherein when the computer readable instructions are executed by a processor, the method of any one of claims 1 to 13 is performed.

17. A computer program product comprising computer readable instructions, which when executed by one or more processors perform the method of any one of claims 1 to 13.

Citation Information

Patent Citations

  • A method for calculating water surface reflection and refraction effects by utilizing light ray tracing

    CN109685880A

  • Rendering method and device and electronic equipment

    CN112819940A

  • Picture rendering method and picture rendering device

    CN113079409A

  • Method and apparatus for rendering shadows

    US20100295851A1

Cited By

  • Rendering generation method and system for animation of cultural and creative products

    CN119478149A