Lighting update method, device, equipment, medium and program product of virtual scene

By performing voxelization on the virtual scene and optimizing the lighting probe, the problem of low lighting update efficiency in the virtual scene was solved, achieving efficient lighting update and image rendering.

CN118691730BActive Publication Date: 2026-07-14TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2023-03-21
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

In existing technologies, when restoring high-frequency indirect lighting information using screen space occlusion technology, the lighting update efficiency of virtual scenes is relatively low.

Method used

By voxelizing the target virtual scene, a small number of voxels to be updated are selected, their lighting information is updated, and the lighting information of the virtual viewpoint is updated in combination with the initial voxels. The lighting update process is optimized by using a lighting probe and occlusion inspection.

Benefits of technology

It effectively improves the lighting update efficiency of virtual scenes, reduces update costs, and enhances the quality of image rendering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118691730B_ABST
    Figure CN118691730B_ABST
Patent Text Reader

Abstract

The application provides a virtual scene light update method, device, equipment, medium and program product; the method comprises the following steps: obtaining a target virtual scene, and performing voxelization processing on the target virtual scene to obtain a plurality of initial voxels corresponding to the target virtual scene; in response to a change in content in the target virtual scene, selecting at least one to-be-updated voxel from the plurality of initial voxels, the number of to-be-updated voxels being less than the number of initial voxels; updating the light information carried by each to-be-updated voxel to obtain an updated voxel corresponding to each to-be-updated voxel; and updating the light information of each virtual viewpoint in the changed target virtual scene in combination with the updated voxels and the initial voxels other than the to-be-updated voxels. Through the application, the light update efficiency of the virtual scene can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device, medium, and program product for updating lighting in a virtual scene. Background Technology

[0002] With the development of multimedia technology, the variety of games is increasing, and their functions are becoming more and more abundant. In order to provide players with a more realistic gaming experience, technicians are committed to improving the detail of game graphics. For example, they improve the realism of lighting in game scenes to enhance the overall detail of the game graphics.

[0003] In related technologies, the high-frequency indirect lighting information restored by screen space occlusion technology has low lighting update efficiency because it requires a complete lighting update of the entire virtual scene. Summary of the Invention

[0004] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for updating lighting in a virtual scene, which can effectively improve the lighting update efficiency of the virtual scene.

[0005] The technical solution of this application embodiment is implemented as follows:

[0006] This application provides a method for updating lighting in a virtual scene, including:

[0007] The target virtual scene is acquired and voxelized to obtain multiple initial voxels corresponding to the target virtual scene.

[0008] The different initial voxels are located in different positions in the target virtual scene, and the initial voxels carry the lighting information of the corresponding positions in the target virtual scene;

[0009] In response to changes in the content of the target virtual scene, at least one voxel to be updated is selected from the plurality of initial voxels, wherein the number of voxels to be updated is less than the number of initial voxels;

[0010] The illumination information carried by each of the voxels to be updated is updated to obtain the updated voxels corresponding to each of the voxels to be updated.

[0011] By combining the updated voxel and the initial voxels other than the voxel to be updated among the plurality of initial voxels, the lighting information of each virtual viewpoint in the changed target virtual scene is updated.

[0012] The virtual viewpoint refers to a virtual scene point in the changed target virtual scene that can be captured by the virtual camera.

[0013] In some embodiments, the above-described first occlusion check on the adjacent voxel and the target voxel based on the first distance and the second distance to obtain a first occlusion check result includes: comparing the first distance and the second distance to obtain a first comparison result; when the first comparison result indicates that the first distance is less than or equal to the second distance, and the dot product of the direction vector from the virtual viewpoint to the voxel center point of the target voxel and the direction vector from the target voxel to the corresponding virtual object is less than a dot product threshold, determining the first occlusion check result as a third result; wherein, the third result is used to indicate that the adjacent voxel and the target voxel pass the first occlusion check.

[0014] In some embodiments, the above-described second occlusion check on the adjacent voxel and the target voxel based on the second distance and the third distance to obtain a second occlusion check result includes: comparing the second distance and the third distance to obtain a second comparison result; when the second comparison result indicates that the second distance is greater than the third distance, determining the second occlusion check result as a fourth result; wherein the fourth result is used to indicate that the adjacent voxel and the target voxel pass the second occlusion check.

[0015] In some embodiments, the above-described temporal correction of the updated illumination information to obtain the second illumination information includes: determining the target voxel where the virtual viewpoint is located from the updated voxel and the initial voxels other than the voxel to be updated, and obtaining the illumination information of the target voxel; determining the pixel corresponding to the virtual viewpoint, and querying multiple historical voxels of the pixel in the historical update process from the multiple initial voxels, and obtaining the illumination information of each historical voxel; and performing a weighted summation of the illumination information of the target voxel and the illumination information of each historical voxel to obtain the second illumination information of the virtual viewpoint.

[0016] This application provides a lighting update device for a virtual scene, including:

[0017] A voxelization module is used to acquire a target virtual scene and perform voxelization processing on the target virtual scene to obtain multiple initial voxels corresponding to the target virtual scene; wherein, different initial voxels are located in different positions in the target virtual scene, and the initial voxels carry the lighting information of the corresponding position in the target virtual scene;

[0018] A selection module is configured to select at least one voxel to be updated from the plurality of initial voxels in response to changes in the content of the target virtual scene, wherein the number of voxels to be updated is less than the number of initial voxels;

[0019] The voxel update module is used to update the illumination information carried by each of the voxels to be updated, so as to obtain the updated voxels corresponding to each of the voxels to be updated.

[0020] The lighting update module is used to update the lighting information of each virtual viewpoint in the changed target virtual scene by combining the updated voxel and the initial voxels other than the voxel to be updated among the plurality of initial voxels; wherein, the virtual viewpoint is a virtual scene point in the changed target virtual scene that can be captured by the virtual camera.

[0021] In some embodiments, the selection module is further configured to, in response to changes in the content of the virtual scene, obtain the camera position of the virtual camera in the changed virtual scene; obtain the voxel position of the voxel center point of each initial voxel in the virtual scene, and determine the voxel distance between the camera position and each voxel position; and, based on the voxel distance, select at least one voxel to be updated from the plurality of initial voxels.

[0022] In some embodiments, the selection module is further configured to: determine the initial voxel as a first initial voxel when the voxel distance of the initial voxel is less than or equal to a voxel distance threshold; determine the initial voxel as a second initial voxel when the voxel distance of the initial voxel is greater than the voxel distance threshold; select a first number of first initial voxels and a second number of second initial voxels from the plurality of initial voxels, and determine the selected first initial voxels and second initial voxels as the voxels to be updated; wherein the first number is greater than the second number, and the first number is at least one.

[0023] In some embodiments, the voxel update module is further configured to perform the following processing on each of the voxels to be updated: determine multiple target virtual scene points located within the voxel to be updated from each virtual scene point of the virtual scene; obtain target lighting information of each target virtual scene point within the voxel to be updated, and perform a weighted summation of the target lighting information to obtain updated lighting information; update the lighting information carried by the voxel to be updated to the updated lighting information to obtain the updated voxel corresponding to the voxel to be updated.

[0024] In some embodiments, the voxel update module is further configured to perform the following processing on each of the target virtual scene points within the voxel to be updated: obtaining direct lighting information of the target virtual scene point, wherein the direct lighting information is used to indicate the lighting effect of direct light emitted by the virtual light source on the target virtual scene point; obtaining indirect lighting information of the target virtual scene point, wherein the indirect lighting information is used to indicate the lighting effect of reflected light corresponding to the direct light on the target virtual scene point; and summing the direct lighting information and the indirect lighting information to obtain the target lighting information of the target virtual scene point.

[0025] In some embodiments, the direct lighting information includes direct lighting intensity. The voxel update module is further configured to: determine the light source distance between the virtual light source in the virtual scene and the target virtual scene point; obtain the camera distance between the target virtual scene point and the virtual camera, and add the camera distance and the light source distance to obtain a total distance; determine the light source intensity loss value of the virtual light source based on the total distance and the target virtual scene point; and subtract the light source intensity from the loss value to obtain the direct lighting intensity of the target virtual scene point.

[0026] In some embodiments, the voxel update module is further configured to determine, from among a plurality of lighting probes deployed in the target virtual scene, at least one target lighting probe whose distance to a point in the target virtual scene is less than a distance threshold, wherein the lighting probe is used to store lighting information at the corresponding position in the changed virtual scene; when the number of target lighting probes is one, the lighting information stored in the target lighting probe is determined as the indirect lighting information of the target virtual scene point; when the number of target lighting probes is multiple, the weight of each target lighting probe is determined based on the probe distance between each target lighting probe and the target virtual scene point; and the lighting information stored in each target lighting probe is weighted and summed according to the weight to obtain the indirect lighting information of the target virtual scene point.

[0027] In some embodiments, the above-described virtual scene lighting update device further includes: a deployment module, configured to acquire the camera position of the virtual camera in the virtual scene; determine a virtual scene region in the virtual scene whose distance from the camera position is less than a distance threshold as a first virtual scene region, and determine a virtual scene region in the virtual scene whose distance from the camera position is greater than or equal to the distance threshold as a second virtual scene region; deploy a third number of lighting probes in the first virtual scene region, and deploy a fourth number of lighting probes in the second virtual scene region, wherein the third number is greater than the fourth number.

[0028] In some embodiments, the lighting update module described above is configured to perform the following processing for each virtual viewpoint in the changed virtual scene: determine the target voxel where the virtual viewpoint is located from the updated voxel and the initial voxels other than the voxel to be updated, and obtain the lighting information of the target voxel; determine the lighting information of the target voxel as the updated lighting information of the virtual viewpoint; and update the lighting information of the virtual viewpoint to the updated lighting information of the virtual viewpoint.

[0029] In some embodiments, the above-mentioned lighting update device for virtual scenes further includes: a correction module, configured to perform the following processing on the updated lighting information after updating each of the virtual viewpoints: perform spatial domain correction on the updated lighting information to obtain first lighting information, and perform temporal domain correction on the updated lighting information to obtain second lighting information; and combine the first lighting information and the second lighting information to perform error correction on the updated lighting information.

[0030] In some embodiments, the correction module is further configured to: determine, from the updated voxel and the initial voxels other than the voxel to be updated, the target voxel where the virtual viewpoint is located, and a plurality of adjacent voxels adjacent to the target voxel; select a target adjacent voxel from the plurality of adjacent voxels; obtain the illumination information of the target voxel and the illumination information of each target adjacent voxel; and perform a weighted summation of the illumination information of the target voxel and the illumination information of each target adjacent voxel to obtain the first illumination information of the virtual viewpoint.

[0031] In some embodiments, the above-described correction module is further configured to perform the following processing for each of the adjacent voxels: acquiring first occlusion information of the adjacent voxel and second occlusion information of the target voxel; when the first occlusion information indicates that there is no virtual object between the adjacent voxel and the virtual camera, and the second occlusion information indicates that there is no virtual object between the target voxel and the virtual camera, determining the adjacent voxel as the target adjacent voxel; when the first occlusion information indicates that there is a virtual object between the adjacent voxel and the virtual camera, and the second occlusion information indicates that there is no virtual object between the target voxel and the virtual camera, determining the adjacent voxel as the target adjacent voxel; when the first occlusion information indicates that there is a virtual object between the adjacent voxel and the virtual camera, and the second occlusion information indicates that there is no virtual object between the target voxel and the virtual camera, determining the adjacent voxel as the target adjacent voxel; when the first occlusion information indicates that there is a virtual object between the adjacent voxel and the virtual camera, and the second occlusion information indicates that there is no virtual object between the target voxel and the virtual camera, determining the target .... When the occlusion information indicates that a virtual object exists between the target voxel and the virtual camera, an occlusion check is performed on the adjacent voxel and the target voxel to obtain an occlusion check result; when the occlusion check result indicates that the adjacent voxel and the target voxel pass the occlusion check, the adjacent voxel is identified as the target adjacent voxel; when the first occlusion information indicates that a virtual object exists between the adjacent voxel and the virtual camera, or the second occlusion information indicates that a virtual object exists between the target voxel and the virtual camera, the adjacent voxel is identified as a non-adjacent voxel.

[0032] In some embodiments, the correction module is further configured to: obtain a first distance between the adjacent voxel and the corresponding virtual object, and a second distance between the target voxel and the corresponding virtual object; perform a first occlusion check on the adjacent voxel and the target voxel based on the first distance and the second distance, and obtain a first occlusion check result; when the first occlusion check result indicates that the adjacent voxel and the target voxel have passed the first occlusion check, determine the occlusion check result as a first result; when the first occlusion check result indicates that the adjacent voxel and the target voxel have not passed the first occlusion check, obtain a third distance between the adjacent voxel and the target voxel. Based on the second distance and the third distance, a second occlusion check is performed on the adjacent voxel and the target voxel to obtain a second occlusion check result. When the second occlusion check result indicates that the adjacent voxel and the target voxel have passed the second occlusion check, the occlusion check result is determined as a first result. When the second occlusion check result indicates that the adjacent voxel and the target voxel have not passed the second occlusion check, the occlusion check result is determined as a second result. The first result is used to indicate that the adjacent voxel and the target voxel have passed the occlusion check, and the second result is used to indicate that the adjacent voxel and the target voxel have not passed the occlusion check.

[0033] In some embodiments, the correction module is further configured to compare the first distance and the second distance to obtain a first comparison result; when the first comparison result indicates that the first distance is less than or equal to the second distance, and the dot product of the direction vector from the virtual viewpoint to the voxel center point of the target voxel and the direction vector from the target voxel to the corresponding virtual object is less than the dot product threshold, the first occlusion check result is determined as a third result; wherein the third result is used to indicate that the adjacent voxel and the target voxel pass the first occlusion check.

[0034] In some embodiments, the correction module is further configured to compare the second distance and the third distance to obtain a second comparison result; when the second comparison result indicates that the second distance is greater than the third distance, the second occlusion check result is determined as a fourth result; wherein the fourth result is used to indicate that the adjacent voxel and the target voxel pass the second occlusion check.

[0035] In some embodiments, the correction module is further configured to: determine the target voxel where the virtual viewpoint is located from the updated voxel and the initial voxels other than the voxel to be updated; obtain the illumination information of the target voxel; determine the pixel corresponding to the virtual viewpoint; query multiple historical voxels of the pixel in the historical update process from the multiple initial voxels; and obtain the illumination information of each historical voxel; and perform a weighted summation of the illumination information of the target voxel and the illumination information of each historical voxel to obtain the second illumination information of the virtual viewpoint.

[0036] In some embodiments, the above-mentioned correction module is further configured to perform a validity check on the first illumination information and obtain a check result; when the check result indicates that the first illumination information is invalid, the updated illumination information is corrected to the second illumination information; when the check result indicates that the first illumination information is valid, the updated illumination information is corrected to the first illumination information.

[0037] In some embodiments, the correction module is further configured to determine the target voxel where the virtual viewpoint is located from the updated voxel and the initial voxels other than the voxel to be updated; in the changed virtual scene, construct an inspection ray with the target voxel as the starting point and the virtual camera as the ending point; when the inspection ray intersects with a virtual object in the changed virtual scene, determine the inspection result as a first inspection result, wherein the first inspection result is used to indicate that the first lighting information is invalid; when the inspection ray does not intersect with a virtual object in the changed virtual scene, determine the inspection result as a second inspection result, wherein the second inspection result is used to indicate that the first lighting information is valid.

[0038] In some embodiments, the above-described virtual scene lighting update device further includes: performing the following processing on each of the virtual viewpoints in the changed virtual scene: obtaining the pixel corresponding to the virtual viewpoint in the imaging plane of the virtual camera; determining the viewpoint distance between the virtual camera and the virtual viewpoint, and determining the initial lighting information of the pixel by combining the viewpoint distance and the updated lighting information of the virtual viewpoint; determining at least one target screen probe from a plurality of screen probes deployed in the imaging plane whose distance to the pixel is less than a distance threshold, the screen probe being used to store the lighting information of the corresponding position in the imaging plane; and performing a weighted summation of the lighting information stored in each target screen probe and the initial lighting information of the pixel to obtain the target lighting information of the pixel, wherein the target lighting information of the pixel is used to render the image on the imaging plane of the virtual camera.

[0039] This application provides an electronic device, including:

[0040] Memory is used to store executable instructions or computer programs.

[0041] The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the lighting update method for a virtual scene provided in the embodiments of this application.

[0042] This application provides a computer-readable storage medium storing computer-executable instructions for inducing a processor to execute and implement the virtual scene lighting update method provided in this application.

[0043] This application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the virtual scene lighting update method described above in this application.

[0044] The embodiments of this application have the following beneficial effects:

[0045] By voxelizing the target virtual scene, multiple initial voxels are obtained. In response to changes in the content of the target virtual scene, at least one voxel to be updated is selected from these initial voxels. The lighting information carried by each voxel to be updated is updated. Combining the updated voxel with the other initial voxels from the multiple initial voxels, the lighting information of each virtual viewpoint in the changed target virtual scene is updated. Thus, by selecting at least one voxel to be updated from multiple initial voxels in response to changes in the virtual scene's content, and since the number of voxels to be updated is less than the number of initial voxels, the number of voxels to be updated is effectively reduced, thereby reducing update costs and significantly improving the lighting update efficiency of the virtual scene. Attached Figure Description

[0046] Figure 1 This is a schematic diagram of the architecture of the lighting update system for a virtual scene provided in an embodiment of this application;

