Global illumination determination method, device and storage medium
By obtaining and calculating the diffuse reflection and specular reflection illumination values of the target object, combined with probe and texture map technology, the noise and accuracy problems of the existing global illumination calculation scheme are solved, and more efficient global illumination rendering is achieved.
Patent Information
- Application Number
- CN202311869789.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2043-12-29
AI Technical Summary
Due to limited computing power in the real-time field, the existing global illumination calculation scheme can only sample at 1SPP, resulting in serious picture noise. It also lacks an effective global illumination calculation scheme and cannot directly solve the integral term in the rendering equation.
By obtaining the diffuse reflection illumination value and specular reflection illumination value of the target object, using the probe for ray tracing and texture map storage, combined with the noise reduction and upsampling of the specular reflection result, the global illumination value is calculated, which makes up for the limitations of the diffuse reflection illumination value. properties and improve calculation accuracy.
It improves the calculation accuracy and rendering effect of global illumination, reduces noise, enhances the efficiency of ray tracing, and adds little computational overhead.
Smart Images

Figure CN117788677B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer image processing, and in particular to a method, device and storage medium for determining global illumination. Background Art
[0002] In recent years, with the development of computer technology, industries such as games, movies and virtual reality have shown a booming trend. Global illumination algorithms are widely used in high-realistic rendering of the above scenes. The rendered images not only need to consider the effect of light emitted by the scene light source directly shining on the considered surface (i.e. the surface of the object), but also need to consider the lighting effect of light from the light source after being reflected by other surfaces and then hitting the considered surface. Global illumination plays a huge role in the integration of the realism of object lighting and the surrounding environment.
[0003] Considering the huge amount of calculation required for accurate global illumination algorithms, the commonly used ray tracing technologies can be divided into two categories: offline ray tracing and real-time ray tracing. For offline ray tracing, since there is no performance requirement, the algorithms related to physical illumination can already achieve photorealistic rendering. In the real-time field, even with the support of existing hardware, it is still limited by computing power. For most complex scenes, it can only support rendering with a sample per pixel (SPP) of 1. Due to the extremely small number of samples, the picture has serious noise and needs to be assisted by efficient filtering or an AI-based denoiser, ultimately achieving a compromise between effect and performance.
[0004] The calculation of global illumination follows the rendering equation, and it is difficult to directly find an analytical solution due to multiple iterative integrations. A reasonable and effective calculation solution for global illumination has not yet been provided in the related art.
[0005] The most popular ray tracing solution is Monte Carlo path tracing, which is a method that uses Monte Carlo approximation to calculate the rendering equation to find the numerical solution. The disadvantage is that it requires recursive calculation of integral formulas, and convergence often requires a large number of samples. In actual calculations, in order to reduce the explosive growth of calculations, some auxiliary means are often used to speed up the convergence. In the real-time field, due to limited computing power, only 1SPP sampling can be used, which consumes a lot of calculations. Summary of the invention
[0006] In view of this, the present disclosure proposes a method, device and storage medium for determining global illumination. The technical solution includes:
[0007] According to one aspect of the present disclosure, a method for determining global illumination is provided, the method comprising:
[0008] Acquire a diffuse reflection illumination value and a specular reflection illumination value of a target object, wherein the diffuse reflection illumination value is an illumination value of a emitted light relative to a diffuse reflection of the target object, and the specular reflection illumination value is an illumination value of a emitted light relative to a specular reflection of the target object;
[0009] A global illumination value of the target object is determined according to the diffuse reflection illumination value and the specular reflection illumination value, and the global illumination value is used to render the target object.
[0010] In a possible implementation, a plurality of probes are pre-set in the virtual scene where the target object is located, and the plurality of probes are used to emit a plurality of emission lights to the virtual scene. The step of acquiring the diffuse reflection illumination value of the target object includes:
[0011] Performing ray tracing on the plurality of emitted light rays to obtain the irradiance received by the surface of the target object;
[0012] The diffuse reflection illumination value of the target object is determined according to the irradiance received by the surface of the target object.
[0013] In another possible implementation, performing ray tracing on the multiple emission light rays emitted by the multiple probes to obtain the irradiance received by the surface of the target object includes:
[0014] Performing ray tracing on the multiple emission rays emitted by the multiple probes to obtain diffuse reflection illumination information of the virtual scene, wherein the diffuse reflection illumination information is used to indicate the irradiance received by the surface of the target object;
[0015] storing diffuse lighting information of the virtual scene in a texture map;
[0016] The irradiance received by the surface of the target object is obtained by sampling the texture map.
[0017] In another possible implementation, the method further includes:
[0018] For at least one probe among the plurality of probes, determining a position offset of the probe according to target information of the probe, wherein the target information includes at least one of a light direction of the emitted light, a flag, a previous frame offset, a distance, and a probe offset length;
[0019] Updating the position of the probe according to the position offset of the probe;
[0020] Among them, the flag is used to indicate whether the target object is hit by the back of the emitted light, the previous frame offset is the position offset of the probe in the previous frame in the time domain, the distance is the distance between the probe and the target object, and the probe offset length is a variable that decreases according to a preset value each time it is updated.
[0021] In another possible implementation, the position offset of the probe has an upper limit value, and the upper limit value is determined according to the probe distance, where the probe distance is a preset value or a distance between the probe and another probe closest to the probe.
[0022] In another possible implementation, before performing ray tracing on the multiple emission rays emitted by the multiple probes, the method further includes:
[0023] The plurality of emission light rays are rearranged, and the coherence between the plurality of emission light rays after the rearrangement is higher than a preset coherence threshold.
[0024] In another possible implementation, a plurality of pixels in the screen are used to emit a plurality of emission rays to the virtual scene, and obtaining the specular reflection illumination value of the target object includes:
[0025] Performing ray tracing on the multiple emitted light rays to obtain a mirror reflection result of the target object;
[0026] The specular reflection illumination value of the target object is determined according to the specular reflection result.
[0027] In another possible implementation, the specular reflection result includes a primary reflection result and a secondary reflection result, and performing ray tracing on the multiple emitted light rays to obtain the specular reflection result of the target object includes:
[0028] Performing ray tracing on the plurality of emitted light rays to obtain the primary reflection result, wherein the primary reflection result is a reflection result calculated when the emitted light rays directly hit the target object without being ricocheted;
[0029] The secondary reflection result is determined according to the stored irradiance received by the surface of the target object, and the secondary reflection result is the reflection result calculated when the emitted light hits the target object after being bounced off surrounding objects.
[0030] In another possible implementation, the plurality of emitted light rays are sampled at a preset resolution, where the preset resolution is a non-full-screen resolution.
[0031] In another possible implementation manner, the sampled function is a visible normal distribution function (VisibleNormal Distribution Function, VNDF).
[0032] In another possible implementation, determining the specular reflection illumination value of the target object according to the specular reflection result includes:
[0033] De-noising the specular reflection result;
[0034] The specular reflection illumination value of the target object is obtained according to the specular reflection result after denoising.
[0035] In another possible implementation, determining the global illumination value of the target object according to the diffuse reflection illumination value and the specular reflection illumination value includes:
[0036] Adding the diffuse reflection illumination value and the specular reflection illumination value to obtain an indirect light illumination value of the target object;
[0037] Determine the global illumination value of the target object according to the indirect light illumination value and the direct light illumination value of the target object.
[0038] According to another aspect of the present disclosure, a global illumination determination device is provided, the device comprising:
[0039] An acquisition module, used to acquire a diffuse reflection illumination value and a specular reflection illumination value of a target object, wherein the diffuse reflection illumination value is an illumination value of a emitted light relative to a diffuse reflection of the target object, and the specular reflection illumination value is an illumination value of a emitted light relative to a specular reflection of the target object;
[0040] A determination module is used to determine a global illumination value of the target object according to the diffuse reflection illumination value and the specular reflection illumination value, wherein the global illumination value is used to render the target object.
[0041] In a possible implementation, a plurality of probes are pre-set in the virtual scene where the target object is located, and the plurality of probes are used to emit a plurality of emission lights to the virtual scene. The acquisition module is further used to:
[0042] Performing ray tracing on the plurality of emitted light rays to obtain the irradiance received by the surface of the target object;
[0043] The diffuse reflection illumination value of the target object is determined according to the irradiance received by the surface of the target object.
[0044] In another possible implementation, the acquisition module is further used to:
[0045] Performing ray tracing on the multiple emission rays emitted by the multiple probes to obtain diffuse reflection illumination information of the virtual scene, wherein the diffuse reflection illumination information is used to indicate the irradiance received by the surface of the target object;
[0046] storing diffuse lighting information of the virtual scene in a texture map;
[0047] The irradiance received by the surface of the target object is obtained by sampling the texture map.
[0048] In another possible implementation, the apparatus further includes: an updating module, wherein the updating module is configured to:
[0049] For at least one probe among the plurality of probes, determining a position offset of the probe according to target information of the probe, wherein the target information includes at least one of a light direction of the emitted light, a flag, a previous frame offset, a distance, and a probe offset length;
[0050] Updating the position of the probe according to the position offset of the probe;
[0051] Among them, the flag is used to indicate whether the target object is hit by the back of the emitted light, the previous frame offset is the position offset of the probe in the previous frame in the time domain, the distance is the distance between the probe and the target object, and the probe offset length is a variable that decreases according to a preset value each time it is updated.
[0052] In another possible implementation, the position offset of the probe has an upper limit value, and the upper limit value is determined according to the probe distance, where the probe distance is a preset value or a distance between the probe and another probe closest to the probe.
[0053] In another possible implementation, the apparatus further includes: a rearrangement module, the rearrangement module being configured to:
[0054] The plurality of emission light rays are rearranged, and the coherence between the plurality of emission light rays after the rearrangement is higher than a preset coherence threshold.
[0055] In another possible implementation, a plurality of pixels in the screen are used to emit a plurality of emission rays to the virtual scene, and the acquisition module is further used to:
[0056] Performing ray tracing on the multiple emitted light rays to obtain a mirror reflection result of the target object;
[0057] The specular reflection illumination value of the target object is determined according to the specular reflection result.
[0058] In another possible implementation, the specular reflection result includes a primary reflection result and a secondary reflection result, and the acquisition module is further used to:
[0059] Performing ray tracing on the plurality of emitted light rays to obtain the primary reflection result, wherein the primary reflection result is a reflection result calculated when the emitted light rays directly hit the target object without being ricocheted;
[0060] The secondary reflection result is determined according to the stored irradiance received by the surface of the target object, and the secondary reflection result is the reflection result calculated when the emitted light hits the target object after being bounced off surrounding objects.
[0061] In another possible implementation, the plurality of emitted light rays are sampled at a preset resolution, where the preset resolution is a non-full-screen resolution.
[0062] In another possible implementation manner, the sampled function is VNDF.
[0063] In another possible implementation, the acquisition module is further used to:
[0064] De-noising the specular reflection result;
[0065] The specular reflection illumination value of the target object is obtained according to the specular reflection result after denoising.
[0066] In another possible implementation, the determining module is further configured to:
[0067] Adding the diffuse reflection illumination value and the specular reflection illumination value to obtain an indirect light illumination value of the target object;
[0068] Determine the global illumination value of the target object according to the indirect light illumination value and the direct light illumination value of the target object.
[0069] According to another aspect of the present disclosure, a computing device is provided, the computing device comprising: a processor; a memory for storing processor-executable instructions;
[0070] Wherein, the processor is configured to:
[0071] Acquire a diffuse reflection illumination value and a specular reflection illumination value of a target object, wherein the diffuse reflection illumination value is an illumination value of a emitted light relative to a diffuse reflection of the target object, and the specular reflection illumination value is an illumination value of a emitted light relative to a specular reflection of the target object;
[0072] A global illumination value of the target object is determined according to the diffuse reflection illumination value and the specular reflection illumination value, and the global illumination value is used to render the target object.
[0073] According to another aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method provided by the above-mentioned first aspect or any possible implementation manner of the first aspect is implemented.
[0074] The disclosed embodiment obtains the diffuse reflection illumination value and the specular reflection illumination value of the target object, wherein the diffuse reflection illumination value is the illumination value of the diffuse reflection of the emitted light relative to the target object, and the specular reflection illumination value is the illumination value of the specular reflection of the emitted light relative to the target object; determines the global illumination value of the target object according to the diffuse reflection illumination value and the specular reflection illumination value, and the global illumination value is used to render the target object; that is, by superimposing and calculating the specular reflection illumination value, the limitation that only the diffuse reflection illumination value can be calculated in the related scheme is compensated, so that the global illumination value determined according to the diffuse reflection illumination value and the specular reflection illumination value is more complete and accurate, thereby improving the calculation accuracy of the global illumination, thereby improving the rendering effect based on the global illumination value. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
[0076] Figure 1 A schematic diagram of the structure of a computing device provided by an exemplary embodiment of the present disclosure is shown.
[0077] Figure 2 A flowchart of a method for determining global illumination provided by an exemplary embodiment of the present disclosure is shown.
[0078] Figure 3 A schematic diagram of a pipeline description provided by an exemplary embodiment of the present disclosure is shown.
[0079] Figure 4 A flowchart of a method for calculating diffuse reflection illumination values provided by an exemplary embodiment of the present disclosure is shown.
[0080] Figure 5 A flow chart of a method for calculating a specular reflection illumination value provided by an exemplary embodiment of the present disclosure is shown.
[0081] Figure 6 A schematic structural diagram of a global illumination determination device provided by an exemplary embodiment of the present disclosure is shown.
[0082] Figure 7It is a block diagram of a device according to an exemplary embodiment.
[0083] Figure 8 is a block diagram of a device according to another exemplary embodiment. DETAILED DESCRIPTION
[0084] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0085] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0086] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0087] In the related art, for any point in space, if we want to calculate the illumination at that point, we follow the rendering equation, that is, L(w o )=L e (w o )+∫f(p,w i ,w o )*L(w i )*cosθdw i , where w i is the incident direction, w o is the viewing direction, L e (w o ) is the self-luminous term of the point p, ∫f(p,w i ,w o )*L(w i )*cosθdw i Calculate the sum of the radiances reflected from point p in the viewing direction, f(p,w i ,w o ) is the bidirectional reflectance distribution function (BRDF), L(w i) is the incident light, which includes direct light emitted by the light source and indirect light bounced by other objects in the space, and θ is the angle between the light direction and the shading surface. Since there are few objects with self-luminous properties in the actual space, L e (w o ) is not studied much. i ,w o )*L(w i )*cosθdw i is a hemispherical integral, so the integral can be directly converted into a sum, that is N is the number of rays received at the shading point. Considering the limited computing resources, the calculation of direct light can follow the current mature solution. The required information in the space, such as normal, base color, texture coordinates, etc., is recorded by the delay pipeline, and the direct light is calculated according to the lighting formula in the calculation shader. The calculation of indirect light uses the integral formula ∫f(p,w i ,w o )*L(w i )*cosθdw i Since it is impossible to directly find the analytical solution of this integral term, we first consider decomposing this term according to the BRDF term in the formula, that is, f(p,w i ,w o ) = f d (p,w i ,w o )+f r (p,w i ,w o ) and substitute it into the above formula, decomposing the above integral term into diffuse reflection integral term f d (p,w i ,w o ) and the specular reflection integral term f r (p,w i ,w o ) and calculate them separately. For the diffuse integral term, considering the performance optimization, the dynamic diffuse global illumination (English: Dynamic Diffuse Global Illumination) method can be sampled and optimized in implementation.
[0088] Since the above method only processes diffuse reflection items and lacks directional information for calculating specular reflection and cannot directly process specular reflection items, the embodiments of the present disclosure provide a global illumination determination method, device and storage medium, by obtaining the diffuse reflection illumination value and specular reflection illumination value of the target object, the diffuse reflection illumination value is the illumination value of the diffuse reflection of the emitted light relative to the target object, and the specular reflection illumination value is the illumination value of the specular reflection of the emitted light relative to the target object; the global illumination value of the target object is determined according to the diffuse reflection illumination value and the specular reflection illumination value; that is, the specular reflection illumination value is calculated by superposition, which makes up for the limitation that only the diffuse reflection illumination value can be calculated in the related schemes, so that the global illumination value determined according to the diffuse reflection illumination value and the specular reflection illumination value is more complete and accurate, thereby improving the calculation accuracy of the global illumination, thereby improving the rendering effect based on the global illumination value.
[0089] The global illumination determination method of the disclosed embodiment may be executed by a computing device. Figure 1 , which shows a schematic diagram of the structure of a computing device provided by an exemplary embodiment of the present disclosure.
[0090] The computing device may be a terminal or a server. The terminal includes a mobile terminal or a fixed terminal, such as a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC), an intelligent robot, a car computer, and other terminal devices. The server may be a server, a server cluster consisting of several servers, or a cloud computing service center.
[0091] like Figure 1 As shown, the computing device includes a processor 10, a memory 20, and a communication interface 30. Those skilled in the art will appreciate that Figure 1 The structure shown in the figure does not constitute a limitation on the computing device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0092] in:
[0093] The processor 10 is the control center of the computing device, and uses various interfaces and lines to connect various parts of the entire computing device. By running or executing software programs and / or modules stored in the memory 20, and calling data stored in the memory 20, the processor 10 performs various functions of the computing device and processes data, thereby controlling the computing device as a whole. The processor 10 can be implemented by a central processing unit (CPU) or a graphics processing unit (GPU).
[0094] The memory 20 can be used to store software programs and modules. The processor 10 executes various functional applications and data processing by running the software programs and modules stored in the memory 20. The memory 20 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system 21, an acquisition module 22, a determination module 23, and an application 24 required for at least one function, etc.; the data storage area may store data created according to the use of the computing device, etc. The memory 20 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk or an optical disk. Accordingly, the memory 20 may further include a memory controller to provide the processor 10 with access to the memory 20 .
[0095] The processor 10 executes the following functions by running the acquisition module 22: acquiring the diffuse reflection illumination value and the specular reflection illumination value of the target object, the diffuse reflection illumination value is the illumination value of the diffuse reflection of the emitted light relative to the target object, and the specular reflection illumination value is the illumination value of the specular reflection of the emitted light relative to the target object. The processor 10 executes the following functions by running the determination module 23: determining the global illumination value of the target object according to the diffuse reflection illumination value and the specular reflection illumination value, and the global illumination value is used to render the target object.
[0096] The global illumination determination method provided by the embodiments of the present disclosure is introduced below using several exemplary embodiments.
[0097] Please refer to Figure 2 , which shows a flowchart of a method for determining global illumination provided by an exemplary embodiment of the present disclosure. In this embodiment, the method is used for Figure 1 The method is illustrated by using the computing device shown in FIG.
[0098] Step 201 , obtaining diffuse reflection illumination value and specular reflection illumination value of the target object, wherein the diffuse reflection illumination value is the illumination value of the emitted light relative to the diffuse reflection of the target object, and the specular reflection illumination value is the illumination value of the emitted light relative to the specular reflection of the target object.
[0099] Diffuse reflection refers to the phenomenon that light is scattered everywhere when projected on a rough surface, and specular reflection refers to the phenomenon that light is reflected along the reflection direction when projected on a smooth surface. According to the microsurface model, the illumination value received at a point is usually divided into a diffuse reflection component (i.e., diffuse reflection illumination value) and a specular reflection component (i.e., specular reflection illumination value) according to the BRDF item of its surface. The diffuse reflection illumination value is the illumination value of the diffuse reflection of the light emitted in the virtual scene relative to the target object, and the specular reflection illumination value is the illumination value of the specular reflection of the light emitted in the virtual scene relative to the target object.
[0100] Optionally, the virtual scene is a virtual space scene, such as an indoor virtual scene, a store virtual scene, etc. The virtual scene may have a light source and virtual objects. Different virtual objects may be set according to different virtual spaces.
[0101] Optionally, the virtual scene is a virtual scene displayed (or provided) when the application is running on the computing device. The virtual scene can be a simulation environment of the real world, a semi-simulation and semi-fictitious virtual scene, or a purely fictitious virtual scene. The virtual scene can be any of a two-dimensional virtual scene, a 2.5-dimensional virtual scene, or a three-dimensional virtual scene. For example, the virtual scene can be a game scene, a virtual reality (VR) scene, or an animation scene.
[0102] In this case, both diffuse and specular lighting values belong to indirect lighting values. Diffuse lighting values can also be called diffuse indirect lighting values, and specular lighting values can also be called specular indirect lighting values. In diffuse lighting, photons are randomly scattered in all directions after hitting a rough surface. In specular lighting, when photons hit a strong reflective surface such as a mirror, they bounce in a predictable direction. In indirect lighting, light bounces off the surface of an object once or multiple times, and multiple times means at least twice.
[0103] A virtual scene may include at least one virtual object. Each virtual object has its own shape and volume in the virtual scene and occupies a portion of the space in the virtual scene. A virtual object may be an inanimate object, including but not limited to buildings, vegetation, sky, roads, rocks or water bodies, etc. A virtual object may also be a living object, including but not limited to virtual animals or digital people.
[0104] Optionally, the target object is any virtual object in the virtual scene.
[0105] In the disclosed embodiment, the diffuse reflection processing and the specular reflection processing of indirect light are completely separated, and the calculation of diffuse reflection illumination value and the calculation of specular reflection illumination value are completely decoupled. Optionally, the global illumination calculation pipeline based on ray tracing includes a diffuse reflection indirect light calculation pipeline and a specular reflection indirect light calculation pipeline. The computing device calculates the diffuse reflection illumination value through the diffuse reflection indirect light calculation pipeline, and calculates the specular reflection illumination value through the specular reflection indirect light calculation pipeline.
[0106] It should be noted that the process in which the computing device calculates the diffuse reflection illumination value through the diffuse reflection indirect light calculation pipeline and calculates the specular reflection illumination value through the specular reflection indirect light calculation pipeline can be referred to the relevant detailed description in the following embodiments and will not be introduced here.
[0107] Step 202: determining a global illumination value of the target object according to the diffuse illumination value and the specular illumination value, and the global illumination value is used to render the target object.
[0108] Among them, the computing device can directly determine the lighting value obtained by adding the diffuse reflection lighting value and the specular reflection lighting value as the global lighting value used to render the target object. The computing device can also add the diffuse reflection lighting value and the specular reflection lighting value to obtain the indirect light lighting value of the target object, and determine the global lighting value of the target object based on the indirect light lighting value and the direct light lighting value. The present disclosure does not limit the method of determining the global lighting value used to render the target object based on the diffuse reflection lighting value and the specular reflection lighting value.
[0109] Optionally, the computing device adds the diffuse reflection illumination value and the specular reflection illumination value to obtain an indirect light illumination value of the target object; and determines a global illumination value of the target object based on the indirect light illumination value and the direct light illumination value of the target object.
[0110] The addition of the diffuse reflection illumination value and the specular reflection illumination value may be a direct addition or a weighted addition according to a preset weight value, which is not limited in the embodiments of the present disclosure.
[0111] Optionally, the global illumination value of the target object is determined based on the indirect light illumination value and the direct light illumination value of the target object, including: adding the indirect light illumination value and the direct light illumination value of the target object to obtain the global illumination value of the target object; or, adding the indirect light illumination value and the direct light illumination value of the target object and then post-processing to obtain the global illumination value of the target object.
[0112] Taking into account the limited computing resources, the calculation of direct light illumination values can follow the current mature solutions, and record the required information in the space, such as normals, base colors, texture coordinates, etc. through the delay pipeline, and calculate the direct light illumination value using the preset illumination formula based on the above recorded information.
[0113] The addition of the indirect light illumination value and the direct light illumination value of the target object may be performed directly or weighted according to a preset weight value, which is not limited in the embodiments of the present disclosure.
[0114] Illustratively, the post-processing includes at least one of Screen Space Ambient Occlusion (SSAO), Tone Mapping (Tome Mapping), and Temporal Anti-Aliasing (TAA).
[0115] Optionally, the computing device may render the target object according to the determined global illumination value. Schematically, the computing device calculates the color value of each pixel of the target object according to the global illumination value and the material information of the target object, converts the calculated color value of each pixel into a final two-dimensional graphic, and completes the rendering process.
[0116] In an illustrative example, a schematic diagram of the pipeline description is as follows Figure 3 As shown. The figure includes a conventional rasterization process and a global illumination calculation pipeline based on ray tracing provided by an embodiment of the present disclosure. The conventional rasterization process includes deferred rendering, calculation of direct light and shadow maps, and post-processing. The post-processing includes screen space ambient light shielding, tone mapping, etc., which will not be introduced here. The global illumination calculation pipeline based on ray tracing provided by an embodiment of the present disclosure includes a diffuse indirect light calculation pipeline and a specular reflection indirect light calculation pipeline, wherein the calculation process of the diffuse reflection illumination value includes: probe position generation and ray tracing, probe information update, probe state update, probe position update, storage of illumination information, and calculation of diffuse reflection illumination value. The calculation process of the specular reflection illumination value includes: specular reflection ray generation and ray tracing, secondary reflection, noise reduction, and upsampling to restore the signal. The computing device adds the diffuse reflection illumination value and the specular reflection illumination value to obtain the indirect light illumination value of the target object, adds the indirect light illumination value and the direct light illumination value of the target object, and performs post-processing to obtain the global illumination value of the target object. It should be noted that the calculation process of the diffuse reflection illumination value and the calculation process of the specular reflection illumination value can be referred to the relevant detailed description in the following embodiments, which will not be introduced here.
[0117] In summary, compared with the current global illumination calculation scheme, the global illumination determination method provided by the embodiment of the present disclosure improves the consistency between light rays and enhances the efficiency of ray tracing. At the same time, it can further solve the problems of lack of light and light leakage, and supplements the calculation of mirror reflection illumination values without significantly increasing performance overhead, while obtaining a more complete global illumination result.
[0118] In the embodiment of the present disclosure, the diffuse reflection processing and the specular reflection processing of indirect light are completely separated, that is, the calculation of diffuse reflection illumination value and the calculation of specular reflection illumination value are completely decoupled. The following describes the calculation of diffuse reflection illumination value and the calculation of specular reflection illumination value respectively. Please refer to Figure 4 , which shows a flowchart of a method for calculating diffuse reflection illumination value provided by an exemplary embodiment of the present disclosure. This embodiment uses this method for Figure 1 The method is illustrated by using the computing device shown in FIG.
[0119] Step 401: multiple rays are emitted to a virtual scene through multiple probes.
[0120] A plurality of probes are pre-set in the virtual scene where the target object is located, and the plurality of probes are used to randomly emit a plurality of emission rays to the virtual scene where the target object is located.
[0121] In the virtual scene, determine a cuboid with a range of m*n*t, so that the cuboid covers the required calculation space as much as possible, evenly place p*q*w probes in the cuboid, take the world space coordinates of the probe center as the starting point of the light, randomly generate the light direction according to the importance sampling, and emit multiple emission rays from each probe according to the randomly generated light direction. Among them, m, n, t, p, q, w are all positive integers.
[0122] Step 402, rearrange the multiple emission light rays.
[0123] Since the GPU is a device with good parallelism, if the light has high coherence (high consistency) with the light around it, the GPU can calculate this batch of light together, thereby improving the calculation efficiency. The sampling direction of the diffuse BRDF is random on the hemisphere. In order to enhance the consistency of light and reduce the cache miss rate, multiple emission rays are reordered according to the direction of the light. The coherence between the rearranged multiple emission rays is high (for example, higher than the preset coherence threshold), so that the GPU can subsequently calculate the rearranged multiple emission rays together to improve the efficiency of ray tracing.
[0124] Optionally, the preset coherence threshold is a default setting or a custom setting, which is not limited in the embodiments of the present disclosure.
[0125] Different from the solutions of related technologies, the Fibonacci spiral sampling algorithm is used to uniformly emit light onto the spherical surface in the light direction. At the same time, because this is a set of pseudo-random sequences, a random rotation matrix needs to be generated for each frame to disrupt the light. The embodiment of the present disclosure reorders multiple emitted light rays according to the directions of the light rays, so that the coherence between the rearranged multiple emitted light rays is higher, so that the GPU can calculate this batch of light rays together, thereby improving the calculation efficiency.
[0126] Step 403, tracing the multiple emitted light rays to obtain the diffuse reflection illumination value of the target object.
[0127] Optionally, multiple emitted light rays are traced in a virtual scene to obtain the irradiance received by the surface of the target object; and the diffuse reflection illumination value of the target object is determined according to the irradiance received by the surface of the target object. The diffuse reflection illumination value is independent of the observation direction.
[0128] Furthermore, the diffuse reflection illumination value of the target object is determined based on the irradiance received by the surface of the target object, including: performing ray tracing on the multiple emission light rays emitted by the multiple probes to obtain diffuse reflection illumination information of the virtual scene, wherein the diffuse reflection illumination information is used to indicate the irradiance received by the surface of the target object; storing the diffuse reflection illumination information of the virtual scene in a texture map; and acquiring the irradiance received by the surface of the target object by sampling the texture map.
[0129] Optionally, multiple emitted light rays are traced in the virtual scene to determine the light path formed by the emitted light rays in the spatial scene starting from the object. The light path refers to the light path composed of light rays, which can be formed in the process of light rays propagating in the spatial scene. The light path can be related to the object hit by the light. For example, when the light hits an object, it can be propagated by reflection or refraction according to the material information of the object, thereby forming a light path.
[0130] Optionally, the computing device stores the diffuse reflection lighting information and geometric information of the virtual scene in at least one probe pre-set in the virtual scene. Schematically, the diffuse reflection lighting information and geometric information of the virtual scene are stored in a texture map of the probe.
[0131] Optionally, select the Lambert model for the diffuse BRDF term and convert the diffuse integral term f d The term is proposed as an integral, that is, the diffuse illumination value L d (w o ) can be calculated by the following formula:
[0132]
[0133] Where π represents the reflectivity, which can be a constant, ∫L(w i )*cosθdw i The integral term is represented by the irradiance received by the surface of the target object. The calculated diffuse illumination value is independent of the viewing direction. The irradiance in the virtual scene has been stored in the texture map through the above pipeline. The irradiance received by the surface of the target object can be obtained by sampling the texture map. The diffuse illumination value can be calculated using the above formula.
[0134] Step 404: Update the probe information, probe status, and probe location.
[0135] Probe information is the lighting information in the virtual scene collected by the probe. Probe information includes the irradiance and distance of multiple points in the virtual scene. Probe information is the first result to be obtained in subsequent calculations. In other words, the probe is a typical representative of the discretization of continuous space. Probe information collects the lighting information (irradiance and distance) in the space where the probe is located. Ultimately, this part of the lighting information is used to calculate the diffuse reflection lighting value of any point in the virtual scene. The probe state includes the activated state and the inactivated state. Only the probe in the activated state will participate in the calculation.
[0136] Optionally, the probability and distance of frontal hits and backside hits are counted, and the threshold of the minimum hit distance is artificially designed. By counting this information, the probe that needs to be fine-tuned is selected, and it is moved in the opposite direction to a certain minimum value to achieve the purpose of fine-tuning. In the embodiment of the present disclosure, the strategy of backside hit selection can be simplified, and its own influence can be considered at the same time. Each probe movement is also limited by the position offset of its previous frame in the time domain, which prevents it from moving indefinitely. That is, the position offset of the probe provided in the embodiment of the present disclosure is determined according to the target information of the probe, that is, for at least one probe among the multiple probes, the position offset of the probe is determined according to the target information of the probe, and the position of the probe is updated according to the position offset of the probe. Among them, the target information includes at least one of the light direction of the emitted light, the flag bit, the offset of the previous frame, the distance and the probe offset length.
[0137] Optionally, the position offset of the probe is calculated by the following formula: Position offset of the probe - = light direction * (flag * previous frame offset – distance) * 0.1 * probe offset length. The light can be physically simulated as a ray model, which includes two elements, namely the origin and the ray direction. The origin represents the starting point of the light, and the ray direction represents the direction of the light (illumination).
[0138] The flag is used to indicate whether the target object is hit by the back side of the emitted light. The target object has a front and back side. The intersection of the light and the target object is called a hit. In principle, the target object cannot be illuminated when the light intersects the back side of the target object. This situation is called the target object being hit by the back side of the emitted light.
[0139] Optionally, the flag bit is determined in the ray tracing stage. Schematically, when the flag bit is a first value, it is used to indicate that the target object is hit by the back side of the emitted light, and when the flag bit is a second value, it is used to indicate that the target object is not hit by the back side of the emitted light. For example, the first value is -1, and the second value is 1. This is not limited in the embodiments of the present disclosure.
[0140] The previous frame offset is the position offset of the probe in the previous frame in the time domain.
[0141] The distance is the distance between the probe and the target object.
[0142] The probe offset length is a global variable, and the probe offset length is a variable that is decremented by a preset value each time it is updated. For example, the preset value is 0.01.
[0143] At the same time, in order to ensure that the calculated offset does not affect the spatial information collection of the probe, we will also clamp the calculated probe offset result, that is, the probe position offset has an upper limit value, which is determined by the probe spacing. The probe spacing is a preset value or the distance between the probe and the closest probe. For example, the upper limit value of the probe position offset is 0.5 times the probe spacing.
[0144] It should be noted that the calculation of specular reflection illumination value is different from that of diffuse reflection illumination value. The specular reflection part is a high-frequency signal. The calculation of incident light depends on the viewing direction. Only indirect light sources near the incident direction contribute. The previous method cannot directly solve the calculation of specular reflection. Therefore, for the calculation of specular reflection illumination value, the present disclosure embodiment designs a complete ray tracing pipeline. Please refer to Figure 5 , which shows a flow chart of a method for calculating the specular reflection illumination value provided by an exemplary embodiment of the present disclosure. This embodiment uses this method for Figure 1 The method is illustrated by using the computing device shown in FIG.
[0145] Step 501, emitting multiple rays to a virtual scene through multiple pixels in the screen.
[0146] Since diffuse reflection component and specular reflection component are separated in this solution, and ray tracing is performed in both pipelines, considering the real-time performance requirements, if specular ray tracing still emits light at full screen resolution, the calculation amount is high and the performance overhead is large. Therefore, in order to reduce the number of rays, the embodiment of the present disclosure performs downsampling processing on the geometry buffer (English: Geometry Buffer) in the initial stage of the pipeline. The geometry buffer is a structure used to store data required for illumination in rendering, and the geometric information of the emitted light is generated. The geometry buffer is a structure used to store data required for illumination in rendering. The geometric information of the emitted light includes the origin and direction of the emitted light; according to the geometric information of the emitted light, multiple emitted rays are emitted. The advantage of doing so is that the performance will be improved by 2 times in theory. Among them, the downsampling processing includes resolution reduction and sampling. The downsampling processing is used to indicate that multiple emitted rays are sampled at a preset resolution. The preset resolution is a non-full screen resolution. The number of rays obtained by the downsampling processing is less than the number of rays at the full screen resolution. For example, the preset resolution is 1 / 4 of the screen resolution, that is, a screen resolution that is 1 / 2 wide and 1 / 2 high. Optionally, the light direction of the emitted light is obtained according to the importance sampling of the BRDF item of the specular reflection. That is, the light direction is obtained by importance sampling of the BRDF item of the specular reflection, and the sampling function of the BRDF item of the specular reflection can have multiple distributions. In current specular reflection tracking, the reflection direction is usually distributed according to the specular highlight BRDF or the highlight GGX distribution, but such a distribution cannot handle some light with very low incident angles very well, and the angle between the sampled normal and the light direction is greater than 90 degrees, which causes a waste of samples. The embodiment of the present disclosure can sample the emitted light according to VNDF, that is, the sampling function is VNDF (VNDF is a mathematical probability function), which reduces the number of invalid samples.
[0147] Step 502, ray tracing is performed on the multiple emitted light rays to obtain a first-level reflection result.
[0148] The computing device performs VNDF-based ray tracing on multiple emitted light rays in the virtual scene to obtain a first-level reflection result, where the first-level reflection result is the reflection result calculated when the emitted light rays directly hit the target object without being bounced.
[0149] Step 503: Determine the secondary reflection result according to the stored irradiance received by the surface of the target object.
[0150] Optionally, the computing device reuses the diffuse reflection lighting information of the virtual scene stored in the diffuse reflection calculation process, and the diffuse reflection lighting information includes the irradiance received by the surface of the target object. The computing device calculates the secondary reflection result in the virtual scene based on the irradiance. The secondary reflection result is the reflection result calculated when the emitted light hits the target object after bouncing off the surrounding objects, and is used to supplement the lost effect caused by the primary reflection result of the emitted light.
[0151] In actual calculations, it is very difficult to simulate multiple ejections in real physics and the amount of calculation is very high. Therefore, the probe used in the above diffuse reflection calculation is reused. The probe collects the irradiance map in the virtual scene. Each point on the map is used to indicate the irradiance of the point. The points on the sampling map are used to simulate multiple ejections in real space to calculate the secondary reflection result. The final specular reflection result includes the primary reflection result and the secondary reflection result.
[0152] Step 504, denoising the primary reflection result and the secondary reflection result to obtain a denoised specular reflection result.
[0153] The computing device performs noise reduction on the specular reflection result (i.e., the primary reflection result and the secondary reflection result) through a noise reducer to obtain a noise-reduced specular reflection result. The noise reducer may be a noise reducer based on spatiotemporal filtering, and the noise reducer is used to eliminate noise and restore the signal through spatiotemporal filtering.
[0154] Since multiple emission rays are sampled at 1 / 4SPP, the specular reflection result will be full of noise, so a denoiser is used to denoise the specular reflection result. Optionally, the specular reflection result includes specular reflection illumination information and material information of the target object. Since the filter may cause blurring of the material, the specular reflection illumination information and the material information of the target object in the specular reflection result can be separated before being sent to the filter. In other words, only the specular reflection illumination information of the specular reflection result is sent to the filter, and after filtering, the denoised specular reflection illumination information is multiplied by the material information again, and finally restored to the original resolution (i.e., the resolution before downsampling) through bilinear interpolation. Optionally, denoising the specular reflection result includes: denoising the specular reflection illumination information in the specular reflection result.
[0155] Step 505 , up-sampling the denoised specular reflection result to obtain the specular reflection illumination value of the target object.
[0156] Since the specular reflection result is obtained after downsampling, that is, the calculated specular reflection result is completed on a small-resolution image, the final result needs to be restored to the target resolution, so the signal needs to be restored, that is, the denoised specular reflection result is upsampled.
[0157] Optionally, the denoised specular reflection result is upsampled to obtain the specular reflection illumination value of the target object, including: multiplying the denoised specular reflection illumination information with the material information of the target object to obtain the corrected specular reflection illumination information; upsampling the corrected specular reflection illumination information to obtain the specular reflection illumination value of the target object, the upsampling being used to indicate that the screen resolution corresponding to the specular reflection illumination information is restored to the original resolution through bilinear interpolation.
[0158] In summary, the disclosed embodiment calculates the complete global illumination with fewer resources, by optimizing the current dynamic global illumination calculation scheme, and combining it with ray tracing in space to calculate the complete global illumination value on the light path. On the one hand, the calculation of the diffuse illumination value is obtained by calculating the probe-based global illumination scheme, which simplifies the discrete light in the space to place probes at several points in the space, and uses the point as the starting point to emit several rays through importance sampling. The coherence between the rays is increased by rearranging the rays, and the efficiency of ray tracing is improved. The simplified probe offset calculation strategy is used to reduce the amount of calculation in the process without affecting the effect; on the other hand, the specular reflection illumination value is calculated by superimposing the specular reflection indirect light calculation pipeline, which makes up for the limitation that only the diffuse reflection illumination value can be calculated in the related technology, and a more complete global illumination value is obtained, and the calculation overhead added by the superimposed specular reflection indirect light calculation pipeline is not large.
[0159] The following is an apparatus embodiment of the present disclosure. For parts not described in detail in the apparatus embodiment, reference may be made to the technical details disclosed in the above method embodiment.
[0160] Please refer to Figure 6 , which shows a schematic diagram of the structure of a global illumination determination device provided by an exemplary embodiment of the present disclosure. The device can be implemented as all or part of a computing device through software, hardware, or a combination of both. The device includes: an acquisition module 22 and a determination module 23.
[0161] An acquisition module 22 is used to acquire a diffuse reflection illumination value and a specular reflection illumination value of a target object, wherein the diffuse reflection illumination value is an illumination value of a diffuse reflection of an emitted light relative to the target object, and the specular reflection illumination value is an illumination value of a specular reflection of an emitted light relative to the target object;
[0162] The determination module 23 is used to determine the global illumination value of the target object according to the diffuse reflection illumination value and the specular reflection illumination value, and the global illumination value is used to render the target object.
[0163] In a possible implementation, a plurality of probes are pre-set in the virtual scene where the target object is located, and the plurality of probes are used to emit a plurality of emission lights to the virtual scene. The acquisition module 22 is further used to:
[0164] Perform ray tracing on multiple emitted rays to obtain the irradiance received by the surface of the target object;
[0165] The diffuse illumination value of the target object is determined based on the irradiance received by the surface of the target object.
[0166] In another possible implementation, the acquisition module 22 is further configured to:
[0167] Performing ray tracing on multiple emission rays emitted by multiple probes to obtain diffuse reflection illumination information of the virtual scene, where the diffuse reflection illumination information is used to indicate the irradiance received by the surface of the target object;
[0168] The diffuse lighting information of the virtual scene is stored in the texture map;
[0169] The irradiance received by the target object surface is obtained by sampling the texture map.
[0170] In another possible implementation, the device further includes: an updating module, the updating module being configured to:
[0171] For at least one probe among the multiple probes, determining a position offset of the probe according to target information of the probe, the target information including at least one of a light direction of the emitted light, a flag, a previous frame offset, a distance, and a probe offset length;
[0172] Update the position of the probe according to the position offset of the probe;
[0173] Among them, the flag is used to indicate whether the target object is hit by the back of the emitted light, the previous frame offset is the position offset of the probe in the previous frame in the time domain, the distance is the distance between the probe and the target object, and the probe offset length is a variable that decreases according to the preset value each time it is updated.
[0174] In another possible implementation, the position offset of the probe has an upper limit value, and the upper limit value is determined according to the probe distance, where the probe distance is a preset value or a distance between the probe and another probe closest to the probe.
[0175] In another possible implementation, the apparatus further includes: a rearrangement module, the rearrangement module being configured to:
[0176] The plurality of emission light rays are rearranged, and the coherence between the plurality of emission light rays after the rearrangement is higher than a preset coherence threshold.
[0177] In another possible implementation, a plurality of pixels in the screen are used to emit a plurality of emission rays to the virtual scene, and the acquisition module 22 is further used to:
[0178] Ray tracing is performed on multiple emitted rays to obtain the specular reflection result of the target object;
[0179] According to the specular reflection result, the specular reflection illumination value of the target object is determined.
[0180] In another possible implementation, the specular reflection result includes a primary reflection result and a secondary reflection result, and the acquisition module 22 is further used to:
[0181] Perform ray tracing on multiple emitted rays to obtain a first-order reflection result, which is the reflection result calculated when the emitted rays directly hit the target object without being bounced;
[0182] The secondary reflection result is determined according to the stored irradiance received by the surface of the target object. The secondary reflection result is the reflection result calculated when the emitted light hits the target object after being bounced off surrounding objects.
[0183] In another possible implementation, the plurality of emitted rays are sampled at a preset resolution, where the preset resolution is a non-full-screen resolution.
[0184] In another possible implementation, the sampled function is VNDF.
[0185] In another possible implementation, the acquisition module 22 is further configured to:
[0186] De-noise the specular reflection result;
[0187] According to the specular reflection result after denoising, the specular reflection illumination value of the target object is obtained.
[0188] In another possible implementation, the determining module 23 is further configured to:
[0189] Add the diffuse reflection lighting value and the specular reflection lighting value to get the indirect light lighting value of the target object;
[0190] Determine the global illumination value of the target object based on the indirect light illumination value and the direct light illumination value of the target object.
[0191] It should be noted that the device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example to implement its functions. In practical applications, the above-mentioned functions can be assigned to different functional modules according to actual needs, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0192] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0193] The embodiments of the present disclosure further provide a computing device, which includes: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to: implement the steps executed by the computing device in the above-mentioned various method embodiments.
[0194] The embodiments of the present disclosure further provide a non-volatile computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the methods executed by the computing device in the above-mentioned various method embodiments are implemented.
[0195] Figure 7 700 is a block diagram of an apparatus 700 according to an exemplary embodiment. For example, the apparatus 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0196] Reference Figure 7 , the device 700 may include one or more of the following components: a processing component 702 , a memory 704 , a power component 706 , a multimedia component 708 , an audio component 710 , an input / output (I / O) interface 712 , a sensor component 714 , and a communication component 716 .
[0197] The processing component 702 generally controls the overall operation of the device 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 702 may include one or more modules to facilitate the interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate the interaction between the multimedia component 708 and the processing component 702.
[0198] The memory 704 is configured to store various types of data to support operations on the device 700. Examples of such data include instructions for any application or method operating on the device 700, contact data, phone book data, messages, pictures, videos, etc. The memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0199] The power supply component 706 provides power to the various components of the device 700. The power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 700.
[0200] The multimedia component 708 includes a screen that provides an output interface between the device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front camera and / or a rear camera. When the device 700 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0201] The audio component 710 is configured to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC), and when the device 700 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 704 or sent via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting audio signals.
[0202] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0203] The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the device 700. For example, the sensor assembly 714 can detect the open / closed state of the device 700, the relative positioning of components, such as the display and keypad of the device 700, the sensor assembly 714 can also detect the position change of the device 700 or a component of the device 700, the presence or absence of user contact with the device 700, the orientation or acceleration / deceleration of the device 700, and the temperature change of the device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0204] The communication component 716 is configured to facilitate wired or wireless communication between the device 700 and other devices. The device 700 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0205] In an exemplary embodiment, the apparatus 700 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above methods.
[0206] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 704 including computer program instructions, which can be executed by a processor 720 of the apparatus 700 to perform the above method.
[0207] Figure 8 800 is a block diagram of an apparatus 800 according to another exemplary embodiment. For example, the apparatus 800 may be provided as a server. Figure 8, the apparatus 800 includes a processing component 822, which further includes one or more processors, and a memory resource represented by a memory 832 for storing instructions, such as an application, that can be executed by the processing component 822. The application stored in the memory 832 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 822 is configured to execute the instructions to perform the above method.
[0208] The device 800 may also include a power supply component 826 configured to perform power management of the device 800, a wired or wireless network interface 850 configured to connect the device 800 to a network, and an input / output (I / O) interface 858. The device 800 may operate based on an operating system stored in the memory 832, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, or the like.
[0209] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 832 including computer program instructions that can be executed by the processing component 822 of the device 800 to perform the above method.
[0210] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0211] 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.
[0212] 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.
[0213] 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 completely 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 personalized 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.
[0214] 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.
[0215] These computer-readable program instructions can be provided to a processor 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 processor 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.
[0216] 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.
[0217] 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 the 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 reverse 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.
[0218] 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 variations 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 technical 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 method for determining global illumination, characterized in that: The method comprises: Acquire a diffuse reflection illumination value and a specular reflection illumination value of a target object, wherein the diffuse reflection illumination value is an illumination value of a emitted light relative to a diffuse reflection of the target object, and the specular reflection illumination value is an illumination value of a emitted light relative to a specular reflection of the target object; Determining a global illumination value of the target object according to the diffuse reflection illumination value and the specular reflection illumination value, wherein the global illumination value is used to render the target object; A plurality of probes are pre-set in the virtual scene where the target object is located. The plurality of probes are used to emit a plurality of emission rays to the virtual scene. The positions of the probes are dynamically updated. The step of obtaining the diffuse reflection illumination value of the target object includes: Performing ray tracing on the plurality of emitted light rays to obtain the irradiance received by the surface of the target object; Determining the diffuse reflection illumination value of the target object according to the irradiance received by the surface of the target object; The position of the probe is updated according to the position offset of the previous frame of the probe in the time domain. The position offset of the probe has an upper limit value, which is determined according to the probe spacing. The probe spacing is a preset value or the distance between the probe and another probe closest to the probe.
2. The method according to claim 1, characterized in that The step of performing ray tracing on the plurality of emission rays emitted by the plurality of probes to obtain the irradiance received by the surface of the target object includes: Performing ray tracing on the multiple emission rays emitted by the multiple probes to obtain diffuse reflection illumination information of the virtual scene, wherein the diffuse reflection illumination information is used to indicate the irradiance received by the surface of the target object; storing diffuse lighting information of the virtual scene in a texture map; The irradiance received by the surface of the target object is obtained by sampling the texture map.
3. The method according to claim 1, characterized in that The method further comprises: For at least one probe among the plurality of probes, determining a position offset of the probe according to target information of the probe, wherein the target information includes a light direction of the emitted light, a flag, a previous frame offset, a distance, and a probe offset length; Updating the position of the probe according to the position offset of the probe; Among them, the flag is used to indicate whether the target object is hit by the back of the emitted light, the previous frame offset is the position offset of the probe in the previous frame in the time domain, the distance is the distance between the probe and the target object, and the probe offset length is a variable that decreases according to a preset value each time it is updated.
4. The method according to claim 1, characterized in that: Before performing ray tracing on the multiple emission rays emitted by the multiple probes, the method further includes: The plurality of emission light rays are rearranged, and the coherence between the plurality of emission light rays after the rearrangement is higher than a preset coherence threshold.
5. The method according to claim 1, characterized in that: A plurality of pixels in the screen are used to emit a plurality of emission rays to the virtual scene, and obtaining the specular reflection illumination value of the target object includes: Performing ray tracing on the multiple emitted light rays to obtain a mirror reflection result of the target object; The specular reflection illumination value of the target object is determined according to the specular reflection result.
6. The method according to claim 5, characterized in that The specular reflection result includes a primary reflection result and a secondary reflection result, and the performing of ray tracing on the plurality of emitted light rays to obtain the specular reflection result of the target object includes: Performing ray tracing on the plurality of emitted light rays to obtain the primary reflection result, wherein the primary reflection result is a reflection result calculated when the emitted light rays directly hit the target object without being ricocheted; The secondary reflection result is determined according to the stored irradiance received by the surface of the target object, and the secondary reflection result is the reflection result calculated when the emitted light hits the target object after being bounced off surrounding objects.
7. The method according to claim 5, characterized in that The plurality of emitted light rays are sampled at a preset resolution, where the preset resolution is a non-full-screen resolution.
8. The method according to claim 7, characterized in that The sampled function is the visible normal distribution function VNDF.
9. The method according to claim 5, characterized in that Determining the specular reflection illumination value of the target object according to the specular reflection result includes: De-noising the specular reflection result; The specular reflection illumination value of the target object is obtained according to the specular reflection result after denoising.
10. The method according to any one of claims 1 to 9, characterized in that: Determining the global illumination value of the target object according to the diffuse reflection illumination value and the specular reflection illumination value includes: Adding the diffuse reflection illumination value and the specular reflection illumination value to obtain an indirect light illumination value of the target object; Determine the global illumination value of the target object according to the indirect light illumination value and the direct light illumination value of the target object.
11. A device for determining global illumination, characterized in that: The device comprises: An acquisition module, used to acquire a diffuse reflection illumination value and a specular reflection illumination value of a target object, wherein the diffuse reflection illumination value is an illumination value of a emitted light relative to a diffuse reflection of the target object, and the specular reflection illumination value is an illumination value of a emitted light relative to a specular reflection of the target object; A determination module, used to determine a global illumination value of the target object according to the diffuse reflection illumination value and the specular reflection illumination value, wherein the global illumination value is used to render the target object; A plurality of probes are pre-set in the virtual scene where the target object is located. The plurality of probes are used to emit a plurality of emission rays to the virtual scene. The positions of the probes are dynamically updated. The acquisition module is further used to: Performing ray tracing on the plurality of emitted light rays to obtain the irradiance received by the surface of the target object; Determining the diffuse reflection illumination value of the target object according to the irradiance received by the surface of the target object; The position of the probe is updated according to the position offset of the previous frame of the probe in the time domain. The position offset of the probe has an upper limit value, which is determined according to the probe spacing. The probe spacing is a preset value or the distance between the probe and another probe closest to the probe.
12. A computing device, characterized in that: The computing device comprises: a processor; a memory for storing instructions executable by the processor; Wherein, the processor is configured to: Acquire a diffuse reflection illumination value and a specular reflection illumination value of a target object, wherein the diffuse reflection illumination value is an illumination value of a emitted light relative to a diffuse reflection of the target object, and the specular reflection illumination value is an illumination value of a emitted light relative to a specular reflection of the target object; Determining a global illumination value of the target object according to the diffuse reflection illumination value and the specular reflection illumination value, wherein the global illumination value is used to render the target object; A plurality of probes are pre-set in the virtual scene where the target object is located. The plurality of probes are used to emit a plurality of emission rays to the virtual scene. The positions of the probes are dynamically updated. The step of obtaining the diffuse reflection illumination value of the target object includes: Performing ray tracing on the plurality of emitted light rays to obtain the irradiance received by the surface of the target object; Determining the diffuse reflection illumination value of the target object according to the irradiance received by the surface of the target object; The position of the probe is updated according to the position offset of the previous frame of the probe in the time domain. The position offset of the probe has an upper limit value, which is determined according to the probe spacing. The probe spacing is a preset value or the distance between the probe and another probe closest to the probe.
13. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 10 is implemented.
