Image rendering method, device, terminal, storage medium and program product

By introducing a ray tracing processing engine into terminal devices, the problem of virtual environment rendering engines lacking ray tracing rendering capabilities has been solved, improving the image quality and rendering efficiency of 3D applications and reducing data transmission costs.

CN115345974BActive Publication Date: 2026-07-03GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2022-08-15
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

In existing technologies, the image quality of terminal devices is poor when running 3D applications, especially when the virtual environment rendering engine does not have ray tracing rendering capabilities, making it difficult to provide high-quality ray tracing rendering effects.

Method used

A ray tracing processing engine is introduced into the terminal, independent of the virtual environment rendering engine. It performs ray tracing calculations by receiving the target LOD value sent by the virtual environment rendering engine, provides ray tracing rendering effects, and transmits scene information in the initial stage of the application to reduce the amount of real-time data transmission.

Benefits of technology

It improves the accuracy and image quality of ray tracing rendering, optimizes the image rendering capabilities of the virtual environment rendering engine, reduces data transmission costs, and achieves ray tracing rendering effects without modifying the internal code of the virtual environment rendering engine.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115345974B_ABST
    Figure CN115345974B_ABST
Patent Text Reader

Abstract

The application discloses an image rendering method and device, a terminal, a storage medium and a program product, and belongs to the technical field of image rendering. The method comprises the following steps: receiving a target LOD value sent by a virtual environment rendering engine through a light tracing processing engine, wherein the target LOD value represents a detail level of an object model corresponding to a target scene object in a to-be-rendered image; performing light tracing calculation on the target scene object through the light tracing processing engine based on the target LOD value, so as to obtain target light tracing data corresponding to the target scene object; and sending the target light tracing data to the virtual environment rendering engine through the light tracing processing engine, so that the virtual environment rendering engine renders the target scene object based on the target light tracing data. The light tracing rendering effect can be provided when the virtual environment rendering engine does not have the light tracing rendering capability, and the image rendering capability of the virtual environment rendering engine can be optimized by upgrading and developing the light tracing processing engine without modifying the internal code of the virtual environment rendering engine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image rendering technology, and in particular to an image rendering method, apparatus, terminal, storage medium, and program product. Background Technology

[0002] With the continuous development of mobile terminal technology and the continuous reduction of data traffic costs, terminal applications are also showing a flourishing development trend. In particular, some applications that could only be used on personal computers can now be used on mobile terminals. A typical example is some game applications that could only run on personal computers, especially 3D games, which can now run on mobile terminals.

[0003] However, the image quality of 3D applications currently running on terminals is poor. Summary of the Invention

[0004] This application provides an image rendering method, apparatus, terminal, storage medium, and program product. The technical solution is as follows:

[0005] On one hand, embodiments of this application provide an image rendering method, which is applied to a terminal, the terminal including a virtual environment rendering engine and a ray tracing processing engine, the method including:

[0006] The ray tracing processing engine receives the target LOD value sent by the virtual environment rendering engine, where the target LOD value represents the level of detail of the object model corresponding to the target scene object in the image to be rendered.

[0007] Based on the target LOD value, the ray tracing engine performs ray tracing calculations on the target scene objects to obtain the target ray tracing data corresponding to the target scene objects.

[0008] The ray tracing processing engine sends the target ray tracing data to the virtual environment rendering engine, so that the virtual environment rendering engine renders the target scene object based on the target ray tracing data.

[0009] On the other hand, embodiments of this application provide an image rendering apparatus, which is applied to a terminal. The terminal includes a virtual environment rendering engine and a ray tracing processing engine. The apparatus includes:

[0010] The receiving module is used to receive the target LOD value sent by the virtual environment rendering engine through the ray tracing processing engine. The target LOD value represents the level of detail of the object model corresponding to the target scene object in the image to be rendered.

[0011] The ray tracing calculation module is used to perform ray tracing calculations on the target scene objects based on the target LOD value through the ray tracing processing engine, and obtain the target ray tracing data corresponding to the target scene objects.

[0012] The first sending module is used to send the target ray tracing data to the virtual environment rendering engine through the ray tracing processing engine, so that the virtual environment rendering engine renders the target scene object based on the target ray tracing data.

[0013] On the other hand, embodiments of this application provide a terminal, the terminal including: a processor and a memory, the memory storing at least one instruction, the at least one instruction being loaded and executed by the processor to implement the image rendering method as described above.

[0014] On the other hand, embodiments of this application provide a computer-readable storage medium storing at least one piece of program code, which is loaded and executed by a processor to implement the image rendering method as described above.

[0015] On the other hand, embodiments of this application provide a computer program product including computer instructions stored in a computer-readable storage medium. A terminal's processor reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the terminal to perform the image rendering methods provided in various optional implementations of the above aspects.

[0016] The technical solution provided in this application can bring the following beneficial effects:

[0017] In this embodiment, a ray tracing processing engine is additionally set up in the terminal to perform ray tracing rendering, providing ray tracing rendering effects. This allows for ray tracing rendering of 3D images even when the virtual environment rendering engine lacks ray tracing capabilities. Alternatively, the ray tracing processing engine can be upgraded and its image rendering capabilities optimized without modifying or understanding its internal code. Furthermore, by transmitting the target LOD value of the object to be rendered in the virtual environment rendering engine to the ray tracing processing engine in real time, and having the ray tracing processing engine perform ray tracing calculations based on the target LOD value, the calculated target ray tracing data can meet the current level of detail requirements of the object in the target scene, improving the accuracy of ray tracing calculations. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 A flowchart illustrating an exemplary embodiment of the image rendering method provided in this application is shown;

