Lighting information loading method and device, computer device and storage medium

By filtering and loading the storage blocks of lighting information that have a significant impact, the problem of wasted storage resources in lighting rendering is solved, and efficient utilization of storage resources is achieved.

CN117011119BActive Publication Date: 2026-11-24TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210645771.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-09
Publication Date
2026-11-24
Estimated Expiration
2042-06-09

AI Technical Summary

Technical Problem

In traditional lighting rendering techniques, the uniform loading of lighting information leads to a waste of storage resources and fails to make effective use of them.

Method used

By determining the candidate lighting information storage blocks and their weights, lighting information storage blocks that have a significant impact on rendering effects are selected for loading, thus reducing the number of blocks to be loaded.

Benefits of technology

While ensuring rendering quality, it saves storage resources and improves storage utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117011119B_ABST
    Figure CN117011119B_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, computer device, and storage medium for loading lighting information. It pertains to the field of gaming and includes: determining at least one candidate lighting information storage block; said candidate lighting information storage block is a lighting information storage block associated with a target image to be rendered; determining storage block weights corresponding to each of the at least one candidate lighting information storage block; determining a lighting information storage block to be loaded from the at least one candidate lighting information storage block according to the storage block weights, and loading the lighting information storage block to be loaded; wherein the loaded lighting information storage block is used for lighting calculations to render the target image. This method can save storage resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of lighting rendering technology, and in particular to a method, apparatus, computer device, and storage medium for loading lighting information. Background Technology

[0002] With the development of computer technology and the gaming industry, lighting rendering technology has emerged. This technology can be used to render images with realistic lighting effects. For example, many scenes in a game scene are illuminated, and lighting rendering technology can be used to render images in the game scene that have lighting effects.

[0003] In traditional techniques, when rendering lighting information, all pre-stored lighting information is loaded into the GPU. Loading all stored lighting information at once consumes a lot of storage space. However, in actual lighting rendering, it is usually not necessary to use all the lighting information, so unnecessary lighting information is loaded, resulting in a waste of storage resources. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, apparatus, computer device, and computer-readable storage medium for loading illumination information that can save storage resources, in order to address the above-mentioned technical problems.

[0005] On one hand, this application provides a method for loading lighting information. The method includes: determining at least one candidate lighting information storage block; the candidate lighting information storage block is a lighting information storage block associated with a target image to be rendered; determining the storage block weights corresponding to the at least one candidate lighting information storage block respectively; determining the lighting information storage block to be loaded from the at least one candidate lighting information storage block according to the storage block weights, and loading the lighting information storage block to be loaded; wherein the loaded lighting information storage block is used to perform lighting calculations to render the target image.

[0006] On the other hand, this application also provides a lighting information loading apparatus. The apparatus includes: a storage block determination module, configured to determine at least one candidate lighting information storage block; the candidate lighting information storage block is a lighting information storage block associated with a target image to be rendered; a weight determination module, configured to determine the storage block weights corresponding to the at least one candidate lighting information storage block; and a loading module, configured to determine the lighting information storage block to be loaded from the at least one candidate lighting information storage block according to the storage block weights, and load the lighting information storage block to be loaded; wherein the loaded lighting information storage block is used for lighting calculations to render the target image.

[0007] In some embodiments, the storage block determination module is further configured to determine the associated illumination information storage block of the target image from a plurality of preset illumination information storage blocks; and determine the candidate illumination information storage block based on the associated illumination information storage block.

[0008] In some embodiments, the storage block determination module is further configured to determine, from a plurality of preset illumination information storage blocks, a first illumination information storage block that is adjacent to a plurality of pixels in the target image; and perform deduplication processing based on the first illumination information storage block to obtain the associated illumination information storage block of the target image.

[0009] In some embodiments, the storage block determination module is further configured to obtain block indices corresponding to multiple index data points respectively; the block indices correspond one-to-one with preset illumination information storage blocks; for a pixel among the multiple pixels, select the block index corresponding to the index data point adjacent to the pixel from the block indices corresponding to the multiple index data points respectively, and obtain the target block index corresponding to the pixel; determine the preset illumination information storage block corresponding to the target block index as the first illumination information storage block adjacent to the pixel.

[0010] In some embodiments, the storage block determination module is further configured to select a second lighting information storage block that is adjacent to a key object in the target image from a plurality of preset lighting information storage blocks; and perform deduplication processing based on the first lighting information storage block and the second lighting information storage block to obtain the associated lighting information storage block of the target image.

[0011] In some embodiments, the storage block determination module is further configured to determine a key object region of a key object in the target image; the key object region is the region where the key object is located in the target image; and determine a preset lighting information storage block that intersects with the key object region from a plurality of preset lighting information storage blocks to obtain the second lighting information storage block.

[0012] In some embodiments, the associated illumination information storage block includes a plurality of illumination information storage units; the storage block determination module is further configured to determine the block precision of the associated illumination information storage block; the block precision is related to the distribution density of the plurality of illumination information storage units; each associated illumination information storage block is filtered according to the block precision to obtain the candidate illumination information storage block; the candidate illumination information storage block is the associated illumination information storage block remaining after filtering.

[0013] In some embodiments, the at least one candidate illumination information storage block includes a first candidate illumination information storage block that is adjacent to at least one pixel in the target image; the weight determination module is further configured to determine the pixel block weight of the first candidate illumination information storage block at each corresponding adjacent pixel; and to statistically analyze each pixel block weight to obtain the storage block weight of the first candidate illumination information storage block.

[0014] In some embodiments, the first candidate illumination information storage block is adjacent to a key object region; the key object region is the region where the key object in the target image is located; the weight determination module is further configured to statistically analyze the weights of each pixel block to obtain a first block weight of the first candidate illumination information storage block; determine a second block weight of the first candidate illumination information storage block based on the depth value of the first candidate illumination information storage block; and obtain the storage block weight of the first candidate illumination information storage block based on the first block weight and the second block weight of the first candidate illumination information storage block.

[0015] In some embodiments, the target image is a target video frame, and the weight determination module is further configured to determine the depth value of each of the neighboring pixels based on the forward video frame of the target video frame; and to determine the pixel block weight of the first candidate illumination information storage block at each of the neighboring pixels based on the depth value of each of the neighboring pixels.

[0016] In some embodiments, the at least one candidate illumination information storage block includes a second candidate illumination information storage block, the block region of the second candidate illumination information storage block being adjacent to a key object region; the key object region is the region where the key object in the target image is located; the weight determination module is further configured to obtain a shadow factor of the second candidate illumination information storage block; the shadow factor is determined based on the proportion of shadow regions in the block region of the second candidate illumination information storage block; and the storage block weight of the second candidate illumination information storage block is determined based on the shadow factor.

[0017] In some embodiments, the lighting information storage block is a volumetric lighting map block, and the volumetric lighting map block includes a plurality of lighting probes; the lighting information loading device is further configured to determine, from the plurality of loaded volumetric lighting map blocks, the loaded volumetric lighting map blocks adjacent to each pixel in the target image; the plurality of loaded volumetric lighting map blocks include the loaded lighting information storage block; determine, from the loaded volumetric lighting map blocks corresponding to each pixel, the lighting probes adjacent to each pixel; determine the lighting information of each pixel using the lighting probes adjacent to each pixel, and perform lighting calculations based on the lighting information of each pixel to render the target image.

[0018] On the other hand, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps in the above-described lighting information loading method.

[0019] On the other hand, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps in the above-described lighting information loading method.

[0020] On the other hand, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps in the above-described lighting information loading method.

[0021] The aforementioned method, apparatus, computer device, storage medium, and computer program product for loading lighting information determine at least one candidate lighting information storage block, which is a lighting information storage block associated with the target image to be rendered. The method determines the storage block weights corresponding to each of the at least one candidate lighting information storage block. Based on the storage block weights, the method determines the lighting information storage block to be loaded from the at least one candidate lighting information storage block and loads the lighting information storage block to be loaded. The loaded lighting information storage block is used for lighting calculations to render the target image. Because the lighting information storage blocks to be loaded are selected based on storage block weights, lighting information storage blocks that have a significant impact on lighting calculations can be loaded, minimizing the number of loaded lighting information storage blocks while ensuring rendering quality, thus saving storage resources. Attached Figure Description

[0022] Figure 1 This is an application environment diagram of the illumination information loading method in some embodiments;

[0023] Figure 2 This is a flowchart illustrating the lighting information loading method in some embodiments;

[0024] Figure 3 This is a schematic diagram of volumetric lighting map blocks in some embodiments;

[0025] Figure 4 This is a flowchart illustrating the lighting information loading method in some embodiments;

[0026] Figure 5 This is a schematic diagram illustrating the calculation of block indexes and weights in some embodiments;

[0027] Figure 6 This is a schematic diagram illustrating the principle of loading lighting information in some embodiments;

[0028] Figure 7 These are renderings of images from some of the embodiments;

[0029] Figure 8 These are renderings of images from some of the embodiments;

[0030] Figure 9 These are renderings of images from some of the embodiments;

[0031] Figure 10 These are renderings of images from some of the embodiments;

[0032] Figure 11 This is a structural block diagram of the illumination information loading device in some embodiments;

[0033] Figure 12 These are internal structural diagrams of the computer device in some embodiments;

[0034] Figure 13 This is a diagram showing the internal structure of a computer device in some embodiments. Detailed Implementation

[0035] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0036] The illumination information loading method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on another server.

[0037] Specifically, when terminal 102 determines the target image to be rendered, which can be an image used to present a scene in a virtual scene, such as an image presenting a scene in a game, terminal 102 can determine at least one candidate lighting information storage block, which is a lighting information storage block associated with the target image to be rendered. It determines the storage block weights corresponding to each of the at least one candidate lighting information storage block, and based on the storage block weights, determines the lighting information storage block to be loaded from the at least one candidate lighting information storage block and loads it. Terminal 102 can then use the loaded lighting information storage block to perform lighting calculations to render the target image. Terminal 102 can send the rendered target image to server 104, which can store the target image or send it to other devices. Terminal 102 can also display the target image after rendering.

[0038] The terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0039] In some embodiments, such as Figure 2 As shown, a method for loading lighting information is provided. This method can be executed by a terminal or a server, or it can be executed by both a terminal and a server. This method can be applied to... Figure 1 Taking terminal 102 as an example, the explanation includes the following steps:

[0040] Step 202: Determine at least one candidate lighting information storage block; the candidate lighting information storage block is a lighting information storage block associated with the target image to be rendered.

[0041] The target image is the image to be rendered, which presents a scene from a virtual scene. A virtual scene refers to a fictional scene, including but not limited to virtual anime scenes or virtual game scenes. The target image includes, but is not limited to, video frames from a game or anime to be rendered. The virtual scene is located in a three-dimensional world space, meaning that the objects in the virtual scene are distributed in a three-dimensional world space, which can also be called scene space.

[0042] A lighting information storage block is used to store lighting information. A lighting information storage block comprises multiple lighting information storage units, where "multiple" means at least two, for example, 64. A lighting information storage block is a collection of multiple lighting information storage units, which are used to store lighting information. The lighting information storage block resides in three-dimensional world space, and each lighting information storage unit within the block resides in three-dimensional world space. The lighting information storage units within the block can be uniformly distributed in three-dimensional world space or non-uniformly distributed. For example, the three-dimensional world space can be represented using a three-dimensional coordinate system (XYZ coordinate system), and the lighting information storage units within the block are arranged in a block-like structure along the X-axis, Y-axis, and Z-axis at fixed intervals. The fixed intervals can be set as needed, for example, a fixed interval of 16 meters.

