CN-121982188-A - Global illumination baking method and device, electronic equipment and storage medium
Abstract
The disclosure provides a global illumination baking method, a global illumination baking device, electronic equipment and a storage medium, wherein the method comprises the steps of obtaining geometric information of a target object in a scene to be baked; the method comprises the steps of determining a plurality of density levels of a target object based on geometric information, generating a three-dimensional grid according to the geometric boundary of the target object, traversing each grid cell in the three-dimensional grid, determining the corresponding density level based on the spatial relationship between each grid cell and the target object, generating a density map according to the determined density levels and the corresponding probe density values, and performing global illumination baking based on the density map. According to the method, the density distribution of the multi-level probe is automatically determined by analyzing the geometric characteristics of the object, the limitation of traditional uniform density control is avoided, the self-adaptive density adjustment mechanism based on the spatial relationship of the object enriches the hierarchical expression of the illumination effect, and the visual richness of the scene is improved.
Inventors
- WANG YUANLONG
Assignees
- 广州博冠信息科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251218
Claims (10)
- 1. A global illumination baking method, comprising: Obtaining 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, each density level corresponding to a different probe density value; Generating a three-dimensional grid according to the geometric boundary of the target object; Traversing each grid cell in the three-dimensional grid, and determining a corresponding density level based on the spatial relationship between each grid cell 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.
- 2. The method of claim 1, wherein the geometric information comprises at least one of a number of vertices, a number of facets, a volume, a surface area, a complexity factor, a number of textures.
- 3. The method of claim 1, wherein the density levels comprise at least two of an inner density level, a surface density level, and an outer density level.
- 4. A method according to claim 3, wherein said determining a corresponding density hierarchy based on the spatial relationship of each grid cell to the target object comprises: Calculating the distance from the world coordinates of the grid unit to the surface of the target object; Determining the grid cell as an internal density hierarchy when the distance is less than a first distance threshold; When the distance is greater than or equal to a first distance threshold and less than a second distance threshold, determining that the grid cell is a surface density level; and when the distance is greater than or equal to a second distance threshold, determining the grid cell as an external density hierarchy.
- 5. The method of claim 1, wherein the generating a three-dimensional mesh from the geometric boundary of the target object comprises: Acquiring the boundary of a volume bounding box of the target object; acquiring the resolution of the grid; The three-dimensional mesh is generated based on the volumetric bounding box boundary and the mesh resolution.
- 6. The method as recited in claim 1, further comprising: and responding to a density control parameter adjustment operation, and adjusting a probe density value corresponding to the target density level based on the density control parameter.
- 7. The method of claim 1, wherein the global illumination baking based on the density map comprises: and carrying out graded baking according to different density levels of the density map.
- 8. A global illumination baking apparatus, comprising: The information acquisition module is used for acquiring geometric information of a target object in a scene to be baked; the density determining module is used for determining a plurality of density levels of the target object based on the geometric information, and each density level corresponds to a different probe density value; The grid generation module is used for generating a three-dimensional grid according to the geometric boundary of the target object; the density calculation module is used for traversing each grid cell in the three-dimensional grid and determining a corresponding density level based on the spatial relationship between each grid cell and the target object; The map generation module is used for generating a density map according to the determined density level and the corresponding probe density value; and the baking module is used for carrying out global illumination baking based on the density map.
- 9. An electronic device comprising 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 storing computer executable instructions which, when invoked and executed by a processor, cause the processor to implement the method of any one of claims 1 to 7.
Description
Global illumination baking method and device, electronic equipment and storage medium Technical Field The disclosure relates to the technical field of graphics processing, and in particular relates to a global illumination baking method, a global illumination baking device, electronic equipment and a storage medium. Background Global illumination is used as an important rendering technology, and the visual reality and immersion experience of a game scene are greatly enhanced by simulating the propagation and reflection of light rays in a three-dimensional scene. In the related art, in order to realize the global illumination effect of a static object, illumination information baking needs to be performed on the whole scene model, and illumination data is recorded by uniformly distributing probes in the scene. The existing scheme generally adopts a simple overall density control mode, uniform probe density is used for sampling illumination information in the whole map scene, and the higher the probe density is, the more detailed the recorded illumination information is. However, this way of unifying the density distribution has significant limitations, either because the probe density is too low, resulting in insufficient illumination accuracy in the complex area, or because the probe density is too high, resulting in a significant increase in baking time and storage overhead. The technical limitation causes complicated operation of a user during setting of baking parameters, the balance point can be found between the effect and the efficiency only by repeated debugging, and meanwhile, the single density control mode limits the diversity of the illumination effect, so that the visual appearance of a game scene lacks layering sense, and in addition, a large amount of probe data also occupies the storage space of equipment, so that the resource consumption of a server is increased. Disclosure of Invention The disclosure aims to provide a global illumination baking method, a global illumination baking device, electronic equipment and a storage medium, so as to realize self-adaptive probe density control based on geometric characteristics of an object and improve baking efficiency and illumination quality. The method comprises the steps of obtaining 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 a geometric boundary of the target object, traversing each grid unit in the three-dimensional grid, 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 levels and the corresponding probe density values, and performing global illumination baking based on the density map. The global illumination baking device comprises an information acquisition module, a density determination module, a grid generation module, a density calculation module and a mapping generation module, wherein the information acquisition module is used for acquiring geometric information of a target object in a scene to be baked, the density determination module is used for determining a plurality of density levels of the target object based on the geometric information, each density level corresponds to different probe density values, the grid generation module is used for generating a three-dimensional grid according to a geometric boundary of the target object, the density calculation module is used for traversing each grid unit in the three-dimensional grid, the corresponding density level is determined based on the spatial relation between each grid unit and the target object, the mapping generation module is used for generating a density mapping according to the determined density levels and the corresponding probe density values, and the baking module is used for conducting global illumination baking based on the density mapping. In a third aspect, the present disclosure provides an electronic device comprising a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to perform steps in the global illumination baking method described above. In a fourth aspect, the present 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 global illumination baking method described above. The disclosure provides a global illumination baking method, a global illumination baking device, electronic equipment and a storage medium, wherein geometrical information of a target object in a scene to be baked is acquired, a plurality of density levels of the target object ar