Indirect light treatment method and apparatus

CN122929054APending Publication Date: 2026-10-16NETEASE (SHANGHAI) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611277051.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-20
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

这种耦合虽然是物理正确的,但是从存储方式上来说它使得细层级探针在承载高频遮蔽信息的同时,需同步保存相同密度的低频漫反射颜色数据,造成纹理资源体积膨胀,并增加了运行时的显存占用与纹理采样带宽开销;此外,由于遮蔽因子已固化在漫反射颜色数据中,当环境光照条件发生变化时,需重新生成整套光照数据或额外保存多套耦合纹理,不利于环境状态的快速适配,数据处理灵活性和资源利用效率受到限制

Benefits of technology

[0009]One embodiment of this application provides an indirect lighting processing method, comprising: constructing a multi-level sampling structure based on the geometric distribution of the scene, the multi-level sampling structure including at least one fine level and at least one coarse level, the fine level and the coarse level having different spatial resolutions; performing occlusion sampling and color sampling on sampling points of each level respectively to obtain occlusion sampling results and indirect color sampling results, the indirect color sampling results not containing occlusion factors; establishing an index addressing structure, the index addressing structure being used to establish a reuse relationship between the fine level and the coarse level, so that the indirect color sampling results of the fine level sampling points reuse the indirect color sampling results of the coarse level sampling points in the same spatial region; packaging the occlusion sampling results and indirect color sampling results into a texture resource based on the index addressing structure; and during the runtime phase, reading the texture resource according to the index addressing structure, obtaining occlusion values ​​and indirect color values ​​and combining them to obtain the indirect lighting result. In this way, by decoupling occlusion sampling and indirect color sampling, and reusing the results of coarse-level indirect color sampling at fine-level, the storage volume and video memory usage of texture resources are reduced, and the runtime texture sampling bandwidth overhead is reduced. This helps to avoid redundant storage of low-frequency color data while maintaining high-frequency occlusion information at fine-level. At the same time, since the indirect color sampling results do not contain occlusion factors, the same set of color texture resources can be applied to various ambient lighting conditions, which helps to reduce multi-state data redundancy and improve the data processing flexibility and efficiency of the rendering pipeline.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122929054A_ABST
    Figure CN122929054A_ABST
Patent Text Reader

Abstract

One embodiment of this application provides an indirect lighting processing method and apparatus, comprising: constructing a multi-level sampling structure according to the geometric distribution of the scene; performing occlusion sampling and color sampling on sampling points at each level respectively to obtain occlusion sampling results and indirect color sampling results, wherein the indirect color sampling results do not contain occlusion factors; establishing an index addressing structure, which is used to establish a reuse relationship between fine-level and coarse-level sampling, so that the indirect color sampling results of fine-level sampling points reuse the indirect color sampling results of coarse-level sampling points in the same spatial region; packaging the occlusion sampling results and indirect color sampling results into texture resources based on the index addressing structure; and during runtime, reading the texture resources according to the index addressing structure, obtaining occlusion values ​​and indirect color values, and combining them to obtain indirect lighting results. This reduces the storage volume and video memory usage of texture resources, and reduces the runtime texture sampling bandwidth overhead.
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 indirect illumination processing methods and apparatus. Background Technology

[0002] In real-time rendering technologies for virtual scenes, one approach to obtain stable indirect lighting is to employ a pre-computed volumetric probe scheme. This technique involves deploying a regularized array of 3D probes in the scene space offline, recording the environmental visibility and diffuse lighting response at each sampling point, and organizing these data into a unified 3D texture or equivalent volumetric data structure. At runtime, the probe data is searched and interpolated based on the spatial location of the objects, and the results are combined to form the indirect lighting contribution.

[0003] In existing related technical solutions, occlusion information and diffuse color together form the integrand in the rendering equation. Therefore, they are often combined into a single lighting signal, potentially stored in the probe data at each level with a single spatial resolution. While this coupling is physically correct, from a storage perspective, it requires fine-level probes to simultaneously store low-frequency diffuse color data of the same density while carrying high-frequency occlusion information. This results in increased texture resource size and increased runtime memory usage and texture sampling bandwidth overhead. Furthermore, since the occlusion factor is fixed in the diffuse color data, when ambient lighting conditions change, the entire set of lighting data must be regenerated or multiple sets of coupled textures must be stored additionally. This is not conducive to rapid adaptation to environmental conditions, and limits data processing flexibility and resource utilization efficiency. Summary of the Invention

[0004] This application provides an indirect illumination processing method, apparatus, electronic device, and computer-readable storage medium to at least partially solve the aforementioned problems existing in the related art.

[0005] According to one aspect of this application, an indirect lighting processing method is provided, comprising: constructing a multi-level sampling structure based on the geometric distribution of the scene, the multi-level sampling structure including at least one fine level and at least one coarse level, the fine level and the coarse level having different spatial resolutions; performing occlusion sampling and color sampling on sampling points of each level respectively to obtain occlusion sampling results and indirect color sampling results, the indirect color sampling results not containing occlusion factors; establishing an index addressing structure, the index addressing structure being used to establish a reuse relationship between the fine level and the coarse level, so that the indirect color sampling results of the fine level sampling points reuse the indirect color sampling results of the coarse level sampling points in the same spatial region; packaging the occlusion sampling results and indirect color sampling results into a texture resource based on the index addressing structure; and during the runtime phase, reading the texture resource according to the index addressing structure, obtaining occlusion values ​​and indirect color values ​​and combining them to obtain the indirect lighting result.

[0006] According to one aspect of this application, an indirect lighting processing apparatus is provided, comprising: a construction module for constructing a multi-level sampling structure based on the geometric distribution of a scene, the multi-level sampling structure including at least one fine-level and at least one coarse-level, the fine-level and coarse-level having different spatial resolutions; a sampling module for performing occlusion sampling and color sampling on sampling points of each level respectively, to obtain occlusion sampling results and indirect color sampling results, the indirect color sampling results not containing occlusion factors; an index addressing module for establishing an index addressing structure, the index addressing structure being used to establish a reuse relationship between the fine-level and coarse-level, enabling the indirect color sampling results of the fine-level sampling points to reuse the indirect color sampling results of the coarse-level sampling points in the same spatial region; a packaging module for packaging the occlusion sampling results and indirect color sampling results into a texture resource based on the index addressing structure; and a result module for reading the texture resource according to the index addressing structure during runtime, obtaining occlusion values ​​and indirect color values, and combining them to obtain an indirect lighting result.

[0007] According to one aspect of this application, an electronic device is provided, including a processor and a memory; the memory stores a computer program; when the processor executes the computer program, it implements any of the above-described indirect illumination processing methods.

[0008] According to one aspect of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements any of the above-described indirect illumination processing methods.

[0009] One embodiment of this application provides an indirect lighting processing method, comprising: constructing a multi-level sampling structure based on the geometric distribution of the scene, the multi-level sampling structure including at least one fine level and at least one coarse level, the fine level and the coarse level having different spatial resolutions; performing occlusion sampling and color sampling on sampling points of each level respectively to obtain occlusion sampling results and indirect color sampling results, the indirect color sampling results not containing occlusion factors; establishing an index addressing structure, the index addressing structure being used to establish a reuse relationship between the fine level and the coarse level, so that the indirect color sampling results of the fine level sampling points reuse the indirect color sampling results of the coarse level sampling points in the same spatial region; packaging the occlusion sampling results and indirect color sampling results into a texture resource based on the index addressing structure; and during the runtime phase, reading the texture resource according to the index addressing structure, obtaining occlusion values ​​and indirect color values ​​and combining them to obtain the indirect lighting result. In this way, by decoupling occlusion sampling and indirect color sampling, and reusing the results of coarse-level indirect color sampling at fine-level, the storage volume and video memory usage of texture resources are reduced, and the runtime texture sampling bandwidth overhead is reduced. This helps to avoid redundant storage of low-frequency color data while maintaining high-frequency occlusion information at fine-level. At the same time, since the indirect color sampling results do not contain occlusion factors, the same set of color texture resources can be applied to various ambient lighting conditions, which helps to reduce multi-state data redundancy and improve the data processing flexibility and efficiency of the rendering pipeline. Attached Figure Description

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

[0011] Figure 1 A schematic diagram of a system architecture is shown in one exemplary embodiment of this application; Figure 2 This application shows a flowchart of a method in one exemplary embodiment; Figure 3 This application illustrates a system architecture diagram of one exemplary embodiment. Figure 4 This diagram illustrates the volumetric probe distribution of U-Diffuse-GI (left) and AO (right) in one exemplary embodiment of this application. Figure 5 This invention illustrates a core flowchart of the baking side in one exemplary embodiment of the present application; Figure 6 This invention illustrates a runtime sampling flowchart in one exemplary embodiment of the present application; Figure 7 This invention illustrates an AO curve encoding flowchart in one exemplary embodiment of the present application. Figure 8 This diagram shows a comparison of the effects of uncoded (left) and curve-coded (right) AO in one exemplary embodiment of this application. Figure 9 This document illustrates a timing diagram of the interaction between the baking side and the runtime in one exemplary embodiment of this application. Figure 10 A schematic diagram illustrating a runtime texture sampling and result example in one exemplary embodiment of this application; Figure 11 This diagram shows a comparison of the effects of no GI (left) and GI (right) in one exemplary embodiment of this application; Figure 12 This illustration shows a schematic diagram of the structure of an electronic device according to one exemplary embodiment of the present application. Detailed Implementation

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

[0013] It is understood that before using the technical solutions disclosed in the various embodiments of this application, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this application in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0014] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0015] The method in one embodiment of this application can run on a terminal device or a server. The terminal device can be a local terminal device. When the method in the embodiment 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 1The figure shows a cloud interaction system architecture diagram provided in this application. 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] It should be noted that the information (including but not limited to user input information, such as information entered by the user into an input box), 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, service pressure corresponding to operations performed on all code of the current project, and code development status of the current project), and signals involved in the embodiments of 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, and the service pressure and code development status involved in the operations in the embodiments of this application were all obtained under full authorization.

[0017] According to one embodiment of the indirect illumination processing method of this application, such as Figure 2 As shown, the method may include: Step S210: Based on the scene's geometric distribution, construct a multi-level sampling structure. The multi-level sampling structure includes at least one fine-level and at least one coarse-level, with different spatial resolutions for the fine-level and coarse-level. Step S230: Perform occlusion sampling and color sampling on each sampling point to obtain occlusion sampling results and indirect color sampling results. The indirect color sampling results do not include occlusion factors. Step S250: Establish an index addressing structure. The index addressing structure is used to establish a reuse relationship between fine-level and coarse-level, so that the indirect color sampling results of fine-level sampling points reuse the indirect color sampling results of coarse-level sampling points in the same spatial region. Step S270: Based on the index addressing structure, the occlusion sampling results and indirect color sampling results are packaged into texture resources; Step S290: During the runtime phase, the texture resource is read according to the index addressing structure to obtain the occlusion value and indirect color value and combine them to obtain the indirect lighting result.

[0018] According to one embodiment of this application, by decoupling occlusion sampling and indirect color sampling, and reusing the results of fine-level indirect color sampling from coarse-level, the storage volume and video memory usage of texture resources are reduced, and the runtime texture sampling bandwidth overhead is reduced. This helps to avoid redundant storage of low-frequency color data while maintaining fine-level high-frequency occlusion information. At the same time, since the indirect color sampling results do not contain occlusion factors, the same set of color texture resources can be applied to various ambient lighting conditions, which helps to reduce multi-state data redundancy and improve the data processing flexibility and efficiency of the rendering pipeline.

[0019] like Figure 3 The diagram illustrates the overall system architecture, showcasing the data processing flow of a hierarchical cascaded voxel GI (Global Illumination) probe system based on Diffuse-AO (diffuse-ambient occlusion combined lighting; AO: Ambient Occlusion) decoupling. From left to right: scene data input → ray structure construction → sparse hierarchical processing (divided into two parallel paths: path one is occlusion baking → occlusion post-processing → curve fitting; path two is low-frequency color extraction → color post-processing → color packaging) → two-level indexing → resource export → runtime sampling → final lighting output. The entire process realizes a complete pipeline from scene data to final lighting.

[0020] The embodiments of this application will be further described below.

[0021] In step S210, a multi-level sampling structure is constructed based on the scene's geometric distribution. This structure includes at least one fine-level and at least one coarse-level, with different spatial resolutions for the fine and coarse levels. This differentiated spatial resolution configuration allows the fine-level to retain high-frequency occlusion details, while the coarse-level covers low-frequency color changes, avoiding resource waste caused by uniform density storage and providing a structural foundation for subsequent signal decoupling and hierarchical multiplexing.

[0022] For example, in one implementation, after reading the scene bounding box and probe spacing parameters on the baking side, the spatial mesh is initialized with 4 times the probe spacing as the finest level mesh unit size. Then, only the mesh units covered by the model's geometric bounding box and those at the terrain ray hit height are candidate-marked. Neighborhood expansion and ray filtering are then used to retain effective units as fine-level sampling blocks. Subsequently, from bottom to top, every 4×4×4 fine-level units are merged into coarse-level sampling blocks, and empty areas are backfilled and covered by a coarser level, thus allowing sparse geometric areas to be finely represented by the fine level and open areas to be efficiently covered by the coarse level. Optionally, the multi-level sampling structure can be configured with different granularity sampling units according to the geometric distribution, balancing detailed representation and hole coverage efficiency.

[0023] Optionally, the multi-level sampling structure can be a voxel probe indexing system containing two, three, or more layers. The number of layers is determined by the scene depth range, geometric density distribution, and runtime memory budget. Taking a three-layer structure as an example, the finest layer can preserve high-frequency occlusion and lighting details in geometrically dense areas, the middle layers serve as transitional fallbacks, and the coarsest layer covers a large area of ​​open space. It should be noted that the relationship between layers is not a simple octree parent-child relationship, but a structure combining sparse occupancy of fine layers and backfilling of coarse layers: fine layers are generated only in the spatial units of adjacent geometry, and the voids not covered by fine layers are directly served by adjacent coarser layers, avoiding the maintenance of a large number of invalid fine probes in open areas. This structure forms a dual indexing system with different granularities by establishing a dedicated occlusion index for fine layers and a dedicated color index for coarse layers, enabling subsequent baking and runtime sampling to call the appropriate layer based on signal frequency differences, reducing redundant data storage. The above description of the number of layers and index division is only an example; in actual implementation, it can be flexibly adjusted according to the performance requirements and scene complexity of the specific application environment.