[0043] Illumination information can include one or more sphere harmonic (SH) coefficients, with "multiple" meaning at least two. Each illumination information storage block can be understood as a light source. The illumination information stored in the illumination information storage block represents the information of the light source. Any light source can be represented using a sphere harmonic function, which is a linear combination of one or more basis functions, i.e., a weighted form. Each basis function in the sphere harmonic function has a corresponding weight, and the sphere harmonic coefficients are the weights of the basis functions in the sphere harmonic function. For example, if the light source is represented using a 3rd-order sphere harmonic function, since the 3rd-order sphere harmonic function has ((1+3+5)×3=27)27 sphere harmonic coefficients, the illumination information can include 27 sphere harmonic coefficients. Illumination information can also be called illumination data.

[0044] Multiple lighting information storage blocks can be pre-generated in the three-dimensional world space. Each lighting information storage block has a block precision, which characterizes the density of lighting information storage units within the block. A higher block precision indicates a denser distribution of lighting information storage units, while a lower block precision indicates a sparser distribution. The number of lighting information storage units in each block can be the same or different; for example, each block may contain 64 lighting information storage units. Different lighting information storage blocks can have the same or different block precisions. The spatial regions occupied by lighting information storage blocks in the three-dimensional world space can overlap or not. For example, lighting information storage blocks with the same block precision occupy non-overlapping spatial regions, while a lighting information storage block with lower block precision may include other lighting information storage blocks with higher block precision within its spatial region. Block precision can be represented by the distance between adjacent lighting information storage units.

[0045] Block precision includes, but is not limited to, at least one of the highest precision level, medium precision level, or lowest precision level. The highest precision level lighting information storage block refers to a lighting information storage block where sampling points are placed around an object at the minimum spacing. The lowest precision level lighting information storage block refers to a lighting information storage block in the scene space (i.e., the 3D world space where the virtual scene is located), where sampling points are placed away from the object at the maximum spacing. The medium precision level lighting information storage block refers to a lighting information storage block where sampling points are placed at an intermediate spacing, where the intermediate spacing is greater than the minimum spacing and less than the maximum spacing.

[0046] In the pre-generated lighting information storage blocks in the 3D world space, there can be one or more lighting information storage blocks associated with the target image to be rendered; "multiple" means at least two. The lighting information storage blocks associated with the target image to be rendered include, but are not limited to, at least one of the following: lighting information storage blocks that are adjacent to the position of pixels in the target image in 3D world space, or lighting information storage blocks that are adjacent to the position of key objects in the target image in 3D world space. Key objects in the target image can be living or inanimate objects, and include, but are not limited to, at least one of the following: main virtual characters or main virtual objects in the target image, and main semi-transparent objects. Candidate lighting information storage blocks belong to the lighting information storage blocks associated with the target image to be rendered.

[0047] Specifically, multiple lighting information storage blocks are pre-generated in the 3D world space. These pre-generated lighting information storage blocks can be called preset lighting information storage blocks. To render the target image, the terminal can determine the lighting information storage block associated with the target image from the preset lighting information storage blocks in the world space. For example, the lighting information storage block associated with the target image can be determined by the pixels or key objects of the target image. The terminal can determine one or more candidate lighting information storage blocks from the lighting information storage blocks associated with the target image, where "multiple" means at least two. Lighting information storage blocks with different block precision can be generated based on the position of objects in the virtual scene. For example, given a determined spatial area occupied by a lighting information storage block, if there are many objects inside or around that spatial area, a lighting information storage block with higher block precision is generated in that spatial area; if there are few objects inside or around that spatial area, a lighting information storage block with lower block precision is generated in that spatial area.

[0048] In some embodiments, the illumination information storage block associated with the target image is called the associated illumination information storage block. There is at least one associated illumination information storage block. The terminal can determine all associated illumination information storage blocks as candidate illumination information storage blocks, or it can filter candidate illumination information storage blocks from the associated illumination information storage blocks. For example, the terminal can filter candidate illumination information storage blocks from each associated illumination information storage block based on block precision. Generally, because the data volume of the lowest precision level illumination information storage block is very small, all the lowest precision level illumination information storage blocks can be permanently loaded. Therefore, during the dynamic loading of illumination information storage blocks, it is not necessary to repeatedly load the lowest precision level illumination information storage blocks. The terminal can then select associated illumination information storage blocks with block precision higher than the lowest precision level from each associated illumination information storage block to obtain candidate illumination information storage blocks. In other words, the lowest precision level associated illumination information storage blocks can be filtered out from each associated illumination information storage block, and the remaining associated illumination information storage blocks can be determined as candidate illumination information storage blocks.

[0049] In some embodiments, the lighting information storage block is a volumetric lighting map block (Brick), which includes multiple lighting probes (Light Probes). The lighting information storage unit in the lighting information storage block is a lighting probe. Lighting probes are used to store the baking information of lighting in the virtual scene. Lighting probes are pre-placed in the virtual scene, and their shape can be at least one of a sphere or a polygon, such as a sphere. Since the lighting information stored in the lighting probes is obtained by collecting lighting information in the three-dimensional world space, the lighting probes can also be called sampling points. A volumetric lighting map block can be understood as a set of adjacent sampling points with equal spacing in the three-dimensional world space, i.e., a set composed of multiple sampling points. For example, a volumetric lighting map block is a 4×4×4 set of sampling points spaced 16 meters apart. A 4×4×4 set of sampling points means that there are 4 sampling points arranged in the X-axis direction, 4 in the Y-axis direction, and 4 in the Z-axis direction, spaced 16 meters apart, for a total of 64 sampling points. Here, spacing refers to the distance between adjacent sampling points, also called the spacing between adjacent sampling points.

[0050] like Figure 3As shown, this diagram displays one volumetric lightmap block with a spacing of 16 meters, one volumetric lightmap block with a spacing of 4 meters, and eight volumetric lightmap blocks with a spacing of 1 meter. The space occupied by the volumetric lightmap block with a spacing of 16 meters includes the volumetric lightmap block with a spacing of 4 meters, and the space occupied by the volumetric lightmap block with a spacing of 4 meters includes the eight volumetric lightmap blocks with a spacing of 1 meter. The volumetric lightmap block with a spacing of 16 meters has the lowest block precision, the volumetric lightmap block with a spacing of 4 meters has the medium block precision, and the volumetric lightmap block with a spacing of 1 meter has the highest block precision.

[0051] In some embodiments, volumetric lightmap blocks are stored in a virtual volumetric lightmap, which is pre-generated and may be baked data obtained through baking, and stores multiple volumetric lightmap blocks. The virtual volumetric lightmap is a 3D texture. The virtual volumetric lightmap may be stored on a hard disk, and it stores each volumetric lightmap block in the virtual scene, unit by unit. Candidate lighting information storage blocks may be volumetric lightmap blocks selected from the virtual volumetric lightmap. The size of the virtual volumetric lightmap is determined based on the included volumetric lightmap blocks; for example, storing... Figure 3 The virtual volumetric lightmaps of the 10 volumetric lightmap blocks are 3D maps of size 40×4×4. A 3D map can be understood as a three-dimensional array. The 40×4×4 is composed of 10 4×4×4 blocks. The 10 4×4×4 blocks are arranged along the X-axis to obtain a three-dimensional array of size 40×4×4. Each 4×4×4 block in the 40×4×4 array is a volumetric lightmap block.

[0052] In some embodiments, each illumination information storage block can be understood as a light source, and the illumination information stored in the illumination information storage block is used to represent the information of the light source. Any light source can be represented using a spherical harmonic function, which is a linear combination of one or more basis functions, i.e., a weighted form. Each basis function in the spherical harmonic function has a corresponding weight, and the spherical harmonic coefficients are the weights of the basis functions in the spherical harmonic function. Therefore, when a light source is represented using a spherical harmonic function, the illumination information can include spherical harmonic coefficients. For example, the illumination information can include the spherical harmonic coefficients of a third-order spherical harmonic function. Since there are 27 spherical harmonic coefficients in a third-order spherical harmonic function, the illumination information can include 27 spherical harmonic coefficients. Illumination information can also be called illumination data. The lighting probes of a volumetric lightmap block store spherical harmonic coefficients. Since a single volumetric lightmap can only store four spherical harmonic coefficients, for example, one spherical harmonic coefficient can be stored in each of the four RGBA channels. Therefore, when the lighting information includes more than four spherical harmonic coefficients, two or more volumetric lightmaps can be used to store the lighting information. For example, if the lighting information includes 27 spherical harmonic coefficients, then seven 3D volumetric lightmaps can be used to store the spherical harmonic coefficients, with one spherical harmonic coefficient stored in each of the RGBA channels in the map.

[0053] Step 204: Determine the storage block weights corresponding to at least one candidate illumination information storage block.

[0054] Each candidate lighting information storage block has a corresponding storage block weight. The storage block weight characterizes the influence of the candidate lighting information storage block on the lighting effect of the target image. The larger the storage block weight, the greater the influence of the candidate lighting information storage block on the lighting effect of the target image. Using candidate lighting information storage blocks with larger storage block weights for lighting rendering can improve the lighting effect in the rendered target image, making the lighting effect in the target image more realistic.

[0055] Specifically, for each candidate illumination information storage block, the terminal can determine the storage block weight corresponding to the candidate illumination information storage block based on at least one of the depth values ​​of pixels adjacent to the candidate illumination information storage block and the depth value of the candidate illumination information storage block itself. For example, the storage block weight is negatively correlated with the depth values ​​of neighboring pixels, and the storage block weight is negatively correlated with the depth value of the candidate illumination information storage block. Depth value refers to the distance of a pixel from the camera in three-dimensional world space; the larger the depth value, the farther the pixel is from the camera. A negative correlation means that, all other things being equal, the two variables change in opposite directions; when one variable decreases, the other variable increases.

[0056] In some embodiments, pixels adjacent to the candidate illumination information storage block can be referred to as neighboring pixels of the candidate illumination information storage block. A candidate illumination information storage block may have at least one neighboring pixel. When a pixel is adjacent to a candidate illumination information storage block, the candidate illumination information storage block can be said to be adjacent to the pixel. Therefore, the neighboring pixels of the candidate illumination information storage block can be determined based on the candidate illumination information storage blocks adjacent to the pixel. For example, if pixel A and pixel B are adjacent to candidate illumination information storage block 1, then each neighboring pixel of candidate illumination information storage block 1 includes pixel A and pixel B.

[0057] Step 206: Based on the storage block weight, determine the lighting information storage block to be loaded from at least one candidate lighting information storage block, and load the lighting information storage block to be loaded; wherein, the loaded lighting information storage block is used to perform lighting calculations to render the target image.

[0058] The lighting information storage block to be loaded comes from the at least one candidate lighting information storage block. As the lighting information storage blocks are loaded, the lighting information storage block to be loaded changes continuously, and the lighting information storage block to be loaded may not necessarily be loaded successfully. The loaded lighting information storage block refers to the lighting information storage block that has been successfully loaded from the at least one candidate lighting information storage block.

[0059] Specifically, the terminal can sequentially determine the lighting information storage blocks to be loaded from the at least one candidate lighting information storage blocks according to their storage block weights in descending order, and load the lighting information storage blocks to be loaded, that is, prioritize loading the lighting information storage blocks with larger storage block weights. For example, the identifiers of the candidate lighting information storage blocks can be arranged according to their storage block weights to obtain an identifier sequence. The candidate lighting information storage block represented by the first identifier in the identifier sequence is determined as the lighting information storage block to be loaded. After the lighting information storage block to be loaded is loaded, the candidate lighting information storage block represented by the next identifier in the identifier sequence is determined as the lighting information storage block to be loaded. This process is repeated multiple times until all candidate lighting information storage blocks are loaded. When the candidate lighting information storage block is a volumetric lighting map block from a virtual volumetric lighting map, the identifier of the candidate lighting information storage block is a block index, which refers to the position of the volumetric lighting map block in the virtual volumetric lighting map.

