Data processing methods, illumination calculation methods, storage media and software products

By decomposing the illumination space into coefficient grids and base grids, and combining it with a multilayer perceptron for illumination calculation, the problem of high storage and computation costs in global illumination calculation is solved, and efficient illumination effect preservation is achieved on low-end devices.

CN120782940BActive Publication Date: 2025-11-14SHANGHAI YINGJIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511196015.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-26
Publication Date
2025-11-14
Estimated Expiration
2045-08-26

AI Technical Summary

Technical Problem

Existing technologies for global illumination computation suffer from high storage requirements and computational costs, especially low efficiency when running on mobile devices and low-performance PCs. Furthermore, existing compression algorithms are of poor quality, leading to problems such as light leakage, color banding, and discontinuous illumination.

Method used

The illumination space is decomposed into coefficient grids and multiple base grids and stored. The storage and computation of illumination information are optimized through basis function decomposition and normalization. The illumination is calculated using a multilayer perceptron to adapt to virtual scenes of different physical sizes.

Benefits of technology

Significantly reduces memory and video memory usage while maintaining lighting effects. Suitable for low-end PCs and low-to-medium performance mobile devices, it improves computing speed and reduces computing overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120782940B_ABST
    Figure CN120782940B_ABST
Patent Text Reader

Abstract

A data processing method, a lighting calculation method, a storage medium, and a program product are disclosed, which can reduce memory / video memory usage and package size while maintaining lighting effects. The data processing method is used to process the lighting space of a virtual scene, including decomposing the lighting space into a coefficient grid and multiple base grids, and storing the coefficient grid and multiple base grids. The coefficient grid includes a coefficient feature dimension and a first spatial dimension, where the first spatial dimension represents the spatial resolution of the coefficient grid vertices. The coefficient feature dimension includes channels for storing coefficient features relative to each coefficient grid vertex. Each base grid includes a base feature dimension and a second spatial dimension, where the second spatial dimension represents the spatial resolution of the base grid vertices. The base feature dimension includes channels for storing base features of a pre-defined sampling frequency band relative to each base grid vertex. The sampling frequency bands of each of the multiple base grids are different from each other.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to a data processing method, a light calculation method, a storage medium, and a program product. Background Technology

[0002] In the rendering field, global illumination is known to simulate the behavior of light in the real world, making rendered images more realistic. However, calculating global illumination involves a large amount of light bounce and scene information, resulting in high storage and computational costs. This is especially true for games and rendering applications (particularly real-time rendering), necessitating the use of compression techniques to reduce storage requirements and file size, thereby improving operational efficiency. Particularly important for running games or real-time rendering applications on mobile devices and low-performance PCs, using compression techniques to reduce storage requirements and file size becomes crucial.

[0003] To address this, various image data compression and optimization methods have been proposed in the industry. Common methods include:

[0004] Lossy compression of spherical harmonic coefficients based on statistical algorithms, such as PCA;

[0005] Lightmap sparsification and sparse sampling of the lightmap, such as ASCT;

[0006] Optimize storage methods, such as using low-precision storage, storing textures separately, and using texture compression formats;

[0007] Replace the full data with sparser lighting probes, for example, using Unity's Adaptive Probe Volumes feature; and

[0008] Remove other unimportant assets from the scene to make room for lighting data.

[0009] However, the inventors of this application discovered that most statistical compression algorithms have low compression quality and insufficient compression ratios, leading to problems such as light leakage, color banding, and discontinuous lighting. Optimized storage methods such as block mapping and coefficient storage also suffer from insufficient compression ratios, typically only around 50%. Furthermore, some compression algorithms are quite complex, and using them can actually increase computational overhead and hardware requirements. For example, the data decompression process requires a large amount of computation, increasing the computational cost of shaders and the burden on game performance. Additionally, when using models based on large networks for image data compression, real-time inference can be slow. And when employing specific technologies such as TensorRT, specific types of graphics cards are required from the user's device. Summary of the Invention

[0010] The technical problem that the invention aims to solve

[0011] This disclosure addresses the aforementioned technical problems. Specifically, for lighting calculation and real-time rendering schemes based on light probes, this disclosure provides a data processing method that can significantly reduce memory / video memory usage and package size while maintaining the basic lighting effects. Furthermore, this disclosure provides a lighting calculation method, a computer-readable storage medium, and a computer program product.

[0012] Technical solutions adopted to solve technical problems

[0013] One technical solution disclosed herein provides a data processing method for processing the lighting space of a virtual scene, comprising:

[0014] The illumination space is decomposed into a coefficient grid and multiple base grids; and

[0015] The coefficient grid and the plurality of base grids are stored, wherein,

[0016] The coefficient grid includes a coefficient feature dimension and a first spatial dimension.

[0017] The first spatial dimension represents the spatial resolution of the coefficient grid vertices.

[0018] The coefficient feature dimension includes channels that store coefficient features relative to each coefficient grid vertex.

[0019] Each of the base grids includes a base feature dimension and a second spatial dimension.

[0020] The second spatial dimension represents the spatial resolution of the base mesh vertices.

[0021] The basic feature dimension includes channels that store a pre-defined sampling frequency band for the basic features relative to each base grid vertex.

[0022] The sampling frequency bands set in the basic feature dimensions of each of the plurality of base grids are different from each other.

[0023] According to the data processing method described in this technical solution, the lighting space of the virtual scene is decomposed into a coefficient grid and multiple base grids by basis function decomposition. As an alternative to directly storing the lighting information of the lighting space, storing the aforementioned coefficient grid and multiple base grids can significantly reduce the amount of memory / video memory used and the package size, thereby achieving a significant compression of lighting data while maintaining the lighting effect as much as possible.

[0024] As a further optional technical solution, the physical coordinates of the coefficient grid and the base grid are normalized, and the normalized coefficient grid and base grid are stored.

[0025] According to the data processing method described in this technical solution, normalization can eliminate the impact of spatial scale differences on the algorithm, enabling virtual scenes of different physical sizes to share the same computation process.

[0026] As a further optional technical solution, decomposing the illumination space into a coefficient grid and multiple base grids includes:

[0027] An initialization step is performed in which initial values ​​are assigned to the coefficient features stored at the vertices of the coefficient grid and the base features stored at the vertices of the base grid.

[0028] The acquisition step involves acquiring the actual values ​​of the illumination information and the spatial information of the illumination space.

[0029] In the first calculation step, the illumination feature vector of the illumination space is calculated based on the actual value of the spatial information of the illumination space, the coefficient features stored in the coefficient grid vertices, and the base features stored in the base grid vertices.

[0030] The second calculation step involves determining an estimated value of the illumination information based on the illumination feature vector.

[0031] The judgment step involves determining whether the difference between the estimated value of the illumination information and the actual value of the illumination information is greater than a preset benchmark difference.

