Virtual scene rendering method and device, electronic equipment and medium

CN123015784APending Publication Date: 2026-10-30SICHUAN JIANSHAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510544097.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

技术人员通过手动的方式对筛选出来的几何模型进行处理,不仅影响虚拟场景整体的渲染效率,而且容易导致硬件资源的利用率较低

Benefits of technology

[0042]在上述实现过程中,通过确定虚拟场景中待渲染对象的静态网格体,并根据静态网格体的材质属性对静态网格体进行划分,从而得到每一静态网格体中不同材质属性对应的多个子网格体,实现了静态网格体的划分,进一步地,根据划分后的子网格体的材质属性对相应的子网格体进行渲染,得到每一子网格体对应的渲染后子网格体,实现了一个静态网格体的拆分渲染,避免了由于一个对象的部分材质属性无法渲染导致对象整体都无法渲染的问题,提高了虚拟场景的渲染的效果。并且本方案无需技术人员手动操作无法渲染的对象,提高了虚拟场景的渲染效率,从而使硬件资源能够处理更多的对象,提高了硬件资源的利用率。进一步地,根据目标虚拟场景中所有的渲染子网格体生成渲染后虚拟场景,实现了虚拟场景的整体渲染,通过该方式对虚拟场景进行渲染,提高了虚拟场景整体的渲染效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123015784A_ABST
    Figure CN123015784A_ABST
Patent Text Reader

Abstract

The virtual scene rendering method, device, electronic equipment and medium provided by the application, by obtaining a to-be-rendered object in a target virtual scene; converting the to-be-rendered model into a static mesh; dividing the static mesh based on material properties included in the static mesh to obtain a plurality of sub-meshes corresponding to different material properties of the static mesh; determining a plurality of sub-meshes corresponding to all objects in the target virtual scene; rendering each sub-mesh based on the material properties of each sub-mesh in the target virtual scene to obtain a rendered sub-mesh corresponding to each sub-mesh; and generating a rendered virtual scene based on all rendered sub-meshes. The application divides the static mesh corresponding to the whole object into sub-meshes corresponding to different material properties, and renders the sub-meshes, thereby avoiding manual processing of models that cannot be rendered by technical personnel, improving rendering efficiency and utilization of hardware resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer graphics technology, and in particular to rendering methods, apparatus, electronic devices and media for virtual scenes. Background Technology

[0002] In recent years, with the rapid development of Virtual Reality (VR), Augmented Reality (AR), and video game technologies, the field of computer graphics has made significant progress in the creation of 3D models and virtual scenes. When rendering high-precision geometric models in a virtual scene using a rendering engine, it is usually necessary to render the materials of the geometric model. A geometric model in a virtual scene may include different material properties. When a geometric model contains material properties that the rendering engine cannot render, the entire geometric model cannot be rendered, thus affecting the overall rendering effect of the virtual scene.

[0003] Currently, the common practice is to manually filter out geometric models in a virtual scene that cannot be rendered. Technicians then manually process these selected models to achieve the overall rendering of the virtual scene. This manual processing of the selected geometric models not only impacts the overall rendering efficiency of the virtual scene but also tends to lead to low utilization of hardware resources.

[0004] Therefore, how to render virtual scenes in related technologies to improve rendering efficiency and hardware resource utilization is a problem that needs to be solved. Summary of the Invention

[0005] In view of this, the purpose of the embodiments of this application is to provide a method, apparatus, electronic device and medium for rendering virtual scenes, so as to solve the problem of how to render virtual scenes in related technologies, so as to improve rendering efficiency and hardware resource utilization.

[0006] In a first aspect, embodiments of this application provide a method for rendering a virtual scene, the method comprising:

[0007] Obtain the object to be rendered in the target virtual scene, wherein the object to be rendered is any object in the target virtual scene;

[0008] Determine the static mesh volume in the object to be rendered;

[0009] The static mesh is divided based on the material properties included in the static mesh to obtain multiple sub-mesh bodies corresponding to different material properties of the static mesh.

[0010] Identify multiple sub-mesh volumes corresponding to all objects in the target virtual scene;

[0011] Based on the material properties of each sub-mesh in the target virtual scene, the corresponding sub-mesh is rendered to obtain the rendered sub-mesh corresponding to each sub-mesh;

[0012] The rendered virtual scene corresponding to the target virtual scene is generated based on all the rendered sub-mesh volumes.

[0013] In one embodiment, the step of dividing the static mesh based on the material properties included in the static mesh to obtain multiple sub-mesh bodies corresponding to different material properties of the static mesh body includes:

[0014] Determine the material properties of each facet that makes up the static mesh;