[0047] Figure 2 This is a schematic diagram of the structure of an electronic device for updating lighting in a virtual scene provided in an embodiment of this application;

[0048] Figures 3 to 9 This is a flowchart illustrating the lighting update method for a virtual scene provided in an embodiment of this application;

[0049] Figure 10This is a schematic diagram illustrating the rendering effect of the lighting update method for a virtual scene provided in an embodiment of this application;

[0050] Figures 11 to 12 This is a flowchart illustrating the lighting update method for a virtual scene provided in an embodiment of this application;

[0051] Figure 13 This is a schematic diagram of the starting point provided in the embodiments of this application;

[0052] Figures 14 to 17 This is a flowchart illustrating the lighting update method for a virtual scene provided in an embodiment of this application. Detailed Implementation

[0053] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0054] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0055] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0057] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.

[0058] 1) Camera Model: This describes the process of mapping coordinate points in the 3D world coordinate system to a 2D image plane, serving as the link between points in 3D space and points in the 2D plane. Camera models include at least: pinhole camera models and fisheye camera models. Taking the pinhole camera model as an example, it contains four coordinate systems: the 3D world coordinate system, the 3D camera coordinate system, the 2D image physical coordinate system, and the 2D image pixel coordinate system.

[0059] 2) Virtual Scene: This refers to a virtual scene displayed or provided by an application when it runs on a terminal. The virtual scene can be a simulation of the real world, a semi-simulated / semi-fictional virtual environment, or a purely fictional virtual environment. The virtual scene can be any of a two-dimensional, 2.5-dimensional, or three-dimensional virtual scene; this application does not limit the dimension of the virtual scene. For example, a virtual scene may include the sky, land, ocean, etc., and the land may include environmental elements such as deserts and cities. Users can control virtual objects to move within this virtual scene.

[0060] 3) Virtual Objects: Images of various people and objects that can be interacted with in a virtual scene, or movable objects within the virtual scene. These movable objects can be virtual characters, virtual animals, anime characters, etc., such as people, animals, plants, oil drums, walls, stones, etc., displayed in the virtual scene. A virtual object can be a virtual avatar representing the user within the virtual scene. A virtual scene can include multiple virtual objects, each with its own shape and volume, occupying a portion of the space within the virtual scene. Optionally, the virtual object can be a user character controlled through client-side operations, artificial intelligence (AI) trained and set up for virtual scene battles, or a non-user character (NPC) set up for virtual scene interaction. Optionally, the virtual object can be a virtual character engaging in adversarial interaction within the virtual scene. Optionally, the number of virtual objects participating in the interaction in the virtual scene can be pre-set or dynamically determined based on the number of clients joining the interaction.

[0061] 4) Virtual objects: These are objects that move or remain stationary in a virtual scene. Moving virtual objects include animals, vehicles, and people in the virtual scene. Stationary virtual objects include walls, rocks, and the ground in the virtual scene.

[0062] 5) Virtual light: refers to the light emitted in the virtual scene by the virtual light source used to illuminate the virtual scene. Virtual light includes direct light and indirect light. Direct light is emitted by the virtual light source and reflected by the virtual lighting point to the virtual camera. Indirect light is emitted by the virtual light source, reflected at least once to the virtual lighting point, and finally reflected by the virtual lighting point to the virtual camera.

[0063] 6) Irradiance: also known as radiation intensity, is the radiant flux per unit area of ​​an irradiated surface. The unit is watts per square meter (W / ㎡). Irradiance characterizes the amount of radiant energy received per unit area per unit time on a surface irradiated by radiation energy, that is, the radiant flux density on the irradiated surface.

[0064] 7) Virtual Camera: A virtual camera is a "camera" set up in computer animation software or virtual engine. In animation, the virtual camera's role in representing the viewpoint is equivalent to a traditional camera. The subjects of a virtual camera and a physical camera are completely different, but their functions are extremely similar. A physical camera captures real people or actual, constructed scenes, while a virtual camera captures models built in 3D software, allowing for limitless possibilities. Virtual cameras are presented as icons in the virtual engine and also have parameters such as lens, focal length, focus, aperture, and depth of field. They can perform camera actions such as "push, pull, pan, tilt, track, flick, rise, fall, and combined movements," achieving shooting effects that are difficult or impossible for physical cameras, such as passing through walls, keyholes, or objects. The parameters that need to be adjusted for a physical camera are distributed on the camera body and require manual operation. The camera parameters of a virtual camera are integrated into buttons or numerical input fields on the panel. The operator only needs to input parameters or drag the mouse. Sometimes a few keyframes can determine the motion path of the virtual camera. In actual shooting, physical cameras often need stabilizers or motion control systems, and even then, the image shake still exists.

[0065] 8) Virtual Engine: A virtual engine refers to a pre-written, editable computer virtual system or the core component of an interactive real-time graphics application. These systems provide virtual scene designers with various tools needed to create virtual scenes, with the aim of enabling designers to easily and quickly write programs. Virtual engines include rendering engines (including 2D and 3D rendering engines), physics engines, collision detection engines, sound engines, script engines, animation engines, artificial intelligence engines, network engines, and scene management engines, etc.

[0066] 9) Virtual light source: It is a "light source" set up in computer animation software or virtual engine. The role of virtual light source in representing the viewpoint during animation production is equivalent to the traditional physical light source. The objects illuminated by virtual light source and physical light source are completely different, but their functions are extremely similar. Physical light source illuminates real people or actual built scenes, while virtual light source illuminates models built in 3D software, which can realize infinite possibilities.

[0067] During the implementation of the embodiments of this application, the applicant discovered the following problems with the related technology:

[0068] In related technologies, the high-frequency indirect lighting information restored by screen space occlusion technology has low lighting update efficiency because it requires a complete lighting update of the entire virtual scene.

[0069] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for updating lighting in a virtual scene, which can effectively improve the lighting update efficiency of the virtual scene. The exemplary application of the lighting update system for the virtual scene provided in this application is described below.

[0070] See Figure 1 , Figure 1 This is a schematic diagram of the architecture of the virtual scene lighting update system 100 provided in the embodiments of this application. The terminal (terminal 400 and terminal 600 are shown as examples) connects to the server 200 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.

[0071] Terminal 400 is used by a user to use client 410 to display the target virtual scene on graphical interface 410-1 (graphical interface 410-1 is shown as an example). Terminal 400, terminal 600 and server 200 are interconnected via wired or wireless network.

[0072] In some embodiments, server 200 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminals 400 and 600 can be smartphones, tablets, laptops, desktop computers, smart speakers, smart TVs, smartwatches, in-vehicle terminals, etc., but are not limited to these. The electronic devices provided in this application embodiment can be implemented as terminals or servers. Terminals and servers can be directly or indirectly connected via wired or wireless communication methods, which is not limited in this application embodiment.

[0073] In some embodiments, the terminal 400 acquires the target virtual scene and sends the target virtual scene to the server 200. The server 200 performs voxelization processing on the target virtual scene to obtain multiple initial voxels. In response to changes in the content of the target virtual scene, the server selects at least one voxel to be updated from the multiple initial voxels, updates the lighting information carried by each voxel to be updated, obtains the updated voxel corresponding to each voxel to be updated, and updates the lighting information of each virtual viewpoint in the changed target virtual scene.

[0074] In other embodiments, server 200 acquires the target virtual scene and performs voxelization on the target virtual scene to obtain multiple initial voxels corresponding to the target virtual scene. In response to changes in the content of the target virtual scene, server 200 selects at least one voxel to be updated from the multiple initial voxels and sends the voxel to be updated to terminal 400. Terminal 400 updates the lighting information carried by each voxel to be updated to obtain the updated voxel corresponding to each voxel to be updated, and updates the lighting information of each virtual viewpoint in the changed target virtual scene.

[0075] In some embodiments, the terminal 600 acquires the target virtual scene and sends the target virtual scene to the server 200. The server 200 performs voxelization processing on the target virtual scene to obtain multiple initial voxels. In response to changes in the content of the target virtual scene, the server selects at least one voxel to be updated from the multiple initial voxels, updates the lighting information carried by each voxel to be updated, obtains the updated voxel corresponding to each voxel to be updated, and updates the lighting information of each virtual viewpoint in the changed target virtual scene.

[0076] In other embodiments, the embodiments of this application can be implemented with the aid of cloud technology, which refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to realize the computation, storage, processing, and sharing of data.

[0077] Cloud technology is a general term encompassing network technology, information technology, integration technology, management platform technology, and application technology based on the cloud computing business model. It can form resource pools, allowing for on-demand use with flexibility and convenience. Cloud computing technology will become a crucial support. The backend services of cloud computing systems require substantial computing and storage resources.

[0078] See Figure 2 , Figure 2 This is a schematic diagram of the structure of the lighting update electronic device 500 for virtual scenes provided in an embodiment of this application, wherein, Figure 2 The electronic device 500 shown can be Figure 1 Server 200 or terminal 400 in the middle, Figure 2 The illustrated electronic device 500 includes at least one processor 430, a memory 450, and at least one network interface 420. The various components in the electronic device 500 are coupled together via a bus system 440. It is understood that the bus system 440 is used to implement communication between these components. In addition to a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2 The general labeled all buses as Bus System 440.

[0079] Processor 430 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0080] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices physically located away from the processor 430.

[0081] The memory 450 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 450 described in this application embodiment is intended to include any suitable type of memory.

[0082] In some embodiments, memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.

[0083] Operating system 451 includes system programs for handling various basic application implementation services and performing hardware-related tasks, such as a framework layer, a core library layer, and a driver layer, for implementing various basic business functions and handling hardware-based tasks;

[0084] The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420, such as Bluetooth, WiFi, and Universal Serial Bus.

[0085] In some embodiments, the virtual scene lighting update device provided in this application can be implemented in software. Figure 2 A lighting update device 455 for a virtual scene stored in memory 450 is shown. This device can be software in the form of programs or plugins, and includes the following software modules: voxelization module 4551, selection module 4552, voxel update module 4553, and lighting update module 4554. These modules are logically connected and can therefore be arbitrarily combined or further separated according to their implemented functions. The functions of each module will be described below.

[0086] In other embodiments, the virtual scene lighting update device provided in this application can be implemented in hardware. As an example, the virtual scene lighting update device provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the virtual scene lighting update method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0087] In some embodiments, the terminal or server can implement the virtual scene lighting update method provided in this application by running a computer program or computer-executable instructions. For example, the computer program can be a native program in the operating system (e.g., a dedicated lighting update program) or a software module, such as a lighting update module that can be embedded in any program (e.g., an instant messaging client, a photo album program, an electronic map client, a navigation client); or it can be a native application (APP), i.e., a program that needs to be installed in the operating system to run. In summary, the above-mentioned computer program can be any form of application, module, or plugin.

[0088] The lighting update method for virtual scenes provided in this application will be described in conjunction with exemplary applications and implementations of the servers or terminals provided in the embodiments of this application.

[0089] See Figure 3 , Figure 3 This is a flowchart illustrating the lighting update method for a virtual scene provided in this application embodiment, which will be combined with... Figure 3 Steps 101 to 104 are described below. The virtual scene lighting update method provided in this application embodiment can be implemented by the server or the terminal alone, or by the server and the terminal working together. The following description will take the implementation by the terminal alone as an example.

[0090] In step 101, the virtual scene is voxelized to obtain multiple initial voxels corresponding to the virtual scene.

[0091] In some embodiments, different initial voxels are located in different positions in the virtual scene, and the initial voxels carry the lighting information of the corresponding positions in the virtual scene.

[0092] In some embodiments, a virtual scene is a virtual scene displayed or provided by an application when it runs on a terminal. This virtual scene can be a simulation of the real world, a semi-simulated / semi-fictional virtual environment, or a purely fictional virtual environment. The virtual scene can be any of a two-dimensional, 2.5-dimensional, or three-dimensional virtual scene; this application embodiment does not limit the dimension of the virtual scene. For example, a virtual scene may include the sky, land, ocean, etc., and the land may include environmental elements such as deserts and cities. Users can control virtual objects to move within this virtual scene.

[0093] In some embodiments, voxelization refers to the process of dividing a virtual scene into multiple initial voxels, each carrying lighting information for a corresponding location in the virtual scene.

[0094] In some embodiments, step 101 above can be implemented as follows: the virtual scene is divided into multiple virtual scene blocks, each virtual scene block is located in a different position in the virtual scene, and each virtual scene block is the same size; the virtual scene information corresponding to each virtual scene block is obtained, the virtual scene information includes virtual scene color, virtual scene diffuse reflection information, direct lighting information, etc.; the virtual scene information is assigned to each virtual scene block to obtain the initial voxel corresponding to the virtual scene block.

[0095] In some embodiments, voxels with normal information are used to represent facets to simplify the description of 3D scenes. First, a cuboid space centered on the camera is maintained. Voxels are used to simplify the description of 3D scene information within this space. The voxel content includes: normal, diffuse color, direct lighting information, and radiance information. To reduce memory consumption, this embodiment uses a hierarchical approach to sparsely store voxels, treating 4*4*4 voxels as a group, called a "brick." The hierarchical index is represented by an n*m*k 3D texture. If a brick contains a voxel, its actual storage location can be obtained through the hierarchical index; if the hierarchical index value is 0, it means that the brick does not contain a voxel, thereby significantly saving video memory.

[0096] In step 102, in response to changes in the content of the virtual scene, at least one voxel to be updated is selected from a plurality of initial voxels.

[0097] In some embodiments, the number of voxels to be updated is less than the initial number of voxels. Because the number of voxels to be updated is less than the initial number of voxels, the number of voxels to be updated is effectively reduced, thereby reducing update costs and effectively improving the lighting update efficiency of the virtual scene.

[0098] In some embodiments, changes in the content of a virtual scene can be the movement of virtual objects within the virtual scene. The content of the virtual scene can change at different points in time. For example, virtual object A moves from position B to position C in the virtual scene. During the process of moving from position B to position C, the content of the virtual scene changes.

[0099] In some embodiments, the duration of content change in a virtual scene can be determined based on the actual changes. The duration of content change in a virtual scene can be a time interval from the start of the change to the cessation of the change.

[0100] As an example, virtual object A in the virtual scene starts moving at 12 minutes and 10 seconds. That is, the content changes in the virtual scene begin at 12 minutes and 10 seconds. During the movement, virtual object A starts from position B and moves to position C. The time to move to position C is 14 minutes and 20 seconds. That is, the content changes in the virtual scene stop at 14 minutes and 20 seconds.

[0101] In some embodiments, during the process of selecting at least one voxel to be updated from a plurality of initial voxels, the number of selection actions is positively correlated with the duration of the content change in the virtual scene. For example, if the duration of the content change in the virtual scene is 10 seconds, then during the 10 seconds of the content change, at least one voxel to be updated is selected from the plurality of initial voxels every second.

[0102] In some embodiments, changes in the content of a virtual scene can be the movement of a virtual light source in the virtual scene. The virtual light source can change at different points in time. For example, when the virtual light source D moves from position E to position F in the virtual scene, the content of the virtual scene changes during the process of moving from position E to position F.

[0103] In some embodiments, step 102 above will be described below using the selection of a single voxel as an example. See [link to documentation]. Figure 4 , Figure 4 This is a flowchart illustrating the lighting update method for a virtual scene provided in an embodiment of this application. Figure 4 Step 102 shown can be achieved through Figure 4 Steps 1021 to 1023 shown are implemented.

[0104] In step 1021, in response to changes in the content of the virtual scene, the camera position of the virtual camera in the changed virtual scene is obtained.

[0105] In some embodiments, a virtual camera is a "camera" set up in computer animation software or a virtual engine. The role of the virtual camera in representing the viewpoint during animation is equivalent to that of a traditional camera. The subjects of the virtual camera and the physical camera are completely different, but their functions are extremely similar. The physical camera shoots real people or actual constructed scenes, while the virtual camera shoots models built in 3D software, which can realize infinite possibilities. The virtual camera is presented in the form of an icon in the virtual engine and also has parameters such as lens, focal length, focus, aperture, and depth of field. It can realize camera actions such as "push, pull, pan, tilt, follow, flick, rise, fall, and combined movements". It can achieve shooting effects that are difficult or even impossible for a physical camera to achieve, such as passing through walls, passing through keyholes, or passing through objects. The parameters that need to be adjusted for a physical camera are distributed on the body of the physical camera and require manual operation. The camera parameters of a virtual camera are integrated into buttons or numerical input fields on the panel. The operator only needs to input parameters or drag the mouse. Sometimes a few keyframes can determine the motion path of the virtual camera. In actual shooting, physical cameras often need stabilizers or motion control systems, and even then, the image shake still exists.

[0106] In some embodiments, the camera position is used to indicate the position coordinates of the virtual camera in the changed virtual scene. When the virtual scene is a two-dimensional virtual scene, the position coordinates are two-dimensional position coordinates, and when the virtual scene is a three-dimensional virtual scene, the position coordinates are three-dimensional position coordinates.

[0107] As an example, the virtual camera's position in the virtual scene is position G, and its position in the changed virtual scene is position H, meaning the virtual camera's position shifts within the virtual scene before and after the change. Alternatively, the virtual camera's position in the virtual scene is position G, and its position in the changed virtual scene is also position G, meaning the virtual camera's position does not shift within the virtual scene before and after the change.

