Illumination data processing method

CN121330157BActive Publication Date: 2026-10-27ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511653835.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-12
Publication Date
2026-10-27
Estimated Expiration
2045-11-12

AI Technical Summary

Technical Problem

[0003]然而,相关技术中在对游戏场景进行光照烘焙的过程中,通常基于静态场景进行烘焙,无法支持动态光影变化和动态场景变化,且无法支持移动中的物体享受全局光照

Benefits of technology

[0010]根据本申请所涉及的光照数据处理,通过确定待烘焙场景的体素结构,将几何模型归一化为规整的体素网格,避免由于场景模型复杂多样,烘焙速度慢而导致的难以统一管理。基于体素结构获取面元光照信息,避免出现对光照多次反弹而导致的计算耗时。根据移动区域信息确定探针部署参数,进而确保资源的高效利用,避免无谓的数据存储和计算,此外,根据目标待渲染对象的移动区域信息确定探针部署参数,从而使得在进行光照烘焙的过程中支持动态物体,提升对待烘焙场景的光照数据处理效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121330157B_ABST
    Figure CN121330157B_ABST
Patent Text Reader

Abstract

The application provides a lighting data processing method. The lighting data processing method comprises: determining a to-be-baked scene, and determining a voxel structure of the to-be-baked scene, wherein the to-be-baked scene comprises a target to-be-rendered object; obtaining face element lighting information of the to-be-baked scene based on the voxel structure; determining movement area information of the target to-be-rendered object in the to-be-baked scene, and determining lighting probe deployment parameters according to the movement area information; deploying lighting probes in the to-be-baked scene according to the lighting probe deployment parameters and the voxel structure, and generating lighting baking data of the to-be-baked scene based on the lighting probes and the face element lighting information. According to the application, the lighting data processing effect of the to-be-baked scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method for processing light illumination data. This application also relates to a light illumination data processing apparatus, a computing device, a computer-readable storage medium, and a computer program product. Background Technology

[0002] With the continuous development of computer technology, global illumination baking is widely used in game development to bake the lighting of game scenes.

[0003] However, current technologies for baking game scenes typically rely on static scenes, failing to support dynamic lighting and scene changes, and also unable to provide global illumination for moving objects. Furthermore, creating global illumination usually requires significant time for offline baking during scene creation, resulting in substantial offline data storage requirements. Therefore, existing global illumination baking solutions struggle to cover the entire game scene and cannot support dynamic lighting and shadows. Summary of the Invention

[0004] In view of this, embodiments of this application provide a method for processing illumination data. This application also relates to an illumination data processing apparatus, a computing device, a computer-readable storage medium, and a computer program product, to solve the aforementioned problems existing in the prior art.

[0005] According to a first aspect of the embodiments of this application, a method for processing illumination data is provided, including: Determine the scene to be baked and determine the voxel structure of the scene to be baked, wherein the scene to be baked includes a target object to be rendered; Based on the voxel structure, obtain the surface element lighting information of the scene to be baked; Determine the movement area information of the target object to be rendered in the scene to be baked, and determine the lighting probe deployment parameters based on the movement area information; Based on the light probe deployment parameters and the voxel structure, light probes are deployed in the scene to be baked, and light baking data for the scene to be baked is generated based on the light probes and the surface element lighting information.

[0006] According to a second aspect of the embodiments of this application, a light illumination data processing apparatus is provided, comprising: The determining unit is configured to determine the scene to be baked and determine the voxel structure of the scene to be baked, wherein the scene to be baked includes a target object to be rendered; The acquisition unit is configured to acquire the surface element lighting information of the scene to be baked based on the voxel structure; The deployment unit is configured to determine the movement area information of the target object to be rendered in the scene to be baked, and to determine the light probe deployment parameters based on the movement area information; The processing unit is configured to deploy a light probe in the scene to be baked according to the light probe deployment parameters and the voxel structure, and generate light baking data for the scene to be baked based on the light probe and the surface element lighting information.

[0007] According to a third aspect of the embodiments of this application, a computing device is provided, comprising: Memory and processor; The memory is used to store computer programs or instructions, and the processor is used to execute the computer programs or instructions, which, when executed by the processor, implement the steps of the above-described illumination data processing method.

[0008] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided that stores a computer program or instructions, which, when executed by a processor, implement the steps of the above-described illumination data processing method.

[0009] According to a fifth aspect of the embodiments of this application, a computer program product is provided, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described illumination data processing* method.

[0010] Based on the lighting data processing involved in this application, the geometric model is normalized into a regular voxel mesh by determining the voxel structure of the scene to be baked, avoiding the difficulty in unified management caused by the slow baking speed due to the complexity and diversity of scene models. The surface lighting information is obtained based on the voxel structure, avoiding the computational time consumption caused by multiple bounces of light. Probe deployment parameters are determined based on the moving region information, thereby ensuring efficient resource utilization and avoiding unnecessary data storage and computation. Furthermore, the probe deployment parameters are determined based on the moving region information of the target object to be rendered, thus enabling dynamic objects to be supported during the lighting baking process and improving the lighting data processing effect of the scene to be baked. Attached Figure Description

[0011] Figure 1 A flowchart of a lighting data processing method according to an embodiment of this application is shown; Figure 2 A schematic diagram of the structure of an illumination data processing apparatus according to an embodiment of this application is shown; Figure 3 A structural block diagram of a computing device according to an embodiment of this application is shown. Detailed Implementation

[0012] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.

[0013] The terminology used in one or more embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this application. The singular forms “a,” “the,” and “the” used in one or more embodiments of this application and in the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” used in one or more embodiments of this application refers to and includes any or all possible combinations of one or more associated listed items.

[0014] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this application, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0015] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0016] The lighting data processing method provided in this application is applied to scenarios that generate, process, and optimize global lighting information, and is particularly suitable for fields such as games and virtual reality that require real-time rendering.

[0017] First, the terms and concepts involved in one or more embodiments of this application will be explained.

[0018] Surface element: an abbreviation for surface element, is a tiny fragment of surface with attributes. In this application, a surface element refers to the surface used to represent a static object to be baked during the voxelization process, and is used to record the surface attributes of that surface.

[0019] A voxel can be understood as a three-dimensional pixel. It is the smallest, indivisible unit cube that makes up a three-dimensional volume space. It has a three-dimensional coordinate position and attribute value.

[0020] Spherical harmonic illumination coefficients are a set of mathematical parameters used to compactly encode a complex lighting environment in a spherical coordinate system.

[0021] Space probes are data points pre-deployed in a 3D scene to collect and store information about the ambient lighting around it.

