Data processing method, illumination calculation method, storage medium and program product

By decomposing the lighting space into a coefficient grid and a base grid and combining it with a multi-layer perceptron for lighting calculation, the problems of high storage and computational costs in global lighting calculation are solved, and efficient lighting rendering is achieved on low-end devices.

CN120782940AActive Publication Date: 2025-10-14SHANGHAI YINGJIAO NETWORK TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies have high storage requirements and computational costs in global illumination calculations, and the compression algorithm is not of high quality, resulting in problems such as light leakage, color banding, and discontinuous lighting, which are particularly evident on mobile terminals and low-performance devices.

Method used

The illumination space is decomposed into a coefficient grid and multiple basis grids. The eigenvalues ​​of the coefficient grid and the basis grid are stored through basis function decomposition and normalization. The multi-layer perceptron is used for illumination calculation to optimize the storage and calculation process.

Benefits of technology

Significantly reduces memory and video memory usage, maintains lighting effects, is suitable for low-end PCs and low- to medium-performance mobile devices, improves calculation speed and reduces calculation overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120782940A_ABST
    Figure CN120782940A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method, an illumination calculation method, a storage medium and a program product, which can reduce the use amount of a memory / video memory and the size of a package while keeping an illumination effect. The data processing method is used for processing an illumination space of a virtual scene, and comprises the following steps: decomposing the illumination space into a coefficient grid and a plurality of base grids, and storing the coefficient grid and the plurality of base grids. The coefficient grid includes a coefficient feature dimension and a first spatial dimension, the first spatial dimension representing a spatial resolution of coefficient grid vertices of the coefficient grid, the coefficient feature dimension including channels storing coefficient features relative to each coefficient grid vertex. Each of the plurality of base grids includes a base feature dimension and a second spatial dimension, the second spatial dimension representing a spatial resolution of a base grid vertex of the base grid, the base feature dimension including a channel storing a base feature of a preset sampling frequency band with respect to each base grid vertex, the sampling frequency bands of each of the plurality of base grids being different from each other.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to a data processing method, an illumination calculation method, a storage medium and a program product. BACKGROUND

[0002] It is known that in the field of rendering, global illumination can simulate the behavior of light in the real world, making the rendered picture more realistic. On the other hand, the calculation of global illumination involves a large amount of light reflection and scene information, and the storage and calculation cost is very high, especially in game and rendering (especially real-time rendering) applications, compression techniques need to be used to reduce storage requirements and package size, and improve running efficiency. In particular, for running games or real-time rendering applications on mobile terminals and low-performance PCs, it is particularly important to use compression techniques to reduce storage requirements and package size.

[0003] For this purpose, various image data compression and optimization methods have been proposed in the industry, common methods include:

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

[0005] Sparse light maps and sparse sampling of light maps, such as ASCT;

[0006] Optimize storage methods, such as using low-precision storage, separate storage of maps and using texture compression formats;

[0007] Replace full data with sparser light probes, such as using Unity's Adaptive Probe Volumes function; and

[0008] Delete other unimportant assets in the picture to give more space to the light data.

[0009] However, the inventors of the present application found that most statistical compression algorithms have low compression quality and insufficient compression rate, which can cause light leakage, color bands, and discontinuous lighting. As for the optimization storage methods such as block map and coefficient storage, there is also a problem of insufficient compression rate, and the compression ratio is usually only about 50%. In addition, some compression algorithms are relatively complex, and the use of these compression algorithms can cause more computational overhead and hardware requirements. For example, a large amount of calculation is required in the data decompression process, which can increase the computational consumption of the shader and increase the game running burden. In addition, in the case of using some large network-based models for image data compression, there can be a problem of slow real-time inference. And in the case of using specific technologies such as TensorRT, the user device is required to have a specific type of graphics card. SUMMARY

[0010] The technical problems solved by the present application

[0011] The present disclosure addresses the aforementioned technical issues. Specifically, for a lighting probe-based lighting calculation and real-time rendering solution, the present disclosure provides a data processing method that significantly reduces memory / video memory usage and package size while maintaining the desired lighting effects. Furthermore, the present disclosure provides a lighting calculation method, a computer-readable storage medium, and a computer program product.

[0012] Technical solutions used to solve technical problems

[0013] A technical solution of the present disclosure provides a data processing method for processing the lighting space of a virtual scene, comprising:

[0014] Decomposing the illumination space into a coefficient grid and a plurality of basis grids; and

[0015] The one coefficient grid and the multiple base grids are stored, wherein,

[0016] The coefficient grid consists of the coefficient feature dimension and the first spatial dimension,

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

[0018] The coefficient feature dimension includes a channel storing a coefficient feature for each coefficient grid vertex,

[0019] Each of the base grids comprises a base feature dimension and a second spatial dimension,

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

[0021] The basic feature dimension includes a channel for storing basic features of a preset sampling frequency band relative to each basic mesh vertex,

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

[0023] According to the data processing method described in the present technical solution, a coefficient grid and multiple base grids are formed by performing basis function decomposition on the lighting space of the virtual scene, and, as an alternative to directly storing the lighting information of the lighting space, the above-mentioned coefficient grid and multiple base grids are stored. This can significantly reduce the usage of memory / video memory and the package size, thereby achieving significant compression of the 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, the influence of spatial scale difference on the algorithm is eliminated through normalization, so that virtual scenes with different physical sizes share the same calculation process.

