Rendering method and device, electronic equipment and readable storage medium
By dividing the game scene into plots and building clusters, and setting simplified model parameters based on the distance of the camera position, different proxy meshes and material instances are generated. This solves the problem of high memory usage and excessively large package size of the UE4 engine in large-scale multiplayer online games, and achieves a balance between rendering effects and performance consumption.
Patent Information
- Application Number
- CN202111468685.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-03
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2041-12-03
AI Technical Summary
In existing technologies, the UE4 engine suffers from high memory consumption and excessively large file size in scene rendering of large-scale multiplayer online games, making it unsuitable for direct adaptation and resulting in severe performance consumption.
The game scene is divided into plots and building clusters. Different simplified model parameters are set according to the distance of the camera position to generate different proxy meshes and material instances. Appropriate rendering methods are used to reduce the performance consumption during rendering.
While ensuring rendering quality, it significantly reduces memory usage and performance consumption, improves the gaming experience, and achieves a dynamic balance between performance and efficiency.
Smart Images

Figure CN114119834B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a rendering method and device, electronic equipment and readable storage medium. BACKGROUND
[0002] In an open world game, the scene is getting bigger and bigger, and the memory and rendering performance overhead is very high, especially for mobile games. In the scene, there are a large number of objects at a long distance, which consume a lot, but the effect displayed is not so outstanding.
[0003] In the prior art, for rendering of a large scene, UE4 engine is usually used for rendering, which provides two sets of large world solutions and streaming loading technology, namely LevelStreamingVolume (currently no unified Chinese name in the industry) and World Composition (currently no unified Chinese name in the industry).
[0004] However, the two technologies still have many deficiencies, such as both of them cannot be directly used at the product level, and still need to be combined with many strategies and modified by engine source code; the default solution of UE4 engine still has a relatively large consumption in package and memory, and for a large-scale multiplayer online (MMO) game, it still cannot reach the ideal consumption range, especially the material generation of LevelLOD, which still needs a lot of performance consumption. SUMMARY
[0005] Embodiments of the present application are proposed to overcome or partially overcome the defects of the prior art.
[0006] In a first aspect, a rendering method is provided, comprising:
[0007] receiving a real terrain model according to a scene to be rendered;
[0008] segmenting the scene to be rendered into plots and building communities;
[0009] receiving a simple model parameter of the plot and the building community according to the distance from the camera position;
[0010] generating a combination of a proxy mesh and a material instance corresponding to the plot and the building community respectively according to the real terrain model and the simple model parameter;
[0011] receiving a simple model of a terrain prosthesis of the scene to be rendered, and generating a material and a map of the simple model of the terrain prosthesis according to the material instance.
[0012] In a second aspect, a rendering device is provided, the device comprising:
[0013] a model receiving unit configured to receive a real terrain model of a scene to be rendered;
[0014] a segmentation unit configured to segment the scene to be rendered into plots and building clusters;
[0015] a parameter receiving unit configured to receive simplified model parameters of the plots and the building clusters according to distances from a camera position;
[0016] a generation unit configured to generate combinations of proxy meshes and material instances corresponding to the plots and the building clusters respectively according to the real terrain model and the simplified model parameters;
[0017] a rendering unit configured to receive simplified models of terrain prostheses of the scene to be rendered, and generate materials and maps of the simplified models of the terrain prostheses according to the material instances.
[0018] In a third aspect, an electronic device is provided, including: a processor; and a memory arranged to store computer-executable instructions that, when executed, cause the processor to perform any of the above methods.
[0019] In a fourth aspect, a computer-readable storage medium is provided, storing one or more programs, which, when executed by an electronic device including a plurality of applications, cause the electronic device to perform any of the above methods.
[0020] The above at least one technical solution adopted by the embodiments of the present application can achieve the following beneficial effects:
[0021] The present application divides the scene to be rendered into plots and building cluster levels, receives different rendering parameters set according to distances from a virtual character for each level, and generates corresponding combinations of proxy meshes and material instances according to the rendering parameters. During rendering, for different plots and building clusters, corresponding combinations of proxy meshes and material instances are used for rendering according to distances from a virtual character, so that the memory occupancy and performance overhead are greatly reduced under the premise of ensuring the rendering effect, and the game experience is significantly improved. The present application renders different effects according to distances from terrain or building clusters, that is, the rendering effect is ensured, and the memory occupancy and hardware performance consumption are greatly reduced, achieving a dynamic balance between effect and performance consumption; and the use of material instances instead of materials greatly reduces the size of the package, greatly reduces the memory occupancy rate, and significantly improves the game experience. BRIEF DESCRIPTION OF DRAWINGS
[0022] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
[0023] Figure 1 A flowchart of a rendering method according to an embodiment of the application is shown;
[0024] Figure 2 A flowchart of a rendering method according to another embodiment of the application is shown;
[0025] Figure 3 A structural diagram of a rendering device according to an embodiment of the application is shown;
[0026] Figure 4 A structural diagram of an electronic device according to an embodiment of the application is shown. DETAILED DESCRIPTION
[0027] In order to make the objects, technical solutions and advantages of the application clearer, the technical solutions of the application will be described below in detail with reference to the embodiments of the application and the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of the application, but not all the embodiments of the application. According to the embodiments of the application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the application.
[0028] The technical solutions provided by the embodiments of the application will be described below in detail with reference to the accompanying drawings.
[0029] In the prior art, the UE4 engine is usually used to render the scene of a large world game. However, the UE4 engine is a general-purpose game engine, which is good at first-person shooting (FPS) games. For a large-scale multiplayer online (MMO) game, the loading strategy and scheme cannot be directly adapted. Moreover, there are still big problems in memory and package size. For example, the UE4 engine needs to generate a new proxy model and a material for each detailed level (LevelLOD) by default. The material is not a material instance. When multiple levels need to generate LevelLOD, hundreds of materials will be generated, which will seriously increase the size of the package.
[0030] The idea of the application is to divide the scene according to plots and building communities, so that the staff can set different simple model parameters for each plot or building community at different distances. During rendering, different proxy meshes and material instances are generated according to the different distances between the target virtual character and the plot or building community, so as to achieve the purpose of different rendering means for different distances, and balance the rendering effect and performance consumption.
[0031] Figure 1 A flowchart showing a rendering method according to one embodiment of the present application is shown from Figure 1 It can be seen that the present application at least includes steps S110-S150:
[0032] Step S110: receiving a real terrain model according to a scene to be rendered.
[0033] In the prior art, for the rendering of the game picture of an open world, the UE4 engine is usually used, but since the UE4 engine is a general class game engine, it is good at FPS type games, and its loading strategy and scheme cannot be directly adapted to MMO type games. On the other hand, in the UE4 engine, the problems of high memory occupancy and large package size have not been well solved. For example, the UE4 engine defaults to generating a new proxy model and material for each LevelLOD, and when multiple levels need to generate LevelLOD, a large number of materials will be generated, even hundreds of them, thereby seriously affecting the package size and increasing the performance consumption.
[0034] In view of the above problems, the present application proposes a rendering method, which divides a scene into at least one plot and one building colony, sets different LevelLOD parameters of the plot and the building colony at different distances (the distance between the plot or the building colony and the camera position), and generates proxy models and material instances of the plot and the building colony at different distances, so that different rendering methods are used at different distances, thereby achieving the purpose of saving performance consumption as much as possible under the premise of ensuring rendering effect.
[0035] First, a real terrain model according to a scene to be rendered is received, which is usually formed by a third-party software. The real terrain of the scene in the game is carved by an artist, and needs to be scanned by a 3D modeling software to form a three-dimensional model. Since the three-dimensional model is directly obtained by scanning, the surface of the three-dimensional model has no material and map, which can be understood as white. However, the precision of the three-dimensional model is very high, and the number of surfaces of the model is very large. The three-dimensional model is called a real terrain model.
[0036] In the generation of the real terrain model and the subsequent "modeling" process, Houdini software can be used, Houdini is a three-dimensional computer graphics software, which is designed according to the node mode, Houdini has the interface of the third-party renderer, and the scene can be exported to other rendering engines for rendering. The reason why the application recommends using Houdini software is that the programmatic node programming limit of Houdini software can ensure that the height of each vertex of the terrain model is lower than the real terrain, so that "model penetration" is not caused, and the game player is not brought bad game experience due to the model penetration.
[0037] Step S120: dividing the real terrain model into plots and building communities.
[0038] The division of the original scene is broken, and the scene to be rendered is divided into plots and building communities. It should be noted that in a scene, the plots can be one or more, and usually multiple; the building community can also be one or more, and usually multiple. One plot or one building community can contain one or more independent models.
[0039] For the division of the plot, the application does not make any limitation, such as division according to the plot size, building style, building position, etc.
[0040] Step S130: receiving the simplified model parameters of the plots and the building communities according to the distance from the camera position.
[0041] For the player, the things far away in the field of view cannot be seen in detail, and the things close to the field of view have higher precision and better visual effect. Based on this, the application sets different simplified model parameters for the plots and the buildings according to the distance from the camera position. In the rendering, with the movement of the player position, the dynamic switching of high-precision resources and low-precision resources is realized, so as to save the performance consumption under the premise of ensuring the effect.
[0042] A scene usually includes one or more plots and one or more building communities. Here, taking a plot level as an example, in the prior art, for a plot level, a level simplified model (LevelLOD) needs to be generated. The LevelLOD can be understood as generating a simplified model of all terrains or models in the level. For this simplified model, a material needs to be generated. The UE4 engine defaults to generating a new proxy model and material for each LevelLOD, resulting in a too large package.
[0043] Different from the prior art, in some embodiments of the present application, for a plot, according to different distances from the camera position, it can be divided into close-up, medium shot and long shot, and different rendering parameters are set according to the divided distance range, in some embodiments of the present application, for the close-up plot, the simple model parameter precision thereof can be set to be relatively high, and the same applies to the medium shot plot, the simple model parameter precision thereof can be set to be at a medium level, and for the long shot plot, since people cannot clearly see the details in the long shot, the simple model parameter precision thereof can be set to be at a relatively low level, so as to save performance consumption. That is, for a plot, there are three sets of simple model parameters, respectively corresponding to close-up, medium shot and long shot.
[0044] Among them, the simple model parameter is artificially set, and specifically includes different parameters of the plot and the building community at different distances from the camera position. In some embodiments of the present application, the simple model parameter mainly includes display distance, terrain compression precision, material map size, whether high light is needed, roughness of the map, and the like.
[0045] Step S140: generating a combination of the proxy mesh and the material instance corresponding to the plot and the building community respectively according to the real terrain model and the simple model parameter.
[0046] The proxy mesh can be understood as combining several models into one simple model, the proxy mesh has low surface number, but the material effect thereof is similar to that of the original model, but the performance consumption thereof is small, the package size is significantly reduced, the proxy mesh replaces multiple models with one model, and reduces the CPU DrawCall and the surface number.
[0047] The material instance is an instance of the material, the material instance inherits the material and has the shader logic of the material, but only exposes the adjustable parameter (Param) and shields the ability to edit the shader, the purpose is that when a model needs to modify the parameter, it will not affect other models using the material. And when the logic of the material is updated, all material instances will be updated. The present application uses the material instance to replace the material of the prior art, reduces the number of variants (shader), the package size is reduced, and the effect is the same as using the master material of the prior art.
[0048] Taking a plot as an example, according to the simple model parameter thereof, a combination of the proxy mesh and the material instance corresponding to the plot is generated, for example, a plot has three sets of simple model parameters corresponding to close-up, medium shot and long shot, three sets of combinations of the proxy mesh and the material instance corresponding to the plot are generated, which also correspond to close-up, medium shot and long shot respectively. In a rendering process, the three sets of combinations of the proxy mesh and the material instance are not used at the same time, and only one of them needs to be called and used.
[0049] Similarly, for the building colony level, the processing procedure is consistent with the above-mentioned plot level. For a building colony level, according to different distances between the building colony and the camera position, the proxy mesh parameters set at different distances are received, and according to the proxy mesh parameters, the combination of the proxy mesh and the material instance of the building colony level at different distances is generated. For a building colony, the combination of the proxy mesh and the material instance at close-up, medium shot, and long shot can also be included.
[0050] For the generation of the proxy mesh, simplification can be performed on the real model according to the proxy mesh parameters, mainly reflected in the reduction of the number of faces and the reduction of the volume. According to different precision proxy mesh parameters, proxy meshes of different precision can be obtained.
[0051] For the material instance, it can be understood that it integrates multiple materials into one material instance. The material types in the material instance are inherited from the material. For a proxy mesh, using ordinary material rendering will cause recompilation every time the modification is made, which is not efficient for development. The material instance allows editing any property in the detail panel, checking the checkbox next to the parameter name, which enables the option, and then the texture or scalar value or any parameter to be adjusted can be adjusted.
[0052] After obtaining the proxy mesh and the material instance, a "modeling" process is usually needed. The process can be realized by the aforementioned Houdini software. After the rendering engine or the rendering device according to the present application generates the proxy mesh and the material instance, a file in a specified format, such as an FPX file, can be output. The FPX file is imported into Houdini to generate a simplified model of the terrain prosthesis. This process can be understood as "modeling" to generate a simplified model of the terrain prosthesis, which is then imported into the rendering engine or the rendering device according to the present application.
[0053] The simplified model of the terrain prosthesis can be understood as the fusion of the proxy mesh of each plot and the proxy mesh of each building colony.
[0054] Step S150: receiving the simplified model of the terrain prosthesis of the scene to be rendered, and generating the material and map of the simplified model of the terrain prosthesis according to the material instance.
[0055] Finally, the simplified model of the terrain prosthesis of the scene to be rendered is received, and the simplified model of the terrain prosthesis is rendered according to the material instance, i.e. the material and map of the simplified model of the terrain prosthesis are generated. For a static material instance, it can be dragged to the corresponding proxy mesh.
[0056] By Figure 1It can be seen from the method that the application divides the scene to be rendered into multiple levels of plots and building communities, receives different rendering parameters set according to the distance from the virtual character for each level, and generates a combination of the corresponding proxy mesh and material instance according to the rendering parameters. During rendering, for different plots and building communities, a corresponding proxy mesh and material instance combination is used for rendering according to the distance from the virtual character, thereby realizing a great reduction in memory occupation and performance overhead while ensuring rendering effect, and significantly improving the game experience. The application renders different effects according to the distance of the terrain or building community, that is, it ensures the rendering effect and greatly reduces the memory occupation and hardware performance consumption, achieving a dynamic balance between effect and performance consumption; and the use of material instances instead of materials greatly reduces the size of the package, greatly reduces the memory occupation rate, and significantly improves the game experience.
[0057] In some embodiments of the application, the receiving of the simple model parameters of the plots and the building communities according to the distance from the camera position comprises: determining a first distance of a target plot from the camera position; if the first distance is in a close-up distance range, receiving a first simple model parameter of the target plot, wherein the first simple model parameter is a real terrain simple model parameter; if the first distance is in a medium shot distance range, receiving a second simple model parameter of the target plot, wherein the second simple model parameter is a plot level simple model parameter; and if the first distance is in a long shot distance range, receiving a third simple model parameter of the target plot, wherein the third simple model parameter is a terrain prosthesis simple model parameter.
[0058] One plot is usually composed of multiple models, for the plot, the application usually adopts one simple model to replace several or all models in the plot, and the skilled person sets the simple model parameters of the plot level at different distances to generate the corresponding proxy grid and material instance of the plot at different distances, so as to realize rendering with different accuracy at different distances. The rendering effect requirement of close-up is higher than that of long shot, so when setting the rendering parameters, the accuracy of the parameters of the close-up plot is higher than that of the medium shot and the long shot. In the application, the real terrain simple model can be understood as the highest accuracy simple model, and the real terrain model can be directly used when the requirement is relatively high; the accuracy of the plot level simple model is lower than that of the real terrain simple model, and the plot level can be understood as replacing several or all models in the plot with one simple model, and the number of faces of the plot level simple model is less than that of the real terrain simple model; the accuracy of the terrain prosthesis simple model is lower than that of the plot level simple model, and in some embodiments of the application, the terrain prosthesis simple model is a static grid body, such as a cone for a mountain. That is, for the plot, when the distance between the plot and the camera position belongs to the close-up range, the simple model parameters of the plot are required to reach the standard of the real terrain; when the distance between the plot and the camera position belongs to the medium shot range, the simple model parameters of the plot are required to reach the requirements of the plot level simple model; when the distance between the plot and the camera position belongs to the long shot range, the simple model parameters of the plot are required to reach the requirements of the terrain prosthesis.
[0059] In some embodiments of the application, the receiving of the simple model parameters of the plot and the building colony according to the distance from the camera position further comprises: determining a second distance between a target building colony and the camera position; if the second distance is in the close-up distance range, receiving fourth simple model parameters of the target building colony, wherein the fourth simple model parameters are single body simple model parameters; if the second distance is in the medium shot distance range, receiving fifth simple model parameters of the target building colony, wherein the fifth simple model parameters are region simple model parameters; if the second distance is in the long shot distance range, receiving sixth simple model parameters of the target building colony, wherein the sixth simple model parameters are building level simple model parameters.
[0060] Similarly, for the building colony, the simple model parameters set at different distances from the camera position are also different. In some embodiments of the application, since the virtual character in the game may approach or enter one or more buildings in the building colony, in some cases, the rendering effect requirement of the building colony level is higher than that of the plot, so in general, the accuracy of the modeling parameters of the building colony can be set higher.
[0061] In the present application, for the building community, the precision of the single model (LOD) is the highest, which can be understood as generating a single building model, rendering, and requiring higher details. When setting its parameters, the LOD level can be set higher. The precision of the regional model (HLOD) is lower than that of the single model, but higher than that of the building checkpoint model (LelvelLOD). The precision of the building checkpoint model is equivalent to that of the plot checkpoint model. The regional model (HLOD) can also be understood as further adjustment based on the building checkpoint model (LelvelLOD). Instead of dynamically simplifying individual models, proxy models are generated in clusters to achieve further optimization, that is, several models in the building community are combined into a single model. The rendering effect is better than that of the checkpoint model (LelvelLOD), and compared with the single model (LOD), the complexity of the scene model is greatly reduced, and DrawCall can also be reduced by setting.
[0062] That is, for the building community, when its distance from the camera position belongs to the close-up range, the model parameters of the building community are required to reach the standard of the single model; when its distance from the camera position belongs to the medium shot range, the model parameters of the building community are required to reach the requirement of the regional model (HLOD); when its distance from the camera position belongs to the long shot range, the model parameters of the plot are required to reach the requirement of the checkpoint model (LelvelLOD).
[0063] It should be noted that the close-up distance range, the medium shot distance range and the long shot distance range can also be set by humans. Workers can set them according to experience and expected rendering effect; and for the three ranges, the plot and the building can be the same or different.
[0064] In some embodiments of the present application, the generating the combination of the proxy mesh and the material instance corresponding to the plot and the building colony respectively according to the real terrain model and the simple model parameter further comprises: for a plot, if the received simple model parameter is the first simple model parameter, simplifying the real terrain model of the plot according to the real terrain simple model parameter to obtain a real terrain simple model as the proxy mesh corresponding to the plot, and determining the material instance corresponding to the plot according to the first simple model parameter; if the received simple model parameter is the second simple model parameter, simplifying the real terrain model of the plot according to the plot checkpoint simple model parameter to obtain a plot checkpoint simple model as the proxy mesh corresponding to the plot, and determining the material instance corresponding to the plot according to the second simple model parameter; if the received simple model parameter is the third simple model parameter, simplifying the real terrain model of the plot according to the terrain prosthesis simple model parameter to obtain a terrain prosthesis simple model as the proxy mesh corresponding to the plot, and determining the material instance corresponding to the plot according to the third simple model parameter.
[0065] During rendering, the combination of the proxy mesh and the material instance triggered for a plot is different due to the different distances from the camera position. If the received simple model parameter is the real terrain simple model parameter according to the distance from the camera position, it indicates that the plot is in the close-up range, and the real terrain model is simplified according to the real terrain simple model parameter to obtain the proxy mesh of the real terrain simple model and the corresponding material instance. Similarly, if the received simple model parameter is the plot checkpoint simple model parameter according to the distance from the camera position, it indicates that the plot is in the medium shot range, and the real terrain model is simplified according to the plot checkpoint simple model parameter to obtain the proxy mesh of the plot checkpoint simple model and the corresponding material instance. If the received simple model parameter is the terrain prosthesis simple model parameter according to the distance from the camera position, it indicates that the plot is in the long shot range, and the real terrain model is simplified according to the terrain prosthesis simple model parameter to obtain the proxy mesh of the terrain prosthesis simple model and the corresponding material instance.
[0066] In some embodiments of the present application, the generating, according to the real terrain model and the simple model parameters, the combination of the agent grid and the material instance corresponding to the land block and the building colony respectively further comprises: for a building colony, if the received simple model parameter is the fourth simple model parameter, simplifying each building in the real terrain model of the building colony according to the single building simple model parameter to obtain a single building simple model as the agent grid corresponding to the building colony, and determining the material instance corresponding to the building colony according to the fourth simple model parameter; if the received simple model parameter is the fifth simple model parameter, grouping and simplifying multiple buildings in the real terrain model of the building colony according to the region simple model parameter to obtain a region simple model as the agent grid corresponding to the building colony, and determining the material instance corresponding to the building colony according to the fifth simple model parameter; if the received simple model parameter is the sixth simple model parameter, simplifying the real terrain model of the building colony according to the building level parameter to obtain a building level simple model as the agent grid corresponding to the building colony, and determining the material instance corresponding to the building colony according to the sixth simple model parameter.
[0067] During rendering, the combination of the agent grid and the material instance triggered for a building colony is different due to the different distances from the camera position. If the received simple model parameter is the single building simple model parameter according to the distance from the camera position, it indicates that the building colony is in the close-up range. At this time, the real terrain model is simplified according to the single building simple model parameter. In some embodiments, the real terrain model can be directly used to obtain the agent grid of the single building simple model and the corresponding material instance. If the received simple model parameter is the region simple model parameter according to the distance from the camera position, it indicates that the building colony is in the medium shot range. At this time, the real terrain model is grouped and simplified according to the region simple model parameter to obtain the agent grid of the region simple model and the corresponding material instance. If the received simple model parameter is the building level simple model parameter according to the distance from the camera position, it indicates that the land block is in the long shot range. At this time, the real terrain model is simplified according to the building level simple model parameter to obtain the agent grid of the building level simple model and the corresponding material instance.
[0068] In some embodiments of the present application, the receiving the simple model of the terrain prosthesis of the scene to be rendered and generating the material and map of the simple model of the terrain prosthesis according to the material instance comprises: receiving the simple model of the terrain prosthesis, wherein the simple model of the terrain prosthesis is obtained by fusing the agent grids of the land block and the building colony based on Houdini software; and generating the material and map of the simple model of the terrain prosthesis according to the material instance of the land block and the material instance of the building colony.
[0069] The received simplified model of the terrain proxy of the scene to be rendered is a whole model, but the precision of different patches and different building colony proxy grids is different, each proxy grid has a corresponding material instance, and the simplified model of the terrain proxy of the scene to be rendered is directly rendered according to the material instance, that is, the material and map of the simplified model of the terrain proxy of the scene to be rendered are generated. For example, for a static material instance, it can be directly dragged and dropped onto the simplified model of the terrain proxy, and for a dynamic material instance, the parameters are dynamically set by a blueprint node to render the simplified model.
[0070] Figure 2 A schematic diagram of a rendering method according to another embodiment of the application is shown, from Figure 2 It can be seen that in the embodiment, the real terrain model of the scene to be rendered is divided into patch A, patch B, building colony C and building colony D.
[0071] For patch A, a simplified model parameter A1 is set for patch A in a close-up view, the simplified model parameter A1 is a real terrain simplified model parameter; a simplified model parameter A2 is set for patch A in a medium view, the simplified model parameter A2 is a patch checkpoint simplified model parameter; a simplified model parameter A3 is set for patch A in a long shot, the simplified model parameter A3 is a terrain proxy simplified model parameter. Similarly, for patch B, a simplified model parameter B1, a simplified model parameter B2 and a simplified model parameter B3 are set for patch B, corresponding to a close-up view, a medium view and a long shot respectively, the simplified model parameter B1 is a real terrain simplified model parameter, the simplified model parameter B2 is a patch checkpoint simplified model parameter, and the simplified model parameter B3 is a terrain proxy simplified model parameter.
[0072] For building colony C, a simplified model parameter C1 is set for building colony C in a close-up view, wherein the simplified model parameter C1 is a single building simplified model parameter; a simplified model parameter C2 is set for building colony C in a medium view, the simplified model parameter C2 is a region simplified model parameter; a simplified model parameter C3 is set for building colony C in a long shot, the simplified model parameter C3 is a building checkpoint simplified model parameter; similarly, for building colony D, a simplified model parameter D1, a simplified model parameter D2 and a simplified model parameter D3 are set for building colony D, corresponding to a close-up view, a medium view and a long shot respectively, wherein the simplified model parameter D1 is a single building simplified model parameter, the simplified model parameter D2 is a region simplified model parameter, and the simplified model parameter D3 is a building checkpoint simplified model parameter.
[0073] According to the simplified model parameter A1, a combination of a first proxy grid and a first material instance of a close-up view of patch A is generated, wherein the first proxy grid corresponds to a real terrain simplified model; according to the simplified model parameter A2, a combination of a second proxy grid and a second material instance of a medium view of patch A is generated, wherein the second proxy grid corresponds to a patch checkpoint simplified model; and according to the simplified model parameter A3, a combination of a third proxy grid and a third material instance of a long shot of patch A is generated, wherein the third proxy grid corresponds to a terrain proxy simplified model.
[0074] Similarly, a combination of a fourth proxy mesh and a fourth material instance for the close view of plot B is generated according to the plot parameter B1, wherein the fourth proxy mesh corresponds to the real terrain template; a combination of a fifth proxy mesh and a fifth material instance for the mid view of plot B is generated according to the plot parameter B2, wherein the fifth proxy mesh corresponds to the plot key template; a combination of a sixth proxy mesh and a sixth material instance for the far view of plot B is generated according to the plot parameter B3, wherein the sixth proxy mesh corresponds to the terrain prosthesis template.
[0075] Similarly, a combination of a fourth proxy mesh and a fourth material instance for the close view of plot B is generated according to the plot parameter B1, wherein the fourth proxy mesh corresponds to the real terrain template; a combination of a fifth proxy mesh and a fifth material instance for the mid view of plot B is generated according to the plot parameter B2, wherein the fifth proxy mesh corresponds to the plot key template; a combination of a sixth proxy mesh and a sixth material instance for the far view of plot B is generated according to the plot parameter B3, wherein the sixth proxy mesh corresponds to the terrain prosthesis template.
[0076] Similarly, a combination of a fourth proxy mesh and a fourth material instance for the close view of plot B is generated according to the plot parameter B1, wherein the fourth proxy mesh corresponds to the real terrain template; a combination of a fifth proxy mesh and a fifth material instance for the mid view of plot B is generated according to the plot parameter B2, wherein the fifth proxy mesh corresponds to the plot key template; a combination of a sixth proxy mesh and a sixth material instance for the far view of plot B is generated according to the plot parameter B3, wherein the sixth proxy mesh corresponds to the terrain prosthesis template.
[0077] Similarly, a combination of a fourth proxy mesh and a fourth material instance for the close view of plot B is generated according to the plot parameter B1, wherein the fourth proxy mesh corresponds to the real terrain template; a combination of a fifth proxy mesh and a fifth material instance for the mid view of plot B is generated according to the plot parameter B2, wherein the fifth proxy mesh corresponds to the plot key template; a combination of a sixth proxy mesh and a sixth material instance for the far view of plot B is generated according to the plot parameter B3, wherein the sixth proxy mesh corresponds to the terrain prosthesis template.
[0078] The Houdini software receives the simplified model of the terrain prosthesis of the to-be-rendered scene generated according to the determined proxy mesh and material instance, and renders the corresponding proxy mesh according to each material instance. In this embodiment, in the rendered scene obtained, the close view is the real terrain simplified model of plot A and the single building simplified model of building colony C; the middle view is the region simplified model of building colony D; and the far view is the terrain prosthesis simplified model of plot B.
[0079] The above embodiment is only illustrative. In practice, through the combination of multiple plots and building colonies, the close view terrain is the real terrain simplified model and the building colony single building simplified model (LOD), the middle view is the terrain level simplified model (LevelLOD) and the building colony region simplified model (HLOD), and the far view is the terrain terrain prosthesis simplified model and the building colony level simplified model (LevelLOD).
[0080] Figure 3 A structural schematic diagram of a rendering device according to one embodiment of the present application is shown. From Figure 3 It can be seen that the device 300 comprises:
[0081] A model receiving unit 310 is configured to receive a real terrain model of a to-be-rendered scene;
[0082] A segmentation unit 320 is configured to segment the to-be-rendered scene into plots and building colonies;
[0083] A parameter receiving unit 330 is configured to receive simplified model parameters of the plots and the building colonies according to distances from a camera position;
[0084] A generation unit 340 is configured to generate combinations of proxy meshes and material instances corresponding to the plots and the building colonies, respectively, according to the real terrain model and the simplified model parameters;
[0085] A rendering unit 350 is configured to receive a simplified model of a terrain prosthesis of the to-be-rendered scene, and generate materials and textures of the simplified model of the terrain prosthesis according to the material instances.
[0086] In some embodiments of the present application, the parameter receiving unit 330 is configured to determine a first distance from a target plot to a camera position; if the first distance is within a close view distance range, receive a first simplified model parameter of the target plot, wherein the first simplified model parameter is a real terrain simplified model parameter; if the first distance is within a middle view distance range, receive a second simplified model parameter of the target plot, wherein the second simplified model parameter is a plot level simplified model parameter; and if the first distance is within a far view distance range, receive a third simplified model parameter of the target plot, wherein the third simplified model parameter is a terrain prosthesis simplified model parameter.
[0087] In some embodiments of the present application, the parameter receiving unit 330 is further configured to determine a second distance between the target building colony and the camera position; if the second distance is within a close distance range, receive a fourth simplified model parameter of the target building colony, wherein the fourth simplified model parameter is a single building simplified model parameter; if the second distance is within a medium distance range, receive a fifth simplified model parameter of the target building colony, wherein the fifth simplified model parameter is a region simplified model parameter; and if the second distance is within a long distance range, receive a sixth simplified model parameter of the target building colony, wherein the sixth simplified model parameter is a building checkpoint simplified model parameter.
[0088] In some embodiments of the present application, the generating unit 340 is configured to, for a plot, if the received simplified model parameter is the first simplified model parameter, simplify a real terrain model of the plot according to the real terrain simplified model parameter to obtain a real terrain simplified model as a proxy mesh corresponding to the plot, and determine a material instance corresponding to the plot according to the first simplified model parameter; if the received simplified model parameter is the second simplified model parameter, simplify the real terrain model of the plot according to the plot checkpoint simplified model parameter to obtain a plot checkpoint simplified model as a proxy mesh corresponding to the plot, and determine a material instance corresponding to the plot according to the second simplified model parameter; and if the received simplified model parameter is the third simplified model parameter, simplify the real terrain model of the plot according to the terrain prosthesis simplified model parameter to obtain a terrain prosthesis simplified model as a proxy mesh corresponding to the plot, and determine a material instance corresponding to the plot according to the third simplified model parameter.
[0089] In some embodiments of the present application, the generating unit 340 is further configured to, for a building colony, if the received simplified model parameter is the fourth simplified model parameter, simplify each building in a real terrain model of the building colony according to the single building simplified model parameter to obtain a single building simplified model as a proxy mesh corresponding to the building colony, and determine a material instance corresponding to the building colony according to the fourth simplified model parameter; if the received simplified model parameter is the fifth simplified model parameter, group and simplify a plurality of buildings in the real terrain model of the building colony according to the region simplified model parameter to obtain a region simplified model as a proxy mesh corresponding to the building colony, and determine a material instance corresponding to the building colony according to the fifth simplified model parameter; and if the received simplified model parameter is the sixth simplified model parameter, simplify the real terrain model of the building colony according to the building checkpoint parameter to obtain a building checkpoint simplified model as a proxy mesh corresponding to the building colony, and determine a material instance corresponding to the building colony according to the sixth simplified model parameter.
[0090] In some embodiments of the present application, the rendering unit 340 is configured to receive the simplified model of the terrain prosthesis, wherein the simplified model of the terrain prosthesis is obtained by fusing the proxy mesh of the plot and the proxy mesh of the building colony based on Houdini software; and generate the material and the texture of the simplified model of the terrain prosthesis according to the material instance of the plot and the material instance of the building colony.
[0091] In some embodiments of the present application, in the above device, the simplified model parameters include display distance, terrain compression accuracy, material texture size, highlight, and roughness.
[0092] It should be noted that the rendering device described above can implement the rendering method described above, which will not be described here.
[0093] Figure 4 is a structural schematic diagram of an electronic device according to an embodiment of the present application. Please refer to Figure 4 At the hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The memory can include a memory, such as a random-access memory (RAM), and can also include a non-volatile memory, such as at least one disk memory. Of course, the electronic device can also include other hardware required by the business.
[0094] The processor, network interface, and memory can be connected to each other through an internal bus, which can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, and a control bus. For ease of representation, Figure 4 Only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or only one type of bus.
[0095] The memory is used to store programs. Specifically, the program can include program code, and the program code includes computer operation instructions. The memory can include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0096] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs, and forms a rendering device at the logical level. The processor executes the program stored in the memory, and is specifically configured to perform the following operations:
[0097] Receive a realistic terrain model based on the scene to be rendered;
[0098] The scene to be rendered is divided into plots of land and building clusters;
[0099] Based on the distance from the camera position, receive simplified model parameters of the plot and the building complex;
[0100] Based on the real terrain model and the simplified model parameters, generate combinations of proxy meshes and material instances corresponding to the plots and building clusters, respectively.
[0101] Receive a simplified model of the terrain dummy in the scene to be rendered, and generate the material and texture of the simplified model of the terrain dummy based on the material instance.
[0102] The above is as stated in this application. Figure 3 The rendering apparatus method disclosed in the illustrated embodiments can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0103] The electronic device can also perform Figure 3 The method executed by the rendering device, and the implementation of the rendering device in Figure 3The functions of the embodiments shown are not limited to the details of the embodiments described herein. The embodiments described herein are intended in all respects to be illustrative rather than restrictive.
[0104] The embodiments of the present application also provide a computer readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by an electronic device comprising a plurality of application programs, can cause the electronic device to perform the method of any one of the embodiments shown. Figure 3 The method performed by the rendering device in the embodiments shown, and specifically for performing:
[0105] receiving a real terrain model according to a scene to be rendered;
[0106] segmenting the scene to be rendered into plots and building clusters;
[0107] receiving a simple model parameter of the plots and the building clusters according to a distance from a camera position;
[0108] generating a combination of proxy meshes and material instances corresponding to the plots and the building clusters respectively according to the real terrain model and the simple model parameter;
[0109] receiving a simple model of a terrain prosthesis of the scene to be rendered, and generating a material and a map of the simple model of the terrain prosthesis according to the material instances.
[0110] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) containing computer usable program code.
[0111] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as a combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions of one or more flows and / or blocks Figure 1 The functions of one or more flows and / or blocks
[0112] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the Figure 1 function specified in the flow or flows and / or blocks Figure 1 of the block or blocks.
[0113] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the Figure 1 function specified in the flow or flows and / or blocks Figure 1 of the block or blocks.
[0114] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0115] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory, non-volatile memory, such as read-only memory (ROM), EPROM, and / or flash memory, etc. The memory is an example of computer readable media.
[0116] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD), or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carrier waves.
[0117] It is also to be noted that the terms "comprising", "including", and any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a... " does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the recited element.
[0118] Those skilled in the art will appreciate that embodiments of the present application can be devised for a method, a system, or a computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer-readable program code.
[0119] The embodiments of the present application described above are merely intended to illustrate the principles of the present application, and are not intended to limit the scope of the present application. Various modifications and changes can be made thereto by those skilled in the art which will fall within the scope and spirit of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A rendering method, characterized by, The method comprises the following steps: receiving a real terrain model of a scene to be rendered; segmenting the scene to be rendered into plots and building clusters; receiving a plurality of simplified model parameters of the plots and the building clusters corresponding to distance ranges according to distances from a camera position; generating a combination of proxy grids and material instances corresponding to distance ranges for the plots and the building clusters respectively according to the real terrain model and the plurality of simplified model parameters; receiving a simplified model of a terrain prosthesis of the scene to be rendered, and generating materials and textures of the simplified model of the terrain prosthesis according to the material instances, wherein the proxy grids of different plots and different building clusters in the simplified model of the terrain prosthesis have different accuracies, and each proxy grid has a corresponding material instance.
2. The method of claim 1, wherein, The step of receiving a plurality of simplified model parameters of the plots and the building clusters corresponding to distance ranges according to distances from a camera position comprises the following steps: determining a first distance from a camera position to a target plot; if the first distance is within a close-up distance range, receiving a first simplified model parameter of the target plot, wherein the first simplified model parameter is a real terrain simplified model parameter; if the first distance is within a medium distance range, receiving a second simplified model parameter of the target plot, wherein the second simplified model parameter is a plot checkpoint simplified model parameter; if the first distance is within a long distance range, receiving a third simplified model parameter of the target plot, wherein the third simplified model parameter is a terrain prosthesis simplified model parameter.
3. The method of claim 2, wherein, The step of receiving a plurality of simplified model parameters of the plots and the building clusters corresponding to distance ranges according to distances from a camera position further comprises the following steps: determining a second distance from a camera position to a target building cluster; if the second distance is within a close-up distance range, receiving a fourth simplified model parameter of the target building cluster, wherein the fourth simplified model parameter is a single building simplified model parameter; if the second distance is within a medium distance range, receiving a fifth simplified model parameter of the target building cluster, wherein the fifth simplified model parameter is a region simplified model parameter; if the second distance is within a long distance range, receiving a sixth simplified model parameter of the target building cluster, wherein the sixth simplified model parameter is a building checkpoint simplified model parameter.
4. The method of claim 2, wherein, The step of generating a combination of proxy grids and material instances corresponding to distance ranges for the plots and the building clusters respectively according to the real terrain model and the plurality of simplified model parameters further comprises the following steps: for a plot, if the received simplified model parameter is the first simplified model parameter, simplifying a real terrain model of the plot according to the real terrain simplified model parameter to obtain a real terrain simplified model as a proxy grid corresponding to the plot, and determining a material instance corresponding to the plot according to the first simplified model parameter; if the received simplified model parameter is the second simplified model parameter, simplifying the real terrain model of the plot according to the plot checkpoint simplified model parameter to obtain a plot checkpoint simplified model as a proxy grid corresponding to the plot, and determining a material instance corresponding to the plot according to the second simplified model parameter; If the received simplified model parameter is the third simplified model parameter, the real terrain model of the land parcel is simplified according to the terrain prosthetic simplified model parameter to obtain a terrain prosthetic simplified model as the corresponding proxy grid of the land parcel, and the corresponding material instance of the land parcel is determined according to the third simplified model parameter.
5. The method of claim 3, wherein, The generating the combination of the proxy grid and the material instance corresponding to the distance range of the land parcel and the building colony respectively according to the real terrain model and the plurality of simplified model parameters further includes: For a building colony, if the received simplified model parameter is the fourth simplified model parameter, each building in the real terrain model of the building colony is simplified according to the single building simplified model parameter to obtain a single building simplified model as the corresponding proxy grid of the building colony, and the corresponding material instance of the building colony is determined according to the fourth simplified model parameter; If the received simplified model parameter is the fifth simplified model parameter, a plurality of buildings in the real terrain model of the building colony are grouped and simplified according to the area simplified model parameter to obtain an area simplified model as the corresponding proxy grid of the building colony, and the corresponding material instance of the building colony is determined according to the fifth simplified model parameter; If the received simplified model parameter is the sixth simplified model parameter, the real terrain model of the building colony is simplified according to the building level parameter to obtain a building level simplified model as the corresponding proxy grid of the building colony, and the corresponding material instance of the building colony is determined according to the sixth simplified model parameter.
6. The method of claim 1, wherein, The receiving the simplified model of the terrain prosthetic of the scene to be rendered and generating the material and the map of the simplified model of the terrain prosthetic according to the material instance includes: receiving the simplified model of the terrain prosthetic, wherein the simplified model of the terrain prosthetic is obtained by fusing the proxy grids of the land parcel and the building colony based on Houdini software; and generating the material and the map of the simplified model of the terrain prosthetic according to the material instance of the land parcel and the material instance of the building colony.
7. The method of any one of claims 1-6, wherein, The simplified model parameter includes: display distance, terrain compression accuracy, material map size, highlight, roughness.
8. A rendering device, characterized in that The device includes: a model receiving unit configured to receive a real terrain model of a scene to be rendered; a segmentation unit configured to segment the scene to be rendered into land parcels and building colonies; a parameter receiving unit configured to receive a plurality of simplified model parameters of the land parcels and the building colonies corresponding to distance ranges according to distances from a camera position; a generating unit configured to generate a combination of proxy grids and material instances corresponding to distance ranges of the land parcels and the building colonies respectively according to the real terrain model and the plurality of simplified model parameters; a rendering unit configured to receive a simplified model of a terrain prosthetic of the scene to be rendered and generate a material and a map of the simplified model of the terrain prosthetic according to the material instance, wherein the proxy grid accuracies of different land parcels and different building colonies in the simplified model of the terrain prosthetic are different, and each proxy grid has a corresponding material instance. 9.An electronic device, comprising: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the method of any of claims 1-7.
10. A computer readable storage medium storing one or more programs, which when executed by an electronic device comprising a plurality of application programs, cause the electronic device to perform any of the methods of claims 1-7.
Citation Information
Patent Citations
Method for scene visualization
CN101635138A
Method and system for making and rendering large-scale terrain
CN108109204A
Object loading method and device, storage medium and electronic device
CN109523621A
Game system and information storage medium
JP2001229395A