[0015] The static mesh contains faces with preset material properties to form a first sub-mesh, and faces without the preset material properties to form a second sub-mesh. The multiple sub-mesh corresponding to different material properties of the static mesh include the first sub-mesh and the second sub-mesh. The preset material properties include at least one of semi-transparency, masking, vertex interpolation, pixel depth offset, and world position offset.

[0016] In one embodiment, rendering the corresponding sub-mesh based on the material properties of each sub-mesh in the target virtual scene to obtain the rendered sub-mesh corresponding to each sub-mesh includes:

[0017] The first sub-mesh corresponding to all objects in the target virtual scene is rendered using a rasterization rendering mode to obtain the rendered first sub-mesh corresponding to all objects.

[0018] The second sub-mesh corresponding to all objects in the target virtual scene is rendered using virtual geometry rendering mode and rasterization rendering mode to obtain the rendered second sub-mesh corresponding to all objects.

[0019] The target virtual scene includes all rendered sub-mesh volumes, including all rendered first sub-mesh volumes and all rendered second sub-mesh volumes.

[0020] In one embodiment, generating the rendered virtual scene corresponding to the target virtual scene based on all the rendered sub-mesh volumes includes:

[0021] Based on the first and second sub-mesh volumes after rendering for each object in the target virtual scene, generate the rendered object corresponding to each object.

[0022] The rendered virtual scene corresponding to the target virtual scene is generated based on the rendered objects corresponding to all objects in the target virtual scene.

[0023] In one embodiment, the method further includes:

[0024] Obtain other virtual scenes in the target application, wherein the target application includes multiple virtual scenes, and the other virtual scenes are any virtual scene other than the target virtual scene among the multiple virtual scenes;

[0025] If the first object in the other virtual scene corresponds to the second object in the target virtual scene, then the static mesh corresponding to the first object is replaced with multiple sub-mesh bodies corresponding to the second object, where the first object is any object in the other virtual scene.

[0026] In one embodiment, the objects in the target virtual scene include blueprints and / or models; if the object to be rendered is a blueprint, the method further includes:

[0027] Identify the static mesh components that make up the blueprint;

[0028] Based on the material properties of each static mesh in the static mesh component, the corresponding static mesh is divided to obtain multiple sub-mesh corresponding to different material properties of each static mesh in the blueprint;

[0029] The sub-mesh corresponding to the blueprint includes multiple sub-mesh corresponding to all static meshes in the blueprint.

[0030] In one embodiment, before dividing the static mesh based on the material properties included in the static mesh to obtain multiple sub-mesh bodies corresponding to different material properties of the static mesh body, the method further includes:

[0031] Determine the material matching result between the material slots in the static mesh and the material of the static mesh;

[0032] If there are unmatched material slots in the static mesh, then delete the unmatched material slots in the static mesh.

[0033] Secondly, embodiments of this application provide a model rendering apparatus in a virtual scene, the apparatus comprising:

[0034] The acquisition module is used to acquire the object to be rendered in the target virtual scene, wherein the object to be rendered is any object in the target virtual scene;

[0035] The first determining module is used to determine the static mesh volume in the object to be rendered;

[0036] The partitioning module is used to partition the static mesh based on the material properties included in the static mesh, thereby obtaining multiple sub-mesh bodies corresponding to different material properties of the static mesh body;

[0037] The second determining module is used to determine multiple sub-mesh volumes corresponding to all objects in the target virtual scene;

[0038] The rendering module is used to render the corresponding sub-mesh based on the material properties of each sub-mesh in the target virtual scene, so as to obtain the rendered sub-mesh corresponding to each sub-mesh.

[0039] The generation module is used to generate the rendered virtual scene corresponding to the target virtual scene based on all the rendered sub-mesh volumes.

[0040] Thirdly, embodiments of this application also provide an electronic device, including: a memory and a processor, wherein the memory stores a computer program executable by the processor, and when the computer program is executed by the processor, it performs a model rendering method in a virtual scene as described in the first aspect above.

[0041] Fourthly, embodiments of this application also provide a computer-readable storage medium storing computer program instructions that, when executed by a processor, perform a model rendering method in a virtual scene as described in the first aspect above.

[0042] In the above implementation process, by determining the static mesh of the object to be rendered in the virtual scene and dividing the static mesh according to its material properties, multiple sub-mesh bodies corresponding to different material properties are obtained in each static mesh, thus realizing the division of the static mesh. Furthermore, the corresponding sub-mesh bodies are rendered according to their material properties, resulting in the rendered sub-mesh body for each sub-mesh body. This achieves the split rendering of a static mesh, avoiding the problem of an object's entire object failing to render due to the inability to render some of its material properties, thereby improving the rendering effect of the virtual scene. Moreover, this solution eliminates the need for technicians to manually manipulate unrenderable objects, improving the rendering efficiency of the virtual scene and allowing hardware resources to handle more objects, thus improving hardware resource utilization. Furthermore, by generating the rendered virtual scene based on all the rendered sub-mesh bodies in the target virtual scene, the overall rendering of the virtual scene is achieved, improving the overall rendering efficiency of the virtual scene. Attached Figure Description

