Fusion rendering method, device, computer device, and storage medium
By independently rendering in multiple rendering engines and using camera feature information for projection transformation processing, the problem of low rendering efficiency of multiple rendering engines is solved, and efficient rendering result fusion is achieved.
Patent Information
- Application Number
- CN202111678821.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2041-12-31
AI Technical Summary
In the prior art, the fusion rendering efficiency of multiple three-dimensional rendering engines is low, and traditional methods require complicated porting operations to lead to a long fusion cycle.
By acquiring the first virtual canvas and the second virtual canvas, it is used for rendering of local scenes and macro scenes, and the projection coordinate transformation process is performed using camera feature information to realize the integration of independent rendering results of multiple rendering engines.
Reduces the complexity between rendering engines, improves the efficiency of fusion rendering, and does not require complicated porting operations, achieving the mutual fusion effect of multiple rendering engines.
Smart Images

Figure CN114429511B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of 3D rendering, and in particular, to a fusion rendering method, apparatus, computer device, storage medium, and computer program product. Background Art
[0002] With the application and development of the WebGL technology (Web Graphics Library, a 3D drawing protocol), more and more 3D GIS platforms (Geo-Information system) have emerged. Each platform has its own advantages, but the platforms are independent of each other and cannot be well integrated to play a role.
[0003] Currently, it is difficult to achieve the fusion of 3D rendering engines using traditional methods. It is necessary to evaluate the complexity of mutual transplantation for multiple rendering engines, which involves a wide range of technical details and is difficult to implement. Moreover, complex transplantation will lead to too long a fusion cycle.
[0004] Therefore, there is a problem of low fusion rendering efficiency for multiple 3D rendering engines in the related art. Summary of the Invention
[0005] Based on this, it is necessary to provide a fusion rendering method, apparatus, computer device, storage medium, and computer program product that can solve the above problems for the above technical problems.
[0006] In a first aspect, the present application provides a fusion rendering method, and the method includes:
[0007] Obtain a first virtual canvas and a second virtual canvas; the first virtual canvas is used to render a partial scene in a target scene according to a first rendering engine, the second virtual canvas is used to render a macro scene in the target scene according to a second rendering engine, and the first virtual canvas and the second virtual canvas are independent of each other and have an associated position relationship;
[0008] Determine first camera feature information according to the rendering result of the partial scene corresponding to the first virtual canvas;
[0009] Perform projection coordinate transformation processing based on the first camera feature information to obtain second camera feature information, and determine the rendering result of the macro scene corresponding to the second virtual canvas according to the second camera feature information;
[0010] Fuse the rendering result of the partial scene and the rendering result of the macro scene to obtain a fused scene rendering result for the first rendering engine and the second rendering engine.
[0011] In one embodiment, the obtaining of the first virtual canvas and the second virtual canvas includes:
[0012] In a preset rendering page, respectively construct a first virtual canvas based on the first rendering engine and a second virtual canvas based on the second rendering engine; the first virtual canvas is located at an upper layer position of the second virtual canvas.
[0013] In one embodiment, after the step of respectively constructing the first virtual canvas based on the first rendering engine and the second virtual canvas based on the second rendering engine, it further includes:
[0014] For the second virtual canvas, configure the loading image and terrain data corresponding to the macro scene;
[0015] Adjust the rendering loop function of the second rendering engine to a closed state.
[0016] In one embodiment, the determining of the first camera feature information according to the local scene rendering result corresponding to the first virtual canvas includes:
[0017] Based on the first virtual canvas, slice the initial point cloud data corresponding to the local scene according to the preset data processing information of the first rendering engine, and perform rendering according to the slicing result to obtain a point cloud data rendering result as the local scene rendering result;
[0018] According to the local scene rendering result, obtain the camera position parameter, specified direction data, and camera focus point corresponding to the local scene as the first camera feature information.
[0019] In one embodiment, the performing of projection coordinate transformation processing based on the first camera feature information to obtain the second camera feature information includes:
[0020] Obtain the point cloud projection coordinate system information based on the first virtual canvas and the second virtual canvas;
[0021] According to the point cloud projection coordinate system information, transform the first camera feature information corresponding to the local scene to obtain the second camera feature information corresponding to the macro scene.
[0022] In one embodiment, the determining of the macro scene rendering result corresponding to the second virtual canvas according to the second camera feature information includes:
[0023] Update the second camera feature information to the second rendering engine;
[0024] Based on the second virtual canvas, render the macro scene according to the second camera feature information to obtain the rendered result of the macro scene.
[0025] In a second aspect, the present application further provides a fusion rendering device, which includes:
[0026] A virtual canvas acquisition module, configured to acquire a first virtual canvas and a second virtual canvas; the first virtual canvas is used to render a local scene in a target scene according to a first rendering engine, and the second virtual canvas is used to render the macro scene in the target scene according to a second rendering engine, and the first virtual canvas and the second virtual canvas are independent of each other and have an associated positional relationship;
[0027] A local scene rendering module, configured to determine first camera feature information according to the rendered result of the local scene corresponding to the first virtual canvas;
[0028] A macro scene rendering module, configured to perform projection coordinate transformation processing based on the first camera feature information to obtain second camera feature information, and determine the rendered result of the macro scene corresponding to the second virtual canvas according to the second camera feature information;
[0029] A fusion rendering module, configured to perform fusion processing on the rendered result of the local scene and the rendered result of the macro scene to obtain a fused scene rendering result for the first rendering engine and the second rendering engine.
[0030] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps of the above-mentioned fusion rendering method are implemented.
[0031] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned fusion rendering method are implemented.
[0032] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned fusion rendering method are implemented.
[0033] The above-mentioned method, apparatus, computer device, storage medium, and computer program product for integrated rendering obtain a first virtual canvas and a second virtual canvas. The first virtual canvas is used to render a partial scene in a target scene according to a first rendering engine, and the second virtual canvas is used to render a macroscopic scene in the target scene according to a second rendering engine. The first virtual canvas and the second virtual canvas are independent of each other and have an associated positional relationship. Then, based on the rendering result of the partial scene corresponding to the first virtual canvas, the first camera feature information is determined, and projection coordinate transformation processing is performed based on the first camera feature information to obtain the second camera feature information. According to the second camera feature information, the rendering result of the macroscopic scene corresponding to the second virtual canvas is determined. Furthermore, the rendering result of the partial scene and the rendering result of the macroscopic scene are integrated to obtain an integrated scene rendering result for the first rendering engine and the second rendering engine, achieving the optimization of integrated rendering for multiple rendering engines. By performing transformation processing in different rendering engines according to the camera feature information on the basis of independent rendering by each rendering engine, and then integrating the separately obtained scene rendering results, the effect of mutual integration of multiple rendering engines can be achieved, without complicated transplantation operations, reducing complexity and improving the efficiency of integrated rendering. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a schematic flowchart of a method for integrated rendering in an embodiment;
[0035] Figure 2 It is a schematic diagram of an integrated rendering processing flow in an embodiment;
[0036] Figure 3 It is a schematic flowchart of another method for integrated rendering in an embodiment;
[0037] Figure 4 It is a structural block diagram of an apparatus for integrated rendering in an embodiment;
[0038] Figure 5 It is an internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0039] In order to make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0040] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties; correspondingly, this application also provides a corresponding user authorization entry for the user to choose to authorize or choose to refuse.
[0041] In one embodiment, as Figure 1 shown, a fusion rendering method is provided. In this embodiment, this method is exemplified by being applied to a terminal. It can be understood that this method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0042] Step 101, obtain a first virtual canvas and a second virtual canvas; the first virtual canvas is used to render a local scene in a target scene according to a first rendering engine, the second virtual canvas is used to render a macro scene in the target scene according to a second rendering engine, and the first virtual canvas and the second virtual canvas are independent of each other and have an associated position relationship;
[0043] Among them, the first virtual canvas and the second virtual canvas can be two independent virtual canvases in a BS system rendering page. For example, two independent and superimposed canvases can be used in the BS system rendering page.
[0044] As an example, the first rendering engine can be the three-dimensional rendering engine Potree based on WebGL, and the second rendering engine can be the three-dimensional rendering engine Cesium based on WebGL. Through heterogeneous WebGL three-dimensional rendering engines, the target scene can be fused and rendered, that is, multiple three-dimensional scenes can be fused based on the local scene and the macro scene in the target scene. Among them, Potree based on the graphics library Three.js is mainly used to render the laser point cloud data in a small scene (i.e., the local scene). Compared with the point cloud rendered by Cesium, through the conversion of point cloud data, the rendered picture is more beautiful and efficient, and it is a WebGL-based point cloud data visualization solution; Cesium is mainly used to render a large scene (i.e., the macro scene), and it can provide the visualization of the global terrain and high-definition images from a macro perspective, such as displaying a three-dimensional earth and map, displaying three-dimensional model data, image data, terrain elevation data, vector data, etc.
[0045] In practical applications, a first virtual canvas and a second virtual canvas that are independent of each other and have an associated positional relationship can be adopted in the BS system rendering page. The first virtual canvas can be used to render a partial scene in the target scene according to a first rendering engine, and the second virtual canvas can be used to render a macroscopic scene in the target scene according to a second rendering engine.
[0046] Specifically, since the rendering effect is poor and the scheduling is slow when using Cesium to render point cloud data, the advantages of large scenes and small scenes can be compatible. By adopting the three-dimensional rendering engines Potree and Cesium based on WebGL, large scenes and small scenes can be seamlessly integrated in the platform, so that the content of small scenes can be displayed in large scenes.
[0047] For example, in the process of fusing multiple three-dimensional scenes based on the WebGL system, for large scenes, based on the three-dimensional rendering engine Cesium, the visualization of basic geographic information data can be provided, such as macroscopic earth data such as image terrain, etc., and for small scenes, based on the three-dimensional rendering engine Potree, the visualization of three-dimensional point cloud data can be provided to render local data scenes.
[0048] Step 102, determine first camera feature information according to the rendering result of the partial scene corresponding to the first virtual canvas;
[0049] Among them, the first camera feature information can be relevant data parameters of the camera in the partial scene, such as the position parameters of the camera in the small scene, the up direction, and the focus point of the camera, etc., which are not specifically limited in this embodiment.
[0050] In a specific implementation, based on the first virtual canvas, the point cloud data can be rendered through the first rendering engine to obtain a rendering result of the partial scene, and the relevant data parameters of the camera in the partial scene can be obtained according to the rendering result of the partial scene as the first camera feature information.
[0051] In an example, during the rendering loop, the point cloud data in the three-dimensional rendering engine Potree can be rendered, and then based on the rendered small scene, the relevant data parameters such as the position parameters of the camera in the small scene, the up direction, and the focus point of the camera (i.e., the first camera feature information) can be obtained.
[0052] Step 103, perform projection coordinate transformation processing based on the first camera feature information to obtain second camera feature information, and determine the rendering result of the macroscopic scene corresponding to the second virtual canvas according to the second camera feature information;
[0053] Among them, the second camera feature information can be relevant data parameters of the camera in the macroscopic scene, such as the camera parameter information in the large scene.
[0054] After obtaining the first camera feature information, projection coordinate transformation processing can be performed based on the first camera feature information. Furthermore, the second camera feature information can be obtained, and based on the second virtual canvas, rendering can be performed by the second rendering engine according to the second camera feature information to obtain a macroscopic scene rendering result.
[0055] For example, for the camera parameters in the small scene (i.e., the first camera feature information), transformation can be performed according to the point cloud projection coordinate system to obtain the camera parameters in the large scene of the 3D rendering engine Cesium (i.e., the second camera feature information). Furthermore, it can be updated to Cesium to further render the scene in Cesium according to the obtained camera parameters.
[0056] Step 104: Perform fusion processing on the local scene rendering result and the macroscopic scene rendering result to obtain a fusion scene rendering result for the first rendering engine and the second rendering engine.
[0057] In practical applications, the separately rendered local scene rendering result and macroscopic scene rendering result can be subjected to fusion processing. Furthermore, a fusion scene rendering result for the first rendering engine and the second rendering engine can be obtained, that is, the effect of mutual fusion of multiple rendering engines is achieved.
[0058] Compared with the traditional method of transplantation in multiple rendering engines, it is necessary to have a good understanding of multiple rendering engines and evaluate the complexity of mutual transplantation at the same time to determine the transplantation from one rendering engine to another, and the transplantation difficulty is large. The technical solution of this embodiment, on the basis of keeping the original rendering engines independent of each other, performs conversion according to the scene camera viewport in different rendering engines, and then superimposes the separately rendered images, without the need for transplantation in multiple rendering engines, and can easily achieve the effect of mutual fusion of multiple rendering engines.
[0059] In the above fusion rendering method, by obtaining the first virtual canvas and the second virtual canvas, then determining the first camera feature information according to the local scene rendering result corresponding to the first virtual canvas, performing projection coordinate transformation processing based on the first camera feature information to obtain the second camera feature information, and determining the macroscopic scene rendering result corresponding to the second virtual canvas according to the second camera feature information. Furthermore, performing fusion processing on the local scene rendering result and the macroscopic scene rendering result to obtain a fusion scene rendering result for the first rendering engine and the second rendering engine, the optimization of fusion rendering for multiple rendering engines is realized. By performing rendering independently in each rendering engine and performing transformation processing according to the camera feature information in different rendering engines, and then fusing the separately obtained scene rendering results, the effect of mutual fusion of multiple rendering engines can be achieved, without complicated transplantation operations, reducing the complexity and improving the fusion rendering efficiency.
[0060] In one embodiment, the obtaining of the first virtual canvas and the second virtual canvas may include the following steps:
[0061] In a preset rendering page, respectively construct a first virtual canvas based on the first rendering engine and a second virtual canvas based on the second rendering engine; the first virtual canvas is located at an upper position of the second virtual canvas.
[0062] In practical applications, in a preset rendering page, such as a BS system rendering page, a first virtual canvas based on the first rendering engine and a second virtual canvas based on the second rendering engine can be respectively constructed, and the first virtual canvas can be located at an upper position of the second virtual canvas.
[0063] For example, in a BS system rendering page, two independent and superimposed canvases (i.e., the first virtual canvas and the second virtual canvas) can be added to respectively render the 3D rendering engine Cesium and the 3D rendering engine Potree. The canvas can be an element in HTML5, which can be used to provide developers with a series of graphics drawn on the canvas, and the canvas for rendering a large scene can be located below, and the canvas for rendering a small scene can be located above, that is, the first virtual canvas is located at an upper position of the second virtual canvas.
[0064] In an alternative embodiment, when constructing the first virtual canvas based on the first rendering engine, for a large scene, based on the 3D rendering engine Cesium, the visualization of basic geographic information data, such as earth macro data like imagery terrain, can be provided to render a macro data scene; when constructing the second virtual canvas based on the second rendering engine, for a small scene, based on the 3D rendering engine Potree, the visualization of 3D point cloud data can be provided to render a local data scene.
[0065] In this embodiment, by respectively constructing a first virtual canvas based on the first rendering engine and a second virtual canvas based on the second rendering engine in a preset rendering page, multiple canvases can be independently constructed in the BS system rendering page, providing data support for subsequent fusion of multiple 3D scenes.
[0066] In one embodiment, after the step of respectively constructing a first virtual canvas based on the first rendering engine and a second virtual canvas based on the second rendering engine, the following steps may be included:
[0067] For the second virtual canvas, configure the loaded imagery and terrain data corresponding to the macro scene; adjust the rendering loop function of the second rendering engine to a closed state.
[0068] In a specific implementation, during the rendering of a large scene based on the 3D rendering engine Cesium, for the second virtual canvas, the loading images and terrain data corresponding to the macroscopic scene can be configured, and the rendering loop function of the second rendering engine can be adjusted to the closed state. For example, the Cesium large scene can be independently initialized, and then the loading images and terrain data for the rendering configuration of the large scene (i.e., the macroscopic scene) can be set, and the default rendering loop function of Cesium (i.e., the second rendering engine) can be turned off.
[0069] In one example, in the lower-layer canvas of the rendering page, the large scene can be rendered using the 3D rendering engine Cesium, and the default rendering loop function of the 3D rendering engine Cesium can be turned off to facilitate further compositing rendering processing.
[0070] In this embodiment, by configuring the loading images and terrain data corresponding to the macroscopic scene for the second virtual canvas, and then adjusting the rendering loop function of the second rendering engine to the closed state, Cesium can be rendered based on the lower-layer canvas of the rendering page, providing data support for further compositing rendering processing.
[0071] In one embodiment, determining the first camera feature information according to the rendering result of the local scene corresponding to the first virtual canvas may include the following steps:
[0072] Based on the first virtual canvas, slice the initial point cloud data corresponding to the local scene according to the preset data processing information of the first rendering engine, and perform rendering according to the slicing result to obtain the point cloud data rendering result as the rendering result of the local scene; according to the rendering result of the local scene, obtain the camera position parameters, specified direction data, and camera focus point corresponding to the local scene as the first camera feature information.
[0073] As an example, the initial point cloud data can be point cloud LAS file data, which is a type of point cloud file. The LAS file is a binary file obtained according to multiple point cloud specification types and can include point cloud specifications, point cloud point data, etc.
[0074] In practical applications, during the rendering of a small scene based on the 3D rendering engine Potree, based on the first virtual canvas, the initial point cloud data can be sliced according to the preset data processing information of the first rendering engine, and then based on the slicing result, the point cloud data can be independently rendered in the first rendering engine to obtain the point cloud data rendering result as the rendering result of the local scene.
[0075] For example, slice the point cloud LAS file data according to the data rules of the 3D rendering engine Potree (i.e., the preset data processing information), so as to further render the small scene in the upper canvas of the rendering page using the 3D rendering engine Potree.
[0076] In one example, during the rendering loop, based on the point cloud data obtained by slicing the point cloud LAS file data (i.e., the initial point cloud data), the point cloud data can be independently rendered in the 3D rendering engine Potree. Furthermore, the camera position, up direction, and view point in Potree (i.e., the camera position parameters, specified direction data, and camera focus point) can be obtained for projection coordinate transformation, so as to further calculate the camera parameters in Cesium.
[0077] In this embodiment, by slicing the initial point cloud data corresponding to the local scene based on the first virtual canvas according to the preset data processing information of the first rendering engine, and rendering according to the slicing result to obtain the point cloud data rendering result as the local scene rendering result. Then, based on the local scene rendering result, the camera position parameters, specified direction data, and camera focus point corresponding to the local scene are obtained as the first camera feature information. Based on the camera feature information in Potree, further conversion processing can be performed according to the scene camera viewport in different rendering engines, improving the fusion rendering efficiency.
[0078] In one embodiment, the projection coordinate transformation process based on the first camera feature information to obtain the second camera feature information may include the following steps:
[0079] Obtain the point cloud projection coordinate system information based on the first virtual canvas and the second virtual canvas; according to the point cloud projection coordinate system information, transform the first camera feature information corresponding to the local scene to obtain the second camera feature information corresponding to the macro scene.
[0080] In one example, based on the obtained camera position, up direction, and view point in the 3D rendering engine Potree (i.e., the first camera feature information), projection coordinate transformation can be performed, and then the camera parameters in the 3D rendering engine Cesium (i.e., the second camera feature information) can be calculated to further render the macro scene in Cesium according to the obtained camera parameters.
[0081] In this embodiment, by obtaining the point cloud projection coordinate system information based on the first virtual canvas and the second virtual canvas, and then transforming the first camera feature information corresponding to the local scene according to the point cloud projection coordinate system information to obtain the second camera feature information corresponding to the macro scene, it is possible to perform conversion processing based on the camera feature information in Potree to obtain the camera feature information in Cesium according to the scene camera viewport in different rendering engines, reducing the complexity and being easy to implement.
[0082] In one embodiment, determining the macro scene rendering result corresponding to the second virtual canvas according to the second camera feature information may include the following steps:
[0083] Update the second camera feature information to the second rendering engine; based on the second virtual canvas, render the macro scene according to the second camera feature information to obtain the macro scene rendering result.
[0084] In practical applications, the camera parameters (i.e., the second camera feature information) in the three-dimensional rendering engine Cesium obtained can be updated to Cesium, and then the scene in Cesium can be rendered according to the obtained camera parameters, that is, the macro scene is rendered to obtain the macro scene rendering result.
[0085] In this embodiment, by updating the second camera feature information to the second rendering engine, and then based on the second virtual canvas, rendering the macro scene according to the second camera feature information to obtain the macro scene rendering result, it is possible to ensure the respective rendering efficiency and normal rendering effect for multiple rendering engines through independent rendering processing.
[0086] To enable those skilled in the art to better understand the above steps, the following Figure 2 Exemplarily illustrate the embodiments of the present application through an example, but it should be understood that the embodiments of the present application are not limited thereto.
[0087] 1. By adding two independent and superimposed canvases (i.e., the first virtual canvas and the second virtual canvas) to the rendering page of the BS system;
[0088] 2. Cesium (i.e., the second rendering engine) can be rendered in the lower canvas (i.e., the second virtual canvas), and the default rendering loop of Cesium can be turned off; the point cloud LAS file data can be sliced, and then Potree (i.e., the first rendering engine) can be rendered in the upper canvas (i.e., the first virtual canvas);
[0089] 3. After the rendering loop starts, the point cloud data can be independently rendered in the three-dimensional rendering engine Potree to obtain the local scene rendering result;
[0090] 4. By obtaining the camera position, up direction, and view point in Potree (i.e., the first camera feature information) and performing projection coordinate transformation, the camera parameters in Cesium (i.e., the second camera feature information) can be calculated.
[0091] 5. The obtained camera parameters in the 3D rendering engine Cesium (i.e., the second camera feature information) can be updated to Cesium, and then the data in the large Cesium scene (i.e., the macroscopic scene) can be rendered based on the obtained camera parameters.
[0092] 6. It can be determined whether to continue rendering to determine whether the rendering loop process ends.
[0093] In the technical solution of this embodiment, since rendering can be independently performed for multiple rendering engines without much concern about the implementation of each rendering engine, the complexity is greatly reduced, and only the basic usage of each rendering engine needs to be mastered. Moreover, independent rendering based on each rendering engine can ensure the normal rendering efficiency and effect of each rendering engine. By ensuring correct calculation results for the camera parameters in different rendering engines, the effect of integrating multiple rendering engines can be achieved. From the implementation level, it is easy to implement and has low risks.
[0094] In one embodiment, as Figure 3 shown, a flowchart of another method for integrated rendering is provided. In this embodiment, the method includes the following steps:
[0095] In step 301, in a preset rendering page, a first virtual canvas based on the first rendering engine and a second virtual canvas based on the second rendering engine are respectively constructed; the first virtual canvas is located at an upper position of the second virtual canvas. In step 302, for the second virtual canvas, loading images and terrain data corresponding to the macro scene are configured. In step 303, the rendering loop function of the second rendering engine is adjusted to an off state. In step 304, based on the first virtual canvas, according to the preset data processing information of the first rendering engine, the initial point cloud data corresponding to the local scene is sliced, and rendered according to the slicing result to obtain a point cloud data rendering result as the local scene rendering result. In step 305, according to the local scene rendering result, the camera position parameters, specified direction data, and camera focus point corresponding to the local scene are obtained as the first camera feature information. In step 306, projection coordinate transformation processing is performed based on the first camera feature information to obtain second camera feature information. In step 307, the second camera feature information is updated to the second rendering engine. In step 308, based on the second virtual canvas, the macro scene is rendered according to the second camera feature information to obtain the macro scene rendering result. In step 309, the local scene rendering result and the macro scene rendering result are fused to obtain a fused scene rendering result for the first rendering engine and the second rendering engine. It should be noted that the specific limitations of the above steps can be referred to the specific limitations of a fusion rendering method described above, which will not be elaborated here.
[0096] It should be understood that although each step in the flowcharts involved in the above-described embodiments is displayed sequentially according to the indication of the arrows, these steps are not necessarily executed sequentially according to the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limitation, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.
[0097] Based on the same inventive concept, an embodiment of the present application further provides a fusion rendering device for implementing the above-mentioned fusion rendering method. The implementation solution provided by the device for solving the problem is similar to the implementation solution described in the above method. Therefore, the specific limitations in one or more embodiments of the fusion rendering device provided below can be referred to the limitations of the fusion rendering method described above, which will not be elaborated here.
[0098] In one embodiment, as Figure 4 shown, a fusion rendering device is provided, including:
[0099] A virtual canvas acquisition module 401, configured to acquire a first virtual canvas and a second virtual canvas; the first virtual canvas is used to render a local scene in a target scene according to a first rendering engine, and the second virtual canvas is used to render a macro scene in the target scene according to a second rendering engine, and the first virtual canvas and the second virtual canvas are independent of each other and have an associated positional relationship;
[0100] A local scene rendering module 402, configured to determine first camera feature information according to a local scene rendering result corresponding to the first virtual canvas;
[0101] A macro scene rendering module 403, configured to perform projection coordinate transformation processing based on the first camera feature information to obtain second camera feature information, and determine a macro scene rendering result corresponding to the second virtual canvas according to the second camera feature information;
[0102] A fusion rendering module 404, configured to perform fusion processing on the local scene rendering result and the macro scene rendering result to obtain a fusion scene rendering result for the first rendering engine and the second rendering engine.
[0103] In one embodiment, the virtual canvas acquisition module 401 includes:
[0104] A virtual canvas construction sub-module, configured to respectively construct a first virtual canvas based on the first rendering engine and a second virtual canvas based on the second rendering engine in a preset rendering page; the first virtual canvas is located at an upper layer position of the second virtual canvas.
[0105] In one embodiment, the device further includes:
[0106] A macro data configuration module, configured to configure a loaded image and terrain data corresponding to the macro scene for the second virtual canvas;
[0107] A rendering loop closing module, configured to adjust a rendering loop function of the second rendering engine to a closed state.
[0108] In one embodiment, the local scene rendering module 402 includes:
[0109] The slicing processing sub-module is used to perform slicing processing on the initial point cloud data corresponding to the local scene based on the first virtual canvas according to the preset data processing information of the first rendering engine, and perform rendering according to the slicing result to obtain a point cloud data rendering result as the local scene rendering result;
[0110] The first camera feature information acquisition sub-module is used to obtain the camera position parameters, specified direction data, and camera focus point corresponding to the local scene according to the local scene rendering result as the first camera feature information.
[0111] In one embodiment, the macro scene rendering module 403 includes:
[0112] The projection coordinate system determination sub-module is used to obtain the point cloud projection coordinate system information based on the first virtual canvas and the second virtual canvas;
[0113] The second camera feature information obtaining sub-module is used to transform the first camera feature information corresponding to the local scene according to the point cloud projection coordinate system information to obtain the second camera feature information corresponding to the macro scene.
[0114] In one embodiment, the macro scene rendering module 403 includes:
[0115] The machine feature information update sub-module is used to update the second camera feature information to the second rendering engine;
[0116] The macro scene rendering result obtaining sub-module is used to render the macro scene based on the second virtual canvas according to the second camera feature information to obtain the macro scene rendering result.
[0117] Each module in the above fusion rendering device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or be stored in the memory of the computer device in software form so that the processor can call and execute the operations corresponding to the above modules.
[0118] In one embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 5As shown in the figure. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a fusion rendering method.
[0119] Those skilled in the art can understand that Figure 5 the structure shown in the figure is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0120] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0121] Obtain a first virtual canvas and a second virtual canvas; the first virtual canvas is used to render a local scene in a target scene according to a first rendering engine, and the second virtual canvas is used to render a macro scene in the target scene according to a second rendering engine. The first virtual canvas and the second virtual canvas are independent of each other and have an associated position relationship;
[0122] Determine first camera feature information according to the rendering result of the local scene corresponding to the first virtual canvas;
[0123] Perform projection coordinate transformation processing based on the first camera feature information to obtain second camera feature information, and determine the rendering result of the macro scene corresponding to the second virtual canvas according to the second camera feature information;
[0124] Fuse the rendering result of the local scene and the rendering result of the macro scene to obtain a fused scene rendering result for the first rendering engine and the second rendering engine.
[0125] In one embodiment, when the processor executes the computer program, it also implements the steps of the fusion rendering method in the above-mentioned other embodiments.
[0126] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0127] Obtain a first virtual canvas and a second virtual canvas; the first virtual canvas is used to render a partial scene in a target scene according to a first rendering engine, and the second virtual canvas is used to render a macroscopic scene in the target scene according to a second rendering engine. The first virtual canvas and the second virtual canvas are independent of each other and have an associated positional relationship;
[0128] Determine first camera feature information according to the rendering result of the partial scene corresponding to the first virtual canvas;
[0129] Perform projection coordinate transformation processing based on the first camera feature information to obtain second camera feature information, and determine the rendering result of the macroscopic scene corresponding to the second virtual canvas according to the second camera feature information;
[0130] Fuse the rendering result of the partial scene and the rendering result of the macroscopic scene to obtain a fused scene rendering result for the first rendering engine and the second rendering engine.
[0131] In one embodiment, when the computer program is executed by a processor, the steps of the fusion rendering method in the above other embodiments are also implemented.
[0132] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the following steps are implemented:
[0133] Obtain a first virtual canvas and a second virtual canvas; the first virtual canvas is used to render a partial scene in a target scene according to a first rendering engine, and the second virtual canvas is used to render a macroscopic scene in the target scene according to a second rendering engine. The first virtual canvas and the second virtual canvas are independent of each other and have an associated positional relationship;
[0134] Determine first camera feature information according to the rendering result of the partial scene corresponding to the first virtual canvas;
[0135] Perform projection coordinate transformation processing based on the first camera feature information to obtain second camera feature information, and determine the rendering result of the macroscopic scene corresponding to the second virtual canvas according to the second camera feature information;
[0136] Fuse the rendering result of the partial scene and the rendering result of the macroscopic scene to obtain a fused scene rendering result for the first rendering engine and the second rendering engine.
[0137] In one embodiment, when the computer program is executed by a processor, it also implements the steps of the fusion rendering method in the above-mentioned other embodiments.
[0138] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium provided in the various embodiments of the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random access memories (ReRAMs), magnetoresistive random access memories (MRAMs), ferroelectric random access memories (FRAMs), phase change memories (PCMs), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the various embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the various embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logics, data processing logics based on quantum computing, etc., without limitation.
[0139] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope described in this specification.
[0140] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A fusion rendering method, characterized in that, The method includes: Obtaining a first virtual canvas and a second virtual canvas; the first virtual canvas is used to render a partial scene in a target scene according to a first rendering engine, and the second virtual canvas is used to render a macroscopic scene in the target scene according to a second rendering engine. The first virtual canvas and the second virtual canvas are independent of each other and have an associated positional relationship; Determining first camera feature information according to the rendering result of the partial scene corresponding to the first virtual canvas; including: based on the first virtual canvas, slicing the initial point cloud data corresponding to the partial scene according to the preset data processing information of the first rendering engine, and performing rendering according to the slicing result to obtain a point cloud data rendering result as the rendering result of the partial scene; according to the rendering result of the partial scene, obtaining the camera position parameters, specified direction data, and camera focus point corresponding to the partial scene as the first camera feature information; Performing a projection coordinate transformation process based on the first camera feature information to obtain second camera feature information, and determining the rendering result of the macroscopic scene corresponding to the second virtual canvas according to the second camera feature information; Performing a fusion process on the rendering result of the partial scene and the rendering result of the macroscopic scene to obtain a fusion scene rendering result for the first rendering engine and the second rendering engine.
2. The method according to claim 1, wherein The obtaining of the first virtual canvas and the second virtual canvas includes: In a preset rendering page, respectively constructing a first virtual canvas based on the first rendering engine and a second virtual canvas based on the second rendering engine; the first virtual canvas is located at an upper position of the second virtual canvas.
3. The method according to claim 2, characterized in that, After the step of respectively constructing the first virtual canvas based on the first rendering engine and the second virtual canvas based on the second rendering engine, it further includes: Configuring the loaded images and terrain data corresponding to the macroscopic scene for the second virtual canvas; Adjusting the rendering loop function of the second rendering engine to an off state.
4. The method according to claim 1, wherein The performing a projection coordinate transformation process based on the first camera feature information to obtain second camera feature information includes: Obtaining point cloud projection coordinate system information based on the first virtual canvas and the second virtual canvas; According to the point cloud projection coordinate system information, transforming the first camera feature information corresponding to the partial scene to obtain the second camera feature information corresponding to the macroscopic scene.
5. The method according to any one of claims 1 to 4, characterized in that, The determining the rendering result of the macroscopic scene corresponding to the second virtual canvas according to the second camera feature information includes: Updating the second camera feature information to the second rendering engine; Based on the second virtual canvas, rendering the macroscopic scene according to the second camera feature information to obtain the rendering result of the macroscopic scene.
6. A fusion rendering device, characterized in that, The device includes: A virtual canvas acquisition module for acquiring a first virtual canvas and a second virtual canvas; the first virtual canvas is used to render a local scene in a target scene according to a first rendering engine, and the second virtual canvas is used to render a macro scene in the target scene according to a second rendering engine. The first virtual canvas and the second virtual canvas are independent of each other and have an associated positional relationship; A local scene rendering module for determining first camera feature information according to the local scene rendering result corresponding to the first virtual canvas; A macro scene rendering module for performing projection coordinate transformation processing based on the first camera feature information to obtain second camera feature information, and determining the macro scene rendering result corresponding to the second virtual canvas according to the second camera feature information; A fusion rendering module for performing fusion processing on the local scene rendering result and the macro scene rendering result to obtain a fusion scene rendering result for the first rendering engine and the second rendering engine; Wherein, the local scene rendering module includes: A slicing processing sub-module for slicing the initial point cloud data corresponding to the local scene based on the first virtual canvas according to the preset data processing information of the first rendering engine, and performing rendering according to the slicing result to obtain a point cloud data rendering result as the local scene rendering result; A first camera feature information acquisition sub-module for acquiring the camera position parameters, specified direction data, and camera focus points corresponding to the local scene according to the local scene rendering result as the first camera feature information.
7. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Vector tile loading method in three-dimensional scene
CN112256897A