[0032] In the update step, if the difference is greater than the baseline difference, the values ​​of the coefficient features stored at the coefficient grid vertices and the base features stored at the base grid vertices are updated based on the difference, and the first calculation step is executed again until the difference is less than the baseline difference; and

[0033] In the output step, if it is determined that the difference is less than the baseline difference, the coefficient features stored in the coefficient grid vertices and the base features stored in the base grid vertices are output in the output step.

[0034] According to the data processing method described in this technical solution, the values ​​of coefficient features and basic features can be automatically optimized through an initialization-calculation-update iteration process, avoiding the limitations of manually adjusting parameters.

[0035] As a further optional technical solution, in the update step, the updated values ​​of the coefficient features and the base features are weighted and pruned to restrict the coefficient features and the base features to the range of [-1, 1].

[0036] According to the data processing method described in this technical solution, by performing a weight pruning operation to restrict the values ​​of the base features and coefficient features to the range [-1, 1], it helps to prevent gradient explosion / vanishing during model training. Furthermore, by restricting these values ​​to the range [-1, 1], the values ​​of the aforementioned features restricted to this range can be directly mapped to eight-bit unsigned integers or half-precision floating-point numbers, thereby further saving storage space.

[0037] As a further optional technical solution, the base features and the coefficient features are stored in an eight-bit unsigned integer or half-precision floating-point number data format.

[0038] The data processing method described in this technical solution can further save storage space.

[0039] As a further optional technical solution, the actual value of the illumination information includes a first actual value encoded as 0th-order spherical harmonic coefficients and a second actual value encoded as 1st-order spherical harmonic coefficients. The estimated value of the illumination information includes a first estimated value corresponding to the first actual value and a second estimated value corresponding to the second actual value. The difference is determined by a loss function consisting of a linear combination of the distance between the first actual value and the first estimated value and the distance between the second actual value and the second estimated value. Furthermore, in the loss function, the proportion of the distance between the first actual value and the first estimated value is higher than that of the distance between the second actual value and the second estimated value.

[0040] According to the data processing method described in this technical solution, by assigning a larger weight to the 0th-order spherical harmonic coefficients (DC components), a higher loss weight can be given to them, thereby ensuring the accuracy of the basic illumination. On the other hand, by assigning a smaller weight to the 1st-order spherical harmonic coefficients (linear components), overfitting to high-frequency noise can be avoided, balancing smoothness and detail preservation.

[0041] As a further optional technical solution, the virtual scene is configured with lighting probes to collect lighting information of the lighting space of the virtual scene. Based on the configuration density of the lighting probes, the virtual scene is divided into regions corresponding to each configuration density, and the lighting space of each region is decomposed into a coefficient grid and multiple base grids.

[0042] According to the data processing method described in this technical solution, the target data (i.e., the lighting space of the virtual scene) to be compressed is adaptively split based on the distribution of the target data (e.g., the lighting data of the lighting space of the virtual scene), for example, according to the configuration density and spatial location distribution of the lighting probes. This avoids the problem of insufficient parameter utilization, local redundancy, and severe errors caused by simply using a set of global parameters to directly compress lighting information with different configuration densities.

[0043] As a further optional technical solution, it is determined whether the color space used for the illumination information is the RGB color space. If it is determined that the color space used is the RGB color space, the RGB color space is converted into the YCoCg color space or the XYZ color space.

[0044] According to the data processing method described in this technical solution, by converting the RGB color space to the YCoCg color space or the XYZ color space, the correlation between the three RGB channels can be removed, thus avoiding color spot distortion in areas with many high-frequency details.

[0045] Another technical solution of this disclosure provides a lighting calculation method, which performs lighting calculations based on a coefficient grid and multiple base grids determined by the data processing method described in any of the above technical solutions. The lighting calculation method includes:

[0046] Obtain the identification information of the virtual scene to be loaded;

[0047] Based on the identification information, retrieve the coefficient grid and the multiple base grids corresponding to the virtual scene;

[0048] Based on the spatial coordinates of the target point in the virtual scene, determine the grid spatial coordinates of the target point in the one coefficient grid and the multiple base grids respectively;

[0049] Determine the coefficient features and basic features corresponding to the target point based on the grid spatial coordinates; and

[0050] The illumination information of the target point is calculated based on the coefficient features and basic features corresponding to the target point.

[0051] According to the lighting calculation method described in this technical solution, compared with reconstructing the lighting space of a virtual scene based on lighting information directly stored in traditional methods, performing lighting calculations using a coefficient grid and multiple base grids determined by the data processing method of any of the above technical solutions can accelerate the calculation speed while maintaining the lighting effect as much as possible. Furthermore, because the amount of data used for lighting calculations is significantly reduced, it is applicable to low-end PCs and low-to-medium performance mobile devices.

[0052] As a further optional technical solution, the spatial coordinates of the target point in the virtual scene are periodically transformed based on the sampling frequency band set in the base feature dimension of each of the plurality of base grids to determine the grid spatial coordinates of the target point in each of the base grids.

[0053] According to the illumination calculation method described in this technical solution, by setting different sampling frequency bands (or sampling periods) for each base grid, it is possible to capture illumination information at multiple scale frequencies by periodically transforming the target points in the virtual scene to each base grid.

[0054] As a further optional technical solution, determining the coefficient features and basic features corresponding to the target point based on the grid space coordinates includes:

[0055] Indexing is performed based on the grid space coordinates of the target point to determine the coefficient grid cell in the coefficient grid where the target point is located, and the base grid cell in each base grid where the target point is located.

[0056] Based on the spatial coordinates of the coefficient grid vertices of the coefficient grid unit and the spatial coordinates of the target point, interpolation calculations are performed using the coefficient features stored at the coefficient grid vertices of the coefficient grid unit to determine the coefficient features of the target point; and

[0057] Based on the spatial coordinates of the base grid vertices of each base grid cell and the grid spatial coordinates of the target point, interpolation calculations are performed based on the base features stored in the base grid vertices of each base grid cell to determine the base features of the target point.

[0058] As a further optional technical solution, calculating the illumination information of the target point includes:

[0059] The illumination feature vector of the target point is determined by element-wise multiplying the coefficient features and basic features of the target point; and

[0060] The illumination feature vector is input into a multilayer perceptron for nonlinear transformation to determine the illumination information of the target point as the output result.

[0061] As a further optional technical solution, the multilayer perceptron includes an input layer, a hidden layer, an activation function, and an output layer. The input layer receives the illumination feature vector of the target point as input. The hidden layer performs a linear transformation on the illumination feature vector from the input layer. The activation function performs a non-linear mapping on the output of the linearly transformed hidden layer. The output layer generates the illumination information of the target point based on the non-linearly mapped output as the output result. Attached Figure Description