[0022] Direct illumination refers to light emitted directly from a light source (such as the sun or a light bulb) and shining directly onto the surface of an object without being reflected or refracted by any intermediate object.

[0023] Indirect lighting: refers to the phenomenon where light emitted from a light source (such as the sun) shines on the surface of an object, and after one or more reflections, shines on the surface of other objects.

[0024] This application provides a method for processing illumination data, and also relates to an apparatus for processing illumination data, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.

[0025] Figure 1 A flowchart of a lighting data processing method according to an embodiment of this application is shown, specifically including the following steps 102-108: Step 102: Determine the scene to be baked and determine the voxel structure of the scene to be baked, wherein the scene to be baked includes the target object to be rendered.

[0026] In this context, the scene to be baked can be understood as a 3D virtual environment that requires pre-calculation of global illumination. A voxel structure can be understood as a set of regular mesh units formed by discretizing the continuous 3D space in the scene to be baked. The target object to be rendered can be understood as an object in the scene to be baked that requires dynamic lighting rendering at runtime; it is typically movable.

[0027] In one specific embodiment provided in this application, a game scene that needs to be baked with global illumination is selected. Then, all complex static models (such as buildings and mountains) in the scene are converted into a unified voxel representation, and movable target objects to be rendered in the scene to be baked are obtained.

[0028] In one specific embodiment provided in this application, the scene to be baked includes at least one static object to be baked; determining the voxel structure of the scene to be baked includes: Each static object to be baked is voxelized to obtain at least one voxel mesh corresponding to the scene to be baked. The surface properties of each voxel mesh are stored in the corresponding face element to obtain the voxel structure of the scene to be baked.

[0029] In this context, static objects to be baked can be understood as objects whose position remains fixed within the scene to be baked, and whose geometry and material do not change. Examples include buildings, roads, mountains, and static decorations in a game scene. The lighting information for static objects to be baked can be pre-calculated.

[0030] Voxelization can be understood as a computational process that transforms a complex three-dimensional model with continuous surfaces into an approximate representation composed of discrete, regular three-dimensional mesh units (i.e., voxels).

[0031] A voxel mesh can be understood as a three-dimensional mesh element obtained through voxelization, which is the basic unit that constitutes the entire voxel structure. Each voxel mesh occupies a specific position and volume in space.

[0032] Surface properties can be understood as parameters used to describe the visual and optical characteristics of an object's surface. Surface properties include virtual normals, which define the surface's orientation and are the basis for calculating the direction of light reflection. Surface properties also include the lighting parameters of the static object to be baked.

[0033] A surface element can be understood as a surface element of a voxel mesh. In this application, a surface element is not a solid cube that fills the entire volume of a voxel, but rather a tiny fragment representing the surface of the original static object to be baked at the location of the voxel.

[0034] In one specific embodiment provided in this application, each static object in the scene to be baked is traversed, and its original geometric complexity is disregarded, and it is converted into a set composed of a uniform voxel mesh. After generating the voxel mesh, the optical properties of the original static object surface it represents, such as the virtual normal direction, are extracted and preserved from it. These properties are then stored on the face elements associated with the voxel mesh to obtain the voxel structure of the scene to be baked.

[0035] According to the above-mentioned content of this application, computing resources are concentrated on the static object to be baked, and the three-dimensional model in the scene to be baked is uniformly converted into a standard voxel mesh, thereby avoiding the interference of the compositional differences of the static object to be baked on the baking process, thus speeding up the baking process.

[0036] Step 104: Based on the voxel structure, obtain the surface element lighting information of the scene to be baked.

[0037] In this context, the surface element lighting information can be understood as the lighting calculation results stored on the voxel surface (surface element). This surface element lighting information is used to describe the indirect lighting intensity and color formed at a certain point on the object's surface after light bounces in the scene.

[0038] In one specific embodiment provided in this application, a global illumination algorithm is run on the voxel structure, and the calculated illumination information is stored on the surface of each voxel to obtain an indirect illumination base map of the entire scene to be baked.

[0039] In one specific embodiment provided in this application, the surface attribute includes a virtual normal direction. The virtual normal direction can be understood as a normal vector stored on a surface element to simulate the orientation of the static surface of the object to be baked. During voxelization, the normal is recalculated based on the orientation of the surface segment of the static object to be baked represented by the voxel.

[0040] Based on this, and using the voxel structure, the surface element lighting information of the scene to be baked is obtained, including S1042-S1048: S1042. In the scene to be baked, determine the face element to be processed, wherein the face element to be processed is the face element corresponding to any voxel mesh in each voxel mesh.

[0041] In this context, the face element to be processed can be understood as the face element currently undergoing lighting calculation during the global lighting calculation process. The voxel structure of the entire scene to be baked consists of millions or even billions of face elements, and lighting calculation requires traversing every face element. Each face element becomes a face element to be processed during the calculation.

[0042] S1044. Determine the virtual normal direction corresponding to the surface element to be processed.

[0043] The virtual normal direction includes a first normal orientation and / or a second normal orientation.

[0044] It's important to understand that the first normal orientation can be understood as the front or outward orientation of the face element, i.e., the direction facing the scene space to be baked, where it might receive reflected light from other surfaces. The second normal orientation can be understood as the back or inward orientation of the face element, such as the direction pointing inwards towards an object or close to a wall. In this orientation, it is usually difficult or impossible to receive indirect lighting from other parts of the scene to be baked.

[0045] Furthermore, the static object to be baked has a first normal orientation and a second normal orientation. For example, in a game scene, if the static object to be baked is a leaf, when the leaf is oriented with its first normal orientation, it can receive direct sunlight from the game scene. Alternatively, when oriented with its first normal orientation, its light transmittance can be determined based on its material, thus obtaining transmitted light in the second normal orientation. However, when oriented with its second normal orientation, there is no indirect lighting from other parts of the scene to be baked.

[0046] S1046. Based on the virtual normal direction, determine the surface illumination information of the surface element to be processed.

[0047] In one specific embodiment provided in this application, determining the surface illumination information of the surface element to be processed based on the virtual normal direction includes: When the virtual normal direction is the first normal orientation, the reference surface lighting information of at least one reference surface element is obtained, and the first surface lighting information of the surface element to be processed is determined based on the lighting information of each reference surface element, wherein there is indirect lighting between at least one reference surface element and the surface element to be processed. When the virtual normal direction is the direction of the second normal, the second surface element lighting information of the surface element to be processed is determined; Based on the first surface element illumination information and / or the second surface element illumination information, determine the surface element illumination information of the surface element to be processed.

