[go: up one dir, main page]

CN118365773B - A method and device for realizing real-time global illumination on a mobile terminal - Google Patents

A method and device for realizing real-time global illumination on a mobile terminal Download PDF

Info

Publication number
CN118365773B
CN118365773B CN202410250477.9A CN202410250477A CN118365773B CN 118365773 B CN118365773 B CN 118365773B CN 202410250477 A CN202410250477 A CN 202410250477A CN 118365773 B CN118365773 B CN 118365773B
Authority
CN
China
Prior art keywords
illumination
rendering
buffer
lighting
calculated
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410250477.9A
Other languages
Chinese (zh)
Other versions
CN118365773A (en
Inventor
王伟亮
张锦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Yonghang Technology Co Ltd
Original Assignee
Beijing Yonghang Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Yonghang Technology Co Ltd filed Critical Beijing Yonghang Technology Co Ltd
Priority to CN202410250477.9A priority Critical patent/CN118365773B/en
Publication of CN118365773A publication Critical patent/CN118365773A/en
Application granted granted Critical
Publication of CN118365773B publication Critical patent/CN118365773B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/55Radiosity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/06Ray-tracing

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)

Abstract

本发明公开了一种移动端实时全局光照实现方法及装置,在分块缓冲区上,根据阴影图生成Lumen场景的几何缓冲,在表面缓冲中计算直接光照。从上一帧的体素光照中取得经过多帧光线弹射的累加结果,组成最终光照作为当前帧的间接光照。将整个流程中计算好漫反射间接光照以及反射步骤中计算好的粗糙镜面的间接光照,与渲染流程计算的直接光照结果直接相加,组成了全局光照结果。本发明方案充分利用分块芯片缓冲区进行渲染,让前序的渲染流程尽量发生在分块芯片缓冲区,以获得更高性能,实现了在移动端的全局关照高效方案。

The present invention discloses a method and device for implementing real-time global illumination on a mobile terminal. On a block buffer, a geometric buffer of a Lumen scene is generated according to a shadow map, and direct illumination is calculated in a surface buffer. The cumulative result of light bounces over multiple frames is obtained from the voxel illumination of the previous frame, and the final illumination is formed as the indirect illumination of the current frame. The diffuse indirect illumination calculated in the entire process and the indirect illumination of the rough mirror calculated in the reflection step are directly added to the direct illumination result calculated in the rendering process to form the global illumination result. The scheme of the present invention makes full use of the block chip buffer for rendering, and allows the preceding rendering process to occur in the block chip buffer as much as possible to obtain higher performance, thereby realizing an efficient global illumination scheme on a mobile terminal.

Description

