Illumination rendering method and device in virtual scene, equipment, storage medium and program product

By initializing and determining the luminous information of voxels based on the target light source position in the virtual scene, the problem of insufficient computing resources caused by the increase in the number of light sources in the virtual scene is solved, and efficient lighting rendering and realism are achieved.

CN119810304APending Publication Date: 2025-04-11BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411856181.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In virtual scenes, as the number of light sources increases, how to achieve efficient lighting rendering with a small amount of computing resources, and improve lighting effects has become an urgent problem.

Method used

By initializing the luminescence information of the virtual scene voxel based on the target light source position, the target luminescence information of the voxel is determined, wherein the luminescence information of the voxel is determined based at least on the light portion reflected back by the multiple neighbor voxels, and the illumination in the virtual scene is rendered based on the target luminescence information.

Benefits of technology

Improves the lighting rendering effect, improves the realism of lighting, and reduces the amount of lighting calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810304A_ABST
    Figure CN119810304A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an illumination rendering method and device in a virtual scene, equipment, a storage medium and a program product. The method comprises the steps of initializing light emitting information of multiple voxels of a virtual scene based on the position of a target light source in the virtual scene; determining target luminescence information of a plurality of voxels in the virtual scene, wherein first luminescence information of a first voxel in the virtual scene is determined at least based on light parts reflected back to the first voxel by the plurality of neighbor voxels; and rendering illumination in the virtual scene based on the target luminescence information. Therefore, according to the embodiment of the invention, the illumination rendering effect can be improved, the illumination reality sense can be improved, and the calculation amount of illumination calculation can also be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Example embodiments of the present disclosure generally relate to the computer field, and in particular, to a method, apparatus, device, computer-readable storage medium, and computer program product for lighting rendering in a virtual scene. Background Art

[0002] With the development of computer technology, users can use computers to place virtual objects and lighting components (e.g., lights) in scenes provided by computers (e.g., simulation environments, virtual environments, etc.), and the lighting components in these virtual scenes can provide lighting effects for the virtual scenes. In order to calculate the lighting effects in virtual environments, people have adopted various lighting calculation methods. Summary of the invention

[0003] In a first aspect of the present disclosure, a method for rendering lighting in a virtual scene is provided. The method comprises: initializing luminous information of multiple voxels of the virtual scene based on the position of a target light source in the virtual scene; determining target luminous information of multiple voxels in the virtual scene, wherein first luminous information of a first voxel in the virtual scene is determined based at least on a portion of light reflected back to the first voxel by multiple neighboring voxels; and rendering lighting in the virtual scene based on the target luminous information.

[0004] In a second aspect of the present disclosure, a device for lighting rendering in a virtual scene is provided. The device comprises: an initialization module configured to initialize the luminous information of multiple voxels of the virtual scene based on the position of a target light source in the virtual scene; a determination module configured to determine the target luminous information of multiple voxels in the virtual scene, wherein the first luminous information of a first voxel in the virtual scene is determined at least based on the light portion reflected back to the first voxel by multiple neighboring voxels; and a rendering module configured to render the lighting in the virtual scene based on the target luminous information.

[0005] In a third aspect of the present disclosure, an electronic device is provided. The device includes at least one processing unit; and at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit. When the instructions are executed by the at least one processing unit, the device executes the method of the first aspect.

[0006] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and the computer program can be executed by a processor to implement the method of the first aspect.

[0007] In a fifth aspect of the present disclosure, a computer program product is provided, which includes computer executable instructions, and when the computer executable instructions are executed by a processor, the method of the first aspect is implemented.

[0008] It should be understood that the contents described in this content section are not intended to limit the key features or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0010] Figure 1 A schematic diagram showing an example environment in which embodiments of the present disclosure can be implemented;

[0011] FIG. 2A to FIG. 2B A schematic diagram showing a lighting assembly and its lighting effect according to some embodiments of the present disclosure;

[0012] Figure 3 A schematic diagram of a lighting calculation method is shown;

[0013] Figure 4 A flowchart of lighting rendering in a virtual scene according to some embodiments of the present disclosure is shown;

[0014] Figure 5 A schematic structural block diagram of an apparatus for lighting rendering in a virtual scene according to some embodiments of the present disclosure is shown;

[0015] Figure 6 A block diagram of an electronic device capable of implementing various embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0016] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0017] It should be noted that the titles of any sections / subsections provided herein are not restrictive. Various embodiments are described throughout this article, and any type of embodiment may be included under any section / subsection. In addition, the embodiments described in any section / subsection may be combined in any manner with any other embodiments described in the same section / subsection and / or different sections / subsections.

[0018] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may be included below. The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may be included below.

[0019] The embodiments of the present disclosure may involve user data, data acquisition and / or use, etc. These aspects are subject to the corresponding laws, regulations and relevant provisions. In the embodiments of the present disclosure, all data collection, acquisition, processing, processing, forwarding, use, etc. are carried out on the premise that the user knows and confirms. Accordingly, when implementing each embodiment of the present disclosure, the type, scope of use, usage scenario, etc. of the data or information that may be involved should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with the relevant laws and regulations. The specific notification and / or authorization method can vary according to the actual situation and application scenario, and the scope of the present disclosure is not limited in this respect.

[0020] In this specification and the embodiments, if personal information processing is involved, it will be processed on the premise of having a legal basis (such as obtaining the consent of the subject of personal information, or it is necessary to perform a contract, etc.), and will only be processed within the scope of regulations or agreements. If a user refuses to process personal information other than the necessary information for basic functions, it will not affect the user's use of basic functions.

[0021] As described above, with the development of computer technology, users can use computers to place virtual objects and lighting components (e.g., lights) in scenes provided by computers (e.g., simulation environments, virtual environments, etc.), and the lighting components in these virtual scenes can provide lighting effects for the virtual scenes. In order to calculate the lighting effects in virtual environments, people have adopted various lighting calculation methods.

