Illumination rendering method and device, electronic equipment and storage medium

By dividing the virtual scene into multiple levels and generating asynchronous lighting reconstruction tasks, the problem of dynamic global lighting in open world game scenes cannot be achieved on mobile terminals and mid-to-low-end devices, and the quality of the game screen is improved.

CN119251379APending Publication Date: 2025-01-03XINGZHEN TECH (SHANGHAI) CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411111730.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

The prior art cannot effectively realize the dynamic global lighting effect of open world game scenes on mobile terminals and some mid- and low-end PCs, resulting in poor visual effects of game pictures.

Method used

By dividing the virtual scene into scene coverage at multiple levels, asynchronous lighting reconstruction tasks are generated for each level, pre-calculated data of the lighting probe are obtained, indirect lighting data is determined and stored in voxels, forming a target volume texture, and realizing lighting Render.

Benefits of technology

Light rendering is performed asynchronously on the CPU side, without blocking the rendering thread, effectively improving the quality of the game screen and achieving dynamic global lighting effects on mobile terminals and mid- and low-end devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251379A_ABST
    Figure CN119251379A_ABST
Patent Text Reader

Abstract

The invention relates to an illumination rendering method and device, electronic equipment and a storage medium, and the method comprises the steps: dividing a virtual scene into scene coverage ranges corresponding to a plurality of hierarchies, generating an asynchronous illumination reconstruction task based on the current illumination state information of each hierarchy, and executing the asynchronous illumination reconstruction task. In the execution process, pre-calculated illumination data stored by a plurality of illumination probes in a corresponding scene coverage range are obtained, and a three-dimensional space corresponding to the scene coverage range comprises a plurality of tetrahedral grids with the illumination probes as vertexes; and determining a matched tetrahedral mesh of voxels in the corresponding three-dimensional space in the plurality of tetrahedral meshes, determining indirect illumination data based on the pre-calculated illumination data of each illumination probe in the matched tetrahedral mesh, and storing the indirect illumination data to the voxels to obtain the target volume texture of the hierarchy. And performing illumination rendering based on the target volume texture of each level. The dynamic global illumination effect of the open world game scene can be realized on the mobile terminal, and the picture quality of the game is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a lighting rendering method, device, electronic device and storage medium. Background Art

[0002] With the improvement of hardware performance of smart terminals, the image quality and complexity of mobile games are also constantly improving, and players have higher and higher requirements for the visual experience of games. Among them, realizing the global illumination effect of game scenes is one of the key technologies to improve the visual experience of games.

[0003] However, the lighting rendering method used in related technologies to achieve global lighting effects for game scenes, although it can support global lighting effects for dynamic lighting scenes, is not suitable for open world game scenes. In addition, due to the complex process and high performance overhead, it can easily cause game operation on mobile terminals and some mid-to-low-end PCs to become stuck, resulting in poor visual effects on the game screen. Summary of the invention

[0004] The present disclosure provides a lighting rendering method, device, electronic device and storage medium to at least solve the problem that the lighting rendering method in the related art cannot achieve dynamic global lighting effects of open world game scenes on mobile terminals and some low-end and mid-end PCs, resulting in poor visual effects of the game screen. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, a lighting rendering method is provided, comprising:

[0006] Acquire current illumination state information corresponding to a plurality of scene coverage ranges in the virtual scene, wherein the plurality of scene coverage ranges correspond to a plurality of levels, and a scene coverage range of a lower level is smaller than a scene coverage range of a higher level;

[0007] For each of the levels, based on current lighting state information of a scene coverage range corresponding to the level, generating an asynchronous lighting reconstruction task for the level;

[0008] In the process of executing the asynchronous illumination reconstruction task of the level, the pre-calculated illumination data respectively stored in a plurality of illumination probes in the corresponding scene coverage are obtained, the three-dimensional space corresponding to the scene coverage includes a plurality of tetrahedral meshes with the plurality of illumination probes as vertices; a voxel in the three-dimensional space corresponding to the scene coverage is determined, and a matching tetrahedral mesh among the plurality of tetrahedral meshes, wherein the voxel is located in the matching tetrahedral mesh; based on the pre-calculated illumination data of each illumination probe in the matching tetrahedral mesh, indirect illumination data stored in the voxel is determined, and the indirect illumination data is stored in the voxel, so as to obtain a target volume texture of the scene coverage corresponding to the level;

[0009] Based on the target volume texture of the scene coverage range corresponding to each of the levels, the virtual scene is illuminated and rendered.

[0010] In some exemplary embodiments, before determining the voxels in the three-dimensional space corresponding to the scene coverage, the method further includes:

[0011] voxelize the three-dimensional space corresponding to the scene coverage range based on the step size of the corresponding level to obtain a voxel space corresponding to the scene coverage range, wherein the voxel space is composed of a plurality of the voxels;

[0012] Among them, the step size corresponding to the low level is smaller than the step size corresponding to the high level.

[0013] In some exemplary embodiments, the multiple scene coverages overlap with each other, and the lighting rendering of the virtual scene based on the target volume texture of the scene coverage corresponding to each level includes:

[0014] Determine at least one candidate scene coverage range to which the pixel to be rendered belongs in the scene coverage range corresponding to each of the levels;

[0015] Determine the lowest level among the levels corresponding to the coverage range of the at least one candidate scene;

[0016] Determine a matching voxel of the pixel to be rendered in a target volume texture corresponding to the candidate scene coverage at the lowest level;

[0017] Based on the indirect lighting data stored in the matching voxel, lighting rendering is performed on the pixel point to be rendered.

[0018] In some exemplary embodiments, determining the indirect lighting data stored in the voxel based on the pre-computed lighting data of each lighting probe in the matching tetrahedral mesh includes:

[0019] Determining a weight corresponding to each of the light probes based on a distance between each light probe and the voxel in the matching tetrahedral mesh;

[0020] Based on the weight corresponding to each of the illumination probes, a weighted sum is performed on the pre-calculated illumination data stored in each of the illumination probes to obtain the indirect illumination data stored in the voxel.

[0021] In some exemplary embodiments, the generating the asynchronous illumination reconstruction task of the level based on the current illumination state information of the scene coverage range corresponding to the level includes:

[0022] Determine the difference between current lighting state information and historical lighting state information of a scene coverage range corresponding to the level, and obtain the lighting state difference of the level;

[0023] When the illumination state difference of the level satisfies a preset illumination state update condition, an asynchronous illumination reconstruction task of the level is generated.

[0024] In some exemplary embodiments, the method further comprises:

[0025] In the case where the illumination state difference of the level does not satisfy the preset illumination state update condition, determining a current coverage range change of the scene coverage range corresponding to the level;

[0026] When the current coverage change satisfies a preset change condition, an asynchronous lighting reconstruction task of the level is generated.

[0027] In some exemplary embodiments, before determining the voxels in the three-dimensional space corresponding to the scene coverage, the method further includes:

[0028] For a voxel in the three-dimensional space corresponding to the scene coverage range, searching for a historical voxel corresponding to the voxel from a historical target volume texture of a corresponding level;

[0029] If the historical voxel is found, the indirect illumination data stored in the historical voxel is stored in the voxel;

[0030] If the historical voxel is not found, the step of determining the voxel in the three-dimensional space corresponding to the scene coverage and matching the tetrahedral meshes among the multiple tetrahedral meshes is performed.

[0031] In some exemplary embodiments, the method further comprises:

[0032] Determining light source spherical harmonic coefficients of the light source in the virtual scene;

[0033] For each lighting probe in the virtual scene, an indirect lighting value is determined based on the light transmission coefficient stored in the lighting probe and the spherical harmonic coefficient of the light source, and the indirect lighting value is stored in the lighting probe as pre-calculated lighting data.

[0034] According to a second aspect of an embodiment of the present disclosure, a lighting rendering device is provided, comprising:

[0035] The lighting state acquisition unit is configured to acquire current lighting state information corresponding to a plurality of scene coverage ranges in the virtual scene, wherein the plurality of scene coverage ranges correspond to a plurality of levels, and a scene coverage range of a lower level is smaller than a scene coverage range of a higher level;

[0036] An asynchronous task generation unit is configured to execute, for each of the levels, generating an asynchronous lighting reconstruction task for the level based on current lighting state information of a scene coverage range corresponding to the level;

[0037] The volume texture generation unit is configured to obtain, during the execution of the asynchronous illumination reconstruction task of the level, pre-calculated illumination data respectively stored in a plurality of illumination probes within the corresponding scene coverage, wherein the three-dimensional space corresponding to the scene coverage includes a plurality of tetrahedral meshes with the plurality of illumination probes as vertices; determine a voxel in the three-dimensional space corresponding to the scene coverage, and a matching tetrahedral mesh among the plurality of tetrahedral meshes, wherein the voxel is located within the matching tetrahedral mesh; determine indirect illumination data stored in the voxel based on the pre-calculated illumination data of each illumination probe in the matching tetrahedral mesh, and store the indirect illumination data in the voxel, so as to obtain a target volume texture of the scene coverage corresponding to the level;

[0038] The lighting rendering unit is configured to perform lighting rendering on the virtual scene based on the target volume texture of the scene coverage corresponding to each of the levels.

[0039] In some exemplary embodiments, the volume texture generation unit is further configured to perform voxelization on the three-dimensional space corresponding to the scene coverage range based on the step size of the corresponding level before determining the voxels in the three-dimensional space corresponding to the scene coverage range, and before matching tetrahedral meshes among the multiple tetrahedral meshes, to obtain a voxel space corresponding to the scene coverage range, wherein the voxel space is composed of a plurality of voxels; wherein the step size corresponding to the low level is smaller than the step size corresponding to the high level.

[0040] In some exemplary embodiments, the multiple scene coverages overlap with each other, and the lighting rendering unit includes:

[0041] A first determining unit is configured to determine at least one candidate scene coverage range to which the pixel to be rendered belongs in the scene coverage range corresponding to each of the levels;

[0042] A second determining unit is configured to determine the lowest level among the levels corresponding to the coverage range of the at least one candidate scene;

[0043] A matching voxel determination unit is configured to determine a matching voxel of the pixel to be rendered in the target volume texture corresponding to the candidate scene coverage range at the lowest level;

[0044] The pixel rendering unit is configured to perform lighting rendering on the pixel to be rendered based on the indirect lighting data stored in the matching voxel.

[0045] In some exemplary embodiments, when the volume texture generation unit determines the indirect lighting data stored in the voxel based on the pre-calculated lighting data of each lighting probe in the matching tetrahedral mesh, the volume texture generation unit is configured to determine the weight corresponding to each lighting probe based on the distance between each lighting probe in the matching tetrahedral mesh and the voxel; and perform weighted summation of the pre-calculated lighting data stored in each lighting probe based on the weight corresponding to each lighting probe to obtain the indirect lighting data stored in the voxel.

[0046] In some exemplary embodiments, the asynchronous task generation unit includes:

[0047] an illumination state difference determining unit, configured to determine the difference between current illumination state information and historical illumination state information of a scene coverage range corresponding to the level, to obtain the illumination state difference of the level;

[0048] The first generating unit is configured to execute, when the illumination state difference of the level satisfies a preset illumination state updating condition, generating an asynchronous illumination reconstruction task of the level.

[0049] In some exemplary embodiments, the asynchronous task generation unit further includes:

[0050] a coverage range change determination unit, configured to determine a current coverage range change of a scene coverage range corresponding to the level when the illumination state difference of the level does not satisfy a preset illumination state update condition;