Method and device for realizing real-time global illumination of mobile terminal
Technical Field
The invention relates to the technical field of data processing, in particular to a method and a device for realizing real-time global illumination of a mobile terminal.
Background
In the prior art, the real-time global illumination technology is always a necessary advanced characteristic of high-quality games at a host end. Because global illumination technology has high computational power requirements and requires GPU hardware feature support, it is only applicable to host platforms such as PC, playStation that are landed on high-computational-power devices.
When light leaves the light source, it illuminates all surfaces visible at the location of the light source, which is referred to in computer graphics as "direct illumination". But in real life the light does not stop there, it also bounces off the surface and captures the color of the surface during this process. The bounce of light rays from a rough surface in all directions is called "global illumination". Whereas the process of bouncing light off a smooth surface is called "reflection". Eventually, the light will reach your eye or camera, forming an image. In most games, global illumination can only be handled by an off-line process called "illumination map baking" because its computational cost is too high to calculate in real time. In the illusion engine, the illumination map is baked by the CPU. The static illumination provided by the illumination map can be of very high quality, but requires a long build time and greatly limits the game environment. Any action that would significantly alter the indirect lighting would cause the lighting state to become incorrect.
With the iterative upgrade of mobile devices in recent years, mobile-end GPU (graphics processing unit, graphics processor) performance has gradually approached that of early host device GPUs. In order to enable the advanced graphic feature of the real-time global illumination technology to be applied to a mobile platform, the adaptation and integration aiming at the mobile platform are carried out on the illumination technology which is landed on a host device in a fantasy engine, and innovative improvements are carried out, so that the application can be carried out at the mobile terminal with high performance.
Disclosure of Invention
The invention provides a method and a device for realizing real-time global illumination of a mobile terminal, which are used for solving the problem of realizing dynamic global illumination by fully utilizing a hardware structure of a mobile platform and realizing high-performance and low-power consumption.
According to one aspect of the invention, a method for realizing real-time global illumination of a mobile terminal is provided, which comprises the following steps:
Rendering a shadow map of the picture;
Generating a geometric buffer of the Lumen scene according to the shadow map on the block buffer area, and calculating direct illumination in the surface buffer;
the accumulated result of multi-frame ray ejection is obtained from the voxel illumination of the previous frame, and the final illumination is formed to serve as indirect illumination of the current frame;
and directly adding the calculated diffuse reflection indirect illumination in the whole Lumen process and the calculated indirect illumination of the rough mirror surface in the reflection step with the calculated direct illumination result in the rendering process to form a global illumination result.
The shadow map of the rendered picture comprises:
And firstly rendering the depth of the whole scene, and then judging whether the current rendering pixel point is shielded or not by comparing the depths to obtain a shadow map.
The method further comprises the steps of:
the noise reduction processing is carried out on the shadow map, and specifically comprises the following steps:
recoding the data format by adopting a space-time difference guided filtering algorithm, and simultaneously carrying out noise reduction on 4 light sources in one noise reduction calculation;
dividing 4 textures for transferring data into two groups, each group creating a data format of RGBA32UINT and RGBA 8;
Information for noise reduction calculation on a light source is stored on each single channel in each texture, and blur radius, transmission distance, light miss count and sampling count are stored respectively, and are sampled in the noise reduction calculation.
The method further comprises the steps of:
And transmitting data back and forth among a plurality of calculation steps by using the 4 intermediate texture formats, wherein the output data corresponding to each step is input data of the next step, and the 4 intermediate texture formats are alternated back and forth to obtain a noise reduction result.
Generating a geometric buffer of the Lumen scene according to the shadow map on the blocking buffer area, and calculating direct illumination in the surface buffer, wherein the method comprises the following steps:
and firstly, rendering the geometric Buffer G-Buffer through a basic rendering path on the Buffer area of the partitioned chip, and drawing all basic geometric information related to the scene in the current screen for sampling information of a subsequent rendering process.
The method further comprises the steps of:
Copying selected necessary data in a basic rendering path from a block chip buffer area to a system buffer area, wherein the data comprises inherent color, normal, metaliness, roughness, reflectivity and depth information.
The method further comprises the steps of:
The basic rendering stage to the illumination stage are completed on the whole block chip buffer area, and the whole rendering process occurs in one rendering path;
the final combination and reflection steps are all calculated after the whole direct illumination after the buffer area of the segmented chip;
And finally, combining the direct illumination and the indirect illumination obtained by coloring and rendering together to serve as a rendering result of the global illumination.
According to another aspect of the present invention, there is provided a mobile terminal real-time global illumination implementation apparatus, including:
A shadow rendering unit for rendering a shadow map of the picture;
the direct illumination calculation unit is used for generating a geometric buffer of the Lumen scene according to the shadow map on the block buffer area and calculating direct illumination in the surface buffer;
the indirect illumination calculation unit is used for obtaining the accumulated result of multi-frame light ejection from the voxel illumination of the previous frame to form final illumination serving as the indirect illumination of the current frame;
The global illumination acquisition unit is used for directly adding the calculated diffuse reflection indirect illumination in the whole Lumen process and the calculated indirect illumination of the rough mirror surface in the reflection step with the calculated direct illumination result of the rendering process to form a global illumination result.
The apparatus further comprises:
The device comprises a shadow map, a noise reduction unit, 4 textures used for transmitting data, a noise reduction unit, a processing unit and a processing unit, wherein the shadow map is subjected to noise reduction processing, recoding is conducted on a data format by adopting a space-time difference guided filtering algorithm, 4 light sources are simultaneously subjected to noise reduction in one noise reduction calculation, 4 textures used for transmitting data are divided into two groups, RGBA32UINT and RGBA8 data formats are created in each group, information used for noise reduction calculation on one light source is stored on each single channel in each texture, blur radius, transmission distance, light miss count and sampling count are respectively stored, the information is sampled in the noise reduction calculation, the 4 intermediate texture formats are used for transmitting data back and forth among a plurality of calculation steps, output data corresponding to each step are input data of the next step, and the 4 intermediate texture formats are alternated back and forth, so that a noise reduction result is obtained.
The apparatus further comprises:
the partitioned chip cache area is used for completing the whole rendering process from a basic rendering stage to an illumination stage in one rendering path;
The direct illumination calculation unit is used for firstly rendering the geometric Buffer G-Buffer through a basic rendering path on the block chip Buffer area, drawing all scene-related basic geometric information in a current screen and sampling information for a subsequent rendering process, copying selected necessary data in the basic rendering path, and copying the selected necessary data from the block chip Buffer area to the system Buffer area, wherein the data comprise inherent color, normal line, metaliness, roughness, reflectivity and depth information.
By adopting the technical scheme of the invention, a real-time global illumination implementation scheme of the mobile terminal is provided, a geometric buffer G-buffer of the Lumen scene LumenScene is generated on a block buffer area according to a shadow map, and direct illumination is calculated in a Surface buffer Cache. And obtaining the accumulated result of multi-frame light ejection Bounce from the Voxel illumination of the previous frame to form final illumination FINAL LIGHTING as indirect illumination of the current frame. And directly adding the calculated diffuse reflection indirect illumination in the whole Lumen process and the calculated indirect illumination of the rough mirror surface in the reflection step with the calculated direct illumination result in the rendering process to form a global illumination result.
According to the scheme, the segmented chip buffer area is fully utilized for rendering, the synthesis sequence of the Lumen indirect illumination is changed, the leading rendering flow is enabled to occur in the segmented chip buffer area as much as possible, so that higher performance is obtained, and the global illumination efficient scheme at the mobile terminal is realized.
The technical scheme of the invention is further described in detail through the drawings and the embodiments.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate the invention and together with the embodiments of the invention, serve to explain the invention. In the drawings:
FIG. 1 is a schematic flow chart of a method for realizing real-time global illumination of a mobile terminal in an embodiment of the invention;
FIG. 2 is a schematic diagram of an image rendering pipeline in a real-time global illumination implementation solution for a mobile terminal according to an embodiment of the present invention;
FIG. 3 is a schematic diagram illustrating a data flow of a rendering pipeline according to an embodiment of the present invention;
Fig. 4 is a schematic diagram of a data encoding format of a noise reduction algorithm according to an embodiment of the present invention.
Fig. 5 is a schematic diagram of data processing of a noise reduction algorithm according to an embodiment of the present invention.
FIG. 6 is a schematic diagram of a shadow rendering process in accordance with an embodiment of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described below with reference to the accompanying drawings, it being understood that the preferred embodiments described herein are for illustration and explanation of the present invention only, and are not intended to limit the present invention.
Global illumination (Global Illumination, GI) refers to a rendering technique that considers both direct illumination from a light source in a scene and indirect illumination after reflection by other objects in the scene.
Lumen is a real-time global illumination and reflection system that can provide full-dynamic indirect illumination and reflection effects for scenes. The Lumen system greatly improves global illumination because it more accurately simulates the interaction of light sources with objects, and the transfer of light sources and reflections between objects.
The partitioned chip buffer (Tiled memory) is a cache on the integrated chip that is close to the GPU core, which is very efficient to access and low in power consumption due to its close proximity to the GPU core, so high performance rendering on mobile devices requires full utilization Tiled memory. Because Tiled memory is expensive, the buffer space design is small enough to accommodate the size of only one Tile, approximately 32x32 screen pixels. Therefore, the GPU of the mobile device works by dividing the whole screen into a plurality of tiles, and rendering the tiles one by one. It is also for this reason that Tiled memory cannot be randomly sampled as a complete texture.
The segmented chip buffer is a block of cache located on the mobile device chip, and memory access is very efficient in the segmented chip buffer. But the segmented chip buffer also has its own limitations on which random sampling cannot be buffered for texture. In order to fully utilize the hardware characteristics of the block chip buffer area of the mobile platform, the problem of random sampling of textures is solved in the scheme of the application, and the whole rendering process is completely executed on the block chip buffer area and then is synthesized with the indirect illumination result of the Lumen. Therefore, the scheme of the application can obtain higher execution efficiency on the mobile platform.
Fig. 1 is a flowchart of a method for implementing real-time global illumination of a mobile terminal in an embodiment of the invention. As shown in fig. 1, the mobile terminal real-time global illumination implementation method comprises the following steps:
And 101, rendering a shadow map of the picture.
In the embodiment of the invention, shadows are calculated through ray tracing. Firstly, rendering the depth of the whole scene, and then judging whether the current rendering pixel point is shielded or not by comparing the depths to obtain a shadow map. Since the quality of the rendered pixels obtained in the ray tracing step is related to the number of samples of the emitted ray samples, in order to obtain high performance execution efficiency during operation, ray tracing is usually emitted only once for each pixel, which results in an insufficient number of samples of the ray samples, which may generate noise, and noise reduction is further performed. And obtaining a high-quality image after noise reduction through some existing noise reduction algorithm schemes, and then entering a coloring process on the buffer area of the whole block chip.
And 102, generating a geometric buffer G-buffer of the Lumen scene on the block buffer area according to the shadow map, and calculating direct illumination in a Surface buffer Cache.
In the embodiment of the present invention, G-Buffer refers to Geometry Buffer, i.e. "Geometry Buffer". Unlike ordinary rendering of colors only into textures, G-Buffer refers to buffers containing geometric information of color, normal, reflectivity, metallization, roughness, etc., i.e., textures containing the above information.
In the embodiment of the invention, the geometric Buffer G-Buffer is rendered on the Buffer area of the partitioned chip through the Base Pass, wherein the Base Pass is the most basic rendering step, and all scene-related Base geometric information in the current screen is to be drawn and used for sampling information for the subsequent rendering process for calculation.
After the base rendering path BasePass is finished, some necessary geometry Buffer G-Buffer data are parsed, the parsing process is to copy the data in the base rendering path BasePass, and copy the data from the block chip Buffer to the system Buffer, and the corresponding geometry Buffer is expanded, where the geometry data include intrinsic color, normal, metal, roughness, reflectivity and depth information. The intrinsic color, the metal degree, the roughness and the reflectivity information are used for coloring materials, the normal and the reflectivity information participate in illumination calculation, and the depth information is used for reconstructing positions in world space. Because the subsequent final collection step FINAL GATHER needs to randomly sample the geometry Buffer G-Buffer, but there is no way to randomly sample the Buffer of the segmented chip, we parse some necessary data onto the system Buffer texture, so that the texture on the system Buffer is sampled in the final collection step, and the corresponding information can be obtained.
And 103, obtaining the accumulated result of multi-frame light ejection from the Voxel illumination of the previous frame to form final illumination FINAL LIGHTING as indirect illumination of the current frame.
In the embodiment of the present invention, the phase from the base rendering BasePass to the illumination Lighting is completed in the whole block chip buffer, and the whole rendering process Shading occurs in one rendering path RENDERPASS. Therefore, there is no way to re-interleave the computation logic in the rendering path RENDERPASS, for both the final combination FINAL GATHER and the Reflection step Reflection in the Lumen flow, after the segmented chip cache, i.e., after the entire direct illumination. And finally, combining the direct illumination and the indirect illumination after coloring rendering Shading to be used as a rendering result of our global illumination.
The size of the voxels can be divided according to actual needs. Each voxel contains material information of the current voxel including, but not limited to, diffuse reflectance (Albedo), roughness (Roughness), metallic, transparency (Alpha), normal, etc.
Step 104, directly adding the calculated diffuse reflection indirect illumination in the whole Lumen process and the calculated indirect illumination of the rough mirror surface in the reflection step with the calculated direct illumination result in the rendering process to form a global illumination result.
In the embodiment of the invention, the rendering pipeline is kept to be executed on the block chip buffer area as much as possible, so as to obtain higher performance. The order of composition can be adjusted in this way because both direct and indirect illumination each correctly calculate the occlusion, which comes from either shadow mapping or ray tracing shadows, and indirect illumination from distance field tracing shadows calculated in the Lumen scene illumination, so they can be correctly combined together. If the occlusion is not calculated correctly, the result is brighter. Finally, we combine with the indirect illumination of Lumen to obtain the final image.
As shown in fig. 2, a schematic diagram of a rendering pipeline of a frame of image is shown, where the Lumen scene represents the update procedure of the entire Lumen scene. The geometric buffer G-buffer of the Lumen scene LumenScene is generated from the beginning, namely the Surface buffer Surface Cache is generated from the grid piece information MeshCard, then the direct illumination is calculated in the Surface buffer Surface Cache, the accumulated result of multi-frame light ejection Bounce is obtained from the Voxel illumination Voxel Lighting of the previous frame, the final illumination FINAL LIGHTING is formed as the indirect illumination of the current frame, and the final illumination of the current frame is contributed to the Voxel illumination of the next frame to be used as the multi-frame light ejection result. This is the rendering Lumen SCENE LIGHTING flow of the entire Lumen scene illumination.
The scene is rendered in the lower box of fig. 2, which represents the mobile-side rendering pipeline. The rendering process occurring in the partitioned chip buffer is completed from the basic rendering BasePass stage to the illumination Lighting stage over the partitioned chip buffer, and the whole rendering process Shading occurs in one rendering path RENDERPASS, so that there is no way to re-insert the calculation logic in the rendering path RENDERPASS, so that the final combination FINAL GATHER and Reflection step Reflection in the Lumen process are calculated after the partitioned chip buffer, that is, after the whole direct illumination, and finally we combine the direct illumination and indirect illumination obtained after the coloring rendering Shading as the rendering result of our global illumination.
As shown in fig. 3, a data flow diagram of the whole rendering pipeline is shown, wherein a shadow map is first rendered, shadows are calculated by ray tracing, the depth of the whole scene needs to be rendered first, and then whether the current rendering pixel point is blocked or not is judged by comparing the depths, so as to obtain the shadow map. Since the rendered pixels obtained in the ray tracing step are related to the number of samples of the emitted ray, breakfast occurs when the number of samples is insufficient, noise reduction is further performed. And obtaining a high-quality image after noise reduction through some existing noise reduction algorithm schemes, and then entering a coloring process on the buffer area of the whole block chip.
The noise reduction algorithm in the embodiment of the application adopts SVGF (Spatiotemporal Variance-Guided Filter, space-time difference Guided filtering). Based on the algorithm, recoding is carried out on the data format, so that 4 light sources can be simultaneously subjected to noise reduction in one noise reduction calculation, and the noise reduction efficiency is improved. The 4 textures used to transfer data are divided into two groups, each group creating the data format of RGBA32UINT and RGBA8, as shown in FIG. 4. Information for noise reduction calculations on one light source is stored on each single channel in each texture, respectively blur radius WorldBluringRadius, transmission distance TransmissionDistance, ray miss count MissCount, and sample count SampleCount, which are sampled in the noise reduction calculations.
After recoding according to the information, the shadow of 4 light sources can be calculated simultaneously by realizing one shadow noise reduction calculation step, so that the total calculation step cost of multi-light source shadow noise reduction is greatly reduced. The 4 intermediate texture formats are used to pass data back and forth between the multiple computation steps, with the output data corresponding to each step being the input data for the next step, thus alternating back and forth between the 4 intermediate textures, as shown in fig. 5.
As shown in FIG. 6, a shadow rendering process is schematically illustrated, wherein a geometry Buffer G-Buffer is first rendered by a base render BasePass on a tiled chip Buffer. The basic rendering path is the most basic rendering step, and all scene-related basic geometric information in the current screen is to be drawn for providing calculation use for the subsequent rendering flow.
After the Base rendering path Pass is finished, some necessary geometry Buffer G-Buffer data are parsed, namely the geometry Buffer in fig. 3 is expanded, and the geometry data comprise inherent color, normal, metallization, roughness, reflectivity and depth information. The intrinsic color, the metal degree, the roughness and the reflectivity information are used for coloring materials, the normal and the reflectivity information participate in illumination calculation, and the depth information is used for reconstructing positions in world space. Since the subsequent final collection step Lumen FINAL GATHER requires random sampling of the geometry Buffer G-Buffer, and there is no way to randomly sample the segmented chip buffers, we parse some of the necessary data into the system cache.
In the embodiment of the invention, in order to improve the performance at the mobile end, the buffer area of the segmented chip is fully utilized for rendering, the synthesis sequence of the Lumen indirect illumination is adjusted, and the synthesis step is put at the last, so that the leading-in rendering flow can be generated in the buffer area of the segmented chip as much as possible, and higher performance is obtained. The composition step is put to the end and is actually not performed on the segmented chip buffer, but rather in the system memory, and cannot be performed on the segmented chip buffer because the texture random sampling is largely used in this step and is implemented based on the compute shader.
In order to realize the above flow, the technical scheme of the invention also provides a mobile terminal real-time global illumination realizing device, which comprises:
A shadow rendering unit for rendering a shadow map of the picture;
the direct illumination calculation unit is used for generating a geometric buffer of the Lumen scene according to the shadow map on the block buffer area and calculating direct illumination in the surface buffer;
the indirect illumination calculation unit is used for obtaining the accumulated result of multi-frame light ejection from the voxel illumination of the previous frame to form final illumination serving as the indirect illumination of the current frame;
The global illumination acquisition unit is used for directly adding the calculated diffuse reflection indirect illumination in the whole Lumen process and the calculated indirect illumination of the rough mirror surface in the reflection step with the calculated direct illumination result of the rendering process to form a global illumination result.
The apparatus further comprises:
The device comprises a shadow map, a noise reduction unit, 4 textures used for transmitting data, a noise reduction unit, a processing unit and a processing unit, wherein the shadow map is subjected to noise reduction processing, recoding is conducted on a data format by adopting a space-time difference guided filtering algorithm, 4 light sources are simultaneously subjected to noise reduction in one noise reduction calculation, 4 textures used for transmitting data are divided into two groups, RGBA32UINT and RGBA8 data formats are created in each group, information used for noise reduction calculation on one light source is stored on each single channel in each texture, blur radius, transmission distance, light miss count and sampling count are respectively stored, the information is sampled in the noise reduction calculation, the 4 intermediate texture formats are used for transmitting data back and forth among a plurality of calculation steps, output data corresponding to each step are input data of the next step, and the 4 intermediate texture formats are alternated back and forth, so that a noise reduction result is obtained.
The apparatus further comprises:
the partitioned chip cache area is used for completing the whole rendering process from a basic rendering stage to an illumination stage in one rendering path;
The direct illumination calculation unit is used for firstly rendering the geometric Buffer G-Buffer through a basic rendering path on the block chip Buffer area, drawing all scene-related basic geometric information in a current screen and sampling information for a subsequent rendering process, copying selected necessary data in the basic rendering path, and copying the selected necessary data from the block chip Buffer area to the system Buffer area, wherein the data comprise inherent color, normal line, metaliness, roughness, reflectivity and depth information.
In summary, the technical scheme of the invention provides a real-time global illumination implementation scheme of a mobile terminal, wherein on a block buffer area, a geometric buffer of a Lumen scene is generated according to a shadow map, and direct illumination is calculated in a surface buffer. And obtaining the accumulated result of multi-frame ray ejection from the voxel illumination of the previous frame to form final illumination as indirect illumination of the current frame. And directly adding the calculated diffuse reflection indirect illumination in the whole process and the calculated indirect illumination of the rough mirror surface in the reflection step with the calculated direct illumination result of the rendering process to form a global illumination result. According to the scheme, the segmented chip buffer area is fully utilized for rendering, the Lumen synthesis step is put at the end, and the leading rendering flow is enabled to occur in the segmented chip buffer area as much as possible, so that higher performance is obtained, and the global care efficient scheme at the mobile terminal is realized.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, magnetic disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (7)