[0022] However, with the development of computers, the number of light sources in virtual scenes is increasing, and people's demand for various lighting effects in virtual scenes is also increasing. How to realize lighting calculations in virtual scenes with a small amount of computing resources and how to improve the lighting effects have become urgent problems to be solved.

[0023] In view of this, an embodiment of the present disclosure proposes a lighting rendering scheme in a virtual scene. According to the scheme, the luminous information of multiple voxels in the virtual scene can be initialized based on the position of the target light source in the virtual scene; the target luminous information of multiple voxels in the virtual scene can be determined, wherein the first luminous information of the first voxel in the virtual scene is determined based on at least the light portion reflected back to the first voxel by multiple neighboring voxels; and the lighting in the virtual scene can be rendered based on the target luminous information.

[0024] Based on this approach, the embodiments of the present disclosure can improve the lighting rendering effect and enhance the lighting realism, and the embodiments of the present disclosure can also reduce the amount of calculation of lighting calculations.

[0025] Example Environment

[0026] Figure 1 1 is a schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented. Figure 1 As shown, example environment 100 may include electronic device 110 .

[0027] In the example environment 100, an application 120 is installed in an electronic device 110. A user 140 can interact with the application 120 via the electronic device 110 and / or its attached devices. The application 120 can be an application that supports lighting rendering in a virtual scene, such as a game application, a modeling application, etc., or any other appropriate application.

[0028] exist Figure 1 In the environment 100 , if the application 120 is active, the application 120 may provide an interface 150 for the user 140 .

[0029] In some embodiments, the electronic device 110 communicates with the server 130 to provide services for the application 120. The electronic device 110 can be any type of mobile terminal, fixed terminal or portable terminal, including a mobile phone, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a media computer, a multimedia tablet, a personal communication system (PCS) device, a personal navigation device, a personal digital assistant (PDA), an audio / video player, a digital camera / camcorder, a positioning device, a television receiver, a radio broadcast receiver, an e-book device, a gaming device, or any combination of the foregoing, including accessories and peripherals of these devices or any combination thereof. In some embodiments, the electronic device 110 can also support any type of interface for the user (such as a "wearable" circuit, etc.).

[0030] The server 130 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks, and big data and artificial intelligence platforms. The server 130 may include, for example, a computing system / server, such as a mainframe, an edge computing node, a computing device in a cloud environment, etc. The server 130 may provide background services for the application 120 that supports light rendering in the electronic device 110.

[0031] A communication connection may be established between the server 130 and the electronic device 110. The communication connection may be established in a wired manner or a wireless manner. The communication connection may include, but is not limited to, a Bluetooth connection, a mobile network connection, a universal serial bus connection, a wireless fidelity connection, etc., and the embodiments of the present disclosure are not limited in this respect. In the embodiments of the present disclosure, the server 130 and the electronic device 110 may implement signaling interaction through the communication connection between the two.

[0032] It should be understood that the structure and function of the various elements in the environment 100 are described for exemplary purposes only and do not imply any limitation on the scope of the present disclosure.

[0033] Some example embodiments of the present disclosure will be described below with continued reference to the accompanying drawings.

[0034] Example lighting process

[0035] The following will refer to FIG. 2A to FIG. 2B To describe the lighting rendering scene according to an embodiment of the present disclosure. Figure 2A A lighting component 201 in a virtual scene is shown.

[0036] In the virtual scene provided by the electronic device 110 , the user can build various structures, and the user can also add light sources (eg, lighting component 201 ) in the virtual scene to provide lighting for the virtual environment.

[0037] In some embodiments, the electronic device 110 may add a lighting component to the virtual scene in response to receiving a light source placement operation from the user. For example, the electronic device 110 may place the lighting component 201 in the virtual scene in response to receiving a placement operation for the lighting component 201, and the lighting component 201 may provide lighting for the virtual scene. Figure 2A As shown, the lighting component 201 is a surface light source, and the lighting component 201 can illuminate the virtual environment around it. In other embodiments, the lighting component can also be a spherical light source, a point light source, etc.

[0038] refer to Figure 2B , Figure 2B A schematic diagram of a lighting assembly and a switch control is shown.

[0039] like Figure 2B As shown, in some embodiments, the electronic device 110 can provide the lighting effect of the lighting component in the virtual scene based on the configuration information of the lighting component in response to the lighting component being turned on in the virtual scene. The configuration information can be stored in a configuration file, which can be, for example, a file in JSON format.

[0040] In some embodiments, voxel data associated with the voxels may also be stored in the configuration file.

[0041] In some embodiments, the electronic device 110 may turn on the lighting component in response to receiving a preset operation for the lighting component. For example, if the electronic device 110 receives an operation indicating to turn on the lighting component via controls 202-1, 202-2, and 202-3, the electronic device 110 may turn on the virtual lighting of the lighting components 205-1, 205-2, and 205-3 corresponding to the above three controls, respectively, to provide lighting effects for the virtual environment. It should be understood that the three controls mentioned here can also control all the lighting components at the same time. For example, the electronic device 110 only needs to receive an operation for control 202-1 to turn on or off the lighting components 205-1, 205-2, and 205-3.

[0042] In some embodiments, the configuration information further indicates at least one lighting parameter associated with the plurality of virtual light sources.

[0043] In some embodiments, the virtual light sources may each have different parameters, including but not limited to the intensity, color, shape, saturation, etc. of the light. In addition, the configuration information may also indicate information such as anchor point data, attached light brightness information, and offset data. The electronic device 110 may calculate the lighting effect based on this information.