[0043] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0044] Figure 1 This is a flowchart illustrating a model rendering method in a virtual scene provided in an embodiment of this application;

[0045] Figure 2 This is a schematic diagram of the structure of a model rendering device in a virtual scene provided in an embodiment of this application;

[0046] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0047] The embodiments of the technical solution of this application will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of this application and are therefore merely examples, and should not be used to limit the scope of protection of this application.

[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this application.

[0049] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0050] In recent years, with the rapid development of Virtual Reality (VR), Augmented Reality (AR), and video game technologies, the field of computer graphics has made significant progress in the creation of 3D models and virtual environments. When rendering high-precision geometric models in a virtual scene using a rendering engine, it is usually necessary to render the materials of the geometric model. A geometric model in a virtual scene may include different material properties. When a geometric model contains material properties that the rendering engine cannot render, the entire geometric model cannot be rendered, thus affecting the overall rendering effect of the virtual scene. For example, when using Unreal Engine to perform virtual geometry rendering (Nanite rendering) on ​​a model in a virtual scene, if the model's material properties include any of the following: translucency, masking, vertex interpolation, pixel depth offset, or world position offset, virtual geometry rendering of that model is impossible.

[0051] Currently, the common practice is to manually filter out geometric models in a virtual scene that cannot be rendered. Technicians then manually process these selected models to achieve the overall rendering of the virtual scene. This manual processing of the selected geometric models not only impacts the overall rendering efficiency of the virtual scene but also tends to lead to low utilization of hardware resources.

[0052] Therefore, how to render virtual scenes in related technologies to improve rendering efficiency and hardware resource utilization is a problem that needs to be solved.

[0053] Please see Figure 1 , Figure 1 This is a flowchart illustrating a virtual scene rendering method provided in an embodiment of this application. The execution entity of this virtual scene rendering method can be an electronic device, and the method may include the following steps:

[0054] Step S101: Obtain the object to be rendered in the target virtual scene.

[0055] The object to be rendered is any object in the target virtual scene.

[0056] Step S102: Determine the static mesh in the object to be rendered.

[0057] Step S103: Divide the static mesh based on the material properties included in the static mesh to obtain multiple sub-mesh bodies corresponding to different material properties of the static mesh body.

[0058] Step S104: Determine multiple sub-mesh volumes corresponding to all objects in the target virtual scene.

[0059] Step S105: Render the corresponding sub-mesh based on the material properties of each sub-mesh in the target virtual scene to obtain the rendered sub-mesh corresponding to each sub-mesh.

[0060] Step S106: Generate the rendered virtual scene corresponding to the target virtual scene based on all rendered sub-mesh volumes.

[0061] For example, the target virtual scene can be a virtual scene in the game field or a virtual scene in the digital twin field. The target virtual scene can include objects such as buildings, trees, and roads. Rendering the target virtual scene means rendering all objects in the target virtual scene. Therefore, the objects to be rendered in the target virtual scene can be obtained first. These objects can be any objects in the target virtual scene.

[0062] Furthermore, the static meshes within the object to be rendered are identified. Specifically, objects in the target virtual scene can be composed of static meshes and corresponding animations and lighting effects, etc., and typically the static mesh for an object is a single unit. Therefore, the static mesh corresponding to the object to be rendered can be extracted.

[0063] Furthermore, the static mesh can be further divided based on the material properties it contains, resulting in multiple sub-mesh bodies corresponding to different material properties. Typically, a complete object may include multiple materials, each with different material properties; therefore, a complete object can include various material properties. For example, a building may include walls and windows. The wall material can be cement, stone slabs, or wood planks, and the material properties of cement, stone slabs, and wood planks are usually opaque. The window material can be ordinary glass, tempered glass, insulated glass, or polycarbonate glass, and the material properties of ordinary glass, tempered glass, insulated glass, and polycarbonate glass are usually translucent. In addition, in real-world scenarios, object material properties can also include masking, vertex interpolation, pixel depth offset, or world position offset. Since material properties affect the rendering results when rendering virtual geometry objects in a virtual scene, to facilitate effective rendering of objects in a virtual scene, the static mesh can be divided into different sub-mesh bodies based on its material properties, thus obtaining the sub-mesh body corresponding to each material property of the static mesh.