[0024] Optionally, finer layers are used to arrange sampling points at higher resolution in geometrically dense areas, preserving local lighting and occlusion details. Optionally, finer layers can consist of multiple regularly arranged sampling blocks, each containing a preset number of probe units, for example, generating a probe block containing 5×5×5 probes with a unit size of 4 times the probe spacing. The generation process of finer layers may include: first, initializing the finest mesh based on the scene bounding box; then, determining candidate units through coarse screening using the model bounding box and fine screening using terrain rays; and finally, formally creating the sampling blocks after neighborhood expansion and occlusion detection. It should be noted that finer layers are only responsible for sampling and storing high-frequency occlusion signals and do not independently store low-frequency diffuse color data; when a finer layer is hit at runtime, its indirect color information reuses the sampling results of the corresponding coarse layer in the same spatial region through an indexed addressing structure. In this way, finer layers cover areas such as contact shadows, gaps, and corners with higher spatial resolution, enhancing the tonal gradation and spatial fit at geometric boundaries, while the color data does not need to grow synchronously with the density of the finer layers. In practical applications, the fine-level probe spacing and block size can be dynamically adjusted according to the target platform's memory capacity and baking time budget, and this application does not impose any limitations on this.

[0025] Optionally, a coarse level is used to provide color sampling and backoff coverage at a lower resolution in open areas, reducing data redundancy.

[0026] Optionally, the coarse level can consist of multiple merged sampling blocks, and its spatial coverage can be an integer multiple of the fine level. For example, every 4×4×4 fine-level units can be merged into a coarse-level region, generating a corresponding sampling block. The coarse level not only undertakes the indirect color coverage of large open areas but also provides a reusable low-frequency color data source for areas completely covered by the fine level. It should be noted that even if a spatial region is completely covered by the fine level, its corresponding coarse-level sampling block still needs to be retained in the color index to ensure that the fine-level occlusion data can be associated with the low-frequency color response of the same region during runtime. This design ensures that low-frequency diffuse colors are stored only at the coarse level, avoiding the repeated storage of high-bit-width color data in the most numerous fine-level probe blocks. In one possible implementation, the coarse level can be further divided into intermediate and coarsest levels. The intermediate level corresponds to the direct parent of the fine level, and the coarsest level covers a larger area, thereby balancing sampling density and storage overhead at different scales.

[0027] Optionally, spatial resolution is used to quantify the sampling point density at different levels, enabling the allocation of storage resources for high and low frequency signals as needed. Optionally, spatial resolution can be characterized by the world space spacing between adjacent sampling points, the number of probes per unit volume, or the grid cell size. For example, the spacing between fine-level samples is 's', while the spacing between coarse-level samples can be 4s or 16s, with the corresponding spatial resolution decreasing in a stepwise manner.

[0028] In an optional implementation, constructing a multi-level sampling structure includes: obtaining the scene bounding box and a preset spatial unit size; initializing a spatial sampling grid based on the scene bounding box and the preset spatial unit size, the spatial sampling grid being used to generate fine-level sampling blocks; determining spatial units containing scene geometry based on the scene geometry distribution, and generating fine-level sampling blocks based on the spatial sampling grid; merging spatial units containing scene geometry from bottom to top to generate coarse-level sampling blocks; establishing a first index for occlusion sampling for the fine-level sampling blocks, and establishing a second index for color sampling for the coarse-level sampling blocks, obtaining a dual-index structure with different granularities. In this way, by constructing coarse and fine levels from the bottom up and separating occlusion and color indices, sampling resources are allocated differentially according to signal frequency, avoiding redundant color storage at the fine level, reducing the total data volume, and improving bandwidth and caching efficiency.

[0029] In one implementation, the baking side reads all static model and terrain data within the scene, calculates the minimum and maximum spatial coordinates to obtain the scene bounding box, and sets the preset spatial unit size to the finest-level mesh unit coverage range of 4s (s being the world space distance between adjacent probes). Based on this, a spatial sampling mesh covering the entire scene is initialized. Subsequently, candidate mesh units are marked by traversing the model bounding box. Only units covered by the model geometry are marked as candidates, and units containing geometry are retained as spatial units containing scene geometry through ray tracing. These units then generate fine-level sampling blocks containing 5×5×5 probes. Afterward, spatial units containing geometry are merged from bottom to top: every 4×4×4 fine-level units form a region to generate an intermediate-level sampling block, and further merging is carried out to obtain coarser-level sampling blocks. Finally, a first index pointing to occlusion data is established for the fine-level sampling blocks, and a second index pointing to color data is established for the coarse-level sampling blocks, obtaining a dual-index structure with different granularities, enabling runtime addressing of the two types of data separately.

[0030] Optionally, the scene bounding box is used to define the spatial range of the sampling, which is determined based on the minimum bounding cube of the static model and terrain data within the scene, providing the coordinate origin and clipping boundary for subsequent mesh initialization.

[0031] Optionally, the scene bounding box serves as the spatial reference for the entire multi-level sampling structure. It can be constructed not only by traversing all static models and terrain to obtain the minimum and maximum coordinates, but also dynamically calculated based on manually specified baking ranges or volume regions. The bounding box's function is to define the extended boundaries of the spatial sampling grid, preventing the generation of invalid sampling blocks in empty, geometry-free areas, thereby saving index storage and baking computational power.

[0032] Optionally, a preset spatial unit size is used to determine the spatial span and probe density of each sampling block. It is set based on the spacing between adjacent probes and the layer multiple, providing a quantitative basis for grid division. Optionally, the preset spatial unit size serves as a scaling factor connecting world space and the index grid. It is typically set to the length of world space covered by the finest layer grid unit, for example, allowing each fine layer unit to cover a range of 4s, where s represents the world space spacing between adjacent probes. Based on this, the spatial span of coarse layer sampling blocks expands with the layer multiplication, such as the intermediate layer covering 16s and the coarser layer covering 64s, etc.

[0033] Optionally, the spatial sampling mesh is used to discretize the scene space into a regular array of cells, providing a spatial reference for geometric filtering and sampling block generation. Optionally, the initialization process of the spatial sampling mesh uses the minimum coordinates of the scene bounding box as the origin, and divides the internal space of the bounding box into candidate cells arranged in a row-column hierarchy according to a preset spatial cell size; each cell corresponds to a candidate's finest level spatial position, and subsequent geometric filtering determines whether the cell should be retained as a spatial cell containing scene geometry. It should be noted that the above mesh division method is only one example. In actual implementation, the spatial sampling mesh can also adopt a non-uniform division strategy, such as increasing the mesh spacing in the near-field region and sparsening it in the far-field region, or using adaptive octree nodes as spatial sampling cells. This application does not intend to limit this. Furthermore, to facilitate runtime coordinate transformation, the index coordinates of the spatial sampling mesh are usually bound to the voxel lighting bounding box, so that world coordinates can be directly obtained by subtracting the minimum point and multiplying by the reciprocal of the cell size, thereby accelerating the addressing process.

[0034] Optionally, fine-level sampling blocks are used to carry high-frequency occlusion sampling data. They are generated based on spatial units containing scene geometry and have a higher spatial resolution than coarse-level sampling blocks. Optionally, fine-level sampling blocks, as the spatial carrier of high-frequency occlusion sampling results, are typically organized as a volumetric data structure containing multi-dimensional probes. For example, in one possible implementation, each fine-level sampling block contains 5×5×5 probes, and the world space spacing between adjacent probes is s. The advantage of this structure is that, through a smaller spatial span and higher probe density, it can preserve fine visibility variations at geometric edges, corners, object contact surfaces, etc., thereby providing geometrically consistent high-frequency ambient light occlusion details for dynamic objects. It should be noted that fine-level sampling blocks can also use probe distributions of other sizes, such as 4×4×4 or 6×6×6, etc. This application does not intend to limit the number of probes within a single sampling block; at the same time, multiple fine-level sampling blocks can share probes through boundary overlap to ensure the continuity of cross-block interpolation at runtime.

[0035] Optionally, considering that the number of fine-level sampling blocks directly determines the storage scale of high-frequency occlusion data, to avoid redundancy in open areas, the generation process of fine-level sampling blocks typically involves first marking candidates based on the scene's geometric distribution, and then using ray tracing to remove internal voids or invalid units. Specifically, candidates can be marked for the spatial units covered by the model's bounding box, and then short-distance occlusion detection can be performed on the candidate units along the six axes. If no geometry is found within the detection range, the unit is restored to an empty unit, thus ensuring that the fine-level sampling blocks are concentrated in geometrically dense areas. Furthermore, for large-area continuous surfaces such as terrain, a top-down terrain ray marking and neighborhood expansion strategy can be used to ensure that the fine-level sampling blocks cover slopes, steps, and transition areas at terrain edges, thereby avoiding the mixing of missing fine-level probes in subsequent hierarchical boundary sampling.

[0036] Optionally, coarse-level sampling blocks are used to carry low-frequency indirect color sampling results. They are generated by merging geometrically containing units from bottom to top, with a larger spatial span than fine-level sampling blocks. Alternatively, a coarse-level sampling block can be formed by merging multiple fine-level spatial units, with its spatial span increasing exponentially with the level. For example, in one embodiment, every 4×4×4 fine-level units form an intermediate-level region, corresponding to a coarse-level sampling block. This sampling block can also contain 5×5×5 probes, but the world space covered by adjacent probes is larger. The purpose of this structure is to store diffuse indirect lighting colors with lower spatial resolution in open areas far from geometric boundaries or in low-frequency color change regions, thereby avoiding the repeated storage of high-bit-width color data at the fine-level.

[0037] Optionally, to ensure the continuity of the hierarchical transition, coarse-level sampling blocks and fine-level sampling blocks share some probe positions at the boundary, so that adjacent sampling blocks can still obtain consistent color sampling results on the common boundary after merging. Specifically, during the merging process, the baking side will deduplicate the sampling positions shared by adjacent coarse-level sampling blocks at the boundary to avoid repeated path tracing, thereby reducing baking time while ensuring boundary continuity. In addition, after generating the coarse-level sampling block, the system also needs to backfill the coarse-level index for the empty positions not covered by the fine-level or intermediate-level layers, so that the empty areas can fall back to the coarse-level sampling block for color sampling during runtime, ensuring full scene coverage without omissions.

[0038] Optionally, the dual-index structure includes a first index for masking sampling and a second index for color sampling, with different granularities, pointing to fine-level and coarse-level sampling blocks respectively. The key aspect of the dual-index structure is separating the addressing paths of masking sampling results and indirect color sampling results, allowing high-frequency masking data and low-frequency color data to be accessed independently according to their respective granularities. As one implementation, the first index can cover fine-level, intermediate-level, and coarser-level data to ensure masking values ​​are available at each level; the second index only covers intermediate-level and coarser-level data, without creating a separate low-frequency color index for the fine-level, thus allowing fine-level sampling points to reuse coarse-level color sampling results from the same spatial region when color data is needed.

[0039] Optionally, to support the aforementioned reuse relationship, the second index in the dual-index structure is associated with the first index through leaf page numbers: when the first index hits a fine-grained sampling block, the system can directly determine the corresponding coarse-grained color sampling block number through the leaf page number of the fine-grained level, without needing to maintain an additional mapping table from fine to coarse levels. This association method is solidified during the baking stage. For example, it requires that the leaf page number assigned to the coarse-grained unit containing the fine-grained level is equal to the sequence number of the corresponding coarse-grained color sampling block in the color atlas. At runtime, only two data reads need to be performed based on this invariant to obtain the occlusion value and color value respectively. Furthermore, this structure is not only applicable to static scenes, but can also reuse the same set of dual indices during dynamic object addressing, enabling moving characters to always quickly switch to the appropriate level and obtain the corresponding lighting data based on their world coordinates.

[0040] In step S230, occlusion sampling and color sampling are performed on each sampling point at each level to obtain occlusion sampling results and indirect color sampling results. The indirect color sampling results do not include the occlusion factor. In this way, occlusion sampling and color sampling are performed separately and the color results are not multiplied by the occlusion factor, so that they can be stored and processed independently at different levels. This reduces the amount of low-frequency color data and supports runtime adaptation to different sky conditions based on the same set of color data.

[0041] In one implementation, the baking side emits occlusion rays to all probe points at the fine, intermediate, and coarse levels, statistically analyzing whether the path is blocked by geometry or escapes to the external environment, obtaining a scalar visibility ratio as the occlusion sampling result. Simultaneously, color rays are emitted only to the probe points at the intermediate and coarse levels, accumulating the incident radiance from local light sources, sunlight, and scene bounce light to obtain the low-frequency diffuse indirect lighting color without considering visibility occlusion. Since the color branch explicitly does not multiply by the occlusion factor during integration, the same set of color sampling results can be multiplied with the dynamically changing sky color during runtime, while the occlusion data remains independently reused.

[0042] like Figure 5The diagram illustrates a core baking process, showcasing the detailed baking workflow from scene data to final encoded resources. The process includes: Start Baking → Ray Field Construction → Mesh Construction → Geometric Filtering → Coarse Hierarchy Construction (divided into two parallel paths: Baking Occlusion → Occlusion Post-Processing; Baking Color → Color Post-Processing) → Probe Packaging → Index Construction → Curve Fitting → Encoding Resources → End. This flowchart provides a more detailed explanation of the internal processing steps within the baking stage.

[0043] Optionally, occlusion sampling is used to emit rays at each level of probe point and statistically analyze the visibility ratio to obtain scalar occlusion results that reflect geometric occlusion relationships.

[0044] Optionally, occlusion sampling can be implemented through path tracing. The baking side emits several occlusion sampling rays for each probe point at each level of the multi-level sampling structure. If a ray intersects with the scene geometry, occlusion is recorded; if it misses and escapes into the external environment, it is included in the visible channel. Finally, the average visibility ratio or scalar occlusion value at that probe point is calculated. It should be noted that occlusion sampling does not accumulate incident light color or introduce material albedo. Its integration objective is limited to geometric visibility itself. Paths with multiple bounces can have their weights reduced according to a geometric decay function to represent the visibility decay after multiple occlusions. In one possible implementation, an initial geometric weight of 1 is set for an occlusion path. Each time, the geometric bounce direction is sampled in a local hemisphere. If the path eventually escapes, the current weight is included in the result; if it is occluded, the process terminates or continues decaying. This occlusion sampling result can be used for fitting and compression, or it can be multiplied with independently sampled color results at runtime to recover occluded indirect lighting without repeatedly storing the complete diffuse global illumination. The specific details regarding the number of shielding rays, the maximum number of bounces, and the geometric decay function can be flexibly set according to the complexity of the scene, the baking time budget, and the accuracy requirements of the target platform. This application does not impose any limitations on these details.

