Data processing method of light map and related equipment

By acquiring the light source information and lightmap generation model of virtual light sources during game development, performing light baking processing and training the model, the problems of time consumption and storage overhead in real lighting rendering are solved, and efficient lighting effects and rendering quality in virtual scenes are achieved.

CN121600149BActive Publication Date: 2026-06-02TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2026-01-19
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing technologies in game development are difficult to complete at a frame rate of 60 frames per second due to the long rendering time required for realistic lighting. Furthermore, lighting baking involves a large amount of computation and high storage costs, making it unable to effectively adapt to changes in lighting conditions in virtual scenes.

Method used

By acquiring the light source information and lightmap generation model of virtual light sources in the virtual scene, light baking is performed to generate lightmaps at preset time points. The model is then trained based on the lightmaps at adjacent time points to generate lightmaps at intermediate time points in real time, reducing computational load and improving rendering quality.

Benefits of technology

Under conditions of limited storage and computing performance, improving the rendering quality and lighting effects of virtual scenes can more accurately respond to high-frequency changes in light, reduce the computational load of offline lighting baking, and generate high-density lightmap training data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121600149B_ABST
    Figure CN121600149B_ABST
Patent Text Reader

Abstract

The application discloses a data processing method of light mapping and related equipment, which can obtain light source information and light mapping generation model of at least one virtual light source in a virtual scene; according to the lighting parameters of the virtual light source at the preset time point, the virtual scene is subjected to light baking processing to obtain the light mapping corresponding to the virtual light source at the preset time point; based on the light mapping corresponding to the virtual light source at two adjacent preset time points, the light mapping corresponding to the virtual light source at an intermediate time point is generated; based on the light mapping corresponding to the virtual light source at multiple time points and the light source information, the light mapping generation model is trained to generate the light mapping of the virtual scene in real time through the trained light mapping generation model when the virtual scene in a target rendering period is rendered. The application does not need to store the light mapping, and can improve the rendering quality and lighting effect of the virtual scene under the condition that the storage and calculation performance is limited.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to a data processing method for light mapping and related equipment. Background Technology

[0002] With the development of computer technology, users have increasingly higher requirements for the visual presentation of games. Realistic lighting effects have become the key to improving image quality and can greatly enhance the user's immersion. However, the calculation of lighting is huge, and real-time rendering of complex lighting has a huge performance consumption, making it difficult to complete at a frame rate of 60 frames per second.

[0003] In game development, realistic lighting rendering is time-consuming, so the lighting information of light sources in the scene is usually calculated and saved offline; this process is called light baking. Current technologies require baking and storing many sets of lightmaps to adapt to changes in lighting conditions within the game's virtual scene. However, real-world development scenarios often cannot afford the overhead of using too many lightmaps. A large number of lightmaps leads to both high computational demands for lighting baking and significant storage costs. Summary of the Invention

[0004] This application provides a data processing method and related equipment for lightmaps. The related equipment may include a lightmap data processing device, electronic equipment, computer-readable storage medium, and computer program product, which can improve the rendering quality and lighting effects of virtual scenes under conditions of limited storage and computing performance.

[0005] This application provides a data processing method for light map, including:

[0006] Obtain light source information and a light map generation model of at least one virtual light source in a virtual scene, wherein the light source information includes the lighting parameters of the virtual light source at multiple preset time points in a target time period;

[0007] Based on the lighting parameters of the virtual light source at the preset time point, the virtual scene is subjected to lighting baking to obtain the light map corresponding to the virtual light source at the preset time point.

[0008] Based on the light map corresponding to the virtual light source at two adjacent preset time points, a light map corresponding to the virtual light source at an intermediate time point is generated, wherein the intermediate time point is any time point between the two adjacent preset time points;

[0009] Based on the light maps corresponding to the virtual light source at multiple time points and the light source information, the light map generation model is trained so that when rendering the virtual scene within the target time period, the trained light map generation model can generate the light map of the virtual scene in real time. The time points include the preset time point and the intermediate time point.

[0010] Accordingly, embodiments of this application provide a data processing apparatus for light mapping, including:

[0011] The acquisition unit is used to acquire light source information and a light map generation model of at least one virtual light source in a virtual scene. The light source information includes the lighting parameters of the virtual light source at multiple preset time points in the target time period.

[0012] The lighting baking unit is used to perform lighting baking processing on the virtual scene according to the lighting parameters of the virtual light source at the preset time point, so as to obtain the lighting map corresponding to the virtual light source at the preset time point;

[0013] The texture generation unit is used to generate a light map corresponding to the virtual light source at an intermediate time point based on the light map corresponding to the virtual light source at two adjacent preset time points, wherein the intermediate time point is any time point between the two adjacent preset time points.

[0014] The training unit is used to train the light map generation model based on the light map corresponding to the virtual light source at multiple time points and the light source information, so that when rendering the virtual scene within the target time period, the trained light map generation model can generate the light map of the virtual scene in real time. The time points include the preset time point and the intermediate time point.

[0015] Optionally, in some embodiments of this application, the lightmap data processing device may further include a lighting parameter acquisition unit, a lightmap generation unit, and a rendering unit, as follows:

[0016] The lighting parameter acquisition unit is used to acquire the real-time lighting parameters of at least one virtual light source in the virtual scene during the target time period when a rendering request for the virtual scene within the target time period is detected.

[0017] The light map generation unit is used to generate a light map corresponding to the virtual scene based on the real-time lighting parameters of the virtual light source in the virtual scene using a trained light map generation model.

[0018] The rendering unit is used to render the virtual scene in real time based on the light map corresponding to the virtual scene and the original scene image of the virtual scene.

[0019] Optionally, in some embodiments of this application, the illumination baking unit may include a sampling strategy determination subunit, an irradiation calculation subunit, and a texture determination subunit, as follows:

[0020] The sampling strategy determination subunit is used to determine at least one illumination sampling strategy;

[0021] The irradiance calculation subunit is used to calculate the irradiance information of the surface of the virtual object in the virtual scene based on the irradiance parameters of the virtual light source at the preset time point using the irradiance sampling strategy, so as to obtain the irradiance information of the surface of the virtual object at the preset time point under the irradiance sampling strategy.

[0022] The texture determination subunit is used to determine the light texture corresponding to the virtual light source at the preset time point based on the irradiation information.

[0023] Optionally, in some embodiments of this application, the texture determination subunit may be used to determine the weight information corresponding to each illumination sampling strategy; based on the weight information, the irradiance information of the virtual object surface at a preset time point under each illumination sampling strategy is fused to obtain the target irradiance information of the virtual object surface at the preset time point; based on the target irradiance information, the illumination texture corresponding to the virtual light source at the preset time point is determined.

[0024] Optionally, in some embodiments of this application, the illumination sampling strategy is a light source sampling strategy;

[0025] The irradiance calculation subunit can be used to detect the visibility between the surface of a virtual object and the virtual light source in the virtual scene; calculate the reflectivity of the virtual object surface to the virtual light source based on the material information of the virtual object surface; and calculate the irradiance information of the virtual object surface in the virtual scene according to the visibility, the reflectivity, and the illumination parameters of the virtual light source at the preset time point to obtain the irradiance information of the virtual object surface at the preset time point under the illumination sampling strategy.

[0026] Optionally, in some embodiments of this application, the illumination sampling strategy is a hemispherical space-based sampling strategy;

[0027] The irradiance calculation subunit can be specifically used to construct a hemispherical space of the colored points on the surface of the virtual object; generate at least one sampling direction in the hemispherical space according to the material information corresponding to the colored points; emit path rays for detection based on the sampling direction in the virtual scene corresponding to the virtual light source; determine the initial irradiance information of the path ray detection based on the illumination parameters of the virtual light source at the preset time point; obtain the irradiance information of the colored points corresponding to the sampling direction based on the detected initial irradiance information, the angle information of the path rays, the material reflectivity of the colored points, and the sampling probability corresponding to the sampling direction; and determine the irradiance information of the virtual object surface at the preset time point based on the irradiance information of the colored points on the surface of the virtual object in each sampling direction.

[0028] Optionally, in some embodiments of this application, the light baking unit may include a light emitting subunit, a detection subunit, and a baking subunit, as follows:

[0029] The light emitting subunit is used to emit light based on the surface of a virtual object in the virtual scene corresponding to the virtual light source.

[0030] The detection subunit is used to determine the detection result of the emitted light on the irradiance information based on the illumination parameters of the virtual light source at the preset time point;

[0031] The baking subunit is used to perform lighting baking processing on the virtual scene based on the detection results corresponding to the light, so as to obtain the lighting map corresponding to the virtual light source at the preset time point.

[0032] Optionally, in some embodiments of this application, the light emitting subunit may be specifically used to set a first number of light bounces and a first number of samplings on the surface of a virtual object in the virtual scene; based on the first number of samplings, multiple light emitting operations are performed on the surface of the virtual object, and irradiance information is detected based on the emitted light and the first number of light bounces.

[0033] Specifically, the baking subunit can be used to fuse multiple detection results corresponding to the first sampling number to obtain the target detection result; based on the target detection result, the virtual scene is subjected to lighting baking processing to obtain the lighting map corresponding to the virtual light source at the preset time point.

[0034] Optionally, in some embodiments of this application, the data processing device for the light map may further include an additional time point unit, a setting unit, a detection unit, and a baking processing unit, as follows:

[0035] The added time point unit is used to determine a new preset time point when the light source type of the virtual light source is virtual directional light;

[0036] The setting unit is used to set the second ray bounce count and the second sampling count of the surface of the virtual object in the virtual scene, wherein the second ray bounce count is less than the first ray bounce count, and the second sampling count is less than the first sampling count;

[0037] The detection unit is used to emit light multiple times on the surface of the virtual object based on the second sampling number, and to detect irradiation information based on the number of times the emitted light bounces back.

[0038] The baking processing unit is used to perform lighting baking processing on the virtual scene based on multiple detection results corresponding to the second sampling number, so as to obtain the lighting map corresponding to the virtual light source at the newly added preset time point.

[0039] Optionally, in some embodiments of this application, the data processing apparatus for the light map may further include a color channel conversion unit, as follows:

[0040] The color channel conversion unit is used to perform color channel conversion on the light map corresponding to the virtual light source at the newly added preset time point to obtain a single-channel light map corresponding to the virtual light source at the newly added preset time point.

[0041] Optionally, in some embodiments of this application, the texture generation unit may include a time difference determination subunit, a weight determination subunit, and a fusion subunit, as follows:

[0042] The time difference determination subunit is used to determine the time difference information between the intermediate time point and the two adjacent preset time points when the light source type of the virtual light source is local light.

[0043] The weight determination subunit is used to determine the weight information of the light map corresponding to the two adjacent preset time points based on the time difference information.

[0044] The fusion subunit is used to fuse the light maps corresponding to the virtual light source at two adjacent preset time points according to the weight information to obtain the light map corresponding to the virtual light source at the intermediate time point.

[0045] Optionally, in some embodiments of this application, the texture generation unit may include a parameter determination subunit, a parameter change determination subunit, and a texture blending subunit, as follows:

[0046] The parameter determination subunit is used to determine the first illumination parameter corresponding to the virtual light source at the intermediate time point and the second illumination parameter corresponding to the virtual light source at two adjacent preset time points when the light source type of the virtual light source is virtual directional light.

[0047] The parameter change determination subunit is used to determine the change information of the illumination parameters at the intermediate time point relative to the adjacent preset time point based on the first illumination parameter and the second illumination parameter.

[0048] The texture fusion subunit is used to fuse the light maps corresponding to the virtual light source at two adjacent preset time points based on the lighting parameter change information, so as to obtain the light map corresponding to the virtual light source at the intermediate time point.

[0049] Optionally, in some embodiments of this application, the two adjacent preset time points include a first adjacent time point and a second adjacent time point;

[0050] The parameter change determination subunit can specifically be used to determine the target illumination change information corresponding to the adjacent preset time points based on the second illumination parameters corresponding to the first adjacent time points and the second adjacent time points respectively; to determine the first illumination change information corresponding to the intermediate time point and the first adjacent time point based on the second illumination parameters corresponding to the first adjacent time point and the first illumination parameters; to determine the second illumination change information corresponding to the intermediate time point and the second adjacent time point based on the second illumination parameters corresponding to the second adjacent time point and the first illumination parameters; and to determine the illumination parameter change information of the intermediate time point relative to the adjacent preset time points based on the target illumination change information, the first illumination change information, and the second illumination change information.

[0051] Optionally, in some embodiments of this application, the training unit may include a fusion processing subunit and a training subunit, as follows:

[0052] The fusion processing subunit is used to perform fusion processing based on the light map of at least one virtual light source at the same time point to obtain the target light map of the virtual scene at the time point, wherein the time point is the preset time point or the intermediate time point.

[0053] The training subunit is used to train the light map generation model based on the target light map corresponding to the virtual scene at multiple time points and the light source information.

[0054] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0055] An electronic device provided in this application includes a processor and a memory. The memory stores multiple instructions, and the processor loads the instructions to execute the steps in the lightmap data processing method provided in this application.

[0056] This application also provides a computer-readable storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the steps in the lightmap data processing method provided in this application.

[0057] Furthermore, this application also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the steps in the data processing method for light mapping provided in this application.

[0058] This application provides a data processing method and related equipment for lightmaps, which can acquire light source information and a lightmap generation model of at least one virtual light source in a virtual scene. The light source information includes the lighting parameters of the virtual light source at multiple preset time points within a target time period. Based on the lighting parameters of the virtual light source at the preset time points, the virtual scene is subjected to lighting baking processing to obtain a lightmap corresponding to the virtual light source at the preset time points. Based on the lightmaps corresponding to the virtual light source at two adjacent preset time points, a lightmap corresponding to the virtual light source at an intermediate time point is generated, where the intermediate time point is any time point between the two adjacent preset time points. Based on the lightmaps corresponding to the virtual light source at multiple time points and the light source information, the lightmap generation model is trained so that when rendering the virtual scene within the target time period, the trained lightmap generation model can generate the lightmap of the virtual scene in real time. The time points include the preset time points and the intermediate time points.

[0059] This application only requires baking lightmaps at a preset time point, eliminating the need for lightmap baking at every time point, thus reducing the computational load of the offline lightmap baking process. Furthermore, based on the baked lightmaps at the preset time points, this application can generate more lightmaps at other time points, obtaining high-density lightmap training data to train the lightmap generation model. This high-density training data improves the model's generalization ability and accuracy, enabling it to more accurately generate lightmaps for virtual scenes within the target time period during online applications. Based on the reconstruction capabilities of the trained lightmap generation model, the high-density lightmaps are compressed into the model, eliminating the need to store the lightmaps. In practical applications, lightmaps at any time point within the target time period can be generated in real-time using the trained lightmap generation model based on real-time lighting parameters, more accurately responding to high-frequency changes in light. In summary, this application can improve the rendering quality and lighting effects of virtual scenes under conditions of limited storage and computational performance. Attached Figure Description

[0060] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0061] Figure 1a This is a scene diagram illustrating the data processing method for light mapping provided in the embodiments of this application;

[0062] Figure 1b This is a flowchart of the data processing method for light map provided in the embodiments of this application;

[0063] Figure 1c These are rendering results of the current related methods;

[0064] Figure 1d This is another rendering result of the current related method;

[0065] Figure 1e This is an explanatory diagram of the data processing method for light mapping provided in the embodiments of this application;

[0066] Figure 1f This is another illustrative diagram of the data processing method for light maps provided in the embodiments of this application;

[0067] Figure 1g This is another illustrative diagram of the data processing method for light maps provided in the embodiments of this application;

[0068] Figure 1hThis is another illustrative diagram of the data processing method for light maps provided in the embodiments of this application;

[0069] Figure 1i This is another illustrative diagram of the data processing method for light maps provided in the embodiments of this application;

[0070] Figure 1j This is a diagram illustrating the effects of the currently relevant methods;

[0071] Figure 1k These are illustrations of the effects of the light map data processing method provided in the embodiments of this application;

[0072] Figure 2 This is another flowchart of the data processing method for light map provided in the embodiments of this application;

[0073] Figure 3 This is a schematic diagram of the structure of the data processing device for light mapping provided in the embodiments of this application;

[0074] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0075] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0076] This application provides a method for processing lightmap data and related equipment. The related equipment may include a lightmap data processing device, an electronic device, a computer-readable storage medium, and a computer program product. Specifically, the lightmap data processing device may be integrated into an electronic device, which may be a terminal or a server, etc.

[0077] It is understood that the lightmap data processing method of this embodiment can be executed on a terminal, on a server, or jointly by a terminal and a server. The above examples should not be construed as limiting this application.

[0078] like Figure 1a As shown, an example of a method for jointly executing lightmap data processing by a terminal and a server is presented. The lightmap data processing system provided in this embodiment includes a terminal 10 and a server 11, etc.; the terminal 10 and the server 11 are connected via a network, such as a wired or wireless network, etc., wherein the lightmap data processing device can be integrated into the server.

[0079] Server 11 can be used to: acquire light source information and a light map generation model of at least one virtual light source in a virtual scene, wherein the light source information includes the lighting parameters of the virtual light source at multiple preset time points within a target time period; perform lighting baking processing on the virtual scene based on the lighting parameters of the virtual light source at the preset time points to obtain a light map corresponding to the virtual light source at the preset time points; generate a light map corresponding to the virtual light source at an intermediate time point based on the light maps corresponding to the virtual light source at two adjacent preset time points, wherein the intermediate time point is any time point between the two adjacent preset time points; and train the light map generation model based on the light maps corresponding to the virtual light source at multiple time points and the light source information, so that when rendering the virtual scene within the target time period, the trained light map generation model can generate the light map of the virtual scene in real time, wherein the time points include the preset time points and the intermediate time points. Server 11 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0080] Terminal 10 can be used to: when a rendering request for the virtual scene within the target time period is detected, send the real-time lighting parameters of at least one virtual light source in the virtual scene within the target time period to server 11, so that server 11 can generate a lighting map corresponding to the virtual scene based on the real-time lighting parameters of the virtual light source in the virtual scene using a trained lighting map generation model; and render the virtual scene in real time based on the lighting map corresponding to the virtual scene and the original scene image of the virtual scene, and return the rendered image to terminal 10 for real-time display. Terminal 10 may include a mobile phone, vehicle terminal, aircraft, tablet computer, laptop computer, or personal computer (PC), etc. A client can also be set on terminal 10, which can be an application client or a browser client, etc. For example, the client can be a virtual reality application, a 3D map application, a game application, etc.

[0081] The data processing steps for light maps in the aforementioned server 11 can also be performed by the terminal 10.

[0082] The data processing method for light mapping provided in this application involves machine learning and computer vision technologies in the field of artificial intelligence.

[0083] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0084] This embodiment will be described from the perspective of a light map data processing device, which can be integrated into an electronic device, such as a server or a terminal.

[0085] It is understood that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0086] like Figure 1b As shown, the specific process of this lightmap data processing method can be as follows:

[0087] 101. Obtain light source information and a light map generation model of at least one virtual light source in a virtual scene, wherein the light source information includes the lighting parameters of the virtual light source at multiple preset time points in a target time period.

[0088] The virtual scene can be a simulation of the real world, a semi-simulated / semi-fictional scene, or a purely fictional scene. Optionally, the virtual scene can be a two-dimensional virtual scene, a 2.5-dimensional virtual scene, or a three-dimensional virtual scene, etc., and this embodiment does not impose any limitations on this. In a specific scenario, the virtual scene can be a game virtual scene, etc.

[0089] In a specific embodiment, the virtual scene includes virtual objects. Virtual objects can be scene components in the virtual scene, such as virtual buildings in the virtual scene, or scene participants located in the virtual scene, such as virtual objects active in the virtual scene.

[0090] In this embodiment, the virtual light source can specifically be a simulated light source used by a computer to generate simulated lighting effects. It can be used to illuminate virtual scenes and enhance the realism of lighting in the scene by simulating the propagation of light in the real world.

[0091] Specifically, virtual light sources can include virtual point lights, virtual surface lights, and virtual directional lights. A virtual point light source is a virtual light source that emits light from a surface point into the scene. A virtual surface light source has a luminous surface with a geometric area. Virtual directional lights simulate illumination from infinity in a consistent direction and can be used to represent an equivalent approximation of distant light sources or ambient light; specifically, they can simulate parallel light sources like sunlight.

[0092] In this embodiment, the light source information of the virtual light source includes the illumination parameters of the virtual light source at multiple preset time points within the target time period. These illumination parameters can include illumination intensity, illumination direction, illumination strength, light source position, and light source size. The target time period can be the time window interval to be rendered in the virtual scene, such as a day cycle within a game. The preset time points can be specific time points within the target time period, which can be set according to actual conditions; for example, preset time points can be the hour within the target time period.

[0093] Specifically, the lightmap generation model can be used to generate lightmaps. It can be a neural network model, such as a convolutional neural network, like ResNet (Residual Network) or HRNet (High-Resolution Network); or it can use a ViT (Vision Transformer) model, etc. This embodiment does not limit this.

[0094] 102. Based on the lighting parameters of the virtual light source at the preset time point, perform lighting baking on the virtual scene to obtain the lighting map corresponding to the virtual light source at the preset time point.

[0095] Light baking is a rendering technique that pre-calculates and stores complex lighting information. It pre-calculates the lighting effects in a scene and stores this information on a texture map, also called a lightmap. In other words, a lightmap is a texture map embedded in the surface of an object, recording the indirect lighting information from light sources in the virtual scene. It can simulate the lighting effects produced when an object's surface is illuminated by a light source. By applying lightmaps, more realistic lighting effects can be achieved.

[0096] Specifically, a virtual scene may contain one or more virtual light sources. Different virtual light sources have different characteristics. For example, virtual point light sources exhibit relatively low-frequency illumination changes in space, mainly affecting a local area, while virtual directional light sources exhibit relatively high-frequency illumination changes in space, affecting the entire scene. This embodiment can employ a baking technique that separates the light maps of directional light sources from those of other light sources. Specifically, for each type of virtual light source, illumination baking can be performed separately to obtain multi-source light maps. This facilitates precise control and independent optimization of the baking quality for different virtual light sources, improving processing efficiency while ensuring the overall baking effect.

[0097] For example, in specific scenarios, high resolution and HDR (High Dynamic Range) precision can be assigned to virtual directional lights to preserve sharp shadow edges, while medium resolution combined with high compression ratio can be used for point light sources to take advantage of their lighting smoothness.

[0098] It should be noted that when baking a lightmap of a certain virtual light source, other virtual light sources in the virtual scene are not included in the calculation, and the lighting contribution of other virtual light sources needs to be excluded from the current baking result.

[0099] Optionally, in this embodiment, the step "performing lighting baking on the virtual scene according to the lighting parameters of the virtual light source at the preset time point to obtain the lighting map corresponding to the virtual light source at the preset time point" may include:

[0100] Determine at least one illumination sampling strategy;

[0101] Using the lighting sampling strategy, the irradiance information of the virtual object surface in the virtual scene is calculated based on the lighting parameters of the virtual light source at the preset time point, so as to obtain the irradiance information of the virtual object surface at the preset time point under the lighting sampling strategy.

[0102] Based on the irradiation information, the light map corresponding to the virtual light source at the preset time point is determined.

[0103] Specifically, the illumination sampling strategy refers to the method of collecting illumination information from a light source or scene to calculate irradiance. Illumination sampling strategies can include active sampling and passive sampling.

[0104] Active sampling can specifically be a light source sampling strategy, also known as direct light source sampling. It is a strategy that explicitly emits sampling rays in the direction of the virtual light source to calculate the illumination of a point in a virtual scene.

[0105] Passive sampling is random path sampling, specifically a sampling strategy based on hemispherical space. It involves emitting light rays from random directions in the hemispherical space. After several bounces, the light rays may passively encounter the light source. It passively waits for the random path to "collide" with the light source.

[0106] Specifically, in this embodiment, illumination baking can be performed based on irradiance information to determine the illumination map corresponding to the virtual light source at a preset time point. Irradiance information contains the light received data of each point on the surface of the virtual object, and the illumination baking process specifically encodes this data into a texture map, i.e., an illumination map.

[0107] Optionally, in this embodiment, the step "determining the illumination map corresponding to the virtual light source at the preset time point based on the irradiation information" may include:

[0108] Determine the weight information corresponding to each illumination sampling strategy;

[0109] Based on the weight information, the irradiance information of the virtual object surface at a preset time point under each illumination sampling strategy is fused to obtain the target irradiance information of the virtual object surface at the preset time point.

[0110] Based on the target irradiance information, the light map corresponding to the virtual light source at the preset time point is determined.

[0111] The weight information corresponding to the illumination sampling strategy can be set according to the actual situation, and this embodiment does not impose any restrictions on it. Based on the weight information, the irradiance information of the virtual object surface at a preset time point under each illumination strategy is weighted and fused to obtain the target irradiance information.

