Global illumination baking method and device, electronic equipment and storage medium

By using adaptive probe density control based on object geometry features to generate density maps for global illumination baking, the problem of insufficient illumination accuracy and resource waste caused by unreasonable probe distribution is solved, thereby improving the illumination effect and baking efficiency.

CN121982188APending Publication Date: 2026-05-05GUANGZHOU BOGUAN TELECOMM TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU BOGUAN TELECOMM TECH LTD
Filing Date
2025-12-18
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

The current global illumination baking technology has an unreasonable probe density distribution, which leads to insufficient illumination accuracy or waste of computing resources, making it difficult to find a balance between efficiency and quality.

Method used

By acquiring the geometric information of the target object, multiple density levels are determined based on the object's geometric features. A three-dimensional mesh is generated and the mesh cells are traversed to determine the corresponding density level. A density map is then generated and global illumination baking is performed.

Benefits of technology

It enhances the richness of lighting effects, reduces computational overhead and storage usage, and solves the problem of balancing the efficiency and quality of light-based baking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121982188A_ABST
    Figure CN121982188A_ABST
Patent Text Reader

Abstract

The invention provides a global illumination baking method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring geometric information of a target object in a scene to be baked; determining a plurality of density levels of the target object based on the geometric information, wherein each density level corresponds to a different probe density value; generating a three-dimensional grid according to the geometric boundary of the target object; traversing each grid unit in the three-dimensional grid, and determining a corresponding density level based on a spatial relationship between each grid unit and the target object; generating a density map according to the determined density level and the corresponding probe density value; and performing global illumination baking based on the density map. According to the method provided by the invention, the multi-level probe density distribution is automatically determined by analyzing the geometrical characteristics of the object, the limitation of traditional uniform density control is avoided, the level expression of the illumination effect is enriched by a self-adaptive density adjustment mechanism based on the spatial relationship of the object, and the visual richness of a scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of graphics processing technology, and in particular to a global illumination baking method, apparatus, electronic device, and storage medium. Background Technology

[0002] Global illumination, as a crucial rendering technique, significantly enhances the visual realism and immersive experience of game scenes by simulating the propagation and reflection of light in 3D scenes. In related technologies, to achieve global illumination effects for static objects, the entire scene model needs to be baked with lighting information by uniformly distributing probes throughout the scene to record lighting data. Existing solutions typically employ a simple overall density control approach, using a uniform probe density to sample lighting information across the entire map scene; higher probe density results in more detailed lighting information. However, this uniform density distribution method has significant limitations. Either too low a probe density leads to insufficient lighting accuracy in complex areas, or too high a probe density significantly increases baking time and storage overhead. This technical limitation makes setting baking parameters cumbersome for users, requiring repeated adjustments to find a balance between effect and efficiency. Furthermore, the single density control method restricts the diversity of lighting effects, resulting in a lack of visual depth in game scenes. In addition, the large amount of probe data consumes device storage space and increases server resource consumption. Summary of the Invention

[0003] The purpose of this disclosure is to provide a global illumination baking method, apparatus, electronic device, and storage medium to achieve adaptive probe density control based on object geometry features, thereby improving baking efficiency and illumination quality.

[0004] In a first aspect, this disclosure provides a global illumination baking method, including: acquiring geometric information of a target object in a scene to be baked; determining multiple density levels of the target object based on the geometric information, each density level corresponding to a different probe density value; generating a three-dimensional mesh based on the geometric boundary of the target object; traversing each mesh cell in the three-dimensional mesh and determining the corresponding density level based on the spatial relationship between each mesh cell and the target object; generating a density map based on the determined density level and the corresponding probe density value; and performing global illumination baking based on the density map.

[0005] Secondly, this disclosure provides a global illumination baking apparatus, comprising: an information acquisition module for acquiring geometric information of a target object in a scene to be baked; a density determination module for determining multiple density levels of the target object based on the geometric information, each density level corresponding to a different probe density value; a mesh generation module for generating a three-dimensional mesh based on the geometric boundaries of the target object; a density calculation module for traversing each mesh cell in the three-dimensional mesh and determining the corresponding density level based on the spatial relationship between each mesh cell and the target object; a texture generation module for generating a density texture based on the determined density levels and the corresponding probe density values; and a baking module for performing global illumination baking based on the density texture.

[0006] Thirdly, this disclosure provides an electronic device including a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to perform the steps in the above-described global illumination baking method.

[0007] Fourthly, this disclosure provides a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the aforementioned global illumination baking method.

[0008] This disclosure provides a global illumination baking method, apparatus, electronic device, and storage medium. The method acquires the geometric information of a target object in a scene to be baked; determines multiple density levels of the target object based on the geometric information, each density level corresponding to a different probe density value; generates a three-dimensional mesh based on the geometric boundaries of the target object; traverses each mesh cell in the three-dimensional mesh, determining the corresponding density level based on the spatial relationship between each mesh cell and the target object; generates a density map based on the determined density levels and corresponding probe density values; and performs global illumination baking based on the density map. The method provided in this embodiment automatically determines multi-level probe density distribution by analyzing the geometric features of the object, avoiding the limitations of traditional uniform density control. The adaptive density adjustment mechanism based on the spatial relationship of the object enriches the hierarchical representation of the lighting effect, enhances the visual richness of the scene, and effectively reduces unnecessary computational overhead and storage occupation through precise density control and hierarchical baking strategies, solving the technical problem of balancing the efficiency and quality of illumination baking in the field of computer graphics. Attached Figure Description

[0009] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0010] Figure 1 This is a cloud interaction system architecture diagram according to an exemplary embodiment of the present disclosure; Figure 2 This is a schematic diagram of a global illumination baking method provided in an embodiment of the present disclosure; Figure 3 This is a schematic diagram of the structure of a global illumination baking apparatus provided in an embodiment of the present disclosure; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

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

[0012] It should be noted that the information (including but not limited to user input information, such as information entered by the user into input boxes), data (including but not limited to data used for analysis, stored data, and displayed data, such as context code, all code of the current project, the service pressure corresponding to operations performed on all code of the current project, and the code development status of the current project), and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with relevant laws, regulations, and standards. For example, the context code, operations performed on all code of the current project, the corresponding service pressure, and the code development status involved in this application were all obtained with full authorization.

[0013] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of the invention described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0014] It should also be noted that the various trigger events disclosed in this manual can be preset, and different trigger events can trigger the execution of different functions.

[0015] A global illumination baking method in one embodiment of this disclosure can run on a terminal device or a server. The terminal device can be a local terminal device. When the global illumination baking method runs on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and client devices. Figure 1 The figure shows a cloud interaction system architecture diagram provided in this disclosure. As shown, the cloud interaction system may include: a client device 10 and a server 20, wherein the client device 10 can be connected to the server 20 via a network 30.

[0016] The global illumination baking method in one embodiment of this disclosure can run on a terminal device or a server. The terminal device can be a local terminal device, such as a touch device or a non-touch device. When the global illumination baking method runs on a server, the method can be implemented and executed based on a cloud interaction system, which includes a server and client devices.

[0017] In an optional implementation, cloud gaming can run within the cloud interaction system. Cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operation mode, the game program and the game screen presentation are separated. The storage and execution of the global illumination baking method are completed on the cloud gaming server. The client device is used for data reception, transmission, and game screen presentation. For example, the client device can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, or PDA; however, the terminal device for information processing is the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses the game interface and other data, returns it to the client device via the network, and finally, the client device decodes and outputs the game interface.

[0018] In an optional implementation, the terminal device can be a local terminal device that stores the game program and is used to present the game interface. The local terminal device is used to interact with the player through the game interface; that is, it typically downloads, installs, and runs the game program via an electronic device. The local terminal device can provide the game interface to the player in various ways, such as rendering it on a terminal's display screen or providing it to the player via holographic projection. For example, the local terminal device can include a display screen and a processor. The display screen is used to present the game interface, which includes game scene visuals, and the processor is used to run the game, generate the game interface, and control the display of the game interface on the display screen.

[0019] This embodiment provides a global illumination baking method. Figure 2 This is a flowchart of a global illumination baking method according to an embodiment of the present disclosure, such as... Figure 2 As shown, the process includes the following steps: Step S210: Obtain the geometric information of the target object in the scene to be baked; Step S220: Determine multiple density levels of the target object based on geometric information, with each density level corresponding to a different probe density value; Step S230: Generate a 3D mesh based on the geometric boundaries of the target object; Step S240: Traverse each grid cell in the 3D mesh and determine the corresponding density level based on the spatial relationship between each grid cell and the target object; Step S250: Generate a density map based on the determined density level and the corresponding probe density value; Step S260: Perform global illumination baking based on density map.

[0020] The method provided in this embodiment effectively solves the technical problem of unreasonable probe distribution in traditional global illumination baking. This embodiment employs a hierarchical density control technique based on the geometric information of the target object. By calculating the geometric features of the target object, a multi-level density distribution pattern is established, thereby generating a precise density map to guide probe distribution. This significantly improves the lighting effect of the scene and effectively solves the key problem of low efficiency in large-scale scene illumination baking in the field of computer graphics.

[0021] The steps described above are explained in detail below.

[0022] In step S210, the geometric information of the target object in the scene to be baked is obtained. In application, the basic data for subsequent density level calculations are obtained by analyzing the spatial structure and geometric characteristics of the target object.

[0023] Among them, geometric information can be a multi-dimensional geometric attribute data set containing the spatial structural features of the target object.

[0024] Secondly, geometric information often serves to describe the complexity and space-occupying characteristics of a target object.

[0025] In one optional implementation, the geometric information specifically includes geometric feature parameters across multiple dimensions, such as the number of vertices, faces, volume, surface area, complexity coefficient, and the number of materials. For example, when selecting a building model in a scene, the system will automatically detect that the building has 25,000 vertices, 18,000 faces, a volume of 1,500 cubic units, and a surface area of ​​800 square units, thereby obtaining complete geometric information data.

[0026] In an alternative implementation, geometric information is acquired through a specialized geometric analysis algorithm that can accurately calculate various geometric parameters of the target object. For example, for a castle model in a complex game scene, the algorithm will traverse all its geometric faces, calculate the total number of vertices to 85,000, and calculate the precise surface area value based on the face normals.

[0027] In a specific application, when a user selects a game scene to be processed in the global illumination baking system, the system will automatically scan all target objects in the scene, such as buildings, terrain, and vegetation, and extract the geometric information of each object, including its vertex distribution density, surface complexity, and material coverage, to prepare data for subsequent density level division.