[0045] Optionally, color sampling is used to accumulate the incident radiance at coarse-level probe points and integrate it over diffuse reflection to obtain an indirect color result that does not include the occlusion factor. Optionally, color sampling can be performed on probe points within the coarse-level range based on a path tracing framework. The baking side emits a color sampling ray at each unique probe location, accumulating the incident radiance from local light sources, sunlight, ambient light, or reflected light from the scene surface during path propagation, and obtaining the low-frequency color response at that probe point based on the diffuse reflection integral. Considering that the occlusion factor is already provided by a separate occlusion sampling branch, to avoid excessively dark indirect lighting due to repeated multiplication of visibility, color sampling explicitly excludes the independent occlusion term in the integration target; that is, the visibility ratio at the probe is not used as a multiplier when integrating the incident radiance.

[0046] Optionally, the indirect color sampling result is intended to represent the diffuse indirect lighting color without visibility occlusion, so that it can be stored independently of the occlusion sampling result and combined at runtime. Optionally, the indirect color sampling result can be high dynamic range color data, which only reflects the low-frequency color transmission determined by the light source, environment, and multiple reflections, without carrying geometric visibility information of the probe position. In other words, the result is mathematically equivalent to separating the incident radiance term and the visibility term in the rendering equation, and then performing a hemispherical integral on the radiance to obtain the independent response. This separation allows the same set of color data to be reused under different sky or weather conditions. At runtime, the current sky color is multiplied by the indirect color sampling result, and then combined with the occlusion value to obtain the final diffuse global illumination, avoiding the need to repeatedly bake complete lighting data for each sky condition.

[0047] In an optional implementation, occlusion sampling includes: emitting occlusion sampling rays at each sampling point; determining the visibility ratio at the sampling point based on the intersection of the rays with the scene geometry to obtain a scalar occlusion sampling result; and performing post-processing on the scalar occlusion sampling result, including outlier correction and boundary marking, to obtain a post-processed occlusion sampling result. In this way, by independently performing scalar visibility estimation and outlier correction and boundary marking, the geometric accuracy of the high-frequency occlusion signal is ensured, and a continuous data foundation is provided for subsequent compression and layer transitions.

[0048] In one implementation, the baking side traverses all probe blocks and calculates the world position of each sampling point. Then, it emits occlusion sampling rays and calculates the visibility ratio based on the intersection and escape of the rays with the scene geometry to obtain scalar occlusion sampling results. After that, post-processing is performed on the scalar occlusion sampling results, including clamping and repairing outliers that fall inside the geometry or are affected by noise, and marking the boundary attributes of sampling points located on the layer transition surface for use in subsequent pre-fit transition fusion.

[0049] Optionally, the masked sampling ray is designed to detect geometric occlusion around the sampling point and obtain spatial high-frequency visibility information by statistically analyzing the ray escape ratio.

[0050] Optionally, the occlusion sampling ray is not used to calculate illumination color transmission, but specifically to estimate geometric visibility or sky visibility. For each sampling point, the system emits rays in multiple directions. When a ray escapes to the external environment without hitting the scene geometry, a visibility event is accumulated. When a ray hits an opaque surface, it continues to bounce locally in a hemispherical manner according to the geometric attenuation rule to search for possible channels to the external environment between occluders. It should be noted that the number of rays can be dynamically adjusted during the offline baking stage according to the scene complexity and quality requirements. The intersection detection can be implemented through a software ray intersection backend or through a hardware acceleration structure; this application does not limit this. The output of this ray sampling process is scalar visibility, which is not modulated by the light source color or material albedo, thereby achieving decoupling of occlusion and color at the source.

[0051] Optionally, scalar occlusion sampling results record the average visibility or occlusion level at the sampling point as a single-channel value, without carrying illumination color information.

[0052] Optionally, the scalar occlusion sampling result can be represented as the average visibility ratio at the sampling point. A higher value indicates weaker surrounding geometric occlusion and higher visibility of the external environment or sky, while a lower value indicates that the sampling point is located near a corner, gap, or contact surface and is more heavily occluded. As one possible implementation, this result can be recorded as a single-channel floating-point value or a fixed-bit-width integer, and further converted to a more perceptually friendly square root space for quantization and storage during the subsequent packaging stage. It should be noted that this scalar result is independent of the indirect color sampling result and is not multiplied by diffuse color or spherical harmonic coefficients. This allows visibility to be multiplied and combined with low-frequency colors as a post-occlusion factor during runtime, avoiding redundant storage of occlusion information in the low-frequency color data. In this way, high-frequency occlusion details and low-frequency color data can be maintained separately at different resolutions and data formats, avoiding storage redundancy caused by embedding them in the same data volume.

[0053] Optionally, outlier correction aims to clamp and repair noise points, internal penetration points, or extreme values ​​generated by path tracing, ensuring the reasonableness of the input data. Optionally, considering that path tracing is prone to generating noise, flying points, or abnormal penetration values ​​due to numerical precision in dense geometry or narrow regions, after obtaining the original scalar occlusion sampling results, the baking side first clamps extreme values ​​that significantly deviate from the neighborhood distribution, and repairs or removes invalid sampling points that fall inside the geometry or below the surface depth. As a possible implementation, the above correction may include: boundary clamping of values ​​exceeding a reasonable range, querying the nearest surface normal for probes located inside the geometry and extrapolating for repair, and smoothing isolated noise points by neighborhood-weighted filtering. It should be noted that the specific strategy for outlier correction described above is just one example. In actual implementation, the baker can adaptively select the filter kernel size or repair radius based on the scene material characteristics and the number of ray samples; this application does not intend to limit this. One purpose of this step is to prevent outlier data from directly entering subsequent curve fitting, thereby reducing jump artifacts in the reconstruction stage.

[0054] Optionally, boundary markers are used to identify sampling points at the boundary between fine and coarse levels in the hierarchical transition region, providing a location basis for subsequent continuous processing. Optionally, this boundary marker is executed in the post-processing stage after obtaining the scalar occlusion sampling results, and its identification basis is the hierarchical adjacency relationship of the sampling points in space: if the probe block where the current sampling point is located and the adjacent region are represented by different levels, then the sampling point is marked as a hierarchical boundary sampling point. Further, in the subsequent pre-fit transition fusion stage, the system can use this marker to quickly locate the boundary position that needs to be aligned with the parent level data, and use the trilinear sampling results of the corresponding position of the parent level to replace or mix the fine level boundary occlusion value, so that the anchor point absorbs cross-level transition information before quantization. It should be noted that the boundary marker can not only be used for pre-fit fusion, but also provide a position reference for the synchronization of asymmetric curvature ratio after fitting; the above-mentioned hierarchical boundaries include both the transition surface between fine and medium levels and the transition surface between medium and coarse levels, which this application does not limit. This design avoids cross-level jumps caused by independent fitting of compression parameters, ensuring the continuity and consistency of runtime reconstruction.

[0055] In an optional implementation, color sampling includes: emitting color sampling rays at sampling points within the coarse-level sampling range, accumulating the incident radiance and integrating it according to diffuse reflection to obtain the indirect color sampling result, where the coarse-level sampling range corresponds to the spatial region covered by the coarse-level sampling block; and deduplicating the sampling positions shared by adjacent sampling blocks at the boundary to obtain a unique set of color sampling positions. This confines indirect color sampling to the coarse-level range, avoiding redundant baking of low-frequency colors at the fine-level, while reducing redundant ray tracing by deduplicating shared positions at the boundary, significantly compressing baking time and texture storage overhead.

[0056] In one implementation, after completing the index construction of the multi-level sampling structure, the baking side initiates a color sampling task only for the spatial region covered by the coarse-level sampling block. Specifically, for each sampling point within this coarse-level range, the system emits multiple color sampling rays along the hemispherical direction. As the rays propagate in the scene, each time a surface is hit, the corresponding incident radiance is accumulated based on the surface's material albedo and the incident light direction. When the diffuse reflection condition is met, the rays continue to bounce to neighboring areas. When the tracking depth of a single path reaches a preset upper limit or the ray escapes outside the scene, the path is terminated, and the radiance contributed by that path is added to the current sampling point. Subsequently, the system weights and sums the accumulated incident radiance in each direction of the sampling point according to the positive cosine of the angle between the normal and the ray direction, and normalizes it. Then, it performs diffuse reflection integration to obtain the indirect color sampling result at that location that does not contain occlusion factors. Furthermore, to avoid adjacent coarse-level sampling blocks repeatedly emitting rays to the same world space coordinates in the boundary overlapping area, the baking side traverses the probe coordinates at the four corners and edges of all sampling blocks before officially starting the tracing, identifies and eliminates duplicate coordinates, and retains only a unique set of color sampling positions. Subsequently, actual path tracing is only performed on this set, thereby reducing the amount of redundant calculations in the baking stage.

[0057] Optionally, color sampling rays are emitted in multiple directions to absorb incident light, and their quantity and distribution can be configured according to the baking quality preset conditions. Optionally, color sampling rays are tracking rays emitted from each sampling point of the coarse-level sampling block into the scene space to estimate the color of indirect lighting, and their quantity and distribution can be flexibly set according to the baking quality preset conditions. Considering that the spatial scale covered by the coarse-level sampling block is usually larger than that of the fine-level unit, and the color transmission path between adjacent surfaces in the scene is relatively smooth, as a possible implementation, the above-mentioned color sampling rays can adopt a uniform hemispherical distribution, a cosine-weighted distribution, or an adaptive distribution based on importance sampling; if the ray hits an opaque geometric surface during propagation, the color weight of the current path is updated according to the material albedo and incident light brightness of the hit point, and the ejection direction is sampled again in the local hemisphere to simulate multiple diffuse reflection bounces. If the ray does not hit the scene geometry within the set number of bounces and escapes to the external environment, the ambient light contribution of the escape direction is included in the incident radiance of the sampling point according to the current path cumulative weight. It should be noted that the color sampling ray is only responsible for the transmission and estimation of color information, and does not include the visibility occlusion factor of the sampling point itself in the path weight, thereby keeping the occlusion item and the color item decoupled at the data level, providing a basis for independent multiplexing and dynamic sky modulation at runtime.

[0058] Optionally, the incident radiance represents the light energy density recorded by the sampled ray, determined by the outgoing radiance of the hit surface or the ambient light source radiance.

[0059] Optionally, incident radiance is a measure of light energy recorded by the color sampling ray each time it intersects the scene surface or reaches infinity. Physically, it represents the radiance value incident at the sampling point along a specific solid angle. When the color sampling ray first hits a diffuse surface, the incident radiance at that point can originate from a local artificial light source, directional light, or self-illumination. The system multiplies this radiance value by the color flux weight of the current path and adds it to the total response of the sampling point. Furthermore, if the current path continues to bounce towards the next surface, the new incident radiance is determined by the lighting environment of the next hit point and must be multiplied by the albedo of the previous surface to reflect energy attenuation. To avoid high-frequency noise, the incident radiance can be sampled not only once on a single ray but also by averaging after micro-jitter sampling in similar directions. It should be noted that the incident radiance in this embodiment is strictly different from the scalar visibility estimation of the occlusion sampling. It does not carry geometric occlusion ratio information, but simply records the contribution of light color transmission, thereby ensuring that there will be no logical error of repeatedly multiplying the visibility factor when it is combined with the occlusion value.

[0060] Optionally, the diffuse reflection integral sums the radiance in each direction according to cosine weights to obtain a low-frequency indirect color response without shading factors.

[0061] Optionally, the diffuse reflection integral is a calculation process in which the incident radiance carried by each ray is weighted and integrated over the hemispherical space according to the cosine law after tracing multiple color sampling rays at the sampling point. Considering that the diffuse surface exhibits approximately uniform reflection characteristics to incident light from different directions, as a possible implementation, the above diffuse reflection integral can be expressed as the arithmetic mean of the contribution values ​​of all effective paths within the sampling hemisphere multiplied by a coefficient of pi, or by directly summing the product of the incident radiance in each direction and the cosine of the angle between the normal and the ray, and then normalizing. One objective of this embodiment is to transform the discrete ray tracing results into a direction-independent scalar or vector color response through the diffuse reflection integral, thereby adapting to the subsequent storage strategy of only storing low-order average illumination response and significantly compressing the data bandwidth occupied by high-frequency angle information.

[0062] Optionally, sampling location deduplication is used to remove duplicate coordinates of adjacent block boundaries, ensuring that color tracking is performed only once at the same spatial location.

[0063] Optionally, deduplication of sampling positions at the boundaries of adjacent sampling blocks is a process that checks and removes duplicate sampling point coordinates shared by adjacent sampling blocks at the 3D interface after generating coarse-level sampling blocks and before performing color sampling ray tracing. Since coarse-level sampling blocks are usually organized with overlapping boundaries to ensure continuous interpolation at runtime, there will be probe positions with completely overlapping world space coordinates at the interface of each block. If deduplication is not performed, the same coordinate will be assigned to independent ray budgets by different sampling blocks, causing the computational and storage costs of the baking stage to expand linearly with the number of blocks.

[0064] like Figure 6 The diagram illustrates a runtime sampling process, showcasing the detailed sampling flow from world coordinates to final lighting output during runtime. The process includes: world coordinate input → conversion to mesh coordinates → reading the coarse index → ​​determining validity (returning zero if invalid) → determining whether further investigation is needed → reading the page table / direct index → ​​determining the layer → obtaining local coordinates → solving the curvature ratio and reconstructing occlusion / sampling colors → combining lighting → outputting the result. The diagram includes two decision diamonds, demonstrating the efficient runtime lookup mechanism.

[0065] In an optional implementation, the step of emitting color sampling rays from sampling points within the coarse-level sampling range further includes: writing a unit response to rays escaping into the external environment, enabling the runtime to modulate different sky colors using the same set of indirect color sampling results. In this way, after writing a unit response to rays escaping into the external environment, the runtime phase can reuse the same set of indirect color sampling results to modulate different sky colors, avoiding the need to repeatedly bake data for multiple sets of sky states, significantly reducing storage redundancy and baking overhead while preserving the ability to handle environmental changes.

