Rendering method, rendering device, equipment and storage medium
By identifying candidate voxels and target light source visible voxels on the mobile terminal device, and calculating voxel irradiance at multiple levels of detail, the problem of high computing resource consumption in the existing technology is solved, and high-level computing resources are provided on the mobile terminal. High-quality global illumination effects, including realistic indirect lighting and multiple lighting effects.
Patent Information
- Application Number
- CN202310253720.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-08
- Publication Date
- 2024-09-10
AI Technical Summary
When implementing real-time global illumination rendering, the existing technology consumes high computing resources and is difficult to provide high-quality global illumination effects on mobile terminal devices. In particular, calculating indirect illumination requires high computing power and cannot be executed on mobile devices. And the lighting effect is single.
By identifying the candidate voxels where the mesh model patches of the objects in the target scene are located, the target voxels visible to the target light source are determined, and based on the target light source and target voxels, voxel irradiances at multiple levels of detail are calculated, and then Determine indirect lighting in the target scene, reduce the number of calculation voxels, reduce computing resource requirements, and provide real-time global illumination.
Indirect lighting is calculated on computing devices with fewer resources, providing more realistic lighting effects, including contact shadows and glossy reflections, improving the user experience, reducing rendering time and increasing rendering speed.
Smart Images

Figure CN118628637A
Abstract
Description
Technical Field
[0001] 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
[0002] With the development of computer technology, computer graphics has also developed rapidly. Computer graphics is mainly used to represent graphics in computers, and to use computers to calculate, process and display graphics. In the development of computer graphics, global illumination technology is a hot research topic in computer graphics because it can increase the realism of rendered scenes.
[0003] Global illumination technology is one of the core technologies for achieving realistic rendering. When using global illumination methods to render images, not only direct illumination but also indirect illumination needs to be considered. Therefore, the images rendered in this way are more realistic. This makes this technology extremely important in application fields such as games, film and television, and animation. Since global illumination technology is still in the process of rapid development, there are still many problems that need to be solved in the process of using global illumination technology for image rendering. Summary of the invention
[0004] An embodiment of the present application provides a rendering solution.
[0005] 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 of multiple levels of detail for the target scene based on the target light source and the target voxels; and determining indirect lighting of shading points in the target scene based on the voxel irradiances of the multiple levels of detail for rendering an image for the target scene, wherein the shading points correspond to pixels in a display screen.
[0006] 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, which reduces the number of voxels that need to be processed in the process of calculating indirect lighting, thereby reducing the amount of calculation of multiple levels of voxel irradiance and indirect lighting, 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 scene geometry information 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.
[0007] In some embodiments, identifying the candidate voxels where the patches of the mesh model of the object in the target scene are located includes: projecting the patch to the orthogonal plane based on the projection matrix for the orthogonal plane; determining the fragment corresponding to the patch by rasterizing the projected patch; back-projecting the fragment to the coordinate space where the target scene is located based on the projection matrix; and determining the voxel including the fragment in the coordinate space 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.
[0008] In some embodiments, projecting the patch onto the orthogonal plane comprises: 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.
[0009] In some embodiments, determining the fragment corresponding to the projected patch by rasterizing the projected patch includes: determining the attributes of the fragment by interpolating the attributes of the vertices, the attributes of the vertices at least including two-dimensional texture coordinates; and determining the material of the fragment based on the two-dimensional texture coordinates of the fragment. In this way, the material information of the fragment can be quickly determined, so that the opacity of the fragment can be determined.
[0010] In some embodiments, the candidate voxel where the patch of the mesh model of the object in the target scene is located further includes: determining a group of fragments included in the candidate voxel; and determining the attribute of the candidate voxel based on the attribute of the group of fragments. In this way, the attribute of the candidate voxel can be determined quickly and accurately.
[0011] In some embodiments, determining the target voxel visible to the target light source 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 improving user experience.
[0012] In some embodiments, determining the voxel irradiances of the multiple detail levels for the target scene includes: determining the voxel irradiances of the multiple detail levels for the portion of voxels when processing the odd image frames; and determining the voxel irradiances of the multiple detail levels for the remaining voxels when processing the even image frames. In this way, a very high rendering speed can be achieved, thereby improving rendering efficiency and improving user experience.
[0013] In some embodiments, the indirect lighting is target indirect lighting, and determining the indirect lighting of the shading point in the target scene includes: determining the first indirect lighting of the shading point based on the normal, material and voxel irradiance of the multiple detail levels of the shading point; obtaining the second indirect lighting for the shading point in the previous image frame; and determining the target indirect lighting based on the first indirect lighting and the second indirect lighting. In this way, the requirements for device computing resources can be reduced, which is suitable for providing real-time global illumination effects on low-end mobile terminal devices.
[0014] In some embodiments, the indirect lighting is target indirect lighting, and determining the indirect lighting of the shading point in the target scene includes: determining the third indirect lighting of the shading point and the fourth indirect lighting of the adjacent shading point of the shading point; and determining the target indirect lighting based on the third indirect lighting and the fourth indirect lighting. In this way, the requirements for device computing resources can be reduced, which is suitable for providing real-time global illumination effects on low-end mobile terminal devices.
[0015] In some embodiments, the target indirect lighting is determined using a cone formed at the shading point. In this way, the requirements on device computing resources can be reduced.
[0016] In some embodiments, the properties of the target voxel include at least a normal, a color, and an opacity in six directions, wherein determining the voxel irradiance for multiple detail levels 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 the first detail level in multiple detail levels based on the voxel irradiance of the target voxel; and determining the voxel irradiance and opacity of the voxels in the second detail level in the multiple detail levels in the six directions based on the voxel irradiance of the first detail level and the opacity of the target voxel in six directions. In this way, the opacity of the voxels in six directions is saved during the initial voxelization, and anisotropic lighting calculation at the lowest detail level can be achieved, and relatively correct lighting results can be obtained for any type of patch, reducing the occurrence of light leakage.
[0017] In some embodiments, determining the indirect lighting of the shading point of the target scene includes: projecting the facets in the mesh model to the display screen based on a projection matrix for the display screen; determining the target fragment corresponding to the facet by rasterizing the projected facets, 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 quickly calculated.
[0018] In some embodiments, determining the indirect lighting of the shading point by using voxel cone tracing includes: in response to the material having a surface supporting diffuse reflection, collecting the indirect lighting through multiple cones formed at the shading point; and in response to the material having a surface supporting specular reflection, collecting the indirect lighting through a cone formed at the shading point. In this way, different surfaces can be processed differently, so that the obtained indirect lighting is more accurate.
[0019] In some embodiments, collecting the indirect illumination through multiple cones formed at the shading point or collecting the indirect illumination through a cone formed at the shading point includes: in response to a target detail level for a sampling point in the cone being lower than a threshold level, discarding the voxel irradiance for the target detail level. In this way, by setting a detail level threshold, erroneous sampling results are eliminated, effectively reducing color bleeding.
[0020] In some embodiments, determining the target voxel visible to the target light source from the identified candidate voxels includes: determining 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. 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.
[0021] 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, the direct illumination and the corresponding global illumination can be obtained quickly and accurately.
[0022] 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 to the target light source from the identified candidate voxels; a voxel irradiance determination unit configured to determine voxel irradiances of multiple detail levels for 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 detail levels for rendering an image for the target scene, wherein the shading points correspond to pixels in a display screen.
[0023] In some embodiments, the candidate voxel identification unit includes: a projection unit configured to project the patch onto an orthogonal plane based on a projection matrix for the orthogonal plane; a fragment determination unit configured to determine the fragment corresponding to the patch by rasterizing the projected patch; and a back-projection unit configured to back-project the fragment onto a coordinate space where the target scene is located based on the projection matrix. The candidate voxel determination unit is configured to determine the voxel including the fragment in the coordinate space as the candidate voxel.
[0024] 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 the projection matrix.
[0025] 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 vertices, the attributes of the vertices including at least two-dimensional texture coordinates; and a material determination unit, configured to determine the material of the fragment based on the two-dimensional texture coordinates of the fragment.
[0026] 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.
[0027] In some embodiments, the target voxel determination unit includes: an odd frame voxel determination unit, configured to determine the target voxel from identified candidate voxels in a portion of the voxels of the target scene when processing an odd image frame to be displayed on a display screen; and an even frame voxel determination unit, configured to determine the target voxel from identified candidate voxels in the remaining voxels of the target scene when processing an even image frame to be displayed on the display screen.
[0028] 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.
[0029] 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.
[0030] In some embodiments, where the indirect lighting is target indirect lighting, 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.
[0031] In some embodiments, target indirect lighting is determined using a cone formed at the shading point.
[0032] 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 a 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 of voxels in a second detail level among multiple detail levels in six directions based on the voxel irradiance of the first detail level and the opacity of the target voxel in six directions.
[0033] In some embodiments, the indirect lighting determination unit includes: a patch projection unit, configured to project patches in a 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, wherein the target fragment includes 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 a shading point by using voxel cone tracing based on the normal, material, and voxel irradiance of multiple levels of detail of the shading point.
[0034] 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.
[0035] In some embodiments, the plurality of pyramid collection units or the one pyramid 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 pyramid being lower than a threshold level.
[0036] In some embodiments, the target voxel determination unit includes: a first determination 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.
[0037] In some embodiments, the rendering device 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 illumination determination unit configured to determine the global illumination of the shading point based on the indirect lighting and the direct lighting.
[0038] 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 when the instructions are executed by the at least one computing unit, the device executes the method described in the first aspect of the present application.
[0039] According to a fourth aspect of the present application, a computer-readable storage medium is further provided, on which a computer program is stored, and when the program is executed by a processor, the method described in the first aspect of the present application is implemented.
[0040] According to a fifth aspect of the present application, a computer program product is also 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.
[0041] It can be understood that the device 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 by the first aspect. Therefore, the explanation or description of the first aspect is also applicable to the second aspect, the third aspect, the fourth aspect, and the fifth aspect. In addition, the beneficial effects that can be achieved by the second aspect, the third aspect, the fourth aspect, and the fifth aspect can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] 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:
[0043] Figure 1 A schematic diagram of the structure of an electronic device provided according to some embodiments of the present application is shown;
[0044] Figure 2 A software structure block diagram of an electronic device provided according to some embodiments of the present application is shown;
[0045] Figure 3 A system architecture diagram according to some embodiments of the present application is shown;
[0046] Figure 4 A schematic diagram showing an implementation form in a system architecture according to some embodiments of the present application;
[0047] Figure 5 A schematic flowchart of a rendering process according to some embodiments of the present application is shown;
[0048] Figure 6 A schematic flow chart showing an example process for determining indirect lighting according to some embodiments of the present application is shown;
[0049] Figure 7 A schematic diagram showing a voxelization operation performed by a scene voxelization module according to some embodiments of the present application is shown;
[0050] Figure 8 A schematic diagram showing a voxel illumination injection operation performed by a voxel illumination injection module according to some embodiments of the present application is shown;
[0051] Fig. 9 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 is shown;
[0052] Fig. 10A A schematic diagram showing an example of collecting indirect lighting on a diffusely reflective object surface according to some embodiments of the present application;
[0053] Fig. 10B A schematic diagram showing another example of collecting indirect lighting on a glossy reflective object surface according to some embodiments of the present application;
[0054] Fig. 10C A schematic diagram showing an example of using a cone to collect indirect lighting according to some embodiments of the present application;
[0055] Fig.11 A schematic flow chart showing another example process for determining indirect lighting according to some embodiments of the present application is shown;
[0056] Fig.12 A schematic flow chart showing another example process for determining indirect lighting according to some embodiments of the present application is shown;
[0057] Fig.13 A schematic diagram showing a comparative example of rendering effects of a conventional method and the method of the present application; and
[0058] Fig.14 A block diagram of a rendering device according to some embodiments of the present application is shown. DETAILED DESCRIPTION
[0059] The technical solution 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.
[0060] 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 represent A or B, or A and B. "And / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: 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.
[0061] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, 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.
[0062] The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to be limitations on the present disclosure. As used in the specification and appended claims of the present disclosure, the singular expressions "one", "a kind", "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 represent: 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 objects associated before and after are in an "or" relationship.
[0063] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present disclosure. Thus, the phrases "one embodiment", "some embodiments", "another embodiment", "some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0064] The numbers or numerical values used in this specification are all illustrative and are only intended to facilitate understanding of the techniques of the embodiments of the present disclosure, and are by no means intended to limit the scope of the present disclosure.
[0065] The method provided in the embodiments of the present disclosure can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted 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.
[0066] Below, some terms that may be involved in the embodiments of the present disclosure are first introduced in detail.
[0067] 1. Graphics processing unit (GPU)
[0068] GPU is a special type of hardware used to process graphics in computers. Its advantage is that it can process multiple similar tasks in parallel. For example, when rendering a picture, multiple pixels are rendered at the same time. GPU can accelerate this process. A GPU can process thousands of tasks in parallel.
[0069] 2. Central processing unit (CPU)
[0070] The CPU is the brain of all chips, and all tasks must be processed through the CPU. The CPU's main 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 now (2022), when multi-core parallel processors are popular, it can only support the parallel execution of a few to dozens of tasks.
[0071] 3. Rendering Frames
[0072] A rendered frame refers to an image rendered by a graphics processor (GPU). Continuous playback of multiple rendered frames can create a dynamic effect.
[0073] 4. Frame rate
[0074] In real-time rendering, the number of rendered frames produced per second is called the frame rate, and the unit is frame per second (FPS). For example, "frame rate 60" means that 60 rendered frames are produced in one second. The higher the frame rate, the smoother the display effect.
[0075] 5. Power consumption
[0076] Power consumption is used to measure the efficiency of resource consumption (power) in the computing process. The unit of power consumption can be milliampere (mA). Under the premise that the battery power of the device is constant, the higher the power consumption of the device, the greater the power consumption per unit time, resulting in a shorter usage time.
[0077] 6. Chip frequency
[0078] 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 power consumption of the chip is also higher.
[0079] 7. Frequency and frame limits
[0080] Frequency and frame limiting refers to a mandatory method of limiting the chip operating frequency (chip frequency) and game running frame rate in order to prevent mobile phones and other electronic devices from overheating during gaming.
[0081] 8. Battery life
[0082] 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.
[0083] 9. Textures
[0084] A map is another name for a "picture" when it is drawn. In addition, it can also be called a texture.
[0085] 10. Energy efficiency ratio
[0086] Energy efficiency ratio refers to the ratio of computing power divided by energy (or power consumption), that is, the computing power provided by unit energy. The higher the energy efficiency ratio, the stronger the computing power provided by unit energy and the more advanced the chip. In order to save power, it is usually necessary to use more chips with high energy efficiency ratio and reduce the use of chips with low energy efficiency ratio.
[0087] 11. Primitives
[0088] Primitives refer to different drawing shapes, such as circles, rectangles, lines, pictures, text, curves, etc. Each primitive has its own description method, for example, a circle can be described by its center and radius.
[0089] 12. Triangulation
[0090] The architecture of modern GPUs usually only supports drawing triangles well, so all primitives will be converted into triangles on the CPU side. This process is called primitive triangulation.
[0091] 13. Spatial locality
[0092] When the CPU loads data, it loads a whole block of data into the cache together, and then frequently reads and writes data in the cache, which can speed up the CPU operation. This kind of continuous storage of frequently accessed data is called good spatial locality. If the frequently accessed data is placed separately, it is necessary to continuously load multiple blocks of data into the cache multiple times. At this time, the spatial locality is poor, which will greatly affect the operation efficiency.
[0093] 14. Animation shader (AS)
[0094] Animation shader is a technology that migrates user interface (UI) animations calculated on the CPU to the GPU.
[0095] 15. Vertex shader (VS)
[0096] 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.
[0097] 16. Fragment shader (FS)
[0098] Fragment / pixel shaders are instructions that control how to color screen pixels. After passing through the fragment shader, the color of each coordinate point on the screen has been determined.
[0099] 17. Graphics Processing Unit Scene (GPU Scene)
[0100] The GPU scene is a set of scene data formats defined in this disclosure. The GPU scene contains all the data required for drawing. The CPU side defines the scene data, and the GPU side parses the scene data. The function of GPU Scene is somewhat similar to the Primitive Buffer of Machinery, but the format is completely different.
[0101] 18. Index
[0102] 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 in the other memory.
[0103] 19. Data Flow
[0104] Data stream refers to an uninterrupted string of binary data. Direct observation of the data stream cannot obtain effective information, and effective information can only be obtained after decoding the data stream. It is similar to transmitting all the water (effective data) in a cup in the form of water stream (data stream), and the water in the water stream needs to be classified (parsed) when it is used.
[0105] 20.Drawcall
[0106] 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.
[0107] 21.Control Tree
[0108] An application is drawn by combining all controls together. Each control is a geometric primitive. Take Changlian as an example. In the chat page of Changlian, each chat box is a control. Controls have a hierarchical relationship. For example, the 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 hierarchical relationship is called a "control tree". Every application has a control tree.
[0109] 22. Render Tree
[0110] When rendering, there will be a series of rendering objects, which basically correspond to the control tree one by one. This forms a rendering tree. The reason why the control tree is not directly used as the rendering tree is that it is time-consuming to update, create, and delete each node of the rendering tree, while the update, creation, and deletion of the nodes of the control tree are relatively lightweight. Therefore, most of the time when the page changes, we only update the control tree, then find the redundant parts in the control tree, and then update the rendering tree.
[0111] 23. Shader
[0112] 2D graphics means that no matter how you move your perspective, the buildings, flowers, and trees on the ground will not change. 3D graphics are different. As the perspective changes, the objects you see also change, from the front to the side. The farther the object, the smaller it is, and the closer it is, the larger it is. It is very similar to what the human eye sees in real life. Shader is a technology specifically used to render 3D graphics. Through shader, programmers can write their own algorithms for graphics card rendering to make the picture more beautiful and realistic. A few years ago, there was no such thing as shader, so the graphics cards at that time did not support shader, but only supported fixed pipeline rendering, and the game screen was not as cool as it is now. There are two types of shaders, one is vertex shader (3D graphics are composed of triangles one by one, and vertex shader calculates the vertex position and prepares for later pixel rendering), and the other is pixel shader. As the name suggests, pixel shader is a series of algorithms that calculate light and color in pixels. Several different graphics APIs have their own shader languages: in DirectX, the vertex shader is called vertex shader and the pixel shader is called pixel shader; in OpenGL, the vertex shader is also called vertex shader, but the pixel shader is called fragment shader.
[0113] 24. Diffuse Reflection
[0114] Diffuse reflection refers to the phenomenon that light projected onto a rough surface is reflected irregularly in all directions. The lighting effect has nothing to do with the direction of sight, but only with the angle between the surface normal of the object and the direction of the light source.
[0115] 25. Glossy Reflection
[0116] Glossy reflection refers to the phenomenon that light projected onto a relatively smooth (non-mirror) surface is reflected to a certain range around the mirror reflection direction. The lighting effect is related to the line of sight direction, the surface normal of the object, and the direction of the light source.
[0117] 26. Contact Shadow
[0118] Contact shadows are a lighting effect that creates shadows when objects are obscured.
[0119] 27. Pixel
[0120] Pixel is the basic unit of image display and cannot be divided any further. Each pixel is a small grid of a single color.
[0121] 28. Texel
[0122] 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.
[0123] 29. Voxel
[0124] Voxel is the basic unit of discretization of three-dimensional space, and each voxel stores the value of that position in three-dimensional space.
[0125] 30. Surfel
[0126] A face element is similar to a pixel or voxel, and is the basic unit of discrete representation of the surface of an object. It is usually used to approximate the surface of a three-dimensional object.
[0127] 31. Voxel Light Injection
[0128] 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.
[0129] 32. Voxel Light Mipmap:
[0130] Voxel lighting level refinement refers to caching lighting of different precisions level by level 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).
[0131] 33. Post Process
[0132] Post-processing is a step in the rendering process, which further processes the rendered image to improve the image quality or produce a specific rendering effect.
[0133] 34. Anisotropic Opacity
[0134] 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.
[0135] 35. Anisotropic Filter
[0136] Anisotropic filtering refers to filtering in each direction separately, and is a commonly used method for voxel lighting level refinement.
[0137] 36. Scene Parsing
[0138] 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.
[0139] 37. Clipmap
[0140] 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.
[0141] 38. Voxelization
[0142] 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.
[0143] 39. Rasterization
[0144] 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.
[0145] 40.MeshCard
[0146] MeshCard is a data structure proposed in UE5, which is used to approximate objects.
[0147] 41. Radiance
[0148] Radiance is a measure of the brightness of a propagating ray of light.
[0149] 42. Irradiance
[0150] Irradiance refers to the brightness of all light received per unit area.
[0151] For example, Figure 11 shows a schematic diagram of the structure of the 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 screen 194, and a subscriber identification module (SIM) card interface 195, etc. 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.
[0152] It is to be understood that the structure illustrated in the embodiment of the present disclosure does 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 in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0153] 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 processor (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), etc. Different processing units may be independent devices or integrated into one or more processors.
[0154] 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.
[0155] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0156] In some embodiments, the processor 110 may include one or more interfaces. The interface 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, etc.
[0157] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.
[0158] 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 achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
[0159] 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 to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0160] The UART interface is a universal serial data bus for asynchronous communication. The 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 generally 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 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0161] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0162] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the 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.
[0163] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.
[0164] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present disclosure is only for illustrative purposes 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 in the above embodiments, or a combination of multiple interface connection methods.
[0165] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
[0166] 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 supplies power to the processor 110, the internal memory 121, the external memory, the display screen 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 number, battery health status (leakage, impedance), etc. 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.
[0167] 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.
[0168] 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 the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0169] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., 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.
[0170] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent 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 the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a 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.
[0171] 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 integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0172] 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 the network and other devices through wireless communication technology. The wireless communication technology 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).
[0173] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0174] The display screen 194 is used to display images, videos, etc. The 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 or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0175] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0176] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0177] 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 optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted 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.
[0178] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0179] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0180] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0181] 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 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0182] 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 may store an operating system, at least one App required for a function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may 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.
[0183] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0184] 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 arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0185] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0186] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0187] Microphone 170C, also called "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 microphone 170C to input the sound signal into 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 sound source, realize directional recording function, etc.
[0188] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0189] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0190] The gyro 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 gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro 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 gyro sensor 180B can also be used for navigation and somatosensory game scenes.
[0191] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
[0192] 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 leather 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 according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.
[0193] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0194] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
[0195] 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 holds 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.
[0196] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0197] 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.
[0198] 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 a 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 avoid abnormal shutdown of the electronic device 100 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 avoid abnormal shutdown caused by low temperature.
[0199] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and 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 acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0200] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.
[0201] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0202] 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.
[0203] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0204] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out 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, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0205] 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.
[0206] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The present disclosure takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.
[0207] Figure 2 1 is a software structure diagram of the electronic device 100 of the embodiment of the present disclosure. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer. The application layer can include a series of application packages.
[0208] like Figure 2 As shown, the application package may include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
[0209] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0210] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0211] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0212] 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.
[0213] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0214] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
[0215] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0216] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0217] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0218] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0219] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0220] The system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0221] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0222] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0223] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0224] A 2D graphics engine is a drawing engine for 2D drawings.
[0225] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0226] It should be understood that the technical solution in the embodiment of the present disclosure can be used in Android TM 、iOS TM , Hongmeng TM etc. system.
[0227] The technical solution of the embodiment of the present disclosure can be applied to electronic devices so that the electronic devices can provide real global illumination while using fewer resources. The electronic device in the embodiment of the present disclosure can be a laptop computer, or a portable electronic device such as a mobile phone, a tablet computer, a camera, a video camera, a video recorder, or other electronic devices with a battery life, an electronic device in a 5G network, or an electronic device in a public land mobile network (PLMN) that will evolve in the future, etc., and the present disclosure does not limit this.
[0228] As mentioned above, global illumination technology is required when performing rendering operations. However, although traditional global illumination methods based on ray tracing can provide realistic global illumination effects, such methods require high computing power and rely on hardware ray tracing devices, making it difficult to achieve real-time global illumination calculations. Therefore, how to achieve real-time, high-quality global illumination that does not rely on hardware ray tracing is one of the main research directions in the field of real-time rendering in computer graphics.
[0229] In order to achieve real-time global illumination rendering, in a traditional solution, the deferred VCT method is used to voxelize the space where the entire scene is located and cache the scene's geometry and lighting information. This method voxelizes the scene to be rendered, saves the MipMap of the voxel lighting, and calculates the global illumination of the shading point. This method requires dividing the three-dimensional space where the scene is located into a uniform three-dimensional regular grid (3D Regular Grid), and each voxel in the array saves the scene's geometry, color, irradiance and other information. Then, the voxel irradiance of different levels of precision is calculated by anisotropic filtering. Finally, VCT is used to calculate the indirect lighting of the shading point, and together with the direct lighting of the traditional rasterization method, it forms the final global illumination result. Deferred VCT can provide real-time and fully dynamic global illumination effects on high-performance PCs and host devices, but the scene voxelization representation method it uses is highly complex, so it requires extremely high computing power and cannot provide real-time global illumination effects on mobile terminal devices. At the same time, because the voxelization method is too simple, the final global illumination effect will have obvious light leakage defects.
[0230] In another traditional solution, voxel global illumination (VXGI) uses ClipMap to voxelize the space around the camera and cache the geometry and lighting information of the scene; further, only the three-dimensional space around the camera is voxelized, and the opacity and emittance of the voxels in different directions are saved, so that higher-precision voxel data can be saved and the storage burden caused by the voxelization of the entire scene can be reduced. VXGI can provide high-quality real-time full-dynamic global illumination effects on high-performance personal computers and host devices, but when the camera moves, the voxel data needs to be updated again for each frame, which requires extremely high computing power and cannot provide real-time global illumination effects on mobile terminal devices. In another traditional solution, dynamic diffuse global illumination (DDGI) is a global illumination method that uses light probes to cache lighting. This method evenly places spherical light probes in the three-dimensional space where the scene is located, and calculates the irradiance of indirect lighting and the distance information of the scene for each texel on the light probe by ray tracing. Finally, the indirect lighting of each shading point is calculated by interpolation. Although DDGI can provide real-time diffuse dynamic global illumination effects on mobile devices after being improved, the lighting effect of the interpolation-based lighting calculation method is limited. It can only provide diffuse reflection effects and cannot provide more complex glossy reflections, contact shadows and other effects. In addition, since the illumination is collected by time domain accumulation, the global illumination effect will be delayed when the light source changes. Although these traditional methods can achieve real-time global illumination rendering, there are still problems such as high computing power required to calculate global illumination, especially indirect illumination, and more computing resources are used. It is usually impossible to execute on mobile devices, and the lighting effect is relatively simple.
[0231] In order to solve at least some of the above problems and other potential problems, in an embodiment of the present application, a computing device first identifies a candidate voxel where a patch of a mesh model of an object in a target scene is located. Then, the computing device determines a target voxel visible to the target light source from the identified candidate voxel. Next, the computing device uses the target light source and the target voxel to determine the voxel irradiance of multiple levels of detail for the target scene. Then, the computing device determines the indirect lighting of the shading point in the target scene based on the voxel irradiance of the multiple levels of detail, where the shading point corresponds to the pixel point in the display screen. Based on this approach, the candidate voxel where the patch is located is first identified, and then the target voxel visible to the target light source is selected from the candidate voxel for the subsequent calculation of indirect lighting, so that all voxels in the target scene do not need to be calculated, which reduces the number of voxels that need to be processed in the process of calculating indirect lighting, thereby reducing the amount of calculation of multiple levels of voxel irradiance and indirect lighting, and reducing the requirements for device computing resources. Therefore, indirect lighting can be calculated on a computing device with fewer resources, thereby providing real-time global illumination. In addition, by using voxelization, the high and low frequency information of the lighting and the scene geometry information can be better preserved, thereby providing a more realistic lighting effect. In some embodiments, lighting effects such as contact shadows and glossy reflections can also be provided, thereby improving the user experience.
[0232] Figure 3 The system architecture diagram according to some embodiments of the present application is shown. 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 the present application is the renderer 306.
[0233] In this example, the scene data module 302 includes all data present in the scene. The scene data module 302 may include a model 314, light source data 316, camera data 318, and other data 320. The model 314 may refer to a patch model of each object in the scene, the light source data 316 may include the position and direction of the light source, the camera data 316 may include the position and direction of the camera, and other data 320 may describe some scene configuration data in the scene, such as the scene including water mist, etc.
[0234] 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 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 according to the scene data. The shader 322 is a logic code running on the GPU side, and the steps of scene voxelization, illumination injection, illumination Mipmap, indirect illumination calculation, etc. in this application are all implemented in this module. The rendering pipeline 324 configures the execution flow of each computing task on the GPU side, wherein the execution order of the steps of scene voxelization, illumination injection, illumination Mipmap, indirect illumination calculation, etc. are all configured in this module, and the GPU cache space that needs to store intermediate variables (such as voxel data, etc.) is applied for and configured in this module.
[0235] The rendering hardware interface 308 is an 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 GPU drivers 310 and GPU hardware 312 to support the running of programs on the GPU.
[0236] Figure 4 A schematic diagram of an example 400 of an implementation form of the present application in a system architecture according to some embodiments of the present application is shown. Figure 4In the system architecture, a scene data module 402, a data processing module 404, a renderer 406, a rendering hardware interface 408, a GPU driver 410 and a GPU hardware 412 are included. The renderer 406 is the core part of the rendering engine, which directly affects the performance and effect of the rendering. Its main function is to specify the rendering process, shading algorithm, etc. The process of calculating global illumination in the present application is mainly performed in the renderer 406, and its example process 414 of outputting a color image includes the following operations: At box 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 include a tree structure formed by various objects in the scene. Traverse each node to obtain a network model corresponding to each node. Then, the position data of each network model is updated. Some objects in the target scene are movable, so the position data of the corresponding network model needs to be updated. At box 420, a shadow map is generated. This operation generates a shadow map corresponding to the light source in the target scene according to the type, position and orientation of each light source. At box 418, the scene is voxelized. In the three-dimensional space where the scene is located, the normal, color, voxel opacity and voxel non-empty flag of the face contained in each voxel are calculated and stored in the voxel. At box 422, voxel lighting injection is determined. In this step, each light source calculates the visibility of each voxel based on the shadow map, and for visible and non-empty voxels, the voxel irradiance is calculated and stored in the voxel.
[0237] Next, at box 424, a voxel lighting Mipmap is generated. For voxels at the Nth level of detail, the lighting irradiance is calculated from the N-1th layer voxels and stored in the voxels, where the irradiance of the 0th layer voxels is the voxel irradiance obtained by lighting injection calculated at box 422; at box 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 as indirect lighting for the shading point. At box 428, direct lighting is calculated. For each light source, the 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. Then at box 430, global illumination is calculated by mixing: the indirect lighting result of the shading point is added to the direct lighting result as the global illumination of the shading point. Finally, at box 432, a color image is output: the rendered color image with global illumination information is output from the frame buffer to the screen.
[0238] Combined with the above Figure 4 A schematic diagram describing the implementation of the present application in a system architecture according to some embodiments of the present application. Figure 5 A schematic flowchart of the rendering process according to some embodiments of the present application is further described in detail. Figure 1 The process is executed at the electronic device 100 and any suitable computing device.
[0239] At box 502, the candidate voxels where the facets of the mesh model of the object in the target scene are located are identified. For example, the computing device 100 will identify the candidate voxels where the facets of the mesh model of the object in the target scene are located during the voxelization process of the target scene. In one example, the mesh model of the object in the target scene is composed of triangular facets. In another example, the mesh model of the object in the target scene is composed of quadrilateral facets. The above examples are only used to describe the present disclosure, but not to specifically limit the present disclosure. In addition, before voxelizing the target scene, the computing device 100 first traverses the target scene. Specifically, the computing device 100 traverses each node in the target scene graph to obtain the data of the mesh model of the object corresponding to each node, and updates the position data of the mesh model corresponding to each object included in the scene. Further, after obtaining these data, the computing device 100 will also generate a shadow map corresponding to the light source according to the type, position, and orientation of each light source, combined with the data of the obtained mesh model. The process of determining the shadow map can be obtained based on various existing suitable methods.
[0240] In some embodiments, when identifying the candidate voxels where the patch of the mesh model of the object in the target scene is located, the computing device 100 uses the projection matrix for the orthogonal plane to project the patch of each mesh model to the orthogonal plane. For example, the xy plane, the xz plane and the yz plane. In addition, when projecting the patch to the orthogonal plane, camera parameters are also required. The camera parameters can be used to limit the size of the space to be processed. In this process, the computing device uses the projection matrix and the camera parameters to determine the position of the vertices of the patch in the orthogonal plane, for example, the position of the vertices of the patch in the orthogonal plane is determined by multiplying the projection matrix by the vector of the item point. Next, the computing device 100 performs rasterization processing on the projected patch, thereby obtaining the fragment corresponding to the patch on the orthogonal plane. Then, the computing device 100 uses the projection matrix again to back-project the determined fragment to the coordinate space where the target scene is located. Then, the computing device 100 can determine in which voxels the fragment is located. Therefore, the computing device can determine which voxels include the fragment and identify the voxels including the fragment 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 may 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 a voxel of an upper level includes a voxel of a lower level with an occupancy mark, the voxel of the upper level is also marked with an occupancy mark.
[0241] In some embodiments, when determining the fragment corresponding to the patch by rasterizing the projected patch, the computing device may further interpolate the attributes of the vertices of the patch to determine the attributes of the fragment, and the attributes of the vertices include at least two-dimensional texture coordinates. Additionally, the attributes of the patch vertices also include normals, positions, and colors. Therefore, the computing device 100 can determine the attributes of each fragment by interpolating the attributes of the vertices of the patch. Further, each fragment can determine the material of the fragment according to its determined two-dimensional texture coordinates. The material includes opacity data. Additionally, when identifying the candidate voxel where the patch of the mesh model of the 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 included in the candidate voxel. Then, the attributes of the candidate voxel are determined according to the attributes of the group of fragments. In one example, the attributes of the same type of a group of fragments are averaged to determine the attributes of the candidate voxel. In another example, the attributes of the same type of a group of fragments are taken as the middle value to determine the attributes of the candidate voxel. The above examples are only used to describe the present disclosure, but are not specifically limited to the present disclosure.
[0242] In some embodiments, when identifying the candidate voxels where the patches of the mesh model of the object in the target scene are located, the computing device 100 may use a depth peeling algorithm. In this process, the space where the target scene is located is divided into multiple three-dimensional space slices. Each three-dimensional space slice is then processed to determine whether there are patches in the slice and the location of the patches, so that the voxels where the patches are located can be determined. The voxels that include the patches are then marked as candidate voxels.
[0243] By identifying the candidate voxels where the patch is located, it is possible to determine which voxels can be used for subsequent calculations. For voxels without patches, since they are not marked as candidate voxels, they are not calculated during the image rendering process. This operation reduces the amount of calculation in the subsequent multiple levels of voxel irradiance and indirect lighting calculations, and also reduces the requirements for device computing resources.
[0244] At block 504, target voxels visible to the target light source are determined from the identified candidate voxels. Since voxels invisible to the target light source do not need to be processed subsequently, the computing device needs to further determine target voxels visible to the target light source.
[0245] 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.
[0246] At block 506 , based on the target light source and the target voxel, voxel irradiances for multiple levels of detail of the target scene are determined. 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.
[0247] 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.
[0248] When determining the voxel irradiance of multiple detail levels for the target scene, the computing device 10 determines the voxel irradiance of the target voxel in the lowest detail level according to the target light source and the normal and color of the target voxel visible to the light source in the voxel marked by the voxel occupation mark. For example, the voxel irradiance of the target voxel is calculated using a bidirectional reflectance distribution function. At this time, the voxel irradiance of the lowest detail level is formed by the calculated voxel irradiance of the target voxel, also known as the voxel irradiance of the first detail level. Therefore, in the voxel irradiance of the first detail level, if the voxel is a target voxel, it has voxel irradiance, and 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, it is not necessary to calculate the irradiance of these voxels. For each target voxel in the first detail level, 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 the voxels in the second detail level in the multiple detail levels in the six directions based on the voxel irradiance of the first detail level in the multiple detail levels and the opacity of the target voxel in the six directions. For example, each voxel in the second detail level is formed by a cube composed of eight adjacent voxels in the first detail level. If a voxel in the second detail level includes a target voxel with voxel irradiance identified by an occupancy mark of the first detail level, the irradiance of the voxel in each direction in the second detail level is determined by the product of the irradiance of multiple voxels in the eight adjacent voxels in the first detail level and the opacity in the direction. For example, the product of the irradiance of the voxel in the eight adjacent voxels in the first detail level and the opacity of the voxel in the direction is first determined to determine the voxel irradiance of the voxel in the direction, and then the voxel irradiance of the eight adjacent voxels in the direction is added to determine the voxel irradiance of the voxel in the second detail level. Further, the opacity of the voxel in the second detail level is calculated based on the opacity of the voxel in the first detail level. If the voxels in the second detail level include multiple voxels in the first detail level that are marked with 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. 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, but 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.
[0249] At block 508, indirect lighting of a shading point in a target scene is determined based on the voxel irradiances at the multiple levels of detail for rendering an image for the target scene, wherein the shading point corresponds to a pixel in a display screen, which is a point in the target scene to be rendered at the pixel. After the voxel irradiances at the multiple levels of detail for the target scene are determined, the voxel irradiances at the multiple levels of detail may be used to determine the indirect lighting of the shading point in the target scene. After the indirect lighting is obtained, it may be used to render an image for the target scene.
[0250] 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 based on the normal, material, and voxel irradiance of multiple levels of detail of the shading point by using voxel cone tracing.
[0251] 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. Then, the computing device 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. Thus, the global illumination for the target scene can be determined.
[0252] 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, which reduces the number of voxels that need to be processed in the process of calculating indirect lighting, thereby reducing the amount of calculation of multiple levels of voxel irradiance and indirect lighting, 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 lighting effects such as contact shadows and glossy reflections, thereby improving the user experience.
[0253] 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 not to specifically limit the present invention.
[0254] Basic version
[0255] The overall operation process of Example 1 can be found in Figure 4 416-432 in FIG. Figure 6 A schematic flowchart of an example process for determining indirect lighting in the first embodiment is specifically described.
[0256] At block 602, scene data is obtained. The scene data may be obtained by Figure 4It is obtained when the scene is traversed at operation 416 in . Then, at box 606, the scene voxelization operation is performed. This step voxelizes the three-dimensional mesh of the scene and stores the scene data such as the normal and color of the three-dimensional mesh in the scene 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 vertex attributes (position, normal, color, texture map (UV) coordinates) of the scene, triangle patch index and material map. The output is a three-dimensional grid 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 mark of 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 as follows: in VS, the projection matrix and camera parameters of three orthogonal planes (XY, YZ, XZ) are set, the position of each vertex after matrix transformation is calculated according to the projection matrix and camera parameters, and the vertex attributes are interpolated 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, the material data of the fragment is sampled from the material map according to the UV coordinates of the fragment, the fragment is back-projected into the three-dimensional world space according to the camera parameters and the projection matrix, the voxel to which the fragment belongs is calculated, and the attribute data and material data of the fragment are updated to the corresponding voxel using atomic operations.
[0257] For example, Figure 7 A schematic diagram of a scene voxelization module performing a voxelization operation according to some embodiments of the present application is shown. The input 702 of the scene voxelization module 704 includes the vertices of the facets, wherein the vertices have attributes such as position, UV coordinates, normals and colors; the input 702 also includes multiple triangular facets and material maps, camera parameters and projection matrices identified by the index of the vertices. Then, the scene voxelization module 704 generates an output 706, which includes voxel occupancy marks, voxel colors, voxel normals and voxel opacity at different levels. In this example, the image data in the output 706 is a scene in which some items are placed in two nested boxes. For example, the image corresponding to the voxel occupancy marks at different levels is the scene seen from cutting the box in the middle; the voxel opacity is the opacity determined from the six directions of the box.
[0258] Return below Figure 6Next, the description is given. At box 608, the computing device 100 performs a voxel lighting injection operation. This operation calculates and saves the lighting irradiance of each voxel of the voxelized scene. This operation is performed in a compute shader (ComputeShader, CS). The three-dimensional grid array output in the operation of box 606, which contains normals, colors, occupancy marks, and opacity, and the shadow map of each light source provided by the traditional direct lighting calculation method are used as input. The output is a three-dimensional grid array, in which the irradiance of the voxel is stored in each voxel. Its internal algorithm performs the following operations for each voxel: according to 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 position of the voxel and the corresponding depth value stored in the shadow map. If the voxel is visible and the voxel is occupied, the irradiance of the voxel is calculated and saved according to the normal, color and light source in the voxel data.
[0259] For example, Figure 8 A schematic diagram of an example 800 of a voxel lighting injection module performing a voxel lighting injection operation according to some embodiments of the present application is shown. The input 802 of the voxel lighting injection module 804 includes a light source, a shadow map, and a front Figure 7 The voxel occupancy flag, voxel color and voxel normal obtained in the input 802 are obtained. The voxel lighting injection module 804 outputs 806 based on these 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.
[0260] return Figure 6 Next, at box 610, the computing device 100 performs a voxel lighting Mipmap generation operation. This operation calculates and saves the voxel lighting irradiance of different detail levels in the voxelized target scene. This operation is performed in the compute shader (CS). The input is the voxel occupancy mark output in the operation of box 606, the voxel opacity and the voxel irradiance output in operation 608. The output is N three-dimensional grid arrays of different resolutions, and the i-th (i value is 1, 2, ..., N) three-dimensional grid array stores the voxel irradiance of the detail level (LOD) i. Its internal algorithm is to perform the following steps voxel by voxel in hierarchical order: for each voxel in the i-th layer, if the voxel is occupied, use the anisotropic filtering method to collect the voxel irradiance in six directions of the i-1th layer, and multiply it with the opacity to obtain the irradiance of the six directions of the i-th layer voxel. The voxel irradiance of the 0th layer is the voxel irradiance output in operation 608.
[0261] like Fig. 9As shown, 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, LOD i-1 voxel irradiance and LOD i-1 voxel opacity to obtain an output 906, including LOD i voxel irradiance and LOD i voxel opacity.
[0262] Return now Figure 6 Next, 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 detail levels 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: the scene is projected according to the camera parameters, the triangular facets of the scene are rasterized and interpolated to obtain the three-dimensional position, normal, material properties and color of each pixel, cones are drawn on the normal hemisphere (the number is determined by the material properties and image quality requirements), and the indirect lighting is collected from the voxel irradiance map in a sampling manner using the voxel cone tracing (VCT) method.
[0263] After using the rasterization method to obtain the position, normal, and line of sight reflection direction of the screen shading point, the cone is 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 hemispherical surface of the shading point. Fig. 10A As shown, it is a schematic diagram showing an example of collecting indirect lighting on a diffusely reflective object surface according to some embodiments of the present application. Fig. 10A In the example, 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 illumination. Then the indirect illumination collected by each cone is added to obtain the indirect illumination of the shading point.
[0264] 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. Fig. 10B A schematic diagram of another example of collecting indirect lighting on a glossy reflective surface of an object according to some embodiments of the present application is shown, where the reflection direction is determined based on the camera viewpoint and the normal, and a cone 1012 is set in the reflection direction to collect indirect lighting.
[0265] In some embodiments, when indirect lighting is collected through multiple cones formed at a shading point or when indirect lighting is collected through a single cone formed at a shading point, if the target level of detail corresponding to a sampling point in the cone is below a threshold level, the voxel irradiance for the target level of detail is discarded. Fig. 10C A schematic diagram of an example of collecting indirect lighting using a cone according to some embodiments of the present application is shown. When collecting indirect lighting from the cone, multiple three-dimensional points are sampled on the cone midline, 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 the sampling point is lower than the set level of detail threshold, the irradiance of the sampling point is discarded and is not included in the final indirect lighting.
[0266] 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, which reduces the number of voxels that need to be processed in the process of calculating indirect lighting, thereby reducing the amount of calculation of multiple levels of voxel irradiance and indirect lighting, 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 scene geometry information 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.
[0267] First lightweight version
[0268] Embodiment 2 is a lightweight version of Embodiment 1. In order to reduce the amount of data that needs to be processed, when determining the target voxels visible to the target light source from the identified candidate voxels, partial data of the odd-numbered image frames and the even-numbered image frames to be displayed on the display screen are processed separately. For example, when processing odd-numbered image frames, the target voxels are determined from the identified candidate voxels in a portion of the voxels of the target scene; when processing even-numbered image frames, the target voxels are determined from the identified candidate voxels in the remaining voxels of the target scene. For example, a portion of voxels is 1 / 2 of the voxels of the target scene. Furthermore, when determining the voxel irradiance at multiple detail levels of the target scene, also for odd-numbered image frames, only the voxel irradiance at multiple detail levels for the portion of voxels is determined; for even-numbered image frames, only the voxel irradiance at multiple detail levels for the remaining voxels is determined. Therefore, this mode of operation can reduce the amount of data to be processed and improve processing efficiency. The process of this embodiment is as follows. Fig.11 As shown, it shows a schematic flow chart of another example process for determining indirect lighting according to some embodiments of the present application. Compared with the first embodiment, Fig.11 The operations of blocks 1102, 1104, 1106, and 1120 in Figure 6 The corresponding operations of boxes 602, 604, 606 and 612 in are the same. Embodiment 2 makes lightweight optimization for the steps of illumination injection and illumination Mipmap, and only calculates illumination injection and illumination Mipmap for half of the voxels in each frame. At box 1108, the computing device determines whether the current frame is an odd data frame. When it is an odd data frame, at box 1110, illumination injection is performed on the first 1 / 2 voxels. If it is an even data frame, at box 1102, illumination injection is performed on the last 1 / 2 voxels. Next, at box 1114, it is determined whether the current frame is an odd data frame. If it is an odd data frame, at box 1116, an illumination Mipmap for the first 1 / 2 voxels is generated. If it is an even frame, at box 1118, an illumination Mipmap for the last 1 / 2 voxels is generated. From the rendering effect point of view, when the lighting changes smoothly, the rendered global lighting effect has no visual difference from the embodiment 1. When the lighting changes dramatically, the rendering result will be delayed by one frame. 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.
[0269] Second lightweight version
[0270] Embodiment 3 is a lightweight version of embodiment 1. In order to reduce the amount of data processing, for the surface of diffuse reflection objects, only one cone is used to collect the target indirect illumination of the shading point. In one example, when determining the indirect illumination of the shading point in the target scene, a time domain multiplexing method is used. For example, the computing device determines the first indirect illumination of the shading point based on the normal, material and voxel irradiance of multiple detail levels of the shading point; then the computing device obtains the second indirect illumination for the shading point in the previous image frame; then the computing device uses the first indirect illumination and the second indirect illumination to determine the target indirect illumination of the shading point. For example, the two indirect illuminations are calculated using a weighted flattening algorithm to obtain the target indirect illumination or the target indirect illumination is directly determined using an average algorithm. In another example, when determining the indirect illumination of the shading point in the target scene, a spatial domain multiplexing method is used. For example, when determining the indirect illumination of the shading point in the target scene, the third indirect illumination of the shading point and the fourth indirect illumination of the adjacent shading point of the shading point are determined, and then the third indirect illumination and the fourth indirect illumination are 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.
[0271] The process of embodiment 3 is as follows Fig.12 As shown, it shows a schematic flow chart of another example process for determining indirect lighting according to some embodiments of the present application. Compared with the first embodiment, the operations in blocks 1202, 1204, 1206, 1208, and 1210 are as follows: Figure 6The corresponding operations of the middle boxes 602, 604, 606, 608, and 610 are the same. In the third embodiment, for the steps of calculating indirect lighting on the surface of a diffusely reflecting object, a lightweight optimization is performed based on the idea of time-domain and spatial-domain multiplexing. Only one cone is emitted for each shading point in each frame, and the indirect lighting is calculated with the help of the neighborhood 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 domain multiplexing can also be performed when calculating indirect lighting, such as at box 1216, the indirect light illumination of adjacent shading points is collected. Then, at box 1220, the indirect lighting of the current cone is fused, that is, the indirect lighting of the shading point obtained through a single cone is combined with the indirect lighting of the shading point in the previous frame and / or the indirect lighting of the adjacent shading points to determine the target indirect lighting of the shading point. During the fusion process, the target indirect lighting of the shading point can be obtained by applying different weight coefficients to these indirect lightings. Then, at box 1222, an indirect lighting map is generated by the indirect lighting of all shading points. From the rendering effect point of view, time domain multiplexing will bring delays in lighting changes, and global illumination will be slightly delayed when the light source changes drastically. In addition, spatial domain multiplexing will make the rendering effect more low-frequency, resulting in certain visual defects. However, the rendering scheme of this embodiment has low computing power requirements and is suitable for providing real-time global illumination effects on low-end mobile terminal devices.
[0272] In performance tests on multiple scenes, this application can provide high-quality real-time dynamic global illumination effects. Compared with the traditional voxel global illumination method, this application is faster (rendering speed 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 mobile DDGI method, the present invention can provide contact shadows and glossy reflection lighting effects. For example, Fig.13 A schematic diagram showing a comparative example 1300 of rendering effects of a conventional method and the method of the present application is shown; Fig.13 The middle figure 1302 is the rendering effect obtained by the traditional method, and the figure 1304 is the rendering effect obtained by using the method of the present application. Through comparison, it can be seen that the method of the present invention reduces light leakage.
[0273] Table 1 Comparison of rendering speed between the global illumination method of this application and the traditional voxel global illumination method
[0274]
[0275] 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.
[0276] In addition, as shown in Table 1, for the kitchen scene, the rendering time of the sparse lighting injection combined with the odd-even lighting injection of the present application is reduced by 3ms relative to the rendering time of only sparse lighting injection of the present application; for the bedroom scene, the rendering time of the sparse lighting injection combined with the odd-even lighting injection of the present application is reduced by 4.3ms relative to the rendering time of only sparse lighting injection of the present application; for the classroom scene, the rendering time of the sparse lighting injection combined with the odd-even lighting injection of the present application is reduced by 3.3ms relative to the rendering time of only sparse lighting injection of the present application; for the wooden house scene, the rendering time of the sparse lighting injection combined with the odd-even lighting injection of the present application is reduced by 3.1ms relative to the rendering time of only sparse lighting injection of the present application; for the Sponza Palace scene, the rendering time of the sparse lighting injection combined with the odd-even lighting injection of the present application is reduced by 2.5ms relative to the rendering time of only sparse lighting injection of the present application. It can be seen that the solution further combined with 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.
[0277] Fig.14A schematic block diagram of a rendering device 1400 according to an embodiment of the present disclosure is shown. The rendering device 1400 may be implemented at the electronic device 100. The rendering device 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 of multiple detail levels for a target scene based on the target light source and the target voxels; and an indirect illumination determination unit 1408, configured to determine indirect illumination of shading points in a target scene based on the voxel irradiances of multiple detail levels for rendering an image for the target scene, wherein the shading points correspond to pixels in a display screen.
[0278] In some embodiments, the candidate voxel identification unit 1402 includes: a projection unit configured to project the patch onto an orthogonal plane based on a projection matrix for the orthogonal plane; a fragment determination unit configured to determine the fragment corresponding to the patch by rasterizing the projected patch; and a back-projection unit configured to back-project the fragment onto a coordinate space where the target scene is located based on the projection matrix. The candidate voxel determination unit is configured to determine the voxel including the fragment in the coordinate space as the candidate voxel.
[0279] 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 the projection matrix.
[0280] 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 vertices, the attributes of the vertices including at least two-dimensional texture coordinates; and a material determination unit, configured to determine the material of the fragment based on the two-dimensional texture coordinates of the fragment.
[0281] 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.
[0282] In some embodiments, the target voxel determination unit 1404 includes: an odd frame voxel determination unit, configured to determine the target voxel from 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 identified candidate voxels in the remaining voxels of the target scene when processing an even image frame to be displayed on the display screen.
[0283] 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.
[0284] 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 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.
[0285] 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 of the shading point and a fourth indirect lighting of 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.
[0286] In some embodiments, target indirect lighting is determined using a cone formed at the shading point.
[0287] 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 a 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 of voxels in a second detail level among multiple detail levels in six directions based on the voxel irradiance of the first detail level and the opacity of the target voxel in six directions.
[0288] 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 a shading point by using voxel cone tracing based on the normal, material, and voxel irradiance of multiple levels of detail of the shading point.
[0289] 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.
[0290] In some embodiments, the plurality of pyramid collection units or the one pyramid 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 pyramid being lower than a threshold level.
[0291] In some embodiments, the target voxel determination unit 1404 includes: a first determination 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.
[0292] 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 illumination determination unit, configured to determine the global illumination of the shading point based on the indirect lighting and the direct lighting.
[0293] 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.
[0294] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may 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 of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) 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 disk 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 of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted 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 a wire.
[0295] 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, optical fiber transmissions, wireless transmissions, 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 for storage in the computer-readable storage medium in each computing / processing device.
[0296] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related 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++, etc., 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 completely 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., using 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 customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0297] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0298] 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, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0299] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating 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 boxes in the flowchart and / or block diagram.
[0300] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square 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 specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0301] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A rendering method, It is 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 according to claim 1, wherein the candidate voxels at which the patches of the mesh model of the object in the target scene are located are identified include: 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 according to claim 2, wherein the patch is projected onto the orthogonal plane include: 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 the fragment corresponding to the patch is determined by rasterizing the projected patch. include: 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 according to claim 2, wherein the candidate voxel at which the patch of the mesh model of the object in the target scene is located is further include: 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 according to claim 1, wherein a target voxel visible to the target light source is determined from the identified candidate voxels. include: 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 include: 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 include: 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 include: 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 voxel irradiance for multiple levels of detail of the target scene is determined include: 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 according to claim 1, wherein determining the indirect lighting of the shading point of the target scene include: 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 the indirect lighting of the shading point is determined by using voxel cone tracing include: 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 according to claim 13, wherein the indirect lighting is collected by a plurality of cones formed at the shading point or the indirect lighting is collected by a single cone formed at the shading point. include: 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 according to claim 1, wherein a target voxel visible to the target light source is determined from the identified candidate voxels. include: 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: include: 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, It is 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, include: 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
Cited By
Modeling method and device for battery material structure
CN121122439A