1.一种移动端实时全局光照实现方法,其特征在于,包括以下步骤:1. A method for implementing real-time global illumination on a mobile terminal, characterized in that it comprises the following steps: 渲染图片的阴影图;Render the shadow map of the image; 在分块芯片缓冲区上,根据阴影图生成Lumen场景的几何缓冲,在表面缓冲中计算直接光照;On the tile chip buffer, the geometry buffer of the Lumen scene is generated according to the shadow map, and the direct lighting is calculated in the surface buffer; 从上一帧的体素光照中取得经过多帧光线弹射的累加结果,组成最终光照作为当前帧的间接光照;Obtain the cumulative result of light bounces from multiple frames from the voxel lighting of the previous frame to form the final lighting as the indirect lighting of the current frame; 将整个Lumen流程中计算好漫反射间接光照以及反射步骤中计算好的粗糙镜面的间接光照,与渲染流程计算的直接光照结果直接相加,组成了全局光照结果;The diffuse indirect lighting calculated in the entire Lumen process and the indirect lighting of the rough mirror calculated in the reflection step are directly added to the direct lighting result calculated in the rendering process to form the global illumination result; 所述方法还包括:The method further comprises: 对所述阴影图进行降噪处理,具体包括:The shadow image is subjected to noise reduction processing, specifically comprising: 采用时空差异引导滤波算法对数据格式重新编码,在一次降噪计算中同时对4个光源进行降噪;The data format is re-encoded using a spatial-temporal difference guided filtering algorithm, and four light sources are denoised simultaneously in one denoising calculation; 将4个用于传递数据的纹理分为两组,每组创建RGBA32UINT和RGBA8的数据格式;Divide the four textures used to transfer data into two groups, and create RGBA32UINT and RGBA8 data formats in each group; 每个纹理中的每个单通道上存储一个光源上用于降噪计算的信息,分别存储模糊半径、传输距离、光线未命中计数和采样计数,在降噪计算中对这些信息采样;Each single channel in each texture stores information used for noise reduction calculation on a light source, including blur radius, transmission distance, ray miss count and sampling count, and samples these information in noise reduction calculation; 所述方法还包括:The method further comprises: 从基础渲染阶段到光照阶段都是在整个分块芯片缓存区上完成,整个渲染流程发生在一个渲染通路之内;From the basic rendering stage to the lighting stage, everything is done on the entire tile chip buffer, and the entire rendering process occurs within one rendering pass; 最终组合和反射步骤都是在分块芯片缓存区之后,整个直接光照之后计算;The final combination and reflection steps are calculated after the tile chip buffer, after the entire direct lighting; 最后再将着色渲染得到直接光照与间接光照组合在一起,作为全局光照的渲染结果。Finally, the direct lighting and indirect lighting obtained by shading rendering are combined together as the rendering result of global illumination. 2.根据权利要求1所述的一种移动端实时全局光照实现方法,其特征在于,所述渲染图片的阴影图,包括:2. A method for implementing real-time global illumination on a mobile terminal according to claim 1, characterized in that the shadow map of the rendered image comprises: 通过光线追踪计算阴影;先渲染整个场景的深度,然后通过比较深度来判断当前的渲染像素点是否被遮挡,得到阴影图。Calculate shadows through ray tracing; first render the depth of the entire scene, then compare the depth to determine whether the current rendered pixel is blocked, and get a shadow map. 3.根据权利要求1所述的一种移动端实时全局光照实现方法,其特征在于,所述方法还包括:3. A method for implementing real-time global illumination on a mobile terminal according to claim 1, characterized in that the method further comprises: 使用4个中间纹理格式在多个计算步骤之间来回传递数据,每个步骤对应的输出数据是下一个步骤的输入数据,在4个中间纹理格式之间来回交替,得到降噪结果。Use 4 intermediate texture formats to pass data back and forth between multiple calculation steps. The output data corresponding to each step is the input data of the next step. Alternate back and forth between the 4 intermediate texture formats to obtain the denoising result. 4.根据权利要求1所述的一种移动端实时全局光照实现方法,其特征在于,所述在分块芯片缓冲区上,根据阴影图生成Lumen场景的几何缓冲,在表面缓冲中计算直接光照,包括:4. A method for implementing real-time global illumination on a mobile terminal according to claim 1, characterized in that generating a geometric buffer of a Lumen scene according to a shadow map on a block chip buffer and calculating direct illumination in a surface buffer comprises: 在分块芯片缓冲区上先通过基础渲染通路渲染几何缓冲G-Buffer,绘制当前屏幕中的所有与场景相关基础几何信息,用于给后续的渲染流程采样信息。The geometry buffer G-Buffer is first rendered through the basic rendering path on the block chip buffer to draw all the basic geometric information related to the scene on the current screen for sampling information for subsequent rendering processes. 5.根据权利要求4所述的一种移动端实时全局光照实现方法,其特征在于,所述方法还包括:5. A method for implementing real-time global illumination on a mobile terminal according to claim 4, characterized in that the method further comprises: 在基础渲染通路中对选定的数据进行拷贝,从分块芯片缓冲区拷贝到系统缓存区;所述数据包括:固有色、法线、金属度、粗糙度、反射度和深度信息。Selected data is copied in a base rendering pass from a tile chip buffer to a system buffer; the data includes intrinsic color, normal, metalness, roughness, reflectivity, and depth information. 6.一种移动端实时全局光照实现装置,其特征在于,包括:6. A mobile terminal real-time global illumination implementation device, characterized by comprising: 阴影渲染单元,用于渲染图片的阴影图;Shadow rendering unit, used to render the shadow map of the image; 直接光照计算单元,用于在分块芯片缓冲区上,根据阴影图生成Lumen场景的几何缓冲,在表面缓冲中计算直接光照;Direct lighting calculation unit, used to generate the geometry buffer of the Lumen scene based on the shadow map on the tile chip buffer, and calculate direct lighting in the surface buffer; 间接光照计算单元,用于从上一帧的体素光照中取得经过多帧光线弹射的累加结果,组成最终光照作为当前帧的间接光照;The indirect lighting calculation unit is used to obtain the cumulative result of light bounces from multiple frames from the voxel lighting of the previous frame to form the final lighting as the indirect lighting of the current frame; 全局光照获取单元,用于将整个Lumen流程中计算好漫反射间接光照以及反射步骤中计算好的粗糙镜面的间接光照,与渲染流程计算的直接光照结果直接相加,组成了全局光照结果;The global illumination acquisition unit is used to directly add the diffuse indirect illumination calculated in the entire Lumen process and the rough mirror indirect illumination calculated in the reflection step to the direct illumination result calculated in the rendering process to form the global illumination result; 分块芯片缓存区,用于完成一个渲染通路之内从基础渲染阶段到光照阶段的整个渲染流程;整个渲染流程发生在一个渲染通路之内;The tiled chip cache is used to complete the entire rendering process from the basic rendering stage to the lighting stage within a rendering pass; the entire rendering process occurs within a rendering pass; 最终组合和反射步骤都是在分块芯片缓存区之后,整个直接光照之后计算;The final combination and reflection steps are calculated after the tile chip buffer, after the entire direct lighting; 最后再将着色渲染得到直接光照与间接光照组合在一起,作为全局光照的渲染结果;Finally, the direct lighting and indirect lighting obtained by shading rendering are combined together as the rendering result of global illumination; 所述装置还包括:The device also includes: 降噪单元,用于对所述阴影图进行降噪处理,采用时空差异引导滤波算法对数据格式重新编码,在一次降噪计算中同时对4个光源进行降噪;将4个用于传递数据的纹理分为两组,每组创建RGBA32UINT和RGBA8的数据格式;每个纹理中的每个单通道上存储一个光源上用于降噪计算的信息,分别存储模糊半径、传输距离、光线未命中计数和采样计数,在降噪计算中对这些信息采样;使用所述4个中间纹理格式在多个计算步骤之间来回传递数据,每个步骤对应的输出数据是下一个步骤的输入数据,在所述4个中间纹理格式之间来回交替,得到降噪结果。A denoising unit is used to perform denoising on the shadow map, re-encode the data format using a spatiotemporal difference guided filtering algorithm, and simultaneously perform denoising on four light sources in one denoising calculation; divide four textures used to transfer data into two groups, and create RGBA32UINT and RGBA8 data formats in each group; store information used for denoising calculation on a light source on each single channel in each texture, and store blur radius, transmission distance, ray miss count and sampling count respectively, and sample this information in the denoising calculation; use the four intermediate texture formats to transfer data back and forth between multiple calculation steps, the output data corresponding to each step is the input data of the next step, and alternate back and forth between the four intermediate texture formats to obtain a denoising result. 7.根据权利要求6所述的一种移动端实时全局光照实现装置,其特征在于,所述直接光照计算单元,用于在分块芯片缓冲区上先通过基础渲染通路渲染几何缓冲G-Buffer,绘制当前屏幕中的所有与场景相关基础几何信息,用于给后续的渲染流程采样信息;在基础渲染通路中对选定的数据进行拷贝,从分块芯片缓冲区拷贝到系统缓存区;所述数据包括:固有色、法线、金属度、粗糙度、反射度和深度信息。7. According to claim 6, a mobile terminal real-time global illumination implementation device is characterized in that the direct illumination calculation unit is used to first render the geometric buffer G-Buffer through the basic rendering path on the block chip buffer, draw all the basic geometric information related to the scene in the current screen, and use it to sample information for subsequent rendering processes; copy the selected data in the basic rendering path, and copy it from the block chip buffer to the system cache area; the data includes: intrinsic color, normal, metalness, roughness, reflectivity and depth information.
CN202410250477.9A 2024-03-05 2024-03-05 A method and device for realizing real-time global illumination on a mobile terminal Active CN118365773B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410250477.9A CN118365773B (en) 2024-03-05 2024-03-05 A method and device for realizing real-time global illumination on a mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410250477.9A CN118365773B (en) 2024-03-05 2024-03-05 A method and device for realizing real-time global illumination on a mobile terminal

Publications (2)

Publication Number Publication Date
CN118365773A CN118365773A (en) 2024-07-19
CN118365773B true CN118365773B (en) 2025-02-11

Family

ID=91882466

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410250477.9A Active CN118365773B (en) 2024-03-05 2024-03-05 A method and device for realizing real-time global illumination on a mobile terminal

Country Status (1)

Country Link
CN (1) CN118365773B (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10290148B2 (en) * 2011-04-14 2019-05-14 Suntracker Technologies Ltd. System and method for real time dynamic lighting simulation
EP4033451A1 (en) * 2021-01-20 2022-07-27 Siemens Healthcare GmbH Interactive image editing using signed distance fields
CN116468833A (en) * 2022-12-28 2023-07-21 广州艾飞文化传播有限公司 Hair rendering speed increasing method, device, equipment and readable storage medium
CN115830208B (en) * 2023-01-09 2023-05-09 腾讯科技(深圳)有限公司 Global illumination rendering method, device, computer equipment and storage medium
CN116524101A (en) * 2023-04-11 2023-08-01 南京大学 Global illumination rendering method and device based on auxiliary buffer information and direct illumination
CN117523070B (en) * 2023-10-30 2024-09-03 深圳图为技术有限公司 Computer graphics rendering method and system based on ray tracing

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
移动端游戏实时全局光照模块的设计与实现;徐亚杰;《万方数据》;20240819;全文 *

Also Published As

Publication number Publication date
CN118365773A (en) 2024-07-19

Similar Documents

Publication Publication Date Title
US11682158B2 (en) Foveated rendering
TWI764974B (en) Filtering image data using a neural network
US10699468B2 (en) Method for non-planar specular reflections in hybrid ray tracing
Mittring Finding next gen: Cryengine 2
Ritschel et al. The state of the art in interactive global illumination
US8542231B2 (en) Method, computer graphics image rendering system and computer-readable data storage medium for computing of indirect illumination in a computer graphics image of a scene
US10049486B2 (en) Sparse rasterization
CN108335349B (en) Filtering Image Data Using Neural Networks
US20040125103A1 (en) Apparatus and method for volume processing and rendering
EP2674919A2 (en) Streaming light propagation
US20100060640A1 (en) Interactive atmosphere - active environmental rendering
KR102140387B1 (en) Storage of bandwidth-compressed graphics data
Barré-Brisebois et al. Hybrid rendering for real-time ray tracing
Sundén et al. Image plane sweep volume illumination
US20220036632A1 (en) Post-processing in a memory-system efficient manner
EP3211601B1 (en) Rendering the global illumination of a 3d scene
JP2022151742A (en) Image rendering method and apparatus
US20240087078A1 (en) Two-level primitive batch binning with hardware state compression
CN116194960A (en) Direct volume rendering device
CN118365773B (en) A method and device for realizing real-time global illumination on a mobile terminal
US10049491B1 (en) Dynamic global illumination system
Lensing et al. Efficient shading of indirect illumination applying reflective shadow maps
Roughton Interactive Generation of Path-Traced Lightmaps
Lauritzen Rendering antialiased shadows using warped variance shadow maps
Bashford-Rogers et al. Approximate visibility grids for interactive indirect illumination

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant