Ray tracing computational methods, devices, storage media, and terminals
By collaborating between the terminal and the server to calculate ray tracing data using region images and reference lighting data, the problem of resource waste caused by independent calculations by multiple terminals is solved, thus improving the efficiency of ray tracing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2022-08-30
- Publication Date
- 2026-07-17
AI Technical Summary
When multiple terminals perform ray tracing in the same scene, their independent computation processes lead to a waste of resources and time, increasing the processor burden on the terminals.
By acquiring a regional image from the terminal's perspective, sending it to the server to determine reusable feature points, and obtaining reference lighting data, ray tracing data is calculated based on this data, enabling collaboration between terminals.
It saves computational resources and time in the ray tracing process and optimizes the ray tracing performance of terminals with different viewpoints in the same scene.
Smart Images

Figure CN115409934B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer graphics technology, and in particular to a ray tracing calculation method, apparatus, storage medium, and terminal. Background Technology
[0002] Ray tracing is an algorithm that simulates the propagation of light in the real world to achieve realistic rendering. During ray tracing, by tracking the light rays that interact with objects, and based on the material properties of various objects in the scene, the paths of reflection and scattering from the object surfaces are obtained, simulating a realistic virtual scene. Because the number of light rays emitted by a light source can be considered infinite, while the number of light rays entering the human eye is finite, using a forward ray tracing algorithm—that is, tracing the interaction between light rays and scene objects starting from the light source—incurs an extremely high computational load. Typically, a backward ray tracing algorithm is used, that is, tracing the interaction between light rays and scene objects from the perspective of the human eye, which significantly reduces the computational load. Summary of the Invention
[0003] This application provides a ray tracing calculation method, apparatus, computer storage medium, and terminal. For terminals with different viewpoints in the same scene, it can save computational resources and time during the ray tracing process, thereby optimizing the terminal's ray tracing performance. The technical solution is as follows:
[0004] In a first aspect, embodiments of this application provide a ray tracing calculation method applied to a terminal, the method comprising:
[0005] In the target scene, a region image is obtained from the viewpoint corresponding to the terminal, and the region image is sent to the server. The region image is used by the server to determine the reusable feature points in the target scene.
[0006] Obtain reference lighting data of the multiplexed feature points under the viewpoint, and determine ray tracing data of the multiplexed feature points under the viewpoint based on the reference lighting data.
[0007] Secondly, embodiments of this application provide a ray tracing computing device applied to a terminal, the device comprising:
[0008] The first calculation module is used to acquire a region image from the viewpoint corresponding to the terminal in the target scene, and send the region image to the server. The region image is used by the server to determine the reusable feature points in the target scene.
[0009] The second calculation module is used to acquire reference lighting data of the multiplexed feature points under the viewpoint, and determine ray tracing data of the multiplexed feature points under the viewpoint based on the reference lighting data.
[0010] Thirdly, embodiments of this application provide a computer storage medium having multiple instructions adapted for loading by a processor and executing the above-described method steps.
[0011] Fourthly, embodiments of this application provide a terminal that may include: a memory and a processor; wherein the memory stores a computer program adapted to be loaded by the memory and to execute the above-described method steps.
[0012] The beneficial effects of the technical solutions provided in this application include at least the following:
[0013] In this embodiment, firstly, the terminal acquires a region image from its corresponding viewpoint in the target scene. Then, the terminal sends the region image to the server, whereby the server uses the region image to determine reused feature points in the target scene. Next, the terminal acquires reference lighting data for the reused feature points from the viewpoint. Finally, the terminal determines ray tracing data for the reused feature points from the viewpoint based on the reference lighting data. In this embodiment, terminals located at different viewpoints within the same scene, i.e., terminals with different viewing angles within the same scene, can send region images from their respective viewpoints to the server. The server determines reused feature points in the target scene, and each terminal can acquire reference lighting data for the reused feature points from its respective viewpoint. Furthermore, each terminal can determine ray tracing data for the reused feature points from its respective viewpoint based on the reference lighting data. Therefore, in this embodiment, terminals with different viewpoints within the same scene can collaborate during ray tracing, saving computational resources and time, and thus optimizing the performance of ray tracing for terminals with different viewpoints within the same scene. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 This is a schematic diagram of the system architecture of a ray tracing calculation method provided in an embodiment of this application;
[0016] Figure 2 This is a schematic flowchart of a ray tracing calculation method provided in an embodiment of this application;
[0017] Figure 3 This is a flowchart illustrating another ray tracing calculation method provided in an embodiment of this application;
[0018] Figure 4 This is a flowchart illustrating another ray tracing calculation method provided in an embodiment of this application;
[0019] Figure 5 This is a flowchart illustrating another ray tracing calculation method provided in an embodiment of this application;
[0020] Figure 6 This is a flowchart illustrating another ray tracing calculation method provided in an embodiment of this application;
[0021] Figure 7 This is a schematic diagram of the structure of a ray tracing computing device provided in an embodiment of this application;
[0022] Figure 8 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application. Detailed Implementation
[0023] To make the inventive objectives, features, and advantages of the embodiments of this application more apparent and understandable, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] In the description of this application, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. In the description of this application, it should be noted that, unless otherwise expressly specified and limited, "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances. Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist; for example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.
[0025] In recent years, with the continuous development of graphics processing units (GPUs), the computation of ray tracing using GPUs has become increasingly widespread. This means that everything from ray generation and accelerated structure traversal to final shading is performed on the GPU, significantly increasing its workload. Therefore, ray tracing places high demands on the processor performance of the terminal. In related technologies, when multiple terminals perform ray tracing simultaneously in the same scene, the ray tracing computation process for each terminal is often independent, and the results are naturally also independent. Since ray tracing computation itself requires significant resources and time, performing ray tracing computation separately on each terminal is even more resource- and time-consuming.
[0026] The present application will now be described in detail with reference to specific embodiments.
[0027] Please see Figure 1 This is a system architecture diagram of a ray tracing calculation method provided in an embodiment of this application.
[0028] like Figure 1 As shown in the system architecture diagram in this application embodiment, it may include a server and multiple terminals. Both the server and terminals may be equipped with a WebGPU ray tracing algorithm based on a browser-based graphics application interface. The server and terminals may be electronic devices running Android, Apple operating systems, Windows systems, Linux systems, etc.
[0029] It should be understood that a server can be an electronic device with digital resource access capabilities, or it can be a standalone server device, such as a rack-mounted, blade, tower, or cabinet-type server device, or a workstation, mainframe, or other hardware device with strong computing power. Alternatively, it can be a server cluster composed of multiple servers. The servers in the service cluster can be composed in a symmetrical manner, where each server is functionally and functionally equivalent in the business chain, and each server can provide services to the outside world independently. Providing services to the outside world independently can be understood as not requiring the assistance of other servers.
[0030] The terminal and the server communicate and interact via a network, which can be a wireless network or a wired network. Wireless networks include, but are not limited to, cellular networks, wireless LANs, infrared networks, or Bluetooth networks, while wired networks include, but are not limited to, Ethernet, universal serial bus (USB), or controller area networks.
[0031] In some embodiments, technologies and / or formats, including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc., can be used to represent data exchanged over the network (such as target compressed packets). Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), and Internet Protocol Security (IPsec) can be used to encrypt all or some of the links. In other embodiments, custom and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.
[0032] In this embodiment, firstly, the terminal acquires a region image from its corresponding viewpoint in the target scene. Then, the terminal sends the region image to a server, where the server uses the region image to determine reused feature points in the target scene. Next, the terminal acquires reference lighting data for the reused feature points from its viewpoint. Finally, the terminal determines ray tracing data for the reused feature points from its viewpoint based on the reference lighting data. In this embodiment, terminals located at different viewpoints within the same scene (i.e., terminals with different viewing angles within the same scene) can send region images from their respective viewpoints to the server. The server determines reused feature points in the target scene, and each terminal can acquire reference lighting data for the reused feature points from its corresponding viewpoint. Furthermore, each terminal can determine ray tracing data for the reused feature points from its corresponding viewpoint based on the reference lighting data. Therefore, in this embodiment, terminals with different viewpoints within the same scene can collaborate during ray tracing, saving computational resources and time, and thus optimizing the performance of ray tracing for terminals with different viewpoints within the same scene.
[0033] In the following method embodiments, for ease of explanation, only the execution subject of each step is used as the terminal for description.
[0034] Please see Figure 2 This is a schematic flowchart illustrating a ray tracing calculation method provided in an embodiment of this application. Figure 2 As shown, the method described in this application embodiment may include the following steps:
[0035] S201, acquire a region image from the viewpoint corresponding to the terminal in the target scene, and send the region image to the server. The region image is used by the server to determine reusable feature points in the target scene.
[0036] It is easy to understand that the target scene can be a virtual scene or a real scene.
[0037] Viewpoint refers to the perspective from which the terminal observes the target scene. The user can be considered a viewpoint within the scene, and the user's terminal can also be understood as a viewpoint located at a certain perspective within the target scene.
[0038] A region image is an image composed of the content that a terminal can observe from its corresponding viewpoint.
[0039] Reusable feature points can be viewed as unit planes divided by the surface of an object. These unit planes can be common areas on ray tracing paths; that is, when ray tracing is performed by terminals at different viewpoints in the target scene, the rays will all be traced through this unit plane. Within the same target scene, there can be one or more unit planes serving as common areas, i.e., one or more reusable feature points. Reusable feature points can be reusable feature points possessed by any two or more terminals in the target scene. Ray tracing can be understood as tracing light rays emitted from the eye. The ray tracing process can be understood as emitting rays from the viewpoint to pixels on the imaging plane, finding the intersection point of the nearest object intersecting with the ray, and if the surface at that point is a scattering surface, calculating the energy generated by the light source directly illuminating that point; if the surface at that point is a specular or refracting surface, continuing to trace another ray in the direction of reflection or refraction, and so on recursively until the ray escapes the scene or reaches the set maximum recursion depth.
[0040] It should be noted that the method of this application embodiment can be applied to a terminal with any viewpoint in the target scene. A terminal with any viewpoint can acquire regional images under its corresponding viewpoint and send the regional images to the server. The regional images can be used by the server to determine reusable feature points in the target scene.
[0041] In some embodiments, for a target scene, multiple terminals can be simultaneously present in that scene within a certain time period. Each terminal represents a viewpoint within that scene, thus each terminal corresponds to a viewing angle, and the brightness of objects observed by each terminal may differ from different viewing angles. Each terminal can acquire regional images corresponding to different viewing angles at the same frame time. Furthermore, each terminal can send the regional images corresponding to each frame time to the server. The server can find reused feature points based on the acquired regional images corresponding to different terminals at the same frame time. Furthermore, the server can inform the terminals corresponding to each regional image of the reused feature points. The server can use a feature point method to find reused feature points in the target scene, that is, it can select the same representative points from each image, which remain unchanged when the viewing angle changes slightly. Feature points are special locations in an image, generally categorized as corner points, edges, and blocks. Feature points consist of keypoints and descriptors. Keypoints are the positions of feature points in the image; some feature points also have information such as orientation and size. Descriptors describe the information of the pixels surrounding the keypoint. If the descriptors of two feature points are very close in vector space, they can be considered to be the same feature point.
[0042] S202, acquire reference lighting data of the multiplexed feature points under the viewpoint, and determine ray tracing data of the multiplexed feature points under the viewpoint based on the reference lighting data.
[0043] It's easy to understand that reference lighting data can include one or both of lightmap data and bidirectional reflectance distribution function data. Lightmap data refers to the energy of the incident light that a point (i.e., a microfacet) can obtain when receiving direct illumination from a light source. The bidirectional reflectance distribution function (BRDF) is defined as the ratio of the radiance (luminance) of the reflected light at a point (i.e., a microfacet) to the energy (irradiance) of the incident light. For a given point, the ratio of the radiance reflected in different directions to the irradiance of the incident light is fixed; that is, the BRDF value for a point is constant in each direction.
[0044] In some embodiments, obtaining the reference lighting data of the multiplexed feature points under the viewpoint can be understood as obtaining first lighting data from the server and using the first lighting data as the reference lighting data of the multiplexed feature points under the viewpoint. The first lighting data is calculated by the terminal corresponding to the first viewpoint and uploaded to the server when the terminal has not calculated the reference lighting data under the viewpoint. The first lighting data may include one or both of first lighting map data and first bidirectional reflectance distribution function data. The meaning of the first lighting map data is the same as that of the aforementioned lighting map data, and the meaning of the first bidirectional reflectance distribution function data is the same as that of the aforementioned BRDF value. Specifically, the process of the terminal obtaining the first lighting data from the server can be as follows: the terminal is in a state where it is calculating the reference lighting data of the multiplexed feature points under the viewpoint but has not yet obtained the calculation result, or the terminal is in a state where it has not started calculating the reference lighting data of the multiplexed feature points under the viewpoint, and simultaneously periodically sends query commands to the server to obtain the first lighting data from the server through the query commands. The query instruction instructs the server to check if first illumination data uploaded by a terminal corresponding to the first viewpoint exists on the server. If the server contains first illumination data uploaded by a terminal corresponding to the first viewpoint, the server sends the query result (i.e., the first illumination data) to the terminal. The terminal uses the first illumination data as the reference illumination data for the multiplexing point under that viewpoint. The terminal corresponding to the first viewpoint can refer to a terminal in the target scene with a different viewing angle than the terminal itself.
[0045] In some embodiments, obtaining the reference illumination data of the multiplexed feature point under the viewpoint can be understood as calculating the reference illumination data of the multiplexed feature point under the viewpoint. Specifically, the process of calculating the reference illumination data of the multiplexed feature point under the viewpoint can be as follows: the terminal is in a state where it is calculating the reference illumination data of the multiplexed feature point under the viewpoint but has not obtained a calculation result, or the terminal is in a state where it has not started calculating the reference illumination data of the multiplexed feature point under the viewpoint, and at the same time periodically sends a query command to the server. If the query command fails to obtain the first illumination data from the server, the query command is used to instruct the server to query whether the first illumination data uploaded by the terminal corresponding to the first viewpoint exists on the server. If the first illumination data uploaded by the terminal corresponding to the first viewpoint does not exist on the server, the server sends an empty query result to the terminal, and the terminal calculates the reference illumination data of the multiplexed feature point under the viewpoint.
[0046] In some embodiments, the ray tracing data of the reused feature points under the viewpoint is determined based on the reference lighting data. When the reference lighting data contains different data content, the calculation method of the ray tracing data of the reused feature points under the viewpoint will also differ. Specifically, when the reference lighting data includes lightmap data, and this lightmap data is obtained by the terminal from the server, the terminal can directly reuse this lightmap data in subsequent calculations. It can calculate the target bidirectional reflectance distribution function data of the reused feature points under the viewpoint. Furthermore, the ray tracing data of the reused feature points under the viewpoint can be calculated based on the lightmap data and the target bidirectional reflectance distribution function data. When the reference lighting data includes lightmap data, and this lightmap data is calculated by the terminal itself, the terminal can calculate the target bidirectional reflectance distribution function data of the reused feature points under the viewpoint. Furthermore, the ray tracing data of the reused feature points under the viewpoint can be calculated based on the lightmap data and the target bidirectional reflectance distribution function data. When the reference lighting data includes bidirectional reflectance distribution function (BRF) data, and the BRF data is data uploaded by the terminal from a first-view perspective obtained by the terminal from the server, the terminal can calculate the target BRF data of the multiplexed feature point under that viewpoint based on the BRF data. In this case, the terminal does not need to use traditional calculation methods to calculate the target BRF data of the multiplexed feature point under that viewpoint; instead, it can calculate the lighting map data of the multiplexed feature point under that viewpoint. Furthermore, the terminal can calculate the ray tracing data of the multiplexed feature point under that viewpoint based on the lighting map data and the target BRF data. When the reference lighting data includes BRF data, and the BRF data is calculated by the terminal, the terminal can calculate the lighting map data of the multiplexed feature point under that viewpoint. Furthermore, the terminal can calculate the ray tracing data of the multiplexed feature point under that viewpoint based on the lighting map data and the BRF data. Specifically, when the reference lighting data includes lightmap data and bidirectional reflectance distribution function data, it can be determined whether the terminal calculates the target bidirectional reflectance distribution function data based on whether the bidirectional reflectance distribution function data is obtained from the server. The method for calculating ray tracing described above can be used as a reference, and will not be repeated here.
[0047] In this embodiment, firstly, the terminal acquires a region image from its corresponding viewpoint in the target scene. Then, the terminal sends the region image to a server, where the server uses the region image to determine reused feature points in the target scene. Next, the terminal acquires reference lighting data for the reused feature points from its viewpoint. Finally, the terminal determines ray tracing data for the reused feature points from its viewpoint based on the reference lighting data. In this embodiment, terminals located at different viewpoints within the same scene (i.e., terminals with different viewing angles within the same scene) can send region images from their respective viewpoints to the server. The server determines reused feature points in the target scene, and each terminal can acquire reference lighting data for the reused feature points from its corresponding viewpoint. Furthermore, each terminal can determine ray tracing data for the reused feature points from its corresponding viewpoint based on the reference lighting data. Therefore, in this embodiment, terminals with different viewpoints within the same scene can collaborate during ray tracing, saving computational resources and time, and thus optimizing the performance of ray tracing for terminals with different viewpoints within the same scene.
[0048] Please see Figure 3 This is a schematic flowchart illustrating a ray tracing calculation method provided in an embodiment of this application. Figure 3 As shown, the method described in this application embodiment may include the following steps:
[0049] S301, acquire a region image from the viewpoint corresponding to the terminal in the target scene, and send the region image to the server. The region image is used by the server to determine reusable feature points in the target scene.
[0050] For details, please refer to Figure 2 The description of S201 will not be repeated here.
[0051] S302, obtain the reference lighting map data of the multiplexed feature points under the reference view from the server, and use the reference lighting map data as the lighting map data of the multiplexed feature points under the view.
[0052] It is easy to understand that a reference viewpoint can refer to an observation angle in the target scene that is different from the observation angle corresponding to the terminal.
[0053] Reference lighting map data refers to the energy of the incident light ray corresponding to direct illumination that can be obtained from the reused feature points calculated by the terminal corresponding to the reference viewpoint. Specifically, when calculating the reference lighting map data, the terminal corresponding to the reference viewpoint can use the first integral term in the optimized reflection equation to obtain the reference lighting map data. The optimized reflection equation can refer to a formula that uses a segmentation approximation method to decompose the reflection equation in the physically based rendering process into two independent integrals. The optimized reflection equation can be: The first integral term on the right-hand side of the formula can be referred to as the calculation process for the lightmap. The result obtained by the terminal corresponding to the reference viewpoint calculating the first integral term can be called the reference lightmap data.
[0054] Lightmap data can refer to the energy of the incident light corresponding to the direct illumination obtained by reusing feature points at the given viewpoint.
[0055] In some embodiments, obtaining the reference lighting map data of the multiplexed feature points under a reference viewpoint from the server can be understood as obtaining the reference lighting map data of the multiplexed feature points under a reference viewpoint from the server via a first query instruction. The first query instruction can be periodically sent by the terminal to the server within a preset time period. The first query instruction can be used by the server to query whether the reference lighting map data uploaded by the terminal corresponding to the reference viewpoint already exists on the server. The preset time period can refer to the period during which the terminal has not obtained the lighting map data of the multiplexed feature points under that viewpoint. During this preset time period, the terminal can be in a state of calculating lighting map data or in a state of not calculating lighting map data. In this way, the terminal can obtain reference lighting map data from the server before obtaining the calculation result. Since the lighting map data of a reused feature point is the same at any viewing angle when the external ambient lighting remains unchanged, the terminal can use the reference lighting map data as the lighting map data of the reused feature point under the viewpoint. The terminal can stop the current calculation process of the lighting map data of the reused feature point under the viewpoint, or stop calculating the lighting map data of the reused feature point under the viewpoint.
[0056] It is easy to understand that the reference lighting map data that already exists in the server can be calculated by a terminal with a better processor and uploaded to the server. This type of terminal has a fast calculation speed, and uploading its calculation results to the server can save calculation time for terminals with a worse processor, thereby improving the data processing speed of terminals with a worse processor.
[0057] S303, Calculate the target bidirectional reflectance distribution function data of the multiplexed feature points under the viewpoint.
[0058] It is easy to understand that the target bidirectional reflectance distribution function data can be the ratio of the radiance reflected by the multiplexed feature point in the observation direction corresponding to the viewpoint to the irradiance of the corresponding incident light.
[0059] In some embodiments, the terminal can periodically send query commands to the server during the calculation of the target bidirectional reflectance distribution function data of reused feature points under the specified viewpoint, i.e., from the start of the calculation to obtaining the calculation result. The query command instructs the server to check if there is reference bidirectional reflectance distribution function data uploaded by the terminal corresponding to other viewpoints (i.e., viewpoints different from the specified viewpoint) on the server. If no reference bidirectional reflectance distribution function data corresponding to the other viewpoint is found on the server, the server sends an empty query result to the terminal. Therefore, before the terminal obtains the calculation result of the target bidirectional reflectance distribution function data of the reused feature points under the specified viewpoint, and while continuously receiving empty query results, the terminal can complete the calculation process of the target bidirectional reflectance distribution function and obtain the calculation result. The terminal can calculate the target bidirectional reflectance distribution function data of the reused feature points under the specified viewpoint by using the second integral term in the optimized reflection equation formula to obtain reference lighting map data. The optimized reflection equation formula can refer to a formula that uses a segmentation approximation method to decompose the reflection equation in the physically based rendering process into two independent integrals. The optimized reflection equation can be found in the description in S302. The second integral term on the right side of the equation can be referred to as the calculation process of the target bidirectional reflection distribution function data.
[0060] Optionally, after the terminal calculates the target bidirectional reflectance distribution function data of the reused feature point under the stated view, if the server does not yet have reference bidirectional reflectance distribution function data uploaded by terminals corresponding to other viewpoints, the terminal can upload the calculated target bidirectional reflectance distribution function data to the server. This allows terminals corresponding to other viewpoints to obtain the target bidirectional reflectance distribution function data from the server and quickly obtain the bidirectional reflectance distribution function data of the reused feature point under other viewpoints using this data. In this way, terminals corresponding to other viewpoints do not need to calculate the bidirectional reflectance distribution function data of the reused feature point through complex integral terms during the calculation of the ray tracing data of the reused feature point, which can save computational load for terminals corresponding to other viewpoints and thus improve the data processing speed of terminals corresponding to other viewpoints.
[0061] S304, calculate the first product of the light map data and the target bidirectional reflectance distribution function data, and use the first product as the direct illumination data of the multiplexed feature points under the viewpoint.
[0062] It is easy to understand that direct illumination data can refer to the energy directly irradiated by a light source and received by a feature point.
[0063] In some embodiments, when calculating the direct illumination energy received by the multiplexed feature point at the viewing angle, it can be obtained from the lightmap data of the multiplexed feature point at the viewing angle. According to the optimized reflection equation, it is easy to see that the direct illumination energy of the multiplexed feature point at the viewing angle is equal to the product of the lightmap data and the target bidirectional reflectance distribution function data. Therefore, a first product of the lightmap data and the target bidirectional reflectance distribution function data can be calculated, and this first product can be used as the direct illumination data of the multiplexed feature point at the viewing angle.
[0064] S305, acquire the ray tracing data of the observation point corresponding to the multiplexed feature point, calculate the second product of the ray tracing data of the observation point and the bidirectional reflectance distribution function data of the target, and use the second product as the indirect illumination data of the multiplexed feature point under the viewpoint.
[0065] It is easy to understand that the observation point can refer to the reflection point corresponding to the multiplexed feature point receiving the indirect illumination energy from the light source. The observation point can receive the direct illumination energy from the light source; after one reflection from the observation point, the multiplexed feature point can receive the indirect illumination energy from the light source after one reflection. Alternatively, the observation point can receive the indirect illumination energy from the light source after multiple reflections; after a further reflection from the observation point, the multiplexed feature point can receive the indirect illumination energy from the light source after multiple reflections.
[0066] Ray tracing data can refer to the calculation results obtained using the reflection equation.
[0067] Indirect illumination data can refer to the energy indirectly irradiated by a light source and received by multiplexed feature points.
[0068] In some embodiments, when calculating the indirect illumination energy received by the multiplexed feature point under the viewpoint, the indirect illumination energy of the multiplexed feature point itself can be calculated using the ray tracing data of the observation point corresponding to the multiplexed feature point. Specifically, the ray tracing data of the observation point corresponding to the multiplexed feature point can be calculated by the terminal itself, or it can be obtained by the terminal from the server (calculated and uploaded by the terminal corresponding to other viewpoints in the target scene). According to the optimized reflection equation, it is easy to know that the indirect illumination energy of the multiplexed feature point under the viewpoint can be equal to the product of the light map data under indirect illumination and the target bidirectional reflectance distribution function data. Since the light map data of the indirect illumination corresponding to the multiplexed feature point under the viewpoint is the ray tracing data of the observation point corresponding to the multiplexed feature point, a second product of the ray tracing data of the observation point and the target bidirectional reflectance distribution function data can be calculated, and this second product can be used as the indirect illumination data of the multiplexed feature point under the viewpoint.
[0069] S306, calculate the sum of the direct lighting data and the indirect lighting data, and use the sum as the ray tracing data of the multiplexed feature points under the viewpoint.
[0070] In some embodiments, it is readily known that the ray tracing data of the multiplexed feature points under the viewpoint includes the energy of the direct illumination portion and the energy of the indirect illumination portion. The sum of the direct illumination data and the indirect illumination data of the multiplexed feature points under the viewpoint can be calculated and used as the ray tracing data of the multiplexed feature points under the viewpoint.
[0071] In this embodiment, the terminal can send the region image obtained from the terminal's viewpoint in the target scene to the server. The server determines the reused feature points in the target scene. The terminal can obtain the reference lighting map data of the reused feature points in the reference viewpoint from the server and use the reference lighting map data as the lighting map data of the reused feature points in the same viewpoint. The terminal does not need to calculate the lighting map data; it only needs to calculate the BRDF value of the reused feature point in the same viewpoint and subsequently calculate the ray tracing data of the reused feature point based on the lighting map data and the BRDF value. This can reduce the computational load on the terminal, thereby saving computation time and improving data processing speed.
[0072] Please see Figure 4 This is a schematic flowchart illustrating a ray tracing calculation method provided in an embodiment of this application. Figure 4 As shown, the method described in this application embodiment may include the following steps:
[0073] S401, acquire a region image from the viewpoint corresponding to the terminal in the target scene, and send the region image to the server. The region image is used by the server to determine reusable feature points in the target scene.
[0074] For details, please refer to Figure 2 The description in the text will not be repeated here.
[0075] S402, obtain the reference bidirectional reflection distribution function data of the multiplexed feature points from the server under the reference viewpoint.
[0076] It is easy to understand that a reference viewpoint can refer to an observation angle in the target scene that is different from the observation angle corresponding to the terminal.
[0077] The reference bidirectional reflectance distribution function (BRF) data refers to the ratio of the radiance reflected by a multiplexed feature point in the viewing direction corresponding to the reference viewpoint to the irradiance of the corresponding incident light. The BRF data can be calculated by the terminal corresponding to the reference viewpoint and uploaded to the server.
[0078] In some embodiments, obtaining the reference bidirectional reflectance distribution function data of the multiplexed feature points under a reference viewpoint from the server can be understood as obtaining the reference bidirectional reflectance distribution function data of the multiplexed feature points under a reference viewpoint from the server via a second query instruction. The second query instruction can be periodically sent to the server by the terminal within a preset time period. The second query instruction can be used by the server to query whether the reference bidirectional reflectance distribution function data uploaded by the terminal corresponding to the reference viewpoint already exists on the server. The preset time period can refer to the period during which the terminal has not obtained the bidirectional reflectance distribution function data of the multiplexed feature points under that viewpoint. During this preset time period, the terminal can be in a state of calculating the bidirectional reflectance distribution function data under that viewpoint, or it can be in a state of not calculating the bidirectional reflectance distribution function data under that viewpoint.
[0079] S403, obtain the energy distribution ratio of the multiplexed feature point under different viewing angles, and calculate the target bidirectional reflection distribution function data of the multiplexed feature point under the viewing angle based on the reference bidirectional reflection distribution function data and the energy distribution ratio.
[0080] It is easy to understand that the energy distribution ratio can refer to the ratio of the energy reflected at a point in different observation directions, that is, the ratio of the BRDF values corresponding to a point in different observation directions.
[0081] The target bidirectional reflectance distribution function data can be the ratio of the radiance reflected by the multiplexed feature point in the observation direction corresponding to the viewpoint to the irradiance of the corresponding incident light.
[0082] In some embodiments, the ratio of BRDF values corresponding to a point in different viewing directions is determined by the material type of the point's surface, which is generally fixed data. Therefore, the energy distribution ratio reflected by the reused feature point under different viewing angles can be found by considering the material type of the reused feature point's surface. For example, if the reused feature point reflects 5 parts of the total energy at viewpoint A, 2 parts at viewpoint B, and 3 parts at viewpoint C, then the energy ratio reflected between viewpoints A, B, and C can be 5:2:3, meaning the ratio of the BRDF values corresponding to viewpoints A, B, and C can be 5:2:3. Furthermore, since the reference bidirectional reflectance distribution function data of the reused feature point at the reference viewpoint can be obtained, and the energy distribution ratio corresponding to the reference viewpoint can be determined, the target bidirectional reflectance distribution function data corresponding to the viewpoint can be easily calculated from the aforementioned energy distribution ratio and the reference bidirectional reflectance distribution function data.
[0083] For example, one specific implementation could be as follows: a computational model for calculating BRDF values can be pre-trained. This model is input with reference bidirectional reflectance distribution function data corresponding to a reference viewpoint and the material type of the reused feature point surface. After internal processing, the computational model can output the target bidirectional reflectance distribution function data under the aforementioned viewpoint. During this internal processing, the computational model can determine the energy distribution ratio of the reused feature points under different viewpoints based on the material type of the reused feature points. Then, the target bidirectional reflectance distribution function data under the aforementioned viewpoint can be obtained from the energy distribution ratio and the reference bidirectional reflectance distribution function data.
[0084] Therefore, the terminal does not need to complete a complex integration calculation process and can quickly calculate the target bidirectional reflectance distribution function data under the stated viewpoint. It is easy to understand that the reference bidirectional reflectance distribution function data obtained by the terminal from the server can be calculated by a terminal with a high-performance processor and uploaded to the server. This type of terminal has a fast calculation speed, and uploading its calculation results to the server saves calculation time for terminals with lower-performance processors, thereby improving the data processing speed of terminals with lower-performance processors.
[0085] S404, Calculate the light map data of the reused feature points under the viewpoint.
[0086] It is easy to understand that lightmap data can refer to the energy of the incident light corresponding to the direct illumination of the light source obtained by reusing feature points at the stated viewpoint.
[0087] In some embodiments, the terminal can periodically send query commands to the server during the calculation of the lightmap data of reused feature points under the viewpoint, i.e., from the start of the calculation to obtaining the calculation result. The query command instructs the server to check if there is reference lightmap data uploaded by the terminal corresponding to other viewpoints (i.e., viewpoints different from the current viewpoint). If the reference lightmap data is not found on the server, the server sends an empty query result to the terminal. Therefore, in the above process, even if the terminal does not obtain reference lightmap data from the server through the query command, the terminal can complete the calculation of the lightmap data of reused feature points under the viewpoint and obtain the calculation result. The terminal can calculate the lightmap data of reused feature points under the viewpoint using the first integral term in the optimized reflection equation formula. The optimized reflection equation formula can refer to a formula that uses a segmentation approximation method to decompose the reflection equation in the physically based rendering process into two independent integrals. The optimized reflection equation formula can be referred to... Figure 3 In the description of S303, the first integral term on the right side of the formula can be called the calculation process of the lightmap.
[0088] Optionally, after the terminal calculates the lighting map data of the reused feature points under the stated view, if the server does not yet have reference lighting map data uploaded by terminals corresponding to other viewpoints, the terminal can upload the calculated lighting map data under the stated viewpoint to the server. This allows terminals under other viewpoints to obtain and reuse the lighting map data from the server. In this way, when terminals under other viewpoints calculate the ray tracing data of the reused feature points, they do not need to calculate the lighting map data of the reused feature points through complex integral terms, which can save computational load for terminals under other viewpoints and thus improve the data processing speed of terminals under other viewpoints.
[0089] S405, calculate the first product of the light map data and the target bidirectional reflectance distribution function data, and use the first product as the direct illumination data of the multiplexed feature points under the viewpoint.
[0090] S406, acquire the ray tracing data of the multiplexed feature point at the observation point, calculate the second product of the ray tracing data of the observation point and the bidirectional reflectance distribution function data of the target, and use the second product as the indirect illumination data of the multiplexed feature point under the viewpoint.
[0091] S407, calculate the sum of the direct illumination data and the indirect illumination data, and use the sum as the ray tracing data of the multiplexed feature points under the viewpoint.
[0092] For a detailed description of S405 to S407, please refer to [link / reference needed]. Figure 3 S304 to S306 are not described in detail here.
[0093] In this embodiment, the terminal can send a region image of the target scene from the terminal's corresponding viewpoint to the server. The server determines the reused feature points in the target scene. The terminal can obtain the reference bidirectional reflectance distribution function (BRDF) data of the reused feature points from the server at the reference viewpoint. Based on the reference BRDF data and the energy distribution ratio of the reused feature points at different viewpoints, the target BRDF data of the reused feature points at the specified viewpoint is calculated. This eliminates the need for the terminal to perform complex integral calculations to obtain the target BRDF data. The terminal only needs to perform a relatively simple deduction process to obtain the target BRDF data and calculate the illumination map data of the reused feature points at the specified viewpoint. Subsequently, the ray tracing data of the reused feature points is calculated based on the illumination map data and the target BRDF value. This reduces the computational load for the terminal, thereby saving computation time and improving data processing speed.
[0094] Please see Figure 5 This is a schematic flowchart illustrating a ray tracing calculation method provided in an embodiment of this application. Figure 5 As shown, the method described in this application embodiment may include the following steps:
[0095] S501, acquire a region image from the viewpoint corresponding to the terminal in the target scene, and send the region image to the server. The region image is used by the server to determine reusable feature points in the target scene.
[0096] For details, please refer to Figure 2 The description of S 201 will not be repeated here.
[0097] S502, obtain from the server the reference bidirectional reflection distribution function data of the multiplexed feature point under the first view and the target lighting map data of the multiplexed feature point under the second view, and use the target lighting map data as the lighting map data of the multiplexed feature point under the view.
[0098] It's easy to understand that "first-person perspective" refers to the viewpoint of a certain terminal in the target scene, while "second-person perspective" refers to the viewpoint of another terminal in the target scene. The first and second perspectives can be the same, in which case the terminal corresponding to the first perspective is the same as the terminal corresponding to the second perspective. Alternatively, the first and second perspectives can be different, in which case the terminal corresponding to the first perspective is different from the terminal corresponding to the second perspective.
[0099] Referring to bidirectional reflectance distribution function data, it can be defined as the ratio of the radiance reflected by a multiplexed feature point in the observation direction corresponding to the first viewpoint to the irradiance of the corresponding incident light. The bidirectional reflectance distribution function data can be calculated by the terminal corresponding to the first viewpoint and uploaded to the server.
[0100] Target lighting map data refers to the energy of the incident light corresponding to the direct illumination of the light source obtained from the second viewpoint using reused feature points. Target lighting map data can be calculated by the terminal corresponding to the second viewpoint and uploaded to the server.
[0101] In some embodiments, the process of a terminal obtaining reference bidirectional reflectance distribution function (BRF) data from a server can be as follows: The terminal obtains BRF data of multiplexed feature points from the server under a first viewpoint via a second query instruction. The second query instruction can be periodically sent by the terminal to the server within a preset time period. The second query instruction can be used by the server to check whether the reference BRF data uploaded by the terminal corresponding to the first viewpoint already exists on the server. The preset time period can refer to the time period during which the terminal has not obtained BRF data of multiplexed feature points under that viewpoint. During this preset time period, the terminal can be in a state of calculating BRF data under that viewpoint, or it can be in a state of not calculating BRF data under that viewpoint. Similarly, the process of a terminal obtaining target lighting map data from a server can be as follows: The terminal obtains target lighting map data of multiplexed feature points from the server under a second viewpoint via a first query instruction. The first query command can be periodically sent by the terminal to the server within a preset time period. This command is used by the server to check whether the target lighting map data uploaded by the terminal corresponding to the second viewpoint already exists on the server. The preset time period refers to the period during which the terminal has not obtained the lighting map data for the reused feature points under that viewpoint. During this preset time period, the terminal can be in a state of calculating lighting map data or in a state of not calculating lighting map data. It should be noted that the second and first query commands are independent of each other; the terminal can send both commands to the server whenever it requires them.
[0102] Therefore, the terminal can obtain the target lighting map data and reference bidirectional reflectance distribution function data from the server before obtaining the calculation results of the lighting map data and target bidirectional reflectance distribution function data under the viewpoint. Since the lighting map data of a reused feature point is the same at any viewing angle when the external ambient lighting remains unchanged, the terminal can reuse the target lighting map data without completing the calculation process to obtain the lighting map data under the viewpoint. That is, the target lighting map data can be used as the lighting map data of the reused feature point under the viewpoint. The terminal can stop the current calculation process of the lighting map data of the reused feature point under the viewpoint, or stop calculating the lighting map data of the reused feature point under the viewpoint.
[0103] S503, obtain the energy distribution ratio of the multiplexed feature point under different viewing angles, and calculate the target bidirectional reflection distribution function data of the multiplexed feature point under the viewing angle based on the reference bidirectional reflection distribution function data and the energy distribution ratio.
[0104] For details, please refer to Figure 4 The S403 in the text will not be elaborated upon here.
[0105] S504, calculate the first product of the light map data and the target bidirectional reflectance distribution function data, and use the first product as the direct illumination data of the multiplexed feature points under the viewpoint.
[0106] S505, acquire the ray tracing data of the multiplexed feature point at the observation point, calculate the second product of the ray tracing data of the observation point and the bidirectional reflectance distribution function data of the target, and use the second product as the indirect illumination data of the multiplexed feature point under the viewpoint.
[0107] S506, calculate the sum of the direct illumination data and the indirect illumination data, and use the sum as the ray tracing data of the multiplexed feature points under the viewpoint.
[0108] For a detailed description of S504 to S506, please refer to [link / reference needed]. Figure 3 The descriptions of S304 to S306 will not be repeated here.
[0109] In this embodiment, the terminal can send a region image of the target scene from its own perspective to the server. The server determines the reused feature points in the target scene. The terminal can obtain the reference bidirectional reflectance distribution function data of the reused feature points from the server in the first perspective and the target illumination map data of the reused feature points in the second perspective. Based on the reference bidirectional reflectance distribution function data and the energy distribution ratio of the reused feature points in different perspectives, the target bidirectional reflectance distribution function data of the reused feature points in the stated perspective is calculated. This eliminates the need for the terminal to perform complex integral calculations to obtain the target bidirectional reflectance distribution function data, and also eliminates the need for complex integral calculations to obtain the illumination map data. The terminal can obtain the target bidirectional reflectance distribution function data through a relatively simple calculation process using the reference bidirectional reflectance distribution function data, or it can directly reuse the target illumination map data. Subsequently, the ray tracing data of the reused feature points is calculated based on the illumination map data and the target BRDF value. This saves the terminal a lot of calculation time and improves the data processing speed.
[0110] Please see Figure 6 This is a schematic flowchart illustrating a ray tracing calculation method provided in an embodiment of this application. Figure 6 As shown, the method described in this application embodiment may include the following steps:
[0111] S601, acquire a region image from the viewpoint corresponding to the terminal in the target scene, and send the region image to the server. The region image is used by the server to determine reusable feature points in the target scene.
[0112] For details, please refer to Figure 2 The description of S 201 will not be repeated here.
[0113] S602, Calculate the light map data of the reused feature points under the viewpoint.
[0114] In some embodiments, the terminal may have a high-performance processor. During the calculation of the lighting map data of reused feature points under the given viewpoint—that is, from the start of the calculation to obtaining the result—the terminal may periodically send a third query instruction to the server. This third query instruction instructs the server to check if reference lighting map data uploaded by the terminal exists for other viewpoints (i.e., viewpoints different from the given viewpoint). If the reference lighting map data does not exist on the server, the server sends an empty query result to the terminal. Therefore, in the above process, even if the terminal does not obtain reference lighting map data from the server through the third query instruction, the terminal can still complete the calculation of the lighting map data of reused feature points under the given viewpoint and obtain the calculation result.
[0115] Optionally, after the terminal calculates the lighting map data of the reused feature points under the stated view, if the server does not yet have reference lighting map data uploaded by terminals corresponding to other viewpoints, the terminal can upload the calculated lighting map data under the stated viewpoint to the server so that terminals under other viewpoints can obtain and reuse the lighting map data from the server. In this way, when terminals under other viewpoints calculate the ray tracing data of the reused feature points, they do not need to calculate the lighting map data of the reused feature points through complex integral terms, which can save computation for terminals under other viewpoints and thus improve the data processing speed of terminals under other viewpoints.
[0116] S603, Calculate the target bidirectional reflectance distribution function data of the multiplexed feature points under the viewpoint.
[0117] In some embodiments, the terminal may have a high-performance processor. During the calculation of the target bidirectional reflectance distribution function data for the reused feature points under the given viewpoint—that is, from the start of the calculation to obtaining the result—the terminal can periodically send a fourth query instruction to the server. This fourth query instruction instructs the server to query whether reference bidirectional reflectance distribution function data uploaded by terminals corresponding to other viewpoints (i.e., viewpoints different from the given viewpoint) exists on the server. If no reference bidirectional reflectance distribution function data corresponding to the other viewpoint exists on the server, the server sends an empty query result to the terminal. Therefore, in the above process, even if the terminal does not obtain reference bidirectional reflectance distribution function data from the server through the query instruction, the terminal can still complete the calculation of the target bidirectional reflectance distribution function data for the reused feature points under the given viewpoint and obtain the calculation result.
[0118] Optionally, after the terminal calculates the target bidirectional reflectance distribution function data of the reused feature point under the stated view, if the server does not yet have reference bidirectional reflectance distribution function data uploaded by terminals corresponding to other viewpoints, the terminal can upload the calculated target bidirectional reflectance distribution function data to the server. This allows terminals corresponding to other viewpoints to obtain the target bidirectional reflectance distribution function data from the server and quickly obtain the bidirectional reflectance distribution function data of the reused feature point under other viewpoints using this data. In this way, terminals corresponding to other viewpoints do not need to calculate the bidirectional reflectance distribution function data of the reused feature point through complex integral terms during the calculation of the ray tracing data of the reused feature point, which can save computational load for terminals corresponding to other viewpoints and thus improve the data processing speed of terminals corresponding to other viewpoints.
[0119] S604, calculate the first product of the light map data and the target bidirectional reflectance distribution function data, and use the first product as the direct illumination data of the multiplexed feature points under the viewpoint.
[0120] S605, acquire the ray tracing data of the multiplexed feature point at the observation point, calculate the second product of the ray tracing data of the observation point and the target bidirectional reflectance distribution function data, and use the second product as the indirect illumination data of the multiplexed feature point under the viewpoint.
[0121] S606, calculate the sum of the direct illumination data and the indirect illumination data, and use the sum as the ray tracing data of the multiplexed feature points under the viewpoint.
[0122] For a detailed description of S604 to S606, please refer to [link / reference needed]. Figure 3 The descriptions of S304 to S306 will not be repeated here.
[0123] In this embodiment, the terminal can send a region image acquired from its own viewpoint within a target scene to a server. The server then determines reused feature points in the target scene. The terminal can calculate the target bidirectional reflectance distribution function data of the reused feature points under that viewpoint, and can also calculate the lighting map data of the reused feature points under that viewpoint. Finally, ray tracing data for the reused feature points is calculated based on the lighting map data, the target bidirectional reflectance distribution function data, and the lighting map data. Therefore, during ray tracing, terminals with different viewpoints in the same scene can collaborate by having reused feature points with the same characteristics determined by the server. This saves computational resources and time during ray tracing, thereby optimizing the performance of ray tracing for terminals with different viewpoints in the same scene.
[0124] Please see Figure 7This is a schematic diagram of the structure of a ray tracing computing device provided in an embodiment of this application. The ray tracing computing device 700 can be implemented as all or part of a terminal through software, hardware, or a combination of both. The device 700 includes:
[0125] The first calculation module 710 is used to acquire a region image from the viewpoint corresponding to the terminal in the target scene, and send the region image to the server. The region image is used by the server to determine the reusable feature points in the target scene.
[0126] The second calculation module 720 is used to acquire reference lighting data of the multiplexed feature points under the viewpoint, and determine ray tracing data of the multiplexed feature points under the viewpoint based on the reference lighting data.
[0127] Optionally, the second computing module includes:
[0128] The first acquisition module is configured to acquire reference lighting map data of the multiplexed feature points under a reference viewpoint from the server, and use the reference lighting map data as the lighting map data of the multiplexed feature points under the same viewpoint. The reference lighting map data is calculated by the terminal corresponding to the reference viewpoint and uploaded to the server; or...
[0129] The second acquisition module is used to calculate the lighting map data of the reused feature points under the viewpoint.
[0130] Optionally, the second computing module includes:
[0131] The third calculation module is used to calculate the target bidirectional reflectance distribution function data of the reused feature points under the viewpoint;
[0132] The fourth calculation module is used to determine the ray tracing data of the multiplexed feature points under the viewpoint based on the light map data and the target bidirectional reflectance distribution function data.
[0133] Optionally, the second computing module includes:
[0134] The third acquisition module is used to acquire the reference bidirectional reflectance distribution function data of the multiplexed feature points under the reference viewpoint from the server. The reference bidirectional reflectance distribution function data is calculated by the terminal corresponding to the reference viewpoint and uploaded to the server.
[0135] The fourth acquisition module is used to acquire the energy distribution ratio of the reused feature points under different viewpoints;
[0136] The fifth acquisition module is used to calculate the target bidirectional reflection distribution function data of the multiplexed feature points under the viewpoint based on the reference bidirectional reflection distribution function data and the energy allocation ratio;
[0137] The sixth acquisition module is used to calculate the light map data of the reused feature points under the viewpoint;
[0138] The seventh acquisition module is used to determine the ray tracing data of the multiplexed feature points under the viewpoint based on the light map data and the target bidirectional reflectance distribution function data.
[0139] Optionally, the second computing module includes:
[0140] The eighth acquisition module is used to calculate the target bidirectional reflectance distribution function data of the multiplexed feature points under the viewpoint;
[0141] The ninth acquisition module is used to calculate the light map data of the reused feature points under the viewpoint;
[0142] The tenth acquisition module is used to determine the ray tracing data of the multiplexed feature points under the viewpoint based on the light map data and the target bidirectional reflectance distribution function data.
[0143] Optionally, the second computing module includes:
[0144] The eleventh acquisition module is used to acquire from the server the reference bidirectional reflectance distribution function data of the multiplexed feature points under the first view and the target lighting map data of the multiplexed feature points under the second view, and use the target lighting map data as the lighting map data of the multiplexed feature points under the view. The reference bidirectional reflectance distribution function data is calculated by the terminal corresponding to the first view and uploaded to the server, and the target lighting map data is calculated by the terminal corresponding to the second view and uploaded to the server.
[0145] The twelfth acquisition module is used to acquire the energy distribution ratio of the multiplexed feature points under different viewpoints;
[0146] The thirteenth acquisition module is used to calculate the target bidirectional reflection distribution function data of the multiplexed feature points under the viewpoint based on the reference bidirectional reflection distribution function data and the energy allocation ratio.
[0147] The fourteenth acquisition module is used to determine the ray tracing data of the multiplexed feature points under the viewpoint based on the light map data and the target bidirectional reflectance distribution function data.
[0148] Optionally, the second computing module includes:
[0149] The fifth calculation module is used to calculate the first product of the light map data and the target bidirectional reflectance distribution function data, and use the first product as the direct illumination data of the multiplexed feature points under the viewpoint;
[0150] The sixth calculation module is used to acquire the ray tracing data of the observation point corresponding to the multiplexed feature point, calculate the second product of the ray tracing data of the observation point and the target bidirectional reflectance distribution function data, and use the second product as the indirect illumination data of the multiplexed feature point under the viewpoint.
[0151] The seventh calculation module is used to calculate the sum of the direct lighting data and the indirect lighting data, and use the sum as the ray tracing data of the multiplexed feature points under the viewpoint.
[0152] Please refer to Figure 8 , Figure 8 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application. Figure 8 As shown, terminal 800 may include: at least one processor 801, at least one network interface 804, user interface 803, memory 805, display assembly 806, and at least one communication bus 802.
[0153] The communication bus 802 is used to enable communication between these components.
[0154] The user interface 803 may include a display screen and a camera. Optionally, the user interface 803 may also include a standard wired interface and a wireless interface.
[0155] The network interface 804 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).
[0156] The processor 801 may include one or more processing cores. The processor 801 connects to various parts within the terminal 700 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 805, and by calling data stored in the memory 805. Optionally, the processor 801 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 801 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also be implemented as a separate chip without being integrated into the processor 801.
[0157] The memory 805 may include random access memory (RAM) or read-only memory. Optionally, the memory 805 may include a non-transitory computer-readable storage medium. The memory 805 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 805 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 805 may also be at least one storage device located remotely from the aforementioned processor 801. Figure 8 As shown, the memory 805, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a program for calculating ray tracing methods.
[0158] In addition, those skilled in the art will understand that the structure of the terminal 800 shown in the above figures does not constitute a limitation on the terminal 800. The user terminal may include more or fewer components than shown, or combine certain components, or have different component arrangements. For example, the terminal 800 also includes radio frequency circuits, audio circuits, WiFi components, power supplies, Bluetooth components, etc., which will not be described in detail here.
[0159] This application also provides a computer-readable storage medium storing at least one instruction that is executed by a processor to implement the ray tracing calculation method as described in the above embodiments.
[0160] This application also provides a computer program product that stores at least one instruction, which is loaded and executed by the processor to implement the ray tracing calculation method described in the above embodiments.
[0161] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of a computer program from one place to another. Storage media can be any available medium accessible to a general-purpose or special-purpose computer. The above descriptions are merely optional embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A ray tracing calculation method, applied to a terminal, characterized in that, The method includes: In the target scene, a region image is obtained from the viewpoint corresponding to the terminal, and the region image is sent to the server. The region image is used by the server to determine the reusable feature points in the target scene. Obtain reference lighting data of the multiplexed feature points under the viewpoint, and determine ray tracing data of the multiplexed feature points under the viewpoint based on the reference lighting data; The reference lighting data includes reference bidirectional reflectance distribution function (BRF) data. The step of acquiring the reference lighting data of the multiplexed feature point under the viewing angle, and determining the ray tracing data of the multiplexed feature point under the viewing angle based on the reference lighting data, includes: acquiring the reference BRF data of the multiplexed feature point under the reference viewing angle from the server; the reference BRF data is calculated by the terminal corresponding to the reference viewing angle and uploaded to the server; acquiring the energy distribution ratio of the multiplexed feature point under different viewing angles; calculating the target BRF data of the multiplexed feature point under the viewing angle based on the reference BRF data and the energy distribution ratio; calculating the lighting map data of the multiplexed feature point under the viewing angle; and determining the ray tracing data of the multiplexed feature point under the viewing angle based on the lighting map data and the target BRF data.
2. The method according to claim 1, characterized in that, The reference lighting data includes light map data, and obtaining the reference lighting data of the reused feature points under the viewpoint includes: Obtain reference lighting map data of the multiplexed feature points from the server under a reference viewpoint, and use the reference lighting map data as the lighting map data of the multiplexed feature points under that viewpoint. The reference lighting map data is calculated by the terminal corresponding to the reference viewpoint and uploaded to the server; or... Calculate the light map data of the reused feature points under the viewpoint.
3. The method according to claim 2, characterized in that, Before determining the multiplexed feature points based on the reference illumination data using ray tracing data at the viewpoint, the method further includes: Calculate the target bidirectional reflectance distribution function data of the reused feature points under the specified viewpoint; The step of determining the ray tracing data of the multiplexed feature points under the viewpoint based on the reference illumination data includes: The ray tracing data of the reused feature points under the specified viewpoint is determined based on the light map data and the target bidirectional reflectance distribution function data.
4. The method according to claim 1, characterized in that, The reference illumination data includes target bidirectional reflectance distribution function data. Obtaining the reference illumination data of the multiplexed feature points under the viewpoint, and determining the ray tracing data of the multiplexed feature points under the viewpoint based on the reference illumination data, includes: Calculate the target bidirectional reflectance distribution function data of the reused feature points under the specified viewpoint; Calculate the lightmap data of the reused feature points under the specified viewpoint; The ray tracing data of the reused feature points under the specified viewpoint is determined based on the light map data and the target bidirectional reflectance distribution function data.
5. The method according to claim 1, characterized in that, The reference lighting data includes reference bidirectional reflectance distribution function data and lightmap data. Obtaining the reference lighting data of the multiplexed feature points under the viewpoint, and determining the ray tracing data of the multiplexed feature points under the viewpoint based on the reference lighting data, includes: The reference bidirectional reflectance distribution function data of the multiplexed feature points under a first view and the target lighting map data of the multiplexed feature points under a second view are obtained from the server. The target lighting map data is used as the lighting map data of the multiplexed feature points under the view. The reference bidirectional reflectance distribution function data is calculated by the terminal corresponding to the first view and uploaded to the server. The target lighting map data is calculated by the terminal corresponding to the second view and uploaded to the server. Obtain the energy distribution ratio of the reused feature points under different viewpoints; Calculate the target bidirectional reflectance distribution function data of the reused feature point under the viewpoint based on the reference bidirectional reflectance distribution function data and the energy allocation ratio; The ray tracing data of the reused feature points under the specified viewpoint is determined based on the light map data and the target bidirectional reflectance distribution function data.
6. The method according to any one of claims 3-5, characterized in that, The step of determining the ray tracing data of the multiplexed feature points under the viewpoint based on the light map data and the target bidirectional reflectance distribution function data includes: Calculate the first product of the light map data and the target bidirectional reflectance distribution function data, and use the first product as the direct illumination data of the multiplexed feature points under the viewpoint; Acquire the ray tracing data of the observation point corresponding to the multiplexed feature point, calculate the second product of the ray tracing data of the observation point and the bidirectional reflectance distribution function data of the target, and use the second product as the indirect illumination data of the multiplexed feature point under the viewpoint; Calculate the sum of the direct lighting data and the indirect lighting data, and use the sum as the ray tracing data of the multiplexed feature points under the viewpoint.
7. A ray-tracing computing device, applied to a terminal, characterized in that, The device includes: The first calculation module is used to acquire a region image from the viewpoint corresponding to the terminal in the target scene, and send the region image to the server. The region image is used by the server to determine the reusable feature points in the target scene. The second calculation module is used to acquire reference lighting data of the multiplexed feature points under the viewpoint, and determine ray tracing data of the multiplexed feature points under the viewpoint based on the reference lighting data; The reference lighting data includes reference bidirectional reflectance distribution function (BDR) data. The second calculation module is specifically used to: obtain the reference BDR data of the multiplexed feature point from the server at a reference viewpoint; the reference BDR data is calculated by the terminal corresponding to the reference viewpoint and uploaded to the server; obtain the energy distribution ratio of the multiplexed feature point at different viewpoints; calculate the target BDR data of the multiplexed feature point at the viewpoint based on the reference BDR data and the energy distribution ratio; calculate the lighting map data of the multiplexed feature point at the viewpoint; and determine the ray tracing data of the multiplexed feature point at the viewpoint based on the lighting map data and the target BDR data.
8. A computer storage medium, characterized in that, The computer storage medium stores a plurality of instructions, which are adapted to be loaded by a processor and executed as the method steps of any one of claims 1 to 6.
9. A terminal, characterized in that, include: A processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and executed the method steps as claimed in any one of claims 1 to 6.