[0064] As an example, a static mesh is typically composed of faces. Faces belonging to the same material property within a static mesh can be grouped into a sub-mesh, thus obtaining a sub-mesh corresponding to each material property of the static mesh. In this case, the number of sub-mesh corresponding to a static mesh is the same as the number of material properties included in the static mesh. For example, if the static mesh includes two material properties, it will have two sub-mesh; if it includes three material properties, it will have three sub-mesh.

[0065] Furthermore, the above method can be used to determine multiple sub-mesh volumes corresponding to the static mesh volume of each object in the target virtual scene.

[0066] Furthermore, based on the material properties of all sub-mesh bodies in the target virtual scene, the corresponding sub-mesh bodies are rendered, thus obtaining the rendered sub-mesh body for each sub-mesh body. Specifically, sub-mesh bodies with different material properties can use different rendering modes. Specifically, different rendering modes can be applied to corresponding sub-mesh bodies based on whether their material properties allow for virtual geometry rendering, thus achieving the rendering of sub-mesh bodies with different material properties. As an example, if the material properties of a sub-mesh body in the target virtual scene allow for virtual geometry rendering, then the corresponding sub-mesh body is rendered using virtual geometry, thus obtaining the rendered sub-mesh body for that sub-mesh body; if the material properties of a sub-mesh body in the target virtual scene do not allow for virtual geometry rendering, then the corresponding sub-mesh body is rasterized, thus obtaining the rendered sub-mesh body for that sub-mesh body. This method can be used to determine the rendered sub-mesh body for each sub-mesh body, that is, all rendered sub-mesh bodies in the target virtual scene include the rendered sub-mesh bodies corresponding to all sub-mesh bodies. This rendering method effectively avoids the problem of poor rendering results caused by using the same rendering method for static meshes with different material properties, and it does not require manual processing by technicians, thus improving the rendering efficiency of virtual scenes.

[0067] Furthermore, a rendered virtual scene corresponding to the target virtual scene can be generated based on all rendered sub-mesh volumes. As an example, all rendered sub-mesh volumes in the target virtual scene can be combined to obtain the rendered virtual scene corresponding to the target virtual scene. As another example, all rendered sub-mesh volumes in the target virtual scene can be configured with corresponding textures and lighting information as needed, and then combined to obtain the rendered virtual scene corresponding to the target virtual scene.

[0068] In the above implementation process, by determining the static mesh of the object to be rendered in the virtual scene and dividing the static mesh according to its material properties, multiple sub-mesh bodies corresponding to different material properties are obtained in each static mesh, thus realizing the division of the static mesh. Furthermore, the corresponding sub-mesh bodies are rendered according to their material properties, resulting in the rendered sub-mesh body for each sub-mesh body. This achieves the split rendering of a static mesh, avoiding the problem of an object's entire object failing to render due to the inability to render some of its material properties, thereby improving the rendering effect of the virtual scene. Moreover, this solution eliminates the need for technicians to manually manipulate unrenderable objects, improving the rendering efficiency of the virtual scene and allowing hardware resources to handle more objects, thus improving hardware resource utilization. Furthermore, by generating the rendered virtual scene based on all the rendered sub-mesh bodies in the target virtual scene, the overall rendering of the virtual scene is achieved, improving the overall rendering efficiency of the virtual scene.

[0069] In one embodiment, dividing the static mesh based on the material properties included in the static mesh to obtain multiple sub-mesh bodies corresponding to different material properties of the static mesh body may include the following steps:

[0070] Step 1: Determine the material properties of each facet that makes up the static mesh.

[0071] Step 2: Form the first sub-mesh by combining the faces in the static mesh that include the preset material properties, and form the second sub-mesh by combining the faces in the static mesh that do not include the preset material properties. The multiple sub-mesh corresponding to different material properties of the static mesh include the first sub-mesh and the second sub-mesh.

[0072] Preset material properties include at least one of the following: semi-transparency, masking, vertex interpolation, pixel depth offset, and world position offset.

[0073] For example, a static mesh is typically composed of multiple faces, which can be triangles or other polygons, without limitation. Each face may have a different material and corresponding material properties. To accurately divide the static mesh, faces with preset material properties can be grouped into a first sub-mesh, and faces without preset material properties can be grouped into a second sub-mesh. This results in two sub-mesh types corresponding to different material properties of the static mesh. In other words, the multiple sub-mesh types corresponding to different material properties of the static mesh include the first sub-mesh and the second sub-mesh. The preset material properties can be determined based on the rendering characteristics of the material properties. Specifically, the preset material properties can be set based on whether the material properties can be used for virtual geometry rendering. For example, preset material properties may include at least one of the following: semi-transparency, masking, vertex interpolation, pixel depth offset, and world position offset, which cannot be used for virtual geometry rendering. In practical applications, preset material properties may also include other material properties that cannot be used for virtual geometry rendering, without limitation.

[0074] In the above implementation process, the static mesh is divided into two sub-mesh bodies based on whether the material properties of the constituent facets include preset material properties. This results in two sub-mesh bodies having different rendering characteristics, which facilitates further rendering using corresponding rendering methods based on the rendering characteristics of the sub-mesh bodies. This eliminates the need to divide the static mesh body into a corresponding sub-mesh body based on each material property, effectively reducing the number of sub-mesh bodies corresponding to the static mesh body and the number of sub-mesh bodies processed in subsequent rendering processes, thereby improving the overall rendering efficiency of the virtual scene.

[0075] In one embodiment, rendering the corresponding sub-mesh based on the material properties of each sub-mesh in the target virtual scene to obtain the rendered sub-mesh for each sub-mesh may include the following steps:

[0076] Step 1: Render the first sub-mesh corresponding to all objects in the target virtual scene using rasterization rendering mode to obtain the rendered first sub-mesh corresponding to all objects.

[0077] Step 2: Render the second sub-mesh corresponding to all objects in the target virtual scene using virtual geometry rendering mode and rasterization rendering mode to obtain the rendered second sub-mesh corresponding to all objects.

[0078] The target virtual scene includes all rendered sub-mesh volumes, including all rendered first sub-mesh volumes and all rendered second sub-mesh volumes.

[0079] For example, when rendering a sub-mesh, the corresponding rendering mode can be adopted for the corresponding sub-mesh according to the rendering characteristics of the sub-mesh's material properties, thereby realizing the rendering of different sub-mesh.

[0080] Specifically, since the first sub-mesh cannot be rendered using virtual geometry (Nanite rendering), the first sub-mesh corresponding to all objects in the target virtual scene is rendered using rasterization rendering mode to obtain the rendered first sub-mesh corresponding to all objects. This rasterization rendering mode is the traditional pipeline rendering. The second sub-mesh corresponding to all objects in the target virtual scene is rendered using both virtual geometry rendering mode and rasterization rendering mode to obtain the rendered second sub-mesh corresponding to all objects, thus realizing the rendering of the first and second sub-mesh.

[0081] Furthermore, this method can be used to obtain the first sub-mesh and all second sub-mesh after rendering corresponding to all static meshes in the target virtual scene. In other words, all rendered sub-meshes in the target virtual scene include all first sub-mesh and all second sub-mesh after rendering.

[0082] In the above implementation process, different rendering modes are adopted for sub-mesh with different material properties in the target virtual scene, which improves the rendering effect of sub-mesh. Furthermore, all sub-mesh with the same material property in the target virtual scene are rendered in batches using the same rendering mode, thereby improving the overall rendering efficiency of the virtual scene.

[0083] In one embodiment, generating the rendered virtual scene corresponding to the target virtual scene based on all rendered sub-mesh volumes may include the following steps:

[0084] Step 1: Generate the rendered object corresponding to each object based on the first and second rendered sub-mesh volumes corresponding to each object in the target virtual scene.

[0085] Step 2: Generate the rendered virtual scene corresponding to the target virtual scene based on the rendered objects corresponding to all objects in the target virtual scene.

[0086] For example, the rendered first sub-mesh and rendered second sub-mesh of each object in the target virtual scene are combined to form the rendered object corresponding to the object. This makes it easier to adjust or optimize the rendered object as a whole without having to adjust or optimize the rendered first sub-mesh and rendered second sub-mesh separately, reducing the complexity of the operation. Furthermore, the rendered objects corresponding to all objects in the target virtual scene are displayed in the virtual scene, thereby obtaining the rendered virtual scene corresponding to the target virtual scene. This realizes the rendering of the target virtual scene and ensures the integrity of the presentation effect of each rendered object in the scene.

[0087] In the above implementation process, the first and second sub-mesh volumes after rendering for each object are combined into the rendered object corresponding to that object. This makes it easier to adjust or optimize the rendered object as a whole without having to adjust or optimize the first and second sub-mesh volumes separately, reducing the complexity of the operation. All rendered objects in the target virtual scene are presented in the virtual scene, realizing the rendering of the target virtual scene and ensuring the integrity of the rendering effect of each rendered object in the scene.

[0088] In one embodiment, the method may further include the following steps:

[0089] Step 1: Obtain other virtual scenes from the target application.

[0090] The target application includes multiple virtual scenes, and the other virtual scenes are any virtual scenes other than the target virtual scene.

[0091] Step 2: If the first object in other virtual scenes corresponds to the second object in the target virtual scene, then replace the static mesh corresponding to the first object with multiple sub-mesh bodies corresponding to the second object.

[0092] The first object is any object in other virtual scenes, and the second object is any object in the target virtual scene.

[0093] For example, an application in the gaming or digital twin field may include multiple levels, typically each level corresponding to at least one virtual scene, and different virtual scenes may include the same model. Therefore, when the target virtual scene is one of multiple virtual scenes in the target application, and it is necessary to render other virtual scenes in the target application, the sub-mesh volumes divided in the target virtual scene can be applied to any other virtual scene in the target application besides the target virtual scene.

[0094] Specifically, any virtual scene other than the target virtual scene among multiple virtual scenes of the target application is designated as an "other virtual scene," and any object in the other virtual scene is designated as the first object. Each object in the target virtual scene is then traversed, and any object in the target virtual scene that is identical to the first object is designated as the second object. In other words, the first object in the other virtual scene corresponds to the second object in the target virtual scene. Furthermore, the static mesh corresponding to the first object is replaced with multiple sub-mesh volumes corresponding to the second object. Therefore, when rendering objects in other virtual scenes, it is unnecessary to re-mesh the static mesh of the first object, reducing the operational steps in the rendering process of other virtual scenes and thus improving the rendering efficiency of other virtual scenes.

[0095] In the above implementation process, by replacing the corresponding objects in other virtual scenes with the sub-mesh volumes in the target virtual scene, the rendering efficiency of multiple virtual scenes is improved by eliminating the need to repeatedly divide the same objects in multiple virtual scenes when rendering multiple virtual scenes in the same application.

[0096] In one embodiment, if the target virtual scene includes blueprints and / or models, the method may further include the following steps:

[0097] Step 1: Identify the static mesh components that make up the blueprint.

[0098] Step 2: Based on the material properties of each static mesh in the static mesh component, divide the corresponding static mesh to obtain the sub-mesh corresponding to different material properties of each static mesh in the blueprint.

[0099] The sub-mesh corresponding to the blueprint includes multiple sub-mesh corresponding to all static meshes in the blueprint.

[0100] For example, the target virtual scene may include not only models but also blueprints, and the blueprints can be used to create visual models through static mesh components. If the object to be rendered is a blueprint, the static mesh components that make up the blueprint can be determined.

[0101] Furthermore, based on the material properties included in each static mesh in the static mesh component, the corresponding static mesh is divided to obtain multiple sub-mesh corresponding to each static mesh in the blueprint. That is, the sub-mesh corresponding to the blueprint includes multiple sub-mesh corresponding to all static meshes in the blueprint.

[0102] If the object to be rendered is a model, the model is directly converted into the corresponding static mesh, and the static mesh is divided according to the material properties of the static mesh to obtain multiple sub-mesh bodies.

[0103] In the above implementation process, by determining the static mesh components that make up the blueprint of the virtual scene, and dividing the corresponding static mesh according to the material properties of each static mesh in the static mesh component, the sub-mesh of the corresponding static mesh is obtained, thereby realizing the division of the static mesh that makes up the blueprint in the target virtual scene.

[0104] In one embodiment, before dividing the static mesh based on the material properties included in the static mesh to obtain sub-mesh bodies corresponding to different material properties of the static mesh, the method may further include the following steps:

[0105] Step 1: Determine the material slots in the static mesh and the material matching results of the static mesh.

[0106] Step 2: If there are unmatched material slots in the static mesh, delete the unmatched material slots in the static mesh.

[0107] For example, in a 3D model, different materials can be set for different areas or locations of an object through material slots. In order to accurately determine the material properties included in the static mesh, it is necessary to ensure that the number of material slots in the static mesh is consistent with the number of material types in the corresponding static mesh.

[0108] Specifically, the matching result between the material slots in the static mesh and the material of the static mesh is determined. That is, it is determined whether the material slots of the static mesh match the material information of the static mesh. If a material slot does not match the material information of the static mesh, that is, there are unmatched material slots in the static mesh, and the number of material slots is greater than the number of material types, then the unmatched material slots in the static mesh are deleted.

[0109] In the above implementation process, based on the material slots in the static mesh and the material matching results of the static mesh, redundant material slots in the static mesh are deleted, which facilitates the subsequent determination of the material properties of the static mesh and improves the accuracy of static mesh division.

[0110] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of a virtual scene rendering device provided in an embodiment of this application, as shown below. Figure 2 The rendering apparatus for the virtual scene shown includes:

[0111] The acquisition module 201 is used to acquire the objects to be rendered in the target virtual scene.

[0112] The model to be rendered is any model in the target virtual scene.

[0113] The first determining module 202 is used to determine the static mesh volume in the object to be rendered;

[0114] The partitioning module 203 is used to partition the static mesh based on the material properties included in the static mesh, so as to obtain multiple sub-mesh bodies corresponding to different material properties of the static mesh body;

[0115] The second determining module 204 is used to determine multiple sub-mesh volumes corresponding to all objects in the target virtual scene;

[0116] The rendering module 205 is used to render the corresponding sub-mesh based on the material properties of each sub-mesh in the target virtual scene, so as to obtain the rendered sub-mesh corresponding to each sub-mesh.

[0117] The generation module 206 is used to generate the rendered virtual scene corresponding to the target virtual scene based on all rendered sub-mesh volumes.

[0118] In one embodiment, the partitioning module 203 is specifically used for:

[0119] Determine the material properties of each facet that makes up the static mesh;

[0120] The static mesh contains faces with preset material properties to form a first sub-mesh, and the static mesh contains faces without preset material properties to form a second sub-mesh. The multiple sub-mesh corresponding to different material properties of the static mesh include the first sub-mesh and the second sub-mesh. The preset material properties include at least one of semi-transparency, masking, vertex interpolation, pixel depth offset, and world position offset.

[0121] In one embodiment, the rendering module 205 is specifically used for:

[0122] The first sub-mesh corresponding to all objects in the target virtual scene is rendered using rasterization rendering mode to obtain the rendered first sub-mesh corresponding to all objects.

[0123] The second sub-mesh corresponding to all objects in the target virtual scene is rendered using the virtual geometry rendering mode to obtain the rendered second sub-mesh corresponding to all objects.

[0124] The target virtual scene includes all rendered sub-mesh volumes, including all rendered first sub-mesh volumes and all rendered second sub-mesh volumes.

[0125] In one embodiment, the generation module 206 is specifically used for:

[0126] The rendered object is generated based on the first and second rendered sub-mesh corresponding to each object in the target virtual scene.

[0127] The rendered virtual scene corresponding to the target virtual scene is generated based on the rendered objects corresponding to all objects in the target virtual scene.

[0128] In one embodiment, the generation module 206 is further configured to:

[0129] Obtain other virtual scenes in the target application. The target application includes multiple virtual scenes, and the other virtual scenes are any virtual scenes other than the target virtual scene.

[0130] If the first object in another virtual scene corresponds to the second object in the target virtual scene, then the static mesh corresponding to the first object is replaced with multiple sub-mesh bodies corresponding to the second object. The first object can be any object in another virtual scene.

[0131] In one embodiment, objects in the target virtual scene include blueprints and / or models. If the object to be rendered is a blueprint, the partitioning module 203 is further configured to:

[0132] Identify the static mesh components that make up the blueprint;

[0133] Based on the material properties of each static mesh in the static mesh component, the corresponding static mesh is divided to obtain multiple sub-mesh corresponding to different material properties of each static mesh in the blueprint;

[0134] The sub-mesh corresponding to the blueprint includes multiple sub-mesh corresponding to all static meshes in the blueprint.

[0135] In one embodiment, the partitioning module 203 is further configured to:

[0136] Determine the material matching result between the material slots in the static mesh and the material of the static mesh;

[0137] If there are unmatched material slots in the static mesh, delete the unmatched material slots in the static mesh.

[0138] It should be understood that the virtual scene rendering method embodiment corresponds to and can execute the various steps involved in the above method embodiment. The specific functions of the virtual scene rendering device can be found in the description above. To avoid repetition, detailed descriptions are appropriately omitted here. The virtual scene rendering device includes at least one software function module that can be stored in memory or embedded in the device's operating system (OS) in the form of software or firmware.

[0139] Please refer to Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. An electronic device 300 provided in this application includes a processor 301 and a memory 302. These components are interconnected and communicate with each other via a communication bus 303 and / or other forms of connection mechanisms (not shown). The memory 302 stores a computer program executable by the processor 301. When executed by the processor 301, the computer program performs the virtual scene rendering method described in the first aspect above.

[0140] This application also provides a computer-readable storage medium storing computer program instructions, which, when executed by processor 301, perform the virtual scene rendering method described in the first aspect above.

[0141] The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0142] It should be understood that the disclosed apparatus / systems and methods can also be implemented in other ways, as provided in the embodiments of this application. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, or they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0143] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0144] The above description is only an optional implementation of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the embodiments of this application should be covered within the protection scope of the embodiments of this application.

Claims