[0048] In this context, a reference element can be understood as other elements that contribute light to the indirect lighting of the element to be processed. For example, in a game scene, a beam of light shines from a light bulb onto wall A (reference element), and wall A reflects the light onto wall B (the element to be processed). The element corresponding to wall A is then the reference element for the element corresponding to wall B. The lighting information of the reference element can be understood as the lighting information (color, brightness) stored within the reference element itself. This lighting information represents the light energy emitted by the reference element as a new secondary light source, used to construct the indirect lighting of the element to be processed.

[0049] The first-level surface lighting information can be understood as the complete lighting information calculated for a surface with a first normal orientation, including indirect lighting, taking into account the light energy transfer of other surface elements in the scene to be baked. The second-level surface lighting information can be understood as the lighting information calculated for a surface with a second normal orientation, which typically does not include or only includes simplified indirect lighting.

[0050] In one specific embodiment provided in this application, when the surface element to be processed has a first normal orientation, rays are emitted into the scene to be baked based on the position and virtual normal direction of the surface element to be processed, all reference surface elements that can illuminate it are found, and the illumination values ​​calculated by these reference surface elements in the previous lighting iteration are obtained. The indirect light collected from all reference surface elements is combined with direct illumination to obtain the global illumination result of the surface element to be processed. When the surface element to be processed has a second normal orientation, if the light source can illuminate the back side, only the direct illumination received by the surface element is calculated, or a fixed ambient light value is simply assigned. This avoids the time-consuming calculation of illumination. Based on the determination result of the virtual normal orientation, the corresponding calculation result is determined as the surface element illumination information of the surface element to be processed.

[0051] Furthermore, the surface properties also include the illumination parameters of the static object to be baked.

[0052] Here, the lighting parameters can be understood as a set of parameters used to define the optical properties of the surface material of the static object to be baked. This includes the material of the static object to be baked, and the ability of the static object to reflect light of different wavelengths determined based on the material. Combining the above, when the virtual normal direction is the first normal orientation, the lighting information of at least one reference surface element is obtained, including: When the virtual normal direction is the first normal orientation, at least one reference surface element is determined to have indirect lighting on the surface element to be processed; Determine the reference lighting parameters for the static object to be baked corresponding to each reference element; Based on each reference illumination parameter, the reference surface element illumination information of each reference surface element for the surface element to be processed is determined.

[0053] Based on the above-described content of this application, by reducing the complex indirect lighting calculations for the second normal-oriented surface element, the computational load required for a single illumination bounce iteration is reduced, thereby shortening the total baking time. By referencing the previous calculation results of the reference surface element, the effect of multiple illumination bounces can be simulated efficiently.

[0054] The reference lighting parameters can be understood as the lighting parameters of the static object to be baked corresponding to the reference element.

[0055] In one specific embodiment provided in this application, based on the surface element to be processed having a first normal orientation, multiple rays are emitted into the hemispherical space according to its virtual normal direction, and collision detection is performed. During this process, all surface elements hit by rays and whose virtual normal direction is towards the current ray can be identified as reference surface elements with indirect lighting. The static object to be baked corresponding to the reference surface element is determined, and the lighting parameters such as the material color of the static object to be baked are obtained. Based on the above operations, the lighting information of each reference surface element for the surface element to be processed is calculated, and the reference surface element lighting information of each reference surface element for the surface element to be processed is obtained.

[0056] Based on the above-mentioned content of this application, by determining the reference surface lighting information of each reference surface element for the surface element to be processed, the surface lighting information of the surface element to be processed is made more realistic.

[0057] In one specific embodiment provided in this application, the first surface element illumination information of the surface element to be processed is determined based on the illumination information of each reference surface element, including: Determine the target lighting parameters of the static object to be baked corresponding to the surface element to be processed; Based on the target illumination parameters, calculate the direct illumination information of the surface element to be processed; Based on the direct illumination information of the surface element to be processed and the reference surface element illumination information of each reference surface element on the surface element to be processed, the first surface element illumination information of the surface element to be processed is generated.

[0058] Among them, the target lighting parameters can be understood as the material optical properties of the static object to be baked corresponding to the surface element to be processed, which are used to determine how the surface element interacts with the light for the first time.

[0059] Direct lighting information can be understood as the lighting result produced when light emitted from a direct light source (such as the sun or a light bulb) in the scene to be baked directly illuminates the surface element to be processed without any surface reflection.

[0060] In one specific embodiment provided in this application, a static object to be baked corresponding to the surface element to be processed is determined, and target lighting parameters such as the material color of the static object to be baked are obtained. Based on the light source information in the scene to be baked, the effect of direct light illuminating the surface element is calculated. And based on the reference surface element lighting information of each reference surface element obtained above, the first surface element lighting information of the surface element to be processed is obtained.

[0061] Based on the aforementioned content of this application, by calculating direct and indirect light separately, the lighting of the scene to be baked is ensured to be more realistic. Since both direct and indirect light are uniformly modulated by the material color, the inherent color of the object can be correctly and consistently represented under all lighting conditions, ensuring the harmony and unity of the entire color system of the scene to be baked. By using the direct lighting information of the surface element to be processed and the lighting information of the reference surface elements for each reference surface element, complex nonlinear calculations are avoided, ensuring the stability and repeatability of the baking results.

[0062] S1048. Based on the surface illumination information of each surface element to be processed, determine the surface illumination information of the scene to be baked.

[0063] In this context, surface element lighting information can be understood as the calculated lighting results received on a single surface element. It describes the color and brightness values ​​formed at that surface element location after the combined effect of direct and indirect lighting. The surface element lighting information of the entire scene to be baked is the collection of lighting information from all individual surface elements.

[0064] In one specific embodiment provided in this application, a face element is selected from the face element set according to spatial order or dependency order as the current computation target. The virtual normal direction is read from the stored data of the face element to be processed. Lighting simulation is performed using the virtual normal direction of this face element. For example, the direct light received by this face element is calculated based on the light source direction and the normal. Rays are emitted into the scene to be baked according to the normal direction, searching for other face elements that contribute to it, and collecting the light rays reflected from other face elements. The face element lighting information of all face elements in the scene to be baked is summarized to obtain the face element lighting information of the scene to be baked.

[0065] As described above in this application, the virtual normal direction provides surface orientation information for each facet, enabling the ray tracing algorithm to calculate reflections and bounces in a manner close to physical laws. By preserving the virtual normal during voxelization, the orientation details of the static object to be baked are retained at the lighting level. Each facet is processed individually, and its normal direction is determined, ensuring that the lighting results accurately reflect the geometric features of the scene to be baked, avoiding defects such as light leakage or leveling. Each iteration of light bounce is based on the correct, directional lighting information of each facet after the previous iteration, thus ensuring the realism of multiple bounce simulations. Based on this, accurate facet lighting information for the scene to be baked is obtained.