[0051] The second generating unit is configured to execute, when the current coverage range change satisfies a preset change condition, generating the asynchronous illumination reconstruction task of the level.

[0052] In some exemplary embodiments, the volume texture generation unit is further configured to perform: for the voxel in the three-dimensional space corresponding to the scene coverage range, searching for the historical voxel corresponding to the voxel from the historical target volume texture of the corresponding level; if the historical voxel is found, storing the indirect lighting data stored in the historical voxel to the voxel; if the historical voxel is not found, executing the step of determining the voxel in the three-dimensional space corresponding to the scene coverage range, and matching the tetrahedral meshes among the multiple tetrahedral meshes.

[0053] In some exemplary embodiments, the apparatus further comprises:

[0054] A light source spherical harmonic coefficient determination unit, configured to determine the light source spherical harmonic coefficients of the light source in the virtual scene;

[0055] The indirect lighting value determination unit is configured to execute, for each lighting probe in the virtual scene, determine the indirect lighting value based on the light transmission coefficient stored in the lighting probe and the spherical harmonic coefficient of the light source, and store the indirect lighting value as pre-calculated lighting data in the lighting probe.

[0056] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0057] processor;

[0058] a memory for storing instructions executable by the processor;

[0059] Wherein, the processor is configured to execute the instructions to implement the lighting rendering method of the first aspect mentioned above.

[0060] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the lighting rendering method of the first aspect.

[0061] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the lighting rendering method of the first aspect is implemented.

[0062] The disclosed embodiment divides a virtual scene into scene coverage areas corresponding to multiple levels, and the scene coverage area of ​​the lower level is smaller than the scene coverage area of ​​the higher level. Then, for each level, an asynchronous lighting reconstruction task of the level is generated based on the current lighting state information of the scene coverage area corresponding to the level. In the process of executing the asynchronous lighting reconstruction task of the level, pre-calculated lighting data respectively stored in multiple lighting probes in the corresponding scene coverage area are obtained. The three-dimensional space corresponding to the scene coverage area includes multiple tetrahedral meshes with the multiple lighting probes as vertices. Then, matching tetrahedral meshes of voxels in the three-dimensional space corresponding to the scene coverage area in the multiple tetrahedral meshes are determined. Based on the pre-calculated lighting data of each lighting probe in the matching tetrahedral meshes, indirect lighting data stored in the voxel is determined, and the indirect lighting data is stored in the voxel. Then, a target volume texture of the scene coverage area corresponding to the level is obtained. Based on the target volume textures of the scene coverage area corresponding to each level, lighting rendering is performed on the virtual scene. In the above technical solution, each level is updated using a separate asynchronous task, which can be performed asynchronously on the CPU side without blocking the rendering thread. It can achieve dynamic global illumination effects in open world game scenes on mobile terminals and some mid-to-low-end PCs, effectively improving the game's picture quality.

[0063] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0065] Figure 1 is a schematic diagram of an application environment of a lighting rendering method according to an exemplary embodiment;

[0066] Figure 2 is a flowchart of a lighting rendering method according to an exemplary embodiment;

[0067] Figure 3 is a flowchart of another lighting rendering method according to an exemplary embodiment;

[0068] Figure 4 is a flowchart of another lighting rendering method according to an exemplary embodiment;

[0069] Figure 5 is a structural block diagram of a lighting rendering device according to an exemplary embodiment;

[0070] Figure 6It is a structural block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0071] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0072] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0073] It should also 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 display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0074] See also Figure 1 , which is a schematic diagram of an application environment according to an exemplary embodiment, the application environment may include a terminal 110 and a server 120, and the terminal 110 and the server 120 may be connected via a wired network or a wireless network.

[0075] The terminal 110 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. The terminal 110 is installed with client software such as an application (Application, referred to as App) that can provide a virtual scene display function. The application may be an independent application or a subroutine in the application. The user of the terminal 110 may log in to the application using pre-registered user information, which may include an account number and a password. Specifically, the virtual scene display function includes rendering lighting in a virtual scene. Exemplarily, the application may be a game application, etc.

[0076] The server 120 may provide background services for the application in the terminal 110. The server 120 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, an edge computing node, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0077] Figure 2 is a flowchart of a lighting rendering method according to an exemplary embodiment. Figure 2 As shown, the following steps are included:

[0078] In step S201, current illumination state information corresponding to a plurality of scene coverage ranges in a virtual scene is obtained, wherein the plurality of scene coverage ranges correspond to a plurality of levels, and a scene coverage range at a lower level is smaller than a scene coverage range at a higher level.

[0079] Specifically, the virtual scene is divided into multiple levels of scene coverage, and the size of the scene coverage of each level is different. The low-level scene coverage is small and the lighting accuracy requirement is high, while the high-level scene coverage is large and the lighting accuracy requirement is low. For example, there can be three levels, and the size of each level can be twice that of the previous level.

[0080] In a specific implementation, the virtual scene can be divided into multiple levels of scene coverage based on the depth information of each pixel in the virtual scene, with the position of the virtual object as the center, wherein the depth information indicates the distance between the pixel and the virtual object, and the distance indicated by the depth information corresponding to the high-level scene coverage is at least greater than the distance indicated by the depth information corresponding to the low-level scene coverage.

[0081] The multiple levels of scene coverage can overlap with each other. For example, the lowest level of scene coverage, indicated by a rectangular block with a length and width of 64 meters and a height of 32 meters, centered on the position of the virtual object, can be included in the middle level of scene coverage, indicated by a rectangular block with a length and width of 128 meters and a height of 64 meters. The scene coverage of the middle level can be included in the highest level of scene coverage, indicated by a rectangular block with a length and width of 256 meters and a height of 128 meters.

[0082] In step S203, for each of the levels, an asynchronous lighting reconstruction task of the level is generated based on the current lighting state information of the scene coverage range corresponding to the level.

[0083] The current lighting status information may include information such as the direction, intensity, and color of each light source in the virtual scene.