[0112] Specifically, this embodiment can dynamically balance the contributions of different illumination sampling strategies through Multiple Importance Sampling (MIS). Active sampling is suitable for capturing known light sources, while passive sampling is suitable for exploring unknown indirect light. MIS combines the advantages of both, avoiding noise generated by difficult paths in a single illumination sampling strategy, thereby reducing errors and improving convergence efficiency.

[0113] Optionally, in this embodiment, the illumination sampling strategy is a light source sampling strategy;

[0114] The step "using the lighting sampling strategy, based on the lighting parameters of the virtual light source at the preset time point, to calculate the irradiance information of the virtual object surface in the virtual scene, and obtain the irradiance information of the virtual object surface at the preset time point under the lighting sampling strategy" may include:

[0115] Detect the visibility between the surface of a virtual object and the virtual light source in the virtual scene;

[0116] Based on the material information of the virtual object's surface, the reflectivity of the virtual object's surface to the virtual light source is calculated;

[0117] Based on the visibility, reflectivity, and illumination parameters of the virtual light source at the preset time point, the irradiance information of the virtual object surface in the virtual scene is calculated to obtain the irradiance information of the virtual object surface at the preset time point under the illumination sampling strategy.

[0118] Specifically, the light source sampling strategy is active sampling.

[0119] Optionally, in this embodiment, the step of "detecting the visibility between the surface of a virtual object in the virtual scene and the virtual light source" may include:

[0120] A probe ray is emitted from the surface of the virtual object toward the virtual light source;

[0121] Based on the detection rays, the visibility between the surface of a virtual object and the virtual light source in the virtual scene is determined.

[0122] The detection ray is a shadow ray, used to determine whether the path from a point on the surface to the light source is blocked by other objects.

[0123] The visibility of a virtual light source can be detected by emitting a probe ray. Visibility is determined by the location of the probe ray's hit. If the probe ray intersects the surface of the virtual light source or does not intersect with any geometry in the virtual scene, the virtual light source is visible, with a visibility of 1. If the probe ray intersects with any geometry in the virtual scene, or in other words, the distance between the intersection point and the intersection point is less than the distance to the virtual light source, the virtual light source is occluded, and its visibility is 0.

[0124] Specifically, for a virtual point light source, a single probe ray can be emitted from the surface of a virtual object toward the location of the virtual point light source. For a virtual surface light source, a point can be randomly sampled on the surface of the virtual light source as a sampling point, and the visibility between the virtual object surface and the sampling point in the virtual scene can be detected. For a virtual directional light, a parallel probe ray can be emitted in its direction.

[0125] In a specific embodiment, the reflectivity of the virtual object's surface to a virtual light source is calculated based on the material information of the virtual object's surface. Specifically, this can be achieved by performing corresponding calculations on the material parameters and the color of the virtual light source to obtain the reflectivity. Here, the material information defines how the surface reflects light, the light source information provides the color of the incident light, and the reflectivity is the result of the interaction between the two.

[0126] Optionally, in this embodiment, the step "calculating the irradiance information of the virtual object surface in the virtual scene based on the visibility, the reflectivity, and the illumination parameters of the virtual light source at the preset time point" may include:

[0127] Based on the direction vector from the virtual light source to the surface of the virtual object in the virtual scene, calculate the incident angle information of the virtual light source;

[0128] Determine the distance information between the virtual light source and the surface of a virtual object in the virtual scene;

[0129] The irradiance information of the surface of the virtual object in the virtual scene is calculated based on the visibility, the distance information, the incident angle information, the reflectivity, and the illumination parameters of the virtual light source at the preset time point.

[0130] In one embodiment, the step "calculating the irradiance information of the virtual object surface in the virtual scene based on the visibility, the distance information, the incident angle information, the reflectivity, and the illumination parameters of the virtual light source at the preset time point" can specifically be as follows: First, determine whether the visibility is 0. If it is 0, then directly determine that the irradiance information is 0. If the visibility is not 0, then the distance information, incident angle information, reflectivity, and illumination parameters can be fused to obtain the irradiance information, i.e., the illumination contribution. This fusion method can be multiplication, etc. In other words, for a visible light source, the irradiance information is calculated based on its distance, incident angle, and material reflection characteristics.

[0131] Active sampling, because it directly samples the light source, has very few samples that do not contribute to the illumination, and a single sample can obtain effective illumination information. However, direct light source sampling cannot capture indirect light, such as light reflected from walls. This can be compensated for by passive sampling, which simulates real light transmission by sampling the light path and generates light maps based on path tracing.

[0132] Optionally, in this embodiment, the illumination sampling strategy is a hemispherical space-based sampling strategy;

[0133] The step "using the lighting sampling strategy, based on the lighting parameters of the virtual light source at the preset time point, to calculate the irradiance information of the virtual object surface in the virtual scene, and obtain the irradiance information of the virtual object surface at the preset time point under the lighting sampling strategy" may include:

[0134] Construct a hemispherical space for the shading points on the surface of the virtual object;

[0135] Based on the material information corresponding to the shading point, at least one sampling direction is generated in the hemispherical space;

[0136] In the virtual scene corresponding to the virtual light source, a path ray is emitted based on the sampling direction for detection; and based on the illumination parameters of the virtual light source at the preset time point, the initial irradiance information of the path ray detection is determined.

[0137] Based on the detected initial irradiance information, the angle information of the path ray, the material reflectivity of the colored point, and the sampling probability corresponding to the sampling direction, the irradiance information of the colored point corresponding to the sampling direction is obtained;

[0138] Based on the irradiance information of the colored points on the surface of the virtual object in each sampling direction, the irradiance information of the surface of the virtual object at a preset time point is determined.

[0139] The hemispherical sampling strategy is specifically passive sampling. Passive sampling involves randomly sampling directions within the hemispherical space according to a BSDF (Bidirectional Scattering Distribution Function). If a ray hits a virtual light source, it is also included in the lighting contribution. Specifically, it can sample reflection directions based on material roughness and normal distribution. Passive sampling can automatically capture indirect light, and its ejected rays may hit the light source after multiple reflections. However, most passively sampled rays do not hit the light source, resulting in a zero contribution. To address this, active sampling can be combined with lightmap baking.

[0140] Here, BSDF is a function describing the surface reflection characteristics. In this embodiment, the directional sampling can be guided by the distribution characteristics of the corresponding BRDF of the material, that is, the sampling direction is generated on the hemispherical surface according to the probability density function proportional to the shape of the BRDF.

[0141] Specifically, constructing the hemispherical space for the shading point on the virtual object's surface can be achieved by using the shading point as the origin of the coordinate system, determining the normal direction of the virtual object's surface, and constructing a hemispherical space with the normal pointing upwards and covering the outer side of the surface. This hemispherical space can be used to determine which directions can receive light; the visible light within the hemisphere represents the light that the shading point can receive.

[0142] In a specific embodiment, the step "generating at least one sampling direction in the hemispherical space based on the material information corresponding to the shading point" can be: determining the probability density function corresponding to the material information, and then sampling directions based on the probability density function to generate sampling directions. The probability density function provides the probability density distribution of the selected direction, allowing the calculation process to sample according to the known distribution of importance. It should be noted that the physical structure of different materials determines their different preferences for scattering light in various directions, thus resulting in different sampling probability density functions.

[0143] In this embodiment, in the virtual scene corresponding to the virtual light source, a path ray is emitted based on the sampling direction for detection, and the initial irradiance information of the path ray detection is determined based on the illumination parameters of the virtual light source at a preset time point. If the path ray hits a virtual light source in the virtual scene, the radiance of the virtual light source is read based on the current illumination parameters of the virtual light source as the initial irradiance information of the detection; if the path ray hits other virtual objects in the virtual scene that are not virtual light sources, the reflected light of the hit virtual objects is recursively detected, and their emitted radiance is used as the initial irradiance information brought back by this detection. Recursive detection refers to performing a passive sampling process on the hit virtual objects, repeating the process multiple times until the light source is hit, or until the number of bounces meets a preset number of bounces. Here, the preset number of bounces is determined by the Bounce number, which is specifically the number of bounces of illumination considered in the calculation process for a single ray.

[0144] It should be noted that in the virtual scene corresponding to this virtual light source, other virtual light sources do not have any effect on the virtual scene.

[0145] Optionally, in this embodiment, the step "obtaining the irradiance information of the colored point in the sampling direction based on the detected initial irradiance information, the angle information of the path ray, the material reflectivity of the colored point, and the sampling probability corresponding to the sampling direction" can specifically be: fusing the initial irradiance information, the angle information, the material reflectivity, and the sampling probability to obtain the irradiance information of the colored point in the sampling direction. Here, the fusion can be multiplying the initial irradiance information by the angle information, then dividing by the sampling probability to obtain the irradiance contributed in this direction, and finally multiplying by the material reflectivity to obtain the final irradiance information.

[0146] In this embodiment, the irradiance information of the virtual object surface at a preset time point is determined based on the irradiance information of the colored points on the virtual object surface in each sampling direction. Specifically, the irradiance information returned by each path ray is fused. This fusion method can be weighted average, etc. The average value of a large number of random paths is statistically analyzed to approximate the real lighting effect, and the irradiance information of the virtual object surface at the preset time point is completed offline.

[0147] Optionally, in this embodiment, the step "performing lighting baking on the virtual scene according to the lighting parameters of the virtual light source at the preset time point to obtain the lighting map corresponding to the virtual light source at the preset time point" may include:

[0148] In the virtual scene corresponding to the virtual light source, light is emitted based on the surface of virtual objects in the virtual scene;

[0149] Based on the illumination parameters of the virtual light source at the preset time point, the detection result of the emitted light on the irradiance information is determined;

[0150] Based on the detection results corresponding to the light, the virtual scene is subjected to light baking processing to obtain the light map corresponding to the virtual light source at the preset time point.

[0151] In some examples, for an active sampling lighting sampling strategy, the step "emitting light based on the surface of a virtual object in the virtual scene corresponding to the virtual light source" may include:

[0152] A probe ray is emitted from the surface of the virtual object toward the virtual light source;

[0153] The step "determine the detection result of the emitted light on the irradiance information based on the illumination parameters of the virtual light source at the preset time point" may include:

[0154] Based on the detection rays, the visibility between the surface of a virtual object and the virtual light source in the virtual scene is determined;

[0155] When the visibility meets the preset visibility conditions, the initial irradiance information of the path ray detection is determined according to the illumination parameters of the virtual light source at the preset time point;

[0156] The step "Based on the detection results corresponding to the light, perform lighting baking on the virtual scene to obtain the lighting map corresponding to the virtual light source at the preset time point" may include:

[0157] Based on the direction vector from the virtual light source to the surface of the virtual object in the virtual scene, calculate the incident angle information of the virtual light source;

[0158] Determine the distance information between the virtual light source and the surface of a virtual object in the virtual scene;

[0159] Based on the material information of the virtual object's surface, the reflectivity of the virtual object's surface to the virtual light source is calculated;

[0160] Based on the distance information, the incident angle information, the reflectivity, and the initial irradiance information, the irradiance information of the virtual object surface in the virtual scene is calculated to obtain the irradiance information of the virtual object surface at a preset time point under the illumination sampling strategy.

[0161] Based on the irradiation information, the light map corresponding to the virtual light source at the preset time point is determined.

[0162] Specifically, the preset visibility condition can be a visibility of 1.

[0163] Among them, distance information, incident angle information, reflectivity and initial irradiance information can be fused to obtain the final irradiance information, i.e., the light contribution. This fusion method can be multiplication, etc.

[0164] In other examples, for a passively sampled lighting sampling strategy, the step "emitting light based on the surface of a virtual object in the virtual scene corresponding to the virtual light source" may include:

[0165] Construct a hemispherical space for the shading points on the surface of the virtual object;

[0166] Based on the material information corresponding to the shading point, at least one sampling direction is generated in the hemispherical space;

[0167] In the virtual scene corresponding to the virtual light source, detection is performed by emitting path rays based on the sampling direction;

[0168] The step "determine the detection result of the emitted light on the irradiance information based on the illumination parameters of the virtual light source at the preset time point" may include:

[0169] Based on the illumination parameters of the virtual light source at the preset time point, the initial irradiation information of the path ray detection is determined;

[0170] The step "Based on the detection results corresponding to the light, perform lighting baking on the virtual scene to obtain the lighting map corresponding to the virtual light source at the preset time point" may include:

[0171] Based on the detected initial irradiance information, the angle information of the path ray, the material reflectivity of the colored point, and the sampling probability corresponding to the sampling direction, the irradiance information of the colored point corresponding to the sampling direction is obtained;

[0172] Based on the irradiance information of the colored points on the surface of the virtual object in each sampling direction, the irradiance information of the surface of the virtual object at a preset time point is determined;