[0066] For example, during the baking stage, when performing color sampling path tracing on coarse-level sampling points, if a diffuse ray escapes to the external sky environment after several bounces without hitting any scene geometry, the baking side does not write the fixed color value of the current sky into the sampling result of that path, but instead writes it into a standardized unit brightness response. During the runtime stage, when the client queries the indirect color sampling result of that sampling point, it can directly use the unit response to multiply with the dynamic sky color or environmental spherical harmonic coefficient at the current moment to obtain diffuse indirect lighting that matches the current weather or day / night state, without having to maintain multiple independent baking texture resources for different sky states.

[0067] Baking side execution: Dynamic sky mode processing. When dynamic sky mode is enabled, the baking side treats sky escape as a white unit response, which is then modulated according to the current sky color at runtime.

[0068] Traditional diffuse indirect lighting can be represented by the hemispherical integral in the rendering equation:

[0069] Where Li represents the incident radiance, and V represents the geometric visibility from probe position p along direction ωi. Traditionally, the color and visibility terms are solved simultaneously in the same integral. This scheme decomposes the integral into two independent path-tracking estimators:

[0070] In this method, AO path tracing only estimates geometric visibility or sky visibility, without accumulating illumination color. For an AO path, its state can be represented as a scalar geometric weight Gb, initially set to 1. When the path misses the scene and escapes to the external environment, the current Gb is included in the visibility result. When the path hits a surface, material albedo ρ and illumination color Li are not introduced; instead, geometric bounce directions are sampled again in the local hemisphere. Multiple bounces do not solve for color reflection but rather search for whether a visible path to the external environment still exists between occluders. As the number of bounces increases, Gb decreases according to the geometric decay function s(b), which is used to express the visibility decay after multiple occlusions. Therefore, AO path estimation can be summarized as:

[0071] in, This indicates whether the path escapes into the external environment after propagation b. This result is scalar visibility and is not modulated by the color of the light source or the material color.

[0072] U-Diffuse-GI path tracing only estimates diffuse color transmission without an independent AO term. For a diffuse path, its state is color flux Tb. Each surface bounce updates T_{b+1}=Tb·ρb according to the material albedo, and accumulates the incident radiance from local light, sunlight, sky, or ambient probes. The visibility test here is only used to determine whether a certain lighting sample or path segment can transmit light energy; it does not introduce scalar occlusion results from the AO branch, nor does it use geometric survival attenuation or Russian Roulette-style compensation for visibility estimation. In other words, the diffuse branch calculates the color transmission integral of Li, and the AO branch calculates the occlusion integral of V; the two are not multiplied during baking. Its path estimation can be summarized as follows:

[0073] In dynamic sky mode, when the diffuse path escapes to the sky, it does not write a fixed sky color, but writes a white unit response, so that the same set of U-Diffuse-GI data can be modulated at runtime using the current sky color.

[0074] At runtime, AO(p) and U-Diffuse-GI(p) are reconstructed separately based on the sampling location and combined to obtain occluded diffuse indirect lighting. The core of this process lies in decoupling the visibility factor V in the rendering equation from the incident radiance integral, allowing high-frequency geometric occlusion and low-frequency color transmission to be stored, compressed, interpolated, and sampled separately. Since U-Diffuse-GI is not pre-multiplied by AO occlusion during baking, it only needs to be multiplied by the reconstructed AO once during runtime combination; this avoids redundant occlusion caused by low-frequency color data already containing occlusion and multiplying by AO again at runtime, preventing the result from being too dark. Conversely, the AO branch does not carry lighting color, avoiding the occlusion term being superimposed as a luminance term during combination, preventing the result from being too bright. Therefore, the two decoupled branches retain the physical meaning of "color without occlusion" and "occlusion without color," respectively, and have a clear one-time modulation relationship during combination.

[0075] Optionally, rays escaping into the external environment refer to light paths that do not match the scene geometry in the color sampling and pass through the scene boundary.

[0076] Optionally, during the propagation of color sampling rays emitted from coarse-level sampling points, if a ray, after one or more surface bounces, is not blocked by scene geometry and eventually passes through a predefined scene boundary or sky sphere, it is considered an escape ray to the external environment. It should be noted that the determination of such rays is not limited to a specific ray length threshold; it can be a ray that flies directly out of the scene bounding box after a single long-distance roam, or a ray that finds a window or opening in a closed indoor scene and passes through to the external environment. In traditional baking processes, such rays are usually directly accumulated with fixed color values ​​of the external environment or sky, causing the sampling results to be bound to a specific sky; however, this solution identifies them as decoupled dynamic items, thus supporting runtime replacement with any sky color. Furthermore, the identification logic for escape rays can also be combined with the nearest hit distance in the ray hit record, the intersection detection of the hit surface normal direction and the scene bounding box, to ensure that rays hitting distant back surfaces are not easily mistaken for escape rays at complex geometric edges, improving the robustness of dynamic sky color decoupling.

[0077] Optionally, the unit response is a normalized baseline value written to the escape ray during the color sampling phase, which is used to multiply the dynamic sky color at runtime to restore the target illumination.

[0078] Optionally, unit response refers to the normalized luminance reference value written for rays escaping into the external environment during the color sampling stage. Its specific value can be a scalar of 1.0 or an equivalent unit vector under high dynamic range encoding. Considering that traditional methods directly bake a fixed sky color into the indirect color sampling result, if multiple lighting atmospheres such as dawn, noon, and dusk need to be supported within the same set of data, multiple sets of texture resources must be saved, resulting in a significant increase in video memory and baking time. However, with unit response, all sky color contributions are normalized to a uniform magnitude. During runtime, the current actual sky color or spherical harmonic ambient light coefficient is multiplied and superimposed onto this reference, thus restoring the target lighting effect.

[0079] Optionally, different sky colors refer to the environmental top lighting colors that change dynamically over time or with the weather during the operation phase, and can be multiplied with the unit response to achieve multi-atmosphere reuse.

[0080] Optionally, different sky colors refer to the colors of the ambient overhead lighting that are dynamically replaced or gradually transitioned according to the actual situation during the runtime phase. These can include, but are not limited to, the warm orange sky light at dawn, the high-brightness blue-white sky light at noon, the low-saturation diffuse gray sky light on a cloudy day, or the magenta twilight at dusk. For example, when the time system in the virtual scene progresses from day to night, the runtime phase does not need to reload or switch baked textures. Instead, it continuously reads the unit response from the same set of indirect color sampling results and multiplies it by the current sky color or the updated spherical harmonic coefficients. This allows areas significantly affected by the sky, such as building facades and open ground, to present diffuse indirect lighting that matches the current time atmosphere without increasing additional storage overhead. Furthermore, sky color changes can also be linked with the weather system. For example, different sky color presets can be loaded for cloudy, rainy, or dusty environments, ensuring the reusability of the unit response mechanism remains universal under broader dynamic environmental requirements.

[0081] In step S250, an index addressing structure is established. This structure is used to establish a reuse relationship between fine-level and coarse-level layers, allowing the indirect color sampling results of fine-level sampling points to reuse the indirect color sampling results of coarse-level sampling points in the same spatial region. This index addressing structure establishes a reuse relationship between fine-level and coarse-level indirect colors, avoiding redundant storage of low-frequency color data at the fine-level, effectively reducing the overall size of texture resources and maintaining data consistency between layers. In one embodiment, after generating the L0 (finest level), L1 (intermediate level), and L2 (coarsest level) probe blocks, the baking side further establishes index entries for coarse-grained units: for a 4×4×4 coarse-grained spatial region containing L0 child nodes, an accompanying index entry is created and a leaf page number is assigned, which is consistent with the sequence number of the corresponding L1 accompanying block in the low-frequency color atlas; for regions not containing L0 child nodes, a basic index entry is created to directly store the L1 basic block or L2 probe block sequence number. Based on this, when the runtime hits the L0 fine-level occlusion block, there is no need to query the mapping table. The indirect color data of the corresponding L1 scale can be obtained directly from the index entry of the same coarse-grained unit, realizing the direct reuse of the coarse-level color sampling results of the fine-level sampling points for the same spatial region.

[0082] Optionally, the index addressing structure establishes reusable associations between levels through coarse-grained and secondary index entries, and supports fast addressing of fine-grained and coarse-grained levels at runtime.

[0083] Optionally, the above index addressing structure can be designed as a two-level indirect addressing architecture, which includes at least a coarse-grained index layer and a leaf page table layer. Each index entry in the coarse-grained index layer covers a spatial region of several fine-level spatial units. The entry content indicates whether the target region is directly covered by the coarse-level sampling block or requires further querying through a secondary index to access the fine-level sampling block. When the target region contains fine-level sampling points, the corresponding entry is marked as an accompanying index entry, and a secondary index identifier pointing to the leaf page table is generated. When the target region does not contain fine-level sampling points, the corresponding entry is marked as a basic index entry, directly recording the identifier information of the coarse-level sampling block. It should be noted that the above two-level structure is just one example, and this application does not intend to limit the hierarchical depth and arrangement of the index addressing structure. In other embodiments, it can be extended to more levels of indexes or use other data organization forms such as three-dimensional textures or structured buffers, as long as it can achieve the reuse of coarse-level indirect color sampling results by the fine-level layer. Furthermore, index entries can also simultaneously carry spatial boundary continuity parameters, such as the four-corner scale data used for asymmetric curvature correction, so that addressing information and boundary interpolation parameters can be obtained synchronously in a single index read, thereby reducing the additional texture access overhead at runtime.

[0084] Optionally, the reuse relationship allows fine-level sampling points to reuse color results from the same coarse-level region, thereby reducing the overall size of texture resources. Optionally, the above reuse relationship can be manifested as unidirectional reuse of low-frequency color data within the same coarse-grained spatial region. Specifically, when the coarse-grained index entry corresponding to a fine-level sampling point is marked as an accompanying index, the secondary index identifier allocated by the system for this region not only points to the leaf page number of the fine-level occlusion data but also requires that the leaf page number be consistent with the sequence number of the accompanying block responsible for low-frequency colors in the corresponding coarse level. Thus, at runtime, after hitting any sub-unit of L0 through the leaf page, the diffuse color sampling can be directly completed using the L1 low-frequency color block associated with the same page number, without needing to store complete indirect color data within the L0 probe block. It should be noted that the above equivalence between page number and sequence number is one implementation example of establishing a reuse relationship. In actual implementation, the correspondence between fine-level spatial regions and coarse-level color sampling blocks can also be established through pointers, offsets, or independent mapping tables. This application does not limit the specific association form. By establishing this reuse relationship, on the one hand, we can avoid the most numerous fine-level probe blocks from carrying high bit-width color information, thereby compressing the overall resource volume; on the other hand, we can also ensure the consistency of high-frequency occlusion details and low-frequency color information in spatial position, so that the indirect lighting results obtained by the final combination maintain the correct correspondence at the level transition.

[0085] In an optional implementation, establishing the index addressing structure includes: generating coarse-grained index entries based on a second index, wherein the coarse-grained index entries cover a preset number of fine-level spatial units; when the coverage area corresponding to a coarse-grained index entry contains fine-level sampling points, the coarse-grained index entry is marked as an accompanying index entry, and a secondary index identifier is generated for the accompanying index entry, which is used to establish the association between fine-level addressing information and the corresponding coarse-level sampling block; when the coverage area corresponding to a coarse-grained index entry does not contain fine-level sampling points, the coarse-grained index entry is marked as a basic index entry, and the basic index entry directly stores the coarse-level sampling block identifier. In this way, by uniformly covering fine-level spatial units with coarse-grained index entries and distinguishing the presence or absence of fine-level sampling points by using accompanying index entries and basic index entries, not only can a clear association be established with the coarse-level sampling block through the secondary index identifier when a fine-level sample is hit to reuse low-frequency color data, but it can also directly hit the coarse level in open areas, reducing redundant index storage and improving runtime addressing efficiency.

[0086] In one implementation, after the baking side completes the creation of fine-level and coarse-level probe blocks, it begins to construct a two-level addressing structure. Specifically, (1) a coarse-grained coverage area is formed by using 4×4×4 fine-level spatial units as a coarse-grained coverage area, and corresponding coarse-grained index entries are generated; (2) it is determined whether there are valid fine-level sampling points within the coverage area: if there are, the coarse-grained index entry is marked as an accompanying index entry, and a secondary index identifier is generated to point to the fine-level addressing data structure, while recording the association information of the coarse-level sampling block corresponding to the area; if there are no, it is marked as a basic index entry, and the coarse-level sampling block identifier is directly stored so that it can be directly hit at runtime. Through this structure, fine-level areas can be quickly associated with coarse-level low-frequency color data, while empty areas do not require additional fine-level lookups, thereby reducing the amount of index data while maintaining the decoupled reuse relationship.

[0087] Optionally, coarse-grained index entries cover a preset number of fine-level spatial units as top-level addressing units to map to hierarchical sampling block identifiers or secondary index entries.

[0088] Optionally, the coverage granularity of the aforementioned coarse-grained index entries can be flexibly set according to scene complexity and storage budget. In one implementation, a coarse-grained index entry can correspond to 4×4×4 fine-level spatial units, that is, covering an intermediate-level scale region, which contains 64 candidate fine-level units at the finest level. It should be noted that this coverage number is not uniquely limited; it can also correspond to 2×2×2 units or 8×8×8 units, as long as the spatial coverage of the coarse-grained index and the fine-level spatial grid have a calculable multiple relationship in coordinate mapping. By first mapping the three-dimensional spatial coordinates to the coarse-grained index, the system does not need to store an independent top-level index entry for each fine-level unit, thereby significantly reducing the total amount of data in the top-level index and reducing runtime memory usage and texture sampling overhead.

[0089] Optionally, along with the index entries, a coarse-grained region containing fine-level sampling points is marked, and a secondary index identifier is generated to establish the association between fine-level addressing information and the corresponding coarse-level sampling block.

[0090] Optionally, the core function of the accompanying index entry is to establish a reuse channel between fine-level occlusion data and coarse-level low-frequency color data. When a valid fine-level sampling point exists within the coverage area corresponding to the coarse-grained index entry, the system marks the entry as an accompanying index entry and generates a secondary index identifier. This secondary index identifier can point to a data page containing fine-level addressing information, while the coarse-level sampling block number corresponding to the accompanying index entry is reused as the source of low-frequency color data in the same spatial region. After the accompanying index entry is hit at runtime, on the one hand, the high-frequency occlusion value can be obtained by entering the fine-level search through the secondary index identifier; on the other hand, the indirect color sampling results in the coarse-level sampling block associated with the accompanying index entry can be directly reused, thereby achieving decoupled combination of occlusion and color without additional storage of fine-level low-frequency colors.

[0091] Optionally, the sequence association between the accompanying index entry and the corresponding coarse-level sampling block can be solidified using a unified sorting prefix. In one implementation, the baking side arranges the accompanying block, base block, and coarser-level blocks in sequence, so that the sampling block corresponding to the color sampling result is naturally located within the prefix range of the sampling block sequence corresponding to the masked sampling result. For coarse-grained regions containing fine-level sampling points, the page number associated with the secondary index identifier assigned by the system is consistent with the sequence number of the intermediate-level accompanying block in the low-frequency color atlas within that region.

[0092] Optionally, the basic index entry marks coarse-grained regions where fine-level sampling points are absent, directly storing coarse-level sampling block identifiers to achieve fast runtime hits. Alternatively, the basic index entry targets open or geometrically sparse coarse-grained regions where no valid fine-level sampling points exist, eliminating the need for fine-level searches. In this case, the coarse-grained index entry directly stores coarse-level sampling block identifiers, which can be the sequence number of intermediate-level basic blocks or even coarser-level blocks. At runtime, a single index read directly hits the corresponding low-frequency color and occlusion data. Since open areas often occupy a large proportion of the large-world scene, extensive use of basic index entries avoids creating fine-level probe blocks and additional secondary index data structures for blank areas, significantly reducing the total amount of index data and texture atlas size in sparse scenes. Furthermore, the basic index entry can be directly embedded in the coarse-grained index 2D texture, sharing the same texture layout and data width as the accompanying index entry, distinguished only by the entry value range. This allows runtime to identify the entry type and enter the corresponding sampling path through simple range judgment.

[0093] In an optional implementation, the fine-level addressing information pointed to by the secondary index identifier is used to hit fine-level sampling blocks, or to backtrack to the corresponding coarse-level sampling block at the location of a fine-level hole. In this way, by automatically backtracking to the coarse-level sampling block at the location of a fine-level hole, sampling breaks caused by missing fine-level data in sparse areas are avoided, ensuring the continuity of indirect illumination at the level transition of the two-level index structure.

[0094] In one implementation, the runtime client has already completed a coarse-grained index lookup based on world coordinates and hit the accompanying index entry. The client further enters the leaf page table for a secondary lookup based on the secondary index identifier. If a valid fine-level sampling block exists in the corresponding fine-level unit of the sampling point in the leaf page, the fine-level sampling block is directly hit and subsequent reconstruction is performed based on its occlusion data; if the sampling point happens to fall at the location of a fine-level hole, the leaf page entry is configured to point to the corresponding coarse-level sampling block, so that the sampling logic automatically falls back to the coarse-level sampling block in the same spatial region, thereby avoiding illumination breaks caused by the lack of fine-level elements and maintaining the integrity of the overall indirect illumination.

[0095] Optionally, fine-level hole location rollback is used to automatically retrieve coarse-level data at fine-level missing locations to maintain the hierarchical continuity of the sparse voxel structure. Optionally, the above-mentioned fine-level hole location rollback can be implemented through entry configuration in the leaf page table. In one embodiment, after a coarse-grained index entry is marked as an accompanying index entry, its secondary index identifier points to a leaf page containing 64 fine-grained entries; in this leaf page, each entry corresponds to a fine-level spatial location within a coarse-grained unit. When a valid fine-level sampling block exists at the fine-level spatial location, the leaf entry directly stores the index identifier of the fine-level sampling block, so that the runtime can find and read the corresponding occlusion sampling result after a secondary lookup. When the fine-level spatial location does not have geometric coverage and belongs to a fine-level hole, the leaf entry is not simply marked as invalid, but is configured to point to the coarse-level sampling block identifier corresponding to the coarse-grained region, such as the pre-established L1 (intermediate level) accompanying block number in the same region. In this way, when performing a secondary lookup at runtime, even if the independent fine-level data is not hit, it can still automatically backtrack to the coarse-level sampling block based on the same leaf entry and recalculate the sampling position using the local coordinates of the coarse level. Thus, the two types of operations, fine-level hit or coarse-level backtrack, can be completed within the same two-level index structure and the same page table read.

[0096] Optionally, considering that fine-level holes may not be completely empty, but rather local omissions due to geometric filtering thresholds or sparsification strategies, falling back to a coarse-level sampling block can still maintain reasonable illumination approximation. In another implementation, the runtime first determines whether the current region contains fine-level child nodes in the coarse-grained index, and then reads the leaf page to obtain fine-level addressing information. If the fine-level addressing information indicates that the current local coordinates are at a hole location, the runtime does not immediately return a zero value or error, but directly switches to the color or occlusion data of the coarse-level sampling block based on the parent-level association implicit in the index entry—for example, the leaf page number itself is equivalent to the sequence number of the corresponding L1 (intermediate level) accompanying block. Furthermore, to avoid visual seams caused by abrupt changes in hierarchy, the coarse-level sampling block may have previously undergone hierarchy boundary fusion during the baking stage, so that the low-frequency color or occlusion values ​​at its boundaries remain continuous with the adjacent fine-level data; therefore, the sampling results after falling back can transition naturally with the surrounding fine-level regions without introducing obvious illumination jumps due to the fallback operation itself. Furthermore, the aforementioned fallback path applies not only to U-Diffuse-GI (diffuse indirect lighting without multiplication by the occlusion factor) color sampling but also to AO (ambient occlusion) occlusion sampling, thus ensuring that both occlusion and color data can obtain a consistent hierarchical fallback source within any local region of a sparse voxel. For example... Figure 4 The diagram shows the volumetric probe distribution of U-Diffuse-GI (left) and AO (right), with a side-by-side comparison demonstrating the two GI rendering effects. The left image shows the diffuse lighting effect with color information, presenting a blue-white 3D terrain scene, including undulating mountains and tree models, with soft ambient occlusion and diffuse color information in the lighting. The right image is the corresponding pure AO (ambient occlusion) grayscale image, showing the occlusion relationship of different areas in the scene. Darker areas represent more occluded depressions, while lighter areas represent more exposed open areas.

[0097] In step S270, based on the index addressing structure, the occlusion sampling results and indirect color sampling results are packaged into texture resources. In this way, by arranging the color sampling blocks in the prefix range of the occlusion sampling block sequence, the layer attribution can be directly determined at runtime based on the probe block sequence number range, avoiding the need for additional storage of layer identifier bits and significantly reducing the index size and sampling branch logic.

[0098] In one example, after completing the masking and color sampling of probe blocks at all levels, the baking side performs the packaging stage. Specifically, the system first writes the sampling blocks corresponding to the accompanying index entries, the sampling blocks corresponding to the basic index entries, and the coarse-level sampling blocks into the low-frequency color atlas in sequence. Then, it writes the above three types of sampling blocks, along with the fine-level sampling blocks, into the masking atlas in sequence. Thus, the low-frequency color probe blocks form a prefix range in the overall probe block sequence. At runtime, by determining whether the current probe block sequence number is less than the total number of blocks in the color atlas, the system can distinguish whether the sequence number points to low-frequency color data or only to masking data. For example, when the sequence number carried by a coarse-grained index entry is less than the total number of color blocks, the system directly samples the low-frequency color atlas with that sequence number; if the sequence number is greater than or equal to the total number of color blocks, it is determined that a fine-level masking block has been hit, and the corresponding mid-level low-frequency color data is reused with the leaf page number, thereby completing the hierarchical decoupling access without adding an additional mapping table.

[0099] Optionally, this sequence concentrates color sampling blocks in the prefix region of the masked sampling block sequence to indirectly identify the hierarchical affiliation using the sequence number range. Optionally, this prefix arrangement can be implemented in the order of accompanying index block, basic index block, and coarse-level block, where the accompanying block handles low-frequency color reuse in fine-level masked regions, the basic block covers local areas without fine-level masking, and the coarse-level block is used for backtracking in more open spaces. It should be noted that the above order is not limited to a fixed arrangement of accompanying block, basic block, and coarse-level block. In actual implementation, the coarse-level block can be placed at the front or interleaved storage can be used according to data locality requirements, as long as the color sampling blocks are located within the prefix range of the masked sampling block sequence. This structure allows runtime to quickly determine which level of low-frequency color data is currently hit simply by comparing the probe block number with a preset boundary threshold, thereby separating the hierarchical determination logic from the index entries and reducing the storage bit width required for each index unit.

[0100] Optionally, texture resources include occlusion anchor point textures, curvature textures, and color atlases, organized as a two-dimensional texture array. Optionally, occlusion data, after curve fitting, is compressed into anchor point parameters and curvature parameters, stored in two-dimensional anchor point textures and two-dimensional curvature textures respectively. The anchor point textures store three anchor point information using a compact color format, while the curvature textures store curvature coefficients in a single channel. The low-frequency color atlas independently stores the color responses of mid-level and coarse-level probe blocks, excluding fine-level probe blocks. It should be noted that the above texture arrangement is not limited to independent two-dimensional textures; it can also be stored as a two-dimensional texture array. This separate layout allows runtime reading of occlusion parameters and color parameters from different textures, supports on-demand trimming of sampling paths, and improves the flexibility of the rendering pipeline.

[0101] In an optional implementation, the packaging includes arranging the sampling blocks in the order of sampling blocks corresponding to accompanying index entries, sampling blocks corresponding to basic index entries, and coarse-level sampling blocks, so that the sampling blocks corresponding to the color sampling results are located in the prefix range of the sampling block sequence corresponding to the masked sampling results. This concentrates the low-frequency color sampling blocks in the sequence prefix, allowing the runtime to determine the level solely based on the probe block sequence number range without requiring additional level bits, and enabling the direct reuse of low-frequency color data within the prefix region after a fine-level sampling point is hit.

[0102] For example, in the process of packaging probe blocks into an atlas, the system can first arrange the sampling blocks corresponding to the accompanying index entries with fine-level child nodes at the front, then arrange the sampling blocks corresponding to the basic index entries without fine-level child nodes, then arrange the coarser-level sampling blocks, and finally arrange the fine-level sampling blocks; among them, the low-frequency color atlas only includes the first three types of blocks, while the occlusion atlas includes all four types of blocks, so the color atlas naturally constitutes the prefix subsequence of the occlusion atlas.

[0103] Optionally, the accompanying index entry's corresponding sampling block is used to store coarse-level low-frequency color data for regions containing fine-level child nodes, and is reused by fine-level nodes at runtime. Optionally, the aforementioned accompanying index entry's corresponding sampling block plays a dual role in the data structure: on the one hand, the sampling block itself stores the low-frequency diffuse color response of the corresponding coarse-grained spatial region, directly serving the coarse-level color query needs within that region; on the other hand, since the sampling block is placed in the prefix region in the global sequence, and its sequence number strictly matches the corresponding leaf page number, when the runtime enters the region to which the sampling block belongs after hitting a fine-level sampling point, it can directly locate the sampling block based on the leaf page number and reuse its color data, without needing to maintain an additional color mapping table from the finest level to the intermediate level. Considering the high sensitivity of mobile graphics processors to random access and table lookups, solidifying the color reuse relationship into a prefix sequence number convention can reduce video memory usage while reducing runtime addressing instruction overhead. In actual implementation, the sampling block can also use a five-by-five-by-five probe structure to store low-frequency colors and organize them through a two-dimensional texture atlas to facilitate unified addressing with subsequent fine-level occlusion atlases.

[0104] Optionally, the sampling block corresponding to the basic index entry is used to store low-frequency color data of areas without fine-level hierarchy, directly responding to color sampling requests for that area.

[0105] Optionally, the sampling blocks corresponding to the aforementioned basic index entries are suitable for spatial areas in the scene that lack complex geometric details or do not require high-frequency occlusion representation, such as open outdoor flat ground or open areas far from objects. Since no fine-level sampling points are deployed within the coverage area of ​​this sampling block, the system does not need to create additional leaf page tables for it; the coarse-grained index can directly hit this sampling block and read low-frequency colors. From a storage layout perspective, arranging this type of sampling block after the sampling blocks corresponding to the accompanying index entries and before the coarser-level sampling blocks helps to form an orderly transition from high-frequency associated regions to purely low-frequency regions, allowing the color atlas to centrally manage all intermediate-level color data in the prefix section, whether it is accompanying or basic. It should be noted that, in specific implementations, this sampling block can use the same internal probe density and data format as the sampling blocks corresponding to the accompanying index entries, differing only in index relationships and sequence affiliation. This consistency helps simplify runtime branching logic and unify texture sampling code paths.

[0106] Optionally, sequential arrangement refers to arranging the accompanying blocks, base blocks, and coarse-level sampling blocks in sequence to form a hierarchical sequence structure. Optionally, the above sequential arrangement aims to establish a hierarchical prefix relationship between color data blocks and occlusion data blocks through explicit packing rules, thereby compressing the hierarchical identification information that originally needed to be stored independently into the implicit dimension of the sequence number range. As a possible implementation, this arrangement can be specifically implemented as follows: first, write the sampling blocks corresponding to all accompanying index entries with fine-level child nodes to the beginning position of the atlas; then, append the sampling blocks corresponding to base index entries without fine-level child nodes; subsequently, write the coarser-level sampling blocks; and finally, write the fine-level sampling blocks. The sampling blocks corresponding to the accompanying index entries and the sampling blocks corresponding to the base index entries together constitute the prefix set of the color data, and the fine-level sampling blocks only appear in the suffix part of the occlusion sequence.

[0107] Optionally, the prefix range refers to the color sampling blocks being arranged in the starting segment of the masked sampling sequence, and being concentrated at the front end.

[0108] Optionally, the aforementioned prefix range is not only a convenient arrangement in terms of storage layout, but also an index invariant that is strictly constrained to support efficient addressing at runtime. Specifically, the establishment of this prefix range makes the low-frequency color atlas a proper subset of the complete occlusion atlas in physical storage. When the runtime reads any probe block number, if it is determined that the number is less than the total number of blocks in the color atlas, it is directly used as the color atlas index for sampling; if it is determined that the number is greater than or equal to the total number of blocks in the color atlas, it means that a fine-level sampling block containing only occlusion data has been hit. Since the boundary of this range has been fixed during the baking and packaging stage, the runtime does not need to separately save the offset or pointer to the color atlas for each spatial location, thus reducing the association between the two atlases to a single integer comparison operation.

[0109] In step S290, during runtime, texture resources are read according to the indexed addressing structure to obtain occlusion values ​​and indirect color values, which are then combined to obtain indirect lighting results. In this way, by reading and decoupling the occlusion values ​​and indirect color values ​​according to the indexed addressing structure at runtime, high-frequency occlusion details can be preserved while reducing sampling bandwidth, allowing pixel-level volumetric lighting to adapt more smoothly to mobile terminal graphics processors.

[0110] In one implementation, when the rendering pipeline performs volumetric lighting sampling in the deferred lighting or forward lighting channel, it first converts the world coordinates of the current pixel into voxel lighting mesh coordinates and offsets them by a preset distance along the surface normal direction to avoid self-intersection. Then, it determines whether to hit the coarsest level direct sampling, the intermediate level base block direct sampling, or the accompanying index containing the fine level by using coarse-grained index entries. For the accompanying index, it enters the leaf page table for a second lookup to hit the fine level probe block. After a hit, if complete indirect lighting is required, it reconstructs the occlusion value from the occlusion texture and samples the indirect color value that has not been multiplied into the occlusion from the low-frequency color texture. The two are then multiplied and combined according to the current sky color, material occlusion attributes, and intensity parameters to obtain the final occluded diffuse indirect lighting result.

[0111] Optionally, during runtime, the texture is read based on the index and the occlusion and color values ​​are reconstructed, and the indirect lighting results are output after multiplication and combination.

[0112] Optionally, the runtime phase can be any lighting calculation stage within the forward rendering or deferred rendering pipeline of the game client's real-time rendering phase. Its purpose is to transform probe data, baked offline and packaged into 2D texture resources, into indirect lighting contributions visible to screen pixels. In this phase, the graphics processor does not need to upload the complete dense 3D index. Instead, it performs coarse index readings and necessary secondary lookups of leaf pages based on a two-level indirect addressing structure, thereby transforming the originally expensive 3D texture access into a small amount of sampling of 2D anchor point textures, curvature textures, and low-frequency color atlases. Furthermore, the runtime phase can flexibly tailor the sampling path according to the needs of the rendering pipeline. For example, when the rendering pipeline needs to acquire ambient occlusion separately, low-frequency color atlas sampling can be skipped; when low-frequency diffuse color needs to be acquired separately, occlusion reconstruction can be skipped, thus maintaining the scalability and compatibility of the pipeline under different image quality levels and performance budgets.

[0113] Optionally, the occlusion value is used to quantify the proportion of ambient light occluded by the geometry around the sampling point, which is obtained through decoding anchor points and curvature texture reconstruction.

[0114] Optionally, the occlusion value can be a scalar visibility ratio obtained by reconstructing the multi-layer occlusion sampling results in the depth direction using a piecewise quadratic function. A lower value indicates stronger surrounding geometric occlusion, while a higher value indicates higher environmental visibility. Considering the storage and bandwidth constraints of mobile devices, this occlusion value is not directly interpolated from the original five-layer 3D probe data. Instead, it is analytically reconstructed based on three anchor points, curvature coefficients, and the interpolated asymmetric curvature ratio. Specifically, during runtime, the left and right halves are determined based on the relative depth of the sampling points within the probe column. Linear interpolation is performed on the three anchor points, and then a curvature correction term is superimposed, thereby quickly recovering high-frequency contact shadows and gap occlusion details with extremely low bandwidth. It should be noted that the above description of the occlusion value reconstruction method is an exemplary implementation, and this application is not intended to limit it.

[0115] Optionally, the indirect color value represents the diffuse color response unaffected by occlusion factors, obtained through coarse-level atlas sampling. Alternatively, the indirect color value can be a high dynamic range color value obtained by trilinear or bilinear sampling of a low-frequency color atlas. This value has had its geometric visibility factor at the probe explicitly excluded during the baking stage, thus preserving pure low-frequency diffuse color transmission information. During runtime lighting combination, this indirect color value is modulated by scalar multiplication with the occlusion value, material occlusion properties, and an optional sky color, avoiding the double darkening problem caused by pre-multiplying the low-frequency color data by an occlusion factor and then repeatedly multiplying it by occlusion. If the current scene has a dynamic sky mode enabled, this indirect color value can also serve as a white unit sky response, modulated in real-time by the sky color at any given moment during runtime, thus supporting day / night changes or weather switching without repeated baking.

[0116] In an optional implementation, reading texture resources according to the index addressing structure during runtime includes: converting spatial coordinates into fine-level index coordinates and offsetting them by a preset amount along the surface normal direction; calculating coarse-grained index coordinates from the fine-level index coordinates, reading coarse-grained index entries, and determining whether a base index entry or an accompanying index entry is hit based on the coarse-grained index entry marker; when an accompanying index entry is hit, entering the secondary index for a second lookup based on the secondary index identifier, and obtaining the indirect color sampling result of the same spatial region after hitting the fine-level sampling block; when a base index entry is hit, directly obtaining the indirect color sampling result of the coarse-level sampling block; performing occlusion reconstruction and color sampling respectively to obtain occlusion values ​​and indirect color values, and multiplying the occlusion values ​​and indirect color values ​​with the ambient color and material occlusion attributes to obtain the indirect lighting result. Thus, through two-level index lookup and hierarchical adaptive color reuse, spatial addressing, occlusion reconstruction, and color sampling can be completed within a small amount of texture reading, effectively reducing runtime bandwidth overhead and ensuring efficient combination of fine-level occlusion and coarse-level color.

[0117] In one implementation, when the game client renders a dynamic character, the world coordinates of the character's surface pixels are first subtracted from the origin of the voxel lighting bounding box and multiplied by the reciprocal of the spacing to obtain fine-grained index coordinates. Then, the pixel surface normal is offset outward by half a preset unit size to avoid self-intersection. Subsequently, the fine-grained index coordinates are divided by four and rounded to obtain coarse-grained index coordinates, based on which the corresponding entry is read from the two-dimensional tiled coarse-grained index texture. If the entry indicates that the current area contains a fine-grained sampling block, the secondary index identifier is parsed and a secondary lookup is performed in the leaf page table. If a match is found, the occlusion value at that location is obtained. At the same time, the secondary index identifier is directly used to correspond to the first-level low-frequency color block number in the same spatial area, and the indirect color value is sampled. If the entry is a base index, the coarse-grained sampling block is directly matched, and the occlusion value and indirect color value are obtained simultaneously. Finally, the obtained occlusion value and indirect color value are multiplied by the current sky environment color and material occlusion attributes to obtain the diffuse indirect lighting result at that pixel.

[0118] Optionally, the secondary index is used to carry fine-grained addressing information in the region hit by the accompanying index, so as to realize the sequence association between fine-level masking blocks and corresponding low-frequency color blocks.

[0119] Optionally, the aforementioned secondary index can be specifically represented as a leaf page table structure. Each leaf page corresponds to a region containing fine-level sampling blocks, covered by coarse-grained index entries. Each page contains sixty-four fine-grained index entries, each corresponding to the fine-grained addressing information of sixteen fine-level spatial units within that region. It should be noted that this secondary index is not limited to a page table format; it can also achieve the same functionality using 3D textures, structured buffers, or other 2D tiling layouts. Since the secondary index identifier accompanying the index entry in the coarse-grained index directly specifies the page number of the leaf page, and this page number is packaged on the baking side as the same sequence number as the corresponding primary color block, the page number can be directly used as the sampling block sequence number in the low-frequency color atlas when the fine-level sampling block is found through the secondary index at runtime, without the need for additional mapping textures or lookup tables. This not only reduces the number of additional texture reads at runtime but also solidifies the reuse relationship between fine-level high-frequency occlusion data and coarse-level low-frequency color data into the index construction rules, ensuring the determinism of runtime combined lighting.

[0120] Optionally, in terms of the layout of the leaf page table, each leaf page can be expanded into an 8x8 two-dimensional block, where the four layers in the depth direction are folded into two 4x4 sub-blocks, thereby reducing the dependence of mobile graphics processors on 3D texture sampling. It should be noted that the size and folding strategy of the leaf pages are not limited to the above combination and can be adjusted to other 2D tiling forms according to memory bandwidth and cache line size. Furthermore, the coarse-grained index itself can also be tiled onto the 2D texture according to depth slices, and a near-square slice arrangement can be selected to reduce cache jitter caused by aspect ratio imbalance. It should be understood that fine-grained entries in the secondary index can not only point to fine-level sampling blocks, but can also fall back to the corresponding primary-level accompanying sampling block at local hole locations; if the fine-grained entry is an invalid marker, the runtime will directly fall back to the primary-level accompanying block color and occlusion corresponding to that leaf page. This mechanism, which supports both direct hits and backoffs within the secondary index, ensures that fine-level hole regions can still receive continuous illumination sampling. On the other hand, it eliminates the need to create a separate lookup channel for the backoff logic, allowing a single pixel shading path to complete all spatial addressing through only one coarse-grained index read and a conditional secondary lookup during runtime.

[0121] Optionally, occlusion reconstruction is used to recover multi-layer occlusion values ​​in the depth direction based on the parameterized description within the sampling block, in order to achieve a balance between compressed storage and visual accuracy.

[0122] Optionally, the above-mentioned occlusion reconstruction can be achieved at runtime by performing piecewise quadratic interpolation on the three anchor point data and curvature coefficients in the depth direction. Specifically, after determining the local normalized depth coordinates based on the hit level at runtime, it is first determined whether the coordinates are located in the first or second half: if the depth coordinates are less than or equal to half, the parameters are normalized to the zero-to-one interval and the curvature coefficients of the left half are used; if the depth coordinates are greater than half, the effective curvature after asymmetric curvature ratio correction is used for the right half. Based on this, the reference shape is obtained by linear interpolation of the first and last anchor points, and the quadratic bending compensation described by the product term of the curvature coefficients and parameters is added to reconstruct the accurate occlusion value of the current sampling position.

[0123] Optionally, considering the potential differences in curvature between the left and right halves of the occlusion curve in real-world scenarios, an asymmetric curvature ratio can be introduced during reconstruction to perform a secondary correction on the latter half. Specifically, at runtime, after parsing the high-order bits of the index entries, the asymmetric curvature ratios at the four planar corners of the current coarse-grained unit are obtained. Bilinear interpolation is then performed based on the local planar coordinates of the sampling points within the sampling block to obtain a curvature correction value suitable for the current position. Furthermore, to avoid jumps at adjacent sampling blocks or layer boundaries due to independent fitting, the three anchor points and curvature parameters used in the reconstruction have undergone layer boundary pre-fusion and post-fusion processing during the baking stage. Therefore, the boundary continuity is inherited in the reconstructed occlusion values ​​at runtime. It should be understood that, in addition to being used for multiplication with low-frequency colors to obtain the final occluded diffuse indirect lighting, occlusion reconstruction can also be output separately as a screen-space occlusion map or participate in other post-processing pipelines. This application does not limit the specific combination of these features.

[0124] In an optional implementation, occlusion reconstruction includes: fitting multi-layer occlusion sampling results in the depth direction, wherein the fitting uses at least three control points and one curvature coefficient to describe the depth direction variation; and calculating the occlusion value at the current position using a piecewise quadratic function based on the control points and curvature coefficient. Thus, by fitting multi-layer occlusion sampling results in the depth direction to a small number of control points and curvature coefficients, and reconstructing using a piecewise quadratic function, occlusion details can be preserved while significantly reducing storage overhead, thereby recovering high-quality occlusion values ​​with lightweight computation.

[0125] In one implementation, for five layers of occlusion sampling data of a probe post in the probe block along the depth direction, the baking side first extracts three control points located at different depth positions as anchor points and calculates the residual between the midpoints of adjacent anchor points to estimate the curvature coefficient. During the runtime phase, the client determines the local coordinates based on the hit level, judges whether it falls into the left or right half according to the depth ratio, and then performs linear interpolation on the control points and superimposes the curvature compensation term to quickly reconstruct the accurate occlusion value of the current sampling position.

[0126] Optionally, the specific steps for performing AO post-processing, transition blending, and curve fitting on the baking side are as follows: (1) Baking side execution: AO original value cleanup. Outlier clamping, internal probe repair and necessary filtering are performed on the AO scalar obtained by path tracing to ensure that probes falling inside the geometry, in extreme noise or invalid regions will not directly participate in the final fitting.

[0127] (2) Baking side execution: Identify layer boundary probes. For each probe block, check whether its adjacent regions are represented by different layers. If a fine layer probe is located at the L0 / L1 or L1 / L2 transition surface, it is marked as a layer boundary probe.

[0128] (3) Baking-side execution: Pre-fit transition fusion. For the labeled boundary probe, the parent-level AO is trilinearly sampled at its world space location, and the boundary AO value is replaced or blended with the parent-level sampled value. This fusion occurs before curve fitting and quantization, so that the anchor point and curvature parameters are generated based on continuous boundary data from the beginning, avoiding inconsistencies in anchor points and curvature caused by compression and then blending.

[0129] (4) Baking-side execution: Perceptual space quantization preparation. The linear AO is converted to square root space before participating in quantization. Square root space provides more effective code values ​​for dark areas, which can reduce the discontinuity and flicker of dark area occlusion when storing low bit widths.

[0130] (5) Baking side execution: Three anchor point extraction. For each (x,y) probe column, take the five-layer AO values ​​y0, y1, y2, y3, y4, corresponding to z=0, 0.25, 0.5, 0.75, 1, and select three anchor points: ao_0 = y0, ao_M = y2, ao_4 = y4 (6) Baking side execution: Curvature residual calculation. The midpoint residual of the left and right halves is defined as: e1 = y1 - (ao_0 + ao_M) / 2 e3 = y3 - (ao_M + ao_4) / 2 If a symmetrical curvature is used first, the initial value of the curvature can be estimated by combining the left and right residuals: k = 2·(e1 + e3) (7) Baking-side execution: Asymmetric curvature ratio solution. In real-world scenarios, the left and right halves of the AO curve are often asymmetric; therefore, this solution introduces a curvature ratio α for the right half. For a probe block or multiple probe posts near a spatial corner point, the cumulative result is: S11 = Σe1², S13 = Σe1·e3, S33 = Σe3² And solve: S13·α² + (S11 - S33)·α - S13 = 0 After obtaining the candidate roots, select the root that makes the error function smaller and limit it to a predetermined range.

