Rendering method, rendering apparatus, device and storage medium

By identifying candidate voxels and calculating target voxels on mobile terminal devices, the problem of high computing resource consumption in the existing technology is solved, real-time global illumination rendering on low-end devices is achieved, and more realistic illumination is provided. effects and complex rendering effects.

WO2024183530A1PCT designated stage expired Publication Date: 2024-09-12HUAWEI TECH CO LTD

Patent Information

Application Number
PCT/CN2024/076681
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-08
Filing Date
2024-02-07
Publication Date
2024-09-12

AI Technical Summary

Technical Problem

When implementing real-time global illumination rendering, the existing technology consumes a lot of computing resources and is difficult to provide high-quality global illumination effects on mobile terminal devices. Moreover, the illumination effect is single and cannot provide complex effects such as contact shadows and glossy reflections.

Method used

By identifying the candidate voxels where the mesh model patches of objects in the target scene are located, determine the target voxels visible to the target light source, and calculate indirect lighting based on voxel irradiance at multiple levels of detail, reducing the number of calculated voxels. Reduce computing resource requirements, use voxelization methods to retain high- and low-frequency lighting information, and provide realistic lighting effects.

Benefits of technology

Real-time global illumination rendering is implemented on low-resource devices, providing more realistic lighting effects, including contact shadows and glossy reflections, improving user experience and reducing rendering time and computing load.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024076681_12092024_PF_FP_ABST
    Figure CN2024076681_12092024_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a rendering method, a rendering apparatus, a device and a storage medium. The rendering method comprises identifying candidate voxels where a patch of a grid model of an object in a target scene are located. The method further comprises determining, from the identified candidate voxels, a target voxel visible to a target light source. The method further comprises, on the basis of the target light source and the target voxel, determining a voxel irradiance for multiple detail levels of the target scene. The method further comprises, on the basis of the voxel irradiance of the multiple detail levels, determining indirect illumination of a coloring point in the target scene for rendering an image for the target scene, the coloring point corresponding to a pixel point on a display screen. On this basis, a number of voxels needing to be processed in a calculation process may be reduced, thereby decreasing the computational workload involved in the process of determining indirect illumination and global illumination of a coloring point, reducing the requirement and consumption of device computational resources, and presenting more vivid lighting effects, improving a user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Rendering method, rendering device, equipment and storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to Chinese invention patent application number 202310253720.8, entitled “Rendering method, rendering device, equipment and storage medium” and filed on March 8, 2023, and the entire application is incorporated herein by reference. Technical Field

[0003] The embodiments of the present application mainly relate to the field of image rendering. More specifically, the embodiments of the present application relate to a rendering method, a rendering apparatus, a device, and a storage medium. Background Art

[0004] With the development of computer technology, computer graphics has also experienced rapid growth. Computer graphics primarily focuses on representing graphics in computers, as well as computing, processing, and displaying them. Global illumination technology has become a research hotspot in computer graphics, as it can enhance the realism of rendered scenes.

[0005] Global illumination technology is one of the core technologies for achieving photorealistic rendering. When rendering images using global illumination, not only direct lighting but also indirect lighting must be considered. This approach results in more realistic images, making it extremely valuable in applications such as gaming, film, and animation. However, as global illumination technology is still rapidly developing, many challenges remain to be addressed when using it for image rendering.

[0006] Summary of the Invention

[0007] An embodiment of the present application provides a rendering solution.

[0008] According to a first aspect of the present application, a rendering method is provided. The rendering method includes identifying candidate voxels where patches of a mesh model of an object in a target scene are located; determining target voxels visible to a target light source from the identified candidate voxels; determining voxel irradiances for multiple levels of detail of the target scene based on the target light source and the target voxels; and determining indirect lighting for shading points in the target scene based on the multiple levels of detail voxel irradiances for rendering an image of the target scene, wherein the shading points correspond to pixels on a display screen.

[0009] In this way, the candidate voxels where the patch is located are first identified, and then the target voxels visible to the target light source are selected from the candidate voxels for the subsequent calculation of indirect lighting, so that all voxels in the target scene do not need to be calculated. This reduces the number of voxels that need to be processed in the process of calculating indirect lighting, thereby reducing the amount of calculation of voxel irradiance and indirect lighting at multiple levels, and reducing the requirements for device computing resources. Therefore, indirect lighting can be calculated on computing devices with fewer resources, thereby providing real-time global illumination. In addition, by using voxelization methods, the high and low frequency information of lighting and the geometric information of the scene can be better preserved, so that more realistic lighting effects can be provided. In addition to diffuse indirect lighting, lighting effects such as contact shadows and glossy reflections can also be provided, thereby improving the user experience.

[0010] In some embodiments, identifying candidate voxels where patches of a mesh model of an object in a target scene are located includes: projecting the patch onto an orthogonal plane based on a projection matrix for the orthogonal plane; determining a fragment corresponding to the patch by rasterizing the projected patch; back-projecting the fragment into a coordinate space where the target scene is located based on the projection matrix; and determining the voxel in the coordinate space that includes the fragment as the candidate voxel. In this way, it is possible to quickly and accurately determine which voxels the patches of the mesh model are located.

[0011] In some embodiments, projecting the patch onto the orthogonal plane includes determining positions of vertices of the patch in the orthogonal plane based on the projection matrix. In this way, the positions of vertices in the orthogonal plane can be determined quickly and accurately.

[0012] In some embodiments, determining a fragment corresponding to the projected patch by rasterizing the projected patch includes: determining the fragment's attributes by interpolating vertex attributes, the vertex attributes including at least two-dimensional texture coordinates; and determining the fragment's material based on the fragment's two-dimensional texture coordinates. In this manner, the fragment's material information can be quickly determined, thereby determining the fragment's opacity.

[0013] In some embodiments, identifying a candidate voxel where a patch of a mesh model of an object in a target scene is located further comprises: determining a group of fragments comprising the candidate voxel; and determining attributes of the candidate voxel based on attributes of the group of fragments. In this manner, the attributes of the candidate voxel can be determined quickly and accurately.

[0014] In some embodiments, determining the target voxel visible from the identified candidate voxels includes: determining the target voxel from the identified candidate voxels in a portion of the voxels of the target scene when processing odd-numbered image frames to be displayed on the display screen; and determining the target voxel from the identified candidate voxels in the remaining voxels of the target scene when processing even-numbered image frames to be displayed on the display screen. In this way, a very high rendering speed can be achieved, thereby improving rendering efficiency and enhancing user experience.

[0015] In some embodiments, determining the voxel irradiances at multiple levels of detail for the target scene includes: determining the voxel irradiances at multiple levels of detail for a portion of the voxels when processing the odd-numbered image frames; and determining the voxel irradiances at multiple levels of detail for the remaining voxels when processing the even-numbered image frames. This approach can achieve very high rendering speeds, thereby improving rendering efficiency and enhancing user experience.

[0016] In some embodiments, wherein the indirect lighting is target indirect lighting, determining the indirect lighting of a shading point in the target scene includes: determining a first indirect lighting for the shading point based on the shading point's normal, material, and voxel irradiance at the multiple levels of detail; obtaining a second indirect lighting for the shading point in a previous image frame; and determining the target indirect lighting based on the first indirect lighting and the second indirect lighting. This approach can reduce the requirements for device computing resources and is suitable for providing real-time global illumination effects on low-end mobile devices.

[0017] In some embodiments, the indirect lighting is target indirect lighting, and determining the indirect lighting of a shading point in the target scene includes: determining a third indirect lighting for the shading point and a fourth indirect lighting for a shading point adjacent to the shading point; and determining the target indirect lighting based on the third and fourth indirect lighting. This approach can reduce the requirements for device computing resources and is suitable for providing real-time global illumination effects on low-end mobile devices.

[0018] In some embodiments, the target indirect lighting is determined using a cone formed at the shading point, thereby reducing the requirements on device computing resources.

[0019] In some embodiments, wherein the attributes of the target voxel include at least a normal, a color, and an opacity in six directions, wherein determining the voxel irradiance for multiple levels of detail of the target scene includes: determining the voxel irradiance for the target voxel based on the target light source and the normal and color of the target voxel; generating the voxel irradiance of a first level of detail in multiple levels of detail based on the voxel irradiance of the target voxel; and determining the voxel irradiance and opacity of voxels in a second level of detail in multiple levels of detail based on the voxel irradiance of the first level of detail and the opacity of the target voxel in six directions. In this way, the opacity of the voxels in six directions is preserved during the initial voxelization, and anisotropic lighting calculation at the lowest level of detail can be achieved, so that relatively correct lighting results can be obtained for any type of patch, thereby reducing the occurrence of light leakage.

[0020] In some embodiments, determining the indirect lighting of the shading point of the target scene includes: projecting a patch in the mesh model onto the display screen based on a projection matrix for the display screen; determining a target fragment corresponding to the patch by rasterizing the projected patch, the target fragment including depth information; determining the shading point from the target scene based on the depth information; and determining the indirect lighting of the shading point by using voxel cone tracing based on the normal, material, and voxel irradiance of the multiple levels of detail of the shading point. In this way, the position of each shading point can be determined quickly and accurately, and the indirect lighting of each shading point can be calculated quickly.

[0021] In some embodiments, determining the indirect lighting at the shading point using voxel cone tracing includes: in response to the material having a surface that supports diffuse reflection, collecting the indirect lighting through multiple cones formed at the shading point; and in response to the material having a surface that supports specular reflection, collecting the indirect lighting through a single cone formed at the shading point. In this way, different surfaces can be processed differently, making the obtained indirect lighting more accurate.

[0022] In some embodiments, collecting the indirect lighting through multiple cones formed at the shading point or collecting the indirect lighting through a single cone formed at the shading point includes: in response to a target level of detail for a sampling point in the cone being lower than a threshold level, discarding voxel irradiance for the target level of detail. In this way, incorrect sampling results are eliminated by setting a level of detail threshold, effectively reducing color bleeding.

[0023] In some embodiments, determining the target voxel visible from the identified candidate voxels includes determining the target voxel based on a position of the candidate voxel and a shadow map of the target scene relative to the target light source. In this way, the voxel where the visible patch is located can be quickly selected, reducing the number of voxels that need to be processed.

[0024] In some embodiments, the method further includes: calculating the visibility of the shading point relative to the target light source based on the shadow map; in response to the shading point being visible relative to the target light source, calculating the direct illumination of the shading point; and determining the global illumination of the shading point based on the indirect illumination and the direct illumination. In this way, direct illumination and corresponding global illumination can be obtained quickly and accurately.