[0173] Based on the irradiation information, the light map corresponding to the virtual light source at the preset time point is determined.

[0174] Optionally, in this embodiment, the step "emitting light based on the surface of a virtual object in the virtual scene" may include:

[0175] Set the first number of light bounces and the first number of samples to the surface of the virtual object in the virtual scene;

[0176] Based on the first number of samplings, multiple light rays are emitted onto the surface of the virtual object, and irradiance information is detected based on the number of times the emitted light rays bounce back from the first light ray.

[0177] The step "Based on the detection results corresponding to the light, perform lighting baking on the virtual scene to obtain the lighting map corresponding to the virtual light source at the preset time point" may include:

[0178] The multiple detection results corresponding to the first sampling number are fused to obtain the target detection result;

[0179] Based on the target detection results, the virtual scene is subjected to lighting baking to obtain the lighting map corresponding to the virtual light source at the preset time point.

[0180] The number of bounces of the first ray is the bounce count in this light-baking process, and its magnitude affects the quality of light-baking. Specifically, the bounce count is the number of bounces of light considered in the calculation for a single ray. For example, if the bounce count is 4, then during passive sampling, only light with 4 or fewer bounces will be considered, while light with more than 4 bounces will not be considered. The higher the bounce count, the higher the baking quality.

[0181] The first sampling count is specifically the SPP (Samples Per Pixel) in this lighting baking process. The SPP determines how many independent rays each lightmap pixel emits, which is the number of times each shading point (texel) is sampled. Its size affects the lighting baking quality. The larger the SPP, the more samples are accumulated within the pixel, the lower the noise, and the higher the baking quality; conversely, the noise is more obvious.

[0182] Specifically, the light baking process in this embodiment can be a relatively high-quality light baking process, in which the number of first light bounces and the number of first samplings can be set to be higher.

[0183] In this embodiment, the step "fusion of multiple detection results corresponding to the first sampling number to obtain the target detection result" can specifically be: for the same pixel (texel) position, repeatedly emit rays with N independent paths, and average the detection results of the N rays to obtain the target detection result, thereby reducing the influence of noise. The first sampling number is denoted as N.

[0184] Optionally, in this embodiment, before the step "generating a light map corresponding to the virtual light source at an intermediate time point based on the light maps corresponding to the virtual light source at two adjacent preset time points", the following may be included:

[0185] When the type of the virtual light source is virtual directional light, a new preset time point is determined;

[0186] The second ray bounce count and the second sampling count of the virtual object surface in the virtual scene are set, wherein the second ray bounce count is less than the first ray bounce count, and the second sampling count is less than the first sampling count;

[0187] Based on the second sampling number, multiple light rays are emitted on the surface of the virtual object, and irradiance information is detected based on the number of light ray bounces of the emitted light rays.

[0188] Based on the multiple detection results corresponding to the second sampling number, the virtual scene is subjected to lighting baking processing to obtain the lighting map corresponding to the virtual light source at the newly added preset time point.

[0189] Specifically, for directional lights, since the high-frequency changes in indirect lighting mainly originate from the movement of directional lights, additional time points can be added to bake the lightmaps of directional lights. This extra dense baking of the lighting contributed by directional lights (specifically indirect lights, direct lights can be ignored) can more accurately respond to the high-frequency changes in indirect lighting caused by directional lights.

[0190] In this context, compared to the previous light baking, to save computational costs, the light baking here can be of relatively lower quality. Specifically, the second ray bounce count is the number of bounces during the light baking process at the newly added preset time point, and the second ray bounce count can be less than the first ray bounce count. The second sampling count is the SPP (Samples Per Pixel) during the light baking process at the newly added preset time point, and the second sampling count can be less than the first sampling count.

[0191] The step "based on the multiple detection results corresponding to the second sampling number, perform lighting baking on the virtual scene to obtain the lighting map corresponding to the virtual light source at the newly added preset time point" can be: repeatedly emitting M independent path rays at the same pixel (texel) position, averaging the detection results of the M rays to obtain the target detection result, and then performing lighting baking based on the target detection result to reduce the impact of noise. The second sampling number is denoted as M.

[0192] The option to add a preset time point can be set according to the actual situation, such as adding a new preset time point at fixed intervals.

[0193] Optionally, in this embodiment, the data processing method for the light map may further include:

[0194] The color channel of the light map corresponding to the virtual light source at the newly added preset time point is converted to obtain a single-channel light map corresponding to the virtual light source at the newly added preset time point.

[0195] In this embodiment, in order to reduce the consumption of computer resources, the additional light maps at preset time points can be converted into single-channel light intensity maps pixel by pixel.

[0196] 103. Based on the light map corresponding to the virtual light source at two adjacent preset time points, generate the light map corresponding to the virtual light source at an intermediate time point, wherein the intermediate time point is any time point between the two adjacent preset time points.

[0197] Specifically, two adjacent preset time points refer to two consecutive preset time points on the time axis in the sampling sequence of time points. For example, if the preset time points are the hourly moments within a day, then 6:00 and 7:00 are two adjacent preset time points. Any time point between 6:00 and 7:00 is the midpoint between these two adjacent preset time points.

[0198] Specifically, this embodiment can generate lightmaps at other time points using interpolation, thereby obtaining high-density lightmaps. Different interpolation methods can be used for different light source types. For example, linear interpolation can be used for local light; for virtual directional light, interpolation can be performed based on densely baked lightmaps. Here, dense baking refers to adding new preset time points for baking in addition to the original preset time points.

[0199] Optionally, in this embodiment, the step "generating a light map corresponding to the virtual light source at an intermediate time point based on the light maps corresponding to the virtual light source at two adjacent preset time points" may include:

[0200] When the light source type of the virtual light source is local light, the time difference information between the intermediate time point and the two adjacent preset time points is determined.

[0201] Based on the time difference information, the weight information of the light map corresponding to the two adjacent preset time points is determined;

[0202] Based on the weight information, the light maps corresponding to the virtual light source at two adjacent preset time points are fused to obtain the light map corresponding to the virtual light source at the intermediate time point.

[0203] Local light specifically refers to a non-directional light source type, which can include point lights, area lights, etc. In a global illumination scene, local light can also be called direct light.

[0204] Specifically, if the time difference is larger, the weight information of the light map corresponding to the adjacent preset time point can be set smaller; conversely, if the time difference is smaller, the weight information of the light map corresponding to the adjacent preset time point can be set larger.

[0205] The fusion method for the lightmaps of virtual light sources at two adjacent preset time points can be determined based on the actual situation, such as weighted fusion. Specifically, apart from directional light, the changes in other lighting are relatively low-frequency. Therefore, for other light sources, linear interpolation can be used to generate the lightmap at the intermediate time point. This linear interpolation method can be achieved by linearly interpolating the lightmaps at preset time points on both sides of the intermediate time point, with the interpolation parameters linearly determined by the time difference. This saves computational resources and avoids unnecessary overhead. The preset time points here can include newly added preset time points.

[0206] Optionally, in this embodiment, the step "generating a light map corresponding to the virtual light source at an intermediate time point based on the light maps corresponding to the virtual light source at two adjacent preset time points" may include:

[0207] When the light source type of the virtual light source is virtual directional light, determine the first illumination parameter corresponding to the virtual light source at the intermediate time point, and the second illumination parameter corresponding to the virtual light source at the two adjacent preset time points.

[0208] Based on the first illumination parameter and the second illumination parameter, determine the illumination parameter change information of the intermediate time point relative to the adjacent preset time point;

[0209] Based on the lighting parameter change information, the lighting maps corresponding to the virtual light source at two adjacent preset time points are fused to obtain the lighting map corresponding to the virtual light source at the intermediate time point.

[0210] Since the illumination change frequency of directional light is relatively high, in order to ensure the quality and accuracy of the illumination map at the intermediate time point, this embodiment uses the illumination parameter change information between the intermediate time point and the adjacent preset time point to generate the illumination map at the intermediate time point.

[0211] The first lighting parameter is the lighting parameter of the virtual light source at the intermediate time point, and the second lighting parameter is the lighting parameter of the virtual light source at the adjacent preset time point.

[0212] The step "based on the lighting parameter change information, perform fusion processing on the lighting maps corresponding to the virtual light source at the two adjacent preset time points to obtain the lighting map corresponding to the virtual light source at the intermediate time point" can specifically be: using the lighting parameter change information as a weighting coefficient to perform weighted fusion on the lighting maps at the two adjacent preset time points. The interpolation method here can be nonlinear interpolation, based on the lighting parameter change information, to better generate the lighting map of the directional light at the intermediate time point, and to achieve correct response to the high-frequency changes in indirect light caused by the change of directional light.

[0213] Optionally, in this embodiment, the two adjacent preset time points include a first adjacent time point and a second adjacent time point;

[0214] The step "based on the first illumination parameter and the second illumination parameter, determine the illumination parameter change information of the intermediate time point relative to the adjacent preset time point" may include:

[0215] Based on the second illumination parameters corresponding to the first adjacent time point and the second adjacent time point respectively, the target illumination change information corresponding to the adjacent preset time points is determined;

[0216] Based on the second illumination parameters and the first illumination parameters corresponding to the first adjacent time points, the first illumination change information corresponding to the intermediate time point and the first adjacent time points is determined.

[0217] Based on the second illumination parameters corresponding to the second adjacent time point and the first illumination parameters, determine the second illumination change information between the intermediate time point and the second adjacent time point;

[0218] Based on the target illumination change information, the first illumination change information, and the second illumination change information, the illumination parameter change information of the intermediate time point relative to the adjacent preset time point is determined.

[0219] Specifically, if the first adjacent time point is the preset time point to the left of the middle time point, then the second adjacent time point is the preset time point to the right of the middle time point. Conversely, if the first adjacent time point is the preset time point to the right of the middle time point, then the second adjacent time point is the preset time point to the left of the middle time point. The preset time point to the left is specifically the time point that is earlier than the middle time point and has the smallest time difference with it. The preset time point to the right is specifically the time point that is later than the middle time point and has the smallest time difference with it.

[0220] Specifically, the target illumination change information corresponding to adjacent preset time points can be the difference between the second illumination parameters corresponding to the first adjacent time point and the second adjacent time point, respectively.

[0221] Specifically, the first illumination change information corresponding to the intermediate time point and the first adjacent time point can be the difference between the second illumination parameter and the first illumination parameter corresponding to the first adjacent time point.

[0222] Specifically, the second illumination change information corresponding to the intermediate time point and the second adjacent time point can be the difference between the second illumination parameter and the first illumination parameter corresponding to the second adjacent time point.

[0223] In a specific embodiment, the change in illumination parameters at the intermediate time point relative to the first adjacent time point can be determined by the ratio of the first illumination change information to the target illumination change information. The change in illumination parameters at the intermediate time point relative to the second adjacent time point can be determined by the ratio of the second illumination change information to the target illumination change information.

[0224] In specific scenarios, for virtual directional light, the intermediate time point The process of generating a lightmap is as follows:

[0225] For a specific point in time The light intensity is (Specifically, the first illumination parameter in the above embodiment), and the illumination intensity at two adjacent full-hour times (specifically, the second illumination parameter in the above embodiment) are respectively , Furthermore, the information in the light map of the directional light at the top of the hour is as follows: , Then at that specific time point The process of generating the light map is shown in equation (1):

[0226] (1)

[0227] In this embodiment, the preset time point can be the hour or a specific time point. It is the midpoint between two adjacent whole-hour times.

[0228] in, The second illumination parameter corresponds to the preset time point to the left. The second illumination parameter corresponds to the rightmost preset time point. This is the light map corresponding to the left adjacent preset time point. This is the light map corresponding to the preset time point to the right.

[0229] 104. Based on the light maps corresponding to the virtual light source at multiple time points and the light source information, the light map generation model is trained so that when rendering the virtual scene within the target time period, the trained light map generation model can generate the light map of the virtual scene in real time. The time points include the preset time point and the intermediate time point.

[0230] Specifically, a light map generation model can be trained based on the lighting parameters of each virtual light source at multiple time points and the corresponding light maps at multiple time points, so that the trained light map generation model has the ability to reconstruct the light map within the target time period.

[0231] Optionally, in this embodiment, the data processing method for the light map may further include:

[0232] When a rendering request for the virtual scene within the target time period is detected, the real-time lighting parameters of at least one virtual light source in the virtual scene within the target time period are obtained.

[0233] The trained lightmap generation model generates a lightmap corresponding to the virtual scene based on the real-time lighting parameters of the virtual light source in the virtual scene.

[0234] The virtual scene is rendered in real time based on the light map corresponding to the virtual scene and the original scene image of the virtual scene.

[0235] Specifically, the real-time lighting parameters of virtual light sources in the virtual scene at the current time, as well as the position information of the virtual object surfaces in the virtual scene, can be input into the lightmap generation model. This allows the lightmap generation model to generate lightmaps based on the learned parameters, outputting the lightmaps at the corresponding positions on the virtual object surfaces in the virtual scene. It should be noted that the output lightmaps are the lightmaps under all virtual light sources in the virtual scene at the current time.

[0236] In this embodiment, the original scene image specifically records the image data of the surface material properties of virtual objects in the virtual scene when they are not affected by any light, that is, the pure geometric texture information in the absence of light, which only reflects the color and geometric structure of the object itself.

[0237] In one embodiment, the lightmap of the virtual scene and the original scene image of the virtual scene can be merged, and rendering can be performed based on the merged image. There are various fusion methods, such as directly overlaying the lightmap and the original scene image.

[0238] Optionally, in this embodiment, the step "training the light map generation model based on the light maps corresponding to the virtual light source at multiple time points and the light source information" may include:

[0239] The light map of at least one virtual light source at the same time point is fused to obtain the target light map of the virtual scene at the time point, wherein the time point is the preset time point or the intermediate time point.

[0240] The lighting map generation model is trained based on the target lighting map corresponding to the virtual scene at multiple time points and the light source information.

[0241] In some embodiments, the fusion method can be overlay processing. For the light maps of each virtual light source at the same time point, the final effect can be obtained by overlaying the independent light maps of each virtual light source.

[0242] Optionally, in this embodiment, the step "training the lighting map generation model based on the target lighting map corresponding to the virtual scene at multiple time points and the light source information" may include:

[0243] By using a lightmap generation model, a predicted lightmap of the virtual scene at multiple time points is generated based on the lighting parameters at multiple time points in the virtual scene.

[0244] Based on the predicted lighting map and the target lighting map, the parameters of the lighting map generation model are adjusted to obtain the trained lighting map generation model.

[0245] The training process involves first generating a predicted lighting map, then calculating the loss information between the predicted and target lighting maps, and finally using the backpropagation algorithm to adjust the parameters of the lighting map generation model. Based on the loss information, the parameters of the lighting map generation model are optimized so that the loss information between the predicted and target lighting maps is less than a preset loss value, thus obtaining a trained lighting map generation model. The preset loss value can be set according to the actual situation.

[0246] In specific scenarios, to address the challenges of localized dynamic scenes, game projects often employ the baking of multiple lightmaps for different states. For instance, to achieve day / night cycles or changes in lighting conditions within a scene (such as TOD), a lightmap is typically baked at different times. At runtime, the lighting at a specific moment is obtained by directly sampling the lightmap. Alternatively, in localized dynamic scenes involving doors opening and closing, lightmaps are baked for different angles of the door opening and closing. However, these pre-baked lightmaps incur significant storage overhead.

[0247] In game development, realistic lighting is time-consuming and real-time calculations are costly. Therefore, direct and indirect lighting in the scene is typically pre-calculated offline and saved as textures as art assets; this process is called light baking. During rendering, these textures can be used to achieve realistic global illumination. Indirect lighting specifically refers to diffuse reflection of light after it has been reflected from a surface.

[0248] TOD (Time of Day) refers to the 24-hour changes of the sun and moon, which usually refers to the changes in the illumination of objects' surfaces caused by the changing directional light (sun / moon) and skylight (sky) over time.

[0249] Lightmap refers to the lighting information of each object surface saved in the form of a texture during light baking, also known as light map or light texture. It is usually used for shading static objects and has high lighting quality. The algorithm in this application is mainly used for compressing multiple sets of light maps.

[0250] This application provides a solution for preventing light leakage based on multi-set lightmap compression. Specifically, it is a neural network-based lightmap compression and reconstruction method: during the baking stage, multiple lightmaps are generated according to light source type (e.g., skylight and directional light), and the intensity information of indirect light contributed by directional light can be additionally baked intensively. The neural network is trained using this multi-source, high-density baked data, enabling it to output accurate lighting information at runtime with scene time, lighting parameters, and spatial coordinates as input. This method significantly reduces the storage overhead of multiple lightmaps and generates smooth indirect lighting that responds to high-frequency changes in directional light when lighting changes, thereby improving rendering quality and indirect lighting effects under limited storage and performance conditions.

[0251] Current optical image compression methods can only reconstruct illumination information at discrete time points, failing to accurately acquire optical images at arbitrary time points. This makes them unable to correctly respond to high-frequency indirect light variations, such as... Figure 1c The example shows a light leakage problem. For instance, the current Precomputed Radiance Transfer (PRT) method pre-computes the ray transfer response in the scene and projects the light source and transfer function onto a basis such as spherical harmonics. At runtime, only simple calculations of the projection coefficients are needed to quickly obtain indirect lighting, making it computationally efficient and suitable for modeling low-frequency lighting changes. However, the PRT method uses spherical harmonic projection, which inevitably results in the loss of high-frequency lighting information, making it difficult to meet the requirements of high-quality global illumination, such as... Figure 1d As shown, there is a light leakage problem.

[0252] Spherical harmonics are a set of orthogonal basis functions defined on a unit sphere. Indexed by order, any scalar function related in any direction can be expanded into a linear combination of these basis functions. In computer graphics, spherical harmonic expansions are often used to compactly represent ambient light and ray transmission because low-order spherical harmonics can efficiently characterize low-frequency illumination, but have limited representation of high-frequency details.

[0253] This application utilizes a lightmap generation model, which can obtain highly accurate lighting information by inputting any time point and can respond to high-frequency changes in indirect light. Furthermore, the lightmap obtained through static baking achieves high-quality lighting effects. Specifically, this application employs multi-source baking and targeted dense sampling of information to address the shortcomings of current methods in terms of temporal continuity, high-frequency response, and operational efficiency while maintaining near-offline lighting quality.

[0254] Specifically, this application leverages the core features of the MagicDawn baker to provide a high-quality, high-performance semi-dynamic GI method. On the baking side, a baking technique for separating light maps from directional light and other light sources is developed. Furthermore, during the training of the neural network compression algorithm, the lighting change trend is monitored through indirect illumination intensity mapping of directional light. Through this baking and training strategy, this application effectively solves the light leakage problem during light map compression.

[0255] MagicDawn is a lighting baking tool. GI (Global Illumination) simulates the complex propagation process of light through multiple reflections and scatterings in a scene. It includes not only direct lighting from the light source to the object but also indirect lighting produced by light reflection from surfaces, enhancing the realism of the scene. In a narrow sense, global illumination only includes indirect light. In real-time rendering, indirect light can be divided into Diffuse GI and specular components depending on the material. Specular light paths are usually narrower and simpler to calculate, while Diffuse GI, being in hemispherical space, converges more slowly. Baking typically refers to baking the Diffuse GI portion. In a broader sense, the direct light from some static local light sources is also baked into the lighting data. This part is more frequent and detailed, and is collectively referred to as GI.

[0256] In specific scenarios, this application utilizes the offline baking algorithm of the MagicDawn baker, based on path tracing, and combines MIS (Multiple Importance Sampling) and NEE (Next Event Estimation) to accelerate convergence. When calculating the indirect light of directional light, only illumination that bounces once or more can be considered. It should be noted that when calculating directional light, only the directional light is considered in both active and passive sampling, and the contributions of other light sources are not considered. To accelerate baking, the intensity and direction of directional light at multiple moments are included as a light source array in the baking calculation. Since light paths can be reused, the indirect light of directional light at multiple moments can be calculated in a single baking calculation, thereby accelerating baking. When calculating the light maps of other light sources, the same baking algorithm can be used, but the contribution of directional light is not considered.

[0257] Specifically, the optimization strategy for NEE (Nearest Effortless) direct light source sampling not only randomly samples the next direction during each path bounce but also actively constructs a clear path pointing to the light source at each surface point, i.e., a shadow ray. This application can activate two path generation strategies: NEE direct light source sampling and random hemispherical sampling (i.e., random path sampling), and eliminate interference and redundant calculations between strategies through MIS (Intelligent Weighting System). For example, some optical paths may be calculated repeatedly by both strategies, such as when a surface point "accidentally" hits the light source through random sampling and is also explicitly connected to the light source through NEE.

[0258] This application can bake the lightmaps of directional lights and other light sources separately, and then merge the separately baked lightmaps to obtain a complete baking effect. For example... Figure 1e As shown, this application demonstrates the shading effects of scenes under different light sources, and it bakes directional lights and other light sources separately. Figure 1f The image shows a lightmap baked from directional lights. Specifically, it can be a lightmap of the indirect light rays of the directional lights, while the direct light rays can be ignored. Figure 1g The image shows the baking effect under other light sources. For example... Figure 1h As shown, this is the complete baking effect obtained by combining the baking effect of directional light with the baking effect of other light sources.

[0259] To enable neural networks to accurately capture high-frequency changes in lighting, high-frequency lighting information needs to be acquired at the data level. For TOD (Time of Day) scenarios, directly and densely baking lightmaps incurs excessive computational overhead. This technical solution employs a multi-source baking strategy: a complete set of lightmaps is baked at each hour, including lightmaps generated by directional lights and those generated by other light sources. Simultaneously, considering that the high-frequency changes in indirect lighting mainly originate from the movement of directional lights, a low-quality directional lightmap is additionally baked at fixed intervals and converted pixel-by-pixel into a single-channel light intensity map for use.

[0260] During neural network training, for any given time point, this method first linearly interpolates the light maps generated by other light sources, because changes in lighting other than directional light are relatively low-frequency. For the light maps generated by directional light, linear interpolation is not used directly; instead, interpolation is performed based on the densely baked light intensity map. The specific interpolation process can be found in the description of the above embodiments, and will not be repeated here.

[0261] Finally, by summing the illumination information of the directional light with that of other light sources, the complete illumination information for the current moment is obtained. Using this illumination information to train a neural network, a high-frequency illumination representation can ultimately be obtained.

[0262] Based on the lightmap data processing method provided in this application, by reasonably modeling the lighting of different light sources, the training dataset of the neural network is significantly enriched with only a small amount of additional resources, effectively avoiding light leakage caused by changes in lighting in the scene. Figure 1i The image shows the lighting effect during static baking. Figure 1j To achieve the lighting effect without using this solution, such as Figure 1k The image shows the lighting effect achieved using this solution. Combined with... Figure 1i , Figure 1j and Figure 1k It can be determined that the lighting effect achieved by this scheme after reconstruction is basically the same as the lighting effect of static baking. After using this scheme, the light leakage phenomenon in the scene is greatly alleviated.

[0263] As can be seen from the above, this embodiment can obtain light source information and a light map generation model for at least one virtual light source in a virtual scene. The light source information includes the lighting parameters of the virtual light source at multiple preset time points within a target time period. Based on the lighting parameters of the virtual light source at the preset time points, the virtual scene is subjected to lighting baking processing to obtain the light map corresponding to the virtual light source at the preset time points. Based on the light maps corresponding to the virtual light source at two adjacent preset time points, a light map corresponding to the virtual light source at an intermediate time point is generated, where the intermediate time point is any time point between the two adjacent preset time points. Based on the light maps corresponding to the virtual light source at multiple time points and the light source information, the light map generation model is trained so that when rendering the virtual scene within the target time period, the trained light map generation model can generate the light map of the virtual scene in real time, where the time points include the preset time points and the intermediate time points.

[0264] This application only requires baking lightmaps at a preset time point, eliminating the need for lightmap baking at every time point, thus reducing the computational load of the offline lightmap baking process. Furthermore, based on the baked lightmaps at the preset time points, this application can generate more lightmaps at other time points, obtaining high-density lightmap training data to train the lightmap generation model. This high-density training data improves the model's generalization ability and accuracy, enabling it to more accurately generate lightmaps for virtual scenes within the target time period during online applications. Based on the reconstruction capabilities of the trained lightmap generation model, the high-density lightmaps are compressed into the model, eliminating the need to store the lightmaps. In practical applications, lightmaps at any time point within the target time period can be generated in real-time using the trained lightmap generation model based on real-time lighting parameters, more accurately responding to high-frequency changes in light. In summary, this application can improve the rendering quality and lighting effects of virtual scenes under conditions of limited storage and computational performance.

[0265] Based on the method described in the preceding embodiments, the following will provide a more detailed explanation by taking the specific integration of the light map data processing device into a server as an example.

[0266] This application provides a data processing method for light map, such as... Figure 2 As shown, the specific process of this lightmap data processing method can be as follows:

[0267] 201. The server obtains light source information and a light map generation model of at least one virtual light source in the virtual scene. The light source information includes the lighting parameters of the virtual light source at multiple preset time points in the target time period.

[0268] 202. The server performs lighting baking on the virtual scene according to the lighting parameters of the virtual light source at the preset time point to obtain the lighting map corresponding to the virtual light source at the preset time point.

[0269] Specifically, a virtual scene may contain one or more virtual light sources. Different virtual light sources have different characteristics. For example, virtual point light sources exhibit relatively low-frequency illumination changes in space, mainly affecting a local area, while virtual directional light sources exhibit relatively high-frequency illumination changes in space, affecting the entire scene. This embodiment can employ a baking technique that separates the light maps of directional light sources from those of other light sources. Specifically, for each type of virtual light source, illumination baking can be performed separately to obtain multi-source light maps. This facilitates precise control and independent optimization of the baking quality for different virtual light sources, improving processing efficiency while ensuring the overall baking effect.

[0270] It should be noted that when baking a lightmap of a certain virtual light source, other virtual light sources in the virtual scene are not included in the calculation, and the lighting contribution of other virtual light sources needs to be excluded from the current baking result.

[0271] Optionally, in this embodiment, the step "performing lighting baking on the virtual scene according to the lighting parameters of the virtual light source at the preset time point to obtain the lighting map corresponding to the virtual light source at the preset time point" may include:

[0272] Determine at least one illumination sampling strategy;

[0273] Using the lighting sampling strategy, the irradiance information of the virtual object surface in the virtual scene is calculated based on the lighting parameters of the virtual light source at the preset time point, so as to obtain the irradiance information of the virtual object surface at the preset time point under the lighting sampling strategy.

[0274] Based on the irradiation information, the light map corresponding to the virtual light source at the preset time point is determined.

[0275] Specifically, the illumination sampling strategy refers to the method of collecting illumination information from a light source or scene to calculate irradiance. Illumination sampling strategies can include active sampling and passive sampling.

[0276] Active sampling can specifically be a light source sampling strategy, also known as direct light source sampling. It is a strategy that explicitly emits sampling rays in the direction of the virtual light source to calculate the illumination of a point in a virtual scene.

[0277] Passive sampling can be based on a hemispherical sampling strategy, specifically collecting ejected indirect light in randomly distributed directions within the hemispherical space. If the ray hits a virtual light source, it is also included in the illumination contribution.

[0278] Specifically, in this embodiment, illumination baking can be performed based on irradiance information to determine the illumination map corresponding to the virtual light source at a preset time point. Irradiance information contains the light received data of each point on the surface of the virtual object, and the illumination baking process specifically encodes this data into a texture map, i.e., an illumination map.

[0279] Optionally, in this embodiment, the step "determining the illumination map corresponding to the virtual light source at the preset time point based on the irradiation information" may include:

[0280] Determine the weight information corresponding to each illumination sampling strategy;

[0281] Based on the weight information, the irradiance information of the virtual object surface at a preset time point under each illumination sampling strategy is fused to obtain the target irradiance information of the virtual object surface at the preset time point.

[0282] Based on the target irradiance information, the light map corresponding to the virtual light source at the preset time point is determined.

[0283] The weight information corresponding to the illumination sampling strategy can be set according to the actual situation, and this embodiment does not impose any restrictions on it. Based on the weight information, the irradiance information of the virtual object surface at a preset time point under each illumination strategy is weighted and fused to obtain the target irradiance information.

[0284] Specifically, this embodiment can dynamically balance the contributions of different illumination sampling strategies through Multiple Importance Sampling (MIS). Active sampling is suitable for capturing known light sources, while passive sampling is suitable for exploring unknown indirect light. MIS combines the advantages of both, avoiding noise generated by difficult paths in a single illumination sampling strategy, thereby reducing errors and improving convergence efficiency.

[0285] Optionally, in this embodiment, the step "performing lighting baking on the virtual scene according to the lighting parameters of the virtual light source at the preset time point to obtain the lighting map corresponding to the virtual light source at the preset time point" may include:

[0286] In the virtual scene corresponding to the virtual light source, light is emitted based on the surface of virtual objects in the virtual scene;

[0287] Based on the illumination parameters of the virtual light source at the preset time point, the detection result of the emitted light on the irradiance information is determined;

[0288] Based on the detection results corresponding to the light, the virtual scene is subjected to light baking processing to obtain the light map corresponding to the virtual light source at the preset time point.

[0289] Optionally, in this embodiment, the step "emitting light based on the surface of a virtual object in the virtual scene" may include:

[0290] Set the first number of light bounces and the first number of samples to the surface of the virtual object in the virtual scene;

[0291] Based on the first number of samplings, multiple light rays are emitted onto the surface of the virtual object, and irradiance information is detected based on the number of times the emitted light rays bounce back from the first light ray.

[0292] The step "Based on the detection results corresponding to the light, perform lighting baking on the virtual scene to obtain the lighting map corresponding to the virtual light source at the preset time point" may include:

[0293] The multiple detection results corresponding to the first sampling number are fused to obtain the target detection result;

[0294] Based on the target detection results, the virtual scene is subjected to lighting baking to obtain the lighting map corresponding to the virtual light source at the preset time point.

[0295] The number of bounces of the first ray is the bounce count in this light-baking process, and its magnitude affects the quality of light-baking. Specifically, the bounce count is the number of bounces of light considered in the calculation for a single ray. For example, if the bounce count is 4, then during passive sampling, only light with 4 or fewer bounces will be considered, while light with more than 4 bounces will not be considered. The higher the bounce count, the higher the baking quality.

[0296] The first sampling count is specifically the SPP (Samples Per Pixel) in this lighting baking process. The SPP determines how many independent rays each lightmap pixel emits, which is the number of times each shading point (texel) is sampled. Its size affects the lighting baking quality. The larger the SPP, the more samples are accumulated within the pixel, the lower the noise, and the higher the baking quality; conversely, the noise is more obvious.

[0297] Specifically, the light baking process in this embodiment can be a relatively high-quality light baking process, in which the number of first light bounces and the number of first samplings can be set to be higher.

[0298] In this embodiment, the step "fusion of multiple detection results corresponding to the first sampling number to obtain the target detection result" can specifically be: for the same pixel (texel) position, repeatedly emit rays with N independent paths, and average the detection results of the N rays to obtain the target detection result, thereby reducing the influence of noise. The first sampling number is denoted as N.

[0299] Optionally, in this embodiment, before the step "generating a light map corresponding to the virtual light source at an intermediate time point based on the light maps corresponding to the virtual light source at two adjacent preset time points", the following may be included:

[0300] When the type of the virtual light source is virtual directional light, a new preset time point is determined;

[0301] The second ray bounce count and the second sampling count of the virtual object surface in the virtual scene are set, wherein the second ray bounce count is less than the first ray bounce count, and the second sampling count is less than the first sampling count;

[0302] Based on the second sampling number, multiple light rays are emitted on the surface of the virtual object, and irradiance information is detected based on the number of light ray bounces of the emitted light rays.

[0303] Based on the multiple detection results corresponding to the second sampling number, the virtual scene is subjected to lighting baking processing to obtain the lighting map corresponding to the virtual light source at the newly added preset time point.

[0304] Specifically, for directional lights, since the high-frequency changes in indirect lighting mainly originate from the movement of directional lights, additional time points can be added to bake the light map of the directional lights.

[0305] In this context, compared to the previous light baking, to save computational costs, the light baking here can be of relatively lower quality. Specifically, the second ray bounce count is the number of bounces during the light baking process at the newly added preset time point, and the second ray bounce count can be less than the first ray bounce count. The second sampling count is the SPP (Samples Per Pixel) during the light baking process at the newly added preset time point, and the second sampling count can be less than the first sampling count.

[0306] 203. The server generates a light map corresponding to the virtual light source at an intermediate time point based on the light map corresponding to the virtual light source at two adjacent preset time points, wherein the intermediate time point is any time point between the two adjacent preset time points.

[0307] Specifically, this embodiment can generate lightmaps at other time points using interpolation, thereby obtaining high-density lightmaps. Different interpolation methods can be used for different light source types. For example, linear interpolation can be used for local light; for virtual directional light, interpolation can be performed based on densely baked lightmaps. Here, dense baking refers to adding new preset time points for baking in addition to the original preset time points.

[0308] Optionally, in this embodiment, the step "generating a light map corresponding to the virtual light source at an intermediate time point based on the light maps corresponding to the virtual light source at two adjacent preset time points" may include:

[0309] When the light source type of the virtual light source is virtual directional light, determine the first illumination parameter corresponding to the virtual light source at the intermediate time point, and the second illumination parameter corresponding to the virtual light source at the two adjacent preset time points.

[0310] Based on the first illumination parameter and the second illumination parameter, determine the illumination parameter change information of the intermediate time point relative to the adjacent preset time point;

[0311] Based on the lighting parameter change information, the lighting maps corresponding to the virtual light source at two adjacent preset time points are fused to obtain the lighting map corresponding to the virtual light source at the intermediate time point.

[0312] Since the illumination change frequency of directional light is relatively high, in order to ensure the quality and accuracy of the illumination map at the intermediate time point, this embodiment uses the illumination parameter change information between the intermediate time point and the adjacent preset time point to generate the illumination map at the intermediate time point.

[0313] 204. The server performs fusion processing based on the light map of at least one virtual light source at the same time point to obtain the target light map corresponding to the virtual scene at the time point, wherein the time point is the preset time point or the intermediate time point.

[0314] 205. The server trains the light map generation model based on the target light map corresponding to the virtual scene at multiple time points and the light source information, so that when rendering the virtual scene within the target time period, the trained light map generation model can generate the light map of the virtual scene in real time. The time points include the preset time point and the intermediate time point.

[0315] Specifically, a light map generation model can be trained based on the lighting parameters of each virtual light source at multiple time points and the target light map corresponding to the virtual scene at multiple time points, so that the trained light map generation model has the ability to reconstruct the light map within the target time period.

[0316] As can be seen from the above, this embodiment can obtain the light source information and light map generation model of at least one virtual light source in a virtual scene through a server. The light source information includes the lighting parameters of the virtual light source at multiple preset time points in a target time period. Based on the lighting parameters of the virtual light source at the preset time points, the virtual scene is subjected to lighting baking processing to obtain the light map corresponding to the virtual light source at the preset time points. Based on the light maps corresponding to the virtual light source at two adjacent preset time points, a light map corresponding to the virtual light source at an intermediate time point is generated, where the intermediate time point is the two adjacent preset time points. At any time point between points; the light map of at least one virtual light source at the same time point is fused to obtain the target light map corresponding to the virtual scene at the time point, wherein the time point is the preset time point or the intermediate time point; the light map generation model is trained based on the target light map corresponding to the virtual scene at multiple time points and the light source information, so that when rendering the virtual scene within the target time period, the light map generation model generates the light map of the virtual scene in real time through the trained light map generation model, wherein the time points include the preset time point and the intermediate time point.

[0317] This application only requires baking lightmaps at a preset time point, eliminating the need for lightmap baking at every time point, thus reducing the computational load of the offline lightmap baking process. Furthermore, based on the baked lightmaps at the preset time points, this application can generate more lightmaps for other time points, thereby obtaining high-density lightmap training data to train the lightmap generation model. This high-density training data improves the model's generalization ability and accuracy, enabling it to more accurately generate lightmaps for virtual scenes within the target time period during online applications. Based on the reconstruction capabilities of the trained lightmap generation model, there is no need to store the lightmaps. In practical applications, lightmaps can be generated in real-time using the trained lightmap generation model based on real-time lighting parameters. In summary, this application can improve the rendering quality and lighting effects of virtual scenes under conditions of limited storage and computational performance.

[0318] To better implement the above methods, embodiments of this application also provide a data processing apparatus for light mapping, such as... Figure 3 As shown, the data processing device for the light map may include an acquisition unit 301, a light baking unit 302, a texture generation unit 303, and a training unit 304, as follows:

[0319] (1) Obtain unit 301;

[0320] The acquisition unit is used to acquire light source information and a light map generation model of at least one virtual light source in a virtual scene. The light source information includes the lighting parameters of the virtual light source at multiple preset time points in a target time period.

[0321] (2) Light-baking unit 302;

[0322] The lighting baking unit is used to perform lighting baking processing on the virtual scene according to the lighting parameters of the virtual light source at the preset time point, so as to obtain the lighting map corresponding to the virtual light source at the preset time point.

[0323] Optionally, in some embodiments of this application, the illumination baking unit may include a sampling strategy determination subunit, an irradiation calculation subunit, and a texture determination subunit, as follows:

[0324] The sampling strategy determination subunit is used to determine at least one illumination sampling strategy;

[0325] The irradiance calculation subunit is used to calculate the irradiance information of the surface of the virtual object in the virtual scene based on the irradiance parameters of the virtual light source at the preset time point using the irradiance sampling strategy, so as to obtain the irradiance information of the surface of the virtual object at the preset time point under the irradiance sampling strategy.

[0326] The texture determination subunit is used to determine the light texture corresponding to the virtual light source at the preset time point based on the irradiation information.

[0327] Optionally, in some embodiments of this application, the texture determination subunit may be used to determine the weight information corresponding to each illumination sampling strategy; based on the weight information, the irradiance information of the virtual object surface at a preset time point under each illumination sampling strategy is fused to obtain the target irradiance information of the virtual object surface at the preset time point; based on the target irradiance information, the illumination texture corresponding to the virtual light source at the preset time point is determined.

[0328] Optionally, in some embodiments of this application, the illumination sampling strategy is a light source sampling strategy;

[0329] The irradiance calculation subunit can be used to detect the visibility between the surface of a virtual object and the virtual light source in the virtual scene; calculate the reflectivity of the virtual object surface to the virtual light source based on the material information of the virtual object surface; and calculate the irradiance information of the virtual object surface in the virtual scene according to the visibility, the reflectivity, and the illumination parameters of the virtual light source at the preset time point to obtain the irradiance information of the virtual object surface at the preset time point under the illumination sampling strategy.

[0330] Optionally, in some embodiments of this application, the illumination sampling strategy is a hemispherical space-based sampling strategy;

[0331] The irradiance calculation subunit can be specifically used to construct a hemispherical space of the colored points on the surface of the virtual object; generate at least one sampling direction in the hemispherical space according to the material information corresponding to the colored points; emit path rays for detection based on the sampling direction in the virtual scene corresponding to the virtual light source; determine the initial irradiance information of the path ray detection based on the illumination parameters of the virtual light source at the preset time point; obtain the irradiance information of the colored points corresponding to the sampling direction based on the detected initial irradiance information, the angle information of the path rays, the material reflectivity of the colored points, and the sampling probability corresponding to the sampling direction; and determine the irradiance information of the virtual object surface at the preset time point based on the irradiance information of the colored points on the surface of the virtual object in each sampling direction.

[0332] Optionally, in some embodiments of this application, the light baking unit may include a light emitting subunit, a detection subunit, and a baking subunit, as follows:

[0333] The light emitting subunit is used to emit light based on the surface of a virtual object in the virtual scene corresponding to the virtual light source.

[0334] The detection subunit is used to determine the detection result of the emitted light on the irradiance information based on the illumination parameters of the virtual light source at the preset time point;

[0335] The baking subunit is used to perform lighting baking processing on the virtual scene based on the detection results corresponding to the light, so as to obtain the lighting map corresponding to the virtual light source at the preset time point.

[0336] Optionally, in some embodiments of this application, the light emitting subunit may be specifically used to set a first number of light bounces and a first number of samplings on the surface of a virtual object in the virtual scene; based on the first number of samplings, multiple light emitting operations are performed on the surface of the virtual object, and irradiance information is detected based on the emitted light and the first number of light bounces.

[0337] Specifically, the baking subunit can be used to fuse multiple detection results corresponding to the first sampling number to obtain the target detection result; based on the target detection result, the virtual scene is subjected to lighting baking processing to obtain the lighting map corresponding to the virtual light source at the preset time point.

[0338] Optionally, in some embodiments of this application, the data processing device for the light map may further include an additional time point unit, a setting unit, a detection unit, and a baking processing unit, as follows:

[0339] The added time point unit is used to determine a new preset time point when the light source type of the virtual light source is virtual directional light;

[0340] The setting unit is used to set the second ray bounce count and the second sampling count of the surface of the virtual object in the virtual scene, wherein the second ray bounce count is less than the first ray bounce count, and the second sampling count is less than the first sampling count;

[0341] The detection unit is used to emit light multiple times on the surface of the virtual object based on the second sampling number, and to detect irradiation information based on the number of times the emitted light bounces back.

[0342] The baking processing unit is used to perform lighting baking processing on the virtual scene based on multiple detection results corresponding to the second sampling number, so as to obtain the lighting map corresponding to the virtual light source at the newly added preset time point.

[0343] Optionally, in some embodiments of this application, the data processing apparatus for the light map may further include a color channel conversion unit, as follows:

[0344] The color channel conversion unit is used to perform color channel conversion on the light map corresponding to the virtual light source at the newly added preset time point to obtain a single-channel light map corresponding to the virtual light source at the newly added preset time point.

[0345] (3) Texture generation unit 303;

[0346] The texture generation unit is used to generate a light map corresponding to the virtual light source at an intermediate time point based on the light map corresponding to the virtual light source at two adjacent preset time points, wherein the intermediate time point is any time point between the two adjacent preset time points.

[0347] Optionally, in some embodiments of this application, the texture generation unit may include a time difference determination subunit, a weight determination subunit, and a fusion subunit, as follows:

[0348] The time difference determination subunit is used to determine the time difference information between the intermediate time point and the two adjacent preset time points when the light source type of the virtual light source is local light.

[0349] The weight determination subunit is used to determine the weight information of the light map corresponding to the two adjacent preset time points based on the time difference information.

[0350] The fusion subunit is used to fuse the light maps corresponding to the virtual light source at two adjacent preset time points according to the weight information to obtain the light map corresponding to the virtual light source at the intermediate time point.

[0351] Optionally, in some embodiments of this application, the texture generation unit may include a parameter determination subunit, a parameter change determination subunit, and a texture blending subunit, as follows:

[0352] The parameter determination subunit is used to determine the first illumination parameter corresponding to the virtual light source at the intermediate time point and the second illumination parameter corresponding to the virtual light source at two adjacent preset time points when the light source type of the virtual light source is virtual directional light.

[0353] The parameter change determination subunit is used to determine the change information of the illumination parameters at the intermediate time point relative to the adjacent preset time point based on the first illumination parameter and the second illumination parameter.

[0354] The texture fusion subunit is used to fuse the light maps corresponding to the virtual light source at two adjacent preset time points based on the lighting parameter change information, so as to obtain the light map corresponding to the virtual light source at the intermediate time point.

[0355] Optionally, in some embodiments of this application, the two adjacent preset time points include a first adjacent time point and a second adjacent time point;

[0356] The parameter change determination subunit can specifically be used to determine the target illumination change information corresponding to the adjacent preset time points based on the second illumination parameters corresponding to the first adjacent time points and the second adjacent time points respectively; to determine the first illumination change information corresponding to the intermediate time point and the first adjacent time point based on the second illumination parameters corresponding to the first adjacent time point and the first illumination parameters; to determine the second illumination change information corresponding to the intermediate time point and the second adjacent time point based on the second illumination parameters corresponding to the second adjacent time point and the first illumination parameters; and to determine the illumination parameter change information of the intermediate time point relative to the adjacent preset time points based on the target illumination change information, the first illumination change information, and the second illumination change information.

[0357] (4) Training Unit 304;

[0358] The training unit is used to train the light map generation model based on the light map corresponding to the virtual light source at multiple time points and the light source information, so that when rendering the virtual scene within the target time period, the trained light map generation model can generate the light map of the virtual scene in real time. The time points include the preset time point and the intermediate time point.

[0359] Optionally, in some embodiments of this application, the training unit may include a fusion processing subunit and a training subunit, as follows:

[0360] The fusion processing subunit is used to perform fusion processing based on the light map of at least one virtual light source at the same time point to obtain the target light map of the virtual scene at the time point, wherein the time point is the preset time point or the intermediate time point.

[0361] The training subunit is used to train the light map generation model based on the target light map corresponding to the virtual scene at multiple time points and the light source information.

[0362] Optionally, in some embodiments of this application, the lightmap data processing device may further include a lighting parameter acquisition unit, a lightmap generation unit, and a rendering unit, as follows:

[0363] The lighting parameter acquisition unit is used to acquire the real-time lighting parameters of at least one virtual light source in the virtual scene during the target time period when a rendering request for the virtual scene within the target time period is detected.

[0364] The light map generation unit is used to generate a light map corresponding to the virtual scene based on the real-time lighting parameters of the virtual light source in the virtual scene using a trained light map generation model.

[0365] The rendering unit is used to render the virtual scene in real time based on the light map corresponding to the virtual scene and the original scene image of the virtual scene.

[0366] As can be seen from the above, in this embodiment, the acquisition unit 301 can acquire the light source information and light map generation model of at least one virtual light source in the virtual scene. The light source information includes the lighting parameters of the virtual light source at multiple preset time points in the target time period. The lighting baking unit 302 performs lighting baking processing on the virtual scene according to the lighting parameters of the virtual light source at the preset time points to obtain the light map corresponding to the virtual light source at the preset time points. The map generation unit 303 generates the light map corresponding to the virtual light source at an intermediate time point based on the light maps corresponding to the virtual light source at two adjacent preset time points. The intermediate time point is any time point between the two adjacent preset time points. The training unit 304 trains the light map generation model based on the light maps corresponding to the virtual light source at multiple time points and the light source information, so that when rendering the virtual scene in the target time period, the trained light map generation model can generate the light map of the virtual scene in real time. The time points include the preset time points and the intermediate time points.

[0367] This application only requires baking lightmaps at a preset time point, eliminating the need for lightmap baking at every time point, thus reducing the computational load of the offline lightmap baking process. Furthermore, based on the baked lightmaps at the preset time points, this application can generate more lightmaps for other time points, thereby obtaining high-density lightmap training data to train the lightmap generation model. This high-density training data improves the model's generalization ability and accuracy, enabling it to more accurately generate lightmaps for virtual scenes within the target time period during online applications. Based on the reconstruction capabilities of the trained lightmap generation model, there is no need to store the lightmaps. In practical applications, lightmaps can be generated in real-time using the trained lightmap generation model based on real-time lighting parameters. In summary, this application can improve the rendering quality and lighting effects of virtual scenes under conditions of limited storage and computational performance.

[0368] This application also provides an electronic device, such as... Figure 4 The diagram shows a schematic representation of the structure of an electronic device according to an embodiment of this application. This electronic device can be a terminal or a server, specifically:

[0369] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will understand that... Figure 4 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:

[0370] The processor 401 is the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It executes software programs and / or modules stored in the memory 402, and calls data stored in the memory 402, to perform various functions and process data. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 401.

[0371] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0372] The electronic device also includes a power supply 403 that supplies power to the various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0373] The electronic device may also include an input unit 404, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0374] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the electronic device loads the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 runs the applications stored in the memory 402 to realize various functions, as follows:

[0375] The method involves acquiring light source information and a lightmap generation model for at least one virtual light source in a virtual scene. The light source information includes the lighting parameters of the virtual light source at multiple preset time points within a target time period. Based on the lighting parameters of the virtual light source at the preset time points, the virtual scene is subjected to lighting baking to obtain a lightmap corresponding to the virtual light source at each preset time point. A lightmap corresponding to the virtual light source at an intermediate time point is generated based on the lightmaps corresponding to the virtual light source at two adjacent preset time points, where the intermediate time point is any time point between the two adjacent preset time points. The lightmap generation model is trained based on the lightmaps corresponding to the virtual light source at multiple time points and the light source information. This allows the trained lightmap generation model to generate the lightmap of the virtual scene in real time during the rendering of the virtual scene within the target time period. The time points include the preset time points and the intermediate time points.

[0376] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0377] As can be seen from the above, this embodiment can obtain light source information and a light map generation model for at least one virtual light source in a virtual scene. The light source information includes the lighting parameters of the virtual light source at multiple preset time points within a target time period. Based on the lighting parameters of the virtual light source at the preset time points, the virtual scene is subjected to lighting baking processing to obtain the light map corresponding to the virtual light source at the preset time points. Based on the light maps corresponding to the virtual light source at two adjacent preset time points, a light map corresponding to the virtual light source at an intermediate time point is generated, where the intermediate time point is any time point between the two adjacent preset time points. Based on the light maps corresponding to the virtual light source at multiple time points and the light source information, the light map generation model is trained so that when rendering the virtual scene within the target time period, the trained light map generation model can generate the light map of the virtual scene in real time, where the time points include the preset time points and the intermediate time points.