[0026] As a further optional technical solution, the illumination space is decomposed into a coefficient grid and a plurality of base grids, including:

[0027] In the initialization step, initial values are assigned to the coefficient features stored in the coefficient grid vertices and the base features stored in the base grid vertices.

[0028] In the acquisition step, the actual values of the illumination information and the spatial information of the illumination space are acquired.

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

[0030] In the second calculation step, based on the illumination feature vector, the estimated value of the illumination information is determined.

[0031] In the judgment step, whether the difference between the estimated value of the illumination information and the actual value of the illumination information is greater than a pre-set reference difference is judged.

[0032] In the update step, in the case of greater than the reference difference, based on the difference, the values of the coefficient features stored in the coefficient grid vertices and the base features stored in the base grid vertices are updated, and the first calculation step is executed again until the difference is less than the reference difference.

[0033] In the output step, in the case of less than the reference difference, the coefficient features stored in the coefficient grid vertices and the base features stored in the base grid vertices are output.

[0034] According to the data processing method, through the initialization-calculation-update iterative process, the values of the coefficient features and the base features can be automatically optimized, avoiding the limitations of manual parameter adjustment.

[0035] As a further optional technical solution, in the updating step, weight clipping is performed on the updated values ​​of the coefficient feature and the base feature to limit the coefficient feature and the base feature to the interval [-1, 1].

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

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

[0038] The data processing method according to 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 a 0th-order spherical harmonic coefficient and a second actual value encoded as a 1st-order spherical harmonic coefficient. 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. Moreover, in the loss function, the proportion of the distance between the first actual value and the first estimated value is higher than the distance between the second actual value and the second estimated value.

[0040] The data processing method described in this technical solution assigns a higher weight to the 0th-order spherical harmonic coefficients (DC components), thereby giving them a higher loss weight and ensuring the accuracy of the basic lighting. On the other hand, assigning a lower weight to the 1st-order spherical harmonic coefficients (linear components) avoids overfitting of high-frequency noise and balances smoothness and detail preservation.

[0041] As a further optional technical solution, the virtual scene is configured with lighting probes for collecting lighting information of the virtual scene's lighting space. 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 the coefficient grid and the multiple base grids.

[0042] The data processing method described in this technical solution adaptively splits the target data (i.e., the virtual scene's lighting space) based on the distribution of the target data to be compressed (e.g., the lighting data of the virtual scene's lighting space), for example, based on the configuration density and spatial position distribution of the lighting probes. This avoids the problems of insufficient local parameter utilization, local redundancy, and severe errors that can occur when simply using a set of global parameters to directly compress lighting information of varying configuration densities.

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

[0044] According to the data processing method described in the present technical solution, by converting the RGB color space into the YCoCg color space or the XYZ color space, the correlation between the three RGB channels can be removed, thereby avoiding the color cast phenomenon of color spots in areas with more high-frequency details.

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

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

[0047] Retrieving the coefficient grid and the plurality of base grids corresponding to the virtual scene based on the identification information;

[0048] Determining, according to the spatial coordinates of the target point in the virtual scene, the grid space coordinates of the target point in the coefficient grid and the plurality of base grids;

[0049] Determining the coefficient features and base features corresponding to the target point according to the grid space coordinates; and

[0050] Calculate the illumination information of the target point according to the coefficient features and base features corresponding to the target point.

[0051] Compared to reconstructing the virtual scene's lighting space based on traditional methods that directly store lighting information, the lighting calculation method described in this technical solution, using the coefficient grid and multiple base grids determined by the data processing method of any of the above technical solutions, accelerates calculation speed while preserving lighting effects as much as possible. Furthermore, because the amount of data used for lighting calculations is significantly reduced, it is suitable for 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 base grid of the multiple base grids to determine the grid space coordinates of the target point in each base grid.

[0053] According to the illumination calculation method described in the present technical solution, by setting different sampling frequency bands (or sampling periods) for each base grid, it is possible to capture illumination information at multi-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 base features corresponding to the target point according to the grid space coordinates includes:

[0055] Indexing according to the grid space coordinates of the target point, determining the coefficient grid unit where the target point is located in the coefficient grid and the base grid unit where the target point is located in each base grid;

[0056] performing interpolation calculation based on the coefficient features stored in the coefficient grid vertices of the coefficient grid unit and the spatial coordinates of the target point to determine the coefficient features of the target point; and

[0057] According to the spatial coordinates of the base grid vertex of each base grid unit and the grid space coordinates of the target point, interpolation calculation is performed based on the basic features stored in the base grid vertex of each base grid unit to determine the basic features of the target point.

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

[0059] Multiplying the coefficient feature and the base feature of the target point element by element to determine the illumination feature vector of the target point; and

[0060] The illumination feature vector is input into a multi-layer perceptron for nonlinear transformation to determine the illumination information of the target point as an 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 an illumination feature vector of the target point. The hidden layer performs a linear transformation on the illumination feature vector from the input layer. The activation function performs a nonlinear mapping on the output of the linear transformation performed by the hidden layer. The output layer generates illumination information of the target point as the output result based on the output after the nonlinear mapping. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 A schematic diagram shows an example of a light probe configured in a virtual scene, which is a processing target of a data processing method according to an embodiment of the present application.

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