[0025] According to a second aspect of the present application, a rendering device is provided. The rendering device includes: a candidate voxel identification unit configured to identify candidate voxels where patches of a mesh model of an object in a target scene are located; a target voxel determination unit configured to determine target voxels visible from the identified candidate voxels; a voxel irradiance determination unit configured to determine voxel irradiances for multiple levels of detail of the target scene based on the target light source and the target voxels; and an indirect lighting determination unit configured to determine indirect lighting of shading points in the target scene based on the voxel irradiances of the multiple levels of detail for rendering an image of the target scene, wherein the shading points correspond to pixels on a display screen.

[0026] In some embodiments, the candidate voxel identification unit includes: a projection unit configured to project a patch onto an orthogonal plane based on a projection matrix for the orthogonal plane; a fragment determination unit configured to determine a fragment corresponding to the patch by rasterizing the projected patch; and a back-projection unit configured to back-project the fragment into a coordinate space of the target scene based on the projection matrix. The candidate voxel determination unit is configured to determine a voxel in the coordinate space that includes the fragment as a candidate voxel.

[0027] In some embodiments, the projection unit includes: a position determination unit configured to determine positions of vertices of the patch in an orthogonal plane based on a projection matrix.

[0028] In some embodiments, the fragment determination unit includes: a fragment attribute determination unit, configured to determine the attributes of the fragment by interpolating the attributes of the vertex, and the attributes of the vertex include at least two-dimensional texture coordinates; a material determination unit, configured to determine the material of the fragment based on the two-dimensional texture coordinates of the fragment.

[0029] In some embodiments, the candidate voxel identification unit further includes: a group of fragments determination unit, configured to determine a group of fragments included in the candidate voxel; and a voxel attribute determination unit, configured to determine the attributes of the candidate voxel based on the attributes of the group of fragments.

[0030] In some embodiments, the target voxel determination unit includes: an odd frame voxel determination unit, configured to determine the target voxel from the identified candidate voxels in a portion of the voxels of the target scene when processing an odd image frame to be displayed on the display screen; and an even frame voxel determination unit, configured to determine the target voxel from the identified candidate voxels in the remaining voxels of the target scene when processing an even image frame to be displayed on the display screen.

[0031] In some embodiments, the voxel irradiance determination unit includes: a first voxel irradiance determination unit, configured to determine the voxel irradiance of multiple detail levels for a portion of voxels when processing odd image frames; and a second voxel irradiance determination unit, configured to determine the voxel irradiance of multiple detail levels for the remaining voxels when processing even image frames.

[0032] In some embodiments, the indirect lighting is target indirect lighting, and the indirect lighting determination unit includes: a first indirect lighting determination unit, configured to determine the first indirect lighting of the shading point based on the normal, material and voxel irradiance of multiple detail levels of the shading point; a second indirect lighting acquisition unit, configured to acquire the second indirect lighting for the shading point in a previous image frame; and a first target indirect lighting determination unit, configured to determine the target indirect lighting based on the first indirect lighting and the second indirect lighting.

[0033] In some embodiments, the indirect lighting is target indirect lighting, and the indirect lighting determination unit includes: a shading point indirect lighting determination unit, configured to determine a third indirect lighting for the shading point and a fourth indirect lighting for an adjacent shading point of the shading point; and a second target indirect lighting determination unit, configured to determine the target indirect lighting based on the third indirect lighting and the fourth indirect lighting.

[0034] In some embodiments, target indirect lighting is determined using a cone formed at the shading point.

[0035] In some embodiments, wherein the attributes of the target voxel include at least a normal, a color, and an opacity in six directions, the voxel irradiance determination unit includes: a voxel irradiance generation unit configured to determine the voxel irradiance for the target voxel based on the target light source and the normal and color of the target voxel; a first irradiance generation unit configured to generate the voxel irradiance of a first level of detail among multiple levels of detail based on the voxel irradiance of the target voxel; and an irradiance and opacity generation unit configured to determine the voxel irradiance and opacity in six directions of voxels in a second level of detail among multiple levels of detail based on the voxel irradiance of the first level of detail and the opacity of the target voxel in six directions.

[0036] In some embodiments, the indirect lighting determination unit includes: a patch projection unit, configured to project patches in the mesh model onto a display screen based on a projection matrix for the display screen; a target fragment determination unit, configured to determine a target fragment corresponding to the patch by rasterizing the projected patch, the target fragment including depth information; a shading point determination unit, configured to determine a shading point from a target scene based on the depth information; and a first indirect lighting determination unit, configured to determine the indirect lighting of the shading point by using voxel cone tracing based on the normal, material and voxel irradiance of multiple levels of detail of the shading point.

[0037] In some embodiments, the first indirect lighting determination unit includes: multiple cone collection units, configured to collect indirect lighting through multiple cones formed at the shading point in response to the material having a surface supporting diffuse reflection; and a cone collection unit, configured to collect indirect lighting through a cone formed at the shading point in response to the material having a surface supporting specular reflection.

[0038] In some embodiments, the plurality of cone collection units or the cone collection unit comprises a discarding unit configured to discard voxel irradiance for the target detail level in response to the target detail level for a sampling point in the cone being below a threshold level.

[0039] In some embodiments, the target voxel determining unit includes: a first determining unit configured to determine the target voxel based on the position of the candidate voxel and a shadow map of the target scene relative to the target light source.

[0040] In some embodiments, the rendering device further includes: a visibility determination unit configured to calculate the visibility of the shading point relative to the target light source based on the shadow map; a direct lighting calculation unit configured to calculate the direct lighting of the shading point in response to the shading point being visible relative to the target light source; and a global lighting determination unit configured to determine the global lighting of the shading point based on the indirect lighting and the direct lighting.

[0041] According to the third aspect of the present application, an electronic device is also provided, comprising: at least one computing unit; and at least one memory, wherein the at least one memory is coupled to the at least one computing unit and stores instructions for execution by the at least one computing unit, wherein the instructions, when executed by the at least one computing unit, enable the device to execute the method described in the first aspect of the present application.

[0042] According to a fourth aspect of the present application, a computer-readable storage medium is further provided, on which a computer program is stored. When the program is executed by a processor, the method according to the first aspect of the present application is implemented.

[0043] According to a fifth aspect of the present application, a computer program product is further provided, comprising computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the method according to the first aspect of the present application.

[0044] It is understandable that the apparatus of the second aspect, the electronic device of the third aspect, the computer storage medium of the fourth aspect, or the computer program product of the fifth aspect provided above is used to execute the method provided in the first aspect. Therefore, the explanation or description of the first aspect also applies to the second, third, fourth, and fifth aspects. In addition, the beneficial effects that can be achieved in the second, third, fourth, and fifth aspects can refer to the beneficial effects of the corresponding methods and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0046] FIG1 shows a schematic structural diagram of an electronic device according to some embodiments of the present application;

[0047] FIG2 shows a software structure block diagram of an electronic device provided according to some embodiments of the present application;

[0048] FIG3 shows a system architecture diagram according to some embodiments of the present application;

[0049] FIG4 is a schematic diagram showing an implementation form in a system architecture according to some embodiments of the present application;

[0050] FIG5 shows a schematic flowchart of a rendering process according to some embodiments of the present application;

[0051] FIG6 shows a schematic flow chart of an example process for determining indirect lighting according to some embodiments of the present application;

[0052] FIG7 is a schematic diagram showing a voxelization operation performed by a scene voxelization module according to some embodiments of the present application;

[0053] FIG8 is a schematic diagram showing a voxel illumination injection operation performed by a voxel illumination injection module according to some embodiments of the present application;

[0054] FIG9 is a schematic diagram showing a voxel lighting Mipmap generation operation performed by a voxel lighting Mipmap generation module according to some embodiments of the present application;

[0055] FIG10A is a schematic diagram showing an example of collecting indirect lighting on a diffusely reflective surface according to some embodiments of the present application;

[0056] FIG10B is a schematic diagram showing another example of collecting indirect lighting on a glossy reflective surface according to some embodiments of the present application;

[0057] FIG10C is a schematic diagram showing an example of using a cone to collect indirect lighting according to some embodiments of the present application;

[0058] FIG11 is a schematic flowchart illustrating another example process for determining indirect lighting according to some embodiments of the present application;

[0059] FIG12 shows a schematic flowchart of another example process for determining indirect lighting according to some embodiments of the present application;

[0060] FIG13 is a schematic diagram showing a comparative example of rendering effects of a conventional method and the method of the present application; and

[0061] FIG14 shows a block diagram of a rendering device according to some embodiments of the present application. DETAILED DESCRIPTION

[0062] The technical solutions of the present disclosure will be described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments.

[0063] The technical solutions in the embodiments of the present disclosure will be described below in conjunction with the accompanying drawings in the embodiments of the present disclosure. In the description of the embodiments of the present disclosure, unless otherwise specified, " / " means and / or. For example, A / B can mean A or B, or A and B. "And / or" in this article is only a way to describe the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present disclosure, "plurality" or "multiple" refers to two or more than two.

[0064] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0065] The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to be limiting of the present disclosure. As used in the specification of the present disclosure and the appended claims, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present disclosure, "at least one", "one or more" refer to one, two or more. The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.

[0066] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present disclosure. Thus, phrases such as "one embodiment," "some embodiments," "another embodiment," and "other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0067] The numbers or numerical values ​​used in this specification are all illustrative and are only intended to facilitate understanding of the technology of the embodiments of the present disclosure, and are in no way intended to limit the scope of the present disclosure.

[0068] The methods provided in the embodiments of the present disclosure can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). The embodiments of the present disclosure do not impose any restrictions on the specific types of electronic devices.

[0069] Below, some terms that may be involved in the embodiments of the present disclosure are first introduced in detail.

[0070] 1. Graphics processing unit (GPU)

[0071] A GPU is a specialized type of hardware in a computer specifically designed for graphics processing. Its advantage lies in its ability to process multiple similar tasks in parallel. For example, when rendering an image, multiple pixels are rendered simultaneously, and a GPU can accelerate this process. A single GPU can process thousands of tasks in parallel.

[0072] 2. Central processing unit (CPU)

[0073] The CPU is the brain of every chip, processing all tasks through it. Its primary task is to interpret computer instructions and process data in computer software. Its disadvantage is that it can only execute tasks serially and sequentially. Even in the current era of multi-core parallel processors (2022), it can only support the parallel execution of a few to dozens of tasks.

[0074] 3. Rendering Frames

[0075] A rendered frame refers to an image rendered by the graphics processor (GPU). Playing multiple rendered frames continuously can create a dynamic effect.

[0076] 4. Frame rate