[0060] In some embodiments, the terminal can sequentially determine the lighting information storage blocks to be loaded from the at least one candidate lighting information storage blocks in descending order of storage block weight. If there is free block storage space, the lighting information storage blocks to be loaded are loaded until no free block storage space is available. The total capacity of the storage space in the GPU (graphics processing unit) memory used to store lighting information storage blocks can be fixed, and the capacity of the free block storage space is the capacity of the fixed storage resource minus the capacity of the occupied block storage space. In some embodiments, the terminal's GPU memory permanently loads a preset lighting information storage block of the lowest precision level. The at least one candidate lighting information storage block does not include the preset lighting information storage block of the lowest precision level. The terminal can use at least one of the loaded lighting information storage blocks to perform lighting calculations and render the target image. There can be multiple loaded lighting information storage blocks, including the preset lighting information storage block of the lowest precision level and the loaded lighting information storage blocks.

[0061] In some embodiments, for each pixel in the screen space, the screen space is the 2D (two-dimensional) space of the screen, and the size of the screen space is the size of the screen, in pixels. The screen size can be set, for example, 1280×720. The size of the target image is consistent with the size of the screen space, so the pixels in the target image can also be called pixels in the screen space. The terminal can determine the three-dimensional world space position of the pixel. The three-dimensional world space position of the pixel refers to the position of the pixel in three-dimensional world space. The position of the pixel in three-dimensional world space is uniquely determined by the coordinates of the pixel in three-dimensional world space, which can be called world coordinates. The terminal can determine the lighting information storage block adjacent to the pixel from the loaded lighting information storage block based on the three-dimensional world space position of the pixel. For example, for each loaded lighting information storage block, if the three-dimensional world space position of the pixel is included in the space area occupied by the loaded lighting information storage block in three-dimensional world space, the loaded lighting information storage block is determined to be the lighting information storage block adjacent to the pixel. When there are multiple lighting information storage blocks in the three-dimensional world space of the occupied space area including the pixel, the terminal can determine the lighting information storage block with the highest block precision among the multiple lighting information storage blocks as the lighting information storage block next to the pixel. Based on the lighting information storage blocks next to the pixel, the lighting information corresponding to the pixel is determined. When the lighting information corresponding to each pixel in the screen space is obtained, the lighting information corresponding to each pixel can be used to perform lighting calculations and render the target image.

[0062] In some embodiments, a lighting information storage block includes multiple lighting information storage units, each corresponding to a three-dimensional world space location. Each lighting information storage unit stores lighting information at its corresponding three-dimensional world space location. When a terminal determines a lighting information storage block adjacent to a pixel, it can identify the lighting information storage units adjacent to the pixel from among the lighting information storage units included in that block. Based on the lighting information stored in these adjacent lighting information storage units, the terminal calculates the lighting information corresponding to the pixel. Specifically, for each lighting information storage unit in a lighting information storage block adjacent to a pixel, the terminal can calculate the distance between the three-dimensional world space location of the pixel and the three-dimensional world space location of the lighting information storage unit. Lighting information storage units with a distance less than a first distance threshold are identified as adjacent to the pixel. The first distance threshold can be preset or set as needed. Alternatively, the terminal can arrange the lighting information storage units in ascending order of distance to obtain a storage unit sequence. Lighting information storage units in the storage unit sequence that are arranged before the preset sorting are identified as adjacent to the pixel. The preset sorting can be set as needed. For example, if it is the 5th position, then the lighting information storage units from the 1st to the 4th position will be determined as the lighting information storage units adjacent to the pixel.

[0063] In some embodiments, the lighting information storage block is a volumetric lighting map block, and the GPU memory uses a physical volumetric lighting map to store the loaded volumetric lighting map blocks. In the virtual volumetric lighting map, only the volumetric lighting map blocks needed for the current scene are loaded into the physical volumetric lighting map. Therefore, the size of the physical volumetric lighting map is smaller than the size of the virtual volumetric lighting map. The total capacity of the storage space in the GPU memory used to store volumetric lighting map blocks can be called the total capacity of physical volumetric lighting map blocks. The capacity of the free block storage space can be called the available physical volumetric lighting map block capacity. The capacity of the storage space storing the lowest precision level volumetric lighting map blocks is the total number of lowest precision level volumetric lighting map blocks. When the lowest precision level volumetric lighting map blocks are permanently loaded in the terminal's GPU memory, the available physical volumetric lighting map block capacity = total physical volumetric lighting map block capacity - total number of lowest precision level volumetric lighting map blocks.

[0064] In some embodiments, in order to ensure the correctness of linear interpolation sampling of the texture, each volumetric lightmap block needs to be expanded by one texel. The expanded texel stores the lighting data of adjacent sampling points. For example, a 4×4×4 volumetric lightmap block is actually 5×5×5 in the physical volumetric lightmap.

[0065] In the above-described lighting information loading method, at least one candidate lighting information storage block is determined. This candidate lighting information storage block is associated with the target image to be rendered. The storage block weights corresponding to each of the at least one candidate lighting information storage block are determined. Based on these weights, the lighting information storage block to be loaded is selected from the at least one candidate lighting information storage block and loaded. The loaded lighting information storage block is then used for lighting calculations to render the target image. Since the lighting information storage blocks to be loaded are selected based on their weights, lighting information storage blocks that have a significant impact on lighting calculations can be loaded. This minimizes the number of loaded lighting information storage blocks while ensuring rendering quality, thus saving storage resources.

[0066] In some embodiments, determining at least one candidate illumination information storage block includes: determining an associated illumination information storage block of the target image from a plurality of preset illumination information storage blocks; and determining a candidate illumination information storage block based on the associated illumination information storage block.

[0067] The system includes multiple preset lighting information storage blocks, where "multiple" means at least two. The associated lighting information storage block is a preset lighting information storage block that influences the lighting effect of the target image. There is at least one associated lighting information storage block, and at least one candidate lighting information storage block.

[0068] Specifically, the terminal can determine the associated illumination information storage block of the target image based on the three-dimensional world space position of the pixels in the screen space. For example, the terminal can obtain the block area of ​​the preset illumination information storage block. The block area of ​​the preset illumination information storage block refers to the spatial area occupied by the preset illumination information storage block in the three-dimensional world space. For a pixel in the screen space, the terminal can determine the first illumination information storage block that is adjacent to multiple pixels in the target image from multiple preset illumination information storage blocks. Each pixel corresponds to one first illumination information storage block. The block area of ​​the first illumination information storage block adjacent to the pixel includes the three-dimensional world space position of the pixel. If there is more than one preset illumination information storage block whose block area includes the three-dimensional world space position of the pixel, the preset illumination information storage block with higher block precision is determined as the first illumination information storage block of the pixel. For example, S1 and S2 are two preset illumination information storage blocks. The block areas of S1 and S2 both include the three-dimensional world space position of pixel A. The block precision of S1 is higher than that of S2. Then S1 is determined as the first illumination information storage block of the pixel. The terminal can determine the associated illumination information storage blocks based on the first illumination information storage blocks that are adjacent to each of the multiple pixels. For example, the terminal can perform deduplication on each of the first illumination information storage blocks to obtain the associated illumination information storage blocks, that is, to determine the different first illumination information storage blocks in each of the first illumination information storage blocks as the associated illumination information storage blocks. For example, taking multiple pixels as pixels 1 to 5, the first illumination information storage block adjacent to pixel 1 is S1, the first illumination information storage block adjacent to pixel 2 is S1, the first illumination information storage block adjacent to pixel 3 is S2, the first illumination information storage block adjacent to pixel 4 is S1, and the first illumination information storage block adjacent to pixel 5 is S2. Then the different first illumination information storage blocks are S1 and S2, so S1 and S2 can be determined as two associated illumination information storage blocks.

[0069] In some embodiments, the terminal can determine associated lighting information storage blocks based on the position of key objects in the target image in three-dimensional world space. Specifically, the terminal can determine the bounding box of the key object, which refers to the geometry in three-dimensional world space that can enclose the key object. The bounding box can be any shape of geometry, including but not limited to any one of spheres, cones, or cubes. For example, the bounding box of the key object in three-dimensional world space is the smallest cube that can enclose the key object. The terminal can determine associated lighting information storage blocks based on the bounding box of the key object. For example, the terminal can determine a preset lighting information storage block where the block area intersects with the bounding box as a second lighting information storage block adjacent to the key object, or determine a preset lighting information storage block where the distance between the block area and the bounding box is less than a second distance threshold as a second lighting information storage block adjacent to the key object. Since there can be multiple key objects, and the second lighting information storage blocks adjacent to different key objects may be the same, the terminal can determine the different lighting information storage blocks in each of the second lighting information storage blocks as associated lighting information storage blocks.

[0070] In some embodiments, the terminal can determine the associated lighting information storage block by combining the three-dimensional world space position of pixels in the screen space and the position of key objects in the three-dimensional world space. Specifically, the terminal can determine different lighting information storage blocks from each of the first lighting information storage blocks and each of the second lighting information storage blocks to obtain each associated lighting information storage block, that is, by deduplicating each of the first lighting information storage blocks and each of the second lighting information storage blocks to obtain each associated lighting information storage block.

[0071] In some embodiments, the lighting information storage block is a volumetric lighting map block, and the preset lighting information storage block is a volumetric lighting map block stored in a virtual volumetric lighting map. The terminal can determine the associated volumetric lighting map block of the target image from the virtual volumetric lighting map, determine candidate volumetric lighting map blocks based on the associated volumetric lighting map blocks, determine the storage block weights corresponding to at least one candidate volumetric lighting map block, determine the volumetric lighting map block to be loaded from at least one candidate volumetric lighting map block based on the storage block weights, and load the volumetric lighting map block to be loaded. The loaded volumetric lighting map block is used for lighting calculations to render the target image.

[0072] In this embodiment, since the lighting information storage block associated with the target image has an impact on the lighting effect of the rendered target image, candidate lighting information storage blocks are determined based on the associated lighting information storage blocks. This ensures that the selected candidate lighting information storage blocks are lighting information storage blocks that have an impact on the lighting effect of the target image, thereby improving the accuracy of selecting candidate lighting information storage blocks.

[0073] In some embodiments, determining the associated illumination information storage block of the target image from a plurality of preset illumination information storage blocks includes: determining a first illumination information storage block that is adjacent to a plurality of pixels in the target image from the plurality of preset illumination information storage blocks; and performing deduplication processing based on the first illumination information storage block to obtain the associated illumination information storage block of the target image.

[0074] In this context, multiple pixels in the target image refer to multiple pixels in screen space. Each pixel corresponds to a first lighting information storage block, and the block region of the first lighting information storage blocks adjacent to the pixel includes the pixel's three-dimensional world space location. Deduplication refers to removing identical lighting information storage blocks and retaining the different lighting information storage blocks.

[0075] Specifically, the terminal can obtain the block area of ​​the preset illumination information storage block. The block area of ​​the preset illumination information storage block refers to the spatial area occupied by the preset illumination information storage block in the three-dimensional world space. For a pixel in the screen space, the terminal can determine the first illumination information storage block that is adjacent to the multiple pixels in the target image from multiple preset illumination information storage blocks. For example, the preset illumination information storage block whose block area includes the three-dimensional world space position of the pixel is determined as the first illumination information storage block of the pixel. If there is more than one preset illumination storage block whose block area includes the three-dimensional world space position of the pixel, the terminal can determine the preset illumination information storage block with higher block accuracy as the first illumination information storage block of the pixel.