[0064] Figure 3 A schematic diagram showing a coefficient grid and multiple base grids formed by performing basis function decomposition on the illumination space of a virtual scene is shown.

[0065] Figure 4 A flowchart of a lighting calculation method implemented by a coefficient grid and a base grid formed by a data processing method according to an embodiment of the present application is shown.

[0066] Figure 5 Shown Figure 4 Schematic diagram of the lighting calculation method.

[0067] Figure 6 Shows the implementation Figure 5 FIG. 1 is a flowchart of step ST400 in the illumination calculation method shown in FIG.

[0068] Figure 7 An example of the main structure of a multilayer perceptron and a schematic diagram showing the nonlinear transformation of an illumination feature vector by the multilayer perceptron are shown. DETAILED DESCRIPTION

[0069] First, before describing the specific embodiments, some technical terms involved in the present disclosure are explained.

[0070]

Term explanation

[0071] The “virtual scene” mentioned in this application is, for example, a CG movie scene, an animation scene, or a game scene, etc., and is not a real scene in a 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 data set 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, which is used to express and analyze the distribution, structure or pattern of data. It 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 technology that simulates the lighting of the real world in a three-dimensional virtual environment or a three-dimensional virtual scene to obtain three-dimensional world lighting data, thereby generating realistic graphics. The core of the three-dimensional feature space is to calculate the visual effects produced by the interaction of light and the surface of an object through mathematical models and algorithms, including but not limited to diffuse reflection, specular reflection, shadows, ambient light occlusion, etc. In the three-dimensional lighting space, the lighting information at the position corresponding to the coordinate can be queried through the three-dimensional space coordinates. It is particularly important to note that the three-dimensional lighting space is a space for lighting information, not an actual physical space, similar to the above-mentioned three-dimensional feature space, or similar to the latent space / feature space mentioned in deep learning.

[0075] "Lighting information," as used in this application, refers to the information required for rendering a virtual scene. It primarily describes, but is not limited to, the intensity and color of light in different directions. It should be noted that lighting information may be represented in different forms (e.g., spherical harmonic coefficients) and may describe slightly different information.

[0076] The "global illumination (GI)" mentioned in this application refers to an illumination technology that takes into account both the illumination directly from the light source in the virtual scene, i.e., direct illumination, and the illumination reflected by other virtual objects (or virtual objects) in the virtual scene, i.e., indirect illumination. In other words, global illumination is an illumination technology that takes into account both direct and indirect illumination. Specifically, unlike the local illumination model, the global illumination model takes into account the multiple reflections, refractions, and scattering of light in the virtual scene, simulating more complex and realistic illumination phenomena. Direct light is light from the light source, and indirect light is light emitted from the light source that is reflected and / or scattered from the surface of a virtual object to the surface of other virtual objects. The technical solution of this application discusses a global illumination technology that covers both direct and indirect illumination, as well as a global illumination technology that only covers indirect illumination.

[0077] The "light 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 stands for Neural Field, an implicit representation model based on neural networks used to model signals in physical or abstract space (such as geometric shapes, materials, lighting, motion, etc.). Neural fields take spatial coordinates (such as 3D position, time, etc.) as input and directly map them to target signals (such as color, density, speed, etc.) using neural networks (such as multi-layer perceptrons (MLPs), thereby implicitly expressing 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 that aims to unify multiple signal representation methods, including the aforementioned neural fields and other traditional approaches. In particular, neural fields can be viewed as a specific representation within the Factor Field framework. For example, Neural Fields (NeRFs) correspond to a single factor field, using multilayer perceptrons (MLPs) with positional encodings as factors.