[0062] Figure 1 A schematic diagram showing an example of a lighting probe in a virtual scene, which is the processing object of the data processing method configured in an embodiment of this application, is illustrated.

[0063] Figure 2 A flowchart of the model training of the coefficient grid and base grid used in the data processing method of one embodiment of this application is shown, illustrating the main steps of model training.

[0064] Figure 3 This diagram illustrates a coefficient grid and multiple basis grids formed by decomposing the lighting space of a virtual scene using basis functions.

[0065] Figure 4 A flowchart is shown of a lighting calculation method implemented using a coefficient grid and a base grid formed by a data processing method based on an embodiment of this application.

[0066] Figure 5 It shows Figure 4 A schematic diagram of the illumination calculation method described above.

[0067] Figure 6 Implementation shown Figure 5 The flowchart of step ST400 in the illumination calculation method shown.

[0068] Figure 7 An example of the main components of a multilayer perceptron is shown, along with a schematic diagram of the nonlinear transformation of the illumination feature vector through the multilayer perceptron. Detailed Implementation

[0069] First, before describing the specific implementation methods, some of the technical terms used in this disclosure will be explained.

[0070] [Glossary]

[0071] The “virtual scene” mentioned in this application is, for example, a CG movie scene, an animation scene, or a game scene, and is not a real scene in real three-dimensional space.

[0072] The "feature space" described in this application is a mathematical representation of data features, where each feature corresponds to a dimension in the space. For example, if a dataset has n features, then it can be represented in an n-dimensional space.

[0073] The “three-dimensional feature space” mentioned in this application refers to the feature space that represents data in three dimensions. It is used to describe and analyze the distribution, structure or pattern of data and is an important concept in machine learning, data analysis and pattern recognition.

[0074] The "three-dimensional lighting space" described in this application is an important concept in computer graphics. It refers to a technique that simulates real-world lighting in a three-dimensional virtual environment or scene to obtain three-dimensional lighting data, thereby generating realistic graphics. The core of the three-dimensional feature space lies in calculating the visual effects produced by the interaction of light with the surface of an object through mathematical models and algorithms, including but not limited to diffuse reflection, specular reflection, shadows, and ambient occlusion. In the three-dimensional lighting space, lighting information at the corresponding location can be retrieved using three-dimensional spatial coordinates. It is important to note that the three-dimensional lighting space is a space of lighting information, not an actual physical space, similar to the aforementioned three-dimensional feature space, or more specifically, similar to the latent space / feature space mentioned in deep learning.

[0075] The "lighting information" mentioned in this application refers to the information required to render a virtual scene, mainly describing the intensity and color of light in different directions, including but not limited to. It should be noted that lighting information may have different representations (e.g., spherical harmonic coefficients), and the information described may also differ slightly.

[0076] The "global illumination (GI)" described in this application refers to a lighting technique that considers both direct lighting (light directly from a light source in a virtual scene) and indirect lighting (light reflected from other virtual objects in the virtual scene). In other words, global illumination is a lighting technique that simultaneously considers direct and indirect lighting. Specifically, unlike local lighting models, global illumination models consider multiple reflections, refractions, and scatterings of light in a virtual scene, simulating more complex and realistic lighting phenomena. Direct light is light emitted from a light source, while indirect light is light emitted from a light source that is reflected and / or scattered from the surface of a virtual object to the surface of other virtual objects. The technical solutions discussed in this application cover global illumination techniques that encompass both direct and indirect lighting, as well as global illumination techniques that only cover indirect lighting.

[0077] The "lighting probe" described in this application is a data structure used to store scene lighting information. By pre-calculating and storing the lighting information at the probe, we can quickly obtain the global lighting effect of the scene at runtime.

[0078] The "neural field" described in this application is an implicit representation model based on neural networks, used to model signals (such as geometry, material, lighting, motion, etc.) in physical or abstract space. Neural fields use spatial coordinates (such as 3D position, time, etc.) as input and leverage neural networks (such as multilayer perceptrons, MLPs) to directly map them to target signals (such as color, density, velocity, etc.), thus implicitly representing complex continuous fields in a differentiable manner. Commonly used neural fields include NeRF, Plenoxels, and Instant-NGP.

[0079] The “neural grid” described in this application is a specific type of neural field, and the data structure used to represent the core implementation part of the field is a grid structure.

[0080] The "Factor Field" described in this application is a mathematical framework designed to unify various signal representation methods, including the aforementioned neural field and other traditional methods. Specifically, the neural field can be viewed as a concrete manifestation within the Factor Field framework. For example, NeRF corresponds to a single-factor field, using a multilayer perceptron (MLP) with position coding as the factor.

[0081] The “coefficient grid” and “base grid” described in this application are two specific types of factor fields. The data structures used to represent the core implementation of the field are both grid structures. The coefficient grid and the base grid can also be referred to as coefficient (factor) field and base (factor) field, respectively.

[0082] [Core Idea of ​​the Technical Solution]

[0083] The technical solution disclosed herein is based on the concept of basis function decomposition. The core idea of ​​basis function decomposition is to decompose a feature space such as the injected three-dimensional lighting space into a combination of multiple basis functions (which can also be understood as factor fields in this application), and to flexibly combine them with different representation methods (such as MLP, grid, hash table, etc.) and coordinate transformations (such as periodic transformation, orthogonal projection, etc.).

[0084] More specifically, in this disclosure, the three-dimensional lighting space is decomposed into a combination of a coefficient factor field with global characteristics and multiple gene subfields with local characteristics. Based on this, a multilayer perceptron (including activation functions) and periodic coordinate transformation are combined to achieve lighting data compression while ensuring the accuracy of lighting calculation and the rendering effect (especially real-time rendering).

[0085] Next, the illumination space, which is the object of data processing, will be described.

[0086] [Description of a lit space]

[0087] In this embodiment, the three-dimensional lighting space of a three-dimensional virtual scene in a video game is used as an example of the data processing object for applying the data processing method of this application. The three-dimensional lighting space in this embodiment includes three-dimensional spatial information and lighting information. Three-dimensional spatial information refers to the spatial physical information of the three-dimensional lighting space, such as being represented by coordinate values ​​in a three-dimensional orthogonal coordinate system. Each physical spatial location in the three-dimensional lighting space has corresponding lighting information, which includes, but is not limited to, intensity information and color information of light from different directions. Lighting information can be encoded and stored in various ways.