1. A method for rendering virtual scenes, characterized in that, The method includes: Obtain the object to be rendered in the target virtual scene, wherein the object to be rendered is any object in the target virtual scene; Determine the static mesh volume in the object to be rendered; The static mesh is divided based on the material properties included in the static mesh to obtain multiple sub-mesh bodies corresponding to different material properties of the static mesh. Identify multiple sub-mesh volumes corresponding to all objects in the target virtual scene; Based on the material properties of each sub-mesh in the target virtual scene, the corresponding sub-mesh is rendered to obtain the rendered sub-mesh corresponding to each sub-mesh; The rendered virtual scene corresponding to the target virtual scene is generated based on all the rendered sub-mesh volumes.

2. The method according to claim 1, characterized in that, The process of dividing the static mesh based on the material properties included in the static mesh to obtain multiple sub-mesh bodies corresponding to different material properties of the static mesh body includes: Determine the material properties of each facet that makes up the static mesh; The static mesh contains faces with preset material properties to form a first sub-mesh, and faces without the preset material properties to form a second sub-mesh. The multiple sub-mesh corresponding to different material properties of the static mesh include the first sub-mesh and the second sub-mesh. The preset material properties include at least one of semi-transparency, masking, vertex interpolation, pixel depth offset, and world position offset.

3. The method according to claim 2, characterized in that, The step of rendering the corresponding sub-mesh based on the material properties of each sub-mesh in the target virtual scene to obtain the rendered sub-mesh corresponding to each sub-mesh includes: The first sub-mesh corresponding to all objects in the target virtual scene is rendered using a rasterization rendering mode to obtain the rendered first sub-mesh corresponding to all objects. The second sub-mesh corresponding to all objects in the target virtual scene is rendered using virtual geometry rendering mode and rasterization rendering mode to obtain the rendered second sub-mesh corresponding to all objects. The target virtual scene includes all rendered sub-mesh volumes, including all rendered first sub-mesh volumes and all rendered second sub-mesh volumes.

4. The method according to claim 3, characterized in that, The step of generating the rendered virtual scene corresponding to the target virtual scene based on all the rendered sub-mesh volumes includes: Based on the first and second sub-mesh volumes after rendering for each object in the target virtual scene, generate the rendered object corresponding to each object. The rendered virtual scene corresponding to the target virtual scene is generated based on the rendered objects corresponding to all objects in the target virtual scene.

5. The method according to claim 1, characterized in that, The method further includes: Obtain other virtual scenes in the target application, wherein the target application includes multiple virtual scenes, and the other virtual scenes are any virtual scene other than the target virtual scene among the multiple virtual scenes; If the first object in the other virtual scene corresponds to the second object in the target virtual scene, then the static mesh corresponding to the first object is replaced with multiple sub-mesh bodies corresponding to the second object, where the first object is any object in the other virtual scene.

6. The method according to claim 1, characterized in that, The objects in the target virtual scene include blueprints and / or models. If the object to be rendered is a blueprint, the method further includes: Identify the static mesh components that make up the blueprint; Based on the material properties of each static mesh in the static mesh component, the corresponding static mesh is divided to obtain multiple sub-mesh corresponding to different material properties of each static mesh in the blueprint; The sub-mesh corresponding to the blueprint includes multiple sub-mesh corresponding to all static meshes in the blueprint.

7. The method according to claim 1, characterized in that, Before dividing the static mesh based on the material properties included in the static mesh to obtain multiple sub-mesh bodies corresponding to different material properties of the static mesh body, the method further includes: Determine the material matching result between the material slots in the static mesh and the material of the static mesh; If there are unmatched material slots in the static mesh, then delete the unmatched material slots in the static mesh.

8. A rendering device for virtual scenes, characterized in that, The device includes: The acquisition module is used to acquire the object to be rendered in the target virtual scene, wherein the object to be rendered is any object in the target virtual scene; The first determining module is used to determine the static mesh volume in the object to be rendered; The partitioning module is used to partition the static mesh based on the material properties included in the static mesh, thereby obtaining multiple sub-mesh bodies corresponding to different material properties of the static mesh body; The second determining module is used to determine multiple sub-mesh volumes corresponding to all objects in the target virtual scene; The rendering module is used to render the corresponding sub-mesh based on the material properties of each sub-mesh in the target virtual scene, so as to obtain the rendered sub-mesh corresponding to each sub-mesh. The generation module is used to generate the rendered virtual scene corresponding to the target virtual scene based on all the rendered sub-mesh volumes.

9. An electronic device, characterized in that, The electronic device includes: Memory; processor; The memory stores a computer program executable by the processor, which, when executed by the processor, performs the rendering method of the virtual scene according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, perform the rendering method of the virtual scene according to any one of claims 1-7.