[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 base grid are also referred to as coefficient (factor) fields and base (factor) fields, 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 illumination space, into a combination of multiple basis functions (also understood as factor fields in this application), and flexibly combine them with different representation methods (such as MLP, grids, hash tables, etc.) and coordinate transformations (such as periodic transformations and orthogonal projections).

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

[0085] Next, the illumination space as the target of data processing will be described.

[0086] Description of the lighting space

[0087] In this embodiment, the three-dimensional lighting space of a three-dimensional virtual scene of a video game is used as an example of a data processing object to which the data processing method of this application is applied. 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, for example, expressed in the form of coordinate values ​​of a three-dimensional orthogonal coordinate system. Each physical spatial position in the three-dimensional lighting space has corresponding lighting information, and the lighting information includes but is not limited to intensity information and color information of light from different directions. The lighting information can be encoded and stored in a variety of ways.

[0088] In this embodiment, the lighting information is collected by lighting probes configured in the virtual scene. Figure 1 FIG. 1 is a schematic diagram showing an example of a light probe configured in a virtual scene, which is a processing object of a data processing method according to an embodiment of the present application. Figure 1 As shown in FIG, a large number of lighting probes are configured in the virtual scene to collect the lighting information of the virtual scene. Figure 1 It can be observed that the configuration density of light probes varies in different areas of the virtual scene. The configuration density of light probes in some areas is higher, while the configuration density of light probes in some areas is lower. In other words, the configuration LOD (level of detail) of light probes is different in different areas of the virtual scene. Figure 1 In the embodiment, the lighting probes are arranged in a grid as a whole. This facilitates calculations using trilinear interpolation. It should be noted that in this embodiment, the lighting probes are arranged in a grid, but the invention is not limited to this. For example, the lighting probes can be arranged in a tetrahedron rather than a grid. Furthermore, in this embodiment, the lighting probes are arranged in a non-uniform manner (or, in a block-by-block uniform manner), but the invention is not limited to this. For example, the lighting probes can also be arranged uniformly in a grid throughout the virtual scene.

[0089] In this implementation, Light Probes use spherical harmonics to store lighting information. Specifically, each Light Probe records the lighting information at its location and encodes this lighting information as spherical harmonic coefficients for the red, green, and blue color channels. However, it should be noted that Light Probes are not limited to using spherical harmonics to store lighting information; other methods, such as the Ambient Cube, can also be used as needed.

[0090] In summary, in this implementation, the virtual scene's lighting space is an abstract data space constructed based on lighting probes and the lighting information they store, used to describe the lighting distribution within the virtual scene. This lighting space integrates the sampled data from discrete light probes to form a continuous, spatial representation of the virtual scene's lighting environment.

[0091] For ease of explanation, we assume that the virtual scene's lighting space is a uniform grid of light probes, represented by a fourth-order tensor of 12*37*22*42, where 37, 22, and 42 represent the number of probes in each of the three spatial dimensions of the light probe grid, and 12 represents the dimensionality of the lighting information stored by each light probe. It's important to reiterate that the representation of the light space doesn't have to be a standard grid; the light probe grid here is merely a specific implementation of a 3D light field.

[0092] Next, the data structures of the coefficient grid and the base grid obtained by decomposing the illumination space of the virtual scene using the data processing method according to one embodiment of the present application will be described.

[0093] Coefficient Grid

[0094] The coefficient grid is a factor field with global characteristics formed by basis function decomposition of the illumination space, sometimes also called the coefficient factor field.

[0095] From a computer graphics perspective, a coefficient grid is a three-dimensional grid with uniformly spaced vertices. The vertices of a coefficient grid are called coefficient grid vertices. Furthermore, a unit enclosed 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 whose first component is the coefficient feature dimension, and the next three components constitute the first spatial dimension. Here, the first spatial dimension represents the spatial resolution of the coefficient grid's 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 spaced in three orthogonal directions, for a total of 11*11*11 coefficient grid vertices. The coefficient feature dimension, on the other hand, consists of channels that store coefficient features for each coefficient grid vertex. Specifically, in a 27*11*11*11 coefficient grid, each coefficient grid vertex stores a coefficient feature (value) of 27 dimensions.

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

[0097] Furthermore, the coefficient grid is a grid with global characteristics, that is, the coefficient grid has the ability to learn the global characteristics of the scene.

[0098] Base grid

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

[0100] From a computer graphics perspective, a base mesh is a three-dimensional grid with uniformly spaced vertices. The vertices of a base mesh are called base mesh vertices. Furthermore, a 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, a base mesh is a fourth-order tensor whose first component is the base feature dimension, and the next three components constitute the second spatial dimension. Here, the second spatial dimension represents the spatial resolution of the base mesh vertices of the base mesh. 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 three base mesh vertices uniformly spaced in each of the three orthogonal directions, for a total of 3*3*3 base mesh vertices. Furthermore, base features include channels that store base features for a pre-defined sampling frequency band (or frequency level) for each base mesh vertex. Specifically, in a 6*3*3*3 base mesh, each base mesh vertex stores a base feature for a specific sampling frequency band with a dimension of 6. It should be noted that the basic features described here are actually implicit feature codes after periodic coordinate transformation.

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

[0102] [Flow of the data processing method of this embodiment]

[0103] The data processing method of this embodiment mainly includes a decomposition step and a storage step. In the decomposition step, the illumination space of the virtual scene is subjected to basis function decomposition as described below, and the illumination space is decomposed into a coefficient grid and multiple base grids. The coefficient grid includes a coefficient feature dimension and a first spatial dimension representing the spatial resolution of the coefficient grid vertices. Each base grid includes a base feature dimension and a second spatial dimension representing the spatial resolution of the base grid vertices. Then, in the storage step, instead of storing the illumination information of the illumination space of the virtual scene, the coefficient grid and multiple base grids formed by the decomposition are stored. In particular, in order to be able to query the corresponding coefficient grid and base grid when reconstructing the above-mentioned virtual scene, in the storage step, the above-mentioned coefficient grid and the above-mentioned multiple base grids are stored in association with the identification information of the virtual scene that serves as the basis for the decomposition.

[0104] Decomposing an illumination space into a coefficient grid and multiple base grids through basis function decomposition involves model training for the coefficient grid and the base grids. The following describes the main process of model training for the coefficient grid and the base grids.

[0105]

Model training of coefficient grid and basis grid

[0106] Figure 2 The flowchart of the model training of the coefficient grid and base grid used in the data processing method of one embodiment of the present application is shown, and the main steps of the model training are shown. It should be noted that, Figure 2 This is just an example of model training and does not necessarily include only the steps described in the figure. Furthermore, the order of the steps shown in the figure is just an example and can be adjusted based on actual conditions, 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 should be noted that the total dimension of the base features of each base grid equals the dimension of the coefficient features of the coefficient grid. For example, suppose there are six base grids. Then, the dimension of the coefficient features of the coefficient grid is 27, and the dimensions of the base features of the six base grids are 6, 6, 6, 3, 3, and 3, respectively, satisfying 6 + 6 + 6 + 3 + 3 + 3 = 27.

[0108] Figure 3 Schematic diagram showing a coefficient grid and multiple base grids formed by performing basis function decomposition on the illumination 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 by basis function decomposition. The above six base grids are 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.

[0109] Secondly, the coefficient feature dimensions of the coefficient grid and the base feature dimensions 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 in each coefficient grid vertex of the coefficient grid and the base features stored in each base grid vertex of each base grid. This is because the specific values ​​of the coefficient features and base features cannot be determined before the model training begins, and they need to be determined through training (or supervised learning). On the other hand, since the first spatial dimension and the second spatial dimension are pre-set, there is no need to assign initial values. In addition, in the initialization step, the parameters of the multi-layer perceptron used to map the illumination feature vector described later are also initialized.

[0110] Next, the actual values ​​of the illumination information and the actual values ​​of the spatial information of the illumination space of the virtual scene are acquired (i.e., the acquisition step). Each illumination information of the illumination space is associated one-to-one with each spatial information, constituting a training example (i.e., a labeled training sample). In this embodiment, the actual value of the illumination information includes, 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 through 0th-order spherical harmonics and 1st-order spherical harmonics, wherein the first actual value stored in the 0th-order spherical harmonics describes isotropically uniform illumination, 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, and a suitable order can be selected according to actual conditions.

[0111] Then, based on the actual value of the spatial information of the obtained illumination space and the coefficient features stored in the coefficient grid vertices and the base features stored in the base grid vertices, the illumination feature vector of the illumination space is calculated (i.e., the first calculation step). Specifically, each illumination probe in the illumination space is traversed, and the spatial position of the illumination probe in the virtual scene (i.e., the actual value of the spatial information) is mapped to the coefficient grid and the corresponding grid space position in each base grid. Then, based on the queried grid space position, the grid unit where it is located is determined. After determining the grid unit where it is located, the coefficient features and base features at the grid space position are determined by trilinear interpolation based on the eight grid vertices of the grid unit. Then, the element-by-element product (also called the Hadamard product) of the coefficient features and the spliced-together base features determines the illumination feature vector at the grid space position. For example, if the coefficient feature is , the concatenated base features are , then 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 the multilayer perceptron initialized in the initialization step. The multilayer perceptron then uses this mapping to determine the estimated value of the illumination information. 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. Specifically, the first estimated value describes uniform illumination in all directions, while the second estimated value describes illumination details in different directions.

[0113] Next, a judgment is made as to whether the difference between the estimated value of the illumination information and the actual value of the illumination information is greater than a pre-set reference difference (i.e., the judgment step). Specifically, in this embodiment, a loss function (also called a cost function) is constructed to perform the difference judgment. 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 distance mentioned here can be set to various types of distances according to actual conditions, such as Euclidean distance, city distance (Manhattan distance), etc. For example, the loss function can be constructed as the following expression:

[0114]

[0115] in:

[0116] 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 ;

[0118] represents a root mean square error between the second actual value and the second estimated value;

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

[0120] And, as an example, in the above expression, for example, However, it should be noted that and The relationship between is not limited to the above relationship, and can also be designed into other relationships according to actual needs.

[0121] In particular, in this embodiment, considering that uniform illumination information in all directions is more important for illumination calculation and final rendering effect than illumination details in different directions, the root mean square error between the first actual value and the first estimated value accounts for a larger proportion than the root mean square error between the second actual value and the second estimated value in the loss function. In other words, and Satisfaction between This relationship.

[0122] It should be noted again that the root mean square error (RMS) is a type of distance metric and is not limited to this. Furthermore, it should be noted that the above loss function is only an example of a measure of the difference between the estimated value and the actual value, and other types of loss functions can also be used as needed.

[0123] Then, if it is determined that the calculated difference is less than or equal to the preset benchmark 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 pre-set benchmark difference, the coefficient features stored at the coefficient grid vertices and the values ​​of the base features stored at each base grid vertex are updated based on the difference, and the first calculation step described above is performed again until the calculated difference is less than or equal to the benchmark difference (i.e., the updating step). As a specific means of updating, for example, a gradient descent method can be used. Specifically, the values ​​of the current coefficient features and base features, as well as the parameters of the multi-layer perceptron, are adjusted and updated. Based on the updated coefficient features and base features, as well as the parameters of the multi-layer perceptron, the estimated value of the illumination information at the above-mentioned grid spatial position is again determined, and a determination is made as to whether the difference between the updated estimated value and the actual value is greater than the above-set benchmark difference. This process is repeated until the difference between the final estimated value and the actual value is less than or equal to the above-set benchmark difference, in other words, until the value of the loss function is less than the pre-set benchmark value. Thus, the final coefficient features and base features are determined.

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

[0126] Optionally, weight clipping is performed on the updated values ​​of each coefficient feature and each base feature, limiting the values ​​of each component of each coefficient feature and each base feature to the interval [-1, 1]. By weight clipping each coefficient feature and each base feature, the gradient amplitude can be more controllable during backpropagation, avoiding gradient explosion or gradient vanishing due to excessive differences. Furthermore, since weight clipping is performed after the parameters such as coefficient features and base features are updated, it can avoid affecting the gradient calculation logic. In other words, weight clipping does not participate in backpropagation.

[0127] Furthermore, after weight clipping to restrict the coefficient features and base features to the range [-1, 1], the coefficient features and base features can be stored (i.e., quantized) in the storage format of eight-bit unsigned integers (i.e., unit8) or half-precision floating-point numbers (float16). This saves storage resources occupied by the coefficient features and base features compared to using single-precision floating-point numbers (float32) for storage.

[0128] On the other hand, optionally, it is determined whether the color space used for the illumination information is an RGB color space. If it is determined that the RGB color space is used, a color space conversion is performed to convert the RGB color space into a YCoCg color space. In the case where the color space used for the illumination information stored in the spherical harmonic coefficients is an RGB color space, since there is a strong correlation between the three RGB channels, after performing illumination calculations based on the trained coefficient grid and the base grid and further completing the rendering task, color spot color casts are likely to occur in areas with more high-frequency details in the scene. To this end, by converting the RGB color space into the YCoCg color space, the correlation between colors can be removed, avoiding the generation of color spot color casts in areas with more high-frequency details. In addition, the RGB color space can also be converted into an XYZ color space.

[0129] In addition, when the configuration density of the illumination probes is the same throughout the entire area of ​​the virtual scene, the above-mentioned basis function decomposition can be performed on the illumination space of the entire virtual scene, decomposing it into a coefficient grid and multiple basis grids. On the other hand, if the configuration density of the illumination probes is the same in different areas of the virtual scene, in other words, if there are multiple areas in the virtual scene with different configuration densities of illumination probes, then, since the illumination probe data itself is three-dimensional unstructured data, the spatial distribution is very uneven. Simply using a set of global parameters to directly compress information of different densities can easily lead to redundant parameter utilization in some areas and insufficient parameter utilization in other areas. In addition, the distribution of illumination probes with different configuration densities may also have the problem of coordinate overlap. Therefore, it is preferred to divide the virtual scene into areas corresponding to each configuration density according to the configuration density of the illumination probes, and perform basis function decomposition on the illumination space of each area separately.

[0130] Additionally, the physical coordinates of the coefficient grid and each base grid can optionally be normalized to a [-1, 1]*[-1, 1]*[-1, 1] cube. 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] The data processing method described in this embodiment performs basis function decomposition on the virtual scene's lighting space, decomposing it into a coefficient grid with global characteristics and multiple base grids with local characteristics. This significantly compresses the amount of data required to store the virtual scene while preserving the original lighting effects as much as possible. In other words, the data processing method described in this embodiment significantly reduces memory / video memory usage and package size while preserving the lighting effects as much as possible.

[0132] Specifically, assume that each light probe encodes and stores the RGB information in the light information of the virtual scene through the coefficients of the 1st order spherical harmonics, for example. Further assume that for each color channel in RGB, we use the 1st order spherical harmonics (i.e., the highest order number of the corresponding spherical harmonic function = 1), and each coefficient of the spherical harmonic function occupies 1 single-precision floating point number (float32), and each single-precision floating point number needs to occupy 4 bytes. Since the 1st order spherical harmonics includes a total of 4 coefficients, for each color channel, the storage amount occupied is 4 single-precision floating point numbers. Since there are a total of 3 color channels, the storage amount required to store the RGB information in a light probe is 3*4 = 12 single-precision floating point numbers, occupying 48 bytes. Therefore, if the number of light probes is 37*22*42 as described above, without applying other additional data compression means, the size of the storage space occupied is 1641024 bytes. Unlike this, by decomposing the light space into the above one coefficient grid and the above six coefficient grids as described above, and assuming that each element of each coefficient feature vector and each element of each basis feature vector also occupies 1 single-precision floating point number, i.e., 4 bytes. Then, without applying other additional data compression means, the size of the storage space occupied is 206712 bytes, and the compression ratio is about 12.6%.

[0133] Moreover, if the weight clipping is performed on the updated coefficient features and basis features after each update during the model training process to limit their values to the interval [-1, 1], then they can be stored using an 8-bit unsigned integer (occupying 1 byte) or a half-precision floating point number (occupying 2 bytes), so that further data compression can be achieved. Specifically, in the case of storing using a half-precision floating point number, the compression ratio can be further about 6.3%, and in the case of storing using an 8-bit unsigned integer, the compression ratio can be further about 3.15%,

[0134]

Light calculation method based on coefficient grid and basis grid

[0135] Next, referring to Figures 4-7 , the light calculation method implemented by the coefficient grid and the basis grid formed by the data processing method according to an embodiment of the present application is described.

[0136] Figure 4 A flowchart of the light calculation method implemented by the coefficient grid and the basis grid formed by the data processing method according to an embodiment of the present application is shown. It should be noted that, Figure 4This is just an example of the process of the illumination calculation method, and does not mean that it only includes the steps described in the figure. Moreover, the order of the steps shown in the figure is only an example and can be adjusted according to actual conditions as long as the illumination calculation can be completed. On the other hand, Figure 5 Shown Figure 4 Schematic diagram of the lighting calculation method.

[0137] First, in step ST100, the identification information of the virtual scene to be loaded is obtained. Specifically, when a user launches a game or switches game scenes, the game screen needs to be re-rendered and reloaded. To this end, the processing device needs to know which virtual scene to load. Therefore, by obtaining the identification information, the processing device can know 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 the base grid are stored in association with the identification information of the virtual scene in the above storage step, it is possible to quickly and accurately find the coefficient grid and multiple base grids corresponding to the virtual scene pointed to by the identification information through the identification information. 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 basis 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. Regarding the mapping to the coefficient grid, the mapping adopted is That is, the identity mapping. Regarding the mapping to each base grid, the mapping used is a periodic coordinate transformation mapping. For example, for each of the six basis functions mentioned above, the periodic transformation mapping used is .in, Indicates the The sampling frequency band (or frequency level) of each grid. The larger the sampling frequency, the more detailed the captured lighting information. Specifically, if the sampling frequency band is in the low frequency band, the lighting information captured describes the global lighting distribution (such as diffuse reflection and ambient occlusion). If the sampling frequency band is in the mid-frequency band, the lighting information captured describes local shadow transitions (such as soft shadows and indirect lighting). If the sampling frequency band is in the high frequency band, the lighting information captured describes microscopic surface reflections (such as highlights and texture details). In other words, mapping a 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 multiple (here, six) base grids, thereby determining the grid spatial coordinates of the target point in each base grid. Therefore, by setting a different sampling frequency band for each base grid, it is possible to capture lighting information at multiple frequency scales 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 of the virtual scene are determined based on the grid space coordinates of the target point in the coefficient grid and each base grid. Figure 6 A flowchart for implementing step ST400 is shown.