[0084] In some exemplary embodiments, in order to reduce the number of updates and reduce the consumption of computing resources, Figure 3 As shown, for each level, when implementing the current illumination state information of the scene coverage range corresponding to the level to generate the asynchronous illumination reconstruction task of the level, the above step S203 may include:

[0085] In step S301, the difference between the current lighting state information and the historical lighting state information of the scene coverage range corresponding to the level is determined to obtain the lighting state difference of the level.

[0086] The historical lighting information of this level may be the lighting state information corresponding to the previous asynchronous lighting reconstruction task of this level.

[0087] In step S303, when the illumination state difference of the level satisfies a preset illumination state update condition, an asynchronous illumination reconstruction task of the level is generated.

[0088] The preset lighting state update condition may be characterized by exceeding a corresponding threshold value. For example, if the lighting state information includes the direction, intensity, and color of each light source, the preset lighting state update condition may be that the direction difference of the light source exceeds the direction difference threshold value, and the intensity difference of the light source exceeds the intensity difference threshold value, and the color difference of the light source exceeds the color difference threshold value. It can be understood that each threshold value in the preset lighting state update condition may be configured and adjusted based on actual needs.

[0089] For each level, the above implementation method determines whether to generate an asynchronous lighting reconstruction task for the level by judging whether the lighting state difference of the level meets the preset lighting state update conditions, rather than strictly comparing the lighting state information such as the direction, intensity, and color of each light source. This not only improves flexibility, but also reduces the number of updates and reduces the consumption of computing resources.

[0090] Continue to see Figure 3 In step S305, when the illumination state difference of the level does not satisfy the preset illumination state update condition, the current coverage range change of the scene coverage range corresponding to the level is determined.

[0091] In step S307, when the current coverage range change meets a preset change condition, an asynchronous lighting reconstruction task of the level is generated.

[0092] Among them, the current coverage change of the scene coverage corresponding to this level can be measured by the distance of viewpoint movement. Specifically, the current coverage change is positively correlated with the distance of viewpoint movement, that is, the greater the distance of viewpoint movement, the greater the current coverage change.

[0093] The preset change condition may be that the current coverage range changes by more than a preset change threshold, and the preset change threshold may be set based on actual experience. For example, when the current coverage range change is measured by the distance of view movement, the preset change condition may be that the distance of view movement exceeds a preset movement distance.

[0094] In the above-mentioned embodiment, when the illumination state difference of a layer does not satisfy the preset illumination state update condition, the current coverage change of the layer is further considered. When the current coverage change of the layer satisfies the preset change condition, an asynchronous illumination reconstruction task of the layer is generated, thereby improving flexibility while greatly reducing the consumption of computing resources.

[0095] The embodiment of the present disclosure generates an asynchronous lighting reconstruction task for each level, and then the asynchronous lighting reconstruction tasks of each level can be executed separately through separate asynchronous threads. Specifically, the execution process of the asynchronous lighting reconstruction task of each level is as follows: Figure 2 As shown, the following steps (1) to (3) in S205 may be included:

[0096] (1) obtaining pre-calculated lighting data respectively stored in a plurality of lighting probes within a scene coverage range corresponding to the level, wherein the three-dimensional space corresponding to the scene coverage range includes a plurality of tetrahedral meshes with the plurality of lighting probes as vertices.

[0097] Specifically, there are multiple lighting probes distributed in the virtual scene. Lighting probes are lighting detectors pre-placed in the virtual scene. Lighting probes can capture and use relevant information about light passing through blank spaces in the scene, and can be used to provide high-quality lighting information including indirect reflected light for dynamic objects in the virtual scene.

[0098] In a specific implementation, each lighting probe stores a pre-calculated light transfer coefficient. The light transfer coefficient can be pre-baked out based on a PRT (Precomputed Radiance Transfer) method and stored in each lighting probe, wherein the light transfer coefficient can be recorded using a spherical harmonic function.

[0099] In the disclosed embodiments, the pre-calculated lighting data stored in the lighting probes may be pre-calculated indirect lighting values, and the three-dimensional space corresponding to the virtual scene includes a plurality of tetrahedral meshes with the lighting probes as vertices. That is to say, the three-dimensional space corresponding to the coverage range of each scene is composed of a plurality of tetrahedral meshes with the lighting probes therein as vertices. Managing the plurality of lighting probes within the virtual scene through tetrahedral meshes can reduce package occupancy and performance overhead.

[0100] Exemplarily, the indirect lighting data stored in each lighting probe in the virtual scene can be obtained by: determining the light source spherical harmonic coefficients of the light source in the virtual scene; for each lighting probe in the virtual scene, determining the indirect lighting value based on the light transmission coefficient stored in the lighting probe and the light source spherical harmonic coefficients, and storing the indirect lighting value as pre-calculated lighting data in the lighting probe.

[0101] Specifically, for parallel light in the virtual scene, the corresponding spherical harmonic function value can be calculated according to its lighting direction to obtain the spherical harmonic coefficient of the light source of the parallel light; for the sky light in the virtual scene, the first two order spherical harmonic function values ​​can be obtained from its pre-calculated irradiance environment data to obtain the spherical harmonic coefficient of the light source of the sky light, wherein the light transmission coefficient pre-calculated based on PRT is also recorded using spherical harmonics, and then the indirect lighting value can be obtained by performing a dot product between the light transmission coefficient stored in the lighting probe and the light source spherical harmonic coefficient of the light source, and the indirect lighting value is stored in the lighting probe as pre-calculated lighting data.

[0102] The above implementation method can reduce package occupancy and performance overhead by precalculating the indirect lighting value of each lighting probe in the virtual scene and managing the lighting probes in the virtual scene with tetrahedrons.

[0103] (2) Determine a voxel in the three-dimensional space corresponding to the scene coverage range, and a matching tetrahedral mesh among the multiple tetrahedral meshes, wherein the voxel is located within the matching tetrahedral mesh.