[0066] Step 106: Determine the movement area information of the target object to be rendered in the scene to be baked, and determine the lighting probe deployment parameters based on the movement area information.

[0067] The movement area information can be understood as a data description of the spatial range that the target object to be rendered may move within the scene to be baked. For example, the patrol path of an active character, or all areas that a player character may reach.

[0068] In one specific embodiment provided in this application, the activity range of the target object to be rendered is analyzed, and the region for probe deployment is determined and generated accordingly. For example, probes are deployed more densely in areas where the target object to be rendered has a high activity density; in areas where the target object cannot reach, probes are not deployed or are deployed sparsely. This ensures efficient use of resources and avoids unnecessary data storage and computation.

[0069] Step 108: Deploy the light probe in the scene to be baked according to the light probe deployment parameters and the voxel structure, and generate the light baking data of the scene to be baked based on the light probe and the surface element lighting information.

[0070] The illumination probe deployment parameters can be understood as the rules and values ​​that guide how to arrange illumination probes in three-dimensional space. These parameters are determined based on the information of the moving area and include at least the probe's coverage area, density, and distribution shape.

[0071] A lighting probe can be understood as a pre-set data point in a 3D scene space, used to store the spherical harmonic lighting information of its surrounding environment, and to connect the lighting data between the static baked scene and the dynamic rendering object.

[0072] Lighting baking data can be understood as a collection of global lighting data used for real-time rendering. It mainly includes lighting probes deployed in the scene to be baked and the spherical harmonic lighting data they store.

[0073] In one specific embodiment provided in this application, in conjunction with the above description, lighting probes are deployed at corresponding locations in the scene to be baked. Then, each lighting probe collects the lighting information stored on the surrounding surface elements and encodes it into a format suitable for real-time rendering, such as spherical harmonic coefficients, to obtain the lighting baking data of the scene to be baked.

[0074] Specifically, in one embodiment provided in this application, deploying a light probe in the scene to be baked according to the light probe deployment parameters and the voxel structure includes: Scan the voxel structure in the scene to be baked to determine the spatial deployment position of each light probe; Based on the spatial deployment location of each light probe and the deployment parameters of the light probe, light probes are deployed in the scene to be baked.

[0075] The spatial deployment location can be understood as the specific coordinates determined for placing each lighting probe in the three-dimensional scene space.

[0076] In one specific embodiment provided in this application, all voxel meshes containing face elements are identified. Then, with the voxel as the core, the position of the probe is calculated by expanding outward by a certain distance, automatically avoiding large blank areas, thereby ensuring that the activity space of the target object to be rendered in the scene to be baked is covered by the probes. According to the spatial deployment position and lighting probe deployment parameters of each lighting probe, lighting probes are deployed in the scene to be baked; for example, probes with higher density parameters are deployed near the location of the target object to be rendered.

[0077] Based on the above-described content of this application, by deploying probes in the area of ​​the target object to be rendered and in the area including the static object to be baked, the total number of probes is reduced, thereby reducing the final lighting baking data file size and runtime memory usage. This, in turn, speeds up the process of acquiring surface lighting information and shortens the baking time.

[0078] Furthermore, based on the above, the voxel structure in the scene to be baked is scanned to determine the spatial deployment positions of each illumination probe, including: Scan the voxel structure in the scene to be baked to obtain the structure voxel block corresponding to the voxel structure; Based on preset voxel block expansion parameters, the structure voxel block is expanded to obtain the spatial deployment positions of each illumination probe.

[0079] Here, a structural voxel block can be understood as a continuous 3D spatial region occupied by solid facets, identified and aggregated after scanning the voxel structure of the entire scene. It is a continuous block or point cloud-like set composed of one or more voxels representing static objects to be baked, such as the voxelized outlines or bounding volumes of all static objects to be baked in the scene to be baked. Preset voxel block expansion parameters can be understood as pre-defined values ​​or rules used to control the outward expansion range from the structural voxel block. For example, this parameter is the expansion distance, defined as the range that the probe needs to cover outside the outline of the static objects to be baked to effectively cover all objects in the scene to be baked (e.g., static objects to be baked and target objects to be rendered).

[0080] In one specific embodiment provided in this application, the entire voxel structure is traversed, and spatial clustering is performed to aggregate all adjacent voxels representing entities together, forming one or more connected structural voxel blocks. This effectively extracts the precise 3D spatial occupancy of all static objects to be baked from the scene to be baked. Each obtained structural voxel block is treated as a whole and 3D expanded according to preset voxel block expansion parameters. For example, it is expanded outward by 5 meters. This results in a new 3D spatial volume that is larger than the original structural voxel block. The spatial deployment positions of each lighting probe are then obtained.

[0081] Based on the aforementioned content of this application, the complexity of spatial analysis is simplified by using voxel blocks. The deployment range of probes is planned based on the obtained voxel blocks to ensure the probe coverage matches the scene to be baked, avoiding unforeseen coverage gaps. The voxel blocks are expanded according to preset voxel block expansion parameters to determine their final positions, thereby automatically and precisely generating probes only where needed. By adjusting the preset voxel block expansion parameters, seam problems that occur when calculating lighting information between static objects to be baked are avoided, thus achieving a stable global lighting effect for baking.

[0082] In one specific embodiment provided in this application, illumination baking data of the scene to be baked is generated based on the illumination probe and the surface element illumination information, including: Identify the light probe to be processed, wherein the light probe to be processed is any light probe deployed in the scene to be baked; Obtain the spatial position of the light probe to be processed; Based on the spatial position of the illumination probe to be processed, at least one surface element illumination information corresponding to the illumination probe to be processed is determined, and at least one surface element illumination information is stored based on the illumination probe to be processed. Based on the illumination information of each surface element stored in each illumination probe to be processed, illumination baking data of the scene to be baked is generated.

[0083] Here, the lighting probe to be processed can be understood as any lighting probe currently collecting data and deployed in the scene during the lighting baking data generation process. Data filling for all probes is completed by traversing each deployed probe. Spatial location can be understood as the coordinates of the lighting probe to be processed in the 3D scene space.

[0084] In one specific embodiment provided in this application, all lighting probes deployed in the scene to be baked are traversed. From all the lighting probe sets, one is selected sequentially as the current data acquisition and storage target. The three-dimensional coordinates of the current lighting probe to be processed in world space are read. Centered on the spatial position of the lighting probe to be processed, a spatial query is performed according to a preset influence radius or volume to find all facets located within that volume, and the calculated facet lighting information on these facets is read. The discrete facet lighting information is converted into coefficients of spherical harmonic functions, and these coefficients are stored on the lighting probe to be processed. After each probe in the scene to be baked has completed the above data storage, the spatial positions and spherical harmonic coefficients of all lighting probes are used as the lighting baking data of the scene to be baked.