[0141] like Figure 6 As shown, first, in step ST4001, the grid space coordinates of the target point are indexed to determine the coefficient grid cell in which the target point is located in the coefficient grid and the base grid cell in each base grid. As described above, the coefficient grid and each base grid can be viewed 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 in which the target point is located can be determined.

[0142] Next, in step ST4002, based on the coefficient grid unit where the target point is located in the coefficient grid, the coefficient characteristics of the target point are determined. 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 the coefficient grid unit where the target point is located, trilinear interpolation calculation is performed according to the coefficient characteristics stored in the eight coefficient grid vertices, thereby determining 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 referred to as a 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 unit 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 unit where the target point is located, trilinear interpolation calculation is performed according to the basic features stored in the eight base grid vertices, thereby determining 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 basic grids are respectively a 6-dimensional, 6-dimensional, 6-dimensional, 3-dimensional, 3-dimensional, and 3-dimensional feature vector (also called basic feature vector).

[0144] It should be noted that the execution order of step ST4002 and step ST4003 is not limited to this. The execution order can be swapped 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 base features corresponding to the target point. Specifically, after determining the base features of the target point in the six base grids, as shown in FIG. Figure 5 These basic features are concatenated as shown to form a 27-dimensional basic feature vector. Then, Figure 5 As shown, the Hadamard product (element-wise product) is performed on the target point's 27-dimensional coefficient features and the concatenated 27-dimensional basis features to form the target point's illumination feature vector, which also has 27 dimensions. The Hadamard product has already been described above, so its repetition is omitted here. Next, the target point's illumination feature vector is fed as input data into a pre-trained multilayer perceptron for a nonlinear transformation to determine the target point's illumination information.

[0146] Figure 7 An example of the main structure of a multilayer perceptron and a schematic diagram of the nonlinear transformation of the illumination feature vector through the multilayer perceptron are shown. Figure 7As shown, the multilayer perceptron includes an input layer L1, a first intermediate layer L2 (as a hidden layer), and a second intermediate layer L3, 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 undergoes matrix multiplication with the 27*64 two-dimensional matrix to form a 1*64 vector. This 1*64 vector then undergoes a nonlinear transformation using the first activation function F1 and is 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 undergoes matrix multiplication with the 64*12 two-dimensional matrix to form a 1*12 vector. Then, the 1*12 vector is nonlinearly transformed with the second activation function F2 and output to the output layer L4. The output layer L4 outputs the 12-dimensional vector input to the output layer L4 as the calculation result of the illumination information of the target point.

[0147] By performing lighting calculations for each target point in the virtual scene in this way, the entire virtual scene can be illuminated, enabling subsequent rendering tasks to be completed. In particular, by decomposing the virtual scene's lighting space into a coefficient grid and multiple base grids, significant compression of the lighting data is achieved. This prevents the excessively large lighting data required for large-scale games from causing poor performance or even inability to load on low-end devices.

[0148] However, it should be noted that Figure 7 The main structure of the multilayer perceptron shown is only an 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 provide only one intermediate layer and the corresponding activation function.

[0149] Furthermore, it should be noted that while the above embodiment illustrates data compression of virtual scene lighting information, this is not limited to this example. For example, textures can also be compressed. In other words, by employing the data processing method described in this embodiment, compression of texture data and the like can also be achieved.

[0150] It should be noted that the computer-readable medium described herein 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, device, or component, or any combination thereof.

[0151] As another aspect, the present invention further 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 incorporated into the computer device. The computer-readable storage medium carries one or more programs. When executed by the computer device, the computer device implements the method described in the above embodiments and their variations. For example, the computer device may implement the steps shown in the various figures.

[0152] According to one aspect of the present invention, a computer program product is provided, comprising 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-described embodiments.

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

Claims

1. A data processing method for processing the lighting space of a virtual scene, characterized in that: include: Decomposing the illumination space into a coefficient grid and a plurality of basis grids; as well as storing the one coefficient grid and the plurality of base grids, in, The coefficient grid consists of the coefficient feature dimension and the first spatial dimension, The first spatial dimension represents a spatial resolution of coefficient grid vertices of the coefficient grid, The coefficient feature dimension includes a channel storing a coefficient feature for each coefficient grid vertex, Each of the base grids comprises a base feature dimension and a second spatial dimension, The second spatial dimension represents the spatial resolution of the base mesh vertices of the base mesh, The basic feature dimension includes a channel for storing basic features of a preset sampling frequency band relative to each basic mesh vertex, The sampling frequency bands set in the base feature dimensions of each of the multiple base grids are different from each other.