[0088] In this embodiment, lighting information is collected through lighting probes configured in the virtual scene. Figure 1 A schematic diagram illustrating an example of a lighting probe configured in a virtual scene, which is the processing object of a data processing method according to an embodiment of this application. Figure 1 As shown, a large number of lighting probes are configured in this virtual scene to collect its lighting information. Figure 1 It can be observed that the density of light probes varies in different areas of the virtual scene. Some areas have a higher density of light probes, while others have a lower density. In other words, the level of detail (LOD) of the light probes differs across different areas of the virtual scene. Furthermore, in... Figure 1 In this embodiment, the lighting probes are arranged in a grid. This facilitates calculations using trilinear interpolation. It should be noted that this embodiment shows a grid arrangement of the lighting probes, but it is not limited to this. For example, the lighting probes can be arranged in a tetrahedral form instead of a grid. Furthermore, this embodiment shows a non-uniform (or block-uniform) arrangement of the lighting probes, but it is not limited to this. For example, the lighting probes can be uniformly arranged in a grid throughout the entire virtual scene.

[0089] In this embodiment, the illumination probes store illumination information using spherical harmonic functions. Specifically, each illumination probe records the illumination information at its location and encodes this information into spherical harmonic coefficients for the red, green, and blue color channels. However, it should be noted that the method by which the illumination probes store illumination information is not limited to spherical harmonic functions; methods such as Ambient Cubes can also be used as needed.

[0090] In summary, in this embodiment, the lighting space of the virtual scene is an abstract data space constructed based on lighting probes and their stored lighting information, used to describe the lighting distribution within the virtual scene. This lighting space integrates the sampling data from discrete lighting probes to form a continuous and spatialized representation of the lighting environment of the virtual scene.

[0091] For ease of explanation, we will assume that the lighting space of the virtual scene is a uniform illumination probe mesh, which can be represented by a fourth-order tensor of 12*37*22*42. Here, 37, 22, and 42 represent the number of probes in the three spatial dimensions of the lighting probe mesh, respectively, and 12 represents the dimension of the lighting information stored in each illumination probe. It is important to emphasize again that the representation of the lighting space does not have to be a standard mesh; the illumination probe mesh here is merely a specific implementation of a three-dimensional lighting field.

[0092] Next, the data structure of the coefficient grid and the base grid obtained by decomposing the lighting space of the virtual scene using the data processing method of an embodiment of this application will be described.

[0093] [Coefficient Grid]

[0094] The coefficient grid is a factor field with global properties formed by decomposing the illumination space using basis functions; it is sometimes also called a coefficient factor field.

[0095] From a computer graphics perspective, a coefficient grid is a three-dimensional grid with uniformly distributed vertices. The vertices of a coefficient grid are called coefficient grid vertices. Furthermore, a cell formed by eight adjacent coefficient grid vertices in three orthogonal directions is called a coefficient grid cell. From a data structure or mathematical description perspective, a coefficient grid is a fourth-order tensor. Its first component is the coefficient feature dimension, and the latter three components constitute the first spatial dimension. Here, the first spatial dimension represents the spatial resolution of the coefficient grid vertices. For example, if the coefficient grid is a 27*11*11*11 fourth-order tensor, then 11*11*11 is the first spatial dimension of the coefficient grid, indicating that there are 11 coefficient grid vertices uniformly distributed in each of the three orthogonal directions, for a total of 11*11*11 coefficient grid vertices. On the other hand, the coefficient feature dimension includes channels for storing coefficient features relative to each coefficient grid vertex. Specifically, in a 27*11*11*11 coefficient grid, each coefficient grid vertex stores coefficient features (values) with a dimension of 27.

[0096] On the other hand, the coefficient grid can be viewed as a three-dimensional index array. Specifically, based on the spatial coordinates of a specific point, the coefficient grid cell containing that point can be determined. Then, trilinear interpolation is performed based on the coefficient features stored in the eight vertices of that coefficient grid cell to calculate the coefficient features at that specific point.

[0097] Furthermore, the coefficient grid is a grid with global characteristics. That is, the coefficient grid has the ability to learn globally about the scene.

[0098] [Base Mesh]

[0099] A basis grid is a factor field with local characteristics formed by decomposing the illumination space using basis functions; it is sometimes also called a gene subfield. In this embodiment, multiple (specifically six) basis grids are formed by decomposing the illumination space using basis functions.

[0100] From a computer graphics perspective, a base mesh is a 3D mesh with uniformly distributed vertices, and the vertices of the base mesh are called base mesh vertices. Furthermore, the unit enclosed by eight adjacent base mesh vertices in three orthogonal directions is called a base mesh cell. From a data structure or mathematical description perspective, the base mesh is a fourth-order tensor, where the first component is the basis feature dimension, and the latter three components constitute the second spatial dimension. Here, the second spatial dimension represents the spatial resolution of the base mesh vertices. For example, if the base mesh is a 6*3*3*3 fourth-order tensor, then 3*3*3 is the second spatial dimension of the base mesh, indicating that there are 3 base mesh vertices uniformly distributed in each of the three orthogonal directions, for a total of 3*3*3 base mesh vertices. On the other hand, the basis features include channels that store a pre-defined sampling frequency band (or frequency hierarchy) of basis features relative to each base mesh vertex. Specifically, in a 6*3*3*3 base mesh, each base mesh vertex stores a 6-dimensional basis feature for a specific sampling frequency band. It should be noted that the basic features mentioned here are actually implicit feature codes after periodic coordinate transformation.

[0101] It should be noted that in this application, the number of basis features formed by basis function decomposition of the three-dimensional lighting space is multiple. Furthermore, in this application, the sampling frequency bands (or frequency levels) set in the basis feature dimensions of each base grid are different from each other, in order to capture lighting details at different frequencies.

[0102] [Flowchart of the data processing method in this embodiment]

[0103] The data processing method of this embodiment mainly includes a decomposition step and a storage step. In the decomposition step, the lighting space of the virtual scene is decomposed using basis functions as described below, decomposing the lighting space into a coefficient grid and multiple base grids. Each coefficient grid includes a coefficient feature dimension and a first spatial dimension representing the spatial resolution of the vertices of the coefficient grid. Each base grid includes a base feature dimension and a second spatial dimension representing the spatial resolution of the vertices of the base grid. Next, in the storage step, instead of storing the lighting information of the lighting space of the virtual scene, the decomposed coefficient grid and multiple base grids are stored. In particular, in order to be able to query the corresponding coefficient grid and base grids when reconstructing the virtual scene, in the storage step, the coefficient grid and the multiple base grids are stored in association with the identification information of the virtual scene on which the decomposition is based.

[0104] Decomposing a lighting space into a coefficient grid and multiple basis grids involves model training for both the coefficient grid and the basis grids. The main process of model training for the coefficient grid and the basis grids will be described below.

[0105] Model training using coefficient grids and base grids