[0085] In one specific embodiment provided in this application, after a light probe is deployed in the scene to be baked, in order to reflect different environments in the same scene to be baked, the light baking data of the scene to be baked can also be generated in the following manner, including: Divide the scene to be baked into at least one sub-baking scene; Set the environmental parameters corresponding to the sub-baking scene to be processed, wherein the sub-baking scene to be processed is any one of at least one sub-baking scene; Based on the environmental parameters, the illumination baking data for the sub-baking scene to be processed is generated.

[0086] Based on the above-described content of this application, the scene to be baked is divided into at least one sub-baking scene, and environmental parameters are set for each sub-baking scene. This allows the environment of the sub-baking scene to be dynamically displayed based on the environmental parameters of the sub-baking scene in which the target rendering object is located, when the target rendering object is located in different sub-baking scenes. This achieves the goal of different sub-baking scenes exhibiting different environments within the same scene to be baked.

[0087] In one specific embodiment provided in this application, after generating the light baking data of the scene to be baked, in order to reduce storage space, the light probe can be used to compress the light baking data of the scene to be baked, and the compressed light baking data of the scene to be baked can be stored.

[0088] According to the above-mentioned content of this application, the illumination data of the surface element is compressed into a continuous representation composed of the spherical harmonic coefficients of the probe, and then compressed and stored to obtain the compressed illumination baking data of each sub-baking scene to be processed, thereby reducing the storage space by compressing the illumination data of each sub-scene to be processed.

[0089] Based on the aforementioned content of this application, by determining the voxel structure of the scene to be baked, the geometric model is normalized into a regular voxel mesh, avoiding the difficulty in unified management caused by the complexity and diversity of scene models and the slow baking speed. The surface lighting information is obtained based on the voxel structure, avoiding the computational time consumption caused by multiple bounces of lighting. The probe deployment parameters are determined based on the movement area information of the target object to be rendered, thereby supporting dynamic objects during the lighting baking process. Furthermore, determining the probe deployment parameters based on the movement area information ensures efficient resource utilization and avoids unnecessary data storage and computation.

[0090] In one specific embodiment provided in this application, after storing the compressed lighting baking data of the scene to be baked, lighting rendering is performed on the target object to be rendered, including: Obtain the instruction to be rendered; Based on the rendering instruction, a sub-baking scene containing the target object to be rendered is determined in the scene to be baked, and the sub-baking scene is determined as the target rendering scene; In the lighting baking data, the lighting baking data corresponding to the target rendering scene is decompressed, and the target object to be rendered is then subjected to lighting rendering.

[0091] The "to be rendered" instruction can be understood as a request issued at runtime. It is a trigger signal used to initiate real-time rendering of sub-scenes within the scene to be baked. The target rendering scene can be understood as the portion of the scene to be baked that needs to be drawn to the screen in the current frame; it is a subset of the complete scene to be baked. This scene contains the target object to be rendered.

[0092] In one specific embodiment provided in this application, the lighting baking data of the scene to be baked, which has been compressed and stored, is dynamically decompressed. For example, the rendering instruction is obtained, and the camera parameters of the current frame (e.g., position, orientation, field of view) are determined based on the rendering instruction to identify visible objects (including static objects and dynamic target objects to be rendered), thereby defining the spatial range of the target rendering scene that needs to be processed. The world space position of each pixel on the object is obtained. Based on the position, the corresponding lighting baking data is queried, and the lighting probes around it are located. Using the trilinear sampling function of the hardware, the spherical harmonics of the lighting are obtained from the 3D texture storing the probe data in one go. Finally, in the shader, these spherical harmonics are calculated in real time in combination with the normal information of the pixel to obtain the final color value containing the baked global illumination, and output to the screen.

[0093] In one specific embodiment provided in this application, lighting rendering of the target object to be rendered includes: Obtain the object position of the target object to be rendered, and obtain a preset index table, wherein the preset index table is used to store the spatial positions of each light probe deployed in the scene to be baked; Based on the object position of the target object to be rendered, at least one spatial position corresponding to the object position is determined in the preset index table, and at least one target lighting probe is determined. Obtain the surface element illumination information stored in each target illumination probe; The target object to be rendered is rendered using the surface element lighting information stored in each target lighting probe.

[0094] Here, object position can be understood as the world space coordinates of the target object to be rendered (a dynamic object) in the current frame. The preset index table can be understood as a pre-calculated data structure used to establish the correspondence between spatial positions and light probes. It stores the spatial position information of all light probes in the entire scene to be baked. Target light probes can be understood as light probes located around the target object's position, found by querying the preset index table.

[0095] In one specific embodiment provided in this application, the object position of the target object to be rendered is obtained, and a preset index table is acquired. Based on the object position, a search is performed in the preset index table. The probe mesh cell where the object position is located or the nearest neighbor is found, thereby accurately locating the target lighting probe affecting the target object to be rendered. The spherical harmonic coefficients of the target lighting probe are read, and the acquired spherical harmonic coefficients are passed to the shader. Combined with the pixel normal, a series of dot product operations are performed to calculate the final diffuse lighting color in real time, and then applied to the surface of the target object to be rendered.

[0096] In one specific embodiment provided in this application, lighting rendering is performed on the target object to be rendered based on the surface element lighting information stored in each target lighting probe, including: Obtain spotlight illumination information, wherein the spotlight illumination information includes first spotlight illumination information and second spotlight illumination information, and the spotlight illumination information is determined based on direct illumination information in the target rendering scene; Based on the illumination information of the first spotlight and the surface element illumination information stored in each target illumination probe, the first face of the target object to be rendered is illuminated. Based on the lighting information of the second spotlight and the surface lighting information stored in each target lighting probe, the second face of the target object to be rendered is rendered, wherein the first face of the target object to be rendered is different from the second face of the target object to be rendered.

[0097] Among them, the spotlight illumination information can be understood as illumination information that is consistent with the direct illumination direction stored in the surface element.

[0098] In one specific embodiment provided in this application, at least one lighting probe is determined based on a preset index table, positioned at the location of the target object to be rendered. Global illumination of the target object is obtained based on the surface lighting information stored in the at least one lighting probe. Furthermore, lighting information from a first spotlight is superimposed on the first surface of the target object, making the lighting on the first surface more closely resemble the actual scene. Similarly, lighting information from a second spotlight is superimposed on the second surface of the target object, making the lighting on the second surface more closely resemble the actual scene. This results in a high level of lighting quality for the target object in the scene to be rendered.