[0131] (8) Baking-side execution: Brick corner ratio generation. This scheme does not store only one α for each Brick, but uses a 5×5×5 probe Brick as the basic unit, storing α00, α10, α01, and α11 at the four corner points of the local x,y plane of the Brick. Here, the local x,y plane refers to the two-dimensional plane coordinates of the probe column within the Brick. The four corner points correspond to (0,0), (4,0), (0,4), and (4,4) of the Brick in the probe coordinates, respectively. The z direction is still reconstructed by the five layers of AO through three anchor points and curvature. The corner point values ​​are solved by accumulating the statistics of the probe columns within the Brick and adjacent Bricks of the same level according to the bilinear weights to the corner points; when adjacent Bricks of the same level share spatial corner points, consistent quantization values ​​are used to reduce curvature abrupt changes between blocks.

[0132] (9) Baking side execution: Anchor point and curvature packing. The three square root spatial anchor points are packed into a compact color format, and the curvature k is limited to a range before being written to a single-channel texture; the four corner points α are quantized into low-bit width data, which are then written to the high bits of the corresponding index entries.

[0133] (10) Runtime execution: Segmented secondary reconstruction. During runtime, three anchor points, curvature k, and interpolated α are sampled. If z ≤ 0.5, let t = 2z, using the left half; if z > 0.5, let t = 2z - 1, using the right half. The reconstruction function is: AO(z) = lerp(base, top, t) + k_eff·t·(1-t) The left half is k_eff = k, and the right half is k_eff = k·α.

[0134] The core innovation of this post-processing and fitting method is as follows: first, the hierarchical boundaries are processed in the original AO space; then, three-anchor point curvature fitting is performed on the fused five-layer AO; finally, the asymmetric curvature ratio is embedded into the index entries. This preserves the main curve shape of the five-layer AO while avoiding seams at the layer transitions; at the same time, only a small amount of two-dimensional texture sampling and one segmented secondary reconstruction are needed to recover the AO at runtime.

[0135] like Figure 7 The flowchart shown illustrates an AO curve encoding process, illustrating the detailed flow of the AO (Ambient Occlusion) runtime reconstruction algorithm. The input is multi-layer occlusion data, and the process branches into three parallel paths: Path 1: Take three anchor points → Anchor point encoding → Generate 2D parameters; Path 2: Take three anchor points → Calculate residuals → Calculate curvature → Curvature encoding → Generate 2D parameters; Path 3: Calculate residuals → Calculate asymmetry ratio → Generate four-corner parameters → Index carrying. All three paths ultimately converge in the runtime reconstruction stage.

[0136] Optional, runtime reconstruction mathematical formula. Anchor points a0-a4 are distributed along the z-axis, and a simplified representation is obtained through fitting. The lower half shows the data compression representation—3 anchor points (a0, a2, a4, BGR565 format) + symmetric curvature k(R8) + asymmetric ratio ka(Q4). The runtime reconstruction formula includes the calculation of piecewise linear interpolation parameters t(z) and effective curvature k_eff(z), where... ; The final AO reconstruction formula is: ao(z) = lerp(a_base, a_top, t) + k_eff t (1-t), which contains linear terms and quadratic curvature terms. For example... Figure 8 The image shows a comparison of the effects of uncoded (left) and coded (right) AO.

[0137] Optionally, the multi-layer occlusion sampling results can be a scalar sequence distributed along the depth direction, reflecting the occlusion status at different heights of the probe column.

[0138] Optionally, the aforementioned multi-layer occlusion sampling results can be discrete scalar sequences obtained from the probe posts corresponding to each two-dimensional plane coordinate in the 3D probe block, such as five layers of original occlusion values ​​distributed along the depth direction. Considering that the change in geometric occlusion in the vertical direction is usually continuous, to avoid the high bandwidth and memory costs caused by directly storing layer-by-layer high-density scalar data, as a possible implementation, these multi-layer sampling results can first be processed, outlier clamped, and boundary fused on the baking side, and then the processed data can be used as input for curve fitting. This multi-layer sampling result can not only reflect the occlusion level at the beginning, end, and middle positions, but also indirectly express the gradient change in the depth direction through the differences between adjacent layers, thereby providing a sufficient geometric visibility information basis for the subsequent fitting stage.

[0139] Optionally, control points are used to constrain the interpolation skeleton of the occlusion curve in the depth direction, and may include start, mid and end anchor points.

[0140] Optionally, the aforementioned control points can be a set of anchor points uniformly or non-uniformly distributed along the depth direction. Their number can be flexibly determined based on reconstruction accuracy and storage budget. For example, three control points—the first anchor point, the middle anchor point, and the last anchor point—can be used to summarize the occlusion curve of the probe post. To avoid loss of dark details due to low-bit-width quantization, as a possible implementation, the three anchor points can be converted to a more perceptually friendly square root space for quantization before being written to the compact color format, thereby allocating more effective code values ​​in the dark areas. This control point setting method can lock the overall outline of the occlusion curve with very few parameters, and also reserves sufficient residual expression space for subsequent curvature coefficient compensation, allowing the basic occlusion trend to be obtained with only one piecewise linear interpolation at runtime.

[0141] Optionally, curvature coefficients are used to compensate for bending deviations between the interpolated skeleton and the actual sampled values, and can be passed to the runtime stage along with the index.

[0142] Optionally, the curvature coefficients mentioned above can be scalar curvature compensation parameters obtained based on the midpoint residuals between control points, such as the initial value of symmetrical curvature estimated from the sum of the left and right half residuals. To achieve a balance between compressed data volume and reconstruction accuracy, as a possible implementation, the curvature coefficients can be limited to a predetermined range and written into a single-channel texture, sampled along with the 2D anchor point data during runtime. When inconsistencies in the curvature between the left and right halves occur, an asymmetric curvature ratio can be further introduced to correct the right half, and this correction ratio can be obtained by interpolating the four corner parameters in the index entry. In this way, the curvature coefficients not only provide effective compensation for secondary curvature patterns but also extend the adaptability to complex geometrically occluded scenes through an asymmetric mechanism.

[0143] Optionally, a piecewise quadratic function is used at runtime to reconstruct occlusion values ​​based on control points and curvature, and to call different piecewise strategies based on depth position.

[0144] Optionally, the aforementioned piecewise quadratic function can be a polynomial reconstruction formula called at runtime for the left and right halves of the depth direction, respectively, such as a quadratic reconstruction expression composed of linear interpolation terms and curvature compensation terms. In one implementation, when the local depth ratio parameter satisfies the first segmentation condition, the system performs linear interpolation based on the beginning and middle control points, and superimposes a quadratic correction term weighted by the original curvature coefficient; when the second segmentation condition is met, the system reuses the middle and end control points for interpolation, and superimposes a quadratic correction term weighted by the product of the curvature coefficient and the asymmetric curvature ratio. This piecewise processing mechanism allows a single formula shape to take into account different curvature features on the left and right sides without adding additional texture channels or branch logic, thereby completing high-quality occlusion reconstruction with a small number of arithmetic operations on a mobile graphics processor.

[0145] In an optional implementation, the method further includes: introducing an asymmetric curvature ratio as a curvature correction for the second segment based on the difference in curvature between the first and second segments in the depth direction, wherein the first and second segments are divided by control points; and interpolating the asymmetric curvature ratio stored at the corner points of the sampling block according to the planar position of the current sampling point within the sampling block to obtain the curvature correction value for the current sampling point. Thus, by using corner parameters to differentiate the curvature of the right half and interpolate the planar data, the fitting error between segments can be eliminated at low bit widths, ensuring the continuity of the sampling block boundary curvature and suppressing seam artifacts.

[0146] In one implementation, after extracting three anchor points of the five original shading values ​​of the probe column on the baking side, the deviation of the midpoints of the left and right halves relative to the linear interpolation is calculated. If one side of the probe column at the corner is close to the vertical wall and the other side opens to an open space, the shading attenuation pattern of the left and right halves differs significantly. At this time, the differential scaling coefficient is obtained by using the residual statistics, and the second segment's quadratic bending term is adjusted according to this coefficient, thus better reflecting the actual nonlinear attenuation. At the same time, the sampling block stores the quantized curvature correction coefficients at the four corner points of the plane. During runtime, planar interpolation is performed based on the local coordinates of the current sampling point within the block to obtain cross-block reconstruction results with better continuity and effectively suppress seam jumps.

[0147] Optionally, the asymmetric curvature ratio is used to correct the curvature difference between the left and right halves of the occlusion curve in the depth direction, improving the accuracy of piecewise polynomial fitting. Optionally, the aforementioned asymmetric curvature ratio can be a scalar correction coefficient obtained by statistically solving the residuals at the left and right midpoints of the probe column. Considering that geometric occlusion in real-world scenarios is often asymmetrically distributed in the depth direction, for example, a sampling point near the ground may be adjacent to a vertical wall on one side and face an open space on the other, causing the occlusion value to decrease rapidly in the early part of the depth direction and gradually decrease in the later part. To avoid reconstruction errors caused by the symmetric curvature assumption, as a possible implementation method, the above method calculates the left and right half deviations relative to the anchor point linear interpolation for each probe column, and accumulates the sum of squared residuals and cross terms of multiple columns within the same probe block, and then obtains the right half scaling ratio that minimizes the overall error by solving a quadratic equation.

[0148] Optionally, the first and second segments can be divided into two continuous intervals in the depth direction by the middle anchor point among the three anchor points. The first segment corresponds to the range from the bottom anchor point to the middle anchor point, and the second segment corresponds to the range from the middle anchor point to the top anchor point. Furthermore, to adapt to the diverse needs of occlusion curve morphology under different geometric densities, the asymmetric curvature ratio can be extended to a piecewise function that dynamically changes with the depth coordinates, or a classification index adaptively selected based on multi-order residual pattern matching. One design intent of this embodiment is that by keeping the curvature of the left half unchanged and only introducing a proportional correction to the right half, the curve fitting accuracy can be improved without increasing the number of anchor points, while maintaining the extremely simple arithmetic structure of the reconstruction formula at runtime.

[0149] Optionally, the asymmetric curvature ratio is stored at the corner points of the sampling block and interpolated based on the planar position to ensure a continuous transition of curvature across the probe block boundary. Optionally, the asymmetric curvature ratio stored at the corner points of the sampling block can be quantized parameters stored at the four corner points of the local two-dimensional plane of the probe block, where each corner point corresponds to a combination of the minimum and maximum values ​​in the local planar coordinate system. Considering that adjacent probe blocks need to maintain consistent curvature correction when sharing boundary vertices to avoid gaps or brightness jumps between blocks, as a possible implementation, the baking side will jointly accumulate the statistics of shared corner points of adjacent sampling blocks at the same level when generating parameters, and write the same quantized value obtained from the solution into the index entries of all sampling blocks sharing that corner point. During runtime, bilinear interpolation is performed on the four corner parameters based on the local planar coordinates of the sampling point within the sampling block to obtain the asymmetric curvature correction value at the current position; this interpolation process can be implemented using a weighted formula or other weighted averaging methods, and this application is not limited to this.

[0150] In an optional implementation, before fitting the multi-layer occlusion sampling results in the depth direction, the method further includes: identifying layer boundary sampling points and replacing or blending the fine-layer boundary occlusion sampling results with the sampling values ​​at the corresponding positions of the parent layer to obtain the fused occlusion sampling results before performing the fitting. In this way, by replacing or blending the fine-layer boundary results with the parent layer sampling values ​​before fitting, the anchor points can pre-absorb cross-layer transition information, avoiding boundary jumps caused by the independent generation of compression parameters, thus maintaining continuous and smooth layer boundaries even after ambient occlusion (AO) is compressed into two-dimensional parameters.

[0151] In one implementation, after the baking system completes the ambient occlusion (AO) path tracing of the fine-level (L0) layer, it traverses each L0 probe block and detects whether its adjacent areas are covered by the medium-level (L1) or coarse-level (L2) layer. If the bottom surface of the L0 probe block is adjacent to the L1 layer, the five-layer AO probe values ​​on the bottom surface boundary are recorded as layer boundary sampling points. These sampling points are then trilinearly sampled to the parent layer L1 in world space. The obtained L1 sampling values ​​are used to directly replace the original L0 boundary values, or they are mixed according to a preset weight. The five-layer AO values ​​after this boundary fusion are then used in the subsequent three-anchor point extraction and curvature fitting, so that the fitting parameters carry consistent layer transition information from the beginning of generation, effectively suppressing the occlusion jump at the junction of L0 and L1.

[0152] Optionally, the hierarchical boundary sampling points are intended to identify the sampling locations at the boundaries of different hierarchies in order to trigger subsequent parent-level fusion processing.

[0153] Optionally, the layer boundary sampling point can be any sampling location in the fine-layer (L0) probe block that is spatially adjacent to the coarse-layer sampling block, such as a probe post located on the top, bottom, or side surface of the L0 probe block and whose outer parent layer is a medium-layer (L1) or coarse-layer (L2). Considering that the fine-layer records the masking signal at high density in geometrically dense areas, while the coarse-layer backsamples at low density in open areas, if the original sampling values ​​at the boundary between the two are directly used for fitting without processing, visible step-like defects are easily generated due to abrupt changes in spatial resolution. As a possible implementation, after performing X-ray screening and subsequent processing on the probe blocks, the baking side can further traverse each boundary surface of each fine-layer probe block to detect whether adjacent areas are covered by probe blocks of different layers. If an adjacent area on a side or bottom surface is occupied by a parent-level sampling block, then all five depth sampling positions on that surface are marked as layer boundary sampling points. It should be noted that the above boundary identification can be performed sequentially along the six axes of a three-dimensional Cartesian coordinate system, or it can be performed only on the main viewing direction or the normal plane with drastic slope changes. This application does not intend to limit the boundary scanning direction. Furthermore, the marked layer boundary sampling points can be visualized in the editor interface with different colors or icons in subsequent processing, thereby improving the flexibility of data preparation.

[0154] Optionally, the sampled values ​​at the corresponding positions in the parent level are intended to provide cross-level reference data for fine-level boundaries that balances continuity and accuracy.