[0028] In step S120, multiple density levels of the target object are determined based on geometric information, with each density level corresponding to a different probe density value.

[0029] Specifically, this step analyzes the complexity of the target object based on the acquired geometric information, establishes a hierarchical density control system, and achieves refined probe density allocation.

[0030] Among them, the density level can be a graded probe density control level based on the geometric complexity of the target object.

[0031] Secondly, density levels typically serve to provide differentiated probe distribution strategies based on the spatial location and geometric features of objects.

[0032] In an optional implementation, the density level is determined using an adaptive hierarchical algorithm based on geometric complexity, which comprehensively considers factors such as vertex density, number of faces, and material complexity. For example, for complex models, the system will automatically set multiple density levels, such as 5 density levels, while for simple geometry, it will set a low number of density levels, such as 2 density levels.

[0033] In one optional implementation, the probe density value for each density level is calculated using a mathematical model that balances the geometric complexity of the object with rendering quality requirements. The system calculates the probe density value for each density level, ensuring that computational overhead is controlled while maintaining rendering quality.

[0034] In step S130, a three-dimensional mesh is generated based on the geometric boundaries of the target object.

[0035] Specifically, this step involves analyzing the spatial boundary information of the target object to construct a regular three-dimensional mesh structure covering the space surrounding the object, providing a spatial division basis for subsequent density allocation.

[0036] Among them, the geometric boundary can be the outermost contour range of the target object in three-dimensional space.

[0037] Secondly, geometric boundaries typically define the spatial extent of the target object and the area where the mesh is generated.

[0038] In an alternative implementation, the geometric boundary is obtained by calculating the axis-aligned bounding box of the target object, which contains the object's minimum and maximum coordinate values. For example, for a complex architectural model, the system calculates the coordinates of the six faces of its bounding box, forming a cubic space that completely surrounds the building, serving as the base area for subsequent mesh generation.

[0039] In one optional implementation, the 3D mesh is generated using a regular voxelization algorithm, which uniformly divides the bounding box space into multiple cubic mesh cells. For example, when the mesh resolution is set to 64×32×64, the system will divide the bounding box space of the target object into 131,072 equally sized cubic cells, each with a unique 3D coordinate index.

[0040] The three-dimensional mesh can be a set of regularized cubic units that cover the spatial region of the target object.

[0041] In an alternative implementation, the size of the mesh cells is dynamically adjusted based on the size of the target object and the required precision, with larger objects using finer meshes. For example, for a large building with a floor area of ​​1000 square meters, the system automatically selects a high-resolution mesh to ensure that each mesh cell accurately reflects local geometric changes.

[0042] In one alternative implementation, the shape characteristics of the target object are considered during the construction of the 3D mesh, and the mesh is adaptively adjusted for irregular objects. For example, when processing terrain models with complex undulating structures, the system increases the mesh density in areas with drastic geometric changes and decreases the mesh density in flat areas, thereby optimizing the allocation of computing resources.

[0043] In step S140, each grid cell in the three-dimensional mesh is traversed, and the corresponding density level is determined based on the spatial relationship between each grid cell and the target object.

[0044] Specifically, this step calculates the spatial distance relationship between the center point of each grid cell and the surface of the target object, and assigns the grid cells to the corresponding density levels according to a preset distance threshold.

[0045] Among them, spatial relationships can be the relative position and distance features between grid cells and target objects.

[0046] In an optional implementation, spatial relationships are calculated using a shortest distance algorithm, which calculates the minimum Euclidean distance from the center point of a grid cell to the surface of a target object. For example, grid cells located inside a building have negative distances to the surface, while grid cells located outside the building have positive distances. The system classifies density levels based on these distance values.

[0047] In one alternative implementation, the density level is determined based on a comparison of multiple distance thresholds, with different distance ranges corresponding to different probe density requirements. For example, when the distance from a grid cell to the object surface is less than 5 units, it is classified as a high-density level; when the distance is between 5 and 20 units, it is classified as a medium-density level; and when the distance is greater than 20 units, it is classified as a low-density level.

[0048] Among them, the density level can be classified into probe density levels based on spatial location characteristics.

[0049] Secondly, density hierarchy often serves to guide the adoption of differentiated probe distribution strategies in different spatial regions.

[0050] In an optional implementation, the density levels are assigned using an adaptive thresholding algorithm that dynamically adjusts the distance threshold based on the geometric complexity of the target object. For example, for detailed models with rich geometric details, the system reduces the distance threshold between levels to ensure that the area near the surface receives a sufficiently high probe density, thereby guaranteeing the accuracy of the lighting effect.

[0051] In an optional implementation, the spatial relationship determination also considers the normal vector relationship between the mesh cells and the object surface, increasing the density level in areas where the object surface changes drastically. For example, at locations with prominent geometric features such as building corners and window sills, the system automatically increases the density level of surrounding mesh cells to ensure accurate lighting calculations for these important feature areas. In this embodiment, a higher density level represents a higher probe density value.

[0052] In a specific application, when the system processes a complex game building, it will traverse and cover all the grid cells of the building one by one, calculate the distance from the center of each cell to the surface of the building, classify cells with negative distances as internal density layers, cells with distances between 0 and 15 units as surface density layers, and cells with distances greater than 15 units as external density layers, ultimately forming a layered density distribution pattern around the building.

[0053] In step S150, a density map is generated based on the determined density level and the corresponding probe density value.