[0099] Building upon the above, to further enhance the realism of the rendered scene, this application also allows for the control of clouds through an art brush, using brush strokes to paint the clouds. The clouds can be freely painted into desired shapes, and the rendering is based on the data from the art brush.

[0100] Furthermore, to improve the rendering realism and efficiency of the target object during the rendering process, this application, for example, determines the lighting intensity of the point light source by reading the indirect lighting intensity of the facets at the target location using a lighting probe. The lighting direction of the spotlight is determined using the direct lighting information of the facets, and the deployment position of the spotlight is determined based on the deployment position of the facets. In addition, the lighting intensity of the decals in the facets is set based on the reflectivity of the facets, and the color and brightness of the decals are determined by combining this with the lighting color of the facets in the area where the decals are located. Based on this, the point light source, spotlight, and decals are rendered using a unified cluster management method, improving rendering efficiency.

[0101] To facilitate understanding, the lighting data processing method provided in this application is used as an example to illustrate the application of baking and rendering game scenes.

[0102] The scene to be baked is defined, including at least one static object to be baked and at least one dynamic target object to be rendered. All static objects to be baked in the scene are voxelized to obtain their corresponding voxel structures. Voxelization of the scene accelerates the baking process and also unifies the management of various static objects, reducing errors caused by inconsistent materials during baking. Furthermore, to avoid losing details of the static objects during voxelization, facets are used to store the surface properties of the voxel structure, including the facet's front and back faces and the virtual normal direction. Based on the facet's front and back faces and the virtual normal direction, the internal and external structures of the voxel structure are determined. Additionally, by storing the normal direction, the facets ensure accurate simulation of the lighting conditions of static objects during the lighting baking process.

[0103] In order to support multiple bounces and reduce baking time, the finite element method is used to cache the lighting information of each reference surface element that generates indirect lighting for the surface element to be processed in the baking scene. During the calculation, the cached lighting information of each reference surface element is used to perform lighting calculation, thereby simulating the result of multiple lighting bounces.

[0104] Furthermore, to ensure that movable objects to be rendered (such as characters, vehicles, flags, etc.) can also enjoy baked lighting and shadows, a spatial probe is used as the storage medium for the baking results. First- to third-order spherical harmonic lighting data are stored in the spatial probe, and additionally, a 3D texture is used for storage, providing some spatial redundancy so that nearby objects can also enjoy the lighting and shadows.

[0105] For example, spatial probes are deployed in the space of the scene to be baked. These spatial probes serve as the storage carriers for the baking results, containing spherical harmonic lighting data. The deployment of these spatial probes can be understood as follows: The voxel structures in the scene to be baked are scanned to obtain the corresponding structural voxel blocks. Based on preset voxel block expansion parameters, the structural voxel blocks are expanded to obtain the spatial deployment positions of each lighting probe. Based on the spatial deployment positions and parameters of each lighting probe, the lighting probes are deployed in the scene to be baked. During this process, because the spherical harmonic lighting data contains 3D textures, the hardware's trilinear sampling and the redundant and interleaved characteristics between the spatial probes obtained after expanding the structural voxel blocks are directly utilized to obtain seamless, filter-free spherical harmonic lighting data using a single trilinear sampling. The spherical harmonic lighting data is then processed through the normal information of the current static object to be baked to obtain the corresponding spherical harmonic lighting effect. Based on the above operations, the lighting baking data for the scene to be baked is generated.

[0106] During the rendering process, dynamic decompression is performed during the actual lighting rendering. For example, the rendering command is obtained, and the camera parameters of the current frame (such as position, orientation, and field of view) are determined based on the rendering command to identify visible objects (including static objects and dynamic target objects to be rendered), thereby defining the spatial range of the target rendering scene that needs to be processed. The world space position of each pixel on the object is obtained. Based on this position, the corresponding lighting baking data is queried, and the surrounding lighting probes are located. Using the hardware's trilinear sampling function, the spherical harmonics of the lighting are obtained from the 3D texture storing the probe data in one go. Finally, in the shader, these spherical harmonics are calculated in real time in conjunction with the normal information of the pixel to obtain the final color value containing the baked global illumination, which is then output to the screen.

[0107] For example, during the rendering of a target object, the object's position is obtained, and a preset index table is retrieved. Based on the object's position, a search is performed in the preset index table to find the nearest or the location of the probe mesh cell, thus accurately locating the target lighting probe that affects the target object. The spherical harmonic coefficients of the target lighting probe are then read and passed to the shader. Combined with the pixel normals, a series of dot product operations are used to calculate the final diffuse lighting color in real time, which is then applied to the surface of the target object.

[0108] Based on the lighting data processing method, the scene to be baked is converted into a regular mesh through voxelization, simplifying the complexity of ray tracing. Surface lighting information is calculated based on normal orientation, avoiding complex indirect lighting calculations for invalid surfaces such as back faces, reducing unnecessary overhead. Furthermore, spatial probes are deployed only in necessary areas, directly reducing the number of spatial probes that need to be filled with data. Lighting information is collected from surfaces and stored on spatial probes in space, allowing dynamic objects to obtain surrounding lighting information based on their world space position at runtime. This allows dynamic objects in the game to seamlessly integrate into the lighting environment of static scenes, enhancing the immersive experience. Surface lighting information is determined based on surfaces and virtual normals, resulting in stable effects and supporting multiple lighting bounces during baking. Based on the rendering instructions, the target rendering scene containing the target object to be rendered is determined within the scene to be baked, achieving dynamic decompression, reducing performance overhead, and minimizing file size.

[0109] Corresponding to the above method embodiments, this application also provides embodiments of a light illumination data processing apparatus. Figure 2 A schematic diagram of a light data processing apparatus according to an embodiment of this application is shown. Figure 2 As shown, the device includes: The determining unit 202 is configured to determine the scene to be baked and determine the voxel structure of the scene to be baked, wherein the scene to be baked includes a target object to be rendered.

[0110] The acquisition unit 204 is configured to acquire the surface illumination information of the scene to be baked based on the voxel structure.

[0111] Deployment unit 206 is configured to determine the movement area information of the target object to be rendered in the scene to be baked, and to determine the lighting probe deployment parameters based on the movement area information.

[0112] The processing unit 208 is configured to deploy a light probe in the scene to be baked according to the light probe deployment parameters and the voxel structure, and generate light baking data of the scene to be baked based on the light probe and the surface element lighting information.

[0113] Furthermore, the scene to be baked includes at least one static object to be baked; the determining unit 202 is also configured to: Each static object to be baked is voxelized to obtain at least one voxel mesh corresponding to the scene to be baked. The surface properties of each voxel mesh are stored in the corresponding face element to obtain the voxel structure of the scene to be baked.