[0077] In real-time rendering, the number of rendered frames produced per second is called the frame rate, measured in frames per second (FPS). For example, "frame rate 60" means 60 frames are rendered per second. The higher the frame rate, the smoother the display.

[0078] 5. Power consumption

[0079] Power consumption measures the efficiency with which computing processes consume resources (electricity). Power consumption can be measured in milliamperes (mA). Given a given battery level, the higher the device's power consumption, the greater the power consumption per unit time, resulting in a shorter operating time.

[0080] 6. Chip frequency

[0081] Chip frequency refers to the number of cycles the chip runs. The higher the chip frequency, the more instructions are executed per unit time, but at the same time, the chip's power consumption is also higher.

[0082] 7. Frequency and frame limits

[0083] Frequency and frame limiting refers to a mandatory method of limiting the chip operating frequency (chip frequency) and game frame rate in order to prevent mobile phones and other electronic devices from overheating during gaming.

[0084] 8. Battery life

[0085] Battery life refers to the time that electronic devices such as mobile terminals can be used continuously after being fully charged. The longer this time (i.e. the longer the battery life), the better the user experience.

[0086] 9. Textures

[0087] A map is another name for a "picture" when it is drawn. In addition, it can also be called a texture.

[0088] 10. Energy efficiency ratio

[0089] Energy efficiency ratio (EER) refers to the ratio of computing power divided by energy (or power consumption), that is, the computing power provided per unit of energy. A higher EER indicates greater computing power per unit of energy and a more advanced chip. To save power, it is generally recommended to use more chips with high EER and less chips with low EER.

[0090] 11. Graphics

[0091] Graphics primitives refer to different drawing shapes, such as circles, rectangles, lines, images, text, curves, etc. Each graphic primitive has its own representation. For example, a circle can be described by its center and radius.

[0092] 12. Triangulation

[0093] Modern GPU architectures generally only support drawing triangles well, so all primitives are converted into triangles on the CPU side. This process is called primitive triangulation.

[0094] 13. Spatial locality

[0095] When the CPU loads data, it loads a whole block into the cache. This process of frequently reading and writing data to the cache speeds up CPU operations. This contiguous storage of frequently accessed data is known as good spatial locality. If frequently accessed data is stored separately, multiple blocks of data must be continuously loaded into the cache. This results in poor spatial locality, significantly impacting operational efficiency.

[0096] 14. Animation shader (AS)

[0097] Animation shader is a technology that migrates user interface (UI) animations calculated on the CPU to the GPU.

[0098] 15. Vertex shader (VS)

[0099] The vertex shader is an instruction used to process the coordinate transformation of triangle vertices. After the vertex shader, the triangle will be converted to the screen coordinate system.

[0100] 16. Fragment shader (FS)

[0101] Fragment / pixel shaders are instructions that control how to color pixels on the screen. After passing through the fragment shader, the color of each coordinate point on the screen has been determined.

[0102] 17. Graphics Processing Unit Scence (GPU Scene)

[0103] A GPU scene is a scene data format defined in this disclosure. It contains all the data required for drawing. The CPU defines this scene data, and the GPU interprets it. The GPU scene's function is somewhat similar to the Machinery primitive buffer, but the format is completely different.

[0104] 18. Index

[0105] An index is used to point to another memory address, similar to a directory entry in a dictionary. Through the index, you can directly find another memory address and then read the data found in the other memory.

[0106] 19. Data Flow

[0107] A data stream is an uninterrupted string of binary data. Directly observing the data stream doesn't yield valid information; it requires decoding. This is similar to transmitting all the water in a glass (valid data) as a stream (data stream). However, when using it, the water in the stream must be classified (parsed).

[0108] 20.Drawcall

[0109] Also called Drawops or DrawPrimitive, it is a drawing instruction sent by the CPU to the GPU to tell the GPU what to draw and how to draw it. Generally, a drawcall only draws one primitive. For example, the first drawcall draws a circle and the second drawcall draws a triangle.

[0110] 21.Control Tree

[0111] An application is drawn by combining all its controls. Each control is a geometric primitive. For example, in Changlian's chat page, each chat box is a control. Controls have hierarchical relationships. For example, a chat box has sub-controls such as "chat name," "time," and "icon," and the chat box itself is a sub-control of the entire chat page. This hierarchy is called a "control tree." Every application has a control tree.

[0112] 22. Render Tree

[0113] During rendering, a series of render objects are generated, and these objects correspond roughly one-to-one with the control tree. This forms the render tree. The reason we don't directly use the control tree as the render tree is that updating, creating, and deleting each node in the render tree is time-consuming, while updating, creating, and deleting nodes in the control tree is relatively lightweight. Therefore, most of the time when a page changes, we only update the control tree, then identify any redundant parts within the control tree and then update the render tree.

[0114] 23. Shader

[0115] 2D graphics means that no matter how you shift your perspective, the buildings, plants, and trees on the ground remain unchanged. 3D graphics, however, are different. As your perspective changes, the objects you see also change, from front-on to side-on, with farther objects appearing smaller and closer objects appearing larger, much like what we see in real life. Shaders are a technology specifically designed for rendering 3D graphics. Through shaders, programmers can write their own algorithms for graphics cards to render images, making them more beautiful and realistic. A few years ago, shaders didn't exist, so graphics cards back then didn't support them, only supporting fixed-pipeline rendering. Game graphics weren't as impressive as they are today. There are two types of shaders: vertex shaders (3D graphics are composed of individual triangles, and vertex shaders calculate vertex positions and prepare for pixel rendering) and pixel shaders. Pixel shaders, as the name suggests, are algorithms that calculate lighting and color on a pixel-by-pixel basis. Several different graphics APIs have their own shader languages: in DirectX, the vertex shader is called a vertex shader and the pixel shader is called a pixel shader; in OpenGL, the vertex shader is also called a vertex shader, but the pixel shader is called a fragment shader.

[0116] 24. Diffuse Reflection

[0117] Diffuse reflection refers to the phenomenon that light projected onto a rough surface is reflected irregularly in all directions. The lighting effect is independent of the direction of sight and is only related to the angle between the surface normal of the object and the direction of the light source.

[0118] 25. Glossy Reflection

[0119] Glossy reflection refers to the phenomenon that light projected onto a relatively smooth (non-specular) surface is reflected to a certain range around the specular reflection direction. The lighting effect is related to the line of sight direction, the normal direction of the object surface, and the direction of the light source.

[0120] 26. Contact Shadow

[0121] Contact shadows are a lighting effect that creates shadows when objects are obscured.

[0122] 27. Pixel

[0123] Pixel is the basic unit of image display and cannot be divided any further. Each pixel is a small grid of a single color.

[0124] 28. Texel

[0125] Texels are similar to pixels and are the basic units of texture images. Each texel stores the value of the texture image at that location.

[0126] 29. Voxel

[0127] Voxel is the basic unit of discretization of three-dimensional space, and each voxel stores the value of that position in three-dimensional space.

[0128] 30. Surfel

[0129] A facet is similar to a pixel or voxel, and is the basic unit of discrete representation of an object's surface. It is usually used to approximate the surface of a three-dimensional object.

[0130] 31. Voxel Light Injection

[0131] Voxel lighting injection refers to calculating the lighting irradiance of all objects in a voxel and saving the irradiance in the voxel for subsequent calculations. It is a necessary step in the voxelized global illumination method.

[0132] 32. Voxel Light Mipmap:

[0133] Voxel lighting level refinement refers to caching lighting of different precisions one level at a time in the form of a pyramid and storing it in voxels of the corresponding level. It is a necessary step in the voxelized global illumination method using voxel cone tracing (VCT).

[0134] 33. Post Process

[0135] Post-processing is a step in the rendering process that further processes the rendered image to improve image quality or produce specific rendering effects.

[0136] 34. Anisotropic Opacity

[0137] Anisotropic opacity refers to the direction-dependent opacity of an object, that is, the object has different opacities when viewed from different directions. In a voxelized scene, the directions are usually the normals of the six faces of a cube.

[0138] 35. Anisotropic Filter

[0139] Anisotropic filtering refers to filtering in each direction separately, and is a commonly used method for voxel lighting level refinement.

[0140] 36. Scene Parsing

[0141] Scene parsing refers to the processing of rendering data, processing the data according to certain rules and caching it in memory / video memory for easy use in subsequent rendering processes.

[0142] 37. Clipmap

[0143] The clipping map is an improvement of the Mipmap, which uses the same resolution to save the data of each level of detail (LOD). The higher the LOD, the larger the coverage area and the lower the accuracy.

[0144] 38. Voxelization

[0145] Voxelization refers to a discrete representation method of three-dimensional space, which discretizes the three-dimensional space into adjacent cubes (voxels). The mean of the objects in each cube is calculated and stored in the cube.

[0146] 39. Rasterization

[0147] Rasterization refers to a step in the rendering pipeline that discretizes triangles into two-dimensional pixels, and the value of each pixel is obtained by interpolating the three vertices of the triangle.

[0148] 40.MeshCard

[0149] MeshCard is a data structure proposed in UE5, which is used to approximate objects.

[0150] 41. Radiance

[0151] Radiance is a measure of the brightness of a propagating ray of light.

[0152] 42. Irradiance

[0153] Irradiance refers to the brightness of all light received per unit area.

[0154] 1 shows a schematic structural diagram of an electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0155] It should be understood that the structures illustrated in the embodiments of the present disclosure do not constitute a specific limitation on the electronic device 100. In other embodiments of the present disclosure, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0156] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0157] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0158] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0159] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0160] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby implementing the touch function of the electronic device 100.

[0161] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.

[0162] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0163] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.

[0164] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the electronic device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0165] The GPIO interface can be configured via software. It can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0166] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.

[0167] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present disclosure is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present disclosure, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0168] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.

[0169] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0170] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0171] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0172] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0173] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0174] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0175] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0176] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0177] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0178] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0179] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0180] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0181] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0182] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0183] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0184] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0185] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an App required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0186] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0187] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0188] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.

[0189] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.

[0190] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.

[0191] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0192] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force acts on pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.

[0193] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0194] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude using the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.

[0195] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D. Based on the detected opening and closing status of the case or flip cover, features such as automatic unlocking of the flip cover can be configured.

[0196] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). It can also detect the magnitude and direction of gravity when electronic device 100 is stationary. It can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.

[0197] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.

[0198] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user is holding the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0199] Ambient light sensor 180L is used to sense ambient light brightness. Electronic device 100 can adaptively adjust the brightness of display screen 194 based on the perceived ambient light. Ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. Ambient light sensor 180L can also work with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent accidental touches.

[0200] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0201] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to prevent the electronic device 100 from shutting down abnormally due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to prevent abnormal shutdown due to low temperature.

[0202] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.

[0203] The bone conduction sensor 180M can obtain vibration signals. In some embodiments, the bone conduction sensor 180M can obtain vibration signals from the vibrating bones of the human body. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure pulse signals. In some embodiments, the bone conduction sensor 180M can also be set in headphones to form bone conduction headphones. The audio module 170 can parse out voice signals based on the vibration signals of the vibrating bones of the human body obtained by the bone conduction sensor 180M to implement voice functions. The application processor can parse heart rate information based on the blood pressure pulse signals obtained by the bone conduction sensor 180M to implement heart rate detection functions.

[0204] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0205] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0206] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.

[0207] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device 100 by inserting it into or removing it from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an embedded SIM (eSIM) card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0208] It should be understood that the phone card in the embodiments of the present disclosure includes but is not limited to a SIM card, an eSIM card, a universal subscriber identity module (USIM), a universal integrated circuit card (UICC), and the like.

[0209] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present disclosure takes the Android system of the layered architecture as an example to illustrate the software structure of the electronic device 100.

[0210] Figure 2 is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present disclosure. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer. The application layer can include a series of application packages.

[0211] As shown in FIG2 , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.

[0212] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0213] As shown in FIG2 , the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.

[0214] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0215] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0216] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0217] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).

[0218] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0219] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.

[0220] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.

[0221] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0222] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0223] The system library can include multiple functional modules, such as a surface manager, media libraries, a 3D graphics processing library (such as OpenGL ES), and a 2D graphics engine (such as SGL).

[0224] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0225] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0226] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0227] A 2D graphics engine is a drawing engine for 2D drawings.

[0228] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

[0229] It should be understood that the technical solutions in the embodiments of the present disclosure can be used in Android TM 、iOS TM , Hongmeng TM etc. systems.

[0230] The technical solutions of the embodiments of the present disclosure can be applied to electronic devices to enable them to provide realistic global illumination while using fewer resources. The electronic devices in the embodiments of the present disclosure can be laptops, portable electronic devices such as mobile phones, tablet computers, cameras, video cameras, video recorders, other electronic devices with long-lasting batteries, electronic devices in 5G networks, or electronic devices in future public land mobile networks (PLMNs), etc., and the present disclosure does not limit this.

[0231] As mentioned earlier, global illumination technology is required for rendering. However, while traditional ray tracing-based global illumination methods can provide realistic global illumination effects, they require high computing power and rely on hardware ray tracing devices, making real-time global illumination calculations difficult. Therefore, achieving real-time, high-quality global illumination without relying on hardware ray tracing is a major research topic in the field of real-time rendering in computer graphics.

[0232] To achieve real-time global illumination rendering, a traditional approach uses a deferred VCT method to voxelize the entire scene space and cache the scene's geometry and lighting information. This method voxelizes the scene to be rendered, saves the voxel lighting MipMap, and calculates global illumination for each shading point. This method divides the scene's three-dimensional space into a uniform 3D regular grid, storing scene geometry, color, irradiance, and other information for each voxel in the grid. Anisotropic filtering is then used to calculate voxel irradiance at varying levels of detail. Finally, VCT is used to calculate indirect lighting for the shading point, which is combined with the direct lighting from traditional rasterization methods to form the final global illumination result. Deferred VCT can provide real-time, fully dynamic global illumination effects on high-performance PCs and consoles, but the scene voxel representation it uses is highly complex, requiring extremely high computing power, making it incapable of providing real-time global illumination effects on mobile devices. Furthermore, due to the simplistic voxelization method, the final global illumination effect exhibits noticeable light leakage artifacts.

[0233] Another traditional approach, voxel global illumination (VXGI), uses a ClipMap approach to voxelize the space around the camera and cache the scene's geometry and lighting information. Furthermore, it voxelizes only the three-dimensional space around the camera, preserving the voxel's opacity and emittance in different directions. This allows for higher-precision voxel data and reduces the storage burden associated with voxelizing the entire scene. VXGI can provide high-quality, real-time, fully dynamic global illumination effects on high-performance personal computers and mainframe devices. However, it requires re-updating voxel data for every frame when the camera is moving, placing extremely high computing power requirements and preventing real-time global illumination effects on mobile devices. Another traditional approach, dynamic diffuse global illumination (DDGI), is a global illumination method that uses light probes to cache lighting. This method evenly places spherical light probes within the scene's three-dimensional space. For each texel on the light probe, ray tracing is used to calculate the indirect lighting irradiance and scene distance information. Finally, interpolation is used to calculate the indirect lighting for each shading point. Although DDGI has been improved to provide real-time diffuse dynamic global illumination effects on mobile devices, the lighting calculation method based on interpolation has limited lighting effects and can only provide diffuse effects, but cannot provide more complex glossy reflections, contact shadows and other effects. In addition, due to the use of time domain accumulation to collect lighting, there will be a delay in the global illumination effect when the light source changes. Although these traditional methods can achieve real-time global illumination rendering, there are still problems such as the need for high computing power to calculate global illumination, especially indirect lighting, and the use of more computing resources. It is usually impossible to execute on mobile devices, and the lighting effect is relatively simple.

[0234] To address at least some of the aforementioned issues and other potential problems, in an embodiment of the present application, a computing device first identifies candidate voxels where patches of a mesh model of an object in a target scene are located. The computing device then determines target voxels visible to the target light source from the identified candidate voxels. The computing device then uses the target light source and the target voxels to determine voxel irradiances for multiple levels of detail for the target scene. Based on the voxel irradiances at the multiple levels of detail, the computing device then determines indirect lighting for shading points in the target scene, where the shading points correspond to pixels on the display screen. In this manner, candidate voxels where patches are located are first identified, and then target voxels visible to the target light source are selected from the candidate voxels for subsequent indirect lighting calculations. This eliminates the need to calculate all voxels in the target scene, reducing the number of voxels that need to be processed during the indirect lighting calculation process. This reduces the computational effort required to calculate voxel irradiances and indirect lighting at multiple levels of detail, and reduces the computational requirements on the device's computing resources. Consequently, indirect lighting can be calculated on a computing device with fewer resources, providing real-time global illumination. Furthermore, the use of voxelization can better preserve the high- and low-frequency information of the lighting and the scene geometry, thereby providing more realistic lighting effects. In some embodiments, it can also provide lighting effects such as contact shadows and glossy reflections, thereby improving the user experience.

[0235] Figure 3 shows a system architecture diagram according to some embodiments of the present application. The system architecture example 300 includes a scene data module 302, a data processing module 304, a renderer 306, a rendering hardware interface 308, a GPU driver 310, and GPU hardware 312. The module mainly optimized in this application is the renderer 306.

[0236] In this example, scene data module 302 includes all data present in the scene. Scene data module 302 may include model 314, light source data 316, camera data 318, and other data 320. Model 314 may refer to a mesh model of each object in the scene, light source data 316 may include the position and direction of the light source, camera data 318 may include the position and direction of the camera, and other data 320 may describe some scene configuration data in the scene, such as whether the scene includes water mist.

[0237] The data processing module 304 performs scene data processing on the CPU side, such as updating the position of the model and camera, traversing the scene graph, updating the configuration parameters, etc. The renderer 306 includes a shader 322 and a rendering pipeline 324, and its main function is to render a two-dimensional image based on the scene data. The shader 322 is the logic code running on the GPU side, and the steps such as scene voxelization, lighting injection, lighting Mipmap, indirect lighting calculation, etc. in this application are all implemented in this module. The rendering pipeline 324 is configured with the execution flow of each computing task on the GPU side, wherein the execution order of the steps such as scene voxelization, lighting injection, lighting Mipmap, indirect lighting calculation, etc. is all configured in this module, and the GPU cache space required to store intermediate variables (such as voxel data, etc.) is all applied for and configured in this module.

[0238] The rendering hardware interface 308 is the interface for the CPU to call the GPU storage and computing functions, which includes graphics application programming interface libraries DirectX 1 326, Metal 328, Vulkan 330, OpenGL 332, etc. At the bottom of the system architecture are the GPU driver 310 and GPU hardware 312 to support the operation of programs on the GPU.

[0239] Figure 4 shows a schematic diagram of an example 400 of an implementation of the present invention in a system architecture according to some embodiments of the present invention. In Figure 4, the system architecture includes a scene data module 402, a data processing module 404, a renderer 406, a rendering hardware interface 408, a GPU driver 410, and GPU hardware 412. The renderer 406 is the core component of the rendering engine, directly impacting rendering performance and results. Its primary function is to define the rendering process, shading algorithms, and other aspects. The process of calculating global illumination in the present invention primarily occurs within the renderer 406. The example process 414 for outputting a color image includes the following operations: At block 416, a scene traversal is performed. This operation traverses each node in the scene graph and updates the position data of each mesh model. For example, a scene graph may comprise a tree structure formed by various objects in the scene. Each node is traversed to obtain the network model corresponding to each node. The position data of each network model is then updated. Some objects in the target scene are movable, necessitating the updating of the position data of their corresponding network models. At block 420, a shadow map is generated. This operation generates a shadow map corresponding to each light source in the target scene based on its type, position, and orientation. At block 418, the scene is voxelized. Within the three-dimensional space of the scene, the normal, color, voxel opacity, and voxel non-empty flag of each facet contained within each voxel are calculated and stored in the voxel. At block 422, voxel lighting injection is determined. In this step, each light source calculates the visibility of each voxel based on the shadow map. For voxels that are visible and non-empty, the voxel irradiance is calculated and stored in the voxel.

[0240] Next, at block 424, a voxel lighting mipmap is generated. For voxels at level N of detail, the lighting irradiance is calculated from the voxels at level N-1 and stored in the voxel, where the irradiance of the voxel at level 0 is the voxel irradiance obtained by lighting injection calculated at block 422. At block 426, indirect lighting is calculated. This operation emits a cone from the shading point and uses the VCT to collect lighting from the voxel scene, which serves as the indirect lighting for the shading point. At block 428, direct lighting is calculated. For each light source, visibility between the shading point and the light source is calculated based on the shadow map, and direct lighting is calculated for visible shading points. Global illumination is then calculated at block 430 by blending the indirect and direct lighting results for the shading point. Finally, at block 432, a color image is output: the rendered color image with global illumination information is output from the frame buffer to the screen.

[0241] The above describes a schematic diagram of the implementation of the present application in a system architecture according to some embodiments of the present application in conjunction with Figure 4. The following further describes a schematic flow chart of the rendering process according to some embodiments of the present application in conjunction with Figure 5. This process can be executed at the electronic device 100 in Figure 1 and any suitable computing device.

[0242] At block 502, candidate voxels where meshes of objects in the target scene are located are identified. For example, during the voxelization process of the target scene, the computing device 100 identifies candidate voxels where meshes of objects in the target scene are located. In one example, the meshes of objects in the target scene are composed of triangular facets. In another example, the meshes of objects in the target scene are composed of quadrilateral facets. The above examples are merely illustrative of the present disclosure and are not intended to limit the present disclosure. Furthermore, before voxelizing the target scene, the computing device 100 traverses the target scene. Specifically, the computing device 100 traverses each node in the target scene graph to obtain mesh model data for the object corresponding to each node and updates the position data corresponding to each object's mesh model in the scene. Furthermore, after obtaining this data, the computing device 100 generates a shadow map corresponding to each light source based on the type, position, and orientation of the light source, combined with the obtained mesh model data. The process of determining the shadow map can be obtained based on various suitable existing methods.

[0243] In some embodiments, when identifying candidate voxels where patches of a mesh model of an object in a target scene are located, the computing device 100 uses a projection matrix for the orthogonal planes to project each patch of the mesh model onto an orthogonal plane, such as the xy plane, the xz plane, and the yz plane. Additionally, camera parameters are required when projecting the patches onto the orthogonal planes. The camera parameters can be used to define the size of the space to be processed. During this process, the computing device uses the projection matrix and camera parameters to determine the positions of the patch's vertices in the orthogonal planes. For example, the projection matrix is ​​multiplied by the vector of the entry point to determine the positions of the patch's vertices in the orthogonal planes. Next, the computing device 100 rasterizes the projected patches to obtain fragments corresponding to the patches on the orthogonal planes. The computing device 100 then back-projects the determined fragments into the coordinate space of the target scene using the projection matrix again. The computing device 100 can then determine which voxels contain the fragments. Thus, the computing device can determine which voxels contain the fragments and identify the voxels containing the fragments as candidate voxels. For example, a flag bit is set for each voxel to identify whether the voxel includes a fragment. If the voxel includes a fragment, it can be marked as 1, and if it does not include a fragment, it can be marked as 0. The above examples are only used to describe the present disclosure, and are not specific limitations of the present disclosure. Those skilled in the art can use any suitable method to identify voxels that include fragments. Alternatively or additionally, the occupancy mark of the target voxel visible to the light source determined at this time is the voxel occupancy mark of the lowest level of detail. The computing device also calculates voxel occupancy marks of more levels based on the voxel occupancy mark of the lowest level of detail. When the voxel of the upper level includes the voxel of the next level with an occupancy mark, the voxel of the upper level is also marked with an occupancy mark.

[0244] In some embodiments, when determining fragments corresponding to the projected patch by rasterizing the patch, the computing device may further interpolate the attributes of the patch's vertices to determine the fragment's attributes. Vertex attributes may include at least two-dimensional texture coordinates. Additionally, the patch's vertex attributes may also include normals, positions, and colors. Therefore, the computing device 100 can determine the attributes of each fragment by interpolating the attributes of the patch's vertices. Furthermore, the material of each fragment can be determined based on its determined two-dimensional texture coordinates. This material includes opacity data. Additionally, when identifying a candidate voxel where a patch of the mesh model of an object in the target scene is located, the computing device 100 further determines the attributes of the candidate voxel. In this process, the computing device determines a group of fragments that comprise the candidate voxel. The attributes of the candidate voxel are then determined based on the attributes of this group of fragments. In one example, the attributes of the candidate voxel are determined by averaging the same attributes of the group of fragments. In another example, the attributes of the candidate voxel are determined by taking the median value of the same attributes of the group of fragments. The above examples are only used to describe the present disclosure, rather than to specifically limit the present disclosure.

[0245] In some embodiments, when identifying candidate voxels where patches of a mesh model of an object in a target scene are located, the computing device 100 may employ a depth peeling algorithm. In this process, the space where the target scene is located is divided into a plurality of three-dimensional space slices. Each three-dimensional space slice is then processed to determine whether the slice contains a patch and the location of the patch, thereby determining the voxel where the patch is located. The voxel containing the patch is then marked as a candidate voxel.

[0246] By identifying candidate voxels where patches are located, we can determine which voxels can be used for subsequent calculations. Voxels without patches are not marked as candidates and are therefore not calculated during image rendering. This operation reduces the amount of computation required for subsequent voxel irradiance and indirect lighting calculations at multiple levels, and also reduces the demands on device computing resources.

[0247] At block 504, target voxels visible to the target light source are determined from the identified candidate voxels. Since voxels not visible to the target light source do not require subsequent processing, the computing device needs to further determine target voxels visible to the target light source.

[0248] In some embodiments, the computing device uses the position of the candidate voxel and the shadow map of the target scene relative to the target light source to determine the target voxel visible to the target light source. Specifically, the computing device compares the position of the candidate voxel with the depth data stored in the shadow map, and then determines the candidate voxel visible to the target light source as the target voxel. The above examples are only used to describe the present disclosure, and are not specific limitations of the present disclosure. Those skilled in the art can determine the target voxel visible to the target light source in any suitable manner as needed. Additionally, if the target scene includes multiple light sources, it is necessary to determine the target voxel visible to each light source.

[0249] At block 506 , voxel irradiances for multiple levels of detail of the target scene are determined based on the target light source and the target voxels. After determining the target light source and the target voxels visible to the light source, the computing device 100 needs to further determine voxel irradiances for multiple levels of detail of the target scene.

[0250] In some embodiments, the attributes of the target voxel include at least a normal, a color, and opacity in six directions. The opacity of the target voxel is determined by the material of the fragment included in the voxel. Alternatively or additionally, the opacity of the target voxel in six directions is determined by the opacity of all fragments included in the voxel in the six directions. For example, the opacity of the voxel in each direction is determined by taking the average of the opacity of the fragments in each direction. The above examples are only used to describe the present disclosure and are not specific limitations of the present disclosure.

[0251] When determining voxel irradiances for multiple levels of detail of a target scene, the computing device 10 determines the voxel irradiance of the target voxel in the lowest level of detail based on the target light source and the normal and color of the target voxel visible to the light source in the voxels identified by the voxel occupation marker. For example, the voxel irradiance of the target voxel is calculated using a bidirectional reflectance distribution function. In this case, the voxel irradiance of the lowest level of detail, also referred to as the voxel irradiance of the first level of detail, is formed by the calculated voxel irradiance of the target voxel. Therefore, in the voxel irradiance of the first level of detail, if the voxel is a target voxel, it has a voxel irradiance. If it is not a target voxel, that is, the voxel is a candidate voxel with a fragment that is not visible to the light source or a voxel without a fragment, then the irradiance of these voxels does not need to be calculated. For each target voxel in the first level of detail, there is an opacity in six directions. If it is not a target voxel, the opacity of the voxel does not need to be calculated. The computing device 100 then determines the voxel irradiance and opacity of voxels in a second level of detail in the multiple levels of detail based on the voxel irradiance of the first level of detail and the opacity of the target voxel in the six directions. For example, each voxel in the second level of detail is formed by a cube consisting of eight adjacent voxels in the first level of detail. If a voxel in the second level of detail includes a target voxel with voxel irradiance identified by an occupancy marker in the first level of detail, the irradiance of the voxel in each direction in the second level of detail is determined by multiplying the irradiance of multiple voxels in the first level of detail by the opacity in that direction. For example, the voxel irradiance in that direction is determined by multiplying the irradiance of the eight adjacent voxels in the first level of detail by the opacity of the voxel in that direction. Then, the voxel irradiance of the voxel in the second level of detail is determined by summing the voxel irradiances of the eight adjacent voxels in the first level of detail. Furthermore, the opacity of the voxel in the second level of detail is calculated based on the opacity of the voxel in the first level of detail. If the voxels in the second detail level include multiple voxels in the first detail level that are identified by occupied markers, the opacity of the voxels in the second detail level in each direction can be calculated based on the opacity of the multiple voxels in the first detail level in each direction. For example, the opacity of the voxels in the second detail level in one direction is determined by averaging the opacity of the multiple voxels in the first detail level. The above examples are only used to describe the present disclosure, and are not specific limitations on the present disclosure. By analogy, the voxel irradiance and opacity of the upper detail level can be calculated based on the determined voxel irradiance and opacity of the lower detail level. Additionally, the number of levels of the detail level can be a predetermined number. Alternatively or additionally, if there are multiple light sources, when calculating the voxel irradiance of the first detail level, the voxel irradiance of the target voxel can be calculated for each light source.Then, the voxel irradiances of different light sources in the same target voxel are added together as the voxel irradiance of the target voxel in the first detail level.

[0252] At block 508, indirect lighting for shading points in a target scene is determined based on the voxel irradiances at the multiple levels of detail for use in rendering an image for the target scene, wherein the shading points correspond to pixels on a display screen, which are points in the target scene to be rendered at the pixels. After determining the voxel irradiances at the multiple levels of detail for the target scene, the voxel irradiances at the multiple levels of detail can be used to determine the indirect lighting for the shading points in the target scene. After the indirect lighting is obtained, it can be used to render an image for the target scene.

[0253] In some embodiments, when determining the indirect lighting of a shading point of a target scene, the computing device 100 projects a patch in a mesh model onto a display screen according to a projection matrix for the display screen of the computing device 100. The computing device 100 then determines a target fragment corresponding to the patch by rasterizing the projected patch, the target fragment including depth information. The computing device then determines a shading point from the target scene based on the depth information. The shading point is a point in the target scene that can be displayed at a pixel point on the display screen. For example, for points within multiple target scenes projected onto the same pixel point, the point with the smallest depth is found as the shading point. The computing device then determines the indirect lighting of the shading point by using voxel cone tracing based on the normal, material, and voxel irradiance of multiple levels of detail of the shading point.

[0254] When calculating the global illumination of a shading point, in addition to obtaining the indirect illumination of the shading point, it is also necessary to obtain the direct illumination of the shading point. In some embodiments, the computing device 100 calculates the visibility of the shading point relative to the target light source based on the shadow map. If the shading point is visible relative to the target light source, the direct illumination of the shading point can be calculated. The method for calculating direct illumination can be implemented using any suitable method in the art. The computing device then uses the indirect illumination and direct illumination of each shading point to determine the global illumination of the shading point. For example, the two illumination data are directly added together. Thus, the global illumination for the target scene can be determined.

[0255] Through this method, the candidate voxels where the patch is located are first identified, and then the target voxels visible to the target light source are selected from the candidate voxels for the subsequent calculation of indirect lighting, so that all voxels in the target scene do not need to be calculated. This reduces the number of voxels that need to be processed in the process of calculating indirect lighting, thereby reducing the amount of calculation of voxel irradiance and indirect lighting at multiple levels, and reducing the requirements for device computing resources. Therefore, indirect lighting can be calculated on computing devices with fewer resources, thereby providing real-time global illumination. In addition, by using the voxelization method, the high and low frequency information of the lighting and the scene geometry information can be better preserved, so that a more realistic lighting effect can be provided. In addition to diffuse indirect lighting, it can also provide contact shadows, glossy reflections and other lighting effects, thereby improving the user experience.

[0256] In order to describe the present invention in detail, several different implementation versions will be described in detail below. These implementation versions are only used to illustrate the present invention, but are not specifically limited to the present invention.

[0257] Basic version

[0258] The overall operation flow of the first embodiment can be seen in blocks 416-432 in Figure 4. The following describes in detail a schematic flow chart of an example process for determining indirect illumination in the first embodiment in conjunction with Figure 6.

[0259] At block 602, scene data is obtained. The scene data can be obtained by performing a scene traversal at operation 416 in FIG. 4 . Then, at block 606, a scene voxelization operation is performed. This step voxelizes the three-dimensional mesh of the scene and stores scene data such as the normal and color of the three-dimensional mesh in the voxel. This operation is performed in the vertex shader VS and the fragment shader FS. At this time, the input is the updated scene data, which mainly includes the scene's vertex attributes (position, normal, color, texture map (UV) coordinates), triangle face index, and material map. The output is a three-dimensional mesh array, in which each voxel stores the following data: 1) the mean of the normal, color, etc. of the three-dimensional mesh of the scene contained in the voxel; 2) a flag indicating whether the voxel is occupied (whether the voxel contains a three-dimensional mesh); 3) the opacity of the voxel in the six directions of +X, -X, +Y, -Y, +Z, and -Z. The specific calculation process is to set the projection matrix and camera parameters of three orthogonal planes (XY, YZ, XZ) in VS, calculate the position of each vertex after matrix transformation according to the projection matrix and camera parameters, and interpolate the vertex attributes in the rasterization stage to obtain the attribute data of the fragment (position, normal, color, UV coordinates); in FS, for each fragment output by VS, sample the material data of the fragment from the material map according to the UV coordinates of the fragment, back-project the fragment into the three-dimensional world space according to the camera parameters and projection matrix, calculate the voxel to which the fragment belongs, and use atomic operations to update the attribute data and material data of the fragment to the corresponding voxel.

[0260] For example, Figure 7 illustrates a schematic diagram of a voxelization operation performed by a scene voxelization module according to some embodiments of the present application. Input 702 to scene voxelization module 704 includes facet vertices, each of which has attributes such as position, UV coordinates, normals, and color. Input 702 also includes multiple triangles identified by vertex indices, a material map, camera parameters, and a projection matrix. Scene voxelization module 704 then generates output 706, which includes voxel occupancy markers, voxel colors, voxel normals, and voxel opacity at different levels. In this example, the image data in output 706 is a scene with objects placed inside two nested boxes. For example, the images corresponding to the voxel occupancy markers at different levels represent the scene seen when the box is cut in the middle; the voxel opacity is the opacity determined from the six directions of the box.

[0261] Returning to FIG. 6 for further description, at block 608 , the computing device 100 performs a voxel lighting injection operation. This operation calculates and stores the lighting irradiance of each voxel in the voxelized scene. This operation is performed in a compute shader (CS). The three-dimensional grid array output in block 606 containing normals, colors, occupancy flags, and opacity, as well as the shadow map for each light source provided by a traditional direct lighting calculation method, are used as input. The output is a three-dimensional grid array, in which the irradiance of each voxel is stored. The internal algorithm performs the following operations on a voxel-by-voxel basis: based on the voxel position and the shadow map, the visibility of the voxel relative to the light source is calculated. Whether the voxel is visible is determined by the voxel position and the corresponding depth value stored in the shadow map. If the voxel is visible and occupied, the irradiance of the voxel is calculated and stored based on the normal, color, and light source in the voxel data.

[0262] For example, FIG8 shows a schematic diagram of an example 800 of a voxel light injection operation performed by a voxel light injection module according to some embodiments of the present application. The input 802 of the voxel light injection module 804 includes a light source, a shadow map, and the voxel occupancy flag, voxel color, and voxel normal obtained in FIG7 . The voxel light injection module 804 outputs 806 based on the data contained in the input 802. The output 806 includes voxel irradiance. As shown by the voxel irradiance in box 806, the light hits the right side and bottom surface of the nested box.

[0263] Returning to FIG. 6 for further description, at block 610 , the computing device 100 performs a voxel lighting mipmap generation operation. This operation calculates and saves the voxel lighting irradiance at different levels of detail in the voxelized target scene. This operation is performed in a compute shader (CS). The inputs are the voxel occupancy flag and voxel opacity output in the operation of block 606 and the voxel irradiance output in operation 608 . The output is a three-dimensional grid array of N different resolutions, with the i-th (i value is 1, 2, ..., N) three-dimensional grid array storing the voxel irradiance at level of detail (LOD) i. The internal algorithm performs the following steps voxel by voxel in hierarchical order: for each voxel in the i-th layer, if the voxel is occupied, the voxel irradiance in six directions of the i-1th layer is collected using anisotropic filtering and multiplied by the opacity to obtain the irradiance in six directions of the voxel in the i-th layer. The voxel irradiance of layer 0 is the voxel irradiance output in operation 608 .

[0264] As shown in FIG9 , it shows a schematic diagram of an example 900 of a voxel lighting mipmap generation module performing a voxel lighting mipmap generation operation according to some embodiments of the present application. The input 902 of the voxel lighting mipmap generation module 904 includes the i-1th level of detail LOD i-1 voxel occupancy flag, the LOD i-1 voxel irradiance, and the LOD i-1 voxel opacity to obtain an output 906 including the LOD i voxel irradiance and the LOD i voxel opacity.

[0265] Now return to Figure 6 to continue the description. At box 612, the computing device 100 calculates indirect lighting. In this operation, the indirect lighting of each pixel on the screen is calculated and saved as an irradiance map of indirect lighting. This operation is performed in VS and FS. The input is the updated scene data and the voxel irradiance of different levels of detail obtained at box 610. The output is a two-dimensional image containing the indirect lighting of the screen shading point. Its internal algorithm performs the following operations pixel by pixel: projects the scene according to the camera parameters, rasterizes the triangles of the scene and interpolates to obtain the three-dimensional position, normal, material properties and color of each pixel, draws cones on the normal hemisphere (the number is determined by the material properties and image quality requirements), and uses the voxel cone tracing (VCT) method to collect indirect lighting from the voxel irradiance map in a sampling manner.

[0266] After using the rasterization method to obtain the position, normal and line of sight reflection direction of the screen shading point, the cones are emitted accordingly. In some embodiments, if the material of the shading point has a surface that supports diffuse reflection, indirect lighting is collected by uniformly emitting multiple cones on the hemisphere of the shading point. As shown in Figure 10A, it shows a schematic diagram of an example of collecting indirect lighting on a diffusely reflecting object surface according to some embodiments of the present application. In Figure 10A, since it is a diffusely reflecting object surface, five stacks 1002, 1004, 1006, 1008 and 1010 are set at the shading point of the surface to collect indirect lighting. The indirect lighting collected by each cone is then added to obtain the indirect lighting of the shading point.

[0267] In some embodiments, if the material of the shading point has a surface that supports specular reflection, indirect lighting is collected through a cone formed at the shading point. In this case, a cone is emitted along the line of sight reflection direction to collect indirect lighting. Figure 10B shows a schematic diagram of another example of collecting indirect lighting on the surface of a glossy reflective object according to some embodiments of the present application. In this case, the reflection direction is determined based on the camera viewpoint and the normal, and a cone 1012 is set in this reflection direction to collect indirect lighting.

[0268] In some embodiments, when collecting indirect lighting through multiple cones formed at a shading point or collecting indirect lighting through a cone formed at a shading point, if the target level of detail corresponding to the sampling point in the cone is lower than the threshold level, the voxel irradiance for the target level of detail is discarded. Figure 10C shows a schematic diagram of an example of collecting indirect lighting using a cone according to some embodiments of the present application. When collecting indirect lighting from the cone, multiple three-dimensional points are sampled on the center line of the cone, and the irradiance is interpolated and calculated on the voxel lighting Mipmap as indirect lighting based on the position of the sampling point and the distance from the shading point. At the same time, in order to reduce the effect of erroneous color bleeding, a level of detail threshold is set. When the level of detail (LOD) of a sampling point is lower than the set level of detail threshold, the irradiance of the sampling point is discarded and not included in the final indirect lighting.

[0269] In this way, the candidate voxels where the patch is located are first identified, and then the target voxels visible to the target light source are selected from the candidate voxels for the subsequent calculation of indirect lighting, so that all voxels in the target scene do not need to be calculated. This reduces the number of voxels that need to be processed in the process of calculating indirect lighting, thereby reducing the amount of calculation of voxel irradiance and indirect lighting at multiple levels, and reducing the requirements for device computing resources. Therefore, indirect lighting can be calculated on computing devices with fewer resources, thereby providing real-time global illumination. In addition, by using voxelization methods, the high and low frequency information of lighting and the geometric information of the scene can be better preserved, so that more realistic lighting effects can be provided. In addition to diffuse indirect lighting, lighting effects such as contact shadows and glossy reflections can also be provided, thereby improving the user experience.

[0270] First lightweight version

[0271] Example 2 is a lightweight version of Example 1. To reduce the amount of data required for processing, when determining target voxels visible to the target light source from identified candidate voxels, partial data from both the odd-numbered and even-numbered image frames to be displayed on the display screen is processed separately. For example, when processing odd-numbered image frames, the target voxels are determined from identified candidate voxels within a portion of the target scene's voxels; when processing even-numbered image frames, the target voxels are determined from identified candidate voxels within the remaining voxels of the target scene. For example, a portion of the voxels may comprise 1 / 2 of the voxels in the target scene. Furthermore, when determining voxel irradiances at multiple levels of detail for the target scene, for odd-numbered image frames, only the voxel irradiances at multiple levels of detail for the portion of voxels are determined; for even-numbered image frames, only the voxel irradiances at multiple levels of detail for the remaining voxels are determined. Therefore, this operational approach can reduce the amount of data processed and improve processing efficiency. The process for this example is shown in Figure 11, which illustrates a schematic flow chart of another example process for determining indirect illumination according to some embodiments of the present application. Compared to the first embodiment, the operations in blocks 1102, 1104, 1106, and 1120 in Figure 11 are identical to the corresponding operations in blocks 602, 604, 606, and 612 in Figure 6. The second embodiment implements lightweight optimizations for the illumination injection and illumination mipmap steps, computing illumination injection and illumination mipmaps for only half of the voxels in each frame. At block 1108, the computing device determines whether the current frame is an odd data frame. If so, illumination injection is performed on the first half of the voxels at block 1110. If so, illumination injection is performed on the last half of the voxels at block 1102. Next, at block 1114, it is determined whether the current frame is an odd data frame. If so, illumination mipmaps are generated for the first half of the voxels at block 1116. If so, illumination mipmaps are generated for the last half of the voxels at block 1118. From the rendering effect point of view, when the lighting changes smoothly, the rendered global illumination effect has no visual difference from Example 1. When the lighting changes drastically, the rendering result will have a one-frame delay. However, since the method of the present invention has high rendering efficiency and reaches a rendering speed of 60 frames per second, the visual effect of the delay can be ignored.

[0272] Second lightweight version

[0273] Example 3 is a lightweight version of Example 1. To reduce data processing, only one cone is used to collect target indirect illumination for shading points on diffusely reflecting surfaces. In one example, a temporal multiplexing approach is employed to determine the indirect illumination for a shading point in a target scene. For example, a computing device determines the first indirect illumination for the shading point based on the shading point's normal, material, and voxel irradiance at multiple levels of detail. The computing device then obtains the second indirect illumination for the shading point in the previous image frame. The computing device then uses the first and second indirect illumination to determine the target indirect illumination for the shading point. For example, a weighted flattening algorithm is used to calculate the target indirect illumination from the two indirect illuminations, or the target indirect illumination is determined directly using an averaging algorithm. In another example, a spatial multiplexing approach is employed to determine the indirect illumination for a shading point in a target scene. For example, when determining the indirect illumination for a shading point in a target scene, the third indirect illumination for the shading point and the fourth indirect illumination for its neighboring shading points are determined. The third and fourth indirect illuminations are then used to determine the target indirect illumination. For example, a weighted flattening algorithm is used to calculate two indirect illuminations to obtain the target indirect illumination, or an average algorithm is directly used to determine the target indirect illumination. In another example, both time domain multiplexing and spatial domain multiplexing can be used. When determining the target indirect illumination, it is necessary not only to calculate the indirect illumination collected by a cone at the shading point, but also to use the indirect illumination of the shading point in the previous image frame and the indirect illumination of the adjacent shading point in the current image frame. For example, a weighted flattening algorithm is used to calculate three indirect illuminations to obtain the target indirect illumination, or an average algorithm is directly used to determine the target indirect illumination. The above examples are only used to describe the present disclosure, and are not specific limitations of the present disclosure.

[0274] The process of Example 3 is shown in Figure 12, which shows a schematic flow chart of another example process for determining indirect lighting according to some embodiments of the present application. Compared with Example 1, the operations in boxes 1202, 1204, 1206, 1208, and 1210 are the same as the corresponding operations in boxes 602, 604, 606, 608, and 610 in Figure 6. Example 3 performs lightweight optimization on the steps of calculating indirect lighting on the surface of diffusely reflecting objects based on the idea of ​​time and space domain multiplexing. Only one cone is emitted for each shading point in each frame, and the indirect lighting is calculated with the help of neighboring shading points and the rendering results of the previous frame, thereby reducing the computational load of the indirect lighting solution. In box 1212, in the process of calculating indirect lighting, based on time domain multiplexing, at box 1214, the position of the shading point of the previous frame is calculated, and at box 1218, the indirect lighting for the shading point in the previous frame is collected. Alternatively or additionally, spatial multiplexing can be performed when calculating indirect lighting, such as by aggregating the indirect lighting of adjacent shading points at block 1216. Then, at block 1220, the indirect lighting of the current cone is fused. This involves combining the indirect lighting of the shading point obtained through a single cone with the indirect lighting of the shading point in the previous frame and / or the indirect lighting of adjacent shading points to determine the target indirect lighting for the shading point. During the fusion process, the target indirect lighting for the shading point can be obtained by applying different weight coefficients to these indirect lighting. Then, at block 1222, an indirect lighting map is generated from the indirect lighting of all shading points. From a rendering perspective, temporal multiplexing can introduce delays in lighting changes, resulting in a slight delay in global illumination when light sources change dramatically. Furthermore, spatial multiplexing can make the rendering effect more low-frequency, resulting in certain visual artifacts. However, the rendering scheme of this embodiment requires relatively low computing power and is suitable for providing real-time global illumination effects on low-end mobile devices.

[0275] In performance tests on multiple scenes, the present application can provide high-quality real-time dynamic global illumination effects. Compared with the traditional voxel global illumination method, the present application is faster (rendering speed is increased by more than 300%, as shown in Table 1) and has better lighting effects (light leakage, incorrect color overflow, etc. are reduced). Compared with the DDGI method on the mobile terminal, the present invention can provide contact shadows and glossy reflection lighting effects. For example, Figure 13 shows a schematic diagram of a comparative example 1300 of the rendering effects of the traditional method and the method of the present application; Figure 1302 in Figure 13 is the rendering effect obtained by the traditional method, and Figure 1304 is the rendering effect obtained using the method of the present application. By comparison, it can be seen that the method of the present invention reduces light leakage.

[0276] Table 1 Comparison of rendering speed between the global illumination method of this application and the traditional voxel global illumination method

[0277] As shown in Table 1, for the kitchen scene, the rendering time of the sparse light injection combined with the odd-even light injection of the present application is reduced by 50.3ms compared with the rendering time of the traditional global illumination method; for the bedroom scene, the rendering time of the sparse light injection combined with the odd-even light injection of the present application is reduced by 46.4ms compared with the rendering time of the traditional global illumination method; for the classroom scene, the rendering time of the sparse light injection combined with the odd-even light injection of the present application is reduced by 38.1ms compared with the rendering time of the traditional global illumination method; for the wooden house scene, the rendering time of the sparse light injection combined with the odd-even light injection of the present application is reduced by 51.3ms compared with the rendering time of the traditional global illumination method; for the Sponza Palace scene, the rendering time of the sparse light injection combined with the odd-even light injection of the present application is reduced by 42.1ms compared with the rendering time of the traditional global illumination method. It can be seen that the method of the present application can quickly reduce the rendering time and speed up the rendering process.

[0278] In addition, as shown in Table 1, for the kitchen scene, the rendering time of the sparse light injection combined with odd and even light injection of the present application is reduced by 3ms compared with the rendering time of only sparse light injection of the present application; for the bedroom scene, the rendering time of the sparse light injection combined with odd and even light injection of the present application is reduced by 4.3ms compared with the rendering time of only sparse light injection of the present application; for the classroom scene, the rendering time of the sparse light injection combined with odd and even light injection of the present application is reduced by 3.3ms compared with the rendering time of only sparse light injection of the present application; for the wooden house scene, the rendering time of the sparse light injection combined with odd and even light injection of the present application is reduced by 3.1ms compared with the rendering time of only sparse light injection of the present application; for the Sponza Palace scene, the rendering time of the sparse light injection combined with odd and even light injection of the present application is reduced by 2.5ms compared with the rendering time of only sparse light injection of the present application. It can be seen that the solution of further combining odd and even lighting injection can further reduce the rendering time compared to the solution of only sparse lighting injection, thereby improving the rendering efficiency.

[0279] FIG14 shows a schematic block diagram of a rendering apparatus 1400 according to an embodiment of the present disclosure. The rendering apparatus 1400 may be implemented at the electronic device 100. The rendering apparatus 1400 includes a candidate voxel identification unit 1402 configured to identify candidate voxels where patches of a mesh model of an object in a target scene are located; a target voxel determination unit 1404 configured to determine target voxels visible to a target light source from the identified candidate voxels; a voxel irradiance determination unit 1406 configured to determine voxel irradiances for multiple levels of detail of the target scene based on the target light source and the target voxels; and an indirect lighting determination unit 1408 configured to determine indirect lighting of shading points in the target scene based on the voxel irradiances at the multiple levels of detail for rendering an image for the target scene, wherein the shading points correspond to pixels in a display screen.

[0280] In some embodiments, the candidate voxel identification unit 1402 includes: a projection unit configured to project a patch onto an orthogonal plane based on a projection matrix for the orthogonal plane; a fragment determination unit configured to determine a fragment corresponding to the patch by rasterizing the projected patch; and a back-projection unit configured to back-project the fragment into a coordinate space of the target scene based on the projection matrix. The candidate voxel determination unit is configured to determine a voxel in the coordinate space that includes the fragment as a candidate voxel.

[0281] In some embodiments, the projection unit includes: a position determination unit configured to determine positions of vertices of the patch in an orthogonal plane based on a projection matrix.

[0282] In some embodiments, the fragment determination unit includes: a fragment attribute determination unit, configured to determine the attributes of the fragment by interpolating the attributes of the vertex, and the attributes of the vertex include at least two-dimensional texture coordinates; a material determination unit, configured to determine the material of the fragment based on the two-dimensional texture coordinates of the fragment.

[0283] In some embodiments, the candidate voxel identification unit 1402 further includes: a group of fragments determination unit, configured to determine a group of fragments included in the candidate voxel; and a voxel attribute determination unit, configured to determine the attributes of the candidate voxel based on the attributes of the group of fragments.

[0284] In some embodiments, the target voxel determination unit 1404 includes: an odd frame voxel determination unit, configured to determine the target voxel from the identified candidate voxels in a portion of the voxels of the target scene when processing an odd image frame to be displayed on the display screen; and an even frame voxel determination unit, configured to determine the target voxel from the identified candidate voxels in the remaining voxels of the target scene when processing an even image frame to be displayed on the display screen.

[0285] In some embodiments, the voxel irradiance determination unit 1406 includes: a first voxel irradiance determination unit, configured to determine the voxel irradiance of multiple detail levels for a portion of voxels when processing odd image frames; and a second voxel irradiance determination unit, configured to determine the voxel irradiance of multiple detail levels for the remaining voxels when processing even image frames.

[0286] In some embodiments, the indirect lighting is target indirect lighting, and the indirect lighting determination unit 810 includes: a first indirect lighting determination unit, configured to determine the first indirect lighting of the shading point based on the normal, material and voxel irradiance of multiple detail levels of the shading point; a second indirect lighting acquisition unit, configured to acquire the second indirect lighting for the shading point in the previous image frame; and a first target indirect lighting determination unit, configured to determine the target indirect lighting based on the first indirect lighting and the second indirect lighting.

[0287] In some embodiments, where the indirect lighting is target indirect lighting, the indirect lighting determination unit 810 includes: a shading point indirect lighting determination unit configured to determine a third indirect lighting for the shading point and a fourth indirect lighting for an adjacent shading point of the shading point; and a second target indirect lighting determination unit configured to determine the target indirect lighting based on the third indirect lighting and the fourth indirect lighting.

[0288] In some embodiments, target indirect lighting is determined using a cone formed at the shading point.

[0289] In some embodiments, wherein the attributes of the target voxel include at least a normal, a color, and an opacity in six directions, the voxel irradiance determination unit 1406 includes: a voxel irradiance generation unit configured to determine the voxel irradiance for the target voxel based on the target light source and the normal and color of the target voxel; a first irradiance generation unit configured to generate the voxel irradiance of a first detail level among multiple detail levels based on the voxel irradiance of the target voxel; and an irradiance and opacity generation unit configured to determine the voxel irradiance and opacity in six directions of voxels in a second detail level among multiple detail levels based on the voxel irradiance of the first detail level and the opacity of the target voxel in six directions.

[0290] In some embodiments, the indirect lighting determination unit 1408 includes: a patch projection unit, configured to project patches in the mesh model onto a display screen based on a projection matrix for the display screen; a target fragment determination unit, configured to determine a target fragment corresponding to the patch by rasterizing the projected patch, the target fragment including depth information; a shading point determination unit, configured to determine a shading point from a target scene based on the depth information; and a first indirect lighting determination unit, configured to determine the indirect lighting of the shading point by using voxel cone tracing based on the normal, material and voxel irradiance of multiple levels of detail of the shading point.

[0291] In some embodiments, the first indirect lighting determination unit includes: multiple cone collection units, configured to collect indirect lighting through multiple cones formed at the shading point in response to the material having a surface supporting diffuse reflection; and a cone collection unit, configured to collect indirect lighting through a cone formed at the shading point in response to the material having a surface supporting specular reflection.

[0292] In some embodiments, the plurality of cone collection units or the cone collection unit comprises a discarding unit configured to discard voxel irradiance for the target detail level in response to the target detail level for a sampling point in the cone being below a threshold level.

[0293] In some embodiments, the target voxel determining unit 1404 includes: a first determining unit configured to determine the target voxel based on the position of the candidate voxel and a shadow map of the target scene relative to the target light source.

[0294] In some embodiments, the rendering device 1400 also includes: a visibility determination unit configured to calculate the visibility of the shading point relative to the target light source based on the shadow map; a direct lighting calculation unit configured to calculate the direct lighting of the shading point in response to the shading point being visible relative to the target light source; and a global lighting determination unit configured to determine the global lighting of the shading point based on the indirect lighting and the direct lighting.

[0295] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.

[0296] A computer-readable storage medium can be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination thereof. As used herein, a computer-readable storage medium is not to be construed as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through an electrical wire.

[0297] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.

[0298] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, and conventional procedural programming languages ​​such as "C" language or similar programming languages. Computer-readable program instructions may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., utilizing an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions. The electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0299] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.

[0300] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine such that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0301] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0302] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the prescribed logical function. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart, can be implemented by a dedicated hardware-based system that performs the prescribed function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0303] The embodiments of the present disclosure have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons skilled in the art to understand the embodiments disclosed herein.

Claims

1. A rendering method, characterized in that: include: Identifying candidate voxels where patches of a mesh model of an object in a target scene are located; Determining a target voxel from among the identified candidate voxels that is visible to the target light source; Determining voxel irradiances for a plurality of levels of detail of the target scene based on the target light source and the target voxel; as well as Based on the voxel irradiances of the multiple levels of detail, indirect lighting of shading points in the target scene is determined for rendering an image for the target scene, wherein the shading points correspond to pixels in a display screen.

2. The method of claim 1, wherein identifying a candidate voxel at which a patch of a mesh model of an object in the target scene is located comprises: Projecting the patch onto the orthogonal plane based on a projection matrix for the orthogonal plane; Determine a fragment corresponding to the surface patch by performing rasterization processing on the projected surface patch; Based on the projection matrix, back-projecting the fragment into the coordinate space of the target scene; as well as A voxel including the fragment in the coordinate space is determined as the candidate voxel.

3. The method of claim 2, wherein projecting the patch onto the orthogonal plane comprises: Based on the projection matrix, positions of the vertices of the patch in the orthogonal plane are determined.

4. The method according to claim 3, wherein determining the fragment corresponding to the patch by rasterizing the projected patch comprises: Determining the attributes of the fragment by interpolating the attributes of the vertex, wherein the attributes of the vertex include at least two-dimensional texture coordinates; as well as The material of the fragment is determined based on the two-dimensional texture coordinates of the fragment.

5. The method of claim 2, wherein identifying the candidate voxels where the patches of the mesh model of the object in the target scene are located further comprises: Determining a group of fragments included in the candidate voxel; as well as Attributes of the candidate voxels are determined based on the attributes of the set of fragments.

6. The method of claim 1 , wherein determining a target voxel from among the identified candidate voxels that is visible to the target light source comprises: When processing an odd-numbered image frame to be displayed on the display screen, determining the target voxel from the identified candidate voxels in a portion of the voxels of the target scene; as well as When processing an even-numbered image frame to be displayed on the display screen, the target voxel is determined from the identified candidate voxels among the remaining voxels of the target scene.

7. The method of claim 6, wherein determining voxel irradiance for a plurality of levels of detail of the target scene comprises: When processing the odd-numbered image frame, determining voxel irradiances at a plurality of levels of detail for the portion of voxels; as well as While processing the even image frames, voxel irradiances for a plurality of levels of detail for the remaining voxels are determined.

8. The method of claim 1 , wherein the indirect lighting is target indirect lighting, wherein determining the indirect lighting of a shading point in the target scene comprises: Determining a first indirect lighting for the shading point based on a normal, a material, and voxel irradiances of the plurality of levels of detail for the shading point; Obtaining a second indirect illumination for the shading point in a previous image frame; and The target indirect lighting is determined based on the first indirect lighting and the second indirect lighting.

9. The method of claim 1 , wherein the indirect lighting is target indirect lighting, wherein determining the indirect lighting of a shading point in the target scene comprises: Determine a third indirect lighting of the shading point and a fourth indirect lighting of an adjacent shading point of the shading point; as well as The target indirect lighting is determined based on the third indirect lighting and the fourth indirect lighting.

10. A method according to claim 8 or 9, wherein the target indirect lighting is determined using a cone formed at the shading point.

11. The method of claim 1 , wherein the properties of the target voxel include at least a normal, a color, and opacity in six directions, wherein determining the voxel irradiance for a plurality of levels of detail of the target scene comprises: Determining a voxel irradiance for the target voxel based on the target light source and the normal and color of the target voxel; generating a voxel irradiance of a first level of detail in the plurality of levels of detail based on the voxel irradiance of the target voxel; and Based on the voxel irradiance of the first level of detail and the opacity of the target voxel in the six directions, voxel irradiance and opacity of voxels in a second level of detail in the multiple levels of detail in the six directions are determined.

12. The method of claim 1, wherein determining indirect lighting of a shading point of the target scene comprises: Projecting the facets in the mesh model onto the display screen based on a projection matrix for the display screen; Determine a target fragment corresponding to the surface patch by rasterizing the projected surface patch, wherein the target fragment includes depth information; Determining the shading point from the target scene based on the depth information; as well as The indirect lighting of the shading point is determined using voxel cone tracing based on the normal of the shading point, the material, and the voxel irradiance of the multiple levels of detail.

13. The method of claim 12, wherein determining the indirect lighting of the shading point using voxel cone tracing comprises: In response to the material having a surface supporting diffuse reflection, collecting the indirect lighting through a plurality of cones formed at the shading point; as well as In response to the material having a surface that supports specular reflection, the indirect lighting is collected via a cone formed at the shading point.

14. The method of claim 13, wherein collecting the indirect illumination through a plurality of cones formed at the shading point or collecting the indirect illumination through one cone formed at the shading point comprises: In response to a target level of detail for a sample point in the pyramid being below a threshold level, voxel irradiances for the target level of detail are discarded.

15. The method of claim 1, wherein determining a target voxel from among the identified candidate voxels that is visible to the target light source comprises: The target voxel is determined based on the position of the candidate voxel and a shadow map of the target scene relative to a target light source.

16. The method according to claim 15, further comprising: Based on the shadow map, calculating the visibility of the shading point relative to the target light source; In response to the shading point being visible relative to the target light source, calculating direct lighting for the shading point; as well as A global illumination of the shading point is determined based on the indirect illumination and the direct illumination.

17. A rendering device, characterized in that: The device comprises: a candidate voxel identification unit configured to identify candidate voxels where patches of a mesh model of an object in a target scene are located; a target voxel determination unit, configured to determine a target voxel visible to the target light source from the identified candidate voxels; a voxel irradiance determination unit configured to determine voxel irradiances for a plurality of detail levels of the target scene based on the target light source and the target voxel; and The indirect lighting determination unit is configured to determine the indirect lighting of the shading points in the target scene based on the voxel irradiances of the multiple detail levels for rendering an image for the target scene, wherein the shading points correspond to pixels in a display screen.

18. An electronic device, comprising: at least one computing unit; At least one memory, the at least one memory being coupled to the at least one computing unit and storing instructions for execution by the at least one computing unit, the instructions, when executed by the at least one computing unit, causing the device to perform the method according to any one of claims 1-16.

19. A computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method according to any one of claims 1 to 16.

20. A computer program product comprising computer executable instructions, wherein the computer executable instructions, when executed by a processor, implement the method according to any one of claims 1 to 16.

Citation Information

Patent Citations

  • Multi-light-source scene acceleration rendering method based on scene multi-direction voxelization

    CN106558092A

  • Cone tracing dynamic global illumination method based on cascaded texture

    CN108537869A

  • Real-time overall illumination method and device in game, medium and electronic equipment

    CN109364481A

  • Scene model rendering method and device thereof, electronic equipment and storage medium

    CN113178014A

  • Three-dimensional scene rendering method and device, electronic equipment and storage medium

    CN114419234A

Cited By

  • Infrared simulation method and system based on neural network and GPU parallel computing

    CN119579752A

  • Real-time rendering display system and method for UI interface layout information based on swan gap system

    CN120234083A

  • A real-time rendering and display system and method for UI interface layout information based on Hongmeng system

    CN120234083B

  • Cloud exhibition hall multimedia component cross-terminal adaptive rendering control method

    CN122066839A

  • Cloud Exhibition Hall Multimedia Component Cross-Terminal Adaptive Rendering Control Method

    CN122066839B