[0054] Specifically, this step converts the density hierarchy information of each grid cell into visualized density map data, providing precise probe distribution guidance for subsequent global illumination baking.

[0055] Density maps can be two-dimensional or three-dimensional data structures that record the density distribution information of probes at various locations in space.

[0056] Secondly, density maps typically serve to provide precise probe distribution guidance for global illumination baking algorithms.

[0057] In an optional implementation, the density map is generated using a voxelization encoding algorithm, which encodes the density information in three-dimensional space into an efficient data format. For example, the system converts a 64×64×64 grid space into a three-dimensional array containing 262,144 density values, each representing the probe density coefficient at a corresponding spatial location, facilitating subsequent rapid querying and processing.

[0058] In an alternative implementation, the probe density values ​​are mapped using a non-linear scaling function that provides a smooth density transition while maintaining hierarchical distinctions. For example, the inner density level corresponds to a density value of 0.9, the surface density level to 0.6, and the outer density level to 0.2. The system applies a gradient function at the hierarchical boundaries to avoid visual artifacts caused by abrupt changes in density values.

[0059] The probe density value can be a numerical parameter that quantifies the number of probes required for a specific spatial location.

[0060] Secondly, the probe density value usually plays a role in controlling the balance between global illumination calculation accuracy and computational overhead.

[0061] In one optional implementation, the probe density value is calculated taking into account the material properties and lighting complexity of the target object, with different material types corresponding to different base density coefficients. For example, for a metallic object with high reflectivity, the system increases the probe density value by 20% in the surrounding area, while maintaining the standard density for diffuse reflective materials to ensure the realism of the lighting effect.

[0062] In an optional implementation, the density map is stored in a compressed format that effectively reduces memory usage while maintaining data accuracy. For example, the system uses an octree compression algorithm to compress the density map, which originally required 8MB of storage space, to 2MB, while ensuring fast decompression and access efficiency during the baking process.

[0063] In a specific application, when the system generates a density map for a game block containing multiple buildings, it marks high-density areas around each building as red, medium-density areas as yellow, and low-density areas as green, forming an intuitive density distribution visualization map to help developers understand probe distribution strategies and make necessary adjustments.

[0064] In step S160, global illumination baking is performed based on the density map.

[0065] Specifically, this step uses the generated density map to guide the probe distribution and calculation strategy of the global illumination algorithm, achieving efficient and high-quality illumination information baking.

[0066] Global illumination baking is a rendering technique that calculates and stores static lighting effects based on scene geometry and light source information.

[0067] Secondly, global illumination baking typically serves to provide pre-computed lighting data for real-time rendering, thereby improving rendering efficiency.

[0068] In one optional implementation, global illumination baking employs a density-map-based hierarchical processing algorithm that adjusts the ray tracing sampling strategy according to different density regions. For example, it uses 1024 rays for fine sampling in high-density regions, 512 rays in medium-density regions, and 256 rays in low-density regions, thereby significantly improving computational efficiency while maintaining quality.

[0069] In an optional implementation, the density mapping is applied using an adaptive probe generation algorithm that dynamically adjusts the spatial distribution of probes based on density values. For example, in high-density areas inside buildings, the system places a lighting probe every 0.5 meters, while in open, low-density areas, the probe spacing is increased to 2 meters, achieving optimized allocation of computing resources.

[0070] Density maps can provide three-dimensional spatial density information data to guide probe distribution and calculation accuracy.

[0071] In an optional implementation, the baking process employs a multi-threaded parallel computing architecture capable of simultaneously handling illumination calculation tasks at different density levels. For example, the system allocates high-density areas to powerful GPU cores for computation and low-density areas to CPU cores for processing, achieving a significant reduction in overall baking time through the rational allocation of hardware resources.

[0072] In one alternative implementation, the quality control of global illumination baking is based on density map accuracy analysis, and the system adjusts the calculation accuracy according to the importance of different areas. For example, the system increases the baking accuracy for game areas where players frequently move, while using relatively lower accuracy for background decoration areas, achieving the best balance between rendering effect and performance.

[0073] In a specific application, when the system performs global illumination baking on a large game scene, it first reads the generated density map, deploys high-density probes in densely built-up urban center areas for fine lighting calculations, and uses low-density probes in open suburban areas for fast processing. The entire baking process is much faster than the traditional uniform distribution method, while ensuring the lighting quality of key areas.

[0074] In a global illumination baking method provided in one embodiment of this application, the geometric information includes at least one of the following: number of vertices, number of faces, volume, surface area, complexity coefficient, and number of materials.

[0075] This implementation method acquires multi-dimensional geometric information of the target object, enabling a more accurate assessment of the object's geometric complexity and rendering requirements. This achieves intelligent density hierarchy division based on object characteristics, enhancing the realism and detail of game scene rendering.

[0076] The number of vertices refers to the number of vertices contained in the mesh model of the target object. The geometric complexity of the object is quantified by counting the total number of vertices in the object's geometric structure.

[0077] The number of faces refers to the number of polygonal faces that make up the surface of a target object. The surface complexity of an object is evaluated by counting the total number of triangular or quadrilateral faces in the object's mesh model.

[0078] Volume refers to the size of the space occupied by a target object in three-dimensional space. The spatial scale of an object is quantified by calculating the spatial capacity inside the geometric boundaries of the object.