[0378] This application only requires baking lightmaps at a preset time point, eliminating the need for lightmap baking at every time point, thus reducing the computational load of the offline lightmap baking process. Furthermore, based on the baked lightmaps at the preset time points, this application can generate more lightmaps for other time points, thereby obtaining high-density lightmap training data to train the lightmap generation model. This high-density training data improves the model's generalization ability and accuracy, enabling it to more accurately generate lightmaps for virtual scenes within the target time period during online applications. Based on the reconstruction capabilities of the trained lightmap generation model, there is no need to store the lightmaps. In practical applications, lightmaps can be generated in real-time using the trained lightmap generation model based on real-time lighting parameters. In summary, this application can improve the rendering quality and lighting effects of virtual scenes under conditions of limited storage and computational performance.

[0379] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0380] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the lightmap data processing methods provided in embodiments of this application. For example, the instructions can execute the following steps:

[0381] The method involves acquiring light source information and a lightmap generation model for at least one virtual light source in a virtual scene. The light source information includes the lighting parameters of the virtual light source at multiple preset time points within a target time period. Based on the lighting parameters of the virtual light source at the preset time points, the virtual scene is subjected to lighting baking to obtain a lightmap corresponding to the virtual light source at each preset time point. A lightmap corresponding to the virtual light source at an intermediate time point is generated based on the lightmaps corresponding to the virtual light source at two adjacent preset time points, where the intermediate time point is any time point between the two adjacent preset time points. The lightmap generation model is trained based on the lightmaps corresponding to the virtual light source at multiple time points and the light source information. This allows the trained lightmap generation model to generate the lightmap of the virtual scene in real time during the rendering of the virtual scene within the target time period. The time points include the preset time points and the intermediate time points.

[0382] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0383] The computer-readable storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0384] Since the instructions stored in the computer-readable storage medium can execute the steps in any of the light map data processing methods provided in the embodiments of this application, the beneficial effects that any of the light map data processing methods provided in the embodiments of this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0385] According to one aspect of this application, a computer program product or computer program 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 the various alternative implementations of the above-described lightmap data processing aspects.

[0386] The above provides a detailed description of a data processing method and related equipment for light mapping provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for processing lightmap data, characterized in that, include: Obtain light source information and a light map generation model of at least one virtual light source in a virtual scene, wherein the light source information includes the lighting parameters of the virtual light source at multiple preset time points in a target time period; Based on the lighting parameters of the virtual light source at the preset time point, the virtual scene is subjected to lighting baking to obtain the light map corresponding to the virtual light source at the preset time point. Based on the light map corresponding to the virtual light source at two adjacent preset time points, a light map corresponding to the virtual light source at an intermediate time point is generated, wherein the intermediate time point is any time point between the two adjacent preset time points; Based on the light maps corresponding to the virtual light source at multiple time points and the light source information, the light map generation model is trained so that when rendering the virtual scene within the target time period, the trained light map generation model can generate the light map of the virtual scene in real time. The time points include the preset time points and the intermediate time points. The step of generating a light map corresponding to the virtual light source at an intermediate time point based on the light maps corresponding to the virtual light source at two adjacent preset time points includes: When the light source type of the virtual light source is virtual directional light, determine the first illumination parameter corresponding to the virtual light source at the intermediate time point, and the second illumination parameter corresponding to the virtual light source at the two adjacent preset time points. Based on the first illumination parameter and the second illumination parameter, determine the illumination parameter change information of the intermediate time point relative to the adjacent preset time point; Based on the lighting parameter change information, the lighting maps corresponding to the virtual light source at two adjacent preset time points are fused to obtain the lighting map corresponding to the virtual light source at the intermediate time point.

2. The method according to claim 1, characterized in that, The method further includes: When a rendering request for the virtual scene within the target time period is detected, the real-time lighting parameters of at least one virtual light source in the virtual scene within the target time period are obtained. The trained lightmap generation model generates a lightmap corresponding to the virtual scene based on the real-time lighting parameters of the virtual light source in the virtual scene. The virtual scene is rendered in real time based on the light map corresponding to the virtual scene and the original scene image of the virtual scene.

3. The method according to claim 1, characterized in that, The step of performing lighting baking on the virtual scene based on the lighting parameters of the virtual light source at the preset time point to obtain the lighting map corresponding to the virtual light source at the preset time point includes: Determine at least one illumination sampling strategy; Using the lighting sampling strategy, the irradiance information of the virtual object surface in the virtual scene is calculated based on the lighting parameters of the virtual light source at the preset time point, so as to obtain the irradiance information of the virtual object surface at the preset time point under the lighting sampling strategy. Based on the irradiation information, the light map corresponding to the virtual light source at the preset time point is determined.

4. The method according to claim 3, characterized in that, The step of determining the illumination map corresponding to the virtual light source at the preset time point based on the irradiation information includes: Determine the weight information corresponding to each illumination sampling strategy; Based on the weight information, the irradiance information of the virtual object surface at a preset time point under each illumination sampling strategy is fused to obtain the target irradiance information of the virtual object surface at the preset time point. Based on the target irradiance information, the light map corresponding to the virtual light source at the preset time point is determined.

5. The method according to claim 3, characterized in that, The illumination sampling strategy is a light source sampling strategy; The step of calculating the irradiance information of the virtual object surface in the virtual scene based on the illumination parameters of the virtual light source at the preset time point using the illumination sampling strategy, to obtain the irradiance information of the virtual object surface at the preset time point under the illumination sampling strategy, includes: Detect the visibility between the surface of a virtual object and the virtual light source in the virtual scene; Based on the material information of the virtual object's surface, the reflectivity of the virtual object's surface to the virtual light source is calculated; Based on the visibility, reflectivity, and illumination parameters of the virtual light source at the preset time point, the irradiance information of the virtual object surface in the virtual scene is calculated to obtain the irradiance information of the virtual object surface at the preset time point under the illumination sampling strategy.

6. The method according to claim 3, characterized in that, The illumination sampling strategy is a hemispherical space-based sampling strategy; The step of calculating the irradiance information of the virtual object surface in the virtual scene based on the illumination parameters of the virtual light source at the preset time point using the illumination sampling strategy, to obtain the irradiance information of the virtual object surface at the preset time point under the illumination sampling strategy, includes: Construct a hemispherical space for the shading points on the surface of the virtual object; Based on the material information corresponding to the shading point, at least one sampling direction is generated in the hemispherical space; In the virtual scene corresponding to the virtual light source, a path ray is emitted based on the sampling direction for detection; and based on the illumination parameters of the virtual light source at the preset time point, the initial irradiance information of the path ray detection is determined. Based on the detected initial irradiance information, the angle information of the path ray, the material reflectivity of the colored point, and the sampling probability corresponding to the sampling direction, the irradiance information of the colored point corresponding to the sampling direction is obtained; Based on the irradiance information of the colored points on the surface of the virtual object in each sampling direction, the irradiance information of the surface of the virtual object at a preset time point is determined.

7. The method according to claim 1, characterized in that, The step of performing lighting baking on the virtual scene based on the lighting parameters of the virtual light source at the preset time point to obtain the lighting map corresponding to the virtual light source at the preset time point includes: In the virtual scene corresponding to the virtual light source, light is emitted based on the surface of virtual objects in the virtual scene; Based on the illumination parameters of the virtual light source at the preset time point, the detection result of the emitted light on the irradiance information is determined; Based on the detection results corresponding to the light, the virtual scene is subjected to light baking processing to obtain the light map corresponding to the virtual light source at the preset time point.

8. The method according to claim 7, characterized in that, The emission of light based on the surface of a virtual object in the virtual scene includes: Set the first number of light bounces and the first number of samples to the surface of the virtual object in the virtual scene; Based on the first number of samplings, multiple light rays are emitted onto the surface of the virtual object, and irradiance information is detected based on the number of times the emitted light rays bounce back from the first light ray. The step of performing lighting baking on the virtual scene based on the detection results corresponding to the light rays to obtain the lighting map corresponding to the virtual light source at the preset time point includes: The multiple detection results corresponding to the first sampling number are fused to obtain the target detection result; Based on the target detection results, the virtual scene is subjected to lighting baking to obtain the lighting map corresponding to the virtual light source at the preset time point.

9. The method according to claim 8, characterized in that, Before generating the light map corresponding to the virtual light source at an intermediate time point based on the light maps corresponding to the virtual light source at two adjacent preset time points, the process further includes: When the type of the virtual light source is virtual directional light, a new preset time point is determined; The second ray bounce count and the second sampling count of the virtual object surface in the virtual scene are set, wherein the second ray bounce count is less than the first ray bounce count, and the second sampling count is less than the first sampling count; Based on the second sampling number, multiple light rays are emitted on the surface of the virtual object, and irradiance information is detected based on the number of light ray bounces of the emitted light rays. Based on the multiple detection results corresponding to the second sampling number, the virtual scene is subjected to lighting baking processing to obtain the lighting map corresponding to the virtual light source at the newly added preset time point.

10. The method according to claim 9, characterized in that, The method further includes: The color channel of the light map corresponding to the virtual light source at the newly added preset time point is converted to obtain a single-channel light map corresponding to the virtual light source at the newly added preset time point.

11. The method according to claim 1, characterized in that, The step of generating a light map for the virtual light source at an intermediate time point based on the light maps corresponding to the virtual light source at two adjacent preset time points includes: When the light source type of the virtual light source is local light, the time difference information between the intermediate time point and the two adjacent preset time points is determined. Based on the time difference information, the weight information of the light map corresponding to the two adjacent preset time points is determined; Based on the weight information, the light maps corresponding to the virtual light source at two adjacent preset time points are fused to obtain the light map corresponding to the virtual light source at the intermediate time point.

12. The method according to claim 1, characterized in that, The two adjacent preset time points include a first adjacent time point and a second adjacent time point; The step of determining the change information of illumination parameters at the intermediate time point relative to adjacent preset time points based on the first illumination parameter and the second illumination parameter includes: Based on the second illumination parameters corresponding to the first adjacent time point and the second adjacent time point respectively, the target illumination change information corresponding to the adjacent preset time points is determined; Based on the second illumination parameters and the first illumination parameters corresponding to the first adjacent time points, the first illumination change information corresponding to the intermediate time point and the first adjacent time points is determined. Based on the second illumination parameters corresponding to the second adjacent time point and the first illumination parameters, determine the second illumination change information between the intermediate time point and the second adjacent time point; Based on the target illumination change information, the first illumination change information, and the second illumination change information, the illumination parameter change information of the intermediate time point relative to the adjacent preset time point is determined.

13. The method according to claim 1, characterized in that, The step of training the light map generation model based on the light map corresponding to the virtual light source at multiple time points and the light source information includes: The light map of at least one virtual light source at the same time point is fused to obtain the target light map of the virtual scene at the time point, wherein the time point is the preset time point or the intermediate time point. The lighting map generation model is trained based on the target lighting map corresponding to the virtual scene at multiple time points and the light source information.

14. A data processing apparatus for light mapping, characterized in that, include: The acquisition unit is used to acquire light source information and a light map generation model of at least one virtual light source in a virtual scene. The light source information includes the lighting parameters of the virtual light source at multiple preset time points in the target time period. The lighting baking unit is used to perform lighting baking processing on the virtual scene according to the lighting parameters of the virtual light source at the preset time point, so as to obtain the lighting map corresponding to the virtual light source at the preset time point; A texture generation unit is used to generate a light map corresponding to the virtual light source at an intermediate time point based on the light maps corresponding to the virtual light source at two adjacent preset time points, wherein the intermediate time point is any time point between the two adjacent preset time points; wherein, generating the light map corresponding to the virtual light source at the intermediate time point based on the light maps corresponding to the virtual light source at two adjacent preset time points includes: when the light source type of the virtual light source is a virtual directional light, determining the first lighting parameters corresponding to the virtual light source at the intermediate time point and the second lighting parameters corresponding to the virtual light source at the two adjacent preset time points; determining the lighting parameter change information of the intermediate time point relative to the adjacent preset time points based on the first lighting parameters and the second lighting parameters; and performing a fusion process on the light maps corresponding to the virtual light source at the two adjacent preset time points based on the lighting parameter change information to obtain the light map corresponding to the virtual light source at the intermediate time point. The training unit is used to train the light map generation model based on the light map corresponding to the virtual light source at multiple time points and the light source information, so that when rendering the virtual scene within the target time period, the trained light map generation model can generate the light map of the virtual scene in real time. The time points include the preset time point and the intermediate time point.

15. An electronic device, characterized in that, It includes a memory and a processor; the memory stores an application program, and the processor runs the application program within the memory to perform the operations in the lightmap data processing method according to any one of claims 1 to 13.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the lightmap data processing method according to any one of claims 1 to 13.

17. A computer program product comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the data processing method for lightmaps as described in any one of claims 1 to 13.