[0044] In other embodiments, the electronic device 110 may also turn on the lighting components in response to the virtual scene satisfying preset conditions. For example, when the virtual scene switches from day to night, the electronic device 110 may automatically turn on the lighting components 205-1, 205-2, and 205-3. Or the electronic device 110 may turn on the lighting components 205-1, 205-2, and 205-3 within a certain period of time according to a preset configuration. Alternatively or additionally, the electronic device 110 may also turn on the lighting components 205-1, 205-2, and 205-3 in response to a virtual object or player character being located within a preset range or area. After turning on the lighting components, the lighting components can provide light sources for the virtual environment, and the electronic device 110 needs to perform lighting calculations for the virtual environment.

[0045] like Figure 3 As shown, Figure 3 An example 300 of a method for calculating voxel light sources is shown.

[0046] like Figure 3 As shown, the light intensity at position 302 is 10, and the light intensities at other positions are associated with position 302. The light intensities at these positions gradually decrease according to the distance from position 302. The light intensity at position 302 can be calculated by Figure 2A and Figure 2B The electronic device 110 can calculate the lighting effect in the virtual scene in response to the activation of these lighting components.

[0047] However, the aforementioned lighting calculation scheme has some significant defects. First, the shape of the light source is a diamond, which makes the illuminated area appear unrealistic and unnatural. Second, the scheme cannot support voxel light sources of arbitrary colors because it is limited to integer values ​​between 0 and 15. In addition, hue changes may occur during light propagation. For example, the original lighting of [3,2,1] may become [2,1,0] and [1,0,0] in sequence, and may even turn to red in the end. Finally, the scheme cannot achieve the superposition effect of lighting. When two beams of light meet, only the maximum value of each channel can be taken, which will cause obvious artifacts.

[0048] However, if a path tracing or global illumination algorithm is used, the computing power of the electronic device 110 will be consumed too much, resulting in low efficiency of the illumination calculation.

[0049] The disclosed embodiment combines the voxel light calculation method of cellular automaton and Figure 3 Combining the illumination calculation method shown in can avoid the above problems and save a lot of computing power. Cellular automata is an algorithm framework: the space is divided into cells (voxel units), each cell is affected by the surrounding neighboring cells, and the rules of this influence are unified for each cell. Each cell in the cellular automaton evolves according to the established rules in a certain area and time domain.

[0050] In the cellular automaton of the embodiment of the present disclosure, a cell is affected by the surrounding cells. In the following, the cell can be a voxel in the virtual scene, and the lighting calculation of each voxel will be affected by the voxels around it. For the lighting calculation, the energy of light in a cell comes from the sum of the energy transmitted to the cell by the surrounding adjacent cells, that is, considering the visibility and transfer function between cells, the lighting calculation of the cellular automaton of the present disclosure can be preliminarily defined as follows:

[0051]

[0052] In formula (1), the Visible function can be determined using the "absorbance" property of each block (i.e., voxel or cell). As for the transmission of Randiance (i.e., the transmission of light), an inspiring calculation method is proposed in the global illumination algorithm (LPV):

[0053] First, the radiance of the source point is expressed as a spherical harmonic function, and then the radiance of the five non-adjacent faces transmitted to the adjacent grid is considered to calculate the total energy of the target grid. Since calculating the energy of the entire surface is too complicated, LPV assumes that all energy is received from the center of the surface, and then the energy of the surface is obtained by multiplying the radiance in the direction of the source point and the center point of the surface by the solid angle corresponding to the surface. The calculation of the radiance of this surface can also be easily obtained because the source point has been represented by spherical harmonics before.

[0054] However, the above method is relatively complex to calculate, especially when the energy is represented as a spherical harmonic function, and it needs to be performed in each dimension of the spherical harmonic coefficient vector (the dimension of the third-order spherical harmonic coefficient is 9). This will increase the amount of calculation and memory in the CPU, making the calculation of the lighting calculation too intensive.

[0055] In order to reduce the computing power consumption of lighting calculation and ensure the authenticity of lighting to the greatest extent, the embodiments of the present disclosure propose the lighting calculation process described below.

[0056] In some embodiments, the electronic device 110 may initialize the light emission information of a plurality of voxels of the virtual scene based on the position of the target light source in the virtual scene.

[0057] For example, the electronic device 110 may assume that there is a virtual light source in each cell, the light source radiates energy uniformly in all directions, and each cell transfers energy to the outside and receives energy from the outside and is concentrated on the virtual light source. The electronic device 110 may select a virtual light source as a target light source and inject lighting information into voxels in the virtual scene according to its position.

[0058] The illumination calculation process may be referred to as an illumination diffusion process, and the illumination diffusion process may be iteratively calculated by the electronic device 110 .

[0059]

[0060] The above diffusion process (Formula (2)) may include the transfer of the Irradiance of the virtual light source (where L represents Irradiance, T is the transfer coefficient, V is visibility, p represents the target voxel, and np represents the adjacent voxel or neighbor voxel of the target voxel).

[0061] In some embodiments, the electronic device 110 may iteratively perform the following light diffusion process at least once:

[0062] First, the electronic device 110 may determine first light emitting information of a first voxel in a previous diffusion process and second light emitting information of a plurality of neighboring voxels of the first voxel in a previous diffusion process.

[0063]

[0064] The above formula (3) represents the light transmission process, but does not take into account the reflection of light, where That is, it is the first luminous information, and α and (1-α) are weighting coefficients, which control the influence ratio of the first luminous information in the previous diffusion process on the luminous information in the next diffusion process.

[0065] That is, the second luminescence information of multiple neighboring voxels in the previous diffusion process.

[0066] In some embodiments, the electronic device 110 may determine target luminescence information of a plurality of voxels in a virtual scene, wherein first luminescence information of a first voxel in the virtual scene is determined based at least on light portions reflected back to the first voxel by a plurality of neighboring voxels.

[0067] In some embodiments, the target luminous information may be a superposition of luminous information in a virtual scene, for example, a superposition of lighting from other voxels, lighting reflected to voxels, and ambient light in the virtual environment.