[0079] Surface area refers to the total area of ​​all polygonal faces that make up the outer surface of a target object. The surface size of an object is quantified by summing the areas of all polygonal faces on the object's surface.

[0080] Complexity coefficient is a quantitative index that comprehensively considers the geometric characteristics of an object. It is a comprehensive complexity evaluation value obtained by weighted calculation of multiple geometric parameters such as the number of vertices, the number of faces, and the change in surface curvature.

[0081] Material quantity refers to the total number of different material types applied to the surface of a target object. The material complexity is evaluated by counting the number of texture maps, shaders, and material properties used by the object.

[0082] The number of materials can be calculated by parsing the material binding information of a target object and totaling the number of all unique material resources associated with that object. Different materials have different optical properties, and the more types of materials there are, the more complex the lighting interactions. Objects with a large number of materials require a more refined probe distribution to accurately simulate the lighting transition effects between different materials.

[0083] In a global illumination baking method provided in one embodiment of this application, the density levels include: internal density levels, surface density levels, and external density levels.

[0084] In an alternative implementation, the internal density level can be set to a high-density probe distribution to handle complex lighting propagation and occlusion effects inside an object. For example, when the target object is an architectural model, the internal density level can set a dense probe grid for the interior space to ensure detailed representation of interior lighting and accurate shadows.

[0085] In an alternative implementation, the surface density level can be set to a medium-density probe distribution, focusing on handling the lighting interactions and material reflection effects on the object's surface. For example, for the surface area of ​​a character model, the surface density level can arrange probes of moderate density around the model's surface to balance lighting quality and computational overhead, achieving realistic surface lighting effects.

[0086] In an alternative implementation, the outer density level can be set to a low-density probe distribution, primarily handling ambient lighting at long distances and light propagation over large areas. For example, in large scenes, the outer density level can use a sparse probe distribution in areas far from the target object, reducing unnecessary computation while ensuring the continuity of overall lighting.

[0087] In a global illumination baking method provided in one embodiment of this application, determining the corresponding density level based on the spatial relationship between each grid cell and the target object includes: Step S2101: Calculate the distance from the world coordinates of the mesh cell to the surface of the target object; Step S2102: When the distance is less than the first distance threshold, determine the grid cell as an internal density level; Step S2103: When the distance is greater than or equal to the first distance threshold and less than the second distance threshold, the grid cell is determined to be a surface density level; Step S2104: When the distance is greater than or equal to the second distance threshold, the grid cell is determined to be an external density level.

[0088] In application, by traversing each grid cell in the three-dimensional mesh system, the shortest spatial distance from the center point of each grid cell to the geometric surface of the target object is accurately measured using geometric calculation algorithms.

[0089] The world coordinates of a grid cell can be a coordinate system in three-dimensional space used to identify the position of the grid cell, containing coordinate values ​​along the X, Y, and Z axes, which can accurately locate the specific position of the grid cell in the three-dimensional world.

[0090] The distance to the target object's surface can be the Euclidean distance between the center point of the grid cell and the nearest point on the geometric surface of the target object. This distance value reflects the spatial positional relationship of the grid cell relative to the target object.

[0091] In step S2102, when the distance is less than the first distance threshold, the grid cell is determined to be an internal density level.

[0092] Specifically, this step uses a set first distance threshold as a judgment criterion to compare and analyze the calculated distance values. When the distance from the grid cell to the surface of the target object is less than the preset first threshold, the grid cell is classified as an internal density level, and a higher probe density or a lower probe density is assigned to the area.

[0093] The first distance threshold can be a critical distance value used to distinguish between internal density levels and other density levels. It is usually set to a negative number or a small positive number close to zero to identify the area inside the object or close to the surface.

[0094] The internal density level can be a high-density probe distribution level set for mesh cells located inside the target object or close to the surface. This level is usually configured with the highest probe density value to ensure the accuracy of internal lighting calculations.

[0095] In step S2103, when the distance is greater than or equal to the first distance threshold and less than the second distance threshold, the grid cell is determined to be a surface density level.

[0096] Specifically, this step uses a dual-threshold interval judgment mechanism to identify and classify mesh cells that are between the first and second distance thresholds. These mesh cells located near the object surface are classified as surface density levels, and a medium-density probe distribution is configured to balance rendering quality and performance requirements.

[0097] The second distance threshold can be a critical distance value used to distinguish between surface density levels and external density levels. It is usually set to a positive number to define the area near the object surface where a moderate probe density is required.

[0098] The surface density level can be a medium-density probe distribution level set for mesh cells located near the surface of the target object. The probe density of this level is between the inner density level and the outer density level.

[0099] In step S2104, when the distance is greater than or equal to the second distance threshold, the grid cell is determined to be an external density level.

[0100] Specifically, this step identifies mesh cells that are far from the surface of the target object. When the calculated distance value is greater than or equal to a preset second distance threshold, these mesh cells that are far from the object are classified as external density levels, and a lower probe density is configured to optimize the overall computing performance.

[0101] The outer density level can be a low-density probe distribution level set for mesh cells far from the target object. This level is usually configured with the minimum number of probes to reduce unnecessary computational overhead.

[0102] In a global illumination baking method provided in one embodiment of this application, generating a three-dimensional mesh based on the geometric boundaries of the target object includes: Step S2301: Obtain the bounding box boundary of the target object's volume; Step S2302: Obtain the grid resolution; Step S2303: Generate a 3D mesh based on the volume bounding box boundary and mesh resolution.