[0076] In some embodiments, the terminal can obtain block indices corresponding to multiple index data points. Each block index corresponds one-to-one with a preset lighting information storage block, and the block index is used to uniquely identify the preset lighting information storage block. When multiple preset lighting information storage blocks are volumetric lighting map blocks within a virtual volumetric lighting map, the block index represents the position of the volumetric lighting map block within the virtual volumetric lighting map. The position of the volumetric lighting map block within the virtual volumetric lighting map can be uniquely identified by the volumetric lighting map block coordinates (BrickUVIndex). That is, the block index can be the volumetric lighting map block coordinates, which are 3D coordinates. For example, the volumetric lighting map block coordinates are (xi,yi,zi), where (xi,yi,zi) represents the xi-th volumetric lighting map block in the X-direction, the yi-th volumetric lighting map block in the Y-direction, and the zi-th volumetric lighting map block in the Z-direction of the virtual volumetric lighting map. For a pixel among multiple pixels, the terminal can select the block index corresponding to the neighboring index data point from the block indices corresponding to the multiple index data points to obtain the target block index corresponding to the pixel. The preset illumination information storage block pointed to by the target block index of the pixel is the first illumination information storage block adjacent to the pixel. The terminal can perform deduplication processing on the target block index corresponding to each pixel to obtain the remaining target block indexes after deduplication. Based on the preset illumination information storage blocks pointed to by the remaining target block indices after deduplication, the associated illumination information storage block of the target image can be obtained. For example, the preset illumination information storage blocks pointed to by the remaining target block indices after deduplication can be determined as the associated illumination information storage block of the target image.

[0077] In some embodiments, the terminal can determine associated illumination information storage blocks based on the first illumination information storage blocks that are adjacent to the plurality of pixels. For example, the terminal can perform deduplication processing on each of the first illumination information storage blocks to obtain associated illumination information storage blocks, that is, determine the different first illumination information storage blocks in each of the first illumination information storage blocks as associated illumination information storage blocks.

[0078] In some embodiments, the terminal can perform deduplication based on the first illumination information storage block to obtain the associated illumination information storage block of the target image. For example, different first illumination information storage blocks can be selected from each first illumination information storage block to obtain the associated illumination information storage block of the target image.

[0079] In this embodiment, since the first lighting information storage block is adjacent to the pixels in the target image, it has a significant impact on the lighting effect at those pixels. Therefore, a related lighting information storage block for the target image is obtained based on the first lighting information storage block, improving the accuracy of the related lighting information storage block. Furthermore, by using pixels to find the related lighting information storage block, lighting rendering can be performed based on the related lighting information storage block for opaque objects in the target image, thereby improving the rationality of the related lighting information storage block.

[0080] In some embodiments, determining a first illumination information storage block that is adjacent to multiple pixels in a target image from a plurality of preset illumination information storage blocks includes: obtaining block indices corresponding to multiple index data points respectively; the block indices correspond one-to-one with the preset illumination information storage blocks; for a pixel among the multiple pixels in the target image, selecting the block index corresponding to the index data point adjacent to the pixel from the block indices corresponding to the multiple index data points respectively, to obtain the target block index corresponding to the pixel; and determining the preset illumination information storage block corresponding to the target block index as the first illumination information storage block adjacent to the pixel.

[0081] Each block index corresponds one-to-one with a preset lighting information storage block, and the block index is used to uniquely identify the preset lighting information storage block. When multiple preset lighting information storage blocks are volumetric lighting map blocks within a virtual volumetric lighting map, the block index represents the position of the volumetric lighting map block within the virtual volumetric lighting map. The position of the volumetric lighting map block within the virtual volumetric lighting map can be uniquely identified by the volumetric lighting map block coordinates. That is, the block index can be the volumetric lighting map block coordinates, which are 3D coordinates. For example, if the volumetric lighting map block coordinates are (xi,yi,zi), (xi,yi,zi) represents the xi-th volumetric lighting map block in the virtual volumetric lighting map, located in the x-th direction, yi-th direction, and zi-th direction. For example, a virtual volumetric lightmap includes 10 volumetric lightmap blocks arranged sequentially along the X-axis. The coordinates of the first volumetric lightmap block are (1,1,1), and the coordinates of the second volumetric lightmap block are (2,1,1). These multiple index data points are points distributed in the 3D world space. The spatial region where these multiple index data points are distributed can cover the spatial region covered by the multiple preset lighting information storage blocks. The distance between adjacent index data points is equal, and the interval between adjacent index data points can be set as needed. For example, for... Figure 3Of the 10 volumetric lightmap tiles distributed throughout, the one with the largest space is the one spaced 16 meters apart. This 16-meter-spaced volumetric lightmap tile occupies a 16 (m) × 16 (m) × 16 (m) spatial region. To ensure that the spatial region of multiple index data points can encompass the space occupied by this 16-meter-spaced volumetric lightmap tile, multiple index data points can be evenly distributed within this space. For example, the interval between adjacent index data points can be 4 meters, generating multiple 16 × 16 × 16 index data points. The pixel-to-target block index refers to the block index corresponding to the index data point adjacent to the pixel.

[0082] Specifically, the terminal can acquire the 3D world space position of the pixel and the 3D world space position of the index data point, calculate the distance between the 3D world space position of the pixel and the 3D world space position of the index data point, and determine the nearest index data point as the neighboring index data point of the pixel. In some embodiments, the plurality of index data points correspond to block information, which includes block index and block precision. The block precision in the block information refers to the block precision of the illumination information storage block represented by the block index in the block information. The block precision can be represented, for example, by the distance between adjacent sampling points. The block precision is negatively correlated with the distance between adjacent sampling points; the higher the block precision, the smaller the distance between adjacent sampling points.

[0083] In some embodiments, multiple preset lighting information storage blocks are volumetric lighting map blocks in a virtual volumetric lighting map. Each lighting information storage block is a volumetric lighting map block, and the block index is the coordinate of the volumetric lighting map block in the virtual volumetric lighting map. Each of these multiple index data points corresponds to a block index stored in a virtual indirect index map. The virtual indirect index map stores the block indices corresponding to each of the multiple index data points, and may also store the block precision of the volumetric lighting map block represented by the block index. The block indices corresponding to each of the multiple index data points stored in the virtual indirect index map can be pre-generated. When generating a corresponding block index for each index data point, the block index of the index data point can be determined based on the volumetric lightmap blocks adjacent to the index data point. For example, if the space occupied by the volumetric lightmap block includes the index data point, the index of the volumetric lightmap block can be determined as the block index corresponding to the index data point. When the space occupied by multiple volumetric lightmap blocks includes the index data point, the block index corresponding to the index data point can be determined according to the block precision. For example, the block index of the volumetric lightmap block with higher block precision can be determined as the block index corresponding to the index data point. For example, for multiple index data points with an interval of 4 meters and a size of 16×16×16, when generating the block index and block precision corresponding to the index data points, the volumetric lighting map blocks within a 4-meter range around the index data points can be obtained. The block index and block precision of the volumetric lighting map blocks within the 4-meter range are used to generate the block index and block precision corresponding to the index data point and stored in the virtual indirect index map. The block information of the index data points stored in the virtual indirect index map is in texels, and the block information includes the index and block precision. Thus, each texel in the virtual indirect index map stores the volumetric lighting map block coordinates and block precision of the volumetric lighting map blocks within the 4-meter range in the virtual volumetric lighting map.

[0084] In some embodiments, the lighting information storage block is a volumetric lighting map block, and the GPU memory uses a physically indirect index map to store the block index of the loaded volumetric lighting map blocks. Similar to the virtual indirect index map, the physically indirect index map stores the block index corresponding to each index data point. The difference is that while the virtual indirect index map stores the volumetric lighting map block with the highest block precision at the index data point, if the volumetric lighting map block with the highest block precision at the index data point is not loaded, the physically indirect index map stores the index information of the lowest precision level volumetric lighting map block at that index data point, i.e., the block index. In other words, for an index data point where the highest precision level volumetric lighting map block is not loaded, the physically indirect index map stores the index information of the lowest precision level volumetric lighting map block at that index data point, i.e., the block index.

[0085] In this embodiment, since the illumination conditions of the index data points adjacent to the pixel are similar to those of the pixel, the preset illumination information storage block pointed to by the block index of the index data points adjacent to the pixel is determined as the first illumination information storage block adjacent to the pixel, thereby improving the accuracy of determining the first illumination information storage block adjacent to the pixel.

[0086] In some embodiments, deduplication based on the first illumination information storage block to obtain the associated illumination information storage block of the target image includes: selecting a second illumination information storage block that is adjacent to a key object in the target image from a plurality of preset illumination information storage blocks; and performing deduplication based on the first illumination information storage block and the second illumination information storage block to obtain the associated illumination information storage block of the target image.

[0087] The second lighting information storage block is a preset lighting information storage block adjacent to the key object, and the key object can have at least one adjacent second lighting information storage block. Deduplication refers to removing identical lighting information storage blocks and retaining different lighting information storage blocks.

[0088] Specifically, the terminal can determine a second lighting information storage block adjacent to a key object from multiple preset lighting information storage blocks, based on the spatial region occupied by the key object in the target image in three-dimensional world space. For example, if the block region of a preset lighting information storage block intersects with the spatial region occupied by the key object in three-dimensional world space, the preset lighting information storage block is determined as the second lighting information storage block adjacent to the key object. Alternatively, if the distance between the block region of the preset lighting information storage block and the spatial region occupied by the key object in three-dimensional world space is less than a second distance threshold, the preset lighting information storage block is determined as the second lighting information storage block adjacent to the key object.

[0089] In some embodiments, the terminal may select all the different illumination information storage blocks from each of the first illumination information storage blocks and each of the second illumination information storage blocks to obtain the associated illumination information storage block of the target image.

[0090] In this embodiment, since the key objects in the target image are important and semi-transparent objects, the lighting effect on the key objects is a relatively important part of the overall lighting effect of the target image. The second lighting information storage block adjacent to the key objects has a significant impact on the lighting effect of the key objects. Therefore, the associated lighting information storage blocks are determined by combining the first lighting information storage blocks adjacent to the pixels and the second lighting information storage blocks adjacent to the key objects. This allows each associated lighting information storage block to include lighting information storage blocks related to opaque objects in the target image and lighting information storage blocks related to the key objects, thus improving the rationality of the associated lighting information storage blocks.

[0091] In some embodiments, selecting a second illumination information storage block that is adjacent to a key object in a target image from a plurality of preset illumination information storage blocks includes: determining a key object region of a key object in the target image; the key object region is the region where the key object is located in the target image; determining a preset illumination information storage block that intersects with the key object region from a plurality of preset illumination information storage blocks to obtain a second illumination information storage block.

[0092] Among them, the key object region of a key object refers to the spatial region in which the key object is located in the three-dimensional world space. For example, the key object region can be the bounding box of the key object.

[0093] Specifically, the terminal can determine the second illumination information storage block from multiple preset illumination information storage blocks whose block area intersects with the key object area. For example, if the block area of ​​a preset illumination information storage block intersects with the key object area, the preset illumination information storage block is determined as the second illumination information storage block adjacent to the key object.

[0094] In this embodiment, a second lighting information storage block is obtained by determining the preset lighting information storage block that intersects with the key object area from multiple preset lighting information storage blocks, thereby improving the rationality of the second lighting information storage block.

[0095] In some embodiments, the associated illumination information storage block includes a plurality of illumination information storage units; determining candidate illumination information storage blocks based on the associated illumination information storage blocks includes: determining the block precision of the associated illumination information storage blocks; the block precision is related to the distribution density of the plurality of illumination information storage units; filtering each associated illumination information storage block according to the block precision to obtain candidate illumination information storage blocks; the candidate illumination information storage blocks are the associated illumination information storage blocks remaining after filtering.