[0068] For a cell, if its neighbor is an opaque grid, then light reflection will occur. The light in the cell first illuminates the opaque grid, and then the light is reflected and fed back to itself. The reflected energy is related to the material of the object in the cell.

[0069] In some embodiments, the electronic device 110 may determine first light portions transmitted to the first voxel by the plurality of neighbor voxels based on the second light emission information, and determine second light portions reflected back to the first voxel by the plurality of neighbor voxels based on the first light emission information.

[0070] For example, the diffuse term (i.e., the second light part), that is, the reflected energy, is related to the intrinsic color of the object in the cell, and can be expressed as follows:

[0071]

[0072] In some embodiments, the electronic device 110 may determine a first propagation property of a plurality of neighboring voxels to a first voxel and a first material property of the first voxel. For example, the first propagation property may be T(p,np), which indicates a propagation coefficient of illumination. The first material property may include V(p,np), which indicates visibility or illumination absorption rate of the first voxel.

[0073] In some embodiments, the electronic device 110 may determine the first light portion transmitted to the first voxel by the plurality of neighboring voxels based on the second luminescence information, the first propagation property, and the first material property. For example, the electronic device 110 may determine the illumination diffused from the neighboring voxels of the first voxel to the first voxel based on the second luminescence information, the first propagation property, and the first material property.

[0074] In some embodiments, the electronic device 110 may determine a second material attribute of the plurality of neighbor voxels and a second propagation attribute from the first voxel to the plurality of neighbor voxels.

[0075] For example, R in formula (4) is the reflectivity, which is set to 1 only at opaque cells in the disclosed embodiment, diffuse is the material representation at the cell (i.e., the second material attribute), which is only related to the intrinsic color of the cell. In the disclosed embodiment, each block has a basic attribute of coloring information, which is calculated as the mean of the intrinsic color, and Tr is the transmission parameter during reflection (i.e., the second propagation attribute).

[0076] In some embodiments, the electronic device 110 may determine the second light portions reflected back to the first voxel by a plurality of neighbor voxels (ie, the light portions reflected to the first voxel by the neighbor voxels) based on the first light emission information, the second propagation property, and the second material property.

[0077] In some embodiments, the electronic device 110 may determine the first light portion and the second light portion to determine the fused light emitting information.

[0078] For example, in the above formula, The formula for calculating the first light fraction delivered to the first voxel is expressed as: where T is the transmission rate and V is the absorption rate of the first voxel. And Represents the light intensity reflected by the neighboring cells, that is, the light intensity of the first voxel * its material representation * transmission rate * reflectivity. Sum the above parts and then multiply them by the corresponding weighting coefficient to get the fused luminescence information.

[0079] In some embodiments, the electronic device 110 may determine to update the light emitting information based on a weighted sum of the fused light emitting information and the first light emitting information.

[0080] For example, the embodiments of the present disclosure also take into account the impact of temporal changes in illumination. That is, the influence of the illumination at the previous moment on the illumination at the next moment, where α is the weighting coefficient.

[0081] In some embodiments, the electronic device 110 may also determine updated luminescence information of the first voxel in the current diffusion process based at least on the first light portion and the second light portion. Here, the first light portion corresponds to the transmission portion of light between voxels, and the second portion corresponds to the reflection portion of light. The electronic device 110 may start the next round of iterative illumination calculation based on the updated luminescence information until the iteration is completed or the calculation result converges.

[0082] Regarding the voxel optical cellular automaton evolution, the disclosed embodiment proposes the following process:

[0083] Since the data of the voxel world is organized in sections (a section is a part including multiple voxels, for example, 16*16*16 voxels), each section includes multiple voxels, and the lighting update of the voxel light is also in sections. If the electronic device 110 detects that the user builds or destroys the virtual scene, the lighting update task will be triggered. These tasks run independently on asynchronous threads and will not block the main thread. Each lighting update will completely evolve the lighting data in a section throughout its life cycle.

[0084] The illumination evolution process of a cellular automaton for a segment can be calculated as follows:

[0085] Collect and inject the voxel light sources that affect the segment (i.e., initialize), and use them as the evolution result of generation 0. According to the evolution result of the previous generation, run the rules of the cellular automaton to obtain the evolution result of the next generation. Continue to iterate until the light field is stable and output to the main thread.

[0086] However, the voxel light source that affects one segment may exist in the surrounding 27 segments (limiting the maximum propagation distance of a light source to 16). This process requires N iterations for each cell within the 48*48*48 voxel range (N is the life span of the cellular automaton). If 12 iterations are assumed, it is necessary to run about 8 million (48*48*48*6*12) cellular automaton rules, which will result in an excessive amount of calculation.

[0087] The evolution process of the voxel optical cellular automaton of the embodiment of the present disclosure is described below.

[0088] In some embodiments, the electronic device 110 may determine, during the illumination diffusion process, a first voxel in an activated state from a plurality of voxels, where the activated state indicates that at least one neighbor of the first voxel has illumination information.

[0089] For example, the electronic device 110 can determine the activated cells. The electronic device 110 marks the cells in the cellular automaton as activated and inactivated. In the cellular automaton, if none of the neighbors of a cell have illumination data, the cell is in an inactivated state and does not need to be calculated. In the initial illumination injection stage, the voxel light source itself and its surrounding neighbors can be set to an activated state, and if the illumination in a cell exceeds a certain threshold during the transmission process, its neighbors will also be activated. The above method can greatly reduce the amount of calculation.

[0090] In some embodiments, the electronic device 110 may determine a diffusion area within a preset range of the position based on the position of the target light source in the virtual scene. The electronic device 110 may also initialize the light emission information of multiple voxels within the diffusion area.