[0103] The above plan will be explained in detail below.

[0104] In step S2301, the bounding box boundary of the target object is obtained.

[0105] Specifically, the bounding box boundary refers to the boundary information of the smallest cube or cuboid that can completely enclose the geometry of the target object, including the minimum and maximum coordinate values ​​of the bounding box in three-dimensional space.

[0106] In step S2302, the grid resolution is obtained.

[0107] Specifically, mesh resolution refers to the parameter setting used to control the degree of subdivision of the 3D mesh, which determines the number and density of mesh cells generated within the volume bounding box space.

[0108] The grid resolution can be a three-dimensional numerical parameter set according to the complexity of the scene and the requirements for baking accuracy, corresponding to the number of grid divisions in the X, Y, and Z axes respectively.

[0109] In one optional implementation, the grid resolution is obtained through user interface settings or preset configuration, and includes three integer values ​​representing the number of grid divisions in the X-axis, Y-axis, and Z-axis directions, respectively. For example, setting the grid resolution to [32, 16, 32] indicates a grid structure with 32 segments in the X-axis direction, 16 segments in the Y-axis direction, and 32 segments in the Z-axis direction.

[0110] In a specific application, in the volumetric GI asset tool interface, the user sets the grid resolution parameters through a slider or numerical input box based on the baking accuracy requirements and computational performance considerations of the current scene. The system then provides a subdivision control benchmark for the subsequent grid generation process based on the set resolution value.

[0111] In step S2303, a three-dimensional mesh is generated based on the volume bounding box boundary and the mesh resolution.

[0112] Specifically, 3D mesh generation refers to the process of creating a regularly arranged mesh cell structure in 3D space based on the spatial range determined by the volume bounding box boundary and the mesh resolution parameters.

[0113] The three-dimensional mesh can be a set of cubic or cuboid mesh cells uniformly distributed at a specified resolution within the volume bounding box space, with each mesh cell having a defined world coordinate position.

[0114] In an alternative implementation, the 3D mesh calculates the world coordinate position of each mesh cell within the volume bounding box space by traversing all mesh indices defined by the mesh resolution. For example, for a resolution setting of [32, 16, 32], a total of 16384 mesh cells are generated, and the coordinates of each cell are uniformly distributed within the bounding box boundary using a linear interpolation algorithm.

[0115] In an alternative implementation, the three-dimensional mesh is implemented using a regular cubic mesh structure. The mesh indices along the X, Y, and Z axes are traversed through three nested loops to calculate the center point coordinates of each mesh cell.

[0116] In one embodiment of this application, a global illumination baking method is provided, which further includes: The response density control parameter adjustment operation adjusts the probe density value corresponding to the target density level based on the density control parameter.

[0117] The method provided in this embodiment offers a dynamic density control parameter adjustment function, allowing users to adjust the probe density values ​​of different density levels in real time based on specific scene requirements and lighting quality requirements. This achieves more flexible and precise lighting baking control, solving the computer field problem of excessively long baking time or insufficient lighting accuracy caused by traditional global density control.

[0118] Specifically, the system provides an interactive density control parameter adjustment interface during the global illumination baking process. When the user needs to adjust the probe density of a specific density level, the system can respond to the corresponding adjustment operation and recalculate and update the probe density value corresponding to the target density level based on the new density control parameters, thereby achieving fine control over the quality of illumination baking.

[0119] The density control parameter adjustment operation allows users to adjust parameters through a graphical user interface, including modifying probe density values ​​at different density levels via sliders, numerical input boxes, or preset options.

[0120] In an optional implementation, density control parameter adjustments can be made via a density control panel in a graphical user interface, which provides independent adjustment controls for internal density levels, surface density levels, and external density levels. For example, a user can drag the internal density slider to adjust the probe density value of the internal density level from the default 1.0 to 1.5, thereby improving the accuracy of lighting calculations for the internal regions of the object.

[0121] In an optional implementation, density control parameter adjustment can also be achieved through preset parameter templates. The system predefines various density parameter combinations suitable for different scene types, such as "high-precision mode," "balanced mode," and "fast mode." For example, when the user selects "high-precision mode," the system automatically sets the internal density level to 2.0, the surface density level to 1.8, and the external density level to 0.5 to obtain the best lighting effect.

[0122] The target density level can be a specific level that the system needs to adjust based on user selection or automatic identification, including one or more of the internal density level, surface density level, and external density level.

[0123] In an optional implementation, the target density level can be determined by the user's selection operation in the density control interface. The user can select a single level for adjustment or select multiple levels for batch adjustment. For example, the user can select the surface density level and the external density level as the target density levels, and then uniformly adjust the probe density values ​​of these two levels to optimize the lighting effect on the object surface and surrounding area.

[0124] In a specific application, when a user runs the volumetric GI asset tool in Maya for global illumination baking, and finds that the internal lighting effect of a complex building model is not delicate enough, the user can select the internal density level as the target density level in the density control panel, and then adjust the probe density value of this level from 1.0 to 1.8 using the slider. After the system responds to this adjustment operation, it will recalculate the probe distribution of the internal area of ​​the building, generating a denser probe mesh, thereby obtaining a more accurate and delicate internal lighting effect in the subsequent lighting baking process.

[0125] In a global illumination baking method provided in one embodiment of this application, global illumination baking based on the density map includes: Graded baking is performed based on different density levels of the density map.

[0126] Specifically, the system uses a layered baking strategy to perform lighting calculations on the scene based on the different density level information marked in the density map generated in the aforementioned steps.

[0127] In one optional implementation, a high-precision octree algorithm is used to calculate detailed lighting based on the internal density level regions identified in the density map, a medium-precision ray tracing algorithm is used for the surface density level regions, and a low-precision fast approximation algorithm is used for the external density level regions. For example, when the system detects that a mesh cell belongs to an internal density level, it will initiate an octree subdivision algorithm to recursively subdivide the region by up to 8 levels, with each child node calculating ray sampling in 16 directions; when the mesh cell belongs to a surface density level, a subdivision depth of 4 levels and ray sampling in 8 directions are used; when the mesh cell belongs to an external density level, only a subdivision depth of 2 levels and ray sampling in 4 directions are used.

[0128] In one optional implementation, a hierarchical baking task queue is established, assigning mesh cells of different density levels to processing queues with corresponding priorities. High-density levels are processed first to ensure the lighting quality of important areas. For example, the system first processes all mesh cells in the inner density level queue, completing the fine lighting calculations for these important areas, and then processes the surface density level and outer density level queues in sequence, ensuring that computational resources are first allocated to the areas that have the greatest impact on visual effects.

[0129] Among them, hierarchical baking can be a parallel lighting computation processing mechanism based on density-level differentiated configuration. Specifically, hierarchical baking refers to processing the baking task in layers according to the computational complexity based on the density indicators of different regions in the density map, using a refined algorithm for high-density regions and a fast algorithm for low-density regions.

[0130] In one optional implementation, a multi-threaded parallel processing architecture is employed, allocating baking tasks at different density levels to different computing units for simultaneous execution, with higher density levels receiving more computing threads and memory resources. For example, 8 CPU threads and 4GB of video memory are allocated to the internal density level for fine lighting calculations, 4 threads and 2GB of video memory are allocated to the surface density level, and 2 threads and 1GB of video memory are allocated to the external density level. Tasks at each level are executed in parallel to improve overall processing speed.

[0131] Based on the above method embodiments, this disclosure also provides a global illumination baking device, see [link to relevant documentation]. Figure 3 The device includes the following modules: The information acquisition module 301 is used to acquire the geometric information of the target object in the scene to be baked; The density determination module 302 is used to determine multiple density levels of the target object based on geometric information, with each density level corresponding to a different probe density value; Mesh generation module 303 is used to generate a three-dimensional mesh based on the geometric boundaries of the target object; The density calculation module 304 is used to traverse each grid cell in the three-dimensional mesh and determine the corresponding density level based on the spatial relationship between each grid cell and the target object. The texture generation module 305 is used to generate a density texture based on the determined density level and the corresponding probe density value. Baking module 306 is used for global illumination baking based on density maps.

[0132] The aforementioned device automatically determines the multi-level probe density distribution by analyzing the geometric features of objects, avoiding the limitations of traditional uniform density control. The adaptive density adjustment mechanism based on the spatial relationship of objects enriches the hierarchical representation of lighting effects, enhances the visual richness of the scene, and effectively reduces unnecessary computational overhead and storage occupation through precise density control and hierarchical baking strategies, thus solving the technical problem of balancing lighting baking efficiency and quality in the field of computer graphics.

[0133] The global illumination baking apparatus provided in this disclosure has the same implementation principle and technical effect as the aforementioned method embodiments. For the sake of brevity, any parts of the global illumination baking apparatus not mentioned in the embodiments can be referred to the corresponding content in the aforementioned global baking method embodiments.

[0134] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0135] This disclosure also provides an electronic device, such as... Figure 4 The diagram shows the structure of the electronic device, which includes a processor 111 and a memory 110. The memory 110 stores computer-executable instructions that can be executed by the processor 111. The processor 111 executes the computer-executable instructions to implement the following global illumination baking method steps: Obtain the geometric information of the target object in the scene to be baked; Multiple density levels of the target object are determined based on geometric information, with each density level corresponding to a different probe density value; Generate a 3D mesh based on the geometric boundaries of the target object; Traverse each grid cell in the 3D mesh and determine the corresponding density level based on the spatial relationship between each grid cell and the target object; A density map is generated based on the determined density level and the corresponding probe density value; Global illumination baking based on density mapping.

[0136] Optionally, the geometric information includes at least one of the following: number of vertices, number of faces, volume, surface area, complexity coefficient, and number of materials.

[0137] Optionally, the density hierarchy includes at least two of the following: internal density hierarchy, surface density hierarchy, and external density hierarchy.

[0138] Optionally, the corresponding density level is determined based on the spatial relationship between each grid cell and the target object, including: Calculate the distance from the world coordinates of the mesh cells to the surface of the target object; When the distance is less than the first distance threshold, the grid cell is determined to be an internal density level; When the distance is greater than or equal to the first distance threshold and less than the second distance threshold, the grid cell is determined to be a surface density level; When the distance is greater than or equal to the second distance threshold, the grid cell is determined to be an outer density level.

[0139] Optionally, a 3D mesh is generated based on the geometric boundaries of the target object, including: Obtain the bounding box boundary of the target object's volume; Get the grid resolution; 3D meshes are generated based on volume bounding box boundaries and mesh resolution.

