Illumination update method and apparatus for virtual scene, electronic device, computer readable storage medium, and computer program product

By voxelizing the virtual scene and selecting voxels to be updated, the problem of low lighting update efficiency in the prior art is solved, and more efficient and accurate lighting update is achieved.

WO2024193219A9PCT designated stage expired Publication Date: 2024-11-07TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/073461
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-21
Filing Date
2024-01-22
Publication Date
2024-11-07

AI Technical Summary

Technical Problem

The high-frequency indirect lighting information restored by screen space occlusion technology in the prior art leads to low lighting update efficiency in virtual scenes.

Method used

By voxelizing the virtual scene, multiple initial voxels are obtained, and in response to content changes, at least one voxel to be updated is selected from the multiple initial voxels, and their lighting information is updated, combining the update voxels and Other initial voxels update the lighting information of the virtual viewpoint.

Benefits of technology

It effectively reduces the number of voxels to be updated, reduces the update cost, and improves the lighting update efficiency and accuracy of virtual scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024073461_07112024_PF_FP_ABST
    Figure CN2024073461_07112024_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an illumination update method and apparatus for a virtual scene, an electronic device, a computer readable storage medium, and a computer program product. The method comprises: performing voxelization processing on a virtual scene to obtain a plurality of initial voxels corresponding to the virtual scene; in response to a change in the content of the virtual scene, selecting 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; updating illumination information carried by each voxel to be updated, to obtain updated voxels corresponding to each voxel to be updated; and according to the updated voxels and initial voxels among the plurality of initial voxels other than the voxel to be updated, updating illumination information of virtual viewpoints in the virtual scene of which the content changes, wherein the virtual viewpoints are virtual scene points, which can be captured by a virtual camera, in the virtual scene of which the content changes.
Need to check novelty before this filing date? Find Prior Art

Description

Method, device, electronic device, computer-readable storage medium, and computer program product for updating illumination of virtual scenes

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application is based on the Chinese patent application with application number 2023103186815 and application date March 21, 2023, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this application as a reference. Technical Field

[0003] The present application relates to the field of computer technology, and in particular to a method, device, electronic device, computer-readable storage medium, and computer program product for updating lighting of a virtual scene. Background Art

[0004] With the development of multimedia technology, the variety of games has increased, and their features have become increasingly rich. To provide players with a more realistic gaming experience, technical personnel are committed to improving the sophistication of game graphics. For example, technical personnel improve the realism of lighting in game graphics to enhance the overall sophistication of game graphics.

[0005] In related technologies, high-frequency indirect lighting information restored by screen space occlusion technology requires comprehensive lighting updates for the entire virtual scene, resulting in low lighting update efficiency for the virtual scene.

[0006] Summary of the Invention

[0007] Embodiments of the present application provide a method, device, electronic device, computer-readable storage medium, and computer program product for updating the lighting of a virtual scene, which can effectively improve the efficiency of updating the lighting of the virtual scene.

[0008] The technical solution of the embodiment of the present application is implemented as follows:

[0009] The present invention provides a method for updating the lighting of a virtual scene, including:

[0010] Performing voxel processing on the virtual scene to obtain a plurality of initial voxels corresponding to the virtual scene;

[0011] Wherein, different initial voxels have different positions in the virtual scene, and the initial voxels carry lighting information of corresponding positions in the virtual scene;

[0012] In response to a change in content in the virtual scene, selecting at least one voxel to be updated from the plurality of initial voxels, wherein the number of the voxels to be updated is less than the number of the initial voxels;

[0013] Updating the illumination information carried by each of the to-be-updated voxels to obtain updated voxels corresponding to each of the to-be-updated voxels;

[0014] updating illumination information of each virtual viewpoint in the virtual scene after content change by combining the updated voxel and the initial voxels among the plurality of initial voxels except the voxel to be updated;

[0015] The virtual viewpoint is a virtual scene point that can be captured by a virtual camera in the virtual scene after the content changes.

[0016] An embodiment of the present application provides a lighting update device for a virtual scene, comprising:

[0017] a voxelization module configured to perform voxelization processing on the virtual scene to obtain a plurality of initial voxels corresponding to the virtual scene; wherein different initial voxels have different positions in the virtual scene, and the initial voxels carry lighting information of corresponding positions in the virtual scene;

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

[0019] a voxel updating module configured to update the illumination information carried by each of the voxels to be updated, and obtain updated voxels corresponding to each of the voxels to be updated;

[0020] The lighting update module is configured to update the lighting information of each virtual viewpoint in the virtual scene after the content changes, combining the updated voxel and the initial voxels among the multiple initial voxels except the voxel to be updated; wherein the virtual viewpoint is a virtual scene point in the virtual scene after the content changes that can be captured by the virtual camera.

[0021] An embodiment of the present application provides an electronic device, including:

[0022] a memory configured to store computer-executable instructions or computer programs;

[0023] The processor is configured to implement the lighting update method of the virtual scene provided in the embodiment of the present application when executing the computer executable instructions or computer program stored in the memory.

[0024] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions configured to cause a processor to execute instructions to implement the virtual scene lighting update method provided in the embodiment of the present application.

[0025] Embodiments of the present application provide a computer program product, comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. A 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 in the embodiments of the present application.

[0026] The embodiments of the present application have the following beneficial effects:

[0027] By performing voxelization on the virtual scene, a plurality of initial voxels corresponding to the virtual scene are obtained. In response to changes in the content of the virtual scene, at least one voxel to be updated is selected from the plurality of initial voxels, and the lighting information carried by each voxel to be updated is updated. The updated voxel and initial voxels other than the voxel to be updated in the plurality of initial voxels are combined to update the lighting information of each virtual viewpoint in the changed virtual scene. In this way, by selecting at least one voxel to be updated from the plurality of initial voxels in response to changes in the content of the virtual scene, the number of voxels to be updated is effectively reduced, as the number of voxels to be updated is smaller than the number of initial voxels, thereby effectively reducing the number of voxels to be updated, thereby effectively reducing the update cost, and effectively improving the lighting update efficiency of the virtual scene. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] FIG1 is a schematic diagram of the architecture of a lighting update system for a virtual scene provided in an embodiment of the present application;

[0029] FIG2 is a schematic structural diagram of an electronic device for updating illumination of a virtual scene provided by an embodiment of the present application;

[0030] FIG3 is a flowchart of a method for updating the lighting of a virtual scene according to an embodiment of the present application;

[0031] FIG4 is a second flow chart of a method for updating illumination of a virtual scene according to an embodiment of the present application;

[0032] FIG5 is a third flow chart of a method for updating illumination of a virtual scene provided in an embodiment of the present application;

[0033] FIG6 is a fourth flow chart of a method for updating illumination of a virtual scene according to an embodiment of the present application;

[0034] FIG7 is a fifth flow chart of a method for updating illumination of a virtual scene provided in an embodiment of the present application;

[0035] FIG8 is a sixth flow chart of a method for updating illumination of a virtual scene provided in an embodiment of the present application;

[0036] FIG9 is a seventh flow chart of a method for updating illumination of a virtual scene according to an embodiment of the present application;

[0037] FIG10 is a schematic diagram of the rendering effect of the lighting update method for a virtual scene provided in an embodiment of the present application;

[0038] FIG11 is a flowchart of an eighth method for updating illumination of a virtual scene according to an embodiment of the present application;

[0039] FIG12 is a ninth flowchart of a method for updating illumination of a virtual scene according to an embodiment of the present application;

[0040] FIG13 is a schematic diagram of the principle of the starting point provided in an embodiment of the present application;

[0041] FIG14 is a flowchart diagram 10 of a method for updating illumination of a virtual scene provided in an embodiment of the present application;

[0042] FIG15 is a flowchart of a method for updating illumination of a virtual scene according to an embodiment of the present application;

[0043] FIG16 is a flowchart diagram 12 of a method for updating illumination of a virtual scene provided in an embodiment of the present application;

[0044] FIG17 is a flowchart diagram thirteen of the lighting update method for a virtual scene provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to make the purpose, 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 limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0046] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be 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.

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

[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0049] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0050] 1) Camera Model: This describes the process of mapping coordinate points in a 3D world coordinate system to a 2D image plane. It serves as the link between 3D spatial points and 2D plane points. Camera models include at least the pinhole camera model and the fisheye camera model. For example, the pinhole camera model 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.

[0051] 2) Virtual scene: This is a virtual scene displayed or provided when the application is running on the terminal. The virtual scene can be a simulation of the real world, a semi-simulation and semi-fictitious virtual environment, or a purely fictitious virtual environment. The virtual scene can be any of a two-dimensional virtual scene, a 2.5-dimensional virtual scene, or a three-dimensional virtual scene. The embodiments of the present application do not limit the dimensions of the virtual scene. For example, the virtual scene can include the sky, land, ocean, etc. The land can include environmental elements such as deserts and cities, and users can control virtual objects to move in the virtual scene.

[0052] 3) Virtual Objects: Images of various people and objects that can interact in a virtual scene, or movable objects in a virtual scene. These movable objects can be virtual people, virtual animals, animated characters, etc., such as people, animals, plants, oil drums, walls, rocks, etc. displayed in a virtual scene. A virtual object can be a virtual avatar in the virtual scene that represents the user. 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 operations, an artificial intelligence (AI) trained to play in a virtual scene, or a non-player character (NPC) set up for virtual scene interaction. Optionally, the virtual object can be a virtual character that engages in adversarial interaction in 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 participating in the interaction.

[0053] 4) Virtual objects: These refer to objects that are moving or 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.

[0054] 5) Virtual light: refers to the light in the virtual scene emitted by the virtual light source used to illuminate the virtual scene. Virtual light includes direct light and indirect light. Among them, direct light is the virtual light emitted by the virtual light source, reflected from the virtual illumination point to the virtual camera, and indirect light is the virtual light emitted by the virtual light source, reflected at least once, to the virtual illumination point, and finally reflected from the virtual illumination point to the virtual camera.

[0055] 6) Irradiance: Also known as radiant illumination, it is the radiation flux per unit area of ​​the illuminated surface. The unit is watt per square meter (W / ㎡). The radiant illumination characterizes the amount of radiation energy received per unit area per unit time on the surface illuminated by the radiation energy, that is, the radiation flux density on the illuminated surface.

[0056] 7) Virtual camera: It is a "camera" set up in computer animation software or virtual engine. The role of virtual camera in expressing viewpoint during animation is equivalent to that of traditional camera. The shooting objects of virtual camera and physical camera are completely different, but the functions are extremely similar. Physical camera shoots real people or actually built scenes, while virtual camera shoots models built in 3D software, which can realize infinite possibilities. Virtual camera is presented in the form of icon in virtual engine, and also has parameters such as lens, focal length, focus, aperture, depth of field, etc. It can realize camera actions such as "push, pull, shake, move, follow, swing, rise, fall, and comprehensive movement", and can achieve shooting effects that are difficult or even impossible to achieve with physical camera, such as: passing through walls, through keyholes, through objects, etc. The parameters that need to be adjusted for physical camera are distributed on the body of physical camera and require manual operation. The camera parameters of the virtual camera are buttons or numerical input bars integrated on the panel. The operator only needs to input the parameters or drag the mouse. Sometimes a few key frames can determine the motion path of the virtual camera. In actual shooting, physical cameras often require a stabilizer or motion control system. Even so, the shaking of the picture still exists.

[0057] 8) Virtual Engine: A virtual engine refers to some already-written editable computer virtual systems or core components of some interactive real-time graphics applications. These systems provide virtual scene designers with various tools needed to write virtual scenes. The purpose is to enable designers to write programs easily and quickly. Virtual engines include rendering engines (rendering engines include two-dimensional rendering engines and three-dimensional rendering engines), physics engines, collision detection engines, sound engines, script engines, animation engines, artificial intelligence engines, network engines, and scene management engines.

[0058] 9) Virtual light source: It is a "light source" set up in computer animation software or virtual engines. The role of virtual light source in expressing viewpoints in animation production is equivalent to the physical light source in the traditional sense. The objects illuminated by virtual light source and physical light source are completely different, but the functions are extremely similar. Physical light source illuminates real-life characters or actually built scenes, while virtual light source illuminates models built in 3D software, which can realize unlimited possibilities.

[0059] During the implementation of the embodiments of this application, the applicant discovered that the related technology has the following problems:

[0060] In related technologies, high-frequency indirect lighting information restored by screen space occlusion technology requires comprehensive lighting updates for the entire virtual scene, resulting in low lighting update efficiency for the virtual scene.

[0061] Embodiments of the present application provide a method, device, electronic device, computer-readable storage medium, and computer program product for updating the lighting of a virtual scene, which can effectively improve the efficiency of updating the lighting of the virtual scene. The following describes an exemplary application of the lighting update system for the virtual scene provided by the embodiments of the present application.

[0062] See Figure 1, which is a schematic diagram of the architecture of a lighting update system 100 for a virtual scene provided in an embodiment of the present application. The terminal (terminal 400 is shown as an example) is connected to the server 200 through a network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.

[0063] The terminal 400 is used for the user to use the client 410 and display a virtual scene on a graphical interface 410-1 (graphic interface 410-1 is shown as an example). The terminal 400 and the server 200 are connected to each other via a wired or wireless network.

[0064] In some embodiments, the server 200 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal 400 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart TV, a smart watch, a car terminal, etc., but is not limited to this. The electronic device provided in the embodiment of the present application can be implemented as a terminal or as a server. The terminal and the server can be directly or indirectly connected by wired or wireless communication, which is not limited in the embodiment of the present application.

[0065] In some embodiments, the terminal 400 sends the virtual scene to the server 200, the server 200 performs voxelization on the virtual scene to obtain multiple initial voxels, and in response to changes in the content of the virtual scene, 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 updated voxels corresponding to each voxel to be updated, and updates the lighting information of each virtual viewpoint in the changed virtual scene.

[0066] In other embodiments, the server 200 performs voxelization on the virtual scene to obtain multiple initial voxels corresponding to the virtual scene. In response to changes in the content of the virtual scene, at least one voxel to be updated is selected from the multiple initial voxels, and the voxel to be updated is sent to the terminal 400. The terminal 400 updates the lighting information carried by each voxel to be updated, obtains updated voxels corresponding to each voxel to be updated, and updates the lighting information of each virtual viewpoint in the changed virtual scene.

[0067] In some embodiments, the terminal 400 sends the virtual scene to the server 200, the server 200 performs voxelization on the virtual scene to obtain multiple initial voxels, and in response to changes in the content of the virtual scene, 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 updated voxels corresponding to each voxel to be updated, and updates the lighting information of each virtual viewpoint in the changed virtual scene.

[0068] In other embodiments, the embodiments of the present application can be implemented with the help of cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network within a wide area network or local area network to realize data calculation, storage, processing, and sharing.

[0069] Cloud technology is a general term for network, information, integration, management platform, and application technologies used in the cloud computing business model. It can form a resource pool that can be used flexibly and conveniently on demand. Cloud computing technology will become a key support. The backend services of technical network systems require a large amount of computing and storage resources.

[0070] Referring to Figure 2, Figure 2 is a schematic diagram of the structure of an electronic device 500 for updating the lighting of a virtual scene provided in an embodiment of the present application, wherein the electronic device 500 shown in Figure 2 can be the server 200 or the terminal 400 in Figure 1, and the electronic device 500 shown in Figure 2 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 through a bus system 440. It can be understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, various buses are labeled as bus system 440 in Figure 2.

[0071] The 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., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

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

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

[0074] In some embodiments, the memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.

[0075] Operating system 451, including system programs for processing various basic application embodiment services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0076] The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include Bluetooth, Wireless Fidelity (WiFi), and Universal Serial Bus (USB).

[0077] In some embodiments, the virtual scene lighting update device provided in embodiments of the present application can be implemented using software. FIG2 shows a virtual scene lighting update device 455 stored in memory 450. This device can be software in the form of a program or plug-in, and includes the following software modules: a voxelization module 4551, a selection module 4552, a voxel update module 4553, and a lighting update module 4554. These modules are logical and can be arbitrarily combined or further separated according to the functions implemented. The functions of each module will be described below.

[0078] In other embodiments, the lighting update device for the virtual scene provided in the embodiments of the present application can be implemented in hardware. As an example, the lighting update device for the virtual scene provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the lighting update method for the virtual scene provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt 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.

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

[0080] The lighting update method for the virtual scene provided by the embodiment of the present application will be explained in combination with the exemplary application and implementation of the server or terminal provided by the embodiment of the present application.

[0081] Refer to Figure 3, which is a flow chart of the first method for updating the lighting of a virtual scene provided in an embodiment of the present application. It will be explained in conjunction with steps 101 to 104 shown in Figure 3. The method for updating the lighting of a virtual scene provided in an embodiment of the present application can be implemented separately by the server or the terminal, or jointly by the server and the terminal. The following will be explained using the example of the terminal being implemented separately.

[0082] In step 101 , a voxelization process is performed on the virtual scene to obtain a plurality of initial voxels corresponding to the virtual scene.

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

[0084] In some embodiments, a virtual scene is a virtual scene displayed or provided when an application is running on a terminal. The virtual scene can be a simulation of the real world, a semi-simulation and semi-fictitious virtual environment, or a purely fictitious virtual environment. The virtual scene can be any of a two-dimensional virtual scene, a 2.5-dimensional virtual scene, or a three-dimensional virtual scene. The embodiments of the present application do not limit the dimensions of the virtual scene. For example, the virtual scene can include the sky, land, ocean, etc., and the land can include environmental elements such as deserts and cities. The user can control virtual objects to move in the virtual scene.

[0085] In some embodiments, voxelization refers to a process of dividing a virtual scene into a plurality of initial voxels. The initial voxels carry lighting information of corresponding positions in the virtual scene, and different initial voxels have different positions in the virtual scene.

[0086] In some embodiments, the above step 101 can be implemented as follows: divide the virtual scene into multiple virtual scene blocks, each virtual scene block has a different position in the virtual scene, and the size of each virtual scene block can be the same or different, obtain virtual scene information corresponding to each virtual scene block, the virtual scene information includes virtual scene color, virtual scene diffuse reflection information, direct lighting information, etc., assign corresponding virtual scene information to each virtual scene block, and obtain the initial voxel corresponding to the virtual scene block.

[0087] In some embodiments, face elements are represented by voxels with normal information to simplify the description of the three-dimensional scene. First, a rectangular space centered on the camera is maintained, and voxels are used to simplify the description of the three-dimensional scene information in this space. The voxel content includes: normal, diffuse reflection color, direct lighting information, and radiant brightness information. In order to reduce memory consumption, the embodiment of the present application uses a hierarchical manner to sparsely store voxels, and regards 4*4*4 voxels as a group, which is called a brick. The hierarchical index is represented by an n*m*k three-dimensional map. If a brick contains voxels, its actual storage location can be obtained through the hierarchical index; if the value obtained by the hierarchical index is 0, it means that the brick does not contain voxels, which can greatly save video memory space.

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

[0089] In some embodiments, the number of voxels to be updated is less than the number of 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.

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

[0091] In some embodiments, the duration of the change of the content in the virtual scene can be determined according to the actual change situation. The duration of the change of the content in the virtual scene can be the time interval from the start of the change to the stop of the change.

[0092] As an example, virtual object A in the virtual scene starts to move at twelve minutes and ten seconds, that is, the content of the virtual scene changes from twelve minutes and ten seconds. During the movement, virtual object A starts from position B and moves to position C. The time it takes to move to position C is fourteen minutes and twenty seconds, that is, from fourteen minutes and twenty seconds on, the content of the virtual scene stops changing.

[0093] In some embodiments, in the process of selecting at least one voxel to be updated from multiple initial voxels, the number of selected actions is positively correlated with the duration of the content change of the virtual scene. For example, if the duration of the content change of 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 multiple initial voxels per second. The longer the duration of the content change of the virtual scene, the more voxels to be updated are selected.

[0094] In some embodiments, the change in the content in the virtual scene can be the movement of the virtual light source in the virtual scene. The light source position and the light intensity of the virtual light source can change in the virtual scene at different time points. For example, the virtual light source D moves from position E to position F in the virtual scene. In the process of moving from position E to position F, the content in the virtual scene changes. For another example, the content in the virtual scene changes in the process of the light intensity of the virtual light source changing from weak to strong or from strong to weak.

[0095] In some embodiments, the above-mentioned step 102 is explained below by taking the selection of a voxel as an example, referring to FIG4 , which is a second flow chart of the lighting update method of the virtual scene provided in an embodiment of the present application. Step 102 shown in FIG4 can be implemented by steps 1021 to 1023 shown in FIG4 .

[0096] In step 1021 , in response to a change in content in the virtual scene, a camera position of the virtual camera in the virtual scene after the content change is obtained.

[0097] In some embodiments, a virtual camera is a "camera" set up in computer animation software or a virtual engine. The role of a virtual camera in expressing viewpoints during animation is equivalent to that of a traditional camera. The virtual camera and the physical camera shoot completely different objects, but their functions are extremely similar. A physical camera shoots real people or actually built scenes, while a virtual camera shoots models built in three-dimensional software, which can achieve 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 achieve camera actions such as "push, pull, shake, move, follow, swing, rise, fall, and comprehensive movement", and can achieve shooting effects that are difficult or even impossible to achieve with a physical camera, such as: passing through walls, through keyholes, through objects, etc. The parameters that need to be adjusted for the physical camera are distributed on the body of the physical camera and require manual operation. The camera parameters of the virtual camera are buttons or numerical input bars integrated on the panel. The operator only needs to input the parameters or drag the mouse. Sometimes a few key frames can determine the motion path of the virtual camera. In actual shooting, physical cameras often require a stabilizer or motion control system. Even so, the shaking of the picture still exists.

[0098] In some embodiments, the camera position is used to indicate the position coordinates of the virtual camera in the virtual scene after the content changes. When the virtual scene is a two-dimensional virtual scene, the position coordinates are two-dimensional position coordinates. When the virtual scene is a three-dimensional virtual scene, the position coordinates are three-dimensional position coordinates.

[0099] As an example, the camera position of the virtual camera in the virtual scene is position G, and the camera position of the virtual camera in the virtual scene after the content changes is position H, which means that the virtual camera has a positional offset in the virtual scene before and after the position change. The camera position of the virtual camera in the virtual scene is position G, and the camera position of the virtual camera in the virtual scene after the content changes is position G, which means that the virtual camera has not a positional offset in the virtual scene before and after the position change.

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

[0101] In some embodiments, the voxel position of the voxel center point of the initial voxel in the virtual scene 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. When the virtual scene is a three-dimensional virtual scene, the position coordinates are three-dimensional position coordinates.

[0102] 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 method for calculating voxel distance does not constitute a limitation of this application. The voxel distance is used to indicate the distance between the voxel center point of the initial voxel and the virtual camera.

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

[0104] In some embodiments, the smaller the voxel distance of an initial voxel is, the greater the probability of being selected as the voxel to be updated, and the size of the voxel distance is proportional to the size of the probability value of being selected as the voxel to be updated.

[0105] In some embodiments, the above-mentioned step 1023 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 multiple 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.

[0106] In some embodiments, the first number is greater than the second number, the first number is at least one, and since the first number is greater than the second number and the first number is at least one, the second number is at least zero.

[0107] In some embodiments, the voxel distance threshold can be specifically set according to the actual scene, and the voxel distance threshold is less than the maximum voxel distance. The 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.

[0108] In this way, a first number of first initial voxels and a second number of second initial voxels are selected from multiple initial voxels, and the selected first initial voxels and second initial voxels are determined as voxels to be updated. Since the selected first number is greater than the second number, the number of selected second initial voxels farther away from the virtual camera is smaller than the number of first initial voxels closer to the virtual camera. Since the first initial voxels closer to the virtual camera are more likely to include virtual viewpoints, selecting more first initial voxels can effectively ensure that the lighting information of subsequent virtual viewpoints is updated, effectively ensure the accuracy of the lighting update of the virtual viewpoint, and thus effectively improve the accuracy of the lighting update.

[0109] As an example, when the number of initial 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 selected first number can be 3, and the selected second number can be 1.

[0110] As an example, when the number of initial 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 selected first number can be 1, and the selected second number can be 0.

[0111] In this way, by selecting at least one voxel to be updated from multiple initial voxels in response to changes in the content of the virtual scene, the number of voxels to be updated is smaller than the number of initial voxels. This effectively reduces the number of voxels to be updated, thereby effectively reducing the update cost and improving the lighting update efficiency of the virtual scene.

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

[0113] In some embodiments, step 103 may be implemented as follows: performing the following processing on each voxel to be updated: updating the illumination information of the corresponding position of the virtual scene carried by the voxel to be updated, and obtaining an updated voxel corresponding to the voxel to be updated.

[0114] In some embodiments, referring to FIG5 , FIG5 is a flowchart diagram three of the lighting update method for a virtual scene provided in an embodiment of the present application. Step 103 shown in FIG3 can be implemented by executing steps 1031 to 1034 shown in FIG5 for each voxel to be updated.

[0115] In step 1031 , a plurality of target virtual scene points located within the voxel to be updated are determined from the virtual scene points of the virtual scene.

[0116] In some embodiments, a virtual scene point refers to the smallest component unit in a virtual scene. The virtual scene is composed of multiple virtual scene points, and different virtual scene points have different positions in the virtual scene.

[0117] In some embodiments, the above-mentioned step 1031 can be implemented as follows: the following processing is performed for each virtual scene point in the virtual scene: the scene point position of the virtual scene point in the virtual scene is compared with the voxel position range of the voxel to be updated in the virtual scene; when the scene point position is within the voxel position range, the virtual scene point is determined as the target virtual scene point.

[0118] As an example, the scene point position of the virtual scene point in the virtual scene is (0.2, 5), and the voxel position range of the voxel to be updated in the virtual scene is a horizontal coordinate between 0 and 1, and a vertical coordinate between 4 and 6. Then the scene point position is between the voxel position range, and the virtual scene point is determined as the target virtual scene point.

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

[0120] In some embodiments, target illumination information is used to indicate the intensity or irradiance of the light reflected at the target virtual scene point. Illumination intensity refers to the amount of visible light received per unit area. Also referred to as illuminance, it is measured in lux (Lux). It indicates the intensity of light and the degree to which an object's surface area is illuminated. Radiance, also known as irradiance, is the amount of radiant flux per unit area of ​​the illuminated surface, measured in watts per square meter (W / ㎡).

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

[0122] 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.

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

[0124] As an example, the target illumination information of the target virtual scene point can be expressed as: G = G1 + G2 (1)

[0125] Among them, G is used to indicate the target lighting information of the target virtual scene point, G1 is used to indicate the direct lighting information of the target virtual scene point, and G2 is used to indicate the indirect lighting information of the target virtual scene point.

[0126] 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.

[0127] In some embodiments, the above-mentioned direct lighting information includes direct lighting intensity. The above-mentioned acquisition of direct lighting information of the target virtual scene point can be achieved in the following manner: determining the light source distance between the virtual light source in the virtual scene and the target virtual scene point; obtaining 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; based on the total distance and the target virtual scene point, determining the loss value of the light source lighting intensity of the virtual light source; subtracting the light source lighting intensity and the loss value to obtain the direct lighting intensity of the target virtual scene point.

[0128] In some embodiments, the loss value of the light source illumination intensity of the above-mentioned virtual light source refers to the loss of light source illumination intensity of the virtual light sent by the virtual light source during the light propagation from the virtual light source to the target virtual scene point and from the target virtual scene point to the virtual camera.

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

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

[0131] In some embodiments, the light path includes a first subpath starting from a virtual light source and ending at a target virtual scene point in the virtual scene, and a second subpath starting from the target virtual scene point and ending at a virtual camera.

[0132] In some embodiments, the above-mentioned determination of the first loss value of the virtual light source based on the total distance can be achieved by obtaining the unit loss value of the light source illumination intensity of the virtual light source per unit distance, and determining the product of the total distance and the unit loss value as the first loss value.

[0133] In some embodiments, the above-mentioned determination of the second loss value of the virtual light source based on the target virtual scene point can be achieved in the following manner: obtaining the absorption rate of the target virtual scene point to the light source illumination intensity of the virtual light source, and determining the product of the absorption rate and the light source illumination intensity as the second loss value, and the absorption rate is associated with the physical material indicated by the target virtual scene point.

[0134] In this way, by determining the loss value of the light source illumination intensity on the light path, the direct illumination intensity of the target virtual scene point can be accurately determined, which is convenient for subsequent combination with the indirect illumination intensity to accurately determine the target illumination information of the target virtual scene point, thereby effectively improving the illumination accuracy of the virtual scene.

[0135] In some embodiments, the above-mentioned indirect lighting information includes indirect lighting intensity. The above-mentioned acquisition of indirect lighting information of the target virtual scene point can be achieved in the following manner: from multiple lighting probes arranged in the virtual scene, determine at least one target lighting probe whose distance to the target virtual scene point is less than a distance threshold; when the number of target lighting probes is one, determine the lighting intensity stored in the target lighting probe as the indirect lighting intensity of the target virtual scene point; when the number of target lighting probes is multiple, determine the weight of each target lighting probe based on the probe distance between each target lighting probe and the target virtual scene point; according to the weight, perform weighted summation on the lighting intensities stored in each target lighting probe to obtain the indirect lighting intensity of the target virtual scene point.

[0136] In some embodiments, the light probe is used to store the light intensity at a corresponding position in the virtual scene after the content changes.

[0137] In some embodiments, light probes store "baked" information about lighting in a virtual scene. Lightmaps store information about lighting that hits surfaces of virtual objects in the virtual scene, but light probes store information about light that passes through empty space in the virtual scene.

[0138] In some embodiments, the probe distance is inversely proportional to the target light probe weight. A larger probe distance corresponds to a smaller target light probe weight, while a smaller probe distance corresponds to a larger target light probe weight. The sum of the target light probe weights equals 1.

[0139] As an example, when there are multiple target light probes, for example, target light probe 1, target light probe 2 and target light probe 3, the probe distance corresponding to target light probe 1 is 3, the probe distance corresponding to target light probe 2 is 4, and the probe distance corresponding to target light probe 3 is 5. The probe weight corresponding to target light probe 1 is 0.2, the probe weight corresponding to target light probe 2 is 0.3, and the probe weight corresponding to target light probe 3 is 0.5.

[0140] In this way, at least one target lighting probe whose distance from the target virtual scene point is less than a distance threshold is determined from multiple lighting probes deployed in the virtual scene, and the weights corresponding to each target lighting probe are determined. According to the weights, 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 virtual scene after the content changes, 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 weighted 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 indirect lighting in the virtual scene after the content changes, effectively improving the accuracy of the determined indirect lighting intensity.

[0141] 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 multiple lighting probes deployed in the virtual scene, the lighting probes can also be deployed in the following manner: obtaining the camera position of the virtual camera in the virtual scene; determining the virtual scene area in the virtual scene whose distance to the camera position is less than the distance threshold as the first virtual scene area, and determining the virtual scene area in the virtual scene whose distance to the camera position is greater than or equal to the distance threshold as the 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.

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

[0143] In some embodiments, the distance threshold may be specifically set according to actual conditions, and the distance threshold is used to divide the virtual scene into at least two virtual scene areas.

[0144] As an example, in the first virtual scene area, 20 light probes are laid out, and in the second virtual scene area, 15 light probes are laid out.

[0145] In this way, 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 are deployed in the first virtual scene area, which can effectively ensure the lighting accuracy of the first virtual scene area, and a small number of lighting probes are deployed in the second virtual scene area. While ensuring the lighting accuracy of the second virtual scene area, the number of deployed lighting probes can be saved, thereby effectively saving storage space and effectively improving the lighting update efficiency of the virtual scene.

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

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

[0148] In step 1034 , the illumination information carried by the voxel to be updated is updated to the updated illumination information, and an updated voxel corresponding to the voxel to be updated is obtained.

[0149] In some embodiments, step 1034 may be implemented as follows: replacing the illumination information carried by the to-be-updated voxel with the updated illumination information, and determining the replaced to-be-updated voxel as the updated voxel corresponding to the to-be-updated voxel.

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

[0151] In step 104 , the lighting information of each virtual viewpoint in the virtual scene after the content change is updated by combining the updated voxel and the initial voxels in the plurality of initial voxels except the voxel to be updated.

[0152] In some embodiments, the virtual viewpoint is a virtual scene point that can be captured by a virtual camera in the virtual scene after the content changes.

[0153] In some embodiments, the above-mentioned updating of the lighting information of each virtual viewpoint in the virtual scene after the content changes is a processing process of updating the lighting information of each virtual viewpoint in the virtual scene after the content changes by combining the updated lighting information of the updated voxel and the lighting information of the initial voxels other than the voxels to be updated in multiple initial voxels.

[0154] In some embodiments, referring to FIG6 , FIG6 is a flow chart diagram four of the lighting update method for a virtual scene provided in an embodiment of the present application. Step 104 shown in FIG3 can be implemented by executing steps 1041 to 1043 shown in FIG6 for each virtual viewpoint in the virtual scene after the content changes.

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

[0156] In some embodiments, the above-mentioned determination of the target voxel where the virtual viewpoint is located from the updated voxels and the initial voxels other than the voxels to be updated can be achieved as follows: the viewpoint position of the virtual viewpoint in the virtual scene is compared with the position ranges corresponding to the updated voxels and the initial voxels other than the voxels to be updated, and the voxel corresponding to the position range where the viewpoint position is located is determined as the target voxel.

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

[0158] In some embodiments, the above step 1042 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.

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

[0160] In this way, 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 voxel to be updated is determined as the updated lighting information of the virtual viewpoint, so that the updated lighting information of the virtual viewpoint is more accurate.

[0161] In some embodiments, referring to FIG. 7 , FIG. 7 is a flowchart diagram five of the lighting update method for a virtual scene provided in an embodiment of the present application. After step 104 above, the updated lighting information can also be corrected through steps 105 to 107 shown in FIG. 7 .

[0162] In step 105 , spatial domain correction is performed on the updated illumination information to obtain first illumination information.

[0163] In some embodiments, spatial correction refers to the process of performing error correction on the updated lighting information of the target voxel in combination with the voxels in the scene space of the virtual scene other than the target voxel corresponding to the virtual viewpoint, where the accuracy of the first lighting information is greater than the accuracy of the updated lighting information.

[0164] In some embodiments, step 105 can be implemented as follows: determining a target voxel where the virtual viewpoint is located and a plurality of adjacent voxels adjacent to the target voxel from the update voxels and the initial voxels excluding the voxel to be updated. Selecting the target adjacent voxel from the plurality of adjacent voxels. Obtaining illumination information for the target voxel and illumination information for each target adjacent voxel. Performing a weighted summation of the illumination information for the target voxel and the illumination information for each target adjacent voxel to obtain first illumination information for the virtual viewpoint.

[0165] In some embodiments, a target voxel where the virtual viewpoint is located and a plurality of adjacent voxels adjacent to the target voxel are determined from the update voxels and the initial voxels except the voxels to be updated.

[0166] In some embodiments, the above-mentioned determination of the target voxel where the virtual viewpoint is located from the updated voxels and the initial voxels other than the voxels to be updated can be achieved as follows: the viewpoint position of the virtual viewpoint in the virtual scene is compared with the position ranges corresponding to the updated voxels and the initial voxels other than the voxels to be updated, and the voxel corresponding to the position range where the voxel position is located is determined as the target voxel.

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

[0168] In some embodiments, a target adjacent voxel is selected from a plurality of adjacent voxels.

[0169] In some embodiments, the above-mentioned selection of the target adjacent voxel from multiple adjacent voxels can be achieved as follows: performing 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.

[0170] 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, and 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.