[0020] Figure 2 A flowchart illustrating an exemplary embodiment of the image rendering method provided in this application is shown;

[0021] Figure 3 This illustration shows a schematic diagram illustrating the relationship between a camera viewport and scene objects in an exemplary embodiment of this application;

[0022] Figure 4 A flowchart illustrating an exemplary embodiment of the image rendering method provided in this application is shown;

[0023] Figure 5 A flowchart illustrating an exemplary embodiment of the image rendering method provided in this application is shown;

[0024] Figure 6 A complete image rendering flowchart illustrating an exemplary embodiment of this application is shown;

[0025] Figure 7 This invention provides a structural block diagram of an image rendering apparatus according to an embodiment of the present application.

[0026] Figure 8 A structural block diagram of a terminal provided in an exemplary embodiment of this application is shown. Detailed Implementation

[0027] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0028] Please refer to Figure 1 This document illustrates a flowchart of an image rendering method provided in an exemplary embodiment of this application. The embodiment uses the application of this method to a terminal as an example for illustration. The method includes:

[0029] Step 101: Receive the target LOD value sent by the virtual environment rendering engine through the ray tracing processing engine. The target LOD value represents the level of detail of the object model corresponding to the target scene object in the image to be rendered.

[0030] In 3D applications (such as 3D games and 3D animations), 3D objects need to be displayed on the terminal's 2D display screen. To make the scene objects displayed in 3D applications more realistic, ray tracing rendering (or simply ray tracing) is performed on the scene objects in the image to simulate effects such as shadows, reflections, refractions, and ambient occlusion in the real world. However, due to the large amount of computation involved in ray tracing, some virtual environment rendering engines do not have ray tracing calculation capabilities.

[0031] The image rendering method provided in this application embodiment can provide ray tracing rendering effects for 3D applications even when the virtual environment rendering engine lacks ray tracing calculation capabilities. By setting up a separate ray tracing processing engine in the terminal, independent of the virtual environment rendering engine (e.g., as a plugin), this ray tracing processing engine has ray tracing calculation or ray tracing rendering functions and can perform ray tracing calculations on scene objects. That is, the terminal in this application embodiment is equipped with both a virtual environment rendering engine and a ray tracing processing engine. The virtual environment rendering engine may or may not have ray tracing calculation capabilities; the ray tracing processing engine has ray tracing calculation capabilities. When the virtual environment rendering engine lacks ray tracing calculation capabilities, the ray tracing processing engine can provide ray tracing rendering functionality for 3D applications. When the virtual environment rendering engine has ray tracing calculation capabilities, the ray tracing processing engine can be directly upgraded and updated without modifying the internal code of the virtual environment rendering engine, thereby further improving the ray tracing rendering effect of 3D applications.

[0032] In 3D application image rendering scenarios, the position and importance of scene objects in the display environment determine the resource allocation for scene object rendering. For example, if scene object 1 is very far from the camera, the details that can be seen of scene object 1 will be greatly reduced; if scene object 1 is very close to the camera, the details that can be seen of scene object 1 will be greatly increased. To avoid rendering all the details of the same scene object when it is in different positions in the display environment, application designers or animators will design object models with different levels of detail for the same scene object according to the required level of detail at different distances. Different levels of detail object models can be distinguished using different LOD (Level of Detail) values. For example, an object model with an LOD value of 0 has a higher level of detail (refinement) than an object model with an LOD value of 1; that is, an object model with an LOD value of 0 includes more object details.

[0033] In 3D applications, objects in the same scene may correspond to different Level of Detail (LOD) values ​​at different display locations within the environment. Different LOD values ​​correspond to different levels of detail in the object model, and these differences in object model quality affect the detail of ray tracing rendering. Therefore, to improve the accuracy of ray tracing rendering of scene objects, in one possible implementation, the virtual environment rendering engine needs to determine the target LOD value of the target scene object in real time during application operation and transmit this target LOD value to the ray tracing engine. The ray tracing engine can receive the target LOD value sent by the virtual environment rendering engine so that it can select the matching object model for ray tracing rendering based on the target LOD value.

[0034] The target LOD value represents the level of detail of the object model corresponding to the target scene object in the image to be rendered, and the higher the level of detail, the smaller the LOD value.

[0035] Step 102: Based on the target LOD value, perform ray tracing calculations on the target scene objects using the ray tracing processing engine to obtain the target ray tracing data corresponding to the target scene objects.

[0036] In one possible implementation, when the ray tracing processing engine receives the target LOD value transmitted by the virtual environment rendering engine, it can determine the level of detail of the object model corresponding to the current target scene object based on the target LOD value, and select the object model corresponding to the level of detail of the target scene object for ray tracing calculation to obtain the target ray tracing data corresponding to the target scene object.

[0037] Optionally, the target ray tracing data may include rendering parameters such as shadows, reflections, refractions, and ambient occlusion corresponding to the target scene objects.

[0038] Optionally, the ray tracing processing engine can pre-store object models corresponding to various levels of detail for the target scene objects, and the object models at different levels of detail are associated with their corresponding LOD values. This allows the ray tracing processing engine to index the corresponding object model based on the received target LOD value during application operation, and then perform ray tracing calculations on the target scene objects based on the object model.

[0039] Step 103: Send the target ray tracing data to the virtual environment rendering engine through the ray tracing processing engine, so that the virtual environment rendering engine can render the target scene objects based on the target ray tracing data.

[0040] In order to enable the target scene objects in the image to have ray tracing rendering effect, in one possible implementation, after the ray tracing processing engine performs ray tracing calculations on the target scene objects to obtain target ray tracing data, it can send the target ray tracing data to the virtual environment rendering engine, so that the virtual environment rendering engine can render the target scene objects based on the target ray tracing data, so that the target scene in the image has ray tracing rendering effect.

[0041] Optionally, when the image rendering mode is full ray tracing, image rendering can be performed solely based on the target ray tracing data returned by the ray tracing engine. When the image rendering mode is hybrid ray tracing, hybrid rendering can be performed based on the target ray tracing data returned by the ray tracing engine and the image rendering parameters generated in the virtual environment rendering engine. For example, if the virtual environment rendering engine uses rasterization rendering, it will merge the target ray tracing data and the rasterization rendering data to obtain the final hybrid rendering effect.

[0042] In summary, in this embodiment, by additionally setting up a ray tracing processing engine in the terminal, the ray tracing processing engine performs ray tracing rendering, providing ray tracing rendering effects. This allows for ray tracing rendering effects to be provided for 3D images even when the virtual environment rendering engine lacks ray tracing rendering capabilities. Furthermore, it allows for the optimization of the virtual environment rendering engine's image rendering capabilities by upgrading and developing the ray tracing processing engine without modifying or understanding its internal code. In addition, by transmitting the target LOD value of the object to be rendered in the virtual environment rendering engine to the ray tracing processing engine in real time, and having the ray tracing processing engine perform ray tracing calculations based on the target LOD value, the target ray tracing data calculated by the ray tracing processing engine can meet the current level of detail requirements of the target scene object, improving the accuracy of ray tracing calculations.

[0043] The level of detail of scene objects changes in real time. To avoid the virtual environment rendering engine needing to transmit the object models of scene objects to the ray tracing engine in real time, which would incur significant transmission costs, this embodiment can transmit the object models of scene objects at each level of detail to the ray tracing engine all at once at the beginning of the application's initial runtime. Then, during subsequent application runtime, there is no need to transmit resource parameters such as object models; only the target LOD values ​​need to be transmitted to achieve ray tracing rendering of scene objects.

[0044] Please refer to Figure 2 This document illustrates a flowchart of an image rendering method provided in an exemplary embodiment of this application. The embodiment uses the application of this method to a terminal as an example for illustration. The method includes:

[0045] Step 201: Send the target scene information of the target scene object to the ray tracing processing engine through the virtual environment rendering engine. The target scene information includes at least one candidate object model corresponding to the target scene object, the candidate LOD value corresponding to the candidate object model, and the light source information.

[0046] To avoid the transmission costs associated with real-time transmission of scene resources such as scene object models and light source information during application operation, in one possible implementation, the virtual environment rendering engine transmits all target scene information corresponding to the target scene object to the ray tracing processing engine at the initial stage of application operation. Correspondingly, the ray tracing processing engine receives and stores the target scene information so that ray tracing calculations can be performed based on the target scene information during subsequent application operation.

[0047] The target scene information mainly includes the scene information required by the ray tracing engine for ray tracing rendering. It can include candidate object models corresponding to different levels of detail of the target scene objects, the candidate LOD values ​​of each candidate object model, light source information, etc.

[0048] Step 202: Receive the target LOD value sent by the virtual environment rendering engine through the ray tracing processing engine. The target LOD value represents the level of detail of the object model corresponding to the target scene object in the image to be rendered.

[0049] Since the target scene information corresponding to the target scene object has been sent to the ray tracing engine in the initial stage of the application, the virtual environment rendering engine only needs to send the real-time determined target LOD value to the ray tracing engine during the application runtime. The ray tracing engine can then find the corresponding target object model and other scene information from itself based on the received target LOD value and perform ray tracing calculations without transmitting the scene object model and other scene information during the application runtime, thus reducing the amount of real-time data transmission and lowering data transmission costs.

[0050] Since objects in the same scene may be located in different positions within the virtual environment at different stages of application execution, requiring the rendering of object models with different levels of detail, the virtual environment rendering engine needs to calculate the distance between the target scene object and the main camera viewport in real time to determine the corresponding target LOD value and transmit it to the ray tracing engine in order for the ray tracing engine to clearly identify the object model to be rendered. In an exemplary example, step 202 may include steps 202A to 202D.

[0051] Step 202A: During application operation, the target distance between the target scene object and the target light source is obtained in real time through the virtual environment rendering engine.

[0052] During application runtime, the level of detail used to render object models in the target scene depends on the object's position within the current environment, primarily its distance from the main camera viewport. Accordingly, during application runtime, the virtual environment rendering engine needs to obtain the target distance between the object and the target camera viewport in real time to determine the appropriate level of detail for rendering.

[0053] The target main camera viewport defines the relative position and orientation of the user and the scene. (Illustrative example, such as...) Figure 3 As shown, it illustrates a schematic diagram of the relationship between a camera viewport and scene objects, according to an exemplary embodiment of this application. Figure 3 The scene shown contains scene object 301 and scene object 302. Scene object 301 is closer to the camera viewport 303 than scene object 302, so the level of detail in scene object 301 is higher than that in scene object 302.

[0054] Optionally, the position of the target main camera at any given time can be changed.