[0155] Optionally, the sampled value at the corresponding position of the parent layer refers to the occlusion scalar value obtained by trilinear interpolation or nearest neighbor sampling at the probe position of the parent layer that shares the same world space coordinates as the sampling point of the fine layer boundary. Since the spatial granularity covered by the parent layer is coarser, its sampled value is relatively smooth in space, which can just compensate for the numerical abrupt change that may be caused by the sudden drop in probe density at the fine layer boundary. As a possible implementation, the above replacement or mixing operation can include completely covering the original value of the fine layer boundary with the sampled value of the parent layer, or it can be weighted and fused according to a preset ratio, for example, assigning a higher parent layer weight to the sampling point farther away from the boundary center, or dynamically adjusting the mixing factor according to the continuity of the geometric surface. In order to avoid the parent layer overly blurring the high-frequency contact occlusion details that the fine layer should retain, the baking side can define a gradient mixing weight band in a region with a certain thickness from the transition surface: the inner layer close to the boundary adopts complete replacement to ensure strict continuity, and gradually becomes partial mixing outward to gradually release the high-frequency information of the fine layer itself. It should be understood that the thickness of the aforementioned weighted band can be flexibly set according to the scene type. For example, a narrower transition band can be used in indoor corners or between closely stacked occluders, while the thickness limit can be relaxed at the junction of open terrain and geometric sparseness. This application does not impose any restrictions on this.

[0156] Optionally, the fused occlusion sampling results are used as input for the fitting stage, ensuring that the anchor points and curvature parameters carry cross-level transition information from the initial generation. Optionally, the fused occlusion sampling results are an intermediate data set formed after the original values ​​at the fine-level boundary are replaced or mixed with the sampled values ​​at the corresponding positions in the parent level. This data set must be generated temporally before depth-direction curve fitting to ensure that the data involved in three-anchor point extraction and curvature calculation have absorbed cross-level consistency information. Considering that if boundary correction is performed on the anchor points or curvature after fitting, the compression parameters of different probe blocks may have generated inconsistent quantization errors, making it difficult to strictly align the secondary reconstruction curves between adjacent blocks; therefore, one objective of this embodiment is to unify the morphology of the five original occlusion values ​​before fitting by placing the layer fusion before fitting, thereby ensuring that the subsequently fitted three anchor points and curvature coefficients naturally possess compatible spatial gradients. Furthermore, the fused occlusion sampling results are applicable not only to boundary probes between adjacent probe blocks at the same level, but also to transition surfaces at the boundaries of any parent-child levels in the three-level structure of fine (L0), medium (L1), and coarse (L2). In practical applications, the baking system can perform an additional smoothing filter on the fused data, or it can be directly fed into the anchor point extraction step; this application is not limited to this. It should be noted that the above timing requirements are important for maintaining the synchronous transition of the decoupled ambient occlusion (AO) data and low-frequency diffuse indirect illumination color (U-Diffuse-GI) data at the level boundaries, because if the AO branch and the U-Diffuse-GI branch are processed independently at the boundaries, there may still be seams of illumination mismatch when they are finally combined; by fusing the original AO values ​​first, a consistent spatial reference can be established for the subsequent synchronous correction of U-Diffuse-GI.

[0157] like Figure 9 The diagram illustrates the interaction sequence between the baking side and the runtime, showcasing the complete temporal interaction relationship of the Diffuse-AO decoupled GI system. It includes five main participants: scene, baker, fitter, resource provider, and runtime. The interaction flow is as follows: The scene provides geometric lights to the baker; the baker constructs the hierarchical structure (self-loop), bakes occlusions (self-loop), and bakes low-frequency colors (self-loop); the baker inputs occlusion data to the fitter; the fitter fits curves (self-loop), outputs parameter data to the resource provider, and outputs index data to the resource provider; the resource provider uploads resources to the runtime; the runtime performs a two-level search (self-loop), reconstructs occlusions (self-loop), and samples low-frequency colors (self-loop).

[0158] like Figure 10This diagram illustrates a runtime texture sampling and result example, demonstrating the correspondence between the system resource data structure and the final rendering effect. The left side shows the compressed resource data structure: Diffuse Bricks (blue-gray block textures), Coarse Index (black index map), AO Bricks (red block textures), and Leaf Page (red textures). The middle section, mapped to the right side by arrows, shows the rendering effects: Diffuse Only (a soft scene with only diffuse colors), AO Only (only AO effects presenting grayscale occlusion information), and AO & Diffuse (the final rendering effect after combining AO and diffuse colors, showcasing a richly detailed colored lighting scene).

[0159] like Figure 11 The image shows a comparison between rendering without GI (left) and with the proposed GI solution (right). The left and right comparisons demonstrate the real-time rendering effects of the same game scene (ancient ruins / temple scene) under different settings. The scene includes complex geometric structures such as stone arches, statues, stairs, and cliffs. The left image shows the effect with basic lighting enabled or at lower settings, where some areas are overly bright or lack detail. The right image shows the effect with full GI (Diffuse+AO), showcasing more realistic lighting distribution, richer shadow details, and more natural material representation. Both images display debugging information (frame rate, lighting settings, etc.) in the upper right corner and performance data (Mesh count, Texture count, Draw Calls, etc.) in the lower left or upper right corner.

[0160] According to one embodiment of the indirect illumination processing apparatus of this application, the apparatus may include: The building module is used to construct a multi-level sampling structure based on the scene's geometric distribution. The multi-level sampling structure includes at least one fine-level and at least one coarse-level, with different spatial resolutions for the fine-level and coarse-level. The sampling module is used to perform occlusion sampling and color sampling on each level of sampling points to obtain occlusion sampling results and indirect color sampling results. The indirect color sampling results do not include the occlusion factor. The index addressing module is used to establish the index addressing structure. The index addressing structure is used to establish the reuse relationship between the fine level and the coarse level, so that the indirect color sampling results of the fine level sampling points can reuse the indirect color sampling results of the coarse level sampling points in the same spatial region. The packaging module is used to package the occlusion sampling results and indirect color sampling results into texture resources based on the index addressing structure; The results module is used during runtime to read texture resources according to the index addressing structure, obtain occlusion values ​​and indirect color values, and combine them to obtain indirect lighting results.

[0161] In this way, by decoupling occlusion sampling and indirect color sampling, and reusing the results of coarse-level indirect color sampling at fine-level, the storage volume and video memory usage of texture resources are reduced, and the runtime texture sampling bandwidth overhead is reduced. This helps to avoid redundant storage of low-frequency color data while maintaining high-frequency occlusion information at fine-level. At the same time, since the indirect color sampling results do not contain occlusion factors, the same set of color texture resources can be applied to various ambient lighting conditions, which helps to reduce multi-state data redundancy and improve the data processing flexibility and efficiency of the rendering pipeline.

[0162] The specific details of each part of the above-mentioned device have been described in detail in the method section of the implementation plan. For any undisclosed details, please refer to the implementation plan of the method section, and therefore will not be repeated here.

[0163] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the exemplary embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0164] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0165] The following is a detailed reference. Figure 12 The diagram illustrates a structural schematic suitable for implementing the electronic device described in the embodiments of this application. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 1201, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1202 or a program loaded from memory 1208 into random access memory (RAM) 1203. The RAM 1203 also stores various programs and data required for the operation of the electronic device. The processor 1201, ROM 1202, and RAM 1203 are interconnected via a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.

[0166] Typically, the following devices can be connected to I / O interface 1205: input devices 1206 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 1207 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 1208 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1209. Communication device 1209 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 12Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0167] In particular, according to one embodiment of this application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, one embodiment of this application includes a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via communication device 1209, or installed from memory 1208, or installed from ROM 1202. When the computer program is executed by processor 1201, it performs the functions defined in the methods described above in various embodiments of this application.

[0168] Figure 12 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0169] This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium may also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the methods shown in the above embodiments are implemented.

[0170] A portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0171] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. An indirect illumination processing method, comprising: Based on the geometric distribution of the scene, a multi-level sampling structure is constructed, which includes at least one fine-level and at least one coarse-level, and the fine-level and the coarse-level have different spatial resolutions. Perform occlusion sampling and color sampling on each sampling point at each level to obtain occlusion sampling results and indirect color sampling results. The indirect color sampling results do not include occlusion factors. An index addressing structure is established, which is used to establish a reuse relationship between the fine level and the coarse level, so that the indirect color sampling results of the fine level sampling points reuse the indirect color sampling results of the coarse level sampling points in the same spatial region; Based on the index addressing structure, the occlusion sampling results and the indirect color sampling results are packaged into texture resources; During runtime, the texture resource is read according to the index addressing structure to obtain the occlusion value and indirect color value, which are then combined to obtain the indirect lighting result.

2. The method according to claim 1, wherein, The construction of the multi-level sampling structure includes: Obtain the scene bounding box and preset spatial unit size; Based on the scene bounding box and the preset spatial unit size, a spatial sampling grid is initialized, and the spatial sampling grid is used to generate fine-level sampling blocks; Based on the scene geometry distribution, spatial units containing scene geometry are determined, and fine-level sampling blocks are generated based on the spatial sampling grid; The spatial units containing scene geometry are merged from bottom to top to generate coarse-level sampling blocks; A first index for masking sampling is established for fine-level sampling blocks, and a second index for color sampling is established for coarse-level sampling blocks, resulting in a dual-index structure with different granularities.

3. The method according to claim 1, wherein, The masking sampling includes: An occlusion sampling ray is emitted for each sampling point at each level. Based on the intersection of the ray with the scene geometry, the visibility ratio at the sampling point is determined to obtain the scalar occlusion sampling result. Post-processing is performed on the scalar occlusion sampling results, including outlier correction and boundary marking, to obtain post-processed occlusion sampling results.

4. The method according to claim 2, wherein, The color sampling includes: Color sampling rays are emitted to the sampling points within the coarse-level sampling range. The incident radiance is accumulated and the indirect color sampling result is obtained by integrating the diffuse reflection. The coarse-level sampling range corresponds to the spatial area covered by the coarse-level sampling block. The sampling positions shared by adjacent sampling blocks at the boundary are deduplicated to obtain a unique set of color sampling positions.

5. The method according to claim 2, wherein, The establishment of the index addressing structure includes: Based on the second index, coarse-grained index entries are generated, which cover a preset number of fine-level spatial units; When the coverage area corresponding to the coarse-grained index entry contains fine-level sampling points, the coarse-grained index entry is marked as an accompanying index entry. The accompanying index entry generates a secondary index identifier, which is used to establish the association between fine-level addressing information and the corresponding coarse-level sampling block. When the coverage area corresponding to the coarse-grained index entry does not include fine-level sampling points, the coarse-grained index entry is marked as a basic index entry, and the basic index entry directly stores the coarse-level sampling block identifier.

6. The method according to claim 5, wherein, The fine-level addressing information pointed to by the secondary index identifier is used to hit the fine-level sampling block, or to backtrack to the corresponding coarse-level sampling block at the fine-level hole location.

7. The method according to claim 5, wherein, The package includes: The sampling blocks are arranged in the order of the sampling blocks corresponding to the accompanying index entries, the sampling blocks corresponding to the basic index entries, and the coarse-level sampling blocks, so that the sampling blocks corresponding to the color sampling results are located in the prefix range of the sampling block sequence corresponding to the occlusion sampling results.

8. The method according to claim 5, wherein, The step of reading the texture resource according to the index addressing structure during runtime includes: Convert the spatial coordinates to fine-level index coordinates and offset them by a preset amount along the surface normal direction; The coarse-grained index coordinates are calculated from the fine-level index coordinates. The coarse-grained index entries are read, and the basic index entry or the accompanying index entry is determined to be hit based on the coarse-grained index entry marker. When an accompanying index entry is hit, the secondary index is entered according to the secondary index identifier for a second search. After hitting the fine-level sampling block, the indirect color sampling result of the same spatial region is obtained. When a basic index entry is hit, the indirect color sampling result of the coarse-level sampling block is obtained directly; Perform occlusion reconstruction and color sampling respectively to obtain occlusion value and indirect color value, and multiply the occlusion value and indirect color value with the ambient color and material occlusion attribute to obtain the indirect lighting result.

9. The method according to claim 8, wherein, The occlusion reconstruction includes: The multi-layer occlusion sampling results in the depth direction are fitted, and the fitting uses at least three control points and a curvature coefficient to describe the changes in the depth direction; Based on the control points and the curvature coefficients, the occlusion value at the current position is calculated using a piecewise quadratic function.

10. The method according to claim 9, wherein, The method further includes: For the difference in curvature of the occlusion curves of the first and second segments in the depth direction, an asymmetric curvature ratio is introduced as a curvature correction for the second segment. The first and second segments are divided by the control points. Based on the planar position of the current sampling point within the sampling block, the asymmetric curvature ratio stored at the corner points of the sampling block is interpolated to obtain the curvature correction value of the current sampling point.

11. The method according to claim 9, wherein, Before performing the fitting of the multi-layer occlusion sampling results in the depth direction, the method further includes: Identify the sampling points at the hierarchical boundaries, and replace or blend the occlusion sampling results of the fine-level boundaries with the sampling values ​​at the corresponding positions of the parent level to obtain the fused occlusion sampling results before performing fitting.

12. The method according to claim 4, wherein, In the step of emitting color sampling rays at sampling points within the coarse-level sampling range, the method further includes: The unit writes a response to rays escaping into the external environment, enabling the modulation of different sky colors at runtime using the same set of indirect color sampling results.

13. An indirect light processing device, comprising: A construction module is used to construct a multi-level sampling structure based on the geometric distribution of the scene. The multi-level sampling structure includes at least one fine level and at least one coarse level, and the fine level and the coarse level have different spatial resolutions. The sampling module is used to perform occlusion sampling and color sampling on each level of sampling points to obtain occlusion sampling results and indirect color sampling results, wherein the indirect color sampling results do not contain occlusion factors. An index addressing module is used to establish an index addressing structure, which is used to establish a reuse relationship between the fine level and the coarse level, so that the indirect color sampling results of the fine level sampling points reuse the indirect color sampling results of the coarse level sampling points in the same spatial region; The packaging module is used to package the occlusion sampling results and the indirect color sampling results into texture resources based on the index addressing structure; The result module is used during runtime to read the texture resource according to the index addressing structure, obtain the occlusion value and indirect color value, and combine them to obtain the indirect lighting result.