[0106] Figure 2 A flowchart illustrating the model training of the coefficient grid and base grid used in the data processing method of one embodiment of this application is shown, illustrating the main steps of model training. It should be noted that... Figure 2 This is merely one example of model training and does not imply that it only includes the steps shown in the diagram. Furthermore, the order of the steps shown in the diagram is only one example and can be adjusted according to the actual situation, as long as the model training can be completed.

[0107] First, construct a coefficient grid with predefined dimensions for each component and multiple base grids. The dimensions of each component in each base grid are also predefined. It's important to note that the total dimension of the base features of all base grids is equal to the dimension of the coefficient features of the coefficient grid. For example, suppose there are 6 base grids. Then, the dimension of the coefficient features of the coefficient grid is 27, and the dimensions of the base features of the 6 base grids are 6, 6, 6, 3, 3, 3, satisfying 6 + 6 + 6 + 3 + 3 + 3 = 27.

[0108] Figure 3 This diagram illustrates a coefficient grid and multiple basis grids formed by basis function decomposition of the lighting space of a virtual scene. In this embodiment, for example... Figure 3As shown, the lighting space of a virtual scene is decomposed into a 27*11*11*11 coefficient grid and six base grids, namely 6*3*3*3, 6*5*5*5, 6*7*7*7, 3*9*9*9, 3*11*11*11 and 3*13*13*13.

[0109] Secondly, the coefficient feature dimension of the coefficient grid and the base feature dimension of each base grid are initialized (i.e., the initialization step). Specifically, in the initialization step, initial values ​​are assigned to the coefficient features stored at each vertex of the coefficient grid and the base features stored at each vertex of each base grid. This is because the specific values ​​of the coefficient features and base features cannot be determined before the model begins training and need to be determined through training (or supervised learning). On the other hand, the first and second spatial dimensions are pre-defined and therefore do not require initial values. Furthermore, the parameters of the multilayer perceptron used to map the illumination feature vectors described later are also initialized in the initialization step.

[0110] Next, the actual values ​​of the illumination information and spatial information in the virtual scene's illumination space are acquired (i.e., the acquisition step). Each piece of illumination information in the illumination space is associated with each piece of spatial information, forming training examples (i.e., labeled training samples). In this embodiment, the actual values ​​of the illumination information include, for example, a first actual value encoded as a 0th-order spherical harmonic coefficient and a second actual value encoded as a 1st-order spherical harmonic coefficient. That is, in this embodiment, the illumination information is stored using 0th-order and 1st-order spherical harmonics, where the first actual value stored in the 0th-order spherical harmonics describes uniform illumination in all directions, and the second actual value stored in the 1st-order spherical harmonics describes illumination details in different directions. It should be noted that the order of the spherical harmonics used is not limited to 1st order; an appropriate order can be selected according to the actual situation.

[0111] Then, based on the actual values ​​of the spatial information of the acquired lighting space, the coefficient features stored in the coefficient grid vertices, and the base features stored in the base grid vertices, the lighting feature vector of the lighting space is calculated (i.e., the first calculation step). Specifically, each lighting probe in the lighting space is traversed, and its spatial position in the virtual scene (i.e., the actual value of the spatial information) is mapped to the corresponding grid spatial position in the coefficient grid and each base grid. Then, based on the queried grid spatial position, the grid cell in which it belongs is determined. After determining the grid cell, the coefficient features and base features at the grid spatial position are determined by trilinear interpolation based on the eight grid vertices of that grid cell. Then, the element-wise product of the coefficient features and the concatenated base features (also known as the Hadamard product) is used to determine the lighting feature vector at the grid spatial position. For example, if the coefficient features are... The basic features after splicing are The corresponding illumination feature vector is expressed as .

[0112] Next, based on the calculated illumination feature vector, an estimated value of the illumination information is determined (i.e., the second calculation step). Specifically, the illumination feature vector determined in the first calculation step is input as input data to a multilayer perceptron initialized in the initialization step. The estimated value of the illumination information is determined through mapping by the multilayer perceptron. The estimated value of the illumination information includes a first estimated value corresponding to the first actual value and a second estimated value corresponding to the second actual value. That is, the first estimated value describes uniform illumination in all directions, and the second estimated value describes the illumination details in different directions.

[0113] Next, a judgment is made as to whether the difference between the estimated value and the actual value of the illumination information is greater than a pre-set benchmark difference (i.e., the judgment step). Specifically, in this embodiment, a loss function (also called a cost function) is constructed to determine the difference. Specifically, in this embodiment, the loss function is a linear combination of the distance between the first actual value and the first estimated value, and the distance between the second actual value and the second estimated value. The distances mentioned here can be set to various types of distances according to the actual situation, such as Euclidean distance, city distance (Manhattan distance), etc. For example, the loss function can be constructed as follows:

[0114]

[0115] in:

[0116] This represents the root mean square error between the first actual value and the first estimated value.

[0117] yes In the loss function The proportion of it, ;

[0118] This represents the root mean square error between the second actual value and the second estimated value.

[0119] yes In the loss function The proportion of it, .

[0120] Furthermore, as an example, in the above expression, for instance, if... This relationship. However, it should be noted that, and The relationships between them are not limited to those mentioned above, and can also be designed into other relationships according to actual needs.

[0121] Specifically, in this embodiment, considering that isotropic lighting information is more important for lighting calculations and the final rendering effect compared to lighting details in different directions, the root mean square error between the first actual value and the first estimated value accounts for a larger proportion in the loss function than the root mean square error between the second actual value and the second estimated value. In other words, and Between This relationship.

[0122] It should be reiterated that the root mean square error mentioned above is one type of distance metric, and is not limited to it. Furthermore, it should be noted that the loss function described above, as a measure of the difference between the estimated and actual values, is only one example; other types of loss functions can be used as needed.

[0123] Then, if it is determined that the calculated difference is less than or equal to the preset baseline difference, the coefficient features stored at the vertices of the coefficient grid, the base features stored at the top of each base grid, and the parameters of the multilayer perceptron are output (i.e., the output step), and the training of the model is completed.

[0124] On the other hand, if the calculated difference is determined to be greater than a preset baseline difference, the values ​​of the coefficient features stored at the vertices of the coefficient grid and the base features stored at the vertices of each base grid are updated based on the difference, and the first calculation step described above is executed again until the calculated difference is less than or equal to the baseline difference (i.e., the update step). As a specific means of updating, gradient descent can be used, for example. Specifically, the current values ​​of the coefficient features and base features, as well as the parameters of the multilayer perceptron, are adjusted and updated. Based on the updated coefficient features and base features, and the parameters of the multilayer perceptron, the estimated value of the illumination information at the aforementioned grid spatial location is determined again, and it is judged whether the difference between the updated estimated value and the actual value is greater than the aforementioned baseline difference. This process is repeated until the difference between the final estimated value and the actual value is less than or equal to the aforementioned baseline difference; in other words, until the value of the loss function is less than a preset baseline value. Thus, the final coefficient features and base features are determined.