[0171] In some embodiments, when the first occlusion information of an adjacent voxel indicates that there is no virtual object between the adjacent voxel and the virtual camera, it means that there is no virtual occluder between the adjacent voxel and the virtual camera, and the virtual scene point on the adjacent voxel has a greater possibility of being captured by the virtual camera (as long as there is at least one virtual viewpoint 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 occluder between the target voxel and the virtual camera, and the virtual scene point on the target voxel has a greater possibility of being captured by the virtual camera (as long as there is at least one virtual viewpoint among the multiple virtual scene points on the target voxel, that is, as long as there is at least one virtual scene point that can be illuminated by direct light or indirect light among the multiple virtual scene points on the target voxel). Then, 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 the adjacent voxels corresponding to the target voxel are more likely to be captured by the virtual camera, and then the adjacent voxel can be determined as the target adjacent voxel.

[0172] 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 the adjacent voxels corresponding to the target voxel have a small possibility of being captured by the virtual camera, then it is necessary to perform an occlusion check on the adjacent voxel and the target voxel, and when the occlusion check result indicates that the adjacent voxel and the target voxel pass the occlusion check, the adjacent voxel is determined as the target adjacent voxel.

[0173] In some embodiments, 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 determined to be a non-adjacent voxel.

[0174] In this way, by selecting a target adjacent voxel from multiple adjacent voxels adjacent to the target voxel, and performing spatial correction on the updated lighting information of the target voxel through the target adjacent voxel, the obtained first lighting information is more accurate, and the updated lighting information of the virtual viewpoint is more accurate.

[0175] In some embodiments, the above-mentioned occlusion check on the adjacent voxels and the target voxel to obtain the occlusion check result can be achieved as follows: 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 pass the first occlusion check, determine the occlusion check result as the first result; when the first occlusion check result indicates that the adjacent voxel and the target voxel do not pass the first occlusion check, obtain a third distance between the adjacent voxel and the target voxel, and based on the second distance and the third distance, perform a second occlusion check 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 pass the second occlusion check, determine the occlusion check result as the first result; when the second occlusion check result indicates that the adjacent voxel and the target voxel do not pass the second occlusion check, determine the occlusion check result as the second result.

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

[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, two occlusion checks (a first occlusion check and a second occlusion check) are performed using the adjacent voxels, the virtual objects corresponding to the adjacent voxels, the target voxels, and the distances between the virtual objects corresponding to the target voxels, so as to accurately determine whether the adjacent voxel is determined as the target adjacent voxel.

[0178] In some embodiments, when the result of the first occlusion check indicates that the adjacent voxel and the target voxel have not passed the first occlusion check, the adjacent voxel cannot be determined as the target adjacent voxel at this time, and 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 determined as the target adjacent voxel.

[0179] In some embodiments, the above-mentioned first occlusion check is performed on the adjacent voxels and the target voxel based on the first distance and the second distance to obtain the first occlusion check result, which can be achieved as follows: 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.

[0180] In some embodiments, the third result is used to indicate that the neighboring voxel and the target voxel pass the first occlusion check.

[0181] 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 a dot product threshold, the first occlusion check result is determined as the fifth result.

[0182] In some embodiments, the fifth result is used to indicate that the neighboring voxel and the target voxel do not pass the first occlusion check.

[0183] In some embodiments, when the first comparison result indicates that the first distance is less than or equal to the second distance, it indicates that the distance between the target voxel and the corresponding virtual object is closer than the distance between the adjacent voxel and the corresponding virtual object. 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, and the proportion of occluded virtual scene points in the voxel is 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, the illumination information of the adjacent voxels has a greater reference value for the updated illumination information of the target voxel. Consideration can be given to performing spatial domain correction on the updated illumination information of the target voxel in combination with the illumination information of the adjacent voxels, that is, the adjacent voxel can be considered as the target adjacent voxel.

[0184] In some embodiments, when the first comparison result indicates that the first distance is less than or equal to the second distance, whether 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 can be used to further determine whether the adjacent voxel is determined as the target adjacent voxel.

[0185] In some embodiments, when 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, it means that the angle between the above two direction vectors is small and more easily blocked. At this time, the adjacent voxel can be determined as the target adjacent voxel.

[0186] In this way, by performing a first occlusion check on the 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 the adjacent voxel pass the first occlusion check, the adjacent voxel is determined as the target adjacent voxel, and the target adjacent voxel is determined by the contribution of the lighting information of the adjacent voxel to the accuracy of the target voxel. The updated lighting information of the target voxel is spatially corrected through the target adjacent voxel, so that the obtained first lighting information is more accurate, and the updated lighting information of the virtual viewpoint is more accurate.

[0187] In some embodiments, the above-mentioned second occlusion check is performed on the adjacent voxels and the target voxel based on the second distance and the third distance to obtain the second occlusion check result, which can be achieved as follows: 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.

[0188] In some embodiments, the fourth result is used to indicate that the neighboring voxel and the target voxel pass the second occlusion check.

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

[0190] 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 adjacent voxel's illumination contribution to the target voxel is greater than the virtual object's illumination contribution to the target voxel. In this case, the second occlusion check result can be determined as a fourth result, indicating 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.

[0191] In this way, by performing a first occlusion check on the 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 the adjacent voxel have not passed the first occlusion check, the second occlusion check is continued, thereby determining the target adjacent voxel based on the contribution of the lighting information of the adjacent voxels to the accuracy of the target voxel, and performing spatial correction on the updated lighting information of the target voxel through the target adjacent voxel, so that the obtained first lighting information is more accurate, and the updated lighting information of the virtual viewpoint is more accurate.

[0192] In some embodiments, illumination information of a target voxel and illumination information of each target adjacent voxel are obtained.

[0193] As an example, the illumination information corresponding to target adjacent voxel 1, target adjacent voxel 2, target adjacent voxel 3, and target adjacent voxel 4 of the target voxel is obtained.

[0194] In some embodiments, the illumination information of the target voxel and the illumination information of each target adjacent voxel are weightedly summed to obtain the first illumination information of the virtual viewpoint.

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

[0196] In step 106, the updated illumination information is subjected to time domain correction to obtain second illumination information.

[0197] In some embodiments, time domain correction refers to the process of performing error correction on the updated illumination information of the target voxel by combining the illumination information of multiple historical voxels of the pixel point corresponding to the virtual viewpoint during the historical update process, and the accuracy of the second illumination information is greater than the accuracy of the updated illumination information.

[0198] In some embodiments, referring to FIG8 , FIG8 is a flowchart diagram six of the lighting update method for a virtual scene provided in an embodiment of the present application. Step 106 shown in FIG7 can be implemented by executing steps 1061 to 1063 shown in FIG8 .

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

[0200] In some embodiments, the above-mentioned determination of the target voxel where the virtual viewpoint is located from the updated voxels and the initial voxels other than the voxels to be updated can be achieved as follows: the viewpoint position of the virtual viewpoint in the virtual scene is compared with the position ranges corresponding to the updated voxels and the initial voxels other than the voxels to be updated, and the voxel corresponding to the position range where the voxel position is located is determined as the target voxel.

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

[0202] In some embodiments, the pixel points corresponding to the virtual viewpoints refer to the pixel points corresponding to the virtual viewpoints in the imaging plane of the virtual camera. The virtual viewpoints correspond one-to-one to the pixel points in the imaging plane of the virtual camera. A virtual viewpoint in the virtual scene corresponds to a pixel point in the imaging plane of the virtual camera of the virtual scene.

[0203] In some embodiments, the number of historical voxels is equal to the number of updates of the content of the virtual scene.

[0204] As an example, the virtual scene content is updated 5 times within 10 seconds, specifically, 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 pixel points during the historical update (each update) are queried, and the lighting information of each historical voxel is obtained.

[0205] In step 1063 , the illumination information of the target voxel and the illumination information of each historical voxel are weightedly summed to obtain second illumination information of the virtual viewpoint.

[0206] In some embodiments, the update of the virtual scene content will cause the voxels corresponding to the pixel points to change. An update of the virtual scene content will cause the voxels corresponding to the pixel points to change. The update of the virtual scene content changes over time. For example, it is updated 5 times within 10 seconds. Each content update will cause the voxels corresponding to the pixel points to change. Then, from the multiple initial voxels, the corresponding multiple initial voxels (historical voxels) of the pixel point in the historical update (each update) process can be queried, and the illumination information of the target voxel and the illumination information of each historical voxel are weighted and summed to obtain the second illumination information of the virtual viewpoint, thereby realizing the correction of the updated illumination information within the time span (time domain) of the content update process.

[0207] As an example, the virtual scene content is updated 5 times within 10 seconds, specifically, 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 pixel point during the historical update (each update) are queried, and the illumination information of the target voxel and the illumination information of each historical voxel are weightedly summed to obtain the second illumination information of the virtual viewpoint.

[0208] In this way, by determining the pixel point corresponding to the virtual viewpoint, and querying multiple historical voxels of the pixel point during the historical update process from multiple initial voxels, and combining the historical voxels corresponding to each update within the update time domain range, the updated lighting information is time-domain corrected to obtain the second lighting information, thereby effectively correcting 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.

[0209] In step 107 , the first illumination information and the second illumination information are combined to perform error correction on the updated illumination information.

[0210] In some embodiments, the accuracy of the second illumination information is greater than the accuracy of the updated illumination information, the accuracy of the first illumination information is greater than the accuracy of the updated illumination information, the first illumination information mainly eliminates the spatial domain error of the updated illumination information, and the second illumination information mainly eliminates the temporal domain error of the updated illumination information. By combining the first illumination information and the second illumination information to perform error correction on the updated illumination information, the updated illumination information after error correction can eliminate both the spatial domain error of the updated illumination information and the temporal domain error of the updated illumination information, thereby making the updated illumination information after error correction more accurate.

[0211] In some embodiments, referring to FIG9 , FIG9 is a flowchart diagram seven of the lighting update method for a virtual scene provided in an embodiment of the present application. Step 107 shown in FIG7 can be implemented by executing steps 1071 to 1073 shown in FIG9 .

[0212] In step 1071, the validity of the first illumination information is checked to obtain a check result.

[0213] In some embodiments, the validity check refers to a process of checking the validity of the first lighting information, and the check result is used to indicate whether the first lighting information is valid.

[0214] In some embodiments, the above step 1071 can be implemented as follows: determine the target voxel where the virtual viewpoint is located from the updated voxels and the initial voxels other than the voxels to be updated; in the virtual scene after the content changes, construct an inspection ray with the target voxel as the starting point and the virtual camera as the end point; when the inspection ray intersects with the virtual object in the virtual scene after the content changes, determine the inspection result as the first inspection result; when the inspection ray does not intersect with the virtual object in the virtual scene after the content changes, determine the inspection result as the second inspection result.

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

[0216] In some embodiments, in some embodiments, the above-mentioned determination of the target voxel where the virtual viewpoint is located from the updated voxels and the initial voxels except the voxels to be updated can be achieved in the following way: the viewpoint position of the virtual viewpoint in the virtual scene is compared with the position ranges corresponding to the updated voxels and the initial voxels except the voxels to be updated, and the voxel corresponding to the position range where the voxel position is located is determined as the target voxel.

[0217] In some embodiments, when the inspection ray intersects with a virtual object in the virtual scene after the content has changed, it indicates that there is a possibility that the target voxel is blocked by the virtual object, and the first lighting information can be determined to be invalid. When the inspection ray intersects with the virtual object in the virtual scene after the content has changed, it indicates that there is a possibility that the target voxel is not blocked by the virtual object, and the first lighting information can be determined to be valid.

[0218] In step 1072 , when the checking result indicates that the first lighting information is invalid, the updated lighting information is corrected to the second lighting information.

[0219] In some embodiments, when the inspection result corresponding to the first lighting information indicates that the first lighting information is invalid, the updated lighting information may be corrected to the second lighting information.

[0220] In step 1073 , when the checking result indicates that the first lighting information is valid, the updated lighting information is corrected to the first lighting information.

[0221] In some embodiments, when the inspection result corresponding to the first lighting information indicates that the first lighting information is valid, the updated lighting information may be corrected to the first lighting information.

[0222] In this way, the accuracy of the second illumination information is greater than the accuracy of the updated illumination information, and the accuracy of the first illumination information is greater than the accuracy of the updated illumination information. The first illumination information mainly eliminates the spatial domain error of the updated illumination information, and the second illumination information mainly eliminates the temporal domain error of the updated illumination information. By combining the first illumination information and the second illumination information to perform error correction on the updated illumination information, the updated illumination information after error correction can eliminate both the spatial domain error of the updated illumination information and the temporal domain error of the updated illumination information, thereby making the updated illumination information after error correction more accurate.

[0223] In some embodiments, after step 104, the target lighting information of the pixel point can also be determined in the following manner: the following processing is performed for each virtual viewpoint in the virtual scene after the content changes: the pixel point corresponding to the virtual viewpoint in the imaging plane of the virtual camera is obtained; the viewpoint distance between the virtual camera and the virtual viewpoint is determined, and the initial lighting information of the pixel point is determined by combining the viewpoint distance and the updated lighting information of the virtual viewpoint; from multiple screen probes arranged in the imaging plane, at least one target screen probe whose distance to the pixel point is less than a distance threshold is determined; the lighting information stored in each target screen probe is weightedly summed with the initial lighting information of the pixel point to obtain the target lighting information of the pixel point.

[0224] In some embodiments, target illumination information of the pixel points is used to render an image on the imaging plane of the virtual camera.

[0225] In some embodiments, the screen probe is used to store illumination information of corresponding positions in the imaging plane.

[0226] In some embodiments, the viewpoint distance between the virtual camera and the virtual viewpoint can be determined by distance calculation methods such as Euclidean distance, Manhattan distance, and Chebyshev distance. The specific calculation method of the viewpoint distance is used to indicate the distance between the virtual camera and the virtual viewpoint.

[0227] In some embodiments, the Euclidean metric (also known as Euclidean distance) is a commonly used definition of distance, referring to the true distance between two points in m-dimensional space, or the natural length of a vector (i.e., the distance from the point to the origin). The Euclidean distance in two-dimensional and three-dimensional space is the actual distance between two points. Manhattan distance is a geometric term used in geometric metric spaces to indicate the sum of the absolute distances between two points in a standard coordinate system.

[0228] In some embodiments, the weights corresponding to the illumination information stored in each target screen probe and the initial illumination information of the pixel point can be specifically set according to actual conditions, 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 point is equal to 1.

[0229] In this manner, by voxelizing the virtual scene, a plurality of initial voxels corresponding to the virtual scene are obtained. In response to changes in the content of the virtual scene, at least one voxel to be updated is selected from the plurality of initial voxels, and the lighting information carried by each voxel to be updated is updated. The updated voxel and initial voxels other than the voxel to be updated in the plurality of initial voxels are combined to update the lighting information of each virtual viewpoint in the changed virtual scene. In this manner, by selecting at least one voxel to be updated from the plurality of 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.

[0230] Below, an exemplary application of the embodiment of the present application in an actual online game application scenario will be described.

[0231] The embodiments of this application can be applied to any project or product that requires real-time global illumination calculations, including games and 3D visual design. They can provide high-quality, realistic lighting rendering effects, significantly improving the visual performance of the product, thereby further enhancing the user experience. In typical application scenarios such as games, the embodiments of this application can automatically calculate the indirect lighting results for each 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.

[0232] In some embodiments, referring to FIG10 , FIG10 is a schematic diagram illustrating the rendering effect of a virtual scene illumination update method provided by an embodiment of the present application. The embodiment of the present application can automatically calculate the indirect illumination result of each pixel on the screen (e.g., pixel 1, pixel 2, and pixel 3) in real time based on the placement and parameters of objects and lights in the game scene, thereby improving the illumination details and realism of the game screen.

[0233] In some embodiments, referring to Figure 11, Figure 11 is a flowchart of a method for updating the lighting of a virtual scene according to an embodiment of the present application. The method for updating the lighting of a virtual scene according to an embodiment of the present application can be implemented through steps 201 to 207 shown in Figure 11.

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

[0235] In step 202, the viewing scene color and depth are obtained.

[0236] In some embodiments, the initial input is the color and depth information rendered from the current perspective of the virtual scene. This information is combined with the virtual scene's 3D structure, such as object poses, materials, and light source parameters, to perform world-space voxel updates. Voxels serve as the fundamental structure of the lighting cache system, and voxel data is continuously updated to adapt to dynamic changes in the virtual scene and calculate indirect lighting propagation.

[0237] In step 203, scene voxel updating is performed.

[0238] In some embodiments, the above step 203 may be implemented in the following manner: updating the scene voxels in combination with the three-dimensional scene information of the virtual scene and the perspective scene color and depth.

[0239] In some embodiments, the embodiments of the present application use voxels with normal information to represent face elements to simplify the description of the three-dimensional scene. First, a rectangular space centered on the camera is maintained, and voxels are used to simplify the description of the three-dimensional scene information in this space. The voxel content includes: normal, diffuse reflection color, direct lighting information, radiant brightness information, etc. In order to reduce memory consumption, the embodiments of the present application use a hierarchical manner to sparsely store voxels, and regard 4*4*4 voxels as a group, which is called a brick. The hierarchical index is represented by an n*m*k three-dimensional map. If a brick contains voxels, its actual storage location can be obtained through the hierarchical index; if the value obtained by the hierarchical index is 0, it means that the brick does not contain voxels, which can greatly save video memory space.

[0240] The scene voxel update (step 203 shown in FIG11 ) of the embodiment of the present application includes voxel creation and voxel update parts. The voxel creation part first converts the three-dimensional objects in the scene into voxel information. This process is called scene voxelization. In the embodiment of the present application, scene voxelization is divided into two parts. One part is based on the screen, that is, screen voxel injection; the other part is based on the three-dimensional model, that is, single model voxelization. The voxel update part is completed by screen voxel injection on the mobile terminal; on the PC and host, in addition to screen voxel injection, light propagation update is also used to complete it.

[0241] In some embodiments, screen voxel injection generally uses a scene color map and a scene depth map. The world coordinates of the pixel are calculated through the depth map, and then the scene color, diffuse color and other information are recorded at the corresponding voxel position. The embodiment of this application proposes an optimized screen voxel injection scheme, which improves the performance and accuracy of screen voxel injection. The process is divided into three parts:

[0242] The first part involves grouped frustum culling: 8*8*8 bricks are grouped together. Each group is intersected with the frustum on the GPU, and groups that don't intersect are discarded. Groups that do intersect are updated frame by frame based on their distance from the camera. Groups closer to the camera are updated more frequently, while those farther away are updated less frequently. Grouped culling significantly reduces the number of voxels that need to be updated.

[0243] The second part is brick collection: brick collection is performed for the group that needs to be updated in this frame. This process will determine whether the brick intersects with the screen depth. If there is an intersection, the brick will be collected for subsequent voxel injection, otherwise it will not be collected. In addition, all bricks before the scene depth will be collected every 10 frames to complete the voxel clearing operation. Here, the embodiment of the present application proposes a new "eight-vertex test method" to test whether the cuboid intersects with the scene depth by comparing the front-back relationship between the 8 vertices of the cuboid and the scene depth: if some of the 8 vertices are before the scene depth, and at the same time some vertices are after the scene depth, then the cuboid is determined to intersect with the scene depth; in addition, in order to make a loose judgment, if any one of the 8 vertices happens to be very close to the scene depth, then the cuboid is determined to intersect with the scene depth.

[0244] The third part, voxel injection: A thread is created for each voxel of the collected bricks. 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 coordinate corresponding to the screen depth is very close to this point, the voxel is updated with its corresponding screen color. If the distance is far, it means that this sampling point is invalid and the clearing phase begins. 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 before the screen depth, the corresponding voxel is cleared.

[0245] In some embodiments, single-model voxelization sends the 3D model in the scene to the GPU, where it is voxelized with the help of hardware rasterization. The model projection scheme needs to be set to orthographic projection, with depth testing disabled. Instance drawing is then used to execute the x, y, and z axes simultaneously in a single draw call batch (Pass). Since the PC solution has a subsequent voxel lighting update scheme, the single-model voxelization stage only writes the voxel's diffuse color and normal. However, in the mobile solution, for performance reasons, voxel lighting propagation is not performed. Instead, screen voxel injection is used to update the lighting for the voxels, as shown in Figure 12. Therefore, a simplified direct lighting is performed during the single-model voxelization stage.

[0246] In some embodiments, referring to FIG. 12 , FIG. 12 is a flow chart of a method for updating the lighting of a virtual scene provided in an embodiment of the present application. The above-mentioned step 203 can be implemented through steps 2031 to 2038 shown in FIG. 12 .

[0247] In step 2031, the virtual scene is divided into time and space.

[0248] In some embodiments, voxel lighting propagation updates are primarily used to update and calculate the direct and indirect lighting within each voxel, allowing the system's lighting cache structure to adapt to dynamic changes in the scene. However, due to the large number of voxels in a scene, it is difficult to complete lighting updates within the limited time. Therefore, only a subset of voxels are updated each frame.

[0249] In some embodiments, all voxel brick structures in the scene must first be spatially and temporally partitioned. Spatially, the scene is divided into two parts: near distance and far distance, based on a certain threshold, with the player or camera as the origin. For example, the area within 300 meters long, 300 meters wide, and 150 meters high is considered near distance, while the rest is considered far distance.

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

[0251] In some embodiments, all voxel brick structures in the near space and the far space are respectively assigned to multiple game frames for lighting updates. The near space is divided into 9 game frames, and the far space is divided into 121 game frames. Afterwards, for all the voxel brick structures divided into the current frame, the non-empty voxel brick structures are collected, that is, the lighting of the voxels in these voxel brick structures is calculated. Then, the non-empty voxels in each voxel brick structure are marked. For example, 64 bits can be used to mark whether the 64 voxels are empty. Finally, the non-empty voxels in a voxel brick structure are uniformly sampled and randomly extracted, and only some of the non-empty voxels are updated. For example, up to 16 non-empty voxels can be randomly updated. Affected by the random strategy, after multiple frames, all non-empty voxels in the voxel brick structure will be updated.

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

[0253] In step 2034 , a non-empty voxel is randomly selected.

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

[0255] In some embodiments, referring to FIG13 , FIG13 is a schematic diagram of the principle of the starting point provided in an embodiment of the present application, wherein the square represents the current voxel, and the curve represents the surface of the virtual object covered by the current voxel. The center point of the voxel is offset along the direction of the normal of the current voxel, and offset outside the current voxel to obtain the offset point. With the offset point as the starting point, a ray is emitted within a certain angle range in the negative direction of the normal of the current voxel, and the intersection point solved by ray tracing is the starting point.

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

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

[0258] In some embodiments, it is necessary to further calculate the indirect lighting of the voxel starting point position, randomly sample a certain number of rays on the hemisphere in the normal direction of the starting point, and obtain the current indirect lighting of the voxel through importance sampling or resampling technology.

[0259] In step 2038, the indirect lighting is updated by interpolation.

[0260] In some embodiments, the current indirect lighting calculation result is interpolated and blended with the result of the previous frame. For example, three rays can be uniformly sampled on a hemisphere in the normal direction of the current voxel starting point, and the lighting of the three rays can be calculated separately through ray tracing. The current indirect lighting is then calculated through resampling, and accumulated over 9 frames in the temporal domain, i.e., the interpolation weight is 1 / 9.

[0261] In step 204 , a scene light probe system is generated.

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

[0263] The embodiment of the present application uses a three-dimensional probe in the world space to cache the indirect light information of the scene. The three-dimensional probe in the embodiment of the present application also stores two parts of indirect light and visibility information. For the indirect light information part, the embodiment of the present application uses different storage formats according to the platform: on the PC side, an octahedral mapping map is used to store the radiation brightness information; on the mobile side, an ambient cube (Ambient Cube) is used to store the irradiance information. For the visibility information part, the embodiment of the present application uses an octahedral mapping map to store the VSM (Variance Shadow Map) distance, that is, the average distance and the average distance squared to the nearest objects in each direction around, for the subsequent use of VSM to calculate visibility. The three-dimensional probes are evenly distributed in a cuboid centered on the camera, and are implemented using a nested hierarchy. The probe density is high in the part close to the camera, and the probe density is low in the part far from the camera.

[0264] This embodiment of the application selects a layer in each frame to update the 3D probes. During the update process, the probes that need to be updated are first collected. The condition for judging is that there are valid voxels within a certain range around the probes. This collection scheme avoids the need to update all probes, which can significantly reduce performance consumption.

[0265] For each 3D probe to be updated, a random ray direction is first emitted from the sphere, and the probe face that needs to be updated is determined by the direction of the ray. If it is a mobile terminal, the face to be updated is first randomly selected, and then the ray direction is randomized using the cosine of the normal angle as the probability of update. The starting point of the ray is the center of the probe, and the voxel at the intersection position can be obtained by the ray tracing algorithm. In the mobile terminal solution, the ray tracing algorithm is implemented using software voxel tracing; its implementation scheme is to save the occupancy information of the next level node in a hierarchical manner, with the bottom layer being voxels. In each previous node, 64 bits are used to save whether the next level 4*4*4 nodes are occupied or not. 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 there is no intersecting voxel within a long range, the probe surface content is updated with skylight, such as irradiance, unit irradiance intensity, etc., and the VSM distance is updated; if the intersecting voxel is the front, the voxel color is used to update the probe surface, and the VSM distance is updated; if the intersecting voxel is the back, only the VSM distance is updated, and the color is not updated. In order to prevent the probe from leaking light or shadows inside the object structure or voxel, the embodiment of the present application also has a probe repositioning function, and on this basis, the position is quantified, the position and transition information is saved, and the repositioning process is smooth and natural. After repositioning, the color of the probe will be reset to prevent light leakage or shadow leakage.

[0266] In step 205 , ray tracing is performed.

[0267] In some embodiments, ray tracing is used to emit light 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 the initial indirect lighting result.

[0268] In some embodiments, after calculation by the ray tracing module, the indirect lighting result at each pixel position can be obtained. Before processing by the denoising module, the indirect lighting result is noisy. For example, when using RTX hardware ray tracing, for each pixel on the screen, at its corresponding world space position, an initial ray is sampled according to its material to generate the initial ray, then ray tracing is performed to obtain the intersection information, and then the lighting result is obtained from the corresponding scene voxel structure.

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

[0270] In some cases, the initial lighting result is often noisy and enters a denoising module, which uses a coherent spatiotemporal algorithm to remove the noise, producing a smooth and stable indirect lighting calculation result. Applications or products can use this result to significantly improve their lighting rendering quality, thereby delivering realistic visual effects.

[0271] In some embodiments, referring to Figure 14 , which is a flowchart diagram 10 of a method for updating the lighting of a virtual scene provided by an embodiment of the present application, step 206 shown in Figure 11 can be implemented through steps 2061 to 2069 shown in Figure 14 .

[0272] In step 2061, a lighting result with noise is obtained.

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

[0274] In some embodiments, for the indirect lighting results with input noise, ordinary ReSTIR time domain multiplexing and spatial domain multiplexing are first performed to preliminarily reduce the noise. Note that in order to reduce the amount of calculation to meet the requirements of real-time operation, the embodiment of the present application does not perform any ray tracing visibility check operations in these two steps. If the visibility check operation is not performed, a large amount of deviation will be introduced. The output indirect lighting results are compared with the physically correct reference standard. Specifically, the indirect lighting high-frequency details are lost, the indirect lighting shadows are lost, the overall contrast of the picture is reduced, and the three-dimensional sense of lighting is lost. In addition, the deviation introduced by time domain multiplexing is small, and the deviation introduced by spatial domain multiplexing is large.

[0275] A simple example process is as follows. A noisy lighting result is 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 most to the current pixel is selected based on the sampling information from the previous historical frames. After spatial multiplexing, the sampling point Ss that contributes most to the current pixel is selected based on the sampling information from surrounding pixels. The indirect lighting result for that pixel can be calculated based on the sampling points.

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

[0277] In some embodiments, the noisy lighting result is 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 a temporal multiplexing operation, the sampling point St that contributes most to the current pixel is selected in combination with the sampling information of the pixel's previous historical frames. After a spatial multiplexing operation, the sampling point Ss that contributes most to the current pixel is selected in combination with the sampling information of other pixels surrounding the pixel. The indirect lighting result for the pixel can be solved based on the sampling points.

[0278] In step 2064, visibility detection is performed.

[0279] In some embodiments, referring to Figure 15 , which is a flowchart diagram 11 of a method for updating the lighting of a virtual scene provided by an embodiment of the present application, step 2064 shown in Figure 14 can be implemented by steps 20641 to 20647 shown in Figure 15 .

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

[0281] In some embodiments, the input obtained is the sampling point Ss resulting from spatial domain multiplexing of the current pixel.

[0282] In step 20642, a ray is emitted toward the sampling point Ss.

[0283] 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 ray tracing is used to determine whether the visibility ray is blocked.

[0284] In step 20643, determine whether it is blocked.

[0285] In some embodiments, it can be determined by ray tracing whether the visibility ray is blocked.

[0286] In step 20644, when blocked, the sampling point Ss is marked as invalid.

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

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

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

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

[0291] In some embodiments, in order to reduce the deviation, the spatial domain multiplexing result Ss is restored to the time domain multiplexing result St, and the time domain multiplexing result St has a smaller deviation.

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

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

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

[0295] In some embodiments, the embodiments of the present application detect spatial domain multiplexing results with large deviations and restore them to time domain multiplexing results. However, compared with spatial domain multiplexing, the results of time domain multiplexing have larger noise points. In order to further eliminate the noise points, the embodiments of the present application combine the results of the visibility check module and perform heuristic spatial domain multiplexing again. This step does not include additional ray tracing visibility check operations. Compared with the simple spatial domain multiplexing in 2063, it can retain the high-frequency details of indirect lighting, greatly improve the quality of indirect lighting, and make it closer to the physically correct reference results. The original spatial domain multiplexing process will screen and filter according to the differences in geometric parameters such as depth values ​​and normal values ​​between the current pixel and the neighboring pixels, but it is still difficult to retain the high-frequency details of indirect lighting.

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

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

[0298] In some embodiments, referring to FIG16 , FIG16 is a flowchart diagram 12 of a virtual scene illumination update method provided in an embodiment of the present application. Let the center pixel be P, and a spatially reused neighboring pixel be Q. Heuristic spatial reuse, i.e., step 2065 shown in FIG11 , can be implemented by steps 20651 to 20657 shown in FIG15 .

[0299] In step 20651, determine whether P is blocked.

[0300] In step 20652, when P is not blocked, determine whether Q is blocked.

[0301] In step 20653, when P is blocked, determine whether Q is blocked.

[0302] In step 20654, when P is blocked and Q is blocked, blockage judgment 1 is performed.

[0303] In step 20655, when P is not blocked and Q is not blocked, or when the blocking judgment 1 (ie, the first blocking check described above) passes, the process is accepted.

[0304] In step 20656, reject when P is blocked and Q is not blocked, or when P is not blocked and Q is blocked.

[0305] In step 20657 , when occlusion determination 1 fails, occlusion determination 2 (ie, the second occlusion check described above) is performed.

[0306] In some embodiments, if point P is not occluded and point Q is not occluded, the neighborhood Q is accepted, that is, a spatial domain multiplexing operation is performed between P and Q. If one of P and Q is occluded and the other is not occluded, the neighborhood Q is rejected, that is, no spatial domain multiplexing operation is performed between P and Q. When both P and Q are occluded, further occlusion judgment is required. The occlusion distance of point P calculated in the visibility check module is Pot and the occlusion direction is Pod, the occlusion distance of point Q is Qot and the occlusion direction is Qod, the world space position corresponding to point P is Wp, and the illumination sampling point position corresponding to point Q is Sq. The distance from Wp to Sq is D, and the direction is L. The occlusion judgment is divided into two steps. First, occlusion judgment 1 is performed. If Qot<=Pot and the dot product of Pod and L is less than a certain threshold a, a can take values ​​in the range of 0 to 1, then the neighborhood Q is accepted through the occlusion judgment. Otherwise, continue with occlusion judgment 2. If Pot>bD, that is, the occlusion distance of point P is D which is greater than Pot times b, then the neighborhood Q is accepted through occlusion judgment, and the value of b can be greater than 0, and b=1 can generally be set. If occlusion judgment 2 also fails, the neighborhood Q is rejected. This heuristic neighborhood screening strategy can be directly applied to the basic spatial domain reuse process, constituting the heuristic spatial domain reuse method of the embodiment of the present application, which can efficiently maintain indirect lighting and shadow details while reducing noise.

[0307] In step 2066, multisample shading.

[0308] In some embodiments, after all the previous processes are processed, each pixel has an optimal illumination sampling point after being processed by the relevant algorithm. However, using only one illumination sampling point after resampling to calculate the final indirect illumination result will be full of a large amount of color noise. All the previous noise reduction processes did not take into account the color spectrum information of the illumination. The embodiment of the present application uses multi-sampling shading calculation to solve this problem. For a pixel for which shading information is to be calculated, the sampling results of other pixels within its small neighborhood are aligned for illumination calculation. The calculation process can refer to the standard algorithm, and the neighborhood range can be selected as 3*3, 5*5, 7*7 or other sizes. Let the pixel to be colored be P and the neighborhood pixel be Q. Assuming that 9 neighborhood pixels are selected, 9 standard spatial domain multiplexing operations are performed respectively. Each time the illumination sampling information of P is set to empty and then reused with the illumination sampling information of Q point. The indirect illumination R is calculated based on the reused result. The weighted average of the R obtained by the 9 calculations is the final indirect illumination calculation result of the pixel P. The embodiment of the present application does not impose specific restrictions on the weighted average strategy. For example, a uniform weight can be selected, that is, if 9 neighboring pixels are selected, the weight of the indirect lighting R calculated each time is 1 / 9. In addition, the multi-sampling shading module can also be used to improve resolution. All noise reduction processing before this module can be performed at a lower resolution, such as half resolution, to keep the resolution of the initial noisy lighting result consistent. In the multi-sampling shading module, the existing noise reduction results can be directly used to perform shading calculations on high-resolution screen pixel information, thereby completing the rate of change improvement and retaining the material details and geometric details of the high screen resolution.

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

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

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

[0312] In step 2069, a noise-free lighting result is generated.

[0313] In step 207 , an indirect lighting result is generated.

[0314] In some embodiments, referring to FIG17 , FIG17 is a flowchart diagram thirteen of a method for updating the illumination of a virtual scene provided in an embodiment of the present application. The method for updating the illumination of a virtual scene provided in an embodiment of the present application can be implemented through steps 301 to 306 shown in FIG17 . Since the computational complexity of steps 301 to 306 shown in FIG17 is smaller than that of steps 201 to 207 shown in FIG11 , real-time dynamic global illumination can be implemented on a mobile terminal. Steps 301 to 306 shown in FIG17 are described below.

[0315] In step 301, three-dimensional scene information is obtained.

[0316] In step 302, the viewing scene color and depth are obtained.

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

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

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

[0320] In some embodiments, in order to implement a global illumination solution on a mobile device, the system uses a screen probe to collect indirect light. Step 305 can be implemented as follows: Lightweight simplified delay pipeline: The system transforms the forward pipeline commonly used on traditional mobile devices into a lightweight simplified delay pipeline, that is, in the base draw call (BasePass) stage, in addition to the screen color and screen depth, an additional R8G8B8A8 map is output, where the RGB channel stores the diffuse color, and the Alpha channel stores the compressed normal information. Since only eight bits of normal information are not accurate enough, grid-like defects will appear on the surface of the curved model. The system adds a small range of noise perturbations based on the screen normal, thereby solving the problem of grid defects. In actual implementation, one bit can be reserved in the B channel to store whether the three-dimensional model is static or dynamic. This method can solve the problem of dynamic object ghosting when performing a temporal supersampling algorithm without a velocity map. Screen Probe Generation: The system divides the screen space into a 64x64 pixel grid, placing a screen-space probe in each grid. Probes are generated by interpolating 3D probes. Probes only store indirect lighting information for the camera-facing hemisphere. Dithering the screen probe generation position allows for temporal supersampling. Screen Probe Capture: The system samples and interpolates screen probes pixel by pixel at half resolution, applying bilateral filtering with depth and normal detection to generate half-resolution screen indirect lighting. If a velocity map is generated in the render project, temporal supersampling can be achieved by overlaying it. If a velocity map is not generated in the render project, dynamic object flags can be used to skip screen probe acquisition and directly capture 3D probes. Indirect Light Upsampling: Bilateral filtering is used to upsample the half-resolution indirect lighting results. Smearing Optimization: Due to the limited resolution of screen probes, if the four probes surrounding a render position fail the depth and normal detection, the system will record the render position and generate an additional screen probe at that location in the next frame, thus avoiding smearing caused by incorrect probe acquisition. The ghosting problem of moving objects is solved by generating screen probes before drawing the moving objects.

[0321] In step 306 , an indirect lighting result is generated.

[0322] Thus, on the mobile side, the embodiments of this application propose an innovative screen space injection solution and a screen probe system, which can control the performance consumption of dynamic global illumination to less than 4ms on high-end mobile devices, realizing the application of large-scale dynamic global illumination on mobile terminals. On the PC side, the embodiments of this application propose an innovative voxel update solution and a new denoising process, including innovative visibility check methods, heuristic spatial domain reuse, multi-sampling shading, etc. It can provide stable global illumination effects for highly dynamic rendered animations and provide high-precision indirect light shadows.

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

[0324] Next, an exemplary structure of a lighting update device 455 for a virtual scene provided by an embodiment of the present application implemented as a software module is described. In some embodiments, as shown in FIG2 , the software modules stored in the device 455 of the memory 450 may include: a voxelization module configured to perform voxelization processing on the virtual scene to obtain a plurality of initial voxels corresponding to the virtual scene; wherein different initial voxels have different positions in the virtual scene, and the initial voxels carry lighting information of corresponding positions in the virtual scene; a selection module configured to select at least one voxel to be updated from the plurality of initial voxels in response to a change in content in the virtual scene, wherein the number of voxels to be updated is less than the number of initial voxels; a voxel update module configured to update the lighting information carried by each voxel to be updated to obtain an updated voxel corresponding to each voxel to be updated; and a lighting update module configured to update the lighting information of each virtual viewpoint in the virtual scene after the content has changed, combining the updated voxel and the initial voxels other than the voxel to be updated in the plurality of initial voxels; wherein the virtual viewpoint is a virtual scene point in the virtual scene after the content has changed that can be captured by a virtual camera.

[0325] In some embodiments, the selection module is further configured to obtain the camera position of the virtual camera in the virtual scene after the content changes in the virtual scene in response to the changes in the content in the 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; based on the voxel distance, select at least one voxel to be updated from multiple initial voxels.

[0326] In some embodiments, the above-mentioned selection module is further configured to determine the initial voxel as the first initial voxel when the voxel distance of the initial voxel is less than or equal to the voxel distance threshold; determine the initial voxel as the 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 multiple 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.

[0327] In some embodiments, the voxel update module is further configured to perform the following processing for each voxel to be updated: determining a plurality of target virtual scene points located within the voxel to be updated from each virtual scene point of the virtual scene; obtaining target lighting information of each target virtual scene point within the voxel to be updated, and performing weighted summation on each target lighting information to obtain updated lighting information; updating the lighting information carried by the voxel to be updated to the updated lighting information to obtain an updated voxel corresponding to the voxel to be updated.

[0328] In some embodiments, the above-mentioned voxel update module is further configured to perform the following processing for each target virtual scene point 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 the 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 the reflected light corresponding to the direct light on the target virtual scene point; summing the direct lighting information and the indirect lighting information to obtain the target lighting information of the target virtual scene point.

[0329] In some embodiments, the direct lighting information includes direct lighting intensity. The above-mentioned 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; based on the total distance and the target virtual scene point, determine the loss value of the light source lighting intensity of the virtual light source; subtract the light source lighting intensity and the loss value to obtain the direct lighting intensity of the target virtual scene point.

[0330] In some embodiments, the voxel update module is further configured to determine at least one target lighting probe whose distance from the target virtual scene point is less than a distance threshold from a plurality of lighting probes arranged in the virtual scene, wherein the lighting probe is configured to store lighting information of a corresponding position in the virtual scene after the content changes; 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; according to the weight, the lighting information stored in each target lighting probe is weightedly summed to obtain the indirect lighting information of the target virtual scene point.

[0331] In some embodiments, the lighting update device for the above-mentioned virtual scene further includes: a layout module configured to obtain the camera position of the virtual camera in the virtual scene; determine the virtual scene area in the virtual scene whose distance from the camera position is less than a distance threshold as the first virtual scene area, and determine the virtual scene area in the virtual scene whose distance from the camera position is greater than or equal to the distance threshold as the second virtual scene area; in the first virtual scene area, layout a third number of lighting probes, and in the second virtual scene area, layout a fourth number of lighting probes, wherein the third number is greater than the fourth number.

[0332] In some embodiments, the above-mentioned lighting update module is configured to perform the following processing for each virtual viewpoint in the virtual scene after the content changes: determine the target voxel where the virtual viewpoint is located from the updated voxels and the initial voxels other than the voxels 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.

[0333] In some embodiments, the lighting update device for the above-mentioned virtual scene also includes: a correction module, configured to perform the following processing on the updated lighting information after each virtual viewpoint is updated: performing spatial domain correction on the updated lighting information to obtain first lighting information, and performing temporal domain correction on the updated lighting information to obtain second lighting information; combining the first lighting information and the second lighting information to perform error correction on the updated lighting information.

[0334] In some embodiments, the correction module is further configured to determine the target voxel where the virtual viewpoint is located, and a plurality of adjacent voxels adjacent to the target voxel from the update voxels and the initial voxels other than the voxels to be updated; 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 weighted summation on 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.

[0335] In some embodiments, the correction module is further configured to perform the following processing on each adjacent voxel: 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, determine 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, perform 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, determine 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, determine the adjacent voxel as a non-adjacent voxel.

[0336] 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; 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 pass the first occlusion check, determine the occlusion check result as the first result; when the first occlusion check result indicates that the adjacent voxel and the target voxel do not pass the first occlusion check, obtain a first distance between the adjacent voxel and the target voxel a third distance thereof, and based on the second distance and the third distance, performing a second occlusion check 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 pass the second occlusion check, determining the occlusion check result as the first result; when the second occlusion check result indicates that the adjacent voxel and the target voxel do not pass the second occlusion check, determining the occlusion check result as the second result; wherein the first result is used to indicate that the adjacent voxel and the target voxel pass the occlusion check, and the second result is used to indicate that the adjacent voxel and the target voxel do not pass the occlusion check.

[0337] 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 a 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.

[0338] 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.

[0339] In some embodiments, the correction module is further configured to determine the target voxel where the virtual viewpoint is located from the updated voxels and the initial voxels other than the voxels to be updated, and obtain the lighting information of the target voxel; determine the pixel point corresponding to the virtual viewpoint, and query multiple historical voxels of the pixel point during the historical update process from multiple initial voxels, and obtain the lighting information of each historical voxel; perform weighted summation on 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.

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

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

[0342] In some embodiments, the lighting update device for the above-mentioned virtual scene further includes: performing the following processing for each virtual viewpoint in the virtual scene after the content changes: obtaining the pixel point 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 point in combination with the viewpoint distance and the updated lighting information of the virtual viewpoint; determining at least one target screen probe whose distance to the pixel point is less than a distance threshold from a plurality of screen probes arranged in the imaging plane; performing weighted summation on the lighting information stored in each target screen probe and the initial lighting information of the pixel point to obtain the target lighting information of the pixel point, wherein the target lighting information of the pixel point is used to render the image on the imaging plane of the virtual camera.

[0343] Embodiments of the present application provide a computer program product, comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. A 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 in the embodiments of the present application.

[0344] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the processor will execute the lighting update method of the virtual scene provided by the embodiment of the present application, for example, the lighting update method of the virtual scene shown in Figure 3.

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

[0346] In some embodiments, computer-executable instructions may be in the form of a program, software, software module, script, 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 a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0347] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as 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 coordinating files (e.g., files storing one or more modules, subroutines, or code portions).

[0348] By way of example, computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed across multiple sites and interconnected by a communication network.

[0349] In summary, the embodiments of the present application have the following beneficial effects:

[0350] (1) By voxelizing the virtual scene, a plurality of initial voxels corresponding to the virtual scene are obtained. In response to changes in the content of the virtual scene, at least one voxel to be updated is selected from the plurality of initial voxels, and the lighting information carried by each voxel to be updated is updated. 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 in the plurality of initial voxels. In this way, by selecting at least one voxel to be updated from the plurality of 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.

[0351] (2) In response to changes in the content of the virtual scene, at least one voxel to be updated is selected from the multiple initial voxels. Since the number of voxels to be updated is smaller 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.

[0352] (3) 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. Since the selected first number is greater than the second number, the number of selected second initial voxels farther from the virtual camera is smaller than the number of selected first initial voxels closer to the virtual camera. Since the first initial voxels closer to the virtual camera are more likely to include virtual viewpoints, selecting more first initial voxels can effectively ensure that the lighting information of subsequent virtual viewpoints is updated, effectively ensuring the accuracy of the lighting update of the virtual viewpoints, thereby effectively improving the accuracy of the lighting update.

[0353] (4) By determining the loss value of the light source illumination intensity on the light path, the direct illumination intensity of the target virtual scene point can be accurately determined, which is convenient for subsequent combination with the indirect illumination intensity to accurately determine the target illumination information of the target virtual scene point, thereby effectively improving the illumination accuracy of the virtual scene.

[0354] (5) By determining at least one target lighting probe whose distance to the target virtual scene point is less than a distance threshold from the multiple lighting probes arranged in the virtual scene, and determining the weights corresponding to each target lighting probe, the lighting information stored in each target lighting probe is weighted and summed according to the weights 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 virtual scene after the content changes, 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, and 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 virtual scene after the content changes, thereby effectively improving the accuracy of the determined indirect lighting intensity.

[0355] (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 are deployed in the first virtual scene area, which can effectively ensure the lighting accuracy of the first virtual scene area. A small number of lighting probes are deployed in the second virtual scene area, which can save the number of deployed lighting probes 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.

[0356] (7) By updating some of the initial voxels (voxels to be updated) of 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, thereby effectively reducing the update cost, and effectively improving the lighting update efficiency of the virtual scene. At the same time, the indirect lighting information of the voxels to be updated can be accurately determined by the layout of the lighting probes, and the direct lighting information of the voxels to be updated can be accurately determined by calculating the loss value of the light source illumination intensity. By summing the direct lighting information and the indirect lighting information, the obtained updated lighting information is made more accurate, effectively improving the accuracy of the determined updated lighting information.

[0357] (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, so that the updated lighting information of the virtual viewpoint is more accurate.

[0358] (9) By selecting a target adjacent voxel from a plurality of adjacent voxels adjacent to the target voxel, spatially correcting the updated illumination information of the target voxel through the target adjacent voxel, the obtained first illumination information is made more accurate, and the updated illumination information of the virtual viewpoint is made more accurate.

[0359] (10) A first occlusion check result is obtained by performing a first occlusion check on the adjacent voxel and the target voxel. When the first occlusion check result indicates that the target voxel and the adjacent voxel pass the first occlusion check, the adjacent voxel is determined as the target adjacent voxel, thereby determining the target adjacent voxel based on 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 spatially corrected through the target adjacent voxel, so that the obtained first illumination information is more accurate, and the updated illumination information of the virtual viewpoint is more accurate.

[0360] (11) A first occlusion check result is obtained by performing a first occlusion check on the adjacent voxels and the target voxel. When the first occlusion check result indicates that the target voxel and the adjacent voxel have not passed the first occlusion check, a second occlusion check is continued, thereby determining the target adjacent voxel based on the contribution of the illumination information of the adjacent voxels to the accuracy of the target voxel, and performing a spatial correction on the updated illumination information of the target voxel through the target adjacent voxel, so that the obtained first illumination information is more accurate, and the updated illumination information of the virtual viewpoint is more accurate.

[0361] (12) By determining the pixel point corresponding to the virtual viewpoint, and querying multiple historical voxels of the pixel point during the historical update process from multiple initial voxels, and combining the historical voxels corresponding to each update within the update time domain range, the updated lighting information is time-domain corrected to obtain the second lighting information, thereby effectively correcting 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.

[0362] (13) The accuracy of the second illumination information is greater than the accuracy of the updated illumination information, and the accuracy of the first illumination information is greater than the accuracy of the updated illumination information. The first illumination information mainly eliminates the spatial domain error of the updated illumination information, and the second illumination information mainly eliminates the temporal domain error of the updated illumination information. By combining the first illumination information and the second illumination information to perform error correction on the updated illumination information, the updated illumination information after error correction can eliminate both the spatial domain error and the temporal domain error of the updated illumination information, thereby making the updated illumination information after error correction more accurate.

[0363] (14) On the mobile side, the embodiments of this application propose an innovative screen space injection solution and a screen probe system, which can control the performance consumption of dynamic global illumination to less than 4ms on high-end mobile devices, realizing the application of large-scale dynamic global illumination on mobile devices. On the PC side: The embodiments of this application propose an innovative voxel update solution and a new denoising process, including an innovative visibility check method, heuristic spatial domain reuse, multi-sampling color search, etc. It can provide stable global illumination effects for highly dynamic rendering animations and provide high-precision indirect light shadows.

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

Claims

1. A method for updating illumination of a virtual scene, the method comprising: Performing voxel processing on the virtual scene to obtain a plurality of initial voxels corresponding to the virtual scene; Wherein, different initial voxels have different positions in the virtual scene, and the initial voxels carry lighting information of corresponding positions in the virtual scene; In response to a change in the content of the virtual scene, selecting at least one voxel to be updated from the plurality of initial voxels, wherein the number of the voxels to be updated is less than the number of the initial voxels; Updating the illumination information carried by each of the voxels to be updated to obtain updated voxels corresponding to each of the voxels to be updated; In combination with the update voxel and the initial voxels among the plurality of initial voxels except the voxel to be updated, the lighting information of each virtual viewpoint in the virtual scene after the content is changed is updated; The virtual viewpoint is a virtual scene point that can be captured by a virtual camera in the virtual scene after the content changes.

2. The method according to claim 1, wherein: The selecting at least one voxel to be updated from the plurality of initial voxels in response to the change of the content in the virtual scene comprises: In response to a change in content in the virtual scene, obtaining a camera position of the virtual camera in the virtual scene after the content has changed; Acquire the voxel position of the voxel center point of each of the initial voxels in the virtual scene, and determine the voxel distance between the camera position and each of the voxel positions; At least one voxel to be updated is selected from the plurality of initial voxels based on the voxel distance.

3. The method according to claim 2, wherein: The selecting at least one voxel to be updated from the plurality of initial voxels based on the voxel distance comprises: When the voxel distance of the initial voxel is less than or equal to the voxel distance threshold, determining the initial voxel as a first initial voxel; When the voxel distance of the initial voxel is greater than the voxel distance threshold, determining the initial voxel as a second initial voxel; Selecting a first number of first initial voxels and a second number of second initial voxels from the plurality of initial voxels, and determining the selected first initial voxels and the second initial voxels as the voxels to be updated; The first number is greater than the second number, and the first number is at least one.

4. The method according to any one of claims 1 to 3, wherein: The updating of the illumination information carried by each of the to-be-updated voxels to obtain updated voxels corresponding to each of the to-be-updated voxels includes: The following processing is performed for each voxel to be updated: Determining, from each virtual scene point of the virtual scene, a plurality of target virtual scene points located within the voxel to be updated; Acquire target illumination information of each target virtual scene point in the voxel to be updated, and perform weighted summation on each target illumination information to obtain updated illumination information; The illumination information carried by the voxel to be updated is updated to the updated illumination information, so as to obtain an updated voxel corresponding to the voxel to be updated.

5. The method according to claim 4, wherein: The step of obtaining target illumination information of each target virtual scene point in the voxel to be updated includes: The following processing is performed for each of the target virtual scene points in the voxel to be updated: obtaining direct illumination information of the target virtual scene point, wherein the direct illumination information is used to indicate the illumination effect of the direct light emitted by the virtual light source on the target virtual scene point; Acquiring 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 direct illumination information and the indirect illumination information are summed to obtain target illumination information of the target virtual scene point.

6. The method according to claim 5, wherein: The direct illumination information includes direct illumination intensity, and the step of acquiring the direct illumination information of the target virtual scene point includes: Determining a light source distance between a virtual light source in the virtual scene and the target virtual scene point; Obtaining a camera distance between the target virtual scene point and the virtual camera, and adding the camera distance to the light source distance to obtain a total distance; Determining a loss value of light source illumination intensity of the virtual light source based on the total distance and the target virtual scene point; The light source illumination intensity and the loss value are subtracted to obtain the direct illumination intensity of the target virtual scene point.

7. The method according to claim 5, wherein: The indirect lighting information includes indirect lighting intensity, and the step of obtaining the indirect lighting information of the target virtual scene point includes: Determine, from the plurality of illumination probes arranged in the virtual scene, at least one target illumination probe whose distance to the target virtual scene point is less than a distance threshold, wherein the illumination probe is used to store the illumination intensity of the corresponding position in the virtual scene after the content is changed; When the number of the target illumination probe is one, determining the illumination intensity stored in the target illumination probe as the indirect illumination intensity of the target virtual scene point; When there are multiple target illumination probes, determining a weight of each target illumination probe based on a probe distance between each target illumination probe and the target virtual scene point; According to the weights, the illumination intensities stored in the target illumination probes are weighted and summed to obtain the indirect illumination intensity of the target virtual scene point.

8. The method according to claim 7, wherein: Before determining, from among the plurality of illumination probes arranged in the virtual scene, at least one target illumination probe whose distance to the target virtual scene point is less than a distance threshold, the method further comprises: Obtaining a camera position of the virtual camera in the virtual scene; Determine a virtual scene area in the virtual scene whose distance from the camera position is less than a distance threshold as a first virtual scene area, and determine a virtual scene area in the virtual scene whose distance from the camera position is greater than or equal to the distance threshold as a second virtual scene area; In the first virtual scene area, a third number of the lighting probes are arranged, and in the second virtual scene area, a fourth number of the lighting probes are arranged, wherein the third number is greater than the fourth number.

9. The method according to claims 1 to 8, wherein: The updating of the illumination information of each virtual viewpoint in the virtual scene after the content change by combining the update voxel and the initial voxels among the multiple initial voxels except the voxel to be updated includes: The following processing is performed for each virtual viewpoint in the virtual scene after the content changes: Determine the target voxel where the virtual viewpoint is located from the update voxels and the initial voxels except the voxels to be updated, and obtain the illumination information of the target voxel; Determining the illumination information of the target voxel as updated illumination information of the virtual viewpoint; The lighting information of the virtual viewpoint is updated to the updated lighting information of the virtual viewpoint.

10. The method according to any one of claims 1 to 9, wherein: After updating the illumination information of each virtual viewpoint in the virtual scene after the content change by combining the update voxel and the initial voxels among the multiple initial voxels except the voxel to be updated, the method further includes: The following processing is performed on the updated illumination information of each virtual viewpoint after being updated: Performing spatial domain correction on the updated illumination information to obtain first illumination information, and performing temporal domain correction on the updated illumination information to obtain second illumination information; The first illumination information and the second illumination information are combined to perform error correction on the updated illumination information.

11. The method according to claim 10, wherein: The performing spatial domain correction on the updated illumination information to obtain first illumination information includes: Determine a target voxel where the virtual viewpoint is located and a plurality of adjacent voxels adjacent to the target voxel from the update voxels and the initial voxels except the voxels to be updated; Selecting a target adjacent voxel from the plurality of adjacent voxels; The illumination information of the target voxel and the illumination information of each of the target adjacent voxels are acquired, and the illumination information of the target voxel and the illumination information of each of the target adjacent voxels are weightedly summed to obtain the first illumination information of the virtual viewpoint.

12. The method according to claim 11, wherein: The step of selecting a target adjacent voxel from the plurality of adjacent voxels comprises: The following processing is performed for each of the adjacent voxels: Acquire 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 a virtual object exists between the adjacent voxel and the virtual camera, and the second occlusion information indicates that the virtual object exists 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 a virtual object exists between the adjacent voxel and the virtual camera, or when the second occlusion information indicates that the virtual object exists between the target voxel and the virtual camera, the adjacent voxel is determined as a non-adjacent voxel.

13. The method according to claim 12, wherein: The performing occlusion check on the adjacent voxel and the target voxel to obtain an occlusion check result includes: Acquire 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, performing 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 pass the first occlusion check, determining the occlusion check result as a first result; When the first occlusion check result indicates that the adjacent voxel and the target voxel do not pass the first occlusion check, obtaining a third distance between the adjacent voxel and the target voxel, and performing a 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; When the second occlusion check result indicates that the adjacent voxel and the target voxel pass the second occlusion check, determining the occlusion check result as a first result; When the second occlusion check result indicates that the adjacent voxel and the target voxel do not pass the second occlusion check, determining the occlusion check result as a second result; The first result is used to indicate that the adjacent voxel and the target voxel pass the occlusion check, and the second result is used to indicate that the adjacent voxel and the target voxel do not pass the occlusion check.

14. The method according to claim 13, wherein: The step of performing a 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: 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 a dot product threshold, determining the first occlusion check result as a third result; The third result is used to indicate that the adjacent voxel and the target voxel pass the first occlusion check.

15. The method according to claim 13, wherein: The step of performing a 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 with 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; The fourth result is used to indicate that the adjacent voxel and the target voxel pass the second occlusion check.

16. The method according to claim 13, wherein: The step of performing time domain correction on the updated illumination information to obtain second illumination information includes: Determine the target voxel where the virtual viewpoint is located from the update voxels and the initial voxels except the voxels to be updated, and obtain the illumination information of the target voxel; Determine a pixel point corresponding to the virtual viewpoint, and query a plurality of historical voxels of the pixel point in a historical update process from the plurality of initial voxels, and obtain illumination information of each of the historical voxels; The illumination information of the target voxel and the illumination information of each of the historical voxels are weightedly summed to obtain the second illumination information of the virtual viewpoint.

17. The method according to claim 10, wherein: The combining the first illumination information and the second illumination information to perform error correction on the updated illumination information includes: Performing a validity check on the first illumination information to obtain a check result; When the checking result indicates that the first illumination information is invalid, correcting the updated illumination information to the second illumination information; When the checking result indicates that the first lighting information is valid, the updated lighting information is corrected to the first lighting information.

18. The method according to claim 17, wherein: The performing validity check on the first illumination information to obtain a check result includes: Determine the target voxel where the virtual viewpoint is located from the update voxels and the initial voxels except the voxels to be updated; In the virtual scene after the content changes, a check ray is constructed with the target voxel as a starting point and the virtual camera as an end point; When the inspection ray intersects with a virtual object in the virtual scene after the content is changed, determining the inspection result as a first inspection result, wherein the first inspection result is used to indicate that the first illumination information is invalid; When the inspection ray does not intersect with the virtual object in the virtual scene after the content is changed, the inspection result is determined as a second inspection result, wherein the second inspection result is used to indicate that the first lighting information is valid.

19. The method according to any one of claims 1 to 15, wherein: After updating the illumination information of each virtual viewpoint in the virtual scene after the content change by combining the update voxel and the initial voxels among the multiple initial voxels except the voxel to be updated, the method further includes: The following processing is performed for each virtual viewpoint in the virtual scene after the content changes: Obtaining a pixel point corresponding to the virtual viewpoint in the imaging plane of the virtual camera; Determine a viewpoint distance between the virtual camera and the virtual viewpoint, and determine initial illumination information of the pixel point by combining the viewpoint distance and updated illumination information of the virtual viewpoint; Determine at least one target screen probe from a plurality of screen probes arranged in the imaging plane, the distance between the probe and the pixel point being less than a distance threshold, the screen probe being used to store illumination information of a corresponding position in the imaging plane; The illumination information stored in each target screen probe and the initial illumination information of the pixel point are weightedly summed to obtain the target illumination information of the pixel point. The target illumination information of the pixel point is used to render the image on the imaging plane of the virtual camera.

20. A lighting update device for a virtual scene, the device comprising: A voxelization module is configured to perform voxelization processing on the virtual scene to obtain a plurality of initial voxels corresponding to the virtual scene; wherein different initial voxels have different positions in the virtual scene, and the initial voxels carry lighting information of corresponding positions in the virtual scene; A selection module configured to select at least one voxel to be updated from the plurality of initial voxels in response to a change in the content of the virtual scene, wherein the number of the voxels to be updated is less than the number of the initial voxels; A voxel updating module is configured to update the illumination information carried by each of the voxels to be updated, and obtain updated voxels corresponding to each of the voxels to be updated; The lighting update module is configured to update the lighting information of each virtual viewpoint in the virtual scene after the content changes, combining the update voxel and the initial voxels among the multiple initial voxels except the voxel to be updated; wherein the virtual viewpoint is a virtual scene point in the virtual scene after the content changes that can be captured by the virtual camera.

21. An electronic device, comprising: a memory configured to store computer executable instructions or computer programs; The processor is configured to implement the lighting update method of the virtual scene described in any one of claims 1 to 19 when executing the computer executable instructions or computer programs stored in the memory.

22. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the virtual scene lighting update method according to any one of claims 1 to 19.

23. A computer program product, comprising a computer program or a computer executable instruction, wherein when the computer program or the computer executable instruction is executed by a processor, the method for updating the lighting of a virtual scene according to any one of claims 1 to 19 is implemented.