[0104] Specifically, the three-dimensional space corresponding to the scene coverage range can be first voxelized to obtain the corresponding voxel space, which is composed of multiple voxels. Then, for each voxel in the voxel space, a matching tetrahedral mesh containing the voxel is searched from multiple tetrahedral meshes included in the three-dimensional space corresponding to the scene coverage range, that is, the voxel is located in the matching tetrahedral mesh.

[0105] (3) Based on the pre-calculated lighting data of each lighting probe in the matching tetrahedral mesh, determine the indirect lighting data stored in the voxel, and store the indirect lighting data in the voxel to obtain a target volume texture of the scene coverage range corresponding to the level.

[0106] Specifically, when the indirect illumination data of all voxels in the three-dimensional space corresponding to the scene coverage of the level are stored, the target volume texture of the scene coverage corresponding to the level can be obtained.

[0107] Exemplarily, the weight corresponding to each lighting probe can be determined based on the distance between each lighting probe and the voxel in the matching tetrahedral mesh; then, based on the weight corresponding to each lighting probe, the pre-calculated lighting data stored in each lighting probe is weighted summed to obtain the indirect lighting data stored in the voxel.

[0108] Specifically, pre-calculated lighting data can be obtained from the lighting probes located at the four vertices of the matching tetrahedral mesh respectively, and the distance between the lighting probes at the four vertex positions of the matching tetrahedral mesh and the voxel is calculated. The distance is normalized and used as the weight corresponding to the lighting probe at the corresponding vertex position. Then, based on the weight corresponding to the lighting probes at the four vertex positions of the matching tetrahedral mesh, the pre-calculated lighting data obtained above are weighted and summed to obtain the indirect lighting data stored in the voxel.

[0109] The above implementation uses a tetrahedral grid to manage the lighting probes in the virtual scene, and converts them into voxel data based on tetrahedral interpolation during lighting reconstruction, thereby ensuring subsequent pixel-by-pixel lighting rendering, improving lighting accuracy, and reducing package size and performance overhead.

[0110] In step S207, the virtual scene is illuminated and rendered based on the target volume texture of the scene coverage range corresponding to each level.

[0111] In a specific implementation, after obtaining the target volume texture, each asynchronous thread can output the target volume texture as the task result of the asynchronous lighting reconstruction task to the rendering thread, so that the rendering thread can perform lighting rendering on the virtual scene based on the acquired target volume texture of the corresponding level.

[0112] In some exemplary embodiments, in order to further reduce performance overhead and improve lighting rendering effects, the aforementioned step S205, before determining the voxels in the three-dimensional space corresponding to the scene coverage range, and matching tetrahedral meshes in the plurality of tetrahedral meshes, may further include:

[0113] voxelize the three-dimensional space corresponding to the scene coverage range based on the step size of the corresponding level to obtain a voxel space corresponding to the scene coverage range, wherein the voxel space is composed of a plurality of the voxels;

[0114] Among them, the step size corresponding to the low level is smaller than the step size corresponding to the high level.

[0115] Specifically, the step size used to achieve voxelization can be understood as the size of the area occupied by the voxel. By setting the step size used for voxelization at the low level to be smaller than the step size used for voxelization at the high level, it can be ensured that the low-level scene coverage corresponds to relatively high lighting accuracy, and the high-level scene coverage corresponds to relatively lower lighting accuracy. This can achieve high lighting accuracy for near scenes and relatively low lighting accuracy for distant scenes. While meeting the user's demand for picture quality, it greatly reduces the performance overhead of lighting rendering, and is more suitable for game running on mobile terminals and some mid-to-low-end PCs, avoiding freezes and improving picture quality.

[0116] Based on this, in some examples, the above step S207 may include the following steps when implemented:

[0117] Determine at least one candidate scene coverage range to which the pixel to be rendered belongs in the scene coverage range corresponding to each of the levels;

[0118] Determine the lowest level among the levels corresponding to the coverage range of the at least one candidate scene;

[0119] Determine a matching voxel of the pixel to be rendered in a target volume texture corresponding to the candidate scene coverage at the lowest level;

[0120] Based on the indirect lighting data stored in the matching voxel, lighting rendering is performed on the pixel point to be rendered.

[0121] In a specific implementation, when lighting rendering is performed on the pixel to be rendered based on the indirect lighting data stored in the matching voxel, in order to render a global lighting effect, the direct lighting data corresponding to the pixel to be rendered under the light source of the virtual scene can be obtained, and then lighting rendering is performed on the pixel to be rendered based on the direct lighting data and the indirect lighting data stored in the matching voxel.

[0122] Specifically, due to the overlap between scene coverage ranges at multiple levels, such as the relationship of inclusion and being included, the pixel to be rendered may belong to multiple scene coverage ranges at the same time. By selecting the lowest level of scene coverage range from the multiple scene coverage ranges to which it belongs, and using the target volume texture corresponding to the selected lowest level of scene coverage range to perform lighting rendering on the pixel to be rendered, the lighting accuracy of the pixel to be rendered can be improved, which is beneficial to improving the picture quality.

[0123] In some exemplary embodiments, in order to further reduce the computational cost of lighting rendering, Figure 4 As shown, the aforementioned step S205, before determining the voxels in the three-dimensional space corresponding to the scene coverage range and matching tetrahedral meshes in the plurality of tetrahedral meshes, may also include:

[0124] In step S401 , for a voxel in the three-dimensional space corresponding to the scene coverage of the level, a historical voxel corresponding to the voxel is searched from the historical target volume texture of the level.

[0125] The historical target volume texture of this level may be the target volume texture corresponding to the previous asynchronous lighting reconstruction task of this level.

[0126] Specifically, the historical voxel corresponding to the voxel is searched from the historical target volume texture of the level, that is, whether the voxel exists in the historical volume texture is searched. If found, the following step S403 can be executed; anyway, if not found, the step of determining the voxel in the three-dimensional space corresponding to the scene coverage range and matching the tetrahedral meshes among the multiple tetrahedral meshes can be executed.

[0127] In step S403, if the historical voxel is found, the indirect illumination data stored in the historical voxel is stored in the voxel.

[0128] In the above implementation, when only the scene coverage changes at a certain level but there is no change in the lighting status, for each voxel at this level, the voxel is searched from the historical target volume texture of this level. If the voxel is found, the historical result is directly reused. If the voxel is not found, the lighting reconstruction calculation is performed, thereby greatly reducing the computational cost of lighting reconstruction. It is more suitable for game running on mobile terminals and some mid-to-low-end PCs, avoiding lag and improving picture quality.

[0129] The disclosed embodiment uses a tetrahedral grid to manage each lighting probe in the virtual scene, but when reconstructing lighting, it is first converted into voxel data based on tetrahedral interpolation, and then pixel-by-pixel lighting rendering is performed, which reduces the package size and can be used for streaming loading of open world game scenes; at the same time, considering that lighting reconstruction needs to be performed at each voxel position, when the scene coverage is large, there will be a large number of voxel positions that need to be calculated within the range, and the reconstruction of lighting will be very time-consuming. Since the farther the object is, the lower the required lighting accuracy is, the disclosed embodiment divides the virtual scene into multiple levels with different step lengths and sizes, and each level is updated using a separate asynchronous task, and reuses existing calculation results as much as possible, so as to prevent blocking the rendering thread and reduce jams; and, based on pre-calculated radiation transmission to support dynamic changes in lighting, it is applicable to dynamic lighting scenes, solves the problem that there is no suitable global lighting solution for dynamic lighting scenes on mobile terminals and some low-end and mid-end PCs, and can effectively improve the picture quality of the game.

[0130] Figure 5 is a structural block diagram of a lighting rendering device according to an exemplary embodiment. Figure 5 , the lighting rendering device 500 comprises:

[0131] The lighting state acquisition unit 510 is configured to acquire current lighting state information corresponding to a plurality of scene coverages in the virtual scene, wherein the plurality of scene coverages correspond to a plurality of levels, and a scene coverage of a lower level is smaller than a scene coverage of a higher level;

[0132] The asynchronous task generation unit 520 is configured to execute, for each of the levels, generating an asynchronous lighting reconstruction task for the level based on current lighting state information of a scene coverage range corresponding to the level;

[0133] The volume texture generation unit 530 is configured to obtain, during the execution of the asynchronous illumination reconstruction task of the level, pre-calculated illumination data respectively stored in a plurality of illumination probes within the corresponding scene coverage, wherein the three-dimensional space corresponding to the scene coverage includes a plurality of tetrahedral meshes with the plurality of illumination probes as vertices; determine a voxel in the three-dimensional space corresponding to the scene coverage, and a matching tetrahedral mesh among the plurality of tetrahedral meshes, wherein the voxel is located within the matching tetrahedral mesh; determine indirect illumination data stored in the voxel based on the pre-calculated illumination data of each illumination probe in the matching tetrahedral mesh, and store the indirect illumination data in the voxel, so as to obtain a target volume texture of the scene coverage corresponding to the level;

[0134] The lighting rendering unit 540 is configured to perform lighting rendering on the virtual scene based on the target volume texture of the scene coverage corresponding to each of the levels.

[0135] In some exemplary embodiments, the volume texture generation unit 530 is further configured to perform voxelization on the three-dimensional space corresponding to the scene coverage range based on the step size of the corresponding level before determining the voxels in the three-dimensional space corresponding to the scene coverage range, and before matching tetrahedral meshes in the multiple tetrahedral meshes, to obtain a voxel space corresponding to the scene coverage range, wherein the voxel space is composed of multiple voxels; wherein the step size corresponding to the low level is smaller than the step size corresponding to the high level.

[0136] In some exemplary embodiments, the multiple scene coverages overlap with each other, and the lighting rendering unit 540 includes:

[0137] A first determining unit is configured to determine at least one candidate scene coverage range to which the pixel to be rendered belongs in the scene coverage range corresponding to each of the levels;

[0138] A second determining unit is configured to determine the lowest level among the levels corresponding to the coverage range of the at least one candidate scene;

[0139] A matching voxel determination unit is configured to determine a matching voxel of the pixel to be rendered in the target volume texture corresponding to the candidate scene coverage range at the lowest level;

[0140] The pixel rendering unit is configured to perform lighting rendering on the pixel to be rendered based on the indirect lighting data stored in the matching voxel.

[0141] In some exemplary embodiments, the volume texture generation unit 530, when determining the indirect lighting data stored in the voxel based on the pre-calculated lighting data of each lighting probe in the matching tetrahedral mesh, is configured to determine the weight corresponding to each lighting probe based on the distance between each lighting probe in the matching tetrahedral mesh and the voxel; and perform weighted summation of the pre-calculated lighting data stored in each lighting probe based on the weight corresponding to each lighting probe to obtain the indirect lighting data stored in the voxel.

[0142] In some exemplary embodiments, the asynchronous task generation unit 520 includes:

[0143] an illumination state difference determining unit, configured to determine the difference between current illumination state information and historical illumination state information of a scene coverage range corresponding to the level, to obtain the illumination state difference of the level;

[0144] The first generating unit is configured to execute, when the illumination state difference of the level satisfies a preset illumination state updating condition, generating an asynchronous illumination reconstruction task of the level.

[0145] In some exemplary embodiments, the asynchronous task generation unit 520 further includes:

[0146] a coverage range change determination unit, configured to determine a current coverage range change of a scene coverage range corresponding to the level when the illumination state difference of the level does not satisfy a preset illumination state update condition;

[0147] The second generating unit is configured to execute, when the current coverage range change satisfies a preset change condition, generating the asynchronous illumination reconstruction task of the level.

[0148] In some exemplary embodiments, the volume texture generation unit 530 is further configured to perform: for the voxel in the three-dimensional space corresponding to the scene coverage range, searching for the historical voxel corresponding to the voxel from the historical target volume texture of the corresponding level; if the historical voxel is found, storing the indirect lighting data stored in the historical voxel to the voxel; if the historical voxel is not found, executing the step of determining the voxel in the three-dimensional space corresponding to the scene coverage range, and matching the tetrahedral meshes among the multiple tetrahedral meshes.

[0149] In some exemplary embodiments, the apparatus 500 further includes:

[0150] A light source spherical harmonic coefficient determination unit, configured to determine the light source spherical harmonic coefficients of the light source in the virtual scene;

[0151] The indirect lighting value determination unit is configured to execute, for each lighting probe in the virtual scene, determine the indirect lighting value based on the light transmission coefficient stored in the lighting probe and the spherical harmonic coefficient of the light source, and store the indirect lighting value as pre-calculated lighting data in the lighting probe.

[0152] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0153] In an exemplary embodiment, an electronic device is also provided, including a processor; a memory for storing processor executable instructions; wherein, when the processor is configured to execute the instructions stored in the memory, the lighting rendering method provided in any of the above embodiments is implemented.

[0154] The electronic device may be a terminal, a server or a similar computing device. For example, the electronic device is a terminal. Figure 6 is a block diagram of an electronic device for running a lighting rendering method according to an exemplary embodiment, specifically:

[0155] The terminal may include components such as an RF (Radio Frequency) circuit 610, a memory 620 including one or more computer-readable storage media, an input unit 630, a display unit 640, a sensor 650, an audio circuit 660, a WiFi (wireless fidelity) module 670, a processor 680 including one or more processing cores, and a power supply 690. Those skilled in the art will appreciate that Figure 6The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0156] The RF circuit 610 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 680 for processing; in addition, the data related to the uplink is sent to the base station. Generally, the RF circuit 610 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a user identity module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, etc. In addition, the RF circuit 610 can also communicate with the network and other terminals through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.

[0157] The memory 620 can be used to store software programs and modules. The processor 680 executes various functional applications and data processing by running the software programs and modules stored in the memory 620. The memory 620 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, application programs required for functions, etc.; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 620 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 620 may also include a memory controller to provide the processor 680 and the input unit 630 with access to the memory 620.

[0158] The input unit 630 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 630 may include a touch-sensitive surface 631 and other input devices 632. The touch-sensitive surface 631, also known as a touch display screen or touchpad, can collect user touch operations on or near it (such as operations performed by users using fingers, styluses, or any other suitable objects or accessories on or near the touch-sensitive surface 631), and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface 631 may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 680, and can receive and execute commands sent by the processor 680. In addition, the touch-sensitive surface 631 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 631, the input unit 630 may further include other input devices 632. Specifically, the other input devices 632 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.

[0159] The display unit 640 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the terminal, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 640 may include a display panel 641. Optionally, the display panel 641 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 631 may cover the display panel 641. When the touch-sensitive surface 631 detects a touch operation on or near it, it is transmitted to the processor 680 to determine the type of touch event, and then the processor 680 provides corresponding visual output on the display panel 641 according to the type of touch event. Among them, the touch-sensitive surface 631 and the display panel 641 can be two independent components to realize input and output functions, but in some embodiments, the touch-sensitive surface 631 and the display panel 641 can also be integrated to realize input and output functions.

[0160] The terminal may also include at least one sensor 650, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 641 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 641 and / or the backlight when the terminal is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the terminal posture (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can be configured in the terminal, they will not be repeated here.

[0161] The audio circuit 660, the speaker 661, and the microphone 662 can provide an audio interface between the user and the terminal. The audio circuit 660 can transmit the received audio data to the speaker 661 after converting the electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 662 converts the collected sound signal into an electrical signal, which is received by the audio circuit 660 and converted into audio data, and then the audio data is processed by the output processor 680, and then sent to another terminal through the RF circuit 610, or the audio data is output to the memory 620 for further processing. The audio circuit 660 may also include an earplug jack to provide communication between an external headset and the terminal.

[0162] WiFi is a short-range wireless transmission technology. The terminal can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 670, which provides users with wireless broadband Internet access. Figure 6 A WiFi module 670 is shown, but it is understandable that it is not an essential component of the terminal and can be omitted as needed without changing the essence of the invention.

[0163] The processor 680 is the control center of the terminal, and uses various interfaces and lines to connect various parts of the entire terminal. By running or executing software programs and / or modules stored in the memory 620, and calling data stored in the memory 620, the processor 680 performs various functions of the terminal and processes data, thereby monitoring the terminal as a whole. Optionally, the processor 680 may include one or more processing cores; preferably, the processor 680 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 680.

[0164] The terminal also includes a power supply 690 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 680 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 690 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0165] Although not shown, the terminal may also include a camera, a Bluetooth module, etc., which will not be described in detail herein. Specifically in this embodiment, the terminal further includes a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors. The one or more programs include instructions for executing any one of the illumination rendering methods provided in the embodiments of the present disclosure.

[0166] In an exemplary embodiment, a computer-readable storage medium is also provided. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the lighting rendering method provided in any of the above embodiments.

[0167] In an exemplary embodiment, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the lighting rendering method provided in any of the above embodiments is implemented.

[0168] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0169] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A lighting rendering method, characterized in that: include: Acquire current illumination state information corresponding to a plurality of scene coverage ranges in the virtual scene, wherein the plurality of scene coverage ranges correspond to a plurality of levels, and a scene coverage range of a lower level is smaller than a scene coverage range of a higher level; For each of the levels, based on current lighting state information of a scene coverage range corresponding to the level, generating an asynchronous lighting reconstruction task for the level; In the process of executing the asynchronous illumination reconstruction task of the level, obtaining pre-calculated illumination data respectively stored in a plurality of illumination probes within a coverage range of a corresponding scene, wherein the three-dimensional space corresponding to the coverage range of the scene includes a plurality of tetrahedral meshes with the plurality of illumination probes as vertices; Determine a voxel in a three-dimensional space corresponding to the scene coverage, a matching tetrahedral mesh in the plurality of tetrahedral meshes, the voxel being located within the matching tetrahedral mesh; determine indirect lighting data stored in the voxel based on pre-calculated lighting data of each lighting probe in the matching tetrahedral mesh, and store the indirect lighting data in the voxel to obtain a target volume texture of the scene coverage corresponding to the level; Based on the target volume texture of the scene coverage range corresponding to each of the levels, the virtual scene is illuminated and rendered.

2. The method according to claim 1, characterized in that Before determining the voxels in the three-dimensional space corresponding to the scene coverage, and matching tetrahedral meshes among the plurality of tetrahedral meshes, the method further comprises: voxelize the three-dimensional space corresponding to the scene coverage range based on the step size of the corresponding level to obtain a voxel space corresponding to the scene coverage range, wherein the voxel space is composed of a plurality of the voxels; Among them, the step size corresponding to the low level is smaller than the step size corresponding to the high level.

3. The method according to claim 2, characterized in that The multiple scene coverages overlap with each other, and the lighting rendering of the virtual scene based on the target volume texture of the scene coverage corresponding to each level includes: Determine at least one candidate scene coverage range to which the pixel to be rendered belongs in the scene coverage range corresponding to each of the levels; Determine the lowest level among the levels corresponding to the coverage range of the at least one candidate scene; Determine a matching voxel of the pixel to be rendered in a target volume texture corresponding to the candidate scene coverage at the lowest level; Based on the indirect lighting data stored in the matching voxel, lighting rendering is performed on the pixel point to be rendered.

4. The method according to claim 1, characterized in that: The determining, based on the pre-computed lighting data of each lighting probe in the matching tetrahedral mesh, indirect lighting data stored in the voxel comprises: Determining a weight corresponding to each of the light probes based on a distance between each light probe and the voxel in the matching tetrahedral mesh; Based on the weight corresponding to each of the illumination probes, a weighted sum is performed on the pre-calculated illumination data stored in each of the illumination probes to obtain the indirect illumination data stored in the voxel.

5. The method according to claim 1, characterized in that The step of generating the asynchronous illumination reconstruction task of the level based on the current illumination state information of the scene coverage range corresponding to the level includes: Determine the difference between current lighting state information and historical lighting state information of a scene coverage range corresponding to the level, and obtain the lighting state difference of the level; When the illumination state difference of the level satisfies a preset illumination state update condition, an asynchronous illumination reconstruction task of the level is generated.

6. The method according to claim 5, characterized in that The method further comprises: In the case where the illumination state difference of the level does not satisfy the preset illumination state update condition, determining a current coverage range change of the scene coverage range corresponding to the level; When the current coverage change satisfies a preset change condition, an asynchronous lighting reconstruction task of the level is generated.

7. The method according to claim 6, characterized in that Before determining the voxels in the three-dimensional space corresponding to the scene coverage, and matching tetrahedral meshes among the plurality of tetrahedral meshes, the method further comprises: For a voxel in the three-dimensional space corresponding to the scene coverage range, searching for a historical voxel corresponding to the voxel from a historical target volume texture of a corresponding level; If the historical voxel is found, the indirect illumination data stored in the historical voxel is stored in the voxel; If the historical voxel is not found, the step of determining the voxel in the three-dimensional space corresponding to the scene coverage and matching the tetrahedral meshes among the multiple tetrahedral meshes is performed.

8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: Determining light source spherical harmonic coefficients of the light source in the virtual scene; For each lighting probe in the virtual scene, an indirect lighting value is determined based on the light transmission coefficient stored in the lighting probe and the spherical harmonic coefficient of the light source, and the indirect lighting value is stored in the lighting probe as pre-calculated lighting data.

9. A lighting rendering device, characterized in that: include: The lighting state acquisition unit is configured to acquire current lighting state information corresponding to a plurality of scene coverage ranges in the virtual scene, wherein the plurality of scene coverage ranges correspond to a plurality of levels, and a scene coverage range of a lower level is smaller than a scene coverage range of a higher level; An asynchronous task generation unit is configured to execute, for each of the levels, generating an asynchronous lighting reconstruction task for the level based on current lighting state information of a scene coverage range corresponding to the level; A volume texture generation unit is configured to obtain, during the execution of the asynchronous illumination reconstruction task of the level, pre-calculated illumination data respectively stored in a plurality of illumination probes within a corresponding scene coverage range, wherein the three-dimensional space corresponding to the scene coverage range includes a plurality of tetrahedral meshes with the plurality of illumination probes as vertices; Determine a voxel in a three-dimensional space corresponding to the scene coverage, a matching tetrahedral mesh in the plurality of tetrahedral meshes, the voxel being located within the matching tetrahedral mesh; determine indirect lighting data stored in the voxel based on pre-calculated lighting data of each lighting probe in the matching tetrahedral mesh, and store the indirect lighting data in the voxel to obtain a target volume texture of the scene coverage corresponding to the level; The lighting rendering unit is configured to perform lighting rendering on the virtual scene based on the target volume texture of the scene coverage corresponding to each of the levels.

10. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the lighting rendering method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the lighting rendering method according to any one of claims 1 to 8.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the lighting rendering method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Illumination robustness new view angle synthesis and three-dimensional reconstruction method based on voxel grid

    CN120298594A

  • A novel approach to illumination robustness for 3D reconstruction based on voxel meshes

    CN120298594B

  • Memory scene generation method based on dynamic prism

    CN121304964A