[0125] Finally, the finalized coefficient features, basic features, and parameters of the multilayer perceptron are output (i.e., the output step), and the training of the model is completed.

[0126] Alternatively, the updated values ​​of each coefficient feature and each basic feature can be weighted and pruned, restricting the values ​​of each component of each coefficient feature and each basic feature to the range [-1, 1]. By performing weight pruning on each coefficient feature and basic feature, the gradient magnitude can be more controllable during backpropagation, avoiding gradient explosion or gradient vanishing due to excessive differences. Furthermore, since the weight pruning operation is performed after the coefficient features and basic features are updated, the gradient calculation logic is not affected. In other words, the weight pruning operation does not participate in backpropagation.

[0127] Alternatively, after weight pruning to restrict the coefficient features and base features to the range [-1, 1], the coefficient features and base features can be stored in an eight-bit unsigned integer (i.e., unit8) or half-precision floating-point number (float16) format (i.e., quantized storage). This saves storage resources compared to using a single-precision floating-point number (float32) data format.

[0128] On the other hand, optionally, it can be determined whether the color space used for the lighting information is RGB. If it is determined to be RGB, a color space conversion is performed, converting the RGB color space to the YCoCg color space. When the color space used for the lighting information stored in the spherical harmonic coefficients is RGB, due to the strong correlation between the three RGB channels, after lighting calculations are performed based on the trained coefficient grid and base grid and further rendering is completed, color casts are prone to occur in areas with many high-frequency details in the scene. Therefore, by converting the RGB color space to the YCoCg color space, the correlation between colors can be removed, avoiding color casts in areas with many high-frequency details. Alternatively, the RGB color space can be converted to the XYZ color space.

[0129] Furthermore, when the configuration density of lighting probes is the same throughout the entire virtual scene, the lighting space of the entire virtual scene can be decomposed using the aforementioned basis function decomposition, resulting in a coefficient grid and multiple base grids. On the other hand, if the configuration density of lighting probes is the same in different regions of the virtual scene—in other words, if there are multiple regions with different lighting probe configuration densities—then, since the lighting probe data itself is 3D unstructured data with a highly uneven spatial distribution, simply using a set of global parameters to directly compress information of different densities can easily lead to redundant parameter utilization in some regions and insufficient parameter utilization in others. Moreover, the distribution of lighting probes with different configuration densities may also have coordinate overlap issues. Therefore, preferably, the virtual scene is divided into regions corresponding to each configuration density based on the lighting probe configuration density, and the lighting space of each region is decomposed using basis functions separately.

[0130] Alternatively, the physical coordinates of the coefficient grid and each base grid are normalized to a cube of [-1,1]*[-1,1]*[-1,1]. This normalization eliminates the impact of spatial scale differences on the algorithm, allowing virtual scenes of different physical sizes to share a unified computational process.

[0131] According to the data processing method described in this embodiment, by performing basis function decomposition on the lighting space of the virtual scene, the lighting space is decomposed into a coefficient grid with global characteristics and multiple base grids with local characteristics. This allows for significant compression of the amount of data required to reproduce the virtual scene while preserving the original lighting effects as much as possible. In other words, the data processing method described in this embodiment can significantly reduce memory / video memory usage and package size while preserving the lighting effects as much as possible.

[0132] Specifically, suppose that each lighting probe encodes and stores the RGB information in the lighting information of the virtual scene, for example, using the coefficients of a first-order spherical harmonic function. Further suppose that for each color channel in the RGB, we use a first-order spherical harmonic (i.e., the highest order of the corresponding spherical harmonic function = 1), with each coefficient occupying one single-precision floating-point number (float32), and each single-precision floating-point number requiring 4 bytes. Since the first-order spherical harmonic function includes a total of 4 coefficients, the storage required for each color channel is 4 single-precision floating-point numbers. Since there are a total of 3 color channels, the storage required to store RGB information in one lighting probe is 3 * 4 = 12 single-precision floating-point numbers, occupying 48 bytes. Therefore, if the number of lighting probes is 37 * 22 * ​​42 as described above, then without applying any additional data compression methods, the storage space occupied is 1,641,024 bytes. In contrast, by decomposing the illumination space into the aforementioned one coefficient grid and six coefficient grids, and assuming that each element of each coefficient eigenvector and each element of each basis eigenvector occupies one single-precision floating-point number, i.e., 4 bytes, then, without applying any other additional data compression methods, the storage space occupied is 206,712 bytes, achieving a compression ratio of approximately 12.6%.

[0133] Furthermore, if the weights of the updated coefficient features and base features are pruned during model training to limit their values ​​to the range [-1, 1], then they can be stored using eight-bit unsigned integers (1 byte) or half-precision floating-point numbers (2 bytes), thereby further compressing the data. Specifically, when using half-precision floating-point numbers for storage, the compression ratio can reach approximately 6.3%, while when using eight-bit unsigned integers for storage, the compression ratio can reach even further, approximately 3.15%.

[0134] [Illumination Calculation Method Based on Coefficient Grid and Base Grid]

[0135] Next, refer to Figures 4-7 The illumination calculation method based on the coefficient grid and base grid formed by the data processing method according to an embodiment of this application will be described.

[0136] Figure 4 A flowchart illustrating a lighting calculation method based on a coefficient grid and a base grid formed by a data processing method according to an embodiment of this application is shown. It should be noted that... Figure 4This is merely one example of a lighting calculation method and does not imply that it only includes the steps shown in the diagram. Furthermore, the order of the steps shown in the diagram is only an example and can be adjusted according to actual circumstances, as long as the lighting calculation can be completed. On the other hand, Figure 5 It shows Figure 4 A schematic diagram of the illumination calculation method described above.

[0137] First, in step ST100, the identification information of the virtual scene to be loaded is obtained. Specifically, when a user starts a game or switches game scenes, the game screen needs to be re-rendered and loaded. Therefore, the processing device needs to know which virtual scene to load. Thus, by obtaining the identification information, the processing device can identify the virtual scene to be loaded.

[0138] Next, in step ST200, after obtaining the identification information of the virtual scene to be loaded, a coefficient grid and multiple base grids corresponding to the virtual scene are retrieved from the storage device based on the identification information. Specifically, since the coefficient grid and base grids are stored in association with the identification information of the virtual scene in the above storage step, the coefficient grid and multiple base grids corresponding to the virtual scene pointed to by the identification information can be found quickly and accurately. In this embodiment, it is assumed that the lighting space of the virtual scene is as follows: Figure 3 As shown, it is decomposed into a coefficient grid of 27*11*11*11 and six base grids of 6*3*3*3, 6*5*5*5, 6*7*7*7, 3*9*9*9, 3*11*11*11, and 3*13*13*13 respectively.

[0139] Then, in step ST300, based on the spatial coordinates of the target point in the virtual scene, the grid space coordinates of the target point in the coefficient grid and each base grid are determined. In other words, the target point in the virtual scene is mapped to the coefficient grid space and each base grid space, respectively. Regarding the mapping to the coefficient grid, a specific mapping method is used. This refers to the identity mapping. The mapping to each basis grid uses a periodic coordinate transformation mapping. For example, for each of the six basis functions mentioned above, a periodic transformation mapping is used. .in, Indicates the first The sampling frequency bands (or frequency levels) of each base grid. It should be noted that the sampling frequency bands... The larger the sampling frequency band, the more detailed the captured lighting information. Specifically, if the sampling frequency band is in the low-frequency band, the captured lighting information describes the global lighting distribution (e.g., diffuse reflection, ambient occlusion). If the sampling frequency band is in the mid-frequency band, the captured lighting information describes the local shadow transitions (e.g., soft shadows, indirect lighting). If the sampling frequency band is in the high-frequency band, the captured lighting information describes the microscopic surface reflections (e.g., highlights, texture details). In other words, mapping the target point to each base grid refers to periodically transforming the spatial coordinates of the target point in the virtual scene based on the sampling frequency band set in the base feature dimension of each of the multiple (here, six) base grids, thereby determining the grid spatial coordinates of the target point in each base grid. Thus, by setting different sampling frequency bands for each base grid, it is possible to capture lighting information at multiple scale frequencies by periodically transforming the target point in the virtual scene to each base grid.

[0140] Next, in step ST400, the coefficient features and base features corresponding to the target point are determined based on the grid space coordinates of the target point in the coefficient grid and each base grid in the virtual scene. Figure 6 A flowchart for implementing step ST400 is shown.

[0141] like Figure 6 As shown, firstly, in step ST4001, the coefficient grid cell containing the target point in the coefficient grid and the base grid cell containing the target point in each base grid are determined by indexing based on the grid space coordinates of the target point. As explained above, the coefficient grid and each base grid can be regarded as a three-dimensional index array. By inputting the grid space coordinates of the target point for querying, the coefficient grid cell and base grid cell containing the target point can be determined.

[0142] Next, in step ST4002, the coefficient characteristics of the target point are determined based on the coefficient grid cell where the target point is located in the coefficient grid. Specifically, based on the spatial coordinates of the target point in the coefficient grid and the spatial coordinates of the eight coefficient grid vertices of its cell, trilinear interpolation is performed according to the coefficient characteristics stored in the eight coefficient grid vertices to determine the coefficient characteristics of the target point. Figure 5 As shown, in this embodiment, the coefficient feature of the target point is a 27-dimensional feature vector (also known as the coefficient feature vector).

[0143] On the other hand, in step ST4003, the basic features of the target point are determined based on the base grid cell where the target point is located in each base grid. Specifically, based on the spatial coordinates of the target point in each base grid and the spatial coordinates of the eight base grid vertices of the base grid cell where it is located, trilinear interpolation is performed according to the basic features stored in the eight base grid vertices to determine the basic features of the target point in each base grid. Figure 5 As shown, in this embodiment, the basic features of the target point in the six base grids are respectively a 6-dimensional, 6-dimensional, 6-dimensional, 3-dimensional, 3-dimensional, and 3-dimensional feature vectors (also called basic feature vectors).

[0144] It should be noted that the execution order of steps ST4002 and ST4003 is not limited to this; the execution order can be changed, or they can be executed simultaneously.

[0145] Next, in step ST500, the illumination information of the target point is calculated based on the coefficient features and basis features corresponding to the target point. Specifically, after determining the basis features of the target point in the six base grids, as follows... Figure 5 These basic features are concatenated as shown to form a 27-dimensional basic feature vector. Then, similarly... Figure 5 As shown, the 27-dimensional coefficient features of the target point and the concatenated 27-dimensional basis features are multiplied by a Hadamard product (element-wise product) to form the illumination feature vector of the target point, which also has 27 dimensions. The Hadamard product has already been described above and will not be repeated here. Next, as input data, the illumination feature vector of the target point is fed into a pre-trained multilayer perceptron for nonlinear transformation to determine the illumination information of the target point.

[0146] Figure 7 This diagram illustrates an example of the main components of a multilayer perceptron and a schematic diagram of the nonlinear transformation of illumination feature vectors through this multilayer perceptron. Figure 7As shown, the multilayer perceptron includes an input layer L1, a first intermediate layer L2 and a second intermediate layer L3 as hidden layers, a first activation function F1 located between the first and second intermediate layers, a second activation function F2 located after the second intermediate layer, and an output layer L4 located after the second activation function. The input layer L1 receives the 27-dimensional illumination feature vector (1*27) of the target point. The first intermediate layer L2, for example, includes a 27*64 two-dimensional matrix. The 1*27 illumination feature vector input to the first intermediate layer L2 is multiplied by the 27*64 two-dimensional matrix to form a 1*64 vector. This 1*64 vector is then nonlinearly transformed by the first activation function F1 and output to the second intermediate layer L3. The second intermediate layer, for example, includes a 64*12 two-dimensional matrix. The 1*64 vector input to the second intermediate layer L3 is multiplied by the 64*12 two-dimensional matrix to form a 1*12 vector. Then, the 1*12 vector is non-linearly transformed by the second activation function F2 and output to the output layer L4. The output layer L4 outputs the 12-dimensional vector input to it as the result of calculating the illumination information of the target point.

[0147] By performing lighting calculations on each target point in the virtual scene using the above method, lighting calculations for the entire virtual scene can be achieved, thus enabling subsequent rendering tasks. In particular, because the lighting space of the virtual scene is decomposed into a coefficient grid and multiple base grids, significant compression of lighting data is achieved. Therefore, it avoids situations where large-scale games suffer from poor performance or even fail to load on low-end devices due to excessively large lighting data.

[0148] However, it should be noted that, Figure 7 The main structure of the multilayer perceptron shown is only one example and is not limited to this. For example, it is also possible to add other intermediate layers as hidden layers and configure corresponding activation functions. For example, it is also possible to set only one intermediate layer and its corresponding activation function.

[0149] Furthermore, it should be noted that the above implementation method uses data compression of lighting information in a virtual scene as an example, but it is not limited to this. For example, textures can also be the object of data compression. That is, by using the data processing method described in this embodiment, compression of texture data and other data can also be achieved.

[0150] It should be noted that the computer-readable medium shown in this invention may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. The computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof.

[0151] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the computer device described in the above embodiments and their variations, or may exist independently and not assembled into the computer device. The computer-readable storage medium carries one or more programs that, when executed by the computer device, cause the computer device to perform the methods as described in the above embodiments and their variations. For example, the computer device may implement the steps shown in the figures.

[0152] According to one aspect of the present invention, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the computer device to perform the methods provided in various optional implementations of the above embodiments.

[0153] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A data processing method, wherein the data processing method is used to process the lighting space of a virtual scene, characterized in that, include: The illumination space is decomposed into a coefficient grid and multiple base grids; as well as The coefficient grid and the plurality of base grids are stored. in, The coefficient grid includes a coefficient feature dimension and a first spatial dimension. The first spatial dimension represents the spatial resolution of the coefficient grid vertices. The coefficient feature dimension includes channels that store coefficient features relative to each coefficient grid vertex. Each of the base grids includes a base feature dimension and a second spatial dimension. The second spatial dimension represents the spatial resolution of the base mesh vertices. The basic feature dimension includes channels that store a pre-defined sampling frequency band for the basic features relative to each base grid vertex. The sampling frequency bands set in the basic feature dimensions of each of the plurality of base grids are different from each other.

2. The data processing method as described in claim 1, characterized in that, The physical coordinates of the coefficient grid and the base grid are normalized, and the normalized coefficient grid and base grid are stored.

3. The data processing method as described in claim 1, characterized in that, Decomposing the illumination space into a coefficient grid and multiple base grids includes: An initialization step is performed in which initial values ​​are assigned to the coefficient features stored at the vertices of the coefficient grid and the base features stored at the vertices of the base grid. The acquisition step involves acquiring the actual values ​​of the illumination information and the spatial information of the illumination space. In the first calculation step, the illumination feature vector of the illumination space is calculated based on the actual value of the spatial information of the illumination space, the coefficient features stored in the coefficient grid vertices, and the base features stored in the base grid vertices. The second calculation step involves determining an estimated value of the illumination information based on the illumination feature vector. The judgment step involves determining whether the difference between the estimated value of the illumination information and the actual value of the illumination information is greater than a preset benchmark difference. In the update step, if the difference is greater than the baseline difference, the values ​​of the coefficient features stored at the coefficient grid vertices and the base features stored at the base grid vertices are updated based on the difference, and the first calculation step is executed again until the difference is less than the baseline difference; and In the output step, if it is determined that the difference is less than the baseline difference, the coefficient features stored in the coefficient grid vertices and the base features stored in the base grid vertices are output in the output step.

4. The data processing method as described in claim 3, characterized in that, In the update step, the updated values ​​of the coefficient features and the base features are weighted and pruned to restrict the coefficient features and the base features to the range [-1, 1].

5. The data processing method as described in claim 4, characterized in that, The base features and the coefficient features are stored in an 8-bit unsigned integer or half-precision floating-point data format.

6. The data processing method as described in claim 3, characterized in that, The actual values ​​of the illumination information include a first actual value encoded as 0th-order spherical harmonic coefficients and a second actual value encoded as 1st-order spherical harmonic coefficients. The estimated value of the illumination information includes a first estimated value corresponding to the first actual value and a second estimated value corresponding to the second actual value. The difference is determined by a loss function consisting of a linear combination of the distance between the first actual value and the first estimated value, and the distance between the second actual value and the second estimated value. In the loss function, the distance between the first actual value and the first estimated value has a higher weight than the distance between the second actual value and the second estimated value.

7. The data processing method according to any one of claims 1 to 6, characterized in that, The virtual scene is equipped with a lighting probe to collect lighting information of the lighting space of the virtual scene. Based on the configuration density of the illumination probes, the virtual scene is divided into regions corresponding to each configuration density, and The illumination space of each region is decomposed into a coefficient grid and a plurality of base grids.

8. The data processing method as described in claim 3 or 6, characterized in that, Determine whether the color space used for the illumination information is the RGB color space. If it is determined that the color space used is RGB color space, the RGB color space is converted into YCoCg color space or XYZ color space.

9. A method for calculating illumination, characterized in that, Illumination calculation is performed based on a coefficient grid and multiple base grids determined by the data processing method according to any one of claims 1 to 8, wherein the illumination calculation method includes: Obtain the identification information of the virtual scene to be loaded; Based on the identification information, retrieve the coefficient grid and the multiple base grids corresponding to the virtual scene; Based on the spatial coordinates of the target point in the virtual scene, determine the grid spatial coordinates of the target point in the one coefficient grid and the multiple base grids respectively; The coefficient features and basic features corresponding to the target point are determined based on the grid spatial coordinates; and The illumination information of the target point is calculated based on the coefficient features and basic features corresponding to the target point.

10. The illumination calculation method as described in claim 9, characterized in that, Based on the sampling frequency band set in the base feature dimension of each of the multiple base grids, the spatial coordinates of the target point in the virtual scene are periodically transformed to determine the grid spatial coordinates of the target point in each of the base grids.

11. The illumination calculation method as described in claim 9, characterized in that, Determining the coefficient features and basic features corresponding to the target point based on the grid space coordinates includes: Indexing is performed based on the grid space coordinates of the target point to determine the coefficient grid cell in the coefficient grid where the target point is located, and the base grid cell in each base grid where the target point is located. Based on the spatial coordinates of the coefficient grid vertices of the coefficient grid unit and the spatial coordinates of the target point, interpolation calculations are performed using the coefficient features stored at the coefficient grid vertices of the coefficient grid unit to determine the coefficient features of the target point; and Based on the spatial coordinates of the base grid vertices of each base grid cell and the grid spatial coordinates of the target point, interpolation calculations are performed based on the base features stored in the base grid vertices of each base grid cell to determine the base features of the target point.

12. The illumination calculation method as described in claim 9 or 11, characterized in that, Calculating the illumination information of the target point includes: The illumination feature vector of the target point is determined by element-wise multiplying the coefficient features and basic features of the target point; and The illumination feature vector is input into a multilayer perceptron for nonlinear transformation to determine the illumination information of the target point as the output result.

13. The illumination calculation method as described in claim 12, characterized in that, The multilayer perceptron includes an input layer, hidden layers, activation functions, and an output layer. The input layer provides the illumination feature vector of the target point as input. The hidden layer performs a linear transformation on the illumination feature vector from the input layer. The activation function performs a non-linear mapping on the output after a linear transformation through the hidden layer. The output layer generates the illumination information of the target point based on the output after nonlinear mapping, as the output result.

14. A computer program product, the computer program product comprising a computer program, characterized in that, The computer program is executed by a processor to implement the method of any one of claims 1 to 13.

15. A computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by a processor to implement the method of any one of claims 1 to 13.

Citation Information

Patent Citations

  • Virtual object rendering method, electronic equipment and storage medium

    CN116797708A

  • Spatial variation indoor scene illumination estimation method based on neural radiation field

    CN117671126A