[0114] Furthermore, the surface properties include the virtual normal direction; the acquisition unit 204 is also configured to: In the scene to be baked, a face element to be processed is determined, wherein the face element to be processed is the face element corresponding to any voxel mesh in each voxel mesh; Determine the virtual normal direction corresponding to the surface element to be processed; Based on the virtual normal direction, determine the surface illumination information of the surface element to be processed; Based on the surface illumination information of each surface element to be processed, the surface illumination information of the scene to be baked is determined.

[0115] Furthermore, the virtual normal direction includes a first normal orientation and / or a second normal orientation; the acquisition unit 204 is also configured to: When the virtual normal direction is the first normal orientation, the reference surface lighting information of at least one reference surface element is obtained, and the first surface lighting information of the surface element to be processed is determined based on the lighting information of each reference surface element, wherein there is indirect lighting between at least one reference surface element and the surface element to be processed. When the virtual normal direction is the direction of the second normal, the second surface element lighting information of the surface element to be processed is determined; Based on the first surface element illumination information and / or the second surface element illumination information, determine the surface element illumination information of the surface element to be processed.

[0116] Furthermore, the surface properties also include the illumination parameters of the static object to be baked; the acquisition unit 204 is further configured to: When the virtual normal direction is the first normal orientation, at least one reference surface element is determined to have indirect lighting on the surface element to be processed; Determine the reference lighting parameters for the static object to be baked corresponding to each reference element; Based on each reference illumination parameter, the reference surface element illumination information of each reference surface element for the surface element to be processed is determined.

[0117] Furthermore, the acquisition unit 204 is also configured as follows: Determine the target lighting parameters of the static object to be baked corresponding to the surface element to be processed; Based on the target illumination parameters, calculate the direct illumination information of the surface element to be processed; Based on the direct illumination information of the surface element to be processed and the reference surface element illumination information of each reference surface element on the surface element to be processed, the first surface element illumination information of the surface element to be processed is generated.

[0118] Furthermore, deployment unit 206 is also configured as follows: Scan the voxel structure in the scene to be baked to determine the spatial deployment position of each light probe; Based on the spatial deployment location of each light probe and the deployment parameters of the light probe, light probes are deployed in the scene to be baked.

[0119] Furthermore, deployment unit 206 is also configured as follows: Scan the voxel structure in the scene to be baked to obtain the structure voxel block corresponding to the voxel structure; Based on preset voxel block expansion parameters, the structure voxel block is expanded to obtain the spatial deployment positions of each illumination probe.

[0120] Furthermore, the processing unit 208 is also configured as follows: Identify the light probe to be processed, wherein the light probe to be processed is any light probe deployed in the scene to be baked; Obtain the spatial position of the light probe to be processed; Based on the spatial position of the illumination probe to be processed, at least one surface element illumination information corresponding to the illumination probe to be processed is determined, and at least one surface element illumination information is stored based on the illumination probe to be processed. Based on the illumination information of each surface element stored in each illumination probe to be processed, illumination baking data of the scene to be baked is generated.

[0121] Furthermore, the processing unit 208 is also configured as follows: Divide the scene to be baked into at least one sub-baking scene; Set the environmental parameters corresponding to the sub-baking scene to be processed, wherein the sub-baking scene to be processed is any one of at least one sub-baking scene; Based on the environmental parameters, the illumination baking data for the sub-baking scene to be processed is generated.

[0122] Furthermore, the processing unit 208 is further configured as follows: Based on the light probe, the light baking data of the scene to be baked is compressed, and the compressed light baking data of the scene to be baked is stored.

[0123] Furthermore, the processing unit 208 is further configured as follows: Obtain the instruction to be rendered; Based on the rendering instruction, a sub-baking scene containing the target object to be rendered is determined in the scene to be baked, and the sub-baking scene is determined as the target rendering scene; In the lighting baking data, the lighting baking data corresponding to the target rendering scene is decompressed, and the target object to be rendered is then subjected to lighting rendering.

[0124] Furthermore, the processing unit 208 is also configured as follows: Obtain the object position of the target object to be rendered, and obtain a preset index table, wherein the preset index table is used to store the spatial positions of each light probe deployed in the scene to be baked; Based on the object position of the target object to be rendered, at least one spatial position corresponding to the object position is determined in the preset index table, and at least one target lighting probe is determined. Obtain the surface element illumination information stored in each target illumination probe; The target object to be rendered is rendered using the surface element lighting information stored in each target lighting probe.

[0125] Furthermore, the processing unit 208 is also configured as follows: Obtain spotlight illumination information, wherein the spotlight illumination information includes first spotlight illumination information and second spotlight illumination information, and the spotlight illumination information is determined based on direct illumination information in the target rendering scene; Based on the illumination information of the first spotlight and the surface element illumination information stored in each target illumination probe, the first face of the target object to be rendered is illuminated. Based on the lighting information of the second spotlight and the surface lighting information stored in each target lighting probe, the second face of the target object to be rendered is rendered, wherein the first face of the target object to be rendered is different from the second face of the target object to be rendered.

[0126] The above is a schematic scheme of a light illumination data processing device according to this embodiment. It should be noted that the technical solution of this light illumination data processing device and the technical solution of the light illumination data processing method described above belong to the same concept. For details not described in detail in the technical solution of the light illumination data processing device, please refer to the description of the technical solution of the light illumination data processing method described above.

[0127] Figure 3 A structural block diagram of a computing device according to an embodiment of this application is shown. The components of the computing device 300 include, but are not limited to, a memory 310 and a processor 320. The processor 320 is connected to the memory 310 via a bus 330, and a database 350 is used to store data.

[0128] The computing device 300 also includes an access device 340, which enables the computing device 300 to communicate via one or more networks 360. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 340 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0129] In one embodiment of this application, the aforementioned components of the computing device 300 and Figure 3 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 3The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this application. Those skilled in the art can add or replace other components as needed.

[0130] The computing device 300 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 300 can also be a mobile or stationary server.

[0131] The processor 320 is used to execute the following computer program or instructions, which, when executed by the processor, implement the steps of the above-described illumination data processing method.

[0132] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the above-described illumination data processing method belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the above-described illumination data processing method.

[0133] An embodiment of this specification also provides a computer-readable storage medium storing a computer program or instructions that, when executed by a processor, implement the steps of the above-described illumination data processing method.

[0134] The above is an illustrative embodiment of a computer-readable storage medium. It should be noted that the technical solution of this storage medium belongs to the same concept as the technical solution of the aforementioned light illumination data processing method. Details not described in detail in the technical solution of the storage medium can be found in the description of the technical solution of the aforementioned light illumination data processing method.

[0135] An embodiment of this specification also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described illumination data processing method.

[0136] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the above-described illumination data processing method belong to the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the above-described illumination data processing method.

[0137] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0138] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.

[0139] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0140] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0141] The preferred embodiments disclosed above are merely illustrative of this application. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this application. These embodiments are selected and specifically described in this application to better explain the principles and practical applications of this application, thereby enabling those skilled in the art to better understand and utilize this application. This application is limited only by the claims and their full scope and equivalents.

Claims

1. A method for processing illumination data, characterized in that, include: Determine the scene to be baked, wherein the scene to be baked includes a target object to be rendered and at least one static object to be baked; Each static object to be baked is voxelized to obtain at least one voxel mesh corresponding to the scene to be baked; the surface properties of each voxel mesh are stored in the corresponding face element to obtain the voxel structure of the scene to be baked, wherein the surface properties include virtual normal direction; In the scene to be baked, a face element to be processed is determined, wherein the face element to be processed is a face element corresponding to any voxel mesh in each voxel mesh; the virtual normal direction corresponding to the face element to be processed is determined; based on the virtual normal direction, the face element lighting information of the face element to be processed is determined; based on the face element lighting information of each face element to be processed, the face element lighting information of the scene to be baked is determined. Determine the movement area information of the target object to be rendered in the scene to be baked, and determine the lighting probe deployment parameters based on the movement area information; Scan the voxel structure in the scene to be baked to obtain the structural voxel block corresponding to the voxel structure; expand the structural voxel block based on the preset voxel block expansion parameters to obtain the spatial deployment position of each light probe; deploy the light probe in the scene to be baked based on the spatial deployment position of each light probe and the light probe deployment parameters. Based on the light probe and the surface element lighting information, the light baking data of the scene to be baked is generated.

2. The method as described in claim 1, characterized in that, The virtual normal direction includes a first normal orientation and / or a second normal orientation; Based on the virtual normal direction, the surface illumination information of the surface element to be processed is determined, including: When the virtual normal direction is the first normal orientation, the reference surface lighting information of at least one reference surface element is obtained, and the first surface lighting information of the surface element to be processed is determined based on the lighting information of each reference surface element, wherein there is indirect lighting between at least one reference surface element and the surface element to be processed. When the virtual normal direction is the direction of the second normal, the second surface element lighting information of the surface element to be processed is determined; Based on the first surface element illumination information and / or the second surface element illumination information, determine the surface element illumination information of the surface element to be processed.

3. The method as described in claim 2, characterized in that, The surface properties also include the illumination parameters of the static object to be baked; When the virtual normal direction is the first normal orientation, the reference surface element illumination information of at least one reference surface element is obtained, including: When the virtual normal direction is the first normal orientation, at least one reference surface element is determined to have indirect lighting on the surface element to be processed; Determine the reference lighting parameters for the static object to be baked corresponding to each reference element; Based on each reference illumination parameter, the reference surface element illumination information of each reference surface element for the surface element to be processed is determined.

4. The method as described in claim 3, characterized in that, Based on the illumination information of each reference surface element, the first surface element illumination information of the surface element to be processed is determined, including: Determine the target lighting parameters of the static object to be baked corresponding to the surface element to be processed; Based on the target illumination parameters, calculate the direct illumination information of the surface element to be processed; Based on the direct illumination information of the surface element to be processed and the reference surface element illumination information of each reference surface element on the surface element to be processed, the first surface element illumination information of the surface element to be processed is generated.

5. The method as described in claim 1, characterized in that, Based on the illumination probe and the surface element illumination information, illumination baking data for the scene to be baked is generated, including: Identify the light probe to be processed, wherein the light probe to be processed is any light probe deployed in the scene to be baked; Obtain the spatial position of the light probe to be processed; Based on the spatial position of the illumination probe to be processed, at least one surface element illumination information corresponding to the illumination probe to be processed is determined, and at least one surface element illumination information is stored based on the illumination probe to be processed. Based on the illumination information of each surface element stored in each illumination probe to be processed, illumination baking data of the scene to be baked is generated.

6. The method according to any one of claims 1 to 5, characterized in that, Generating the illumination baking data for the scene to be baked includes: Divide the scene to be baked into at least one sub-baking scene; Set the environmental parameters corresponding to the sub-baking scene to be processed, wherein the sub-baking scene to be processed is any one of at least one sub-baking scene; Based on the environmental parameters, the illumination baking data for the sub-baking scene to be processed is generated.

7. The method as described in claim 6, characterized in that, The method further includes: Based on the light probe, the light baking data of the scene to be baked is compressed, and the compressed light baking data of the scene to be baked is stored.

8. The method as described in claim 7, characterized in that, After storing the compressed lighting baking data of the scene to be baked, the method further includes: Obtain the instruction to be rendered; Based on the rendering instruction, a sub-baking scene containing the target object to be rendered is determined in the scene to be baked, and the sub-baking scene is determined as the target rendering scene; In the lighting baking data, the lighting baking data corresponding to the target rendering scene is decompressed, and the target object to be rendered is then subjected to lighting rendering.

9. The method as described in claim 8, characterized in that, Performing lighting rendering on the target object to be rendered includes: Obtain the object position of the target object to be rendered, and obtain a preset index table, wherein the preset index table is used to store the spatial positions of each light probe deployed in the scene to be baked; Based on the object position of the target object to be rendered, at least one spatial position corresponding to the object position is determined in the preset index table, and at least one target lighting probe is determined. Obtain the surface element illumination information stored in each target illumination probe; The target object to be rendered is rendered using the surface element lighting information stored in each target lighting probe.

10. The method as described in claim 9, characterized in that, Based on the surface element lighting information stored in each target lighting probe, the target object to be rendered is subjected to lighting rendering, including: Obtain spotlight illumination information, wherein the spotlight illumination information includes first spotlight illumination information and second spotlight illumination information, and the spotlight illumination information is determined based on direct illumination information in the target rendering scene; Based on the illumination information of the first spotlight and the surface element illumination information stored in each target illumination probe, the first face of the target object to be rendered is illuminated. Based on the lighting information of the second spotlight and the surface lighting information stored in each target lighting probe, the second face of the target object to be rendered is rendered, wherein the first face of the target object to be rendered is different from the second face of the target object to be rendered.

11. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer programs or instructions, and the processor is used to execute the computer programs or instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 10.

12. A computer-readable storage medium storing 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 method according to any one of claims 1 to 10.

13. 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 method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Image rendering method and device

    CN117218273A

  • Global illumination rendering method

    CN117745926A