2. The data processing method according to claim 1, wherein: 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 according to claim 1, wherein: Decomposing the illumination space into a coefficient grid and a plurality of basis grids comprises: an initialization step, in which initial values ​​are assigned to the coefficient features stored in the coefficient grid vertices and the base features stored in the base grid vertices; an acquisition step, in which actual values ​​of illumination information and actual values ​​of spatial information of the illumination space are acquired; A first calculation step, in which an illumination feature vector of the illumination space is calculated based on actual values ​​of spatial information of the illumination space and coefficient features stored at vertices of the coefficient grid and base features stored at vertices of the base grid; a second calculation step, in which an estimated value of illumination information is determined based on the illumination feature vector; a judging step, in which it is judged whether a difference between the estimated value of the illumination information and the actual value of the illumination information is greater than a preset reference difference; an updating step, in which, if the difference is determined to be greater than the reference difference, the values ​​of the coefficient features stored at the coefficient mesh vertices and the base features stored at the base mesh vertices are updated based on the difference, and the first calculating step is performed again until the difference is less than the reference difference; and The output step includes outputting the coefficient features stored in the coefficient mesh vertices and the base features stored in the base mesh vertices when it is determined that the difference is smaller than the reference difference.

4. The data processing method according to claim 3, wherein: In the updating step, weight clipping is performed on the updated values ​​of the coefficient feature and the base feature to limit the coefficient feature and the base feature to the interval [-1, 1].

5. The data processing method according to claim 4, wherein: The base feature and the coefficient feature are stored in a data format of an eight-bit unsigned integer or a half-precision floating point number.

6. The data processing method according to claim 3, wherein: The actual value of the illumination information includes 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. 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, and In the loss function, a distance between the first actual value and the first estimated value has a higher weight than a 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 configured with a lighting probe for collecting lighting information of the lighting space of the virtual scene. According to the configuration density of the light probes, the virtual scene is divided into areas corresponding to each configuration density, and The lighting space of each region is decomposed into the one coefficient grid and the plurality of base grids.

8. The data processing method according to claim 3 or 6, characterized in that: Determine whether the color space used by the illumination information is the RGB color space, When it is determined that the adopted color space is the RGB color space, the RGB color space is converted into the YCoCg color space or the XYZ color space.

9. A lighting calculation method, characterized in that: Performing illumination calculation based on a coefficient grid and multiple base grids determined by the data processing method according to any one of claims 1 to 8, the illumination calculation method comprising: Obtain identification information of the virtual scene to be loaded; Retrieving the coefficient grid and the plurality of base grids corresponding to the virtual scene based on the identification information; Determining, according to the spatial coordinates of the target point in the virtual scene, the grid space coordinates of the target point in the coefficient grid and the plurality of base grids; Determining the coefficient features and base features corresponding to the target point according to the grid space coordinates; and Calculate the illumination information of the target point according to the coefficient features and base features corresponding to the target point.

10. The illumination calculation method according to claim 9, wherein: The spatial coordinates of the target point in the virtual scene are periodically transformed based on a sampling frequency band set in a base feature dimension of each base grid of the multiple base grids to determine the grid spatial coordinates of the target point in each base grid.

11. The illumination calculation method according to claim 9, wherein: Determining the coefficient feature and the base feature corresponding to the target point according to the grid space coordinates includes: Indexing according to the grid space coordinates of the target point, determining the coefficient grid unit where the target point is located in the coefficient grid and the base grid unit where the target point is located in each base grid; performing interpolation calculation based on the coefficient features stored in the coefficient grid vertices of the coefficient grid unit and the spatial coordinates of the target point to determine the coefficient features of the target point; and According to the spatial coordinates of the base grid vertices of each base grid unit and the grid space coordinates of the target point, interpolation calculation is performed based on the basic features stored in the base grid vertices of each base grid unit to determine the basic features of the target point.

12. The illumination calculation method according to claim 9 or 11, wherein: Calculating the illumination information of the target point includes: Multiplying the coefficient feature and the base feature of the target point element by element to determine the illumination feature vector of the target point; and The illumination feature vector is input into a multi-layer perceptron for nonlinear transformation to determine the illumination information of the target point as an output result.

13. The illumination calculation method according to claim 12, wherein: The multi-layer perceptron includes an input layer, a hidden layer, an activation function and an output layer. The input layer is used to input the illumination feature vector of the target point. The hidden layer performs a linear transformation on the illumination feature vector from the input layer, The activation function performs nonlinear mapping on the output after linear transformation through the hidden layer, The output layer generates illumination information of the target point as the output result based on the output after the nonlinear mapping.

14. A computer program product, comprising a computer program, characterized in that The computer program is executed by a processor to implement the method according to 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 according to 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

  • Method for evaluating illumination environment space brightness by using HDR panoramic image

    CN120070292A

  • Real-time three-dimensional graph rendering optimization method and device based on deep learning

    CN120088382A

  • Generating a rendered image of a three-dimensional object

    WO2024241064A1