[0140] Optionally, it also includes: The response density control parameter adjustment operation adjusts the probe density value corresponding to the target density level based on the density control parameter.

[0141] Optionally, global illumination baking based on density maps includes: Graded baking is performed based on different density levels of the density map.

[0142] exist Figure 4 In the illustrated embodiment, the electronic device further includes a bus 112 and a communication interface 113, wherein the processor 111, the communication interface 113, and the memory 110 are connected via the bus 112.

[0143] The memory 110 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 113 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 112 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 112 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0144] The processor 111 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 111 or by instructions in software form. The processor 111 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this disclosure can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory. The processor 111 reads the information in the memory and, in conjunction with its hardware, completes the steps of the global illumination baking method described in the aforementioned embodiment.

[0145] This disclosure also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are invoked and executed by a processor, they cause the processor to implement a global illumination baking method, which specifically includes: Obtain the geometric information of the target object in the scene to be baked; Multiple density levels of the target object are determined based on geometric information, with each density level corresponding to a different probe density value; Generate a 3D mesh based on the geometric boundaries of the target object; Traverse each grid cell in the 3D mesh and determine the corresponding density level based on the spatial relationship between each grid cell and the target object; A density map is generated based on the determined density level and the corresponding probe density value; Global illumination baking based on density mapping.

[0146] Optionally, the geometric information includes at least one of the following: number of vertices, number of faces, volume, surface area, complexity coefficient, and number of materials.

[0147] Optionally, the density hierarchy includes at least two of the following: internal density hierarchy, surface density hierarchy, and external density hierarchy.

[0148] Optionally, the corresponding density level is determined based on the spatial relationship between each grid cell and the target object, including: Calculate the distance from the world coordinates of the mesh cells to the surface of the target object; When the distance is less than the first distance threshold, the grid cell is determined to be an internal density level; When the distance is greater than or equal to the first distance threshold and less than the second distance threshold, the grid cell is determined to be a surface density level; When the distance is greater than or equal to the second distance threshold, the grid cell is determined to be an outer density level.

[0149] Optionally, a 3D mesh is generated based on the geometric boundaries of the target object, including: Obtain the bounding box boundary of the target object's volume; Get the grid resolution; 3D meshes are generated based on volume bounding box boundaries and mesh resolution.

[0150] Optionally, it also includes: The response density control parameter adjustment operation adjusts the probe density value corresponding to the target density level based on the density control parameter.

[0151] Optionally, global illumination baking based on density maps includes: Graded baking is performed based on different density levels of the density map.

[0152] The computer program products of the global illumination baking method, apparatus and electronic device provided in this disclosure include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.

[0153] Unless otherwise specifically stated, the relative steps, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of this disclosure.

[0154] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0155] In the description of this disclosure, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this disclosure and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this disclosure. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0156] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.

Claims

1. A global illumination baking method, characterized in that, include: Obtain the geometric information of the target object in the scene to be baked; Based on the geometric information, multiple density levels of the target object are determined, and each density level corresponds to a different probe density value; A three-dimensional mesh is generated based on the geometric boundaries of the target object; Traverse each grid cell in the three-dimensional grid and determine the corresponding density level based on the spatial relationship between each grid cell and the target object; A density map is generated based on the determined density level and the corresponding probe density value; Global illumination baking is performed based on the density map.

2. The method according to claim 1, characterized in that, The geometric information includes at least one of the following: number of vertices, number of faces, volume, surface area, complexity coefficient, and number of materials.

3. The method according to claim 1, characterized in that, The density levels include at least two types: internal density levels, surface density levels, and external density levels.

4. The method according to claim 3, characterized in that, The process of determining the corresponding density level based on the spatial relationship between each grid cell and the target object includes: Calculate the distance from the world coordinates of the mesh cell to the surface of the target object; When the distance is less than a first distance threshold, the grid cell is determined to be an internal density level; When the distance is greater than or equal to a first distance threshold and less than a second distance threshold, the grid cell is determined to be a surface density level; When the distance is greater than or equal to the second distance threshold, the grid cell is determined to be an outer density level.

5. The method according to claim 1, characterized in that, The step of generating a three-dimensional mesh based on the geometric boundaries of the target object includes: Obtain the volume bounding box boundary of the target object; Get the grid resolution; The 3D mesh is generated based on the volume bounding box boundary and the mesh resolution.

6. The method according to claim 1, characterized in that, Also includes: The response density control parameter adjustment operation adjusts the probe density value corresponding to the target density level based on the density control parameter.

7. The method according to claim 1, characterized in that, The global illumination baking based on the density map includes: Graded baking is performed based on different density levels of the density map.

8. A global illumination baking apparatus, characterized in that, include: The information acquisition module is used to acquire the geometric information of the target object in the baking scene; The density determination module is used to determine multiple density levels of the target object based on the geometric information, with each density level corresponding to a different probe density value; A mesh generation module is used to generate a three-dimensional mesh based on the geometric boundaries of the target object; The density calculation module is used to traverse each grid cell in the three-dimensional grid and determine the corresponding density level based on the spatial relationship between each grid cell and the target object. The texture generation module is used to generate density textures based on the determined density level and the corresponding probe density value. A baking module for performing global illumination baking based on the density map.

9. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method of any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the method of any one of claims 1 to 7.