[0091] For example, the electronic device 110 can determine the convergent cell. Since the target area for the update is a 16*16*16 segment, and each evolution of the cell will only pass the light to its neighbors, considering the last evolution of the cellular automaton, the data required are only the cells covered by the segment itself and the data of a circle of cells adjacent to the segment (i.e., the diffusion range), that is, the cell data of the range of 18*18*18 (i.e., the preset area within the diffusion range).

[0092] In some embodiments, the luminous information of the voxels outside the diffusion region is independent of the luminous information of the multiple voxels in the diffusion region. In other words, as the cellular automaton evolves, the cellular region that needs to be updated can converge. Therefore, even if a lot of positions are activated in the later stage of the evolution of the cellular automaton, the consumption of computing resources can be controlled within a reasonable range. Afterwards, the electronic device 110 can perform the injection of light (i.e., initialization).

[0093] Through the rules and evolution of the above-mentioned voxel optical cellular automaton, we can eventually obtain light field data that supports arbitrary colors and light superposition.

[0094] In some embodiments, the electronic device 110 may determine first light field information corresponding to the target light source based on a light diffusion process.

[0095] In some embodiments, the electronic device 110 may also determine the lighting effect of the virtual scene based on the first light field information and the second light field information corresponding to the sky light source, and the electronic device 110 may also render the lighting in the virtual scene based on the target luminous information.

[0096] For example, the light field generated by the voxel light source can be obtained by evolving the voxel light source, and the skylight (i.e., ambient light, i.e., the second light field information) can be transmitted and evolved to obtain the skylight shielding. Finally, the electronic device 110 can combine these two items as the global diffuse reflection part in the virtual scene, as shown in formula (5):

[0097] L diffuse =(VoxelSkyValue*SH sky +VoxelLightValue)*brdf (5)

[0098] VoxelLightValue and VoxelSkyValue are the light field data (i.e., the first light field information) generated by the voxel light source and the occlusion data generated by the skylight obtained by the above algorithm, respectively. skg A map representing skylight. In addition, the ambient light generated by skylight can be expressed as a spherical harmonic function, which can efficiently create lighting effects at different times or in different weather conditions.

[0099] The disclosed embodiment also provides an optimization method and a rendering process for the above-mentioned illumination calculation process:

[0100] The disclosed embodiments may use thread local data to improve memory allocation efficiency and save memory space.

[0101] For example, during the voxel light update iteration of each segment, several large buffers are needed to store intermediate data, such as the evolution results of the previous and current generations in the cellular automaton (48*48*48 floating-point numbers). Applying for a large buffer on the CPU itself takes a long time and causes a lot of memory waste. If an ordinary memory pool is allocated, it is also necessary to deal with the expansion and contraction of the memory pool and data contention issues.

[0102] In some examples, the electronic device 110 can manage a thread-local data pool on a thread-by-thread basis. The advantage of this is that the electronic device 110 can pre-apply for a buffer when the game is started (or a virtual scene is entered), and the buffer size is fixed, and only one task is performed on each thread at the same time. In addition, the above threads do not need to be locked, thereby saving time for applying for memory and saving a lot of memory.

[0103] In some examples, the electronic device 110 may use update dependencies to prevent multiple callbacks to the main thread.

[0104] For example, when the voxel light is updated, the electronic device 110 can initiate multiple tasks, such as the skylight transmission task and the voxel light source transmission task. If these tasks are completed each time and the main thread is called back to update the performance data, it will cause a lot of waste. Therefore, the electronic device 110 can set the root node dependency on the task, and only when the tasks initiated by the root node are completed, will the main thread be notified to update the performance data.

[0105] Regarding voxel light data storage, since the entire voxel light update is completed on the CPU side, the electronic device 110 can store the voxel light data in memory and files. When the world is stable, there is no need to update the lighting, thereby achieving better operating efficiency.

[0106] In order to reduce memory usage, the electronic device 110 may compress the data on the segment. Specifically, there are three forms of data storage.

[0107] The first compression method: the data is stored in the memory in the form of original data, that is, 16*16*16 illumination data are stored, and this state is transient.

[0108] Second compression method: When the data on the segment is all the same value, it will be compressed into a shared format and indexed into a shared memory.

[0109] The third compression method: When the data in the segment cannot be compressed by the second compression method, the block data with the same key will be merged and arranged tightly in the memory.

[0110] Through the above data compression method, the data memory of the virtual scene loaded by the electronic device 110 can be effectively reduced.

[0111] The following will describe how to submit voxel light to the graphics processing unit and perform light shading processing. In addition, the following will also describe the process of the electronic device 110 rendering the lighting in the virtual scene based on the target luminous information. There are two ways to submit voxel light to the graphics processing unit, one is to submit it as vertex data, and the other is to submit it as a three-dimensional texture. In many voxel games, the data of voxel light is submitted as vertex data, but this method has some problems. The following is an analysis of the two methods:

[0112] Regarding performance, storing lighting data on vertices will lead to several problems. On the one hand, due to the characteristics of rasterization, the organization order of vertices will have a relatively large impact on lighting. This problem can be solved by using a solution that further divides the triangles, but this will greatly increase the vertex data of the mesh. On the other hand, this method cannot handle the lighting of B model type blocks (B model means that the mesh data in the block is a complex model rather than a simple cube). The texture-based lighting solution will not have these two problems at all. The following is a performance comparison of the two solutions. However, the texture-based solution still has a problem: light leakage (light passes through the model and causes incorrect lighting effects).

[0113] Regarding memory usage, the presence of lighting data on vertices will cause mesh generation and lighting generation to be coupled together. In order to ensure that the mesh can update lighting information independently, the reading and writing of the mesh can be enabled, which will generate more redundant memory usage. Saving lighting data in textures can save this part of memory.