[0055] Step 202B: Based on the target distance and the first target relationship, determine the target LOD value corresponding to the target scene object. The first target relationship indicates the correspondence between the distance range and the LOD value.

[0056] The terminal is configured with a correspondence between distance ranges and LOD values. Table 1 illustrates the relationship between distance ranges and LOD values.

[0057] Table 1

[0058] Distance range LOD value A1~A2 LOD1 A2~A3 LOD2 A3~A4 LOD3

[0059] In one possible implementation, once the virtual environment rendering engine obtains the target distance between the current target scene object and the main camera viewport, it can determine the target distance range based on the relationship between the target distance and the candidate distance range. Then, based on the LOD value associated with the target distance range, it can determine the target LOD value corresponding to the current target scene object. For example, if the target distance is within the distance range A1 to A2, then the target LOD value corresponding to the target scene without a map is determined to be LOD1.

[0060] Step 202C: Send the target LOD value to the ray tracing processing engine through the virtual environment rendering engine.

[0061] Once the virtual environment rendering engine determines the target LOD value corresponding to the object in the current scene, it can transmit the target LOD value to the ray tracing engine, which will then perform ray tracing calculations based on the target LOD value.

[0062] Step 202D: Receive the target LOD value through the ray tracing engine.

[0063] The corresponding ray tracing engine receives the target LOD value sent by the virtual environment rendering engine.

[0064] Step 203: Find the target object model of the target scene object that matches the target LOD value from the ray tracing processing engine.

[0065] Since the ray tracing engine pre-stores all target scene information corresponding to the target scene objects, such as storing candidate object models of different levels of detail corresponding to the target scene objects, in one possible implementation, when the ray tracing engine receives the target LOD value, it can search based on the target LOD value to find the candidate LOD value that matches the target LOD value, and determine the candidate object model corresponding to the candidate LOD value as the target object model corresponding to the target scene object. The target object model is the object model of the level of detail required for rendering the target scene without a map.

[0066] Step 204: Based on the target object model, perform ray tracing calculations on the target scene objects using a ray tracing processing engine to obtain the target ray tracing data corresponding to the target scene objects.

[0067] Once the ray tracing engine indexes the target object model that needs ray tracing calculation based on the target LOD value, it can perform ray tracing calculation on the target scene object based on the target object model and other scene resources to obtain the target ray tracing data corresponding to the target scene object.

[0068] Step 205: Send the target ray tracing data to the virtual environment rendering engine through the ray tracing processing engine, so that the virtual environment rendering engine can render the target scene objects based on the target ray tracing data.

[0069] The implementation method of step 205 can refer to step 103, and will not be repeated here in this embodiment.

[0070] In this embodiment, by transmitting all target scene information corresponding to the target scene object to the ray tracing engine in advance, only the target LOD value needs to be transmitted in real time during the subsequent application operation, without the need to transmit other scene information in real time, which can reduce the data transmission cost during the application operation.

[0071] In one possible application scenario, if the LOD value of a target scene object is large, meaning the object has a low level of detail, it indicates that the object is less important in the environment and farther from the main camera's viewport. Consequently, users will pay less attention to it, and even if ray tracing is performed on the object, users may not care whether the image of such an object is realistic. Therefore, to further reduce the computational load of ray tracing, ray tracing can be selectively performed on target scene objects based on their LOD values.

[0072] Please refer to Figure 4 This document illustrates a flowchart of an image rendering method provided in an exemplary embodiment of this application. The embodiment uses the application of this method to a terminal as an example for illustration. The method includes:

[0073] Step 401: Receive the target LOD value sent by the virtual environment rendering engine through the ray tracing processing engine. The target LOD value represents the level of detail of the object model corresponding to the target scene object in the image to be rendered.

[0074] The implementation method of step 401 can be referred to the above embodiment, and will not be repeated here.

[0075] Step 402: If the target LOD value is lower than the LOD threshold, perform ray tracing calculations on the target scene objects based on the target LOD value using the ray tracing processing engine to obtain the target ray tracing data corresponding to the target scene objects.

[0076] To avoid meaningless ray tracing rendering of scene objects with low detail levels, one possible implementation is to set a Level of Detail (LOD) threshold. Ray tracing rendering is then performed only on scene objects with high detail levels, excluding those with low detail levels. When the ray tracing engine receives a target LOD value, it compares the target LOD value with the LOD threshold. If the target LOD value is lower than the threshold, it indicates that the target scene object has a high level of detail and requires ray tracing rendering. The ray tracing engine then indexes the corresponding target object model based on the target LOD value and performs ray tracing calculations on the target scene object to obtain the target ray tracing data.

[0077] Optionally, to balance terminal operating status and rendering effect, for example, if the terminal load is low, to further improve the rendering effect, the selective ray tracing rendering process can be skipped, and ray tracing rendering of the target scene objects can be performed in real time. In one possible implementation, the ray tracing processing engine can obtain the current terminal operating status in real time. If the terminal operating status meets the target operating conditions, it indicates that the terminal operating status is good, and there is no need to save ray tracing computation. The ray tracing processing engine can directly perform ray tracing calculations on the target scene objects based on the target LOD value to obtain the target ray tracing data corresponding to the target scene objects.

[0078] Optionally, if the terminal's operating state does not meet the target operating conditions, it indicates a poor terminal operating state. In this case, unnecessary ray tracing rendering can be avoided, preventing further processing pressure on the terminal. In one possible implementation, when the ray tracing engine determines that the terminal's operating state does not meet the target operating conditions, indicating a poor terminal operating state and requiring a reduction in ray tracing computation, the ray tracing engine can compare the target LOD value with the LOD threshold and selectively perform ray tracing calculations. That is, ray tracing calculations are only performed on the target scene objects based on the target LOD value when the target LOD value is lower than the LOD threshold.

[0079] The terminal operating status may include at least one of terminal temperature, terminal load, and terminal battery level. The corresponding target operating conditions may be: terminal temperature below a temperature threshold, terminal load below a load threshold, and terminal battery level above a battery level threshold.

[0080] Taking terminal temperature as an example of terminal operating status, if the terminal temperature is below the temperature threshold, the target operating conditions are met, indicating that the terminal is currently operating well and there are no background programs with high computational load. In this case, ray tracing rendering can be performed in real time based on the target LOD value. Conversely, if the terminal temperature is above the temperature threshold, the target operating conditions are not met, indicating that there are background programs with high computational load running on the terminal. In this case, in order to avoid increasing the ray tracing computation load on the terminal, the ray tracing processing engine can perform selective ray tracing computation based on the target LOD value.

[0081] Taking the terminal's operating status as the terminal load as an example, if the terminal load is lower than the load threshold and meets the target operating conditions, ray tracing rendering can be performed in real time based on the target LOD value; conversely, if the terminal load is higher than the load threshold and does not meet the target operating conditions, selective ray tracing calculations will be performed based on the target LOD value in order to avoid increasing the terminal load.

[0082] Taking the terminal's operating status as the terminal's battery level as an example, if the terminal's battery level is higher than the battery threshold and meets the target operating conditions, it means that the terminal's current battery level is sufficient to support a large amount of ray tracing computation, and ray tracing rendering can be performed in real time based on the target LOD value. Conversely, if the terminal's battery level is lower than the battery threshold and does not meet the target operating conditions, it means that the terminal's current battery level is low and cannot support a large amount of ray tracing computation. In order to avoid putting too much pressure on the terminal's battery level, the ray tracing processing engine can perform selective ray tracing computation based on the target LOD value.

[0083] Optionally, in practical applications, at least one of the terminal's operating states can be selected as the basis for determining whether to execute step 402. For example, if at least one of the terminal's operating states meets the target operating conditions, then the step of performing ray tracing calculations on the target scene objects based on the target LOD value using the ray tracing processing engine is executed; if none of the terminal's operating states meet the target operating conditions, then step 402 is executed.

[0084] Optionally, it can also be set that if all running states in the terminal's running state meet the target running conditions, then the step of performing ray tracing calculations on the target scene objects based on the target LOD value through the ray tracing processing engine can be executed; if there is a running state in the terminal's running state that does not meet the target running conditions, then step 402 can be executed.

[0085] Step 403: If the target LOD value is higher than the LOD threshold, stop performing ray tracing calculations on the target scene objects through the ray tracing processing engine.

[0086] Optionally, if the target LOD value is higher than the LOD threshold, it means that the level of detail of the current target scene object is low. In order to save ray tracing calculations, it is not necessary to perform ray tracing calculations on the target scene object.

[0087] Optionally, when the ray tracing engine does not perform ray tracing calculations on the target scene objects, it can return an empty value to the virtual environment rendering engine so that the virtual environment rendering engine can render the image based on its own output rendering parameters.

[0088] Optionally, in other possible implementations, to avoid unnecessary LOD value transmission, when the virtual environment rendering engine determines that the target LOD value is higher than the LOD threshold, it may not be necessary to send the target LOD value to the ray tracing processing engine, and the corresponding ray tracing processing engine will not need to perform ray tracing calculations on the target scene objects.

[0089] Step 404: Send the target ray tracing data to the virtual environment rendering engine through the ray tracing processing engine, so that the virtual environment rendering engine can render the target scene objects based on the target ray tracing data.

[0090] The implementation method of step 404 can be referred to the above embodiment, and will not be repeated here.

[0091] In this embodiment, by comparing the target LOD value with the LOD threshold, ray tracing rendering of the target scene objects is only performed when the target LOD value is lower than the LOD threshold. This avoids meaningless ray tracing rendering of scene objects with low detail levels. By selectively performing ray tracing rendering, the computational load can be reduced while ensuring image rendering quality. Furthermore, by comparing the current running state of the terminal with the target running conditions, it can be determined whether to selectively perform ray tracing rendering. Ray tracing rendering can be performed indiscriminately when the terminal's running state is good, improving image rendering quality; or it can be selectively performed when the terminal's running state is poor, avoiding increasing the terminal's processing load.

[0092] In other possible implementations, when performing ray tracing calculations on scene objects, different ray tracing calculation precisions can be set based on different LOD values, thereby reducing the amount of ray tracing calculations while achieving ray tracing calculations on scene objects at different levels of detail.

[0093] Please refer to Figure 5 This document illustrates a flowchart of an image rendering method provided in an exemplary embodiment of this application. The embodiment uses the application of this method to a terminal as an example for illustration. The method includes:

[0094] Step 501: Receive the target LOD value sent by the virtual environment rendering engine through the ray tracing processing engine. The target LOD value represents the level of detail of the object model corresponding to the target scene object in the image to be rendered.

[0095] The implementation method of step 501 can be referred to the above embodiment, and will not be repeated here.

[0096] Step 502: Determine the target ray tracing calculation accuracy based on the target LOD value and the relationship between the second target. The second target relationship indicates the relationship between the LOD value and the ray tracing calculation accuracy, and the LOD value and the ray tracing calculation accuracy are negatively correlated.

[0097] The ray tracing engine establishes a correspondence between Level of Detail (LOD) values ​​and ray tracing precision. A higher LOD value indicates a lower level of detail in the scene objects, corresponding to lower ray tracing precision; conversely, a lower LOD value indicates a higher level of detail in the scene objects, corresponding to higher ray tracing precision. In one possible implementation, after the ray tracing engine obtains the target LOD value, it can search for a matching ray tracing precision based on the relationship between the target LOD value and a second target, and then select the appropriate ray tracing precision for ray tracing calculation.

[0098] Optionally, the higher the precision of ray tracing calculations, the greater the corresponding computational load.

[0099] Optionally, the ray tracing calculation precision can indicate the number of facets of the object model participating in the ray tracing calculation. The higher the ray tracing calculation precision, the more facets of the object model participating in the ray tracing calculation for the same scene.

[0100] Optionally, if the LOD value is low, you can set it to perform ray tracing calculations on all faces of the target scene object; if the LOD value is high, you can set it to perform ray tracing calculations only on some faces of the target scene object.

[0101] Step 503: Based on the target ray tracing calculation accuracy, perform ray tracing calculations on the target scene objects through the ray tracing processing engine to obtain the target ray tracing data corresponding to the target scene objects.

[0102] In one possible implementation, once the target ray tracing calculation precision is determined, the ray tracing processing engine can perform ray tracing calculations on the target scene objects according to the ray tracing calculation precision to obtain the target ray tracing data corresponding to the target scene objects.

[0103] Step 504: Send the target ray tracing data to the virtual environment rendering engine through the ray tracing processing engine, so that the virtual environment rendering engine can render the target scene objects based on the target ray tracing data.

[0104] The implementation method of step 504 can be referred to the above embodiment, and will not be repeated here.

[0105] In this embodiment, the ray tracing calculation precision is selected based on the target LOD value. This allows for differentiated ray tracing calculations for all scene objects while reducing the amount of ray tracing calculations for scene objects with lower detail levels.

[0106] Please refer to Figure 6 This document illustrates a complete image rendering flowchart according to an exemplary embodiment of this application. The method includes:

[0107] Step 601: In the initial stage of the application, the virtual environment rendering engine transmits all scene information to the ray tracing processing engine.

[0108] Step 602: The ray tracing engine receives and stores all scene information.

[0109] Step 603: During the application runtime phase, the virtual environment rendering engine calculates the distance between scene objects and the camera viewport in real time and determines the LOD value of the scene objects.

[0110] Step 604: The virtual environment rendering engine sends the LOD value to the ray tracing processing engine in real time.

[0111] Step 605: The ray tracing engine receives the LOD value sent by the virtual environment rendering engine.

[0112] Step 606: The ray tracing processing engine searches for matching object models and other scene information from all pre-stored scene information based on the LOD value, and performs ray tracing calculations based on the object models and other scene information to obtain ray tracing data.

[0113] Step 607: The ray tracing engine sends the ray tracing data to the virtual environment rendering engine.

[0114] Step 608: The virtual environment rendering engine receives the ray tracing data sent by the ray tracing processing engine and performs image rendering based on the ray tracing data.

[0115] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0116] Please refer to Figure 7 This diagram illustrates a structural block diagram of an image rendering apparatus provided in one embodiment of this application. The functions can be implemented in hardware or by hardware executing corresponding software. Figure 7 As shown, the device may include:

[0117] The receiving module 701 is used to receive the target LOD value sent by the virtual environment rendering engine through the ray tracing processing engine. The target LOD value represents the level of detail of the object model corresponding to the target scene object in the image to be rendered.

[0118] The ray tracing calculation module 702 is used to perform ray tracing calculations on the target scene object based on the target LOD value through the ray tracing processing engine to obtain the target ray tracing data corresponding to the target scene object.

[0119] The first sending module 703 is used to send the target ray tracing data to the virtual environment rendering engine through the ray tracing processing engine, so that the virtual environment rendering engine renders the target scene object based on the target ray tracing data.

[0120] Optionally, the ray tracing calculation module 702 is further configured to:

[0121] The target object model of the target scene object that matches the target LOD value is found from the ray tracing processing engine;

[0122] Based on the target object model, the ray tracing processing engine performs ray tracing calculations on the target scene object to obtain the target ray tracing data corresponding to the target scene object.

[0123] Optionally, the device further includes:

[0124] The second sending module is used to send the target scene information of the target scene object to the ray tracing processing engine through the virtual environment rendering engine. The target scene information includes at least one candidate object model corresponding to the target scene object, the candidate LOD value corresponding to the candidate object model, and the light source information.

[0125] The ray tracing computing module 702 is also used for:

[0126] The ray tracing engine searches for candidate LOD values ​​that match the target LOD value, and determines the candidate object model corresponding to the candidate LOD value as the target object model corresponding to the target scene object.

[0127] Optionally, the receiving module 701 is further configured to:

[0128] During application operation, the virtual environment rendering engine obtains the target distance between the target scene object and the target camera viewport in real time.

[0129] Based on the target distance and the first target relationship, the target LOD value corresponding to the target scene object is determined, and the first target relationship indicates the correspondence between the distance range and the LOD value;

[0130] The target LOD value is sent to the ray tracing processing engine through the virtual environment rendering engine;

[0131] The target LOD value is received through the ray tracing processing engine.

[0132] Optionally, the ray tracing calculation module 702 is further configured to:

[0133] If the target LOD value is lower than the LOD threshold, the ray tracing engine performs ray tracing calculations on the target scene object based on the target LOD value to obtain the target ray tracing data corresponding to the target scene object.

[0134] Optionally, the device further includes:

[0135] The stop processing module is used to stop ray tracing calculations on the target scene objects through the ray tracing processing engine when the target LOD value is higher than the LOD threshold.

[0136] Optionally, the device further includes:

[0137] The acquisition module is used to acquire the current terminal operating status of the terminal, which includes at least one of the following: terminal temperature, terminal load, and terminal battery level.

[0138] The ray tracing calculation module 702 is further configured to, when the terminal running state meets the target running conditions, perform a step of performing ray tracing calculation on the target scene object based on the target LOD value through the ray tracing processing engine to obtain the target ray tracing data corresponding to the target scene object;

[0139] The ray tracing calculation module 702 is further configured to, when the terminal's operating state does not meet the target operating conditions, perform the following steps: when the target LOD value is lower than the LOD threshold, perform ray tracing calculations on the target scene object based on the target LOD value using the ray tracing processing engine to obtain the target ray tracing data corresponding to the target scene object.

[0140] Optionally, the device further includes:

[0141] The stop sending module is used to stop sending the target LOD value to the ray tracing processing engine when the virtual environment rendering engine determines that the target LOD value is higher than the LOD threshold.

[0142] Optionally, the ray tracing calculation module 702 is further configured to:

[0143] Based on the target LOD value and the relationship between the second target, the target ray tracing calculation accuracy is determined. The second target relationship indicates the relationship between the LOD value and the ray tracing calculation accuracy, and the LOD value and the ray tracing calculation accuracy are negatively correlated.

[0144] Based on the target ray tracing calculation accuracy, the ray tracing processing engine performs ray tracing calculations on the target scene objects to obtain the target ray tracing data corresponding to the target scene objects.

[0145] In summary, in this embodiment, by additionally setting up a ray tracing processing engine in the terminal, the ray tracing processing engine performs ray tracing rendering, providing ray tracing rendering effects. This allows for ray tracing rendering effects to be provided for 3D images even when the virtual environment rendering engine lacks ray tracing rendering capabilities. Furthermore, it allows for the optimization of the virtual environment rendering engine's image rendering capabilities by upgrading and developing the ray tracing processing engine without modifying or understanding its internal code. In addition, by transmitting the target LOD value of the object to be rendered in the virtual environment rendering engine to the ray tracing processing engine in real time, and having the ray tracing processing engine perform ray tracing calculations based on the target LOD value, the target ray tracing data calculated by the ray tracing processing engine can meet the current level of detail requirements of the target scene object, improving the accuracy of ray tracing calculations.

[0146] It should be noted that the above embodiments of the apparatus are only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0147] Please refer to Figure 8 This diagram illustrates a structural block diagram of a terminal 800 provided in an exemplary embodiment of this application. The terminal 800 in this application may include one or more components such as a virtual environment rendering engine 801 and a ray tracing processing engine 802.

[0148] The virtual environment rendering engine 801 is responsible for rendering images of the application screen. In this embodiment, the virtual environment rendering engine 801 can send all scene information to the ray tracing processing engine 802 at the initial stage of the application, and the ray tracing processing engine 802 is responsible for the ray tracing rendering of each scene object in the application screen. Optionally, the virtual environment rendering engine 801 also needs to determine the LOD value of the scene objects in real time during the application runtime and transmit the LOD value to the ray tracing processing engine 802 so that the ray tracing processing engine can perform ray tracing rendering based on the LOD value. Optionally, the virtual environment rendering engine 801 will also receive ray tracing data fed back by the ray tracing processing engine 802 so as to perform image rendering based on the ray tracing data.

[0149] The ray tracing processing engine 802 is responsible for ray tracing rendering of scene objects in the image. In this embodiment, the ray tracing processing engine 802 receives and stores all scene information sent by the virtual environment rendering engine 801 during the initial stage of the application; during the application runtime stage, the ray tracing processing engine 802 can receive the LOD value sent by the virtual environment rendering engine 801, perform ray tracing calculations based on the LOD value to obtain ray tracing data, and feed the ray tracing data back to the virtual environment rendering engine 801.

[0150] Optionally, the virtual environment rendering engine 801 and the ray tracing processing engine 802 can be integrated on the same processor of the terminal 800, or they can be integrated on different processors of the terminal 800 respectively. This application embodiment does not constitute a limitation in this regard.

[0151] Optionally, the terminal 800 further includes a memory, which may include random access memory (RAM) or read-only memory (ROM). Optionally, the memory includes a non-transitory computer-readable storage medium. The memory can be used to store instructions, programs, code, code sets, or instruction sets. The memory 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 implementing at least one function, instructions for implementing the various method embodiments described above, etc.

[0152] 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 terminal may include more or fewer components than shown, or combine certain components, or have different component arrangements. For example, the terminal 800 may also include a touch screen, sensors, a Wireless Fidelity (WiFi) component, a power supply, a Bluetooth component, etc., which will not be described in detail here.

[0153] This application also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the image rendering method provided in any of the above exemplary embodiments.

[0154] This application provides a computer program product including computer instructions stored in a computer-readable storage medium. A terminal's processor reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the printing device to perform the image rendering method provided in the optional implementation described above.

[0155] It should be understood that "multiple" as used herein refers to 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, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this.

[0156] The above description is merely an optional embodiment of this application and is 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. An image rendering method, characterized in that, The method is applied to a terminal, the terminal including a virtual environment rendering engine and a ray tracing processing engine, the method comprising: The virtual environment rendering engine sends the target scene information of the target scene object to the ray tracing processing engine. The target scene information includes at least one candidate object model corresponding to the target scene object, the candidate LOD value corresponding to the candidate object model, and the light source information. The ray tracing processing engine receives the target LOD value sent by the virtual environment rendering engine, where the target LOD value represents the level of detail of the object model corresponding to the target scene object in the image to be rendered. The current operating status of the terminal is obtained, and the terminal operating status includes at least one of the following: terminal temperature, terminal load, and terminal battery level. When the terminal's operating state meets the target operating conditions, the following steps are performed: based on the target LOD value, the ray tracing processing engine performs ray tracing calculations on the target scene object to obtain the target ray tracing data corresponding to the target scene object. These steps include: searching for candidate LOD values ​​matching the target LOD value from the ray tracing processing engine, and determining the candidate object model corresponding to the candidate LOD value as the target object model corresponding to the target scene object; based on the target object model, the ray tracing processing engine performs ray tracing calculations on the target scene object to obtain the target ray tracing data corresponding to the target scene object. If the terminal's operating state does not meet the target operating conditions, the following steps are performed: if the target LOD value is lower than the LOD threshold, the target scene object is subjected to ray tracing calculations by the ray tracing processing engine based on the target LOD value to obtain the target ray tracing data corresponding to the target scene object. The ray tracing processing engine sends the target ray tracing data to the virtual environment rendering engine, so that the virtual environment rendering engine renders the target scene object based on the target ray tracing data.

2. The method according to claim 1, characterized in that, The step of receiving the target LOD value sent by the virtual environment rendering engine through the ray tracing processing engine includes: During application operation, the virtual environment rendering engine obtains the target distance between the target scene object and the target camera viewport in real time. Based on the target distance and the first target relationship, the target LOD value corresponding to the target scene object is determined, and the first target relationship indicates the correspondence between the distance range and the LOD value; The target LOD value is sent to the ray tracing processing engine through the virtual environment rendering engine; The target LOD value is received through the ray tracing processing engine.

3. The method according to claim 1, characterized in that, The method further includes: If the target LOD value is higher than the LOD threshold, stop performing ray tracing calculations on the target scene objects through the ray tracing processing engine.

4. The method according to claim 1, characterized in that, The method further includes: If the virtual environment rendering engine determines that the target LOD value is higher than the LOD threshold, it stops sending the target LOD value to the ray tracing processing engine.

5. The method according to claim 1, characterized in that, The method further includes: Based on the target LOD value and the relationship between the second target, the target ray tracing calculation accuracy is determined. The second target relationship indicates the relationship between the LOD value and the ray tracing calculation accuracy, and the LOD value and the ray tracing calculation accuracy are negatively correlated. Based on the target ray tracing calculation accuracy, the ray tracing processing engine performs ray tracing calculations on the target scene objects to obtain the target ray tracing data corresponding to the target scene objects.

6. An image rendering apparatus, characterized in that, The device is applied to a terminal, the terminal including a virtual environment rendering engine and a ray tracing processing engine, and the device includes: The second sending module is used to send the target scene information of the target scene object to the ray tracing processing engine through the virtual environment rendering engine. The target scene information includes at least one candidate object model corresponding to the target scene object, the candidate LOD value corresponding to the candidate object model, and light source information. The receiving module is used to receive the target LOD value sent by the virtual environment rendering engine through the ray tracing processing engine. The target LOD value represents the level of detail of the object model corresponding to the target scene object in the image to be rendered. The acquisition module is used to acquire the current terminal operating status of the terminal, which includes at least one of the following: terminal temperature, terminal load, and terminal battery level. The ray tracing calculation module is used to, when the terminal's operating state meets the target operating conditions, execute the following steps: based on the target LOD value, perform ray tracing calculations on the target scene object through the ray tracing processing engine to obtain target ray tracing data corresponding to the target scene object. The steps include: searching for candidate LOD values ​​matching the target LOD value from the ray tracing processing engine, and determining the candidate object model corresponding to the candidate LOD value as the target object model corresponding to the target scene object; based on the target object model, performing ray tracing calculations on the target scene object through the ray tracing processing engine to obtain target ray tracing data corresponding to the target scene object. If the terminal's operating state does not meet the target operating conditions, the following steps are performed: if the target LOD value is lower than the LOD threshold, the target scene object is subjected to ray tracing calculations by the ray tracing processing engine based on the target LOD value to obtain the target ray tracing data corresponding to the target scene object. The first sending module is used to send the target ray tracing data to the virtual environment rendering engine through the ray tracing processing engine, so that the virtual environment rendering engine renders the target scene object based on the target ray tracing data.

7. A terminal, characterized in that, The terminal includes a processor and a memory, the memory storing at least one instruction, the at least one instruction being loaded and executed by the processor to implement the image rendering method as described in any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one piece of program code, which is loaded and executed by a processor to implement the image rendering method as described in any one of claims 1 to 5.

9. A computer program product or computer program, characterized in that, The computer program product or computer program includes computer instructions stored in a computer-readable storage medium, and a processor reads from and executes the computer instructions to implement the image rendering method as described in any one of claims 1 to 5.