[0096] The lighting information storage block comprises multiple lighting information storage units, where "multiple" means at least two, for example, 64. These units are uniformly distributed in the three-dimensional world space, with equal spacing between adjacent units. The block precision is related to the density of the lighting information storage units; a denser distribution (smaller spacing between adjacent units) results in higher block precision, and vice versa.

[0097] Specifically, the terminal can filter each associated lighting information storage block based on block precision, identifying the remaining associated lighting information storage blocks as candidate lighting information storage blocks. The terminal can store the lowest precision level preset lighting information storage block in the GPU's memory for an extended period. During the dynamic loading of lighting information storage blocks, only preset lighting information storage blocks with a block precision higher than the lowest precision level are loaded. Therefore, the terminal can filter out candidate lighting information storage blocks with the lowest precision level from the associated lighting information storage blocks, identifying the remaining associated lighting information storage blocks as candidate lighting information storage blocks, i.e., candidate lighting information storage blocks with the highest or medium precision levels. Thus, during loading, preset lighting information storage blocks with a block precision higher than the lowest precision level are dynamically loaded.

[0098] In this embodiment, since the block precision is related to the density of the distribution of the illumination information storage units in the associated illumination information storage block, filtering of each associated illumination information storage block based on the block precision can filter out associated illumination information storage blocks that do not meet the block precision requirements, thereby improving the rationality of the candidate illumination information storage blocks.

[0099] In some embodiments, at least one candidate illumination information storage block includes a first candidate illumination information storage block that is adjacent to at least one pixel in the target image; determining the storage block weights corresponding to the at least one candidate illumination information storage block includes: determining the pixel block weights of the first candidate illumination information storage block at each of its corresponding adjacent pixels; and statistically analyzing the pixel block weights to obtain the storage block weights of the first candidate illumination information storage block.

[0100] Each candidate illumination information storage block has its own storage block weight. The first candidate illumination information storage block corresponds to at least one neighboring pixel. The pixel block weight characterizes the degree of influence of the first candidate illumination information storage block on the illumination of that neighboring pixel; the larger the pixel block weight, the greater the degree of influence.

[0101] Specifically, for each pixel, the terminal can determine the first illumination information storage block that is adjacent to each pixel from multiple preset illumination information storage blocks, perform deduplication processing on the first illumination information storage blocks, and obtain the remaining first illumination information storage blocks after deduplication. The first candidate illumination information storage block belongs to the remaining first illumination information storage blocks after deduplication. The step of determining the neighboring pixels of the first candidate illumination information storage block includes: if the first illumination information storage block adjacent to the pixel is the first candidate illumination information storage block, then the pixel is the neighboring pixel of the first candidate illumination information storage block. For example, if the remaining first illumination information storage blocks after deduplication are S1 and S2, the first candidate illumination information storage block is S1, and the first illumination information storage block adjacent to pixels A, B, and C is S1, then pixels A, B, and C are all neighboring pixels of the first candidate illumination information storage block S1.

[0102] In some embodiments, the terminal can calculate the pixel block weight based on the depth value of the first candidate illumination information storage block, and the pixel block weight is negatively correlated with the depth value of the first candidate illumination information storage block. The terminal can also determine the pixel block weight by combining the depth value of the first candidate illumination information storage block and its shadow factor. The pixel block weight is positively correlated with the shadow factor. A positive correlation means that, all other things being equal, the two variables change in the same direction; when one variable decreases, the other variable also decreases. The terminal can determine the weight of the shadow factor to obtain a shadow weight coefficient, determine the weight of the depth value of the first candidate illumination information storage block to obtain a depth weight coefficient, and use the shadow weight coefficient and the depth weight coefficient to perform a weighted calculation on the shadow factor and the depth value to obtain the pixel block weight. The shadow weight coefficient and the depth weight coefficient are preset values.

[0103] In some embodiments, for each first candidate illumination information storage block, the terminal can sum the pixel block weights of each neighboring pixel corresponding to the first candidate illumination information storage block, and determine the storage block weight of the first candidate illumination information storage block based on the summation result. For example, the terminal can determine the summation result as the storage block weight of the first candidate illumination information storage block.

[0104] In some embodiments, the terminal can calculate the pixel block weight based on the depth values ​​of neighboring pixels, and the pixel block weight is negatively correlated with the depth values ​​of neighboring pixels. The terminal can also determine the pixel block weight by combining the depth values ​​of neighboring pixels and the shadow region in the block area of ​​the first candidate illumination information storage block. For example, the terminal can calculate the ratio of the size of the shadow region to the size of the block region, and determine the calculated ratio as the shadow factor of the first candidate illumination information storage block; the pixel block weight is positively correlated with the shadow factor. For example, the terminal can determine the weight of the shadow factor to obtain a shadow weight coefficient, determine the weight of the depth values ​​of neighboring pixels to obtain a depth weight coefficient, and use the shadow weight coefficient and the depth weight coefficient to perform a weighted calculation on the shadow factor and the depth values ​​of neighboring pixels to obtain the pixel block weight. The shadow weight coefficient and the depth weight coefficient are preset values. The depth value can be a normalized depth value, and the normalized depth value of the first candidate illumination information storage block is calculated based on the position of the first candidate illumination information storage block. For example, pixel block weight = shadow factor × shadow weight coefficient + (1 - normalized depth value) × depth weight coefficient. The shadow factor can be pre-baked. It should be noted that the weights in this application can all be calculated using the shadow factor × shadow weight coefficient + (1 - normalized depth value) × depth weight coefficient. The difference is that the values ​​of the shadow factor, normalized depth value, shadow weight coefficient, and depth weight coefficient are determined according to actual needs.

[0105] In this embodiment, since a larger pixel block weight indicates a greater impact on the illumination of the pixel, the pixel block weight of the first candidate illumination information storage block at each of its neighboring pixels is determined. The storage block weight of the first candidate illumination information storage block is obtained by statistically analyzing the weights of each pixel block. This allows the storage block weight to reflect the degree of influence of the first candidate illumination information storage block on the illumination effect in the target image, thus improving the rationality of the storage block weight.

[0106] In some embodiments, the first candidate illumination information storage block is adjacent to the key object region; the key object region is the region where the key object in the target image is located; the storage block weight of the first candidate illumination information storage block is obtained by statistically analyzing the weights of each pixel block, including: statistically analyzing the weights of each pixel block to obtain the first block weight of the first candidate illumination information storage block; determining the second block weight of the first candidate illumination information storage block based on the depth value of the first candidate illumination information storage block; and obtaining the storage block weight of the first candidate illumination information storage block based on the first block weight and the second block weight.

[0107] Specifically, the terminal can sum the weights of each pixel block and determine the sum as the first weight of the first candidate illumination information storage block. The terminal can determine the second weight of the first candidate illumination information storage block based on its depth value. The second weight is negatively correlated with the depth value of the first candidate illumination information storage block. The terminal can also determine the second weight by combining the depth value and the shadow factor of the first candidate illumination information storage block. The second weight is positively correlated with the shadow factor. The terminal can determine the weight of the shadow factor of the first candidate illumination information storage block to obtain a shadow weight coefficient, determine the weight of the depth value of the first candidate illumination information storage block to obtain a depth weight coefficient, and use the shadow weight coefficient and the depth weight coefficient to perform a weighted calculation on the shadow factor and the depth value to obtain the second weight. The shadow weight coefficient and the depth weight coefficient are preset values.

[0108] In some embodiments, the terminal may sum the first block weight and the second block weight of the first candidate illumination information storage block, and determine the summation result as the storage block weight of the first candidate illumination information storage block.

[0109] In this embodiment, since the depth value of the illumination information storage block affects the illumination effect, the second block weight of the first candidate illumination information storage block is determined based on the depth value of the first candidate illumination information storage block. The storage block weight of the first candidate illumination information storage block is obtained by combining the first block weight and the second block weight, which improves the rationality of the storage block weight.

[0110] In some embodiments, the target image is a target video frame, and determining the pixel block weight of the first candidate illumination information storage block at each corresponding neighboring pixel includes: determining the depth value of each neighboring pixel based on the forward video frame of the target video frame; and determining the pixel block weight of the first candidate illumination information storage block at each neighboring pixel based on the depth value of each neighboring pixel.

[0111] The target video frame can be any video frame to be rendered, such as the current video frame to be rendered in a game. The preceding video frame of the target video frame refers to the adjacent video frame before the target video frame.

[0112] Specifically, for each neighboring pixel, the terminal can determine the depth value of that neighboring pixel in the preceding video frame of the target video frame, thus obtaining the depth value of each neighboring pixel. For each neighboring pixel, the pixel block weight is negatively correlated with its depth value.

[0113] In this embodiment, based on the preceding video frame of the target video frame, the depth value of each neighboring pixel is determined. Based on the depth value of each neighboring pixel, the pixel block weight of the first candidate lighting information storage block at each neighboring pixel is determined. Since the depth value of the pixel in the preceding video frame of the target video frame has been generated before rendering the target video frame, and the change in the depth value of the pixel between adjacent frames is small, using the depth value of the pixel in the preceding video frame to determine the pixel block weight can improve the efficiency of generating pixel block weight while ensuring the rationality of the pixel block weight.

[0114] In some embodiments, at least one candidate illumination information storage block includes a second candidate illumination information storage block, the block region of the second candidate illumination information storage block being adjacent to a key object region; the key object region is the region where a key object in the target image is located; determining the storage block weights corresponding to at least one candidate illumination information storage block includes: obtaining the shadow factor of the second candidate illumination information storage block; the shadow factor is determined based on the proportion of shadowed areas in the block region of the second candidate illumination information storage block; and determining the storage block weights of the second candidate illumination information storage block based on the shadow factor.

[0115] Specifically, the terminal can calculate the ratio of the size of the shadow area to the size of the block area, and determine the calculated ratio as the shadow factor of the second candidate illumination information storage block. The storage block weight of the second candidate illumination information storage block is positively correlated with the shadow factor.

[0116] In some embodiments, the terminal can determine the storage block weight of the second candidate illumination information storage block based on the depth value of the second candidate illumination information storage block. The terminal can also determine the storage block weight by combining the depth value and the shadow factor of the second candidate illumination information storage block. The storage block weight is negatively correlated with the depth value of the second candidate illumination information storage block. The storage block weight is positively correlated with the shadow factor of the second candidate illumination information storage block. The terminal can determine the weight of the shadow factor of the second candidate illumination information storage block to obtain a shadow weight coefficient, determine the weight of the depth value of the second candidate illumination information storage block to obtain a depth weight coefficient, and use the shadow weight coefficient and the depth weight coefficient to perform a weighted calculation on the shadow factor and depth value of the second candidate illumination information storage block to obtain the storage block weight. The shadow weight coefficient and the depth weight coefficient are preset values. Since the key object is the main object in the target image, the shadow weight coefficient used when calculating the storage block weight of the second candidate illumination information storage block can be greater than the shadow weight coefficient used when calculating the weight of the first block, and the depth weight coefficient used when calculating the storage block weight of the second candidate illumination information storage block can be greater than the depth weight coefficient used when calculating the weight of the first block.

[0117] In this embodiment, since the contribution of global illumination (GI) in shadows is relatively high, and the weight of storage blocks is positively correlated with the shadow factor, the weight of storage blocks can be determined based on the shadow factor. This can increase the weight of storage blocks with global illumination contribution, improve the rationality of storage block weights, and help improve the lighting effect.

[0118] In some embodiments, the lighting information storage block is a volumetric lighting map block, and the volumetric lighting map block includes a plurality of lighting probes; the lighting information loading method further includes: determining, from the plurality of loaded volumetric lighting map blocks, the loaded volumetric lighting map blocks that are respectively adjacent to each pixel in the target image; the plurality of loaded volumetric lighting map blocks include a loaded lighting information storage block; determining, from the loaded volumetric lighting map blocks corresponding to each pixel, the lighting probes that are respectively adjacent to each pixel; determining the lighting information of each pixel using the lighting probes that are respectively adjacent to each pixel, and performing lighting calculations based on the lighting information of each pixel to render the target image.

[0119] The plurality of loaded volumetric lightmap blocks include loaded volumetric lightmap blocks. A loaded volumetric lightmap block refers to the volumetric lightmap block successfully loaded from the at least one candidate volumetric lightmap block. If a preset volumetric lightmap block of the lowest precision level is permanently loaded into the terminal's GPU memory, the plurality of loaded volumetric lightmap blocks also include the preset volumetric lightmap block of the lowest precision level.

[0120] A volumetric lightmap block includes multiple light probes, each corresponding to a 3D world space location. The light probe stores the lighting information at its corresponding 3D world space location.

[0121] Specifically, when the terminal determines the volumetric light map block near the pixel, it can determine the light probes near the pixel from the light probes included in the volumetric light map block near the pixel, calculate the light information corresponding to the pixel based on the light information stored in the light probes near the pixel, and perform lighting calculation based on the light information of each pixel to render the target image.

[0122] In some embodiments, for lighting probes in a volumetric lighting map block adjacent to a pixel, the terminal can calculate the distance between the pixel's 3D world space position and the lighting probe's 3D world space position, and determine lighting probes whose distance is less than a first distance threshold as lighting probes adjacent to the pixel. The first distance threshold can be preset or set as needed. Alternatively, the terminal can arrange the lighting probes in ascending order of distance to obtain a storage unit sequence, and determine the lighting probes in the storage unit sequence that are arranged before the preset sorting as lighting probes adjacent to the pixel. The preset sorting can be set as needed.

[0123] In some embodiments, the loaded volumetric lighting map blocks are stored in the physical volumetric lighting map. For each pixel, the physical indirect index map stores block indices corresponding to multiple index data points. The volumetric lighting map block represented by the block index corresponding to the index data point belongs to the loaded volumetric lighting map block. The terminal can sample the physical indirect index map based on the world coordinates of the pixel, that is, determine the block indices of the index data points adjacent to the pixel and the distance between adjacent sampling points from the physical indirect index map to obtain the target block index corresponding to the pixel. Based on the block index and the distance between adjacent sampling points, the terminal determines the position (e.g., UV (texture) coordinates) of the lighting probe in the corresponding volumetric lighting map. The terminal then samples the volumetric lighting map, that is, determine the lighting probes adjacent to the pixel from the sampled volumetric lighting map. The terminal uses the lighting information in the lighting probes adjacent to the pixel to interpolate and obtain the lighting information (e.g., spherical harmonic coefficients) of the pixel.

[0124] Since different images may require different volumetric lightmap blocks, the physical volumetric lightmap and the physical indirect index map need to be continuously updated during the rendering of multiple different images. During the update process, if the volumetric lightmap block with the highest precision level at the index data point has not yet been loaded, the data of the physical indirect index map can be controlled to point to the corresponding volumetric lightmap block with the lowest precision level, thereby achieving a coarse-grained global illumination effect.

[0125] In this embodiment, since the lighting information in the lighting probes adjacent to the pixel is close to the actual lighting information of the pixel, the lighting probes adjacent to each pixel are determined from the loaded volumetric lighting map blocks corresponding to each pixel. The lighting information of each pixel is determined using the lighting probes adjacent to each pixel, and lighting calculations are performed based on the lighting information of each pixel to render the target image, thereby improving the rendering effect.

[0126] In some embodiments, such as Figure 4As shown, a method for loading lighting information is provided. This method can be executed by a terminal or a server, or by both a terminal and a server. Taking the application of this method to a terminal as an example, the method includes the following steps:

[0127] Step 402: Obtain the virtual volumetric lighting map; the virtual volumetric lighting map includes multiple volumetric lighting map blocks.

[0128] Step 404: Obtain the virtual indirect index map. The virtual indirect index map stores the block indexes corresponding to multiple index data points. The block indexes correspond one-to-one with the volumetric lightmap blocks.

[0129] Step 406: For each pixel in the screen space, determine the world coordinates of the pixel based on the pixel's depth value in the previous frame.

[0130] Step 408: Based on the world coordinates of the pixel, select the block index corresponding to the index data point whose world coordinates are close to the world coordinates of the pixel from the virtual indirect index map, and obtain the target block index corresponding to the pixel.

[0131] Step 410: The illumination information storage block pointed to by the target block index of the pixel is determined as the first illumination information storage block adjacent to the pixel.

[0132] Step 412: Based on the depth value of the pixel in the previous frame, calculate the pixel block weight of the first volumetric lightmap block corresponding to each pixel.

[0133] The terminal can store the first block index and pixel block weight corresponding to each pixel in a 4-channel (RGBA) texture map, such as... Figure 5 As shown, the block index is saved to the RGB channel, and the weights are saved to the Alpha channel. In RGBA, A is short for Alpha, R for Red, G for Green, and B for Blue. In the post-processing at the end of each frame, the volumetric lightmap blocks and weights required for each pixel are calculated based on the depth map information. In the GPU, this calculation is performed using a compute shader or a post-processing shader. The output target texture is read at the beginning of the next frame.

[0134] Step 414: Determine the bounding box of the key object in the current video frame to be rendered. From the multiple volumetric light map blocks generated in the virtual scene, determine the different volumetric light map blocks that intersect with the bounding box to obtain the second volumetric light map block.

[0135] Step 416: Based on the depth value of the second volume lightmap block, calculate the weight of the second block corresponding to each second volume lightmap block.

[0136] Step 418: Determine the different volumetric lightmap blocks from the first volumetric lightmap block and the second volumetric lightmap block to obtain the associated volumetric lightmap block of the current video frame to be rendered.

[0137] Step 420: Add the target block weights corresponding to the associated volumetric lightmap blocks to obtain the storage block weights of the associated volumetric lightmap blocks.

[0138] In cases where the associated volumetric lighting map block has both pixel block weights and a second block weight, the target block weight is multiple, including pixel block weights and the second block weight. In cases where the associated volumetric lighting map block has only pixel block weights, the target block weight is the pixel block weight. In cases where the associated volumetric lighting map block has only the second block weight, the target block weight is the second block weight.

[0139] Step 422: Filter each associated volumetric lighting map block according to the block precision, and determine the remaining associated volumetric lighting map blocks after filtering as candidate volumetric lighting map blocks.

[0140] Step 424: Based on the storage block weight, determine the volumetric lightmap block to be loaded from each candidate volumetric lightmap block. If there is free block storage space, update the physical volumetric lightmap block and the physical indirect index map using the volumetric lightmap block to be loaded to complete the loading of the volumetric lightmap block to be loaded, until there is no free block storage space left and loading stops.

[0141] like Figure 6 The image shows the entire process of loading a volumetric lightmap block. Figure 6 Loading and unloading in the system can be done using LRU (least recently used) loading and unloading.

[0142] In some embodiments, the terminal can store loading information corresponding to each volumetric lightmap block in the virtual volumetric lightmap map, and each volumetric lightmap block in the physical volumetric lightmap map corresponds to an LRUNode (called a node). An LRUNode is a component of a doubly linked list LRUList, and the LRUNodes in the LRUList are arranged in an ordered manner. The loading information includes the storage block weight and the node pointer of the LRUNode in the LRUList. The node pointer is used to uniquely identify the LRUNode; different LRUNodes have different node pointers. The LRUNode stores the node pointers of the previous LRUNode in the LRUList, the node pointers of the next LRUNode in the LRUList, the coordinates of the volumetric lightmap block in the virtual volumetric lightmap, the coordinates of the volumetric lightmap block in the physical volumetric lightmap, the time of the most recent use of the volumetric lightmap block, and the loading status of the volumetric lightmap block. The loading status of the volumetric lightmap block is used to indicate whether the volumetric lightmap block has been loaded into the physical volumetric lightmap. For example, a loading status of 0 indicates that it is not loaded, and a loading status of 1 indicates that it is loaded.

[0143] In some embodiments, the terminal can traverse the loading information of each virtual volumetric lightmap block, obtain the storage block weight from the loading information, and if the storage block weight associated with the volumetric lightmap in each virtual volumetric lightmap block is greater than 0, the terminal can obtain the virtual volumetric lightmap block with a storage block weight greater than 0 and not the lowest precision level from each virtual volumetric lightmap block, thus obtaining the volumetric lightmap block to be loaded. If the number of volumetric lightmap blocks to be loaded is less than or equal to the number of loadable volumetric lightmap blocks, then all volumetric lightmap blocks to be loaded are loaded. If the number of volumetric lightmap blocks to be loaded is greater than the number of loadable volumetric lightmap blocks, then they are loaded in descending order of weight, and for the portion exceeding the capacity, the default lowest precision level volumetric lightmap block is used.

[0144] In some embodiments, for each lighting information storage block to be loaded, the terminal can determine whether the lighting information storage block to be loaded has been loaded based on the LRUList, that is, determine whether there is an LRUNode corresponding to the lighting information storage block to be loaded in the LRUList. If it exists, it is determined that it has been loaded, and the LRUNode corresponding to the lighting information storage block to be loaded is moved to the head of the LRUList and the most recently used time is updated. If it has not been loaded, the LRUNode at the tail of the LRUList is set to the CurNode (current node), the data in the CurNode is unloaded, and the information of the lighting information storage block to be loaded is loaded into the CurNode. The step of unloading the data in the CurNode includes: setting the volumetric lighting map block coordinates in the CurNode in the physical volumetric lighting map to the lowest precision volumetric lighting map block coordinates in the physical volumetric lighting map, updating the loading status to unloaded, and clearing the node pointer in the loading information. The steps of loading the lighting information storage block to be loaded (i.e., the newly loaded volumetric lightmap block) into the CurNode include: loading the lighting information storage block to be loaded into the physical volumetric lightmap region corresponding to the physical volumetric lightmap block coordinates in the CurNode, where the physical volumetric lightmap block coordinates refer to the volumetric lightmap block coordinates in the physical volumetric lightmap, updating the information in the corresponding physical indirect index map to point to the newly loaded volumetric lightmap block, updating the virtual volumetric lightmap block coordinates in the CurNode to the virtual volumetric lightmap block coordinates of the newly loaded volumetric lightmap block, where the virtual volumetric lightmap block coordinates refer to the volumetric lightmap block coordinates in the virtual volumetric lightmap, updating the node pointer in the loading information corresponding to the newly loaded volumetric lightmap block to the node pointer of the CurNode, updating the most recently used time in the CurNode, and updating the loading status to loaded. After the terminal loads the information into the CurNode, it moves the CurNode to the head of the LRUList queue. If the lighting information storage block to be loaded cannot be loaded, for example, due to insufficient storage space, no operation is performed, and the lowest precision volumetric lighting map block that has been permanently loaded is used directly.

[0145] Step 426: Use the physical indirect index map to determine the loaded volumetric lightmap blocks that are adjacent to each pixel.

[0146] Step 428: Sample the loaded volumetric lighting map blocks near the pixel to obtain the lighting information corresponding to the pixel.

[0147] Step 430: Use the lighting information corresponding to each pixel to perform lighting rendering to obtain the current video frame.

[0148] In this embodiment, this application implements a method for dynamic loading and management of volumetric lighting maps. The system distinguishes between critical and secondary units. Critical units refer to key objects, such as the main character or important semi-transparent objects. Based on the unit's position and bounding box in the current frame, the required volumetric lightmap tiles and weights are calculated. Secondary units refer to opaque objects other than critical units. Based on the screen space depth information of the previous frame, the required volumetric lightmap tiles and weights for the current frame are estimated. For all volumetric lightmap tiles that need to be loaded, if the available physical volumetric lightmap tile capacity is not exceeded, all of them are loaded. If the capacity is exceeded, they are loaded according to their weights. For example, if the available physical volumetric lightmap tile capacity is enough to store N volumetric lightmap tiles, then the top N volumetric lightmap tiles by weight are loaded. For the portion exceeding the capacity, the default lowest precision level volumetric lightmap tiles are used, reducing the GPU memory overhead of volumetric lightmaps. The precision level of volumetric lightmaps is controlled according to the weight of the volumetric lightmap tiles to balance the memory overhead and effect precision of volumetric lightmaps, enabling the game to achieve better lighting effects within a certain memory budget. If applied to PRT (Precomputed Radiance Transfer) global illumination, relighting calculations can be performed on the volumetric lightmap blocks visible in the current scene, which can also reduce the computational cost of relighting.

[0149] To demonstrate the effectiveness of the lighting information loading method provided in this application, lighting information was loaded and image rendering was performed using the method provided in this application. For example... Figure 7 The image shown illustrates the rendered image under conditions of volumetric lightmaps and sufficient memory budget. In this case, the scene area covered by the volumetric lightmap is (384, 448, 192) meters, and the spacing between adjacent sampling points in the highest-precision volumetric lightmap tile is 1 meter. Pre-baked data yields 42,523 highest-precision volumetric lightmap tiles, 2,139 medium-precision volumetric lightmap tiles, and 126 lowest-precision volumetric lightmap tiles. The current camera view essentially covers the entire coverage area of ​​the volumetric lightmap, with a window size of 1280×720 (pixels). With sufficient memory budget (i.e., each pixel uses the existing highest-precision volumetric lightmap tile), a total of 8,843 volumetric lightmap tiles need to be loaded. Compared to loading all volumetric lightmap tiles, the memory overhead of volumetric lightmaps is only 20%, saving storage resources without altering the lighting effects.

[0150] When memory is limited, the number of highest-precision volumetric lightmap tiles loaded is limited to 6600. For some volumetric lightmap tiles with lower weights, the lowest-precision volumetric lightmap tiles are used. Figure 8 As shown, this illustrates the image rendered when memory is limited. Figure 8 The effect will be slightly worse than the original effect (i.e., when all volumetric lightmap tiles are loaded), but because the lowest precision volumetric lightmap tile used has a smaller weight, the impact on the effect is minimal, and the memory overhead of volumetric lightmaps is only 15% of the original. This saves storage resources.

[0151] With a severely limited memory budget, the number of highest-precision volumetric lightmap tiles loaded is limited to 4200. More than half of these volumetric lightmap tiles require the use of the lowest-precision volumetric lightmap tiles. This reduces the memory overhead of volumetric lightmaps to only 10% of the original, saving storage resources. Figure 9 As shown, the image rendered under severe memory budget constraints is presented. Since many volumetric lightmap tiles use the lowest precision volumetric lightmap tiles, the effect is significantly affected. However, due to the adjustment of the weights, the effect loss is reduced to a very low level.

[0152] In contrast, the number of highest-precision volumetric lightmap tiles loaded is also limited to 4200, but the weight of each volumetric lightmap tile is the same. The weight of the volumetric lightmap tile is determined only by the number of screen space pixels it occupies, resulting in the following effect: Figure 10 As shown, it can be observed that the global illumination effect is poor on the distant mountain peaks.

[0153] The lighting information loading method provided in this application can be applied to any scenario that requires loading lighting information, including but not limited to at least one of the following scenarios: film and television special effects, visualization design, games, animation, virtual reality (VR), industrial simulation, and digital cultural and creative industries. When applied to scenarios such as film and television special effects, visualization design, games, animation, virtual reality, industrial simulation, and digital cultural and creative industries, the lighting information loading method provided in this application can save storage resources occupied by the loaded lighting information in the GPU while ensuring lighting effects. For example, in the process of creating digital cultural and creative products, the lighting information loading method provided in this application can be used to create images of digital cultural and creative products. As another example, the lighting information loading method provided in this application can be used to create images of simulation equipment in industrial simulations.

[0154] In a game scenario, the lighting information loading method provided in this application can load lighting information used to render video frames in the game. Specifically, when a terminal runs a game application, in order to render video frames in the game, the terminal can determine at least one candidate lighting information storage block. The candidate lighting information storage block is a lighting information storage block associated with the video frame to be rendered. The terminal determines the storage block weight corresponding to each of the at least one candidate lighting information storage blocks. Based on the storage block weight, the terminal determines the lighting information storage block to be loaded from the at least one candidate lighting information storage block and loads the lighting information storage block to be loaded. The loaded lighting information storage block is then used to perform lighting calculations to render the video frame in the game, and the terminal can display the rendered video frame.

[0155] In anime scenes, the lighting information loading method provided in this application can load lighting information used to render images in the anime. Specifically, during the creation of images in the animation, the terminal can determine at least one candidate lighting information storage block, which is a lighting information storage block associated with the image to be created. The terminal determines the storage block weights corresponding to each of the at least one candidate lighting information storage block, determines the lighting information storage block to be loaded from the at least one candidate lighting information storage block based on the storage block weights, loads the lighting information storage block to be loaded, performs lighting calculations using the loaded lighting information storage block, renders the image in the anime, and displays the rendered image.

[0156] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0157] Based on the same inventive concept, this application also provides a lighting information loading device for implementing the lighting information loading method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more lighting information loading device embodiments provided below can be found in the limitations of the lighting information loading method described above, and will not be repeated here.

[0158] In some embodiments, such as Figure 11 As shown, a lighting information loading device is provided, including: a storage block determination module 1102, a weight determination module 1104, and a loading module 1106, wherein:

[0159] The storage block determination module 1102 is used to determine at least one candidate lighting information storage block; the candidate lighting information storage block is a lighting information storage block associated with the target image to be rendered.

[0160] The weight determination module 1104 is used to determine the storage block weights corresponding to at least one candidate illumination information storage block.

[0161] The loading module 1106 is used to determine the lighting information storage block to be loaded from at least one candidate lighting information storage block according to the storage block weight, and load the lighting information storage block to be loaded; wherein the loaded lighting information storage block is used to perform lighting calculations to render the target image.

[0162] In some embodiments, the storage block determination module is further configured to determine the associated illumination information storage block of the target image from a plurality of preset illumination information storage blocks; and to determine candidate illumination information storage blocks based on the associated illumination information storage blocks.

[0163] In some embodiments, the storage block determination module is further configured to determine, from a plurality of preset illumination information storage blocks, a first illumination information storage block that is adjacent to a plurality of pixels in the target image; and perform deduplication processing based on the first illumination information storage block to obtain the associated illumination information storage block of the target image.

[0164] In some embodiments, the storage block determination module is further configured to obtain block indices corresponding to multiple index data points respectively; the block indices correspond one-to-one with preset illumination information storage blocks; for a pixel among multiple pixels, the block index corresponding to the index data point adjacent to the pixel is selected from the block indices corresponding to the multiple index data points respectively, to obtain the target block index corresponding to the pixel; the preset illumination information storage block corresponding to the target block index is determined as the first illumination information storage block adjacent to the pixel.

[0165] In some embodiments, the storage block determination module is further configured to select a second lighting information storage block that is adjacent to a key object in the target image from a plurality of preset lighting information storage blocks; and perform deduplication processing based on the first lighting information storage block and the second lighting information storage block to obtain the associated lighting information storage block of the target image.

[0166] In some embodiments, the storage block determination module is further configured to determine the key object region of a key object in the target image; the key object region is the region where the key object is located in the target image; from a plurality of preset illumination information storage blocks, a preset illumination information storage block that intersects with the key object region is determined to obtain a second illumination information storage block.

[0167] In some embodiments, the associated illumination information storage block includes a plurality of illumination information storage units; the storage block determination module is further configured to determine the block precision of the associated illumination information storage block; the block precision is related to the distribution density of the plurality of illumination information storage units; each associated illumination information storage block is filtered according to the block precision to obtain candidate illumination information storage blocks; the candidate illumination information storage blocks are the associated illumination information storage blocks remaining after filtering.

[0168] In some embodiments, at least one candidate illumination information storage block includes a first candidate illumination information storage block adjacent to at least one pixel in the target image; the weight determination module is further configured to determine the pixel block weight of the first candidate illumination information storage block at each corresponding adjacent pixel; and to statistically analyze the pixel block weights to obtain the storage block weight of the first candidate illumination information storage block.

[0169] In some embodiments, the first candidate illumination information storage block is adjacent to the key object region; the key object region is the region where the key object is located in the target image; the weight determination module is further configured to statistically analyze the weights of each pixel block to obtain the first block weight of the first candidate illumination information storage block; determine the second block weight of the first candidate illumination information storage block based on the depth value of the first candidate illumination information storage block; and obtain the storage block weight of the first candidate illumination information storage block based on the first block weight and the second block weight of the first candidate illumination information storage block.

[0170] In some embodiments, the target image is a target video frame, and the weight determination module is further configured to determine the depth value of each neighboring pixel based on the forward video frame of the target video frame; and to determine the pixel block weight of the first candidate illumination information storage block at each neighboring pixel based on the depth value of each neighboring pixel.

[0171] In some embodiments, at least one candidate illumination information storage block includes a second candidate illumination information storage block, the block region of the second candidate illumination information storage block being adjacent to a key object region; the key object region is the region where the key object in the target image is located; the weight determination module is further configured to obtain a shadow factor of the second candidate illumination information storage block; the shadow factor is determined based on the proportion of shadowed areas in the block region of the second candidate illumination information storage block; and the storage block weight of the second candidate illumination information storage block is determined based on the shadow factor.

[0172] In some embodiments, the lighting information storage block is a volumetric lighting map block, which includes a plurality of lighting probes; the lighting information loading device is further configured to determine, from the plurality of loaded volumetric lighting map blocks, the loaded volumetric lighting map blocks that are respectively adjacent to each pixel in the target image; the plurality of loaded volumetric lighting map blocks include a loaded lighting information storage block; determine, from the loaded volumetric lighting map blocks corresponding to each pixel, the lighting probes that are respectively adjacent to each pixel; determine the lighting information of each pixel using the lighting probes that are respectively adjacent to each pixel; and perform lighting calculations based on the lighting information of each pixel to render the target image.

[0173] Each module in the aforementioned illumination information loading device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0174] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 12 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data involved in the lighting information loading method. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a lighting information loading method.

[0175] In some embodiments, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 13As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When executed by the processor, the computer program implements a method for loading illumination information. The display unit of the computer device is used to form a visually visible image. It can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0176] Those skilled in the art will understand that Figure 12 and Figure 13 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0177] In some embodiments, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method for loading illumination information.

[0178] In some embodiments, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described illumination information loading method.

[0179] In some embodiments, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described illumination information loading method.

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

[0181] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0182] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0183] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for loading illumination information, characterized in that, The method includes: At least one candidate illumination information storage block is determined. This candidate block is selected from multiple preset illumination information storage blocks by identifying a first illumination information storage block that is adjacent to multiple pixels in the target image, and a second illumination information storage block that is adjacent to a key object in the target image. After deduplication based on the first and second illumination information storage blocks to obtain associated illumination information storage blocks for the target image, the block precision of each associated illumination information storage block is determined. The associated illumination information storage blocks are then filtered based on their block precision, leaving the remaining blocks. The block precision is related to the density of the distribution of the multiple illumination information storage units contained within the illumination information storage block. The storage block weights corresponding to the at least one candidate illumination information storage block are determined respectively; the storage block weights corresponding to candidate illumination information storage blocks adjacent to at least one pixel in the target image are determined based on the statistical results of the pixel block weights of the candidate illumination information storage block at the adjacent pixels and the depth value of the candidate illumination information storage block; the storage block weights corresponding to candidate illumination information storage blocks adjacent to key objects in the target image are determined based on the proportion of the shadow area within the block area of ​​the candidate illumination information storage block. Based on the storage block weight, a lighting information storage block to be loaded is determined from the at least one candidate lighting information storage block, and the lighting information storage block to be loaded is loaded; wherein, the loaded lighting information storage block is used to perform lighting calculations to render the target image.

2. The method according to claim 1, characterized in that, The step of determining at least one candidate illumination information storage block includes: The associated illumination information storage block of the target image is determined from multiple preset illumination information storage blocks; The candidate illumination information storage block is determined based on the associated illumination information storage block.

3. The method according to claim 2, characterized in that, The step of determining the associated illumination information storage block of the target image from multiple preset illumination information storage blocks includes: From a plurality of preset illumination information storage blocks, determine a first illumination information storage block that is adjacent to a plurality of pixels in the target image; Based on the first illumination information storage block, deduplication is performed to obtain the associated illumination information storage block of the target image.

4. The method according to claim 3, characterized in that, The step of determining the first illumination information storage block that is adjacent to multiple pixels in the target image from multiple preset illumination information storage blocks includes: Obtain the block indexes corresponding to multiple index data points; each block index corresponds one-to-one with a preset illumination information storage block. For each of the plurality of pixels, the block index corresponding to the index data point adjacent to the pixel is selected from the block indices corresponding to the plurality of index data points respectively, to obtain the target block index corresponding to the pixel; The preset illumination information storage block corresponding to the target block index is determined as the first illumination information storage block adjacent to the pixel.

5. The method according to claim 3, characterized in that, The step of performing deduplication based on the first illumination information storage block to obtain the associated illumination information storage block of the target image includes: Select a second illumination information storage block that is adjacent to the key object in the target image from a plurality of preset illumination information storage blocks; Based on the first illumination information storage block and the second illumination information storage block, deduplication is performed to obtain the associated illumination information storage block of the target image.

6. The method according to claim 5, characterized in that, The step of selecting a second illumination information storage block that is adjacent to the key object in the target image from a plurality of preset illumination information storage blocks includes: Identify the key object region of the key object in the target image; the key object region is the region where the key object in the target image is located; From a plurality of preset lighting information storage blocks, determine the preset lighting information storage block that intersects with the key object region to obtain the second lighting information storage block.

7. The method according to claim 2, characterized in that, The associated illumination information storage block includes multiple illumination information storage units; determining the candidate illumination information storage block based on the associated illumination information storage block includes: Determine the block precision of the associated illumination information storage block; the block precision is related to the distribution density of the plurality of illumination information storage units; The associated illumination information storage blocks are filtered according to the block precision to obtain the candidate illumination information storage blocks; the candidate illumination information storage blocks are the remaining associated illumination information storage blocks after filtering.

8. The method according to claim 1, characterized in that, The at least one candidate illumination information storage block includes a first candidate illumination information storage block that is adjacent to at least one pixel in the target image; Determining the storage block weights corresponding to the at least one candidate illumination information storage block includes: Determine the pixel block weight of the first candidate illumination information storage block at each of its corresponding neighboring pixels; The weights of each pixel block are statistically analyzed to obtain the storage block weights of the first candidate illumination information storage block.

9. The method according to claim 8, characterized in that, The first candidate illumination information storage block is adjacent to the key object region; the key object region is the region where the key object in the target image is located. The step of statistically analyzing the weights of each pixel block to obtain the storage block weights of the first candidate illumination information storage block includes: The weights of each pixel block are statistically analyzed to obtain the first block weight of the first candidate illumination information storage block. Based on the depth value of the first candidate illumination information storage block, determine the weight of the second block of the first candidate illumination information storage block; Based on the first block weight and the second block weight of the first candidate illumination information storage block, the storage block weight of the first candidate illumination information storage block is obtained.

10. The method according to claim 8, characterized in that, The target image is a target video frame. Determining the pixel block weight of the first candidate illumination information storage block at each of its corresponding neighboring pixels includes: Based on the preceding video frame of the target video frame, determine the depth value of each of the neighboring pixels; Based on the depth value of each of the neighboring pixels, the pixel block weight of the first candidate illumination information storage block at each of the neighboring pixels is determined.

11. The method according to claim 1, characterized in that, The at least one candidate illumination information storage block includes a second candidate illumination information storage block, the block region of the second candidate illumination information storage block being adjacent to the key object region; the key object region is the region where the key object in the target image is located; Determining the storage block weights corresponding to the at least one candidate illumination information storage block includes: Obtain the shadow factor of the second candidate illumination information storage block; the shadow factor is determined based on the proportion of shadowed areas in the block area of ​​the second candidate illumination information storage block; The storage block weight of the second candidate lighting information storage block is determined based on the shadow factor.

12. The method according to any one of claims 1 to 11, characterized in that, The lighting information storage block is a volumetric lighting map block, which includes multiple lighting probes; the method further includes: From a plurality of loaded volumetric lighting map blocks, determine the loaded volumetric lighting map blocks that are adjacent to each pixel in the target image; the plurality of loaded volumetric lighting map blocks include the loaded lighting information storage block; From the loaded volumetric lightmap blocks corresponding to each pixel, determine the light probes that are adjacent to each pixel. The illumination information of each pixel is determined by using the illumination probes that are adjacent to each pixel, and illumination calculations are performed based on the illumination information of each pixel to render the target image.

13. A device for loading illumination information, characterized in that, The device includes: A storage block determination module is used to determine at least one candidate illumination information storage block. The at least one candidate illumination information storage block is determined from a plurality of preset illumination information storage blocks by identifying a first illumination information storage block that is adjacent to a plurality of pixels in the target image, and a second illumination information storage block that is adjacent to a key object in the target image. After deduplication based on the first and second illumination information storage blocks to obtain associated illumination information storage blocks for the target image, the block precision of each associated illumination information storage block is determined. The associated illumination information storage blocks are then filtered based on the block precision, leaving the remaining blocks. The block precision is related to the density of the distribution of the plurality of illumination information storage units contained in the illumination information storage block. The weight determination module is used to determine the storage block weights corresponding to the at least one candidate illumination information storage block; the storage block weights corresponding to candidate illumination information storage blocks adjacent to at least one pixel in the target image are determined based on the statistical results of the pixel block weights of the candidate illumination information storage block at the adjacent pixels and the depth value of the candidate illumination information storage block; the storage block weights corresponding to candidate illumination information storage blocks adjacent to key objects in the target image are determined based on the proportion of the shadow area within the block area of ​​the candidate illumination information storage block. The loading module is used to determine the lighting information storage block to be loaded from the at least one candidate lighting information storage block according to the storage block weight, and load the lighting information storage block to be loaded; wherein the loaded lighting information storage block is used to perform lighting calculations to render the target image.

14. The apparatus according to claim 13, characterized in that, The storage block determination module is further configured to determine the associated illumination information storage block of the target image from a plurality of preset illumination information storage blocks; and determine the candidate illumination information storage block based on the associated illumination information storage block.

15. The apparatus according to claim 14, characterized in that, The storage block determination module is further configured to determine, from multiple preset illumination information storage blocks, a first illumination information storage block that is adjacent to multiple pixels in the target image; and perform deduplication processing based on the first illumination information storage block to obtain the associated illumination information storage block of the target image.

16. The apparatus according to claim 15, characterized in that, The storage block determination module is further configured to obtain block indices corresponding to multiple index data points respectively; the block indices correspond one-to-one with preset illumination information storage blocks; for a pixel among the multiple pixel points, the block index corresponding to the index data point adjacent to the pixel point is selected from the block indices corresponding to the multiple index data points respectively, to obtain the target block index corresponding to the pixel point; the preset illumination information storage block corresponding to the target block index is determined as the first illumination information storage block adjacent to the pixel point.

17. The apparatus according to claim 15, characterized in that, The storage block determination module is further configured to select a second lighting information storage block that is adjacent to the key object in the target image from a plurality of preset lighting information storage blocks; and perform deduplication processing based on the first lighting information storage block and the second lighting information storage block to obtain the associated lighting information storage block of the target image.

18. The apparatus according to claim 17, characterized in that, The storage block determination module is further configured to determine the key object region of the key object in the target image; the key object region is the region where the key object is located in the target image; From a plurality of preset lighting information storage blocks, determine the preset lighting information storage block that intersects with the key object region to obtain the second lighting information storage block.

19. The apparatus according to claim 14, characterized in that, The associated illumination information storage block includes multiple illumination information storage units; the storage block determination module is further used to determine the block precision of the associated illumination information storage block; the block precision is related to the distribution density of the multiple illumination information storage units; each associated illumination information storage block is filtered according to the block precision to obtain the candidate illumination information storage block; the candidate illumination information storage block is the associated illumination information storage block remaining after filtering.

20. The apparatus according to claim 13, characterized in that, The at least one candidate illumination information storage block includes a first candidate illumination information storage block that is adjacent to at least one pixel in the target image; the weight determination module is further configured to determine the pixel block weight of the first candidate illumination information storage block at each corresponding adjacent pixel; and to statistically analyze each pixel block weight to obtain the storage block weight of the first candidate illumination information storage block.

21. The apparatus according to claim 20, characterized in that, The first candidate illumination information storage block is adjacent to the key object region; the key object region is the region where the key object in the target image is located; the weight determination module is further used to statistically analyze the weights of each pixel block to obtain the first block weight of the first candidate illumination information storage block; based on the depth value of the first candidate illumination information storage block, determine the second block weight of the first candidate illumination information storage block; based on the first block weight and the second block weight of the first candidate illumination information storage block, obtain the storage block weight of the first candidate illumination information storage block.

22. The apparatus according to claim 20, characterized in that, The target image is a target video frame. The weight determination module is further configured to determine the depth value of each of the neighboring pixels based on the forward video frame of the target video frame; and to determine the pixel block weight of the first candidate illumination information storage block at each of the neighboring pixels based on the depth value of each of the neighboring pixels.

23. The apparatus according to claim 13, characterized in that, The at least one candidate illumination information storage block includes a second candidate illumination information storage block, the block region of the second candidate illumination information storage block being adjacent to the key object region; the key object region is the region where the key object in the target image is located; the weight determination module is further used to obtain the shadow factor of the second candidate illumination information storage block; the shadow factor is determined based on the proportion of the shadow region in the block region of the second candidate illumination information storage block; the storage block weight of the second candidate illumination information storage block is determined based on the shadow factor.

24. The apparatus according to any one of claims 13 to 23, characterized in that, The lighting information storage block is a volumetric lighting map block, and the volumetric lighting map block includes multiple lighting probes; the device is further configured to determine, from the multiple loaded volumetric lighting map blocks, the loaded volumetric lighting map blocks adjacent to each pixel in the target image; the multiple loaded volumetric lighting map blocks include the loaded lighting information storage block; and to determine, from the loaded volumetric lighting map blocks corresponding to each pixel, the lighting probes adjacent to each pixel. The illumination information of each pixel is determined by using the illumination probes that are adjacent to each pixel, and illumination calculations are performed based on the illumination information of each pixel to render the target image.

25. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 12.

26. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 12.

27. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 12.