[0114] In terms of operating efficiency, the solution of using vertices to store lighting data will have better efficiency on the graphics processing unit. The solution using textures requires an additional sampling and UV (UV coordinate) calculation on the graphics processing unit, but the size of the texture can be controlled within a segment, so that the map is smaller and has better memory friendliness, which can alleviate the problem. However, the texture-based solution has more serious problems, the number of materials is greatly increased and the number of instructions submitted by the CPU to the graphics processing unit is greatly increased (the programmable rendering pipeline cluster is interrupted).

[0115] Through the above analysis, although the texture-based lighting solution will achieve better results, if this solution is needed, it is also necessary to solve the various problems it brings.

[0116] In order to obtain better efficiency, the electronic device 110 may directly organize the lighting texture of each segment instead of forming a large three-dimensional texture (the solution used by most Irradiance Volume-based global illumination solutions). However, this method requires setting the texture to each segment, which will generate more material instances. In order to reduce the number of materials and use the same shared material instance, the electronic device 110 may set the texture to the attributes of the renderer.

[0117] In some embodiments, in order to solve the problem of the directionality of light in the light field, the electronic device 110 can determine the gradient information associated with the target luminous information. The electronic device 110 can uniformly consider the directionality of the cellular automaton evolution results when rendering the lighting in the virtual scene. The electronic device 110 can also render the lighting in the virtual scene based on the above gradient information. Specifically, after obtaining the lighting result of the segment, the electronic device 110 can perform a gradient calculation on the light field data on this segment, and use the gradient direction on the entire light field to supplement the sense of direction of the voxel light.

[0118] Since a texture-based lighting solution is used, and the lighting value of each pixel comes from the linear sampling of the texture, this may cause light leakage. The general solution to the light leakage phenomenon is to deal with it through normal offset, line of sight offset, etc. There are also some global illumination solutions that perform Chebyshev tests to solve the light leakage problem.

[0119] In some embodiments, the electronic device 110 can determine the normal information associated with the first voxel based on the position information of multiple neighbor voxels, and the electronic device 110 can also render the lighting in the virtual scene based on the normal information. For the light leakage processing of the virtual scene, on the one hand, it is solved by the traditional line of sight offset, and on the other hand, thanks to the fact that the information of the neighbors of a block in the virtual scene is knowable, therefore, the electronic device 110 can calculate its curved normal at the same time when generating the grid, and handle the light leakage problem by offsetting the curved normal, and the above light leakage processing method is efficient and reliable. For the calculation of the curved normal, the electronic device 110 can traverse the adjacent blocks of a block to see if they are air, and then obtain the direction of the curved normal. Of course, it can also be obtained by scattering points on the hemisphere of its normal.

[0120] Through the above process, the embodiment of the present disclosure can increase the realism of the lighting effect, while reducing the amount of calculation of the lighting calculation, thereby increasing the rendering efficiency of the electronic device.

[0121] Example Process

[0122] Figure 4 4 is a flowchart showing an example process 400 for lighting rendering in a virtual scene according to some embodiments of the present disclosure. The process 400 may be implemented at the electronic device 110. Figure 1 Process 400 is described.

[0123] In block 410 , the electronic device 110 initializes light emission information of a plurality of voxels of the virtual scene based on a position of a target light source in the virtual scene.

[0124] At block 420 , the electronic device 110 determines target luminescence information for a plurality of voxels in the virtual scene, wherein first luminescence information for a first voxel in the virtual scene is determined based at least on portions of light reflected back to the first voxel by a plurality of neighboring voxels.

[0125] In block 430 , the electronic device 110 renders lighting in the virtual scene based on the target luminescence information.

[0126] In some embodiments, determining target luminescence information of multiple voxels in a virtual scene includes: iteratively performing the following lighting diffusion process at least once: determining first luminescence information of a first voxel in a previous diffusion process and second luminescence information of multiple neighbor voxels of the first voxel in the previous diffusion process; based on the second luminescence information, determining a first light portion transmitted to the first voxel by multiple neighbor voxels, and based on the first luminescence information, determining a second light portion reflected back to the first voxel by multiple neighbor voxels; and based on at least the first light portion and the second light portion, determining updated luminescence information of the first voxel in a current diffusion process.

[0127] In some embodiments, determining the first light portion transmitted from multiple neighbor voxels to the first voxel based on the second luminescence information includes: determining the first propagation properties from the multiple neighbor voxels to the first voxel and the first material properties of the first voxel; and determining the first light portion transmitted from the multiple neighbor voxels to the first voxel based on the second luminescence information, the first propagation properties, and the first material properties.

[0128] In some embodiments, determining the second light portion reflected back to the first voxel by multiple neighbor voxels based on the first luminescence information includes: determining the second material properties of the multiple neighbor voxels and the second propagation properties from the first voxel to the multiple neighbor voxels; and determining the second light portion reflected back to the first voxel by the multiple neighbor voxels based on the first luminescence information, the second propagation properties and the second material properties.

[0129] In some embodiments, determining updated luminescence information of a first voxel in a current diffusion process based at least on a first light portion and a second light portion includes: determining the first light portion and the second light portion, determining fused luminescence information; and determining updated luminescence information based on a weighted sum of the fused luminescence information and the first luminescence information.

[0130] In some embodiments, process 400 further includes: in the illumination diffusion process, determining a first voxel in an activated state from the plurality of voxels, the activated state indicating that at least one neighbor of the first voxel has illumination information.

[0131] In some embodiments, process 400 further includes: determining first light field information corresponding to the target light source based on the light diffusion process; and determining a lighting effect of the virtual scene based on the first light field information and second light field information corresponding to the sky light source.

[0132] In some embodiments, initializing the luminous information of multiple voxels of the virtual scene includes: determining a diffusion area within a preset range of the position based on the position of the target light source in the virtual scene; and initializing the luminous information of multiple voxels within the diffusion area.

[0133] In some embodiments, the luminescence information of the voxels outside the diffusion region is independent of the luminescence information of the plurality of voxels within the diffusion region.

[0134] In some embodiments, rendering the lighting in the virtual scene further comprises: determining normal information associated with the first voxel based on position information of a plurality of neighboring voxels; and rendering the lighting in the virtual scene based on the normal information.

[0135] In some embodiments, rendering the lighting in the virtual scene further includes: determining gradient information associated with the target luminescence information; and rendering the lighting in the virtual scene based on the gradient information.

[0136] Example devices and equipment

[0137] The embodiments of the present disclosure also provide corresponding devices for implementing the above methods or processes. Figure 5 A schematic structural block diagram of an apparatus 500 for lighting rendering in a virtual scene according to some embodiments of the present disclosure is shown. The apparatus 500 may be implemented as or included in the electronic device 110 as discussed above. Each module / component in the apparatus 500 may be implemented by hardware, software, firmware, or any combination thereof.

[0138] like Figure 5 As shown, the device 500 includes an initialization module 510, which is configured to initialize the luminescence information of multiple voxels of the virtual scene based on the position of the target light source in the virtual scene; a determination module 520, which is configured to determine the target luminescence information of multiple voxels in the virtual scene, wherein the first luminescence information of the first voxel in the virtual scene is determined based on at least the part of light reflected back to the first voxel by multiple neighboring voxels; and a rendering module 530, which is configured to render the lighting in the virtual scene based on the target luminescence information.

[0139] In some embodiments, the device 500 also includes an iteration module configured to: iteratively perform the following light diffusion process at least once: determine the first luminescence information of the first voxel in the previous diffusion process and the second luminescence information of multiple neighbor voxels of the first voxel in the previous diffusion process; based on the second luminescence information, determine the first light portion transmitted to the first voxel by multiple neighbor voxels, and based on the first luminescence information, determine the second light portion reflected back to the first voxel by multiple neighbor voxels; and based on at least the first light portion and the second light portion, determine the updated luminescence information of the first voxel in the current diffusion process.

[0140] In some embodiments, the device 500 also includes a first determination module, which is configured to: determine a first propagation property from multiple neighbor voxels to a first voxel and a first material property of the first voxel; and determine a first light portion transmitted from multiple neighbor voxels to the first voxel based on the second luminescence information, the first propagation property and the first material property.

[0141] In some embodiments, the device 500 also includes a second determination module, which is configured to: determine a second material property of multiple neighbor voxels and a second propagation property from the first voxel to multiple neighbor voxels; and determine a second light portion reflected back to the first voxel by the multiple neighbor voxels based on the first luminescence information, the second propagation property and the second material property.

[0142] In some embodiments, the device 500 further includes a third determination module configured to: determine the first light portion and the second light portion, determine fused luminescence information; and determine updated luminescence information based on a weighted sum of the fused luminescence information and the first luminescence information.

[0143] In some embodiments, the apparatus 500 further includes a fourth determination module configured to: during the illumination diffusion process, determine a first voxel in an activated state from a plurality of voxels, wherein the activated state indicates that at least one neighbor of the first voxel has illumination information.

[0144] In some embodiments, the device 500 also includes a fifth determination module configured to: determine first light field information corresponding to the target light source based on the light diffusion process; and determine the lighting effect of the virtual scene based on the first light field information and second light field information corresponding to the sky light source.

[0145] In some embodiments, the apparatus 500 further includes a sixth determination module configured to: determine a diffusion area within a preset range of the position based on the position of the target light source in the virtual scene; and initialize luminescence information of a plurality of voxels within the diffusion area.

[0146] In some embodiments, the luminescence information of the voxels outside the diffusion region is independent of the luminescence information of the plurality of voxels within the diffusion region.

[0147] In some embodiments, the apparatus 500 further includes a seventh determination module configured to: determine normal information associated with the first voxel based on position information of a plurality of neighboring voxels; and render lighting in the virtual scene based on the normal information.

[0148] In some embodiments, the apparatus 500 further includes an eighth determination module configured to: determine gradient information associated with the target luminescence information; and render the lighting in the virtual scene based on the gradient information.

[0149] The units included in the device 500 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more units can be implemented using software and / or firmware, such as machine executable instructions stored on a storage medium. In addition to or as an alternative to machine executable instructions, some or all of the units in the device 500 can be implemented at least in part by one or more hardware logic components. As an example and not limitation, exemplary types of hardware logic components that can be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0150] Figure 6 1 shows a block diagram of an electronic device 600 in which one or more embodiments of the present disclosure may be implemented. It should be understood that Figure 6 The electronic device 600 shown is merely exemplary and should not constitute any limitation on the functionality and scope of the embodiments described herein. Figure 6 The electronic device 600 shown can be used to implement Figure 1 Electronic device 110 or Figure 5 Device 500.

[0151] like Figure 6 As shown, the electronic device 600 is in the form of a general electronic device. The components of the electronic device 600 may include, but are not limited to, one or more processors or processing units 610, a memory 620, a storage device 630, one or more communication units 640, one or more input devices 650, and one or more output devices 660. The processing unit 610 may be an actual or virtual processor and is capable of performing various processes according to a program stored in the memory 620. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to improve the parallel processing capability of the electronic device 600.

[0152] The electronic device 600 typically includes a plurality of computer storage media. Such media can be any available media accessible to the electronic device 600, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 620 can be a volatile memory (e.g., registers, caches, random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory) or some combination thereof. The storage device 630 can be a removable or non-removable medium, and can include a machine-readable medium, such as a flash drive, a disk, or any other medium, which can be used to store information and / or data and can be accessed within the electronic device 600.

[0153] The electronic device 600 may further include additional removable / non-removable, volatile / non-volatile storage media. Figure 6 As shown in , a disk drive for reading or writing from a removable, non-volatile disk (e.g., a "floppy disk") and an optical drive for reading or writing from a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to the bus (not shown) by one or more data media interfaces. The memory 620 may include a computer program product 625 having one or more program modules that are configured to perform various methods or actions of various embodiments of the present disclosure.

[0154] The communication unit 640 implements communication with other electronic devices through a communication medium. Additionally, the functions of the components of the electronic device 600 can be implemented with a single computing cluster or multiple computing machines that can communicate through a communication connection. Therefore, the electronic device 600 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.

[0155] The input device 650 may be one or more input devices, such as a mouse, a keyboard, a tracking ball, etc. The output device 660 may be one or more output devices, such as a display, a speaker, a printer, etc. The electronic device 600 may also communicate with one or more external devices (not shown) through the communication unit 640 as needed, such as a storage device, a display device, etc., communicate with one or more devices that allow a user to interact with the electronic device 600, or communicate with any device that allows the electronic device 600 to communicate with one or more other electronic devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).

[0156] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which computer-executable instructions are stored, wherein the computer-executable instructions are executed by a processor to implement the method described above. According to an exemplary implementation of the present disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above.

[0157] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices, equipment, and computer program products implemented according to the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0158] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0159] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, so that the instructions executed on the computer, other programmable data processing apparatus, or other device implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0160] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple implementations of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some implementations as replacements, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.

[0161] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The selection of terms used herein is intended to best explain the principles of the implementations, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the various implementations disclosed herein.

Claims

1. A lighting rendering method in a virtual scene, comprising: Initializing luminous information of a plurality of voxels of the virtual scene based on a position of a target light source in the virtual scene; Determining target luminescence information of a plurality of voxels in the virtual scene, wherein first luminescence information of a first voxel in the virtual scene is determined based at least on a portion of light reflected back to the first voxel by a plurality of neighboring voxels; as well as Based on the target luminescence information, the lighting in the virtual scene is rendered.

2. The method according to claim 1, wherein determining the target luminescence information of the plurality of voxels in the virtual scene comprises: Iteratively perform the following light diffusion process at least once: Determine first luminescence information of a first voxel in a previous diffusion process and second luminescence information of a plurality of neighboring voxels of the first voxel in the previous diffusion process; determining first light portions transmitted to the first voxel by the plurality of neighbor voxels based on the second light emission information, and determining second light portions reflected back to the first voxel by the plurality of neighbor voxels based on the first light emission information; as well as Based at least on the first light portion and the second light portion, updated luminescence information of the first voxel in a current diffusion process is determined.

3. The method according to claim 2, wherein determining the first light portion transmitted to the first voxel by the plurality of neighbor voxels based on the second light emission information comprises: determining a first propagation attribute of the plurality of neighbor voxels to the first voxel and a first material attribute of the first voxel; as well as Based on the second luminescence information, the first propagation property, and the first material property, a portion of the first light transmitted from the plurality of neighbor voxels to the first voxel is determined.

4. The method of claim 2, wherein determining the second light portion reflected back to the first voxel by the plurality of neighbor voxels based on the first light emission information comprises: determining a second material attribute of the plurality of neighbor voxels and a second propagation attribute of the first voxel to the plurality of neighbor voxels; as well as The second light portions reflected back to the first voxel by the plurality of neighbor voxels are determined based on the first luminescence information, the second propagation properties, and the second material properties.

5. The method of claim 2, wherein determining updated luminescence information of the first voxel in a current diffusion process based at least on the first light portion and the second light portion comprises: determining the first light portion and the second light portion, and determining fused luminescence information; as well as The updated luminescence information is determined based on a weighted sum of the fused luminescence information and the first luminescence information.

6. The method according to claim 2, further comprising: In the illumination diffusion process, the first voxel in an activated state is determined from the plurality of voxels, the activated state indicating that at least one neighbor of the first voxel has illumination information.

7. The method according to claim 2, further comprising: Based on the light diffusion process, determining first light field information corresponding to the target light source; as well as The lighting effect of the virtual scene is determined based on the first light field information and the second light field information corresponding to the sky light source.

8. The method according to claim 1, wherein initializing the luminescence information of a plurality of voxels of the virtual scene comprises: Based on the position of the target light source in the virtual scene, determining a diffusion area within a preset range of the position; as well as The light emission information of the plurality of voxels within the diffusion region is initialized. 9 . The method of claim 8 , wherein the luminescence information of the voxels outside the diffusion region is independent of the luminescence information of the plurality of voxels within the diffusion region.

10. The method of claim 1, wherein rendering lighting in the virtual scene further comprises: Determining normal information associated with the first voxel based on position information of the plurality of neighbor voxels; as well as Based on the normal information, the lighting in the virtual scene is rendered.

11. The method of claim 1 , wherein rendering lighting in the virtual scene further comprises: Determining gradient information associated with the target luminescence information; as well as Based on the gradient information, the lighting in the virtual scene is rendered.

12. A device for lighting rendering in a virtual scene, comprising: An initialization module, configured to initialize the luminescence information of a plurality of voxels of the virtual scene based on the position of the target light source in the virtual scene; a determination module configured to determine target luminescence information of a plurality of voxels in the virtual scene, wherein first luminescence information of a first voxel in the virtual scene is determined based at least on a portion of light reflected back to the first voxel by a plurality of neighboring voxels; as well as A rendering module is configured to render the lighting in the virtual scene based on the target luminescence information.

13. An electronic device, comprising: at least one processing unit; as well as At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 11 when executed by the at least one processing unit.

14. A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1 to 11 when executed by a processor.

15. A computer program product tangibly stored in a computer storage medium and comprising computer executable instructions which, when executed by a device, cause the device to perform the method according to any one of claims 1 to 11.

Citation Information

Cited By

  • Object rendering method and device and storage medium

    CN121616734A

  • Object rendering method, device and storage medium

    CN121616734B