[0108] In step 1022, the voxel center point of each initial voxel is obtained in the voxel position in the virtual scene, and the voxel distance between the camera position and each voxel position is determined.

[0109] In some embodiments, the voxel center point of the initial voxel is located in the voxel position in the virtual scene, which is used to indicate the position coordinates of the voxel center point in the virtual scene. When the virtual scene is a two-dimensional virtual scene, the position coordinates are two-dimensional position coordinates, and when the virtual scene is a three-dimensional virtual scene, the position coordinates are three-dimensional position coordinates.

[0110] In some embodiments, the voxel distance between the camera position and each voxel position can be determined using distance calculation methods such as Euclidean distance, Manhattan distance, and Chebyshev distance. The specific calculation method for the voxel distance is as follows: the voxel distance is used to indicate the distance between the voxel center point of the initial voxel and the virtual camera.

[0111] In step 1023, based on the voxel distance, at least one voxel to be updated is selected from multiple initial voxels.

[0112] In some embodiments, the smaller the initial voxel distance, the greater the probability that it will be selected as the voxel to be updated, and the size of the voxel distance is proportional to the probability of it being selected as the voxel to be updated.

[0113] In some embodiments, step 1023 above can be implemented as follows: when the voxel distance of the initial voxel is less than or equal to the voxel distance threshold, the initial voxel is determined as the first initial voxel; when the voxel distance of the initial voxel is greater than the voxel distance threshold, the initial voxel is determined as the second initial voxel; from a plurality of initial voxels, a first number of first initial voxels and a second number of second initial voxels are selected, and the selected first initial voxels and second initial voxels are determined as voxels to be updated.

[0114] In some embodiments, the first quantity is greater than the second quantity, and the first quantity is at least one. Since the first quantity is greater than the second quantity, and the first quantity is at least one, then the second quantity is at least zero.

[0115] In some embodiments, the voxel distance threshold can be specifically set according to the actual scene conditions, and the voxel distance threshold is less than the maximum voxel distance. Initial voxels can be classified into a first initial voxel and a second initial voxel by comparing the voxel distance with the voxel distance threshold, where the voxel distance of the first initial voxel is less than the voxel distance of the second initial voxel.

[0116] Thus, from multiple initial voxels, a first number of first initial voxels and a second number of second initial voxels are selected, and these selected first and second initial voxels are determined as voxels to be updated. Since the first number is greater than the second number, the number of second initial voxels that are farther away from the virtual camera is less than the number of first initial voxels that are closer to the virtual camera. Because the first initial voxels that are closer to the virtual camera are more likely to include the virtual viewpoint, selecting more first initial voxels can effectively ensure that the lighting information of the virtual viewpoint is updated subsequently, effectively ensuring the accuracy of the lighting update of the virtual viewpoint, thereby effectively improving the accuracy of the lighting update.

[0117] As an example, when the initial number of voxels is 10, the number of first initial voxels with a voxel distance less than or equal to the voxel distance threshold can be 5, the number of first initial voxels with a voxel distance greater than the voxel distance threshold can be 5, the first selected number can be 3, and the second selected number can be 1.

[0118] As an example, when the initial number of voxels is 10, the number of first initial voxels whose voxel distance is less than or equal to the voxel distance threshold can be 5, the number of first initial voxels whose voxel distance is greater than the voxel distance threshold can be 5, the first selected number can be 1, and the second selected number can be 0.

[0119] In this way, by responding to changes in the content of the virtual scene, at least one voxel is selected from multiple initial voxels to be updated. Since the number of voxels to be updated is less than the number of initial voxels, the number of voxels to be updated is effectively reduced, thereby effectively reducing the update cost and improving the lighting update efficiency of the virtual scene.

[0120] In step 103, the illumination information carried by each voxel to be updated is updated to obtain the updated voxel corresponding to each voxel to be updated.

[0121] In some embodiments, step 103 above can be implemented as follows: perform the following processing on each voxel to be updated: update the lighting information of the corresponding position of the virtual scene carried by the voxel to be updated, and obtain the updated voxel corresponding to the voxel to be updated.

[0122] In some embodiments, see Figure 5 , Figure 5 This is a flowchart illustrating the lighting update method for a virtual scene provided in an embodiment of this application. Figure 3 Step 103 shown can be performed separately for each voxel to be updated. Figure 5 Steps 1031 to 1034 shown are implemented.

[0123] In step 1031, multiple target virtual scene points located within the voxel to be updated are determined from each virtual scene point in the virtual scene.

[0124] In some embodiments, a virtual scene point refers to the smallest unit in a virtual scene. A virtual scene is composed of multiple virtual scene points, and different virtual scene points are located in different positions within the virtual scene.

[0125] In some embodiments, step 1031 above can be implemented in the following way: Perform the following processing on each virtual scene point in the virtual scene: compare the scene point position of the virtual scene point in the virtual scene with the voxel position range of the voxel to be updated in the virtual scene, and when the scene point position is within the voxel position range, determine the virtual scene point as the target virtual scene point.

[0126] In step 1032, the target lighting information of each target virtual scene point within the voxel to be updated is obtained.

[0127] In some embodiments, target lighting information is used to indicate the intensity or irradiance of light reflected at a target virtual scene point.

[0128] In some embodiments, step 1032 above can be implemented as follows: for each target virtual scene point within the voxel to be updated, the following processing is performed: obtain the direct lighting information of the target virtual scene point; obtain the indirect lighting information of the target virtual scene point; sum the direct lighting information and the indirect lighting information to obtain the target lighting information of the target virtual scene point.

[0129] In some embodiments, direct lighting information is used to indicate the lighting effect of direct light emitted by a virtual light source on a target virtual scene point, and indirect lighting information is used to indicate the lighting effect of reflected light corresponding to the direct light on the target virtual scene point.

[0130] In some embodiments, when the direct lighting information is the direct lighting intensity and the indirect lighting information is the indirect lighting intensity, the lighting intensity sum is obtained by summing the direct lighting intensity and the indirect lighting intensity, and the lighting intensity sum is determined as the target lighting information of the target virtual scene point.

[0131] As an example, the expression for the target lighting information of a target virtual scene point can be:

[0132] (1)

[0133] in, Used to indicate the target lighting information of the target virtual scene point. Used to indicate the direct lighting information of target virtual scene points. Indirect lighting information used to indicate target virtual scene points.

[0134] In some embodiments, when the indirect lighting information is indirect lighting irradiance and the direct lighting information is direct lighting intensity, the lighting irradiance sum value is obtained by summing the direct lighting irradiance and the indirect lighting irradiance, and the lighting irradiance sum value is determined as the target lighting information of the target virtual scene point.

[0135] In some embodiments, the direct lighting information includes direct lighting intensity. The acquisition of direct lighting information of the target virtual scene point can be achieved as follows: determining the light source distance between the virtual light source in the virtual scene and the target virtual scene point; acquiring the camera distance between the target virtual scene point and the virtual camera, and adding the camera distance and the light source distance to obtain the total distance; determining the light source intensity loss value of the virtual light source based on the total distance and the target virtual scene point; and subtracting the light source intensity from the loss value to obtain the direct lighting intensity of the target virtual scene point.

[0136] In some embodiments, the above-mentioned determination of the light intensity loss value of the virtual light source based on the total distance and the target virtual scene point can be achieved as follows: a first loss value of the virtual light source is determined based on the total distance, a second loss value of the virtual light source is determined based on the target virtual scene point, and the first loss value and the second loss value are added together to obtain the light intensity loss value of the virtual light source.

[0137] In some embodiments, a first loss value is used to indicate the loss of the light intensity of the virtual light source along the light path, and a second loss value is used to indicate the loss of the light intensity of the virtual light source at the target virtual point.

[0138] In some embodiments, the light path includes a first sub-path in the virtual scene that starts from a virtual light source and ends at a target virtual scene point, and a second sub-path that starts from the target virtual scene point and ends at a virtual camera.

[0139] In this way, by determining the loss value of the light intensity of the light source along the light path, the direct light intensity of the target virtual scene point can be accurately determined. This facilitates the subsequent combination with the indirect light intensity to accurately determine the target lighting information of the target virtual scene point, thereby effectively improving the lighting accuracy of the virtual scene.

[0140] In some embodiments, the aforementioned indirect lighting information includes indirect lighting intensity. The acquisition of indirect lighting information of the target virtual scene point can be achieved as follows: from a plurality of lighting probes deployed in the target virtual scene, at least one target lighting probe whose distance to the target virtual scene point is less than a distance threshold is determined; when the number of target lighting probes is one, the lighting intensity stored in the target lighting probe is determined as the indirect lighting intensity of the target virtual scene point; when the number of target lighting probes is multiple, the weight of each target lighting probe is determined based on the probe distance between each target lighting probe and the target virtual scene point; according to the weight, the lighting intensities stored in each target lighting probe are weighted and summed to obtain the indirect lighting intensity of the target virtual scene point.

[0141] In some embodiments, a light probe is used to store the light intensity at a corresponding location in the changed virtual scene.

[0142] In some embodiments, the light probe stores “baked” information about lighting in the virtual scene, the light map stores lighting information about light illuminating the surface of virtual objects in the virtual scene, but the light detector stores information about light passing through empty spaces in the virtual scene.

[0143] In some embodiments, the probe distance is inversely proportional to the weight of the target illumination probe; a larger probe distance corresponds to a smaller target illumination probe weight, and vice versa. The weights of all target illumination probes are summed to 1.

[0144] As an example, when there are multiple target illumination probes, such as target illumination probe 1, target illumination probe 2 and target illumination probe 3, the probe distance corresponding to target illumination probe 1 is 3, the probe distance corresponding to target illumination probe 2 is 4, the probe distance corresponding to target illumination probe 3 is 5, the probe weight corresponding to target illumination probe 1 is 0.5, the probe weight corresponding to target illumination probe 2 is 0.3, and the probe weight corresponding to target illumination probe 3 is 0.2.

[0145] Thus, by identifying at least one target lighting probe from among multiple lighting probes deployed in the target virtual scene whose distance to a point in the target virtual scene is less than a distance threshold, and determining the weight corresponding to each target lighting probe, the lighting information stored in each target lighting probe is weighted and summed according to the weight to obtain the indirect lighting intensity of the target virtual scene point. Since the lighting information stored in the target lighting probes accurately reflects the lighting information at the corresponding location in the changed virtual scene, and the target lighting probes are relatively close to the target virtual scene point, they can more accurately reflect the actual indirect lighting of the target virtual scene point. By weighted summing the lighting information from multiple target lighting probes, the determined indirect lighting intensity more accurately reflects the lighting in the changed virtual scene, effectively improving the accuracy of the determined indirect lighting intensity.

[0146] In some embodiments, before determining at least one target lighting probe whose distance to the target virtual scene point is less than a distance threshold from the plurality of lighting probes deployed in the virtual scene, the lighting probes may be deployed in the following manner: obtaining the camera position of the virtual camera in the virtual scene; determining the virtual scene area whose distance to the camera position is less than the distance threshold as a first virtual scene area, and determining the virtual scene area whose distance to the camera position is greater than or equal to the distance threshold as a second virtual scene area; deploying a third number of lighting probes in the first virtual scene area, and deploying a fourth number of lighting probes in the second virtual scene area.

[0147] In some embodiments, the third quantity is greater than the fourth quantity, and the third quantity is an integer greater than or equal to 1.

[0148] In some embodiments, the distance threshold can be specifically set according to the actual situation, and the distance threshold is used to divide the virtual scene into at least two virtual scene regions.

[0149] As an example, 15 lighting probes are deployed in the first virtual scene area, and 20 lighting probes are deployed in the second virtual scene area.

[0150] Thus, since the number of virtual viewpoints (virtual scene points that can be captured by the virtual camera) in the first virtual scene area is greater than the number of virtual viewpoints in the second virtual scene area, deploying more lighting probes in the first virtual scene area can effectively ensure the lighting accuracy of the first virtual scene area. Deploying fewer lighting probes in the second virtual scene area can save on the number of lighting probes deployed while ensuring the lighting accuracy of the second virtual scene area, thereby effectively saving storage space and effectively improving the lighting update efficiency of the virtual scene.

[0151] In step 1033, the lighting information of each target is weighted and summed to obtain the updated lighting information.

[0152] In some embodiments, step 1033 above can be implemented as follows: perform the following processing on each target illumination information: multiply the target illumination information and the corresponding weight to obtain the illumination product result; add the illumination product results corresponding to each target illumination information to obtain the updated illumination information.

[0153] In step 1034, the illumination information carried by the voxel to be updated is updated to the updated illumination information to obtain the updated voxel corresponding to the voxel to be updated.

[0154] In some embodiments, step 1034 above can be implemented in the following manner: replacing the illumination information carried by the voxel to be updated with updated illumination information, and determining the replaced voxel to be updated as the updated voxel corresponding to the voxel to be updated.

[0155] Thus, by updating some initial voxels (voxels to be updated) in the virtual scene, the updated voxels corresponding to each voxel to be updated are obtained, thereby effectively reducing the number of voxels to be updated and thus reducing the update cost, and effectively improving the lighting update efficiency of the virtual scene. At the same time, by deploying lighting probes, the indirect lighting information of the voxels to be updated can be accurately determined, and by calculating the loss value of the light intensity of the light source, the direct lighting information of the voxels to be updated can be accurately determined. By summing the direct and indirect lighting information, the obtained updated lighting information is more accurate, effectively improving the accuracy of the determined updated lighting information.

[0156] In step 104, the lighting information of each virtual viewpoint in the changed virtual scene is updated by combining the updated voxel and the initial voxels other than the voxel to be updated from the multiple initial voxels.

[0157] In some embodiments, the virtual viewpoint is a virtual scene point in the changed virtual scene that can be captured by the virtual camera of the virtual scene.

[0158] In some embodiments, the above-described process of updating the lighting information of each virtual viewpoint in the changed virtual scene is a process of updating the lighting information of each virtual viewpoint in the changed virtual scene by combining the updated lighting information of the updated voxel and the lighting information of the initial voxels other than the voxel to be updated among multiple initial voxels.

[0159] In some embodiments, see Figure 6 , Figure 6 This is a flowchart illustrating the lighting update method for a virtual scene provided in an embodiment of this application. Figure 3 Step 104 shown can be executed separately for each virtual viewpoint in the changed virtual scene. Figure 6 Steps 1041 to 1043 shown are implemented.

[0160] In step 1041, the target voxel where the virtual viewpoint is located is determined from the updated voxel and the initial voxels other than the voxel to be updated, and the lighting information of the target voxel is obtained.

[0161] In some embodiments, the determination of the target voxel where the virtual viewpoint is located from the updated voxel and the initial voxels other than the voxel to be updated can be achieved by comparing the viewpoint position of the virtual viewpoint in the virtual scene with the position ranges corresponding to the updated voxel and the initial voxels other than the voxel to be updated, and determining the voxel corresponding to the position range where the voxel is located as the target voxel.

[0162] In step 1042, the illumination information of the target voxel is determined as the updated illumination information of the virtual viewpoint.

[0163] In some embodiments, step 1042 above can be implemented as follows: when the target voxel is an updated voxel, the updated lighting information of the updated voxel is determined as the updated lighting information of the virtual viewpoint; when the target voxel is an initial voxel other than the voxel to be updated, the initial lighting information of the initial voxel is determined as the updated lighting information of the virtual viewpoint.

[0164] In step 1043, the lighting information of the virtual viewpoint is updated to the updated lighting information of the virtual viewpoint.

[0165] Thus, by determining the target voxel where each virtual viewpoint is located, the lighting information of the target voxel is used as the updated lighting information of the virtual viewpoint. When the target voxel is the voxel to be updated, due to the accuracy of the updated lighting information of the voxel to be updated, the updated lighting information of the virtual viewpoint is made more accurate by using the updated lighting information of the voxel to be updated as the updated lighting information of the virtual viewpoint.

[0166] In some embodiments, see Figure 7 , Figure 7 This is a flowchart illustrating the lighting update method for a virtual scene provided in this application embodiment. After step 104 above, it can also be achieved through... Figure 7 Steps 105 to 107 shown implement the correction of the updated illumination information.

[0167] In step 105, the updated illumination information is spatially corrected to obtain the first illumination information.

[0168] In some embodiments, spatial correction refers to the process of correcting errors in the updated lighting information of the target voxel by combining voxels other than the target voxel corresponding to the virtual viewpoint in the scene space of the virtual scene, wherein the accuracy of the first lighting information is greater than the accuracy of the updated lighting information.

[0169] In some embodiments, see Figure 7 , Figure 7 This is a flowchart illustrating the lighting update method for a virtual scene provided in an embodiment of this application. Figure 6 Step 105 shown can be executed Figure 7Steps 1051 to 1053 shown are implemented.

[0170] In step 1051, the target voxel where the virtual viewpoint is located, and multiple adjacent voxels adjacent to the target voxel, are determined from the updated voxel and the initial voxels other than the voxel to be updated.

[0171] In some embodiments, the determination of the target voxel where the virtual viewpoint is located from the updated voxel and the initial voxels other than the voxel to be updated can be achieved by comparing the viewpoint position of the virtual viewpoint in the virtual scene with the position ranges corresponding to the updated voxel and the initial voxels other than the voxel to be updated, and determining the voxel corresponding to the position range where the voxel is located as the target voxel.

[0172] In some embodiments, the adjacent voxel refers to a voxel that is adjacent to the target voxel.

[0173] In step 1052, a target neighboring voxel is selected from a plurality of neighboring voxels.

[0174] In some embodiments, the selection of a target neighboring voxel from a plurality of neighboring voxels can be achieved as follows: For each neighboring voxel, the following processing is performed: First occlusion information of the neighboring voxel and second occlusion information of the target voxel are obtained; when the first occlusion information indicates that there is no virtual object between the neighboring voxel and the virtual camera, and the second occlusion information indicates that there is no virtual object between the target voxel and the virtual camera, the neighboring voxel is identified as the target neighboring voxel; when the first occlusion information indicates that there is a virtual object between the neighboring voxel and the virtual camera, and the second occlusion information indicates that there is a virtual object between the target voxel and the virtual camera, an occlusion check is performed on the neighboring voxel and the target voxel to obtain an occlusion check result; when the occlusion check result indicates that both the neighboring voxel and the target voxel pass the occlusion check, the neighboring voxel is identified as the target neighboring voxel.

[0175] In some embodiments, the first occlusion information of the adjacent voxel is used to indicate whether a virtual object exists between the adjacent voxel and the virtual camera. The second occlusion information of the target voxel is used to indicate whether a virtual object exists between the target voxel and the virtual camera.

[0176] In some embodiments, when the first occlusion information of the adjacent voxel indicates that there is no virtual object between the adjacent voxel and the virtual camera, it means that there is no virtual occlusion between the adjacent voxel and the virtual camera. Therefore, the virtual scene points on the adjacent voxel are more likely to be captured by the virtual camera (provided that at least one virtual viewpoint exists among the multiple virtual scene points on the adjacent voxel). When the second occlusion information indicates that there is no virtual object between the target voxel and the virtual camera, it means that there is no virtual occlusion between the target voxel and the virtual camera. Therefore, the virtual scene points on the target voxel are more likely to be captured by the virtual camera (provided that at least one virtual viewpoint exists among the multiple virtual scene points on the target voxel, that is, as long as at least one virtual scene point on the target voxel can be illuminated by direct or indirect light). So, when the first occlusion information indicates that there is no virtual object between the adjacent voxel and the virtual camera, and the second occlusion information indicates that there is no virtual object between the target voxel and the virtual camera, it means that the target voxel and its corresponding adjacent voxel are more likely to be captured by the virtual camera. Therefore, the adjacent voxel can be identified as the target adjacent voxel.

[0177] In some embodiments, when the first occlusion information indicates that there is a virtual object between the adjacent voxel and the virtual camera, and the second occlusion information indicates that there is a virtual object between the target voxel and the virtual camera, it means that the target voxel and its corresponding adjacent voxel have a low probability of being captured by the virtual camera. In this case, an occlusion check needs to be performed on the adjacent voxel and the target voxel. When the occlusion check result indicates that the adjacent voxel and the target voxel pass the occlusion check, the adjacent voxel is identified as the target adjacent voxel.

[0178] In some embodiments, when the first occlusion information indicates that there is a virtual object between the adjacent voxel and the virtual camera, or the second occlusion information indicates that there is a virtual object between the target voxel and the virtual camera, the adjacent voxel is determined to be a non-adjacent voxel.

[0179] Thus, by selecting a target neighboring voxel from among multiple neighboring voxels adjacent to the target voxel, and using the target neighboring voxel to perform spatial correction on the updated lighting information of the target voxel, the obtained first lighting information is more accurate, and the updated lighting information of the virtual viewpoint is more accurate.

[0180] In some embodiments, the above-described occlusion check of adjacent voxels and target voxels to obtain occlusion check results can be implemented as follows: A first distance between the adjacent voxel and the corresponding virtual object, and a second distance between the target voxel and the corresponding virtual object are obtained; a first occlusion check is performed on the adjacent voxel and target voxel based on the first and second distances to obtain a first occlusion check result; when the first occlusion check result indicates that the adjacent voxel and target voxel have passed the first occlusion check, the occlusion check result is determined as a first result; when the first occlusion check result indicates that the adjacent voxel and target voxel have not passed the first occlusion check, a third distance between the adjacent voxel and target voxel is obtained, and a second occlusion check is performed on the adjacent voxel and target voxel based on the second and third distances to obtain a second occlusion check result; when the second occlusion check result indicates that the adjacent voxel and target voxel have passed the second occlusion check, the occlusion check result is determined as a first result; when the second occlusion check result indicates that the adjacent voxel and target voxel have not passed the second occlusion check, the occlusion check result is determined as a second result.

[0181] In some embodiments, a first result is used to indicate that the adjacent voxel and the target voxel pass the occlusion check, and a second result is used to indicate that the adjacent voxel and the target voxel do not pass the occlusion check.

[0182] In some embodiments, when the first occlusion information indicates that there is a virtual object between the adjacent voxel and the virtual camera, and the second occlusion information indicates that there is a virtual object between the target voxel and the virtual camera, two occlusion checks (first occlusion check and second occlusion check) are performed using the adjacent voxel, the virtual object corresponding to the adjacent voxel, the target voxel, and the distance between the virtual object corresponding to the target voxel, so as to accurately determine whether the adjacent voxel is identified as the target adjacent voxel.

[0183] In some embodiments, when the first occlusion check result indicates that the adjacent voxel and the target voxel have not passed the first occlusion check, the adjacent voxel cannot be identified as the target adjacent voxel at this time. A second occlusion check is required for the adjacent voxel and the target voxel. Only when the adjacent voxel and the target voxel pass the second occlusion check can the adjacent voxel be identified as the target adjacent voxel.

[0184] In some embodiments, the first occlusion check on adjacent voxels and target voxels based on the first distance and the second distance to obtain the first occlusion check result can be achieved in the following way: the first distance and the second distance are compared to obtain a first comparison result; when the first comparison result indicates that the first distance is less than or equal to the second distance, and the dot product of the direction vector from the virtual viewpoint to the voxel center point of the target voxel and the direction vector from the target voxel to the corresponding virtual object is less than the dot product threshold, the first occlusion check result is determined as the third result.

[0185] In some embodiments, the third result is used to indicate that the adjacent voxel and the target voxel have passed the first occlusion check.

[0186] In some embodiments, when the first comparison result indicates that the first distance is greater than the second distance, or the dot product of the direction vector from the virtual viewpoint to the voxel center point of the target voxel and the direction vector from the target voxel to the corresponding virtual object is greater than or equal to the dot product threshold, the first occlusion check result is determined as the fifth result.

[0187] In some embodiments, the fifth result is used to indicate that the adjacent voxel and the target voxel did not pass the first occlusion check.

[0188] In some embodiments, when the first comparison result indicates that the first distance is less than or equal to the second distance, it means that the distance between the target voxel and the corresponding virtual object is closer than the distance between adjacent voxels and the corresponding virtual objects. The closer the distance between the voxel and the corresponding virtual object, the more virtual scene points in the voxel are occluded by the virtual object, that is, the higher the proportion of occluded virtual scene points in the voxel. The proportion of occluded virtual scene points in the voxel is directly proportional to the distance between the voxel and the corresponding virtual object. In this case, since the number of occluded virtual scene points in the target voxel is greater than the number of occluded virtual scene points in the adjacent voxels, it means that the lighting information of the adjacent voxels has greater reference value for updating the lighting information of the target voxel. It is possible to consider combining the lighting information of the adjacent voxels to perform spatial correction on the updated lighting information of the target voxel, that is, it is possible to consider identifying the adjacent voxels as the target adjacent voxels.

[0189] In some embodiments, if the first comparison result indicates that the first distance is less than or equal to the second distance, the dot product of the direction vector from the virtual viewpoint to the voxel center point of the target voxel and the direction vector from the target voxel to the corresponding virtual object is less than a dot product threshold to further determine whether the adjacent voxel is identified as the target adjacent voxel.

[0190] In some embodiments, when the dot product of the direction vector from the virtual viewpoint to the center point of the target voxel and the direction vector from the target voxel to the corresponding virtual object is less than the dot product threshold, it indicates that the angle between the two direction vectors is small and they are more easily occluded. In this case, the adjacent voxel can be determined as the target adjacent voxel.

[0191] Thus, by performing a first occlusion check on adjacent voxels and the target voxel, a first occlusion check result is obtained. When the first occlusion check result indicates that the target voxel and adjacent voxels have passed the first occlusion check, the adjacent voxel is identified as the target adjacent voxel. The target adjacent voxel is then identified by the contribution of the illumination information of the adjacent voxel to the accuracy of the target voxel. Spatial correction is then performed on the updated illumination information of the target voxel based on the target adjacent voxel, making the obtained first illumination information more accurate and the updated illumination information of the virtual viewpoint more accurate.

[0192] In some embodiments, the second occlusion check on adjacent voxels and target voxels based on the second distance and the third distance to obtain the second occlusion check result can be achieved by comparing the second distance and the third distance to obtain a second comparison result; when the second comparison result indicates that the second distance is greater than the third distance, the second occlusion check result is determined as the fourth result.

[0193] In some embodiments, the fourth result is used to indicate that the adjacent voxel and the target voxel have passed the second occlusion check.

[0194] In some embodiments, a third distance between a neighboring voxel and a target voxel is used to indicate the distance between the voxel center point of the neighboring voxel and the voxel center point of the target voxel.

[0195] In some embodiments, when the second distance between the target voxel and the corresponding virtual object is greater than the third distance between the adjacent voxel and the target voxel, it indicates that the second distance between the target voxel and the corresponding virtual object is farther than the third distance between the adjacent voxel and the target voxel, indicating that the illumination contribution of the adjacent voxel to the target voxel is greater than the illumination contribution of the virtual object to the target voxel. In this case, the second occlusion check result can be determined as the fourth result. The fourth result is used to indicate that the adjacent voxel and the target voxel pass the second occlusion check; that is, the adjacent voxel can be determined as the target adjacent voxel.

[0196] Thus, by performing a first occlusion check on adjacent voxels and the target voxel, a first occlusion check result is obtained. If the first occlusion check result indicates that the target voxel and adjacent voxels have not passed the first occlusion check, a second occlusion check is performed. This allows the target adjacent voxel to be determined by the contribution of the illumination information of the adjacent voxel to the accuracy of the target voxel. The updated illumination information of the target voxel is then spatially corrected using the target adjacent voxel, making the obtained first illumination information more accurate and the updated illumination information of the virtual viewpoint more accurate.

[0197] In step 1053, the illumination information of the target voxel and the illumination information of each adjacent target voxel are obtained.

[0198] As an example, obtain the illumination information corresponding to target neighbor voxels 1, 2, 3, and 4 of the target voxel.

[0199] In step 1054, the lighting information of the target voxel and the lighting information of each neighboring target voxel are weighted and summed to obtain the first lighting information of the virtual viewpoint.

[0200] In some embodiments, the weights corresponding to the illumination information of the target voxel and the illumination information of each target neighboring voxel can be set according to the actual situation. For example, the weight of the illumination information of the target voxel is greater than the weight of the illumination information of each target neighboring voxel, and the weights of the illumination information of each target neighboring voxel are equal.

[0201] In step 106, the updated illumination information is temporally corrected to obtain the second illumination information.

[0202] In some embodiments, temporal correction refers to the process of correcting the error of the updated illumination information of the target voxel by combining the illumination information of multiple historical voxels of the pixel corresponding to the virtual viewpoint in the historical update process, wherein the accuracy of the second illumination information is greater than the accuracy of the updated illumination information.

[0203] In some embodiments, see Figure 8 , Figure 8 This is a flowchart illustrating the lighting update method for a virtual scene provided in an embodiment of this application. Figure 6 Step 106 shown can be executed Figure 8 Steps 1061 to 1063 shown are implemented.

[0204] In step 1061, the target voxel where the virtual viewpoint is located is determined from the updated voxel and the initial voxels other than the voxel to be updated, and the lighting information of the target voxel is obtained.

[0205] In some embodiments, the determination of the target voxel where the virtual viewpoint is located from the updated voxel and the initial voxels other than the voxel to be updated can be achieved by comparing the viewpoint position of the virtual viewpoint in the virtual scene with the position ranges corresponding to the updated voxel and the initial voxels other than the voxel to be updated, and determining the voxel corresponding to the position range where the voxel is located as the target voxel.

[0206] In step 1062, the pixel corresponding to the virtual viewpoint is determined, and multiple historical voxels of the pixel in the historical update process are queried from multiple initial voxels, and the lighting information of each historical voxel is obtained.

[0207] In some embodiments, the pixel corresponding to the virtual viewpoint refers to the pixel corresponding to the virtual viewpoint in the imaging plane of the virtual camera. There is a one-to-one correspondence between the virtual viewpoint and the pixel in the imaging plane of the virtual camera. A virtual viewpoint in the virtual scene corresponds to a pixel in the imaging plane of the virtual camera in the virtual scene.

[0208] In some embodiments, the number of history voxels is equal to the number of times the content of the virtual scene is updated.

[0209] As an example, the virtual scene content was updated 5 times within 10 seconds. Specifically, it was updated once at the 1st second, once at the 3rd second, once at the 5th second, once at the 7th second, and once at the 9th second. The historical voxels corresponding to the pixels in each historical update were queried, and the lighting information of each historical voxel was obtained.

[0210] In step 1063, the lighting information of the target voxel and the lighting information of each historical voxel are weighted and summed to obtain the second lighting information of the virtual viewpoint.

[0211] In some embodiments, updating the virtual scene content causes a change in the voxel corresponding to a pixel. One update of the virtual scene content causes one change in the voxel corresponding to a pixel. The update of the virtual scene content changes over time. For example, if it is updated 5 times in 10 seconds, each update will cause one change in the voxel corresponding to the pixel. Then, from multiple initial voxels, we can query multiple initial voxels (historical voxels) corresponding to the pixel in the historical update process (each update). We can then perform a weighted summation of the lighting information of the target voxel and the lighting information of each historical voxel to obtain the second lighting information of the virtual viewpoint. This allows us to correct the updated lighting information within the time span (temporal domain) of the content update process.

[0212] As an example, the virtual scene content was updated 5 times within 10 seconds. Specifically, it was updated once at the 1st second, once at the 3rd second, once at the 5th second, once at the 7th second, and once at the 9th second. The historical voxels corresponding to the pixels in each historical update were queried, and the lighting information of the target voxel and the lighting information of each historical voxel were weighted and summed to obtain the second lighting information of the virtual viewpoint.

[0213] Thus, by determining the pixel corresponding to the virtual viewpoint and querying multiple historical voxels of the pixel during the historical update process from multiple initial voxels, and combining the historical voxels corresponding to each update within the update time domain, the updated lighting information is temporally corrected to obtain the second lighting information. This effectively corrects the error of the updated lighting information, making the obtained second lighting information more accurate, and making the updated lighting information of the virtual viewpoint more accurate.

[0214] In step 107, the updated illumination information is corrected for errors by combining the first illumination information and the second illumination information.

[0215] In some embodiments, the accuracy of the second illumination information is greater than that of the updated illumination information, and the accuracy of the first illumination information is greater than that of the updated illumination information. The first illumination information mainly eliminates the spatial error of the updated illumination information, while the second illumination information mainly eliminates the temporal error of the updated illumination information. By combining the first and second illumination information to correct the error in the updated illumination information, the resulting error-corrected updated illumination information can eliminate both the spatial and temporal errors of the updated illumination information, thereby making the error-corrected updated illumination information more accurate.

[0216] In some embodiments, see Figure 9 , Figure 9 This is a flowchart illustrating the lighting update method for a virtual scene provided in an embodiment of this application. Figure 6 Step 107 shown can be executed Figure 9 Steps 1071 to 1073 shown are implemented.

[0217] In step 1071, the validity of the first illumination information is checked, and the check result is obtained.

[0218] In some embodiments, the above-mentioned validity check refers to the process of checking the validity of the first illumination information, and the check result is used to indicate whether the first illumination information is valid.

[0219] In some embodiments, step 1071 above can be implemented as follows: determining the target voxel where the virtual viewpoint is located from the updated voxel and the initial voxels other than the voxel to be updated; constructing an inspection ray in the changed virtual scene with the target voxel as the starting point and the virtual camera as the ending point; determining the inspection result as the first inspection result when the inspection ray intersects with a virtual object in the changed virtual scene; and determining the inspection result as the second inspection result when the inspection ray does not intersect with a virtual object in the changed virtual scene.

[0220] In some embodiments, a first check result is used to indicate that the first illumination information is invalid, and a second check result is used to indicate that the first illumination information is valid.

[0221] In some embodiments, the determination of the target voxel where the virtual viewpoint is located from the updated voxel and the initial voxel other than the voxel to be updated can be achieved by comparing the viewpoint position of the virtual viewpoint in the virtual scene with the position range corresponding to the updated voxel and the initial voxel other than the voxel to be updated, and determining the voxel corresponding to the position range where the voxel is located as the target voxel.

[0222] In some embodiments, when the inspection ray intersects with a virtual object in the modified virtual scene, it indicates that the target voxel may be occluded by the virtual object, and the first lighting information can be determined to be invalid. When the inspection ray intersects with a virtual object in the modified virtual scene, it indicates that the target voxel may not be occluded by the virtual object, and the first lighting information can be determined to be valid.

[0223] In step 1072, when the inspection result indicates that the first illumination information is invalid, the illumination information is updated and corrected to the second illumination information.

[0224] In some embodiments, when the inspection result corresponding to the first illumination information indicates that the first illumination information is invalid, the updated illumination information can be corrected to the second illumination information.

[0225] In step 1073, when the inspection result indicates that the first illumination information is valid, the updated illumination information is corrected to the first illumination information.

[0226] In some embodiments, when the inspection result corresponding to the first illumination information indicates that the first illumination information is valid, the updated illumination information can be corrected to the first illumination information.

[0227] Thus, the accuracy of the second illumination information is greater than that of the updated illumination information, and the accuracy of the first illumination information is greater than that of the updated illumination information. The first illumination information mainly eliminates the spatial error of the updated illumination information, while the second illumination information mainly eliminates the temporal error of the updated illumination information. By combining the first and second illumination information to correct the error in the updated illumination information, the resulting error-corrected updated illumination information can eliminate both the spatial and temporal errors of the updated illumination information, thereby making the error-corrected updated illumination information more accurate.

[0228] In some embodiments, after step 104 above, the target illumination information of the pixel can also be determined in the following manner: For each virtual viewpoint in the changed virtual scene, the following processing is performed respectively: obtain the pixel corresponding to the virtual viewpoint in the imaging plane of the virtual camera; determine the viewpoint distance between the virtual camera and the virtual viewpoint, and determine the initial illumination information of the pixel by combining the viewpoint distance and the updated illumination information of the virtual viewpoint; determine at least one target screen probe from the multiple screen probes deployed in the imaging plane whose distance to the pixel is less than a distance threshold; and perform a weighted summation of the illumination information stored in each target screen probe and the initial illumination information of the pixel to obtain the target illumination information of the pixel.

[0229] In some embodiments, the target lighting information of the pixels is used to render the image on the imaging plane of the virtual camera.

[0230] In some embodiments, the screen probe is used to store illumination information at a corresponding location in the imaging plane.

[0231] In some embodiments, the viewpoint distance between the virtual camera and the virtual viewpoint can be determined using distance calculation methods such as Euclidean distance, Manhattan distance, and Chebyshev distance. The specific calculation method for the viewpoint distance is as follows: The viewpoint distance is used to indicate the proximity between the virtual camera and the virtual viewpoint.

[0232] In some embodiments, the weights corresponding to the illumination information stored in each target screen probe and the initial illumination information of the pixel can be specifically set according to the actual situation, and the sum of the weights corresponding to the illumination information stored in each target screen probe and the initial illumination information of the pixel is equal to 1.

[0233] Thus, by voxelizing the target virtual scene, multiple initial voxels are obtained. In response to changes in the content of the target virtual scene, at least one voxel to be updated is selected from these initial voxels. The lighting information carried by each voxel to be updated is updated. Combining the updated voxel with the other initial voxels from the multiple initial voxels, the lighting information of each virtual viewpoint in the changed target virtual scene is updated. In this way, by responding to changes in the content of the virtual scene, at least one voxel to be updated is selected from multiple initial voxels. Since the number of voxels to be updated is less than the number of initial voxels, the number of voxels to be updated is effectively reduced, thereby effectively reducing update costs and significantly improving the lighting update efficiency of the virtual scene.

[0234] The following will describe an exemplary application of the embodiments of this application in a real-world online game scenario.

[0235] This application can be applied to any project or product requiring real-time global illumination calculations, including games and 3D visual design. It can provide high-quality, realistic lighting rendering effects, significantly improving the visual performance of the product and further enhancing the user experience. In typical application scenarios such as games, this application can automatically calculate the indirect lighting results of every pixel on the screen in real time based on the placement and parameters of objects and lights in the game scene, thereby improving the lighting details and realism of the game screen.

[0236] In some embodiments, see Figure 10 , Figure 10 This is a rendering effect diagram of the lighting update method for a virtual scene provided in this application embodiment. This application embodiment can automatically calculate the indirect lighting results of each pixel (e.g., pixel 1, pixel 2, and pixel 3) on the screen in real time based on the placement and parameters of objects and lights in the game scene, thereby improving the lighting details and realism of the game image.

[0237] In some embodiments, see Figure 11 , Figure 11 This is a flowchart illustrating the lighting update method for a virtual scene provided in this application embodiment. The lighting update method for a virtual scene provided in this application embodiment can... Figure 11 Steps 201 to 207 shown are implemented.

[0238] In step 201, the three-dimensional information of the virtual scene is obtained.

[0239] In step 202, the scene color and depth are obtained from the perspective.

[0240] In some embodiments, the initial input is the color and depth information of the virtual scene rendered from the current viewpoint. This information is combined with the 3D structure of the virtual scene, such as object poses, materials, and light source parameters, to update the voxels in the world space. Voxels are used as the basic structure of the lighting caching system, and the voxel data is continuously updated to adapt to the dynamic changes of the virtual scene and to calculate indirect lighting propagation.

[0241] In step 203, scene voxels are updated.

[0242] In some embodiments, step 203 above can be implemented by updating the scene voxels by combining the scene's 3D information, viewpoint, scene color, and depth.

[0243] In some embodiments, this application uses voxels with normal information to represent facets, simplifying the description of 3D scenes. First, a cuboid space centered on the camera is maintained. Voxels are used to simplify the description of 3D scene information within this space. The voxel content includes: normal, diffuse color, direct lighting information, radiance information, etc. To reduce memory consumption, this application uses a hierarchical approach to sparsely store voxels, treating 4*4*4 voxels as a group, called a "brick." The hierarchical index is represented by an n*m*k 3D texture. If a brick contains a voxel, its actual storage location can be obtained through the hierarchical index; if the hierarchical index value is 0, it indicates that the brick does not contain a voxel, thereby significantly saving video memory.

[0244] Scene voxel update in this application embodiment ( Figure 11 Step 203 shown includes voxel creation and voxel updating. The voxel creation part first converts the 3D objects in the scene into voxel information; this process is called scene voxelization. In this embodiment, scene voxelization is performed in two parts: one part is screen-based, i.e., screen voxel injection; the other part is 3D model-based, i.e., single-model voxelization. The voxel updating part is completed by screen voxel injection on mobile devices; on PCs and consoles, in addition to screen voxel injection, illumination propagation updates are also used.

[0245] In some embodiments, screen voxel injection typically uses scene color maps and scene depth maps. The world coordinates of pixels are calculated using the depth map, and then scene color, diffuse color, and other information are recorded at the corresponding voxel location. This application proposes an optimized screen voxel injection scheme, improving the performance and accuracy of screen voxel injection. The process consists of three parts:

[0246] The first part, grouped view frustum clipping: First, treat 8*8*8 bricks as a group. In the GPU, find the intersection of each group with the view frustum, discarding groups that do not intersect with the view frustum. Groups that intersect with the view frustum are updated frame-by-frame based on their distance from the camera; groups closer to the camera are updated more frequently, while groups farther away are updated less frequently. Group clipping significantly reduces the number of voxels that need to be updated.

[0247] The second part, brick collection: For the groups that need to be updated in the current frame, brick collection is performed. This process determines whether the brick intersects with the screen depth. If it intersects, the brick is collected for subsequent voxel injection; otherwise, it is not collected. In addition, every 10 frames, all bricks before the scene depth are collected to complete the voxel clearing operation. Here, this application proposes a novel "eight-vertex test method," which tests whether the cuboid intersects with the scene depth by comparing the relationship between the eight vertices of the cuboid and the scene depth: if some of the eight vertices are before the scene depth, and some of the vertices are after the scene depth, then the cuboid is determined to intersect with the scene depth; in addition, for a more lenient judgment, if any one of the eight vertices is very close to the scene depth, then the cuboid is determined to intersect with the scene depth.

[0248] The third part, voxel injection: For each voxel of the collected bricks, a thread is created. First, a random 3D point is selected within the voxel. The screen depth is obtained by projecting this point into the camera coordinate system. If the world coordinates corresponding to the screen depth are close to this point, the voxel is updated with its corresponding screen color. If the distance is far, the sampling point is invalid, and the process enters the clearing phase. Voxel clearing requires two conditions: if the voxel is determined to have no intersection with the scene depth using the "eight-vertex test method," and the voxel depth is in front of the screen depth, then the corresponding voxel is cleared.

[0249] In some embodiments, single-model voxelization sends the 3D model of the scene to the GPU, completes the voxelization using hardware rasterization, requires setting the model projection scheme to orthographic projection, disabling depth testing, and performing simultaneous x, y, and z axes drawing in a single draw call batch (pass). Because the PC solution has a subsequent voxel lighting update scheme, the single-model voxelization stage only writes the diffuse color and normal of the voxels; however, in the mobile solution, for performance reasons, voxel lighting propagation is not performed, but rather screen voxel injection is used to update the voxel lighting, i.e. Figure 12 The steps shown will be simplified to direct lighting during the single-model voxelization stage.

[0250] In some embodiments, see Figure 12 , Figure 12 This is a flowchart illustrating the lighting update method for a virtual scene provided in an embodiment of this application.

[0251] In step 2031, the virtual scene is divided into spatiotemporal regions.

[0252] In some embodiments, voxel illumination propagation updates are primarily used to update the direct and indirect illumination within each voxel, thereby enabling the system's illumination cache structure to adapt to dynamic changes in the scene. However, due to the large number of voxels in the scene, it is difficult to complete the illumination update within a limited time; therefore, updates are performed on only a subset of voxels per frame.

[0253] In some embodiments, it is first necessary to spatially and temporally divide all voxel brick structures in the scene. Spatially, the scene is divided into two parts, near distance and far distance, with the game player or camera as the origin and according to a certain threshold. For example, the space within 300 meters long, 300 meters wide, and 150 meters high is the near distance, and the rest is the far distance.

[0254] In step 2023, non-empty voxels to be updated in the current frame are collected.

[0255] In some embodiments, all voxel brick structures in the near-field and far-field spaces are allocated to multiple game frames for lighting updates, with 9 game frames allocated to the near-field space and 121 game frames allocated to the far-field space. Then, for all voxel brick structures allocated in the current frame, non-empty voxel brick structures are collected, meaning the lighting of voxels within these structures needs to be calculated. The non-empty voxels within each voxel brick structure are then marked, for example, using 64 bits to mark whether 64 voxels are empty. Finally, uniform sampling is performed on the non-empty voxels within a voxel brick structure, updating only a portion of the non-empty voxels; for example, up to 16 non-empty voxels can be randomly updated. Due to the randomization strategy, after several frames, all non-empty voxels within the voxel brick structure will have been updated.

[0256] In step 2033, non-empty voxels within the non-empty voxel brick are marked.

[0257] In step 2034, non-empty voxels are randomly selected.

[0258] In step 2035, the starting point within the voxel is calculated.

[0259] In some embodiments, see Figure 13 , Figure 13 This is a schematic diagram illustrating the principle of the starting point provided in this application embodiment. The square block represents the current voxel, and the curve represents the virtual object surface covered by the current voxel. The center point of the voxel is offset along the direction of the normal of the current voxel, offsetting it outside the current voxel, to obtain the offset point. Starting from the offset point, light rays are emitted within a certain angle range in the negative direction of the normal of the current voxel. The intersection point is obtained by tracing the light rays, which is the starting point.

[0260] In step 2036, the direct illumination at the voxel starting point position is calculated.

[0261] In step 2037, the indirect illumination at the voxel starting point position is calculated.

[0262] In some embodiments, it is necessary to further calculate the indirect illumination at the voxel's starting point position. A certain number of light rays are randomly sampled on the hemisphere in the direction of the starting point's normal, and the current indirect illumination of the voxel can be obtained through importance sampling or resampling techniques.

[0263] In step 2038, the indirect illumination is interpolated and updated.

[0264] In some embodiments, the current indirect lighting calculation result is interpolated and mixed with the result of the previous frame. For example, three rays can be uniformly sampled on the hemisphere in the normal direction of the current voxel starting point, and the lighting of the three rays can be calculated by ray tracing. Then, the current indirect lighting is calculated by resampling, and the results are accumulated in the time domain for 9 frames, that is, the interpolation weight is 1 / 9.

[0265] In step 204, a scene lighting probe system is generated.

[0266] In some embodiments, a scene lighting probe system is generated based on a voxel structure for subsequent indirect lighting calculations.

[0267] This embodiment uses a 3D probe in world space to cache indirect lighting information of the scene. The 3D probe in this embodiment also stores both indirect lighting and visibility information. For the indirect lighting information, this embodiment uses different storage formats depending on the platform: on a PC, an octahedral mapping map is used to store radiance information; on a mobile device, an ambient cube is used to store irradiance information. For the visibility information, this embodiment uses an octahedral mapping map to store VSM (Variance Shadow Map) distances, i.e., the average distance and the square of the average distance to the nearest object in each direction, used for subsequent visibility calculations using VSM. The 3D probes are uniformly distributed within a cuboid centered on the camera, using a nested hierarchy, with higher probe density closer to the camera and lower probe density farther from the camera.

[0268] In this embodiment, a layer is selected in each frame to update the 3D probes. During the update process, the probes that need to be updated are first collected, and the condition for determination is that there are valid voxels within a certain range around the probe. This collection scheme avoids a full probe update, which can reduce a lot of performance consumption.

[0269] For each 3D probe to be updated, a ray direction is randomly selected from the sphere. The probe surface to be updated is determined by the ray direction. In mobile applications, the surface to be updated is randomly selected first, and then the ray direction is randomly determined using the cosine of the angle between the normals as the update probability. The starting point of the ray is the center of the probe. The voxels at the intersection points can be obtained using a ray tracing algorithm. In the mobile solution, the ray tracing algorithm is implemented using software voxel tracing. The implementation uses a hierarchical approach to store the occupancy information of the next-level nodes. The lowest level is voxels. Each previous node uses 64 bits to store whether the next level 4*4*4 nodes are occupied. Then, HDDA (Hierarchical Digital Differential Analyzer) is used to implement the ray tracing algorithm. In the PC solution, different solutions such as hardware ray tracing can also be selected. If no voxels intersect over a long range, the probe surface content is updated using skylight, such as irradiance and unit irradiance, and the VSM distance is also updated. If the intersecting voxel is on the front side, the probe surface is updated using the voxel color, and the VSM distance is also updated. If the intersecting voxel is on the back side, only the VSM distance is updated, without updating the color. To prevent light or shadow leakage caused by the probe being inside the object structure or voxel, this application embodiment also includes a probe repositioning function. Based on this, the position is quantified, and position and transition information are saved to ensure a smooth and natural repositioning process. After repositioning, the probe color is reset to prevent light or shadow leakage.

[0270] In step 205, the light is traced.

[0271] In some embodiments, ray tracing is used to emit light rays on the hemisphere corresponding to the world space position of each pixel on the screen and obtain intersection information, and use the intersection information to solve for the initial indirect lighting result.

[0272] In some embodiments, after calculation by the ray tracing module, the indirect lighting result at each pixel location can be obtained. Before processing by the noise reduction module, it is a noisy indirect lighting result. For example, in the case of using RTX hardware ray tracing, for each pixel on the screen, initial rays are generated according to its material at its corresponding world space location. Then, ray tracing is performed to obtain intersection information, and the lighting result is obtained from the corresponding scene voxel structure.

[0273] In step 206, noise reduction is performed.

[0274] In some embodiments, the initial lighting results are full of noise and enter a noise reduction module. This module uses relevant spatiotemporal algorithms to eliminate noise, producing smooth and stable indirect lighting calculation results. Application projects or products can use this result to significantly improve their lighting rendering quality, thereby providing realistic visual effects.

[0275] In some embodiments, see Figure 14 , Figure 14 This is a flowchart illustrating the lighting update method for a virtual scene provided in an embodiment of this application. Figure 11 Step 206 shown can be achieved through Figure 14 Steps 2061 to 2069 shown are implemented.

[0276] In step 2061, the noisy lighting results are obtained.

[0277] In step 2062, ReSTIR time-domain multiplexing is performed.

[0278] In some embodiments, for noisy indirect lighting results, conventional ReSTIR temporal and spatial multiplexing is first performed to initially reduce noise. Note that to reduce computational load and meet real-time operation requirements, this embodiment does not perform any ray tracing visibility checks in these two steps. Without visibility checks, significant deviations are introduced, resulting in the output indirect lighting results showing a loss of high-frequency details, shadows, overall image contrast, and a loss of three-dimensionality compared to a physically correct reference standard. Furthermore, temporal multiplexing introduces a smaller deviation, while spatial multiplexing introduces a larger one.

[0279] A simplified example workflow is as follows: For each pixel on the screen, a noisy lighting result has been calculated, and the initial sampling point So obtained by the ray tracing module for that pixel is saved. After temporal multiplexing, the sampling point St that contributes the most to the current pixel is selected by combining the sampling information from previous historical frames. After spatial multiplexing, the sampling point Ss that contributes the most to the current pixel is selected by combining the sampling information from other pixels surrounding the current pixel. The indirect lighting result for that pixel can then be calculated based on these sampling points.

[0280] In step 2063, ReSTIR spatial domain multiplexing is performed.

[0281] In some embodiments, the noisy illumination result has been calculated for each pixel on the screen, and the initial sampling point So obtained by the ray tracing module for that pixel is saved. After temporal multiplexing, the sampling point St that contributes the most to the current pixel is selected by combining the sampling information of the previous historical frames of that pixel. After spatial multiplexing, the sampling point Ss that contributes the most to the current pixel is selected by combining the sampling information of other pixels around that pixel. The indirect illumination result of that pixel can be solved based on the sampling points.

[0282] In step 2064, visibility is detected.

[0283] In some embodiments, see Figure 15 , Figure 15 This is a flowchart illustrating the lighting update method for a virtual scene provided in an embodiment of this application. Figure 14 Step 2064 shown can be achieved through Figure 15 Steps 20641 to 20647 shown are implemented.

[0284] In step 20641, the spatial multiplexing result Ss is obtained.

[0285] In some embodiments, the input obtained is the sampled point Ss of the current pixel after spatial multiplexing.

[0286] In step 20642, light rays are emitted toward the sampling point Ss.

[0287] In some embodiments, in order to determine whether Ss is visible to the current pixel, a ray is emitted from the world space position corresponding to the current pixel to the sampling point Ss, and the visibility ray is determined by ray tracing to determine whether the ray is blocked.

[0288] In step 20643, it is determined whether the object is occluded.

[0289] In some embodiments, it can be determined whether the visible light is blocked by light tracing.

[0290] In step 20644, when the sampling point Ss is occluded, the marked sampling point is invalid.

[0291] In some embodiments, if the visible light is blocked, the light emitted from sampling point Ss cannot reach the current pixel, marking sampling point Ss as invalid, indicating a very large deviation in the spatial multiplexing result. To reduce the deviation, the spatial multiplexing result Ss is restored to the temporal multiplexing result St, which has a smaller deviation. Simultaneously, the occlusion distance Ot and occlusion direction Od of Ss are recorded.

[0292] In step 20645, when there is no occlusion, the sampling point Ss is marked as valid.

[0293] In some embodiments, if the visible light is not blocked, the marked sampling point Ss is valid, proving that the spatial multiplexing result will not produce excessive deviation.

[0294] In step 20646, the time-domain multiplexing result St is restored.

[0295] In some embodiments, in order to reduce bias, the spatial multiplexing result Ss is restored to the temporal multiplexing result St, and the temporal multiplexing result St has a smaller bias.

[0296] In step 20647, the occlusion distance Ot and the occlusion direction Od are saved.

[0297] In some embodiments, the occlusion distance Ot and occlusion direction Od of Ss can be recorded.

[0298] In step 2065, heuristic ReSTIR spatial multiplexing is performed.

[0299] In some embodiments, this application detects spatial multiplexing results with significant deviations and restores them to temporal multiplexing results. However, compared to spatial multiplexing, temporal multiplexing results have greater noise. To further eliminate noise, this application combines the results of the visibility inspection module and performs heuristic spatial multiplexing again. This step does not include additional ray tracing visibility inspection operations. Compared to the simple spatial multiplexing in 2063, it can preserve high-frequency details of indirect lighting, significantly improve the quality of indirect lighting, and make it closer to the physically correct reference result. The original spatial multiplexing process filters based on the differences in geometric parameters such as depth and normal values ​​between the current pixel and neighboring pixels, but it still struggles to preserve high-frequency details of indirect lighting.

[0300] In some embodiments, the first occlusion information described above refers to the occlusion determination 1 described below.

[0301] In some embodiments, the second occlusion information described above refers to the occlusion determination 2 described below.

[0302] In some embodiments, see Figure 16 , Figure 16 This is a flowchart illustrating the lighting update method for a virtual scene provided in an embodiment of this application. Let the center pixel be P, and a neighboring pixel of spatial reuse be Q. Heuristic spatial reuse, i.e., Figure 11 Step 2065 shown can be achieved through Figure 15 Steps 20651 to 20657 shown are implemented.

[0303] In step 20651, it is determined whether P is occluded.

[0304] In step 20652, when P is not occluded, it is determined whether Q is occluded.

[0305] In step 20653, when P is occluded, it is determined whether Q is occluded.

[0306] In step 20654, when P is occluded and Q is occluded, occlusion judgment 1 is performed.

[0307] In step 20655, acceptance is made when P is not occluded and Q is not occluded, or when occlusion judgment 1 (i.e., the first occlusion check described above) passes.

[0308] In step 20656, rejection is made when P is occluded and Q is not occluded, or when P is not occluded and Q is occluded.

[0309] In step 20657, if occlusion judgment 1 fails, occlusion judgment 2 (i.e., the second occlusion check described above) is performed.

[0310] In some embodiments, if neither point P nor point Q is occluded, then the neighborhood Q is accepted, meaning spatial reuse is performed between P and Q. If one of P and Q is occluded while the other is not, then the neighborhood Q is rejected, meaning spatial reuse is not performed between P and Q. When both P and Q are occluded, further occlusion determination is required. Let Pot be the occlusion distance of point P calculated in the visibility check module, Pod be the occlusion direction, Qot be the occlusion distance of point Q, Qod be the occlusion direction, Wp be the world space location of point P, and Sq be the illumination sampling point location of point Q. The distance from Wp to Sq is D, and the direction is L. Occlusion determination consists of two steps. First, occlusion determination 1 is performed. If Qot <= Pot and the dot product of Pod and L is less than a certain threshold a (a can be in the range of 0 to 1), then the occlusion determination is passed, and the neighborhood Q is accepted. Otherwise, proceed to occlusion judgment 2. If Pot > bD, meaning the occlusion distance of point P is greater than b times D, then the neighborhood Q is accepted through the occlusion judgment. b can be greater than 0, and generally, b = 1. If occlusion judgment 2 also fails, then the neighborhood Q is rejected. This heuristic neighborhood selection strategy can be directly applied to the basic spatial multiplexing process, constituting the heuristic spatial multiplexing method of this application embodiment, which can efficiently preserve indirect lighting and shadow details while reducing noise.

[0311] In step 2066, multisampling coloring is performed.

[0312] In some embodiments, after all the previous processing steps, each pixel has an optimal illumination sampling point after processing by the relevant algorithm. However, calculating the final indirect illumination result using only a resampled illumination sampling point will result in a large amount of color noise, as the previous noise reduction processes did not consider the color spectrum information of the illumination. This application embodiment uses multisampling shading calculation to solve this problem. For a pixel whose shading information needs to be calculated, the illumination calculation is performed by aligning the sampling results of other pixels within its small neighborhood. The calculation process can refer to standard algorithms, and the neighborhood range can be selected as 3*3, 5*5, 7*7, or other sizes. Let the pixel to be shading be P, and the neighboring pixels be Q. Assuming 9 neighboring pixels are selected, 9 standard spatial multiplexing operations are performed. Each time, the illumination sampling information of P is set to null before being reused with the illumination sampling information of Q. The indirect illumination R is calculated based on the reused result. The weighted average of the R obtained from the 9 calculations is the final indirect illumination calculation result for pixel P. This application does not impose specific limitations on the weighted averaging strategy. For example, uniform weighting can be chosen; that is, if 9 neighboring pixels are selected, the weight of the indirect illumination R calculated each time is 1 / 9. Furthermore, the multisampling shading module can also be used for resolution enhancement. All noise reduction processing prior to this module can be performed at a lower resolution, such as half-resolution, maintaining the resolution of the initial noisy illumination results. In the multisampling shading module, existing noise reduction results can be directly used to perform shading calculations on high-resolution screen pixel information, thereby achieving a rate of variation enhancement while preserving the material and geometric details of the high-resolution screen.

[0313] In step 2067, time-domain filtering is performed.

[0314] In step 2068, spatial filtering is performed.

[0315] In some embodiments, it is primarily used to eliminate remaining noise and provide a smooth and stable indirect lighting result after noise reduction.

[0316] In step 2069, noise-free lighting results are generated.

[0317] In step 207, the indirect lighting result is generated.

[0318] In some embodiments, see Figure 17 , Figure 17 This is a flowchart illustrating the lighting update method for a virtual scene provided in this application embodiment. The lighting update method for a virtual scene provided in this application embodiment can... Figure 17 Steps 301 to 306 shown are implemented. Figure 17 Steps 301 to 306 shown have a higher computational load compared to... Figure 11The computational load of steps 201 to 207 shown is small, and real-time dynamic global illumination can be implemented on mobile terminals. The following section... Figure 17 Steps 301 to 306 shown will be explained.

[0319] In step 301, the three-dimensional information of the scene is acquired.

[0320] In step 302, the scene color and depth are obtained from the viewpoint.

[0321] In step 303, the scene voxels are updated.

[0322] In step 304, a scene lighting probe system is generated.

[0323] In step 305, a screen space probe system is generated.

[0324] In some embodiments, to implement a global illumination scheme on a mobile device, this system uses a screen probe to collect indirect light. Step 305 above can be implemented as follows: Lightweight simplified delay pipeline: This system transforms the traditional forward pipeline commonly used in mobile devices into a lightweight simplified delay pipeline. That is, in the BasePass stage, in addition to screen color and screen depth, an R8G8B8A8 texture is output. The RGB channel stores the diffuse color, while the Alpha channel stores the compressed normal information. Since the precision of only eight bits of normal information is insufficient, grid-like defects will appear on the surface of the curved model. This system adds a small range of noise perturbation on the screen normal, thereby solving the grid defect problem. In actual implementation, one bit can be reserved in the B channel to store whether the 3D model is static or dynamic. This method can solve the problem of dynamic object ghosting that occurs when performing time supersampling algorithms without a velocity map. Screen Probe Generation: This system divides the screen space into 64*64 pixel grids, placing a screen probe in each grid. Probes are generated by interpolating the 3D probes. Each probe only needs to store indirect lighting information from the hemisphere facing the camera. Temporal oversampling is achieved by jittering the generated position of the screen probe. Screen Probe Acquisition: This system samples and interpolates the screen probes pixel-by-pixel at half resolution. A bilateral filter with depth and normal detection is used to obtain half-resolution indirect lighting. If a velocity map is generated in the rendering project, it can be overlaid for temporal oversampling; otherwise, screen probe acquisition can be skipped based on dynamic object markers, and 3D probes can be acquired directly. Indirect Light Upsampling: The half-resolution indirect lighting result is upsampled using a bilateral filter. Motion Glimmer Optimization: Due to the limited resolution of the screen probes, if none of the four probes around the rendering position pass depth and normal detection, the system will record this rendering position and generate an additional screen probe at this position in the next frame, thus avoiding motion lag caused by incorrect probe acquisition. The problem of motion blur caused by moving objects is solved by generating a screen probe before drawing the moving object.

[0325] In step 306, the indirect lighting result is generated.

[0326] Thus, for mobile devices, this application proposes an innovative screen space injection scheme and a screen probe system, which can control the performance consumption of dynamic global illumination within 4ms on high-end mobile devices, realizing the application of large-world dynamic global illumination on mobile devices. For PC devices, this application proposes an innovative voxel update scheme and a new noise reduction process, including innovative visibility inspection methods, heuristic spatial domain reuse, and multisampling shading. It can provide stable global illumination effects for highly dynamic rendering animations and provide high-precision indirect lighting and shadows.

[0327] It is understood that, in the embodiments of this application, data related to virtual scenes is involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0328] The following description continues to illustrate the exemplary structure of the virtual scene illumination update device 455 provided in the embodiments of this application as a software module. In some embodiments, such as... Figure 2 As shown, the software modules stored in the device 455 in the memory 450 may include: a voxelization module, used to acquire a target virtual scene and perform voxelization processing on the target virtual scene to obtain multiple initial voxels corresponding to the target virtual scene; wherein, different initial voxels are located at different positions in the target virtual scene, and the initial voxels carry the lighting information of the corresponding positions in the target virtual scene; a selection module, used to select at least one voxel to be updated from multiple initial voxels in response to changes in the content of the target virtual scene, wherein the number of voxels to be updated is less than the number of initial voxels; a voxel update module, used to update the lighting information carried by each voxel to be updated to obtain the updated voxel corresponding to each voxel to be updated; and a lighting update module, used to combine the updated voxel and the initial voxels other than the voxel to be updated from the multiple initial voxels to update the lighting information of each virtual viewpoint in the changed target virtual scene; wherein, a virtual viewpoint is a virtual scene point in the changed target virtual scene that can be captured by a virtual camera.

[0329] In some embodiments, the selection module is further configured to, in response to changes in the content of the virtual scene, obtain the camera position of the virtual camera in the changed virtual scene; obtain the voxel position of the voxel center point of each initial voxel in the virtual scene, and determine the voxel distance between the camera position and each voxel position; and, based on the voxel distance, select at least one voxel to be updated from multiple initial voxels.

[0330] In some embodiments, the selection module is further configured to: determine the initial voxel as a first initial voxel when the voxel distance of the initial voxel is less than or equal to a voxel distance threshold; determine the initial voxel as a second initial voxel when the voxel distance of the initial voxel is greater than the voxel distance threshold; select a first number of first initial voxels and a second number of second initial voxels from a plurality of initial voxels, and determine the selected first initial voxels and second initial voxels as voxels to be updated; wherein the first number is greater than the second number, and the first number is at least one.

[0331] In some embodiments, the voxel update module is further configured to perform the following processing for each voxel to be updated: determine multiple target virtual scene points located within the voxel to be updated from each virtual scene point in the virtual scene; obtain target lighting information of each target virtual scene point within the voxel to be updated, and perform weighted summation of each target lighting information to obtain updated lighting information; update the lighting information carried by the voxel to be updated to the updated lighting information to obtain the updated voxel corresponding to the voxel to be updated.

[0332] In some embodiments, the voxel update module is further configured to perform the following processing on each target virtual scene point within the voxel to be updated: obtaining the direct lighting information of the target virtual scene point, wherein the direct lighting information is used to indicate the lighting effect of the direct light emitted by the virtual light source on the target virtual scene point; obtaining the indirect lighting information of the target virtual scene point, wherein the indirect lighting information is used to indicate the lighting effect of the reflected light corresponding to the direct light on the target virtual scene point; and summing the direct lighting information and the indirect lighting information to obtain the target lighting information of the target virtual scene point.

[0333] In some embodiments, the direct lighting information includes direct lighting intensity. The voxel update module is further configured to determine the light source distance between the virtual light source in the virtual scene and the target virtual scene point; obtain the camera distance between the target virtual scene point and the virtual camera, and add the camera distance and the light source distance to obtain the total distance; determine the light source intensity loss value of the virtual light source based on the total distance and the target virtual scene point; and subtract the light source intensity from the loss value to obtain the direct lighting intensity of the target virtual scene point.

[0334] In some embodiments, the voxel update module is further configured to determine, from among a plurality of lighting probes deployed in the target virtual scene, at least one target lighting probe whose distance to a point in the target virtual scene is less than a distance threshold, wherein the lighting probe is used to store lighting information at the corresponding position in the changed virtual scene; when the number of target lighting probes is one, the lighting information stored in the target lighting probe is determined as the indirect lighting information of the target virtual scene point; when the number of target lighting probes is multiple, the weight of each target lighting probe is determined based on the probe distance between each target lighting probe and the target virtual scene point; and the lighting information stored in each target lighting probe is weighted and summed according to the weight to obtain the indirect lighting information of the target virtual scene point.

[0335] In some embodiments, the above-described virtual scene lighting update device further includes: a deployment module, configured to acquire the camera position of the virtual camera in the virtual scene; determine a virtual scene region in the virtual scene whose distance from the camera position is less than a distance threshold as a first virtual scene region, and determine a virtual scene region in the virtual scene whose distance from the camera position is greater than or equal to the distance threshold as a second virtual scene region; deploy a third number of lighting probes in the first virtual scene region, and deploy a fourth number of lighting probes in the second virtual scene region, wherein the third number is greater than the fourth number.

[0336] In some embodiments, the lighting update module described above is used to perform the following processes for each virtual viewpoint in the changed virtual scene: determine the target voxel where the virtual viewpoint is located from the updated voxel and the initial voxel other than the voxel to be updated, and obtain the lighting information of the target voxel; determine the lighting information of the target voxel as the updated lighting information of the virtual viewpoint; and update the lighting information of the virtual viewpoint to the updated lighting information of the virtual viewpoint.

[0337] In some embodiments, the above-mentioned lighting update device for virtual scenes further includes: a correction module, configured to perform the following processing on the updated lighting information after updating for each virtual viewpoint: perform spatial domain correction on the updated lighting information to obtain first lighting information, and perform temporal domain correction on the updated lighting information to obtain second lighting information; and combine the first lighting information and the second lighting information to perform error correction on the updated lighting information.

[0338] In some embodiments, the correction module is further configured to determine, from the updated voxels and the initial voxels other than the voxels to be updated, the target voxel where the virtual viewpoint is located, and a plurality of adjacent voxels adjacent to the target voxel; select the target adjacent voxel from the plurality of adjacent voxels; obtain the illumination information of the target voxel and the illumination information of each target adjacent voxel, and perform a weighted summation of the illumination information of the target voxel and the illumination information of each target adjacent voxel to obtain the first illumination information of the virtual viewpoint.

[0339] In some embodiments, the correction module is further configured to perform the following processing for each adjacent voxel: obtaining first occlusion information of the adjacent voxel and second occlusion information of the target voxel; when the first occlusion information indicates that there is no virtual object between the adjacent voxel and the virtual camera, and the second occlusion information indicates that there is no virtual object between the target voxel and the virtual camera, determining the adjacent voxel as the target adjacent voxel; when the first occlusion information indicates that there is a virtual object between the adjacent voxel and the virtual camera, and the second occlusion information indicates that there is a virtual object between the target voxel and the virtual camera, performing an occlusion check on the adjacent voxel and the target voxel to obtain an occlusion check result; when the occlusion check result indicates that the adjacent voxel and the target voxel pass the occlusion check, determining the adjacent voxel as the target adjacent voxel; when the first occlusion information indicates that there is a virtual object between the adjacent voxel and the virtual camera, or the second occlusion information indicates that there is a virtual object between the target voxel and the virtual camera, determining the adjacent voxel as a non-adjacent voxel.

[0340] In some embodiments, the correction module is further configured to: obtain a first distance between adjacent voxels and corresponding virtual objects, and a second distance between target voxels and corresponding virtual objects; perform a first occlusion check on adjacent voxels and target voxels based on the first and second distances to obtain a first occlusion check result; when the first occlusion check result indicates that adjacent voxels and target voxels have passed the first occlusion check, determine the occlusion check result as the first result; when the first occlusion check result indicates that adjacent voxels and target voxels have not passed the first occlusion check, obtain the distance between adjacent voxels and target voxels. A third distance is used, and based on the second and third distances, a second occlusion check is performed on the adjacent voxels and the target voxel to obtain a second occlusion check result. When the second occlusion check result indicates that the adjacent voxels and the target voxels have passed the second occlusion check, the occlusion check result is determined as the first result. When the second occlusion check result indicates that the adjacent voxels and the target voxels have not passed the second occlusion check, the occlusion check result is determined as the second result. The first result is used to indicate that the adjacent voxels and the target voxels have passed the occlusion check, and the second result is used to indicate that the adjacent voxels and the target voxels have not passed the occlusion check.

[0341] In some embodiments, the correction module is further configured to compare the first distance and the second distance to obtain a first comparison result; when the first comparison result indicates that the first distance is less than or equal to the second distance, and the dot product of the direction vector from the virtual viewpoint to the voxel center point of the target voxel and the direction vector from the target voxel to the corresponding virtual object is less than the dot product threshold, the first occlusion check result is determined as a third result; wherein, the third result is used to indicate that the adjacent voxel and the target voxel pass the first occlusion check.

[0342] In some embodiments, the correction module is further configured to compare the second distance and the third distance to obtain a second comparison result; when the second comparison result indicates that the second distance is greater than the third distance, the second occlusion check result is determined as a fourth result; wherein the fourth result is used to indicate that the adjacent voxel and the target voxel pass the second occlusion check.

[0343] In some embodiments, the correction module is further configured to: determine the target voxel where the virtual viewpoint is located from the updated voxel and the initial voxels other than the voxel to be updated; obtain the illumination information of the target voxel; determine the pixel corresponding to the virtual viewpoint; query multiple historical voxels of the pixel in the historical update process from multiple initial voxels; and obtain the illumination information of each historical voxel; and perform a weighted summation of the illumination information of the target voxel and the illumination information of each historical voxel to obtain the second illumination information of the virtual viewpoint.

[0344] In some embodiments, the above-mentioned correction module is further configured to perform a validity check on the first illumination information and obtain a check result; when the check result indicates that the first illumination information is invalid, the illumination information is updated and corrected to the second illumination information; when the check result indicates that the first illumination information is valid, the illumination information is updated and corrected to the first illumination information.

[0345] In some embodiments, the correction module is further configured to determine the target voxel where the virtual viewpoint is located from the updated voxel and the initial voxel other than the voxel to be updated; in the changed virtual scene, construct an inspection ray with the target voxel as the starting point and the virtual camera as the ending point; when the inspection ray intersects with a virtual object in the changed virtual scene, determine the inspection result as a first inspection result, wherein the first inspection result is used to indicate that the first lighting information is invalid; when the inspection ray does not intersect with a virtual object in the changed virtual scene, determine the inspection result as a second inspection result, wherein the second inspection result is used to indicate that the first lighting information is valid.

[0346] In some embodiments, the above-described virtual scene lighting update device further includes: performing the following processes for each virtual viewpoint in the changed virtual scene: obtaining the pixel corresponding to the virtual viewpoint in the imaging plane of the virtual camera; determining the viewpoint distance between the virtual camera and the virtual viewpoint, and determining the initial lighting information of the pixel by combining the viewpoint distance and the updated lighting information of the virtual viewpoint; determining at least one target screen probe from a plurality of screen probes deployed in the imaging plane whose distance to the pixel is less than a distance threshold; and performing a weighted summation of the lighting information stored in each target screen probe and the initial lighting information of the pixel to obtain the target lighting information of the pixel, wherein the target lighting information of the pixel is used for rendering the image on the imaging plane of the virtual camera.

[0347] This application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the virtual scene lighting update method described above in this application.

[0348] This application provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are executed by a processor, they cause the processor to execute the virtual scene lighting update method provided in this application. For example, ... Figure 3 The method for updating the lighting in a virtual scene is shown.

[0349] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of electronic devices including one or any combination of the above-mentioned memories.

[0350] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.

[0351] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., a file that stores one or more modules, subroutines, or code sections).

[0352] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.

[0353] In summary, the embodiments of this application have the following beneficial effects:

[0354] (1) By voxelizing the target virtual scene, multiple initial voxels corresponding to the target virtual scene are obtained. In response to changes in the content of the target virtual scene, at least one voxel to be updated is selected from the multiple initial voxels. The lighting information carried by each voxel to be updated is updated. Combining the updated voxel and the initial voxels other than the voxel to be updated from the multiple initial voxels, the lighting information of each virtual viewpoint in the changed target virtual scene is updated. In this way, at least one voxel to be updated is selected from multiple initial voxels in response to changes in the content of the virtual scene. Since the number of voxels to be updated is less than the number of initial voxels, the number of voxels to be updated is effectively reduced, thereby effectively reducing the update cost and effectively improving the lighting update efficiency of the virtual scene.

[0355] (2) By responding to changes in the content of the virtual scene, at least one voxel to be updated is selected from multiple initial voxels. Since the number of voxels to be updated is less than the number of initial voxels, the number of voxels to be updated is effectively reduced, thereby effectively reducing the update cost and effectively improving the lighting update efficiency of the virtual scene.

[0356] (3) Select a first number of first initial voxels and a second number of second initial voxels from multiple initial voxels, and determine the selected first initial voxels and second initial voxels as voxels to be updated. Since the first number is greater than the second number, the number of second initial voxels that are farther away from the virtual camera is less than the number of first initial voxels that are closer to the virtual camera. Since the first initial voxels that are closer to the virtual camera are more likely to include the virtual viewpoint, selecting more first initial voxels can effectively ensure that the lighting information of the virtual viewpoint is updated, effectively ensuring the accuracy of the lighting update of the virtual viewpoint, thereby effectively improving the accuracy of the lighting update.

[0357] (4) By determining the loss value of the light intensity of the light source along the light path, the direct light intensity of the target virtual scene point can be accurately determined, which is convenient to combine with the indirect light intensity to accurately determine the target lighting information of the target virtual scene point, thereby effectively improving the lighting accuracy of the virtual scene.

[0358] (5) From multiple lighting probes deployed in the target virtual scene, at least one target lighting probe whose distance to the target virtual scene point is less than a distance threshold is determined, and the weight corresponding to each target lighting probe is determined. According to the weight, the lighting information stored in each target lighting probe is weighted and summed to obtain the indirect lighting intensity of the target virtual scene point. Since the lighting information stored in the target lighting probe can accurately reflect the lighting information of the corresponding position in the changed virtual scene, and the target lighting probe is relatively close to the target virtual scene point, it can more accurately reflect the actual indirect lighting of the target virtual scene point. By weighting and summing the lighting information of multiple target lighting probes, the lighting information of multiple target lighting probes is integrated, so that the determined indirect lighting intensity can more accurately reflect the lighting in the changed virtual scene, effectively improving the accuracy of the determined indirect lighting intensity.

[0359] (6) Since the number of virtual viewpoints (virtual scene points that can be captured by the virtual camera) in the first virtual scene area is greater than the number of virtual viewpoints in the second virtual scene area, more lighting probes can be deployed in the first virtual scene area to effectively ensure the lighting accuracy of the first virtual scene area. Deploying a small number of lighting probes in the second virtual scene area can save the number of lighting probes deployed while ensuring the lighting accuracy of the second virtual scene area, thereby effectively saving storage space and effectively improving the lighting update efficiency of the virtual scene.

[0360] (7) By updating some initial voxels (voxels to be updated) in the virtual scene, the updated voxels corresponding to each voxel to be updated are obtained, thereby effectively reducing the number of voxels to be updated and thus effectively reducing the update cost, which can effectively improve the lighting update efficiency of the virtual scene. At the same time, by deploying lighting probes, the indirect lighting information of the voxels to be updated can be accurately determined, and by calculating the loss value of the light intensity of the light source, the direct lighting information of the voxels to be updated can be accurately determined. By summing the direct lighting information and the indirect lighting information, the obtained updated lighting information is more accurate, which effectively improves the accuracy of the determined updated lighting information.

[0361] (8) By determining the target voxel where each virtual viewpoint is located, the lighting information of the target voxel is determined as the updated lighting information of the virtual viewpoint. When the target voxel is the voxel to be updated, due to the accuracy of the updated lighting information of the voxel to be updated, the updated lighting information of the virtual viewpoint is determined as the updated lighting information of the virtual viewpoint, making the updated lighting information of the virtual viewpoint more accurate.

[0362] (9) By selecting a target neighboring voxel from multiple neighboring voxels adjacent to the target voxel, and by performing spatial correction on the updated lighting information of the target voxel through the target neighboring voxel, the obtained first lighting information is more accurate, and the updated lighting information of the virtual viewpoint is more accurate.

[0363] (10) By performing a first occlusion check on the adjacent voxel and the target voxel, the first occlusion check result is obtained. When the first occlusion check result indicates that the target voxel and the adjacent voxel have passed the first occlusion check, the adjacent voxel is identified as the target adjacent voxel. The target adjacent voxel is determined by the contribution of the illumination information of the adjacent voxel to the accuracy of the target voxel. The target adjacent voxel is used to perform spatial correction on the updated illumination information of the target voxel, so that the obtained first illumination information is more accurate and the updated illumination information of the virtual viewpoint is more accurate.

[0364] (11) By performing a first occlusion check on the adjacent voxels and the target voxel, the first occlusion check result is obtained. When the first occlusion check result indicates that the target voxel and the adjacent voxel have not passed the first occlusion check, the second occlusion check is performed. The target adjacent voxel is determined by the contribution of the illumination information of the adjacent voxel to the accuracy of the target voxel. The target adjacent voxel is used to perform spatial correction on the updated illumination information of the target voxel, so that the obtained first illumination information is more accurate and the updated illumination information of the virtual viewpoint is more accurate.

[0365] (12) By determining the pixel corresponding to the virtual viewpoint and querying multiple historical voxels of the pixel in the historical update process from multiple initial voxels, and combining the historical voxels corresponding to each update within the update time domain, the update lighting information is temporally corrected to obtain the second lighting information, thereby effectively correcting the error of the update lighting information, making the obtained second lighting information more accurate, and making the update lighting information of the virtual viewpoint more accurate.

[0366] (13) The accuracy of the second illumination information is greater than that of the updated illumination information. The accuracy of the first illumination information is greater than that of the updated illumination information. The first illumination information mainly eliminates the spatial error of the updated illumination information, while the second illumination information mainly eliminates the temporal error of the updated illumination information. By combining the first and second illumination information to correct the error of the updated illumination information, the updated illumination information after error correction can eliminate both the spatial error and the temporal error of the updated illumination information, thus making the updated illumination information after error correction more accurate.

[0367] (14) On the mobile end: This application proposes an innovative screen space injection scheme and a screen probe system, which can control the performance consumption of dynamic global illumination within 4ms on high-end mobile devices, realizing the application of large-world dynamic global illumination on mobile devices. On the PC end: This application proposes an innovative voxel update scheme and a new noise reduction process, including innovative visibility inspection methods, heuristic spatial reuse, and multi-sampling color finding. It can provide stable global illumination effects for highly dynamic rendering animations and provide high-precision indirect lighting and shadows.

[0368] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A method for updating lighting in a virtual scene, characterized in that, The method includes: The virtual scene is voxelized to obtain multiple initial voxels corresponding to the virtual scene; The different initial voxels are located in different positions in the virtual scene, and each initial voxel carries the lighting information of the corresponding position in the virtual scene. In response to changes in the content of the virtual scene, the camera position of the virtual camera in the changed virtual scene is obtained; Obtain the voxel center point of each initial voxel in the virtual scene, and determine the voxel distance between the camera position and each voxel position. Based on the voxel distance, at least one voxel to be updated is selected from the plurality of initial voxels, wherein the number of voxels to be updated is less than the number of initial voxels; The illumination information carried by each of the voxels to be updated is updated to obtain the updated voxels corresponding to each of the voxels to be updated. By combining the updated voxel and the initial voxels other than the voxel to be updated among the plurality of initial voxels, the lighting information of each virtual viewpoint in the changed virtual scene is updated. The virtual viewpoint refers to a virtual scene point in the changed virtual scene that can be captured by the virtual camera of the virtual scene.

2. The method according to claim 1, characterized in that, The step of selecting at least one voxel to be updated from the plurality of initial voxels based on the voxel distance includes: When the voxel distance of the initial voxel is less than or equal to the voxel distance threshold, the initial voxel is determined as the first initial voxel; When the voxel distance of the initial voxel is greater than the voxel distance threshold, the initial voxel is determined as the second initial voxel; From the plurality of initial voxels, a first number of first initial voxels and a second number of second initial voxels are selected, and the selected first initial voxels and second initial voxels are determined as the voxels to be updated. Wherein, the first quantity is greater than the second quantity, and the first quantity is at least one.

3. The method according to claim 1, characterized in that, The step of updating the illumination information carried by each of the voxels to be updated to obtain the updated voxels corresponding to each of the voxels to be updated includes: Perform the following processing on each of the voxels to be updated: From each virtual scene point in the virtual scene, determine multiple target virtual scene points located within the voxel to be updated; Obtain the target lighting information of each target virtual scene point within the voxel to be updated, and perform a weighted summation of the target lighting information to obtain the updated lighting information; The illumination information carried by the voxel to be updated is updated with the updated illumination information to obtain the updated voxel corresponding to the voxel to be updated.

4. The method according to claim 3, characterized in that, The step of obtaining the target lighting information of each target virtual scene point within the voxel to be updated includes: For each of the target virtual scene points within the voxel to be updated, the following processing is performed: obtain the direct lighting information of the target virtual scene point, wherein the direct lighting information is used to indicate the lighting effect of the direct light emitted by the virtual light source on the target virtual scene point; Obtain indirect lighting information of the target virtual scene point, wherein the indirect lighting information is used to indicate the lighting effect of the reflected light corresponding to the direct light on the target virtual scene point; The target lighting information of the target virtual scene point is obtained by summing the direct lighting information and the indirect lighting information.

5. The method according to claim 4, characterized in that, The direct lighting information includes direct lighting intensity, and obtaining the direct lighting information of the target virtual scene point includes: Determine the distance between the virtual light source in the virtual scene and the target virtual scene point; Obtain the camera distance between the target virtual scene point and the virtual camera, and add the camera distance and the light source distance to obtain the total distance; Based on the total distance and the target virtual scene point, determine the loss value of the light intensity of the virtual light source; Subtracting the light intensity of the light source from the loss value yields the direct light intensity of the target virtual scene point.

6. The method according to claim 4, characterized in that, The indirect lighting information includes indirect lighting intensity, and obtaining the indirect lighting information of the target virtual scene point includes: From a plurality of lighting probes deployed in the virtual scene, at least one target lighting probe is determined whose distance to the target virtual scene point is less than a distance threshold, wherein the lighting probe is used to store the lighting intensity at the corresponding position in the changed virtual scene. When the number of target lighting probes is one, the lighting intensity stored in the target lighting probe is determined as the indirect lighting intensity of the target virtual scene point; When there are multiple target lighting probes, the weight of each target lighting probe is determined based on the probe distance between each target lighting probe and the target virtual scene point. According to the weights, the light intensities stored in each of the target lighting probes are weighted and summed to obtain the indirect lighting intensity of the target virtual scene point.

7. The method according to claim 6, characterized in that, Before determining, from among the plurality of lighting probes deployed in the virtual scene, at least one target lighting probe whose distance to the target virtual scene point is less than a distance threshold, the method further includes: Obtain the camera position of the virtual camera in the virtual scene; The virtual scene regions in the virtual scene whose distance from the camera position is less than a distance threshold are defined as the first virtual scene regions, and the virtual scene regions in the virtual scene whose distance from the camera position is greater than or equal to the distance threshold are defined as the second virtual scene regions. In the first virtual scene area, a third number of the light probes are deployed, and in the second virtual scene area, a fourth number of the light probes are deployed, wherein the third number is greater than the fourth number.

8. The method according to claim 1, characterized in that, The step of updating the lighting information of each virtual viewpoint in the changed virtual scene by combining the updated voxel and the initial voxels other than the voxel to be updated from the plurality of initial voxels includes: Perform the following processing on each virtual viewpoint in the changed virtual scene: From the updated voxel and the initial voxels other than the voxel to be updated, determine the target voxel where the virtual viewpoint is located, and obtain the lighting information of the target voxel; The illumination information of the target voxel is determined as the updated illumination information of the virtual viewpoint; Update the lighting information of the virtual viewpoint to the updated lighting information of the virtual viewpoint.

9. The method according to claim 1, characterized in that, After updating the lighting information of each virtual viewpoint in the changed virtual scene by combining the updated voxel and the initial voxels other than the voxel to be updated from the plurality of initial voxels, the method further includes: The following processing is performed on the updated lighting information for each virtual viewpoint: The updated illumination information is spatially corrected to obtain first illumination information, and the updated illumination information is temporally corrected to obtain second illumination information. By combining the first illumination information and the second illumination information, error correction is performed on the updated illumination information.

10. The method according to claim 9, characterized in that, The step of spatially correcting the updated illumination information to obtain the first illumination information includes: From the updated voxel and the initial voxels other than the voxel to be updated, determine the target voxel where the virtual viewpoint is located, as well as a plurality of adjacent voxels adjacent to the target voxel; Select the target neighboring voxel from the plurality of neighboring voxels; The illumination information of the target voxel and the illumination information of each of the target neighboring voxels are obtained, and the illumination information of the target voxel and the illumination information of each of the target neighboring voxels are weighted and summed to obtain the first illumination information of the virtual viewpoint.

11. The method according to claim 10, characterized in that, The step of selecting a target neighboring voxel from the plurality of neighboring voxels includes: The following processing is performed on each of the adjacent voxels: Obtain the first occlusion information of the adjacent voxel and the second occlusion information of the target voxel; When the first occlusion information indicates that there is no virtual object between the adjacent voxel and the virtual camera, and the second occlusion information indicates that there is no virtual object between the target voxel and the virtual camera, the adjacent voxel is determined as the target adjacent voxel; When the first occlusion information indicates that there is a virtual object between the adjacent voxel and the virtual camera, and the second occlusion information indicates that there is a virtual object between the target voxel and the virtual camera, an occlusion check is performed on the adjacent voxel and the target voxel to obtain the occlusion check result. When the occlusion check result indicates that the adjacent voxel and the target voxel have passed the occlusion check, the adjacent voxel is identified as the target adjacent voxel; When the first occlusion information indicates that there is a virtual object between the adjacent voxel and the virtual camera, or when the second occlusion information indicates that there is a virtual object between the target voxel and the virtual camera, the adjacent voxel is determined to be a non-adjacent voxel.

12. The method according to claim 11, characterized in that, The occlusion check on the adjacent voxels and the target voxel to obtain the occlusion check result includes: Obtain the first distance between the adjacent voxel and the corresponding virtual object, and the second distance between the target voxel and the corresponding virtual object; Based on the first distance and the second distance, a first occlusion check is performed on the adjacent voxel and the target voxel to obtain the first occlusion check result. When the first occlusion check result indicates that the adjacent voxel and the target voxel have passed the first occlusion check, the occlusion check result is determined as the first result; When the first occlusion check result indicates that the adjacent voxel and the target voxel have not passed the first occlusion check, the third distance between the adjacent voxel and the target voxel is obtained, and based on the second distance and the third distance, a second occlusion check is performed on the adjacent voxel and the target voxel to obtain the second occlusion check result. When the second occlusion check result indicates that the adjacent voxel and the target voxel have passed the second occlusion check, the occlusion check result is determined as the first result; When the second occlusion check result indicates that the adjacent voxel and the target voxel have not passed the second occlusion check, the occlusion check result is determined as the second result; Wherein, the first result is used to indicate that the adjacent voxel and the target voxel have passed the occlusion check, and the second result is used to indicate that the adjacent voxel and the target voxel have not passed the occlusion check.

13. The method according to claim 12, characterized in that, The first occlusion check is performed on the adjacent voxel and the target voxel based on the first distance and the second distance to obtain the first occlusion check result, including: The first distance and the second distance are compared to obtain a first comparison result; When the first comparison result indicates that the first distance is less than or equal to the second distance, and the dot product of the direction vector from the virtual viewpoint to the voxel center point of the target voxel and the direction vector from the target voxel to the corresponding virtual object is less than the dot product threshold, the first occlusion check result is determined as the third result; wherein, the third result is used to indicate that the adjacent voxel and the target voxel pass the first occlusion check.

14. The method according to claim 12, characterized in that, The second occlusion check is performed on the adjacent voxels and the target voxels based on the second distance and the third distance to obtain the second occlusion check result, including: The second distance and the third distance are compared to obtain a second comparison result; When the second comparison result indicates that the second distance is greater than the third distance, the second occlusion check result is determined as the fourth result; wherein, the fourth result is used to indicate that the adjacent voxel and the target voxel pass the second occlusion check.

15. The method according to claim 9, characterized in that, The step of performing temporal correction on the updated illumination information to obtain second illumination information includes: From the updated voxels and the initial voxels other than the voxel to be updated, determine the target voxel where the virtual viewpoint is located, and obtain the lighting information of the target voxel; determine the pixel corresponding to the virtual viewpoint, and from the multiple initial voxels, query multiple historical voxels of the pixel in the historical update process, and obtain the lighting information of each historical voxel. The second lighting information of the virtual viewpoint is obtained by weighted summing of the lighting information of the target voxel and the lighting information of each historical voxel.

16. The method according to claim 9, characterized in that, The step of combining the first illumination information and the second illumination information to perform error correction on the updated illumination information includes: The validity of the first illumination information is checked, and the check result is obtained. When the inspection result indicates that the first illumination information is invalid, the updated illumination information is corrected to the second illumination information; When the inspection result indicates that the first illumination information is valid, the updated illumination information is corrected to the first illumination information.

17. The method according to claim 16, characterized in that, The validity check of the first illumination information, and the resulting check, includes: The target voxel where the virtual viewpoint is located is determined from the updated voxel and the initial voxels other than the voxel to be updated; In the altered virtual scene, an inspection ray is constructed, starting from the target voxel and ending at the virtual camera. When the inspection ray intersects with a virtual object in the changed virtual scene, the inspection result is determined as the first inspection result, wherein the first inspection result is used to indicate that the first lighting information is invalid; When the inspection ray does not intersect with the virtual object in the changed virtual scene, the inspection result is determined as the second inspection result, wherein the second inspection result is used to indicate that the first lighting information is valid.

18. The method according to claim 1, characterized in that, After updating the lighting information of each virtual viewpoint in the changed virtual scene by combining the updated voxel and the initial voxels other than the voxel to be updated from the plurality of initial voxels, the method further includes: For each virtual viewpoint in the modified virtual scene, the following processing is performed: Obtain the pixel point corresponding to the virtual viewpoint in the imaging plane of the virtual camera; Determine the viewpoint distance between the virtual camera and the virtual viewpoint, and combine the viewpoint distance with the updated lighting information of the virtual viewpoint to determine the initial lighting information of the pixel. From a plurality of screen probes deployed in the imaging plane, at least one target screen probe is determined whose distance to the pixel is less than a distance threshold. The screen probe is used to store illumination information at the corresponding position in the imaging plane. The target illumination information of each pixel is obtained by weighted summing the illumination information stored in each target screen probe and the initial illumination information of the pixel. The target illumination information of the pixel is used to render the image on the imaging plane of the virtual camera.

19. A lighting update device for a virtual scene, characterized in that, The device includes: A voxelization module is used to perform voxelization processing on a virtual scene to obtain multiple initial voxels corresponding to the virtual scene; wherein, different initial voxels are located in different positions in the virtual scene, and the initial voxels carry the lighting information of the corresponding positions in the virtual scene. A selection module is configured to, in response to changes in the content of the virtual scene, obtain the camera position of the virtual camera in the changed virtual scene; obtain the voxel center point of each initial voxel in the virtual scene, and determine the voxel distance between the camera position and each voxel position; based on the voxel distance, select at least one voxel to be updated from the plurality of initial voxels, wherein the number of voxels to be updated is less than the number of initial voxels; The voxel update module is used to update the illumination information carried by each of the voxels to be updated, so as to obtain the updated voxels corresponding to each of the voxels to be updated. The lighting update module is used to update the lighting information of each virtual viewpoint in the changed virtual scene by combining the updated voxel and the initial voxels other than the voxel to be updated from the plurality of initial voxels; wherein, the virtual viewpoint is a virtual scene point in the changed virtual scene that can be captured by the virtual camera of the virtual scene.

20. The apparatus according to claim 19, characterized in that, The selection module is further configured to determine the initial voxel as a first initial voxel when the voxel distance of the initial voxel is less than or equal to a voxel distance threshold; and to determine the initial voxel as a second initial voxel when the voxel distance of the initial voxel is greater than the voxel distance threshold. From the plurality of initial voxels, a first number of first initial voxels and a second number of second initial voxels are selected, and the selected first initial voxels and second initial voxels are determined as the voxels to be updated; wherein, the first number is greater than the second number, and the first number is at least one.

21. The apparatus according to claim 19, characterized in that, The voxel update module is further configured to perform the following processing on each of the voxels to be updated: determine multiple target virtual scene points located within the voxel to be updated from each virtual scene point of the virtual scene; obtain the target lighting information of each target virtual scene point within the voxel to be updated, and perform a weighted summation of the target lighting information to obtain the updated lighting information; The illumination information carried by the voxel to be updated is updated with the updated illumination information to obtain the updated voxel corresponding to the voxel to be updated.

22. The apparatus according to claim 21, characterized in that, The voxel update module is further configured to perform the following processing on each of the target virtual scene points within the voxel to be updated: obtaining the direct lighting information of the target virtual scene point, wherein the direct lighting information is used to indicate the lighting effect of direct light emitted by a virtual light source on the target virtual scene point; obtaining the indirect lighting information of the target virtual scene point, wherein the indirect lighting information is used to indicate the lighting effect of reflected light corresponding to the direct light on the target virtual scene point; and summing the direct lighting information and the indirect lighting information to obtain the target lighting information of the target virtual scene point.

23. The apparatus according to claim 22, characterized in that, The direct illumination information includes the direct illumination intensity. The voxel update module is further configured to determine the light source distance between the virtual light source in the virtual scene and the target virtual scene point; obtain the camera distance between the target virtual scene point and the virtual camera, and add the camera distance and the light source distance to obtain the total distance; and determine the light source intensity loss value of the virtual light source based on the total distance and the target virtual scene point. Subtracting the light intensity of the light source from the loss value yields the direct light intensity of the target virtual scene point.

24. The apparatus according to claim 22, characterized in that, The indirect illumination information includes indirect illumination intensity. The voxel update module is further configured to determine, from among multiple lighting probes deployed in the virtual scene, at least one target lighting probe whose distance to the target virtual scene point is less than a distance threshold, wherein the lighting probe is used to store the lighting intensity at the corresponding position in the changed virtual scene; when the number of target lighting probes is one, the lighting intensity stored in the target lighting probe is determined as the indirect lighting intensity of the target virtual scene point; when the number of target lighting probes is multiple, the weight of each target lighting probe is determined based on the probe distance between each target lighting probe and the target virtual scene point; and the lighting intensities stored in each target lighting probe are weighted and summed according to the weights to obtain the indirect lighting intensity of the target virtual scene point.

25. The apparatus according to claim 24, characterized in that, The device further includes: A deployment module is used to obtain the camera position of the virtual camera in the virtual scene; to determine the virtual scene area where the distance from the camera position is less than a distance threshold as a first virtual scene area, and to determine the virtual scene area where the distance from the camera position is greater than or equal to the distance threshold as a second virtual scene area; to deploy a third number of light probes in the first virtual scene area, and to deploy a fourth number of light probes in the second virtual scene area, wherein the third number is greater than the fourth number.

26. The apparatus according to claim 19, characterized in that, The lighting update module is further configured to perform the following processing for each virtual viewpoint in the changed virtual scene: determine the target voxel where the virtual viewpoint is located from the updated voxel and the initial voxels other than the voxel to be updated, and obtain the lighting information of the target voxel; determine the lighting information of the target voxel as the updated lighting information of the virtual viewpoint; and update the lighting information of the virtual viewpoint to the updated lighting information of the virtual viewpoint.

27. The apparatus according to claim 19, characterized in that, The device further includes: The correction module is used to perform the following processing on the updated lighting information after updating each of the virtual viewpoints: perform spatial domain correction on the updated lighting information to obtain first lighting information, and perform temporal domain correction on the updated lighting information to obtain second lighting information; and combine the first lighting information and the second lighting information to perform error correction on the updated lighting information.

28. The apparatus according to claim 27, characterized in that, The correction module is further configured to determine, from the updated voxel and the initial voxels excluding the voxel to be updated, the target voxel where the virtual viewpoint is located, and a plurality of adjacent voxels adjacent to the target voxel; select a target adjacent voxel from the plurality of adjacent voxels; obtain the illumination information of the target voxel and the illumination information of each target adjacent voxel, and perform a weighted summation of the illumination information of the target voxel and the illumination information of each target adjacent voxel to obtain the first illumination information of the virtual viewpoint.

29. The apparatus according to claim 28, characterized in that, The correction module is further configured to perform the following processing for each of the adjacent voxels: obtain first occlusion information of the adjacent voxel and second occlusion information of the target voxel; when the first occlusion information indicates that there is no virtual object between the adjacent voxel and the virtual camera, and the second occlusion information indicates that there is no virtual object between the target voxel and the virtual camera, the adjacent voxel is determined as the target adjacent voxel; When the first occlusion information indicates that there is a virtual object between the adjacent voxel and the virtual camera, and the second occlusion information indicates that there is a virtual object between the target voxel and the virtual camera, an occlusion check is performed on the adjacent voxel and the target voxel to obtain the occlusion check result. When the occlusion check result indicates that the adjacent voxel and the target voxel have passed the occlusion check, the adjacent voxel is identified as the target adjacent voxel; When the first occlusion information indicates that there is a virtual object between the adjacent voxel and the virtual camera, or when the second occlusion information indicates that there is a virtual object between the target voxel and the virtual camera, the adjacent voxel is determined to be a non-adjacent voxel.

30. The apparatus according to claim 29, characterized in that, The correction module is further configured to obtain a first distance between the adjacent voxel and the corresponding virtual object, and a second distance between the target voxel and the corresponding virtual object; based on the first distance and the second distance, perform a first occlusion check on the adjacent voxel and the target voxel to obtain a first occlusion check result; When the first occlusion check result indicates that the adjacent voxel and the target voxel have passed the first occlusion check, the occlusion check result is determined as the first result; When the first occlusion check result indicates that the adjacent voxel and the target voxel have not passed the first occlusion check, the third distance between the adjacent voxel and the target voxel is obtained, and based on the second distance and the third distance, a second occlusion check is performed on the adjacent voxel and the target voxel to obtain the second occlusion check result. When the second occlusion check result indicates that the adjacent voxel and the target voxel have passed the second occlusion check, the occlusion check result is determined as the first result; When the second occlusion check result indicates that the adjacent voxel and the target voxel have not passed the second occlusion check, the occlusion check result is determined as the second result; wherein, the first result is used to indicate that the adjacent voxel and the target voxel have passed the occlusion check, and the second result is used to indicate that the adjacent voxel and the target voxel have not passed the occlusion check.

31. The apparatus according to claim 30, characterized in that, The correction module is further configured to compare the first distance and the second distance to obtain a first comparison result; when the first comparison result indicates that the first distance is less than or equal to the second distance, and the dot product of the direction vector from the virtual viewpoint to the voxel center point of the target voxel and the direction vector from the target voxel to the corresponding virtual object is less than the dot product threshold, the first occlusion check result is determined as a third result; wherein, the third result is used to indicate that the adjacent voxel and the target voxel pass the first occlusion check.

32. The apparatus according to claim 30, characterized in that, The correction module is further configured to compare the second distance and the third distance to obtain a second comparison result; when the second comparison result indicates that the second distance is greater than the third distance, the second occlusion check result is determined as a fourth result; wherein the fourth result is used to indicate that the adjacent voxel and the target voxel pass the second occlusion check.

33. The apparatus according to claim 27, characterized in that, The correction module is further configured to: determine the target voxel where the virtual viewpoint is located from the updated voxel and the initial voxels other than the voxel to be updated; obtain the lighting information of the target voxel; determine the pixel corresponding to the virtual viewpoint; query multiple historical voxels of the pixel in the historical update process from the multiple initial voxels; and obtain the lighting information of each historical voxel; and perform a weighted summation of the lighting information of the target voxel and the lighting information of each historical voxel to obtain the second lighting information of the virtual viewpoint.

34. The apparatus according to claim 27, characterized in that, The correction module is further configured to perform a validity check on the first illumination information and obtain a check result; when the check result indicates that the first illumination information is invalid, the updated illumination information is corrected to the second illumination information. When the inspection result indicates that the first illumination information is valid, the updated illumination information is corrected to the first illumination information.

35. The apparatus according to claim 34, characterized in that, The correction module is further configured to determine the target voxel where the virtual viewpoint is located from the updated voxel and the initial voxels other than the voxel to be updated; in the changed virtual scene, construct an inspection ray with the target voxel as the starting point and the virtual camera as the ending point; when the inspection ray intersects with a virtual object in the changed virtual scene, determine the inspection result as a first inspection result, wherein the first inspection result is used to indicate that the first lighting information is invalid; when the inspection ray does not intersect with a virtual object in the changed virtual scene, determine the inspection result as a second inspection result, wherein the second inspection result is used to indicate that the first lighting information is valid.

36. An electronic device, characterized in that, The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the lighting update method for a virtual scene as described in any one of claims 1 to 18.

37. A computer-readable storage medium storing computer-executable instructions, characterized in that, When the computer-executable instructions are executed by the processor, they implement the lighting update method for the virtual scene according to any one of claims 1 to 18.

38. A computer program product comprising a computer program or computer-executable instructions, characterized in that, When the computer program or computer-executable instructions are executed by a processor, the lighting update method for the virtual scene according to any one of claims 1 to 18 is implemented.