Method, device and electronic equipment for generating a virtual scene

By building virtual scenes in a modular way, deleting the obscured surfaces in the terrain module and merging the surfaces with specified orientations, the problem of module connection defects in the virtual scene is solved, the game performance loss is reduced, and the scene effect is improved.

CN114581618BActive Publication Date: 2025-10-10NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210177177.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-25
Publication Date
2025-10-10
Estimated Expiration
2042-02-25

AI Technical Summary

Technical Problem

In virtual scene editing, there are defects in the connection between scene model objects and the surface of the target scene, as well as in the connection between model components and terrain modules, resulting in increased game performance loss.

Method used

The scene model is constructed in a modular way, the faces blocked by the object module in the terrain module are deleted, and the faces with specified orientations are merged and rendered to generate the target virtual scene.

Benefits of technology

It reduces the loss of game performance, solves the connection defects between modules, and improves the effect of virtual scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114581618B_ABST
    Figure CN114581618B_ABST
Patent Text Reader

Abstract

The application provides a virtual scene generation method and device and electronic equipment, acquires a scene model; the scene model comprises a terrain module and at least one object module spliced with the terrain module; in response to a deletion operation for a specified surface in the terrain module, a first model surface with a specified orientation in the scene model is acquired; the specified surface is a surface in the terrain module blocked by the object module; the first model surface and the surface with the specified orientation in the object module are merged to obtain a merged surface; the merged surface and the surface other than the specified orientation in the object module are rendered to generate a target virtual scene. In this way, the overall scene model is built in a modular manner, and the surface in the terrain module blocked by the object module is deleted, thereby reducing unnecessary rendering and reducing the performance loss of the game. The surface with the same orientation in the terrain module and the object module is merged, thereby solving the connection defects between the modules in the virtual scene and improving the effect of the virtual scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of model rendering, and in particular to a method, device and electronic equipment for generating a virtual scene. Background Art

[0002] In the editing and production of virtual scenes, it is usually necessary to use terrain tools, such as Terrain, to edit and produce the target scene. In conventional scene editing and production, the scene model object can usually be directly inserted into the target scene, or it can be spliced ​​with the terrain module in the target scene through modular model components. However, in the above-mentioned scene production method, defects will appear at the junction of the scene model object and the surface of the target scene, as well as at the connection between the model component and the terrain module. In the related art, transparent vegetation models or transparent patches are usually used to block the defects at the junction. However, this method of scene production that requires vegetation models will result in many obscured model faces and vertices in the resulting scene, and these obscured model faces and vertices will also be rendered, which will inevitably increase the loss of game performance. In addition, this scene production method that requires additional transparent patches will also increase the performance consumption of transparent rendering. Summary of the Invention

[0003] In view of this, an object of the present invention is to provide a method, device and electronic device for generating a virtual scene, so as to reduce the loss of game performance and improve the effect of the virtual scene.

[0004] In a first aspect, an embodiment of the present invention provides a method for generating a virtual scene, the method comprising: obtaining a scene model; wherein the scene model comprises: a terrain module and at least one object module spliced ​​with the terrain module; in response to a deletion operation on a specified face in the terrain module, obtaining a first model face of the scene model; wherein the first model face has a specified orientation; the specified face is a face in the terrain module that is blocked by the object module; merging the first model face and the face with the specified orientation in the object module to obtain a merged face; rendering the merged face and the faces in the object module other than the specified orientation to generate a target virtual scene.

[0005] Furthermore, the step of rendering the merged surface and the surfaces other than the specified orientation in the object module to generate the target virtual scene includes: mapping the merged surface to obtain the target merged surface; rendering the target merged surface and the surfaces other than the specified orientation in the object module to generate the target virtual scene.

[0006] Furthermore, the step of performing mapping processing on the merged surface to obtain the target merged surface includes: responding to the target material creation operation for the merged surface to obtain the target material; responding to the drawing operation for the target channel map, mixing the preset mixed map into the target material according to the preset channel order to obtain the target channel map; responding to the mapping operation for the merged surface, performing mapping processing on the merged surface according to the target channel map and the preset surface map to obtain the target merged surface.

[0007] Furthermore, the step of rendering the target merged faces and faces other than the specified orientation in the object module to generate the target virtual scene includes: responding to the acquisition operation of the faces other than the specified orientation of the object module, acquiring the model side of the object module from the scene model; responding to the rendering operation of the target merged faces and the model side, rendering the target merged faces and the model side according to pre-configured rendering parameters and a pre-drawn light effect map to generate the target virtual scene.

[0008] Furthermore, after the step of merging the first model surface and the surface with a specified orientation in the object module to obtain the merged surface, the method also includes: responding to the UV expansion operation on the merged surface, performing 1uv expansion processing and 2uv expansion processing on the merged surface respectively, to obtain a first expansion result and a second expansion result; wherein the first expansion result is used for mapping processing in the merged surface, and the second expansion result is used for rendering light effects in the merged surface.

[0009] Furthermore, in response to an acquisition operation for a face other than the specified orientation of the object module, after the step of acquiring the model side of the object module from the scene model, the method also includes: responding to a UV expansion operation for the model side, performing 2UV expansion processing on the model side to obtain a third expansion result; wherein the third expansion result is used to render light effects on the model side.

[0010] Furthermore, the scene model is constructed in the following manner: in response to a digging operation on a digging module having a first specified size, the digging module is controlled to perform digging processing in the initial terrain module to obtain a terrain module in the scene model; in response to a splicing operation on an object module having a second specified size, the object module is controlled to be spliced ​​to a specified position of the terrain module to construct the scene model.

[0011] In a second aspect, an embodiment of the present invention provides a device for generating a virtual scene, the device comprising: an acquisition module for acquiring a scene model; wherein the scene model comprises: a terrain module and at least one object module spliced ​​with the terrain module; a deletion module, which responds to a deletion operation on a specified face in the terrain module to acquire a first model face of the scene model; wherein the first model face has a specified orientation; the specified face is a face in the terrain module that is obscured by the object module; a merging module for merging the first model face and the face with the specified orientation in the object module to obtain a merged face; and a generation module for rendering the merged face and the faces in the object module other than the specified orientation to generate a target virtual scene.

[0012] In a third aspect, an embodiment of the present invention provides an electronic device comprising a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the method for generating a virtual scene according to any one of the first aspects.

[0013] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method for generating a virtual scene of any one of the first aspects.

[0014] The embodiments of the present invention bring the following beneficial effects:

[0015] The present invention provides a method, device and electronic device for generating a virtual scene, which obtains a scene model; the scene model includes a terrain module and at least one object module spliced ​​with the terrain module; in response to a deletion operation on a specified face in the terrain module, obtains a first model face with a specified orientation in the scene model; the specified face is a face in the terrain module that is blocked by the object module; the first model face and the face with the specified orientation in the object module are merged to obtain a merged face; the merged face and the faces other than the specified orientation in the object module are rendered to generate a target virtual scene. In this method, the overall scene model is constructed in a modular manner, and the faces in the terrain module that are blocked by the object module are deleted, which reduces unnecessary rendering and reduces the performance loss of the game. The faces with the same orientation in the terrain module and the object module are merged, which solves the connection defects between modules in the virtual scene and improves the effect of the virtual scene.

[0016] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or understood by practicing the present invention. The purposes and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0017] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 A flowchart of a method for generating a virtual scene provided by an embodiment of the present invention;

[0020] Figure 2 A schematic diagram of an object module provided by an embodiment of the present invention;

[0021] Figure 3 A schematic diagram of a scene model provided by an embodiment of the present invention;

[0022] Figure 4 A schematic diagram of a first model surface in a scene model provided by an embodiment of the present invention;

[0023] Figure 5 A schematic diagram of a part of a scene model provided by an embodiment of the present invention;

[0024] Figure 6 A schematic diagram of merging faces in a scene model provided by an embodiment of the present invention;

[0025] Figure 7 A schematic diagram of another scene model provided by an embodiment of the present invention;

[0026] Figure 8 A schematic structural diagram of a device for generating a virtual scene provided by an embodiment of the present invention;

[0027] Figure 9 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0028] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work shall fall within the scope of protection of the present invention.

[0029] In virtual scene editing, a terrain tool such as Terrain (a terrain system of an engine software, generally used for drawing material fusion, drawing ups and downs, and batch brushing vegetation) is usually used. The Terrain has its own series of file forms and implementation modes, and it is not necessary for all game types to have these Terrain parameters and record files. Therefore, in some game types, performance waste is inevitable. In conventional scene editing, scene model objects can be directly inserted into a target scene, or can be spliced with a terrain module in the target scene through a modular model component. However, in the above scene production methods, defects occur at the junction of the scene model object and the ground surface of the target scene, and at the connection of the model component and the terrain module.

[0030] For example, a virtual object (a stone) is placed on a terrain surface. In the real world, the junction of the stone and the ground surface is not just a line, but there is mud or moss as a medium to make the ground and the stone perfectly integrated. Therefore, a vegetation model is used to cover the joint to cover the defects at the joint. However, in this way of producing a scene by using a vegetation model, many model surfaces and vertices are covered, and these covered model surfaces and vertices are also rendered, which inevitably increases the loss of game performance.

[0031] In addition, when the modular model component is spliced with the terrain module in the target scene, since the value of the terrain module changes with the size of the terrain chunk file, it is difficult to lock the uv position like the model, so that a gap occurs at the junction of the Terrain and the scene modular model, and an additional surface is needed to cover the defects at the joint, which also increases the performance consumption of the surface rendering.

[0032] Based on this, the embodiment of the present application provides a virtual scene generation method, device and electronic equipment, which can be applied to a device having a function of generating a virtual scene, and is especially suitable for MOBA (Multiplayer Online Battle Arena) games, MMORPG (Massive (or Massively) Multiplayer Online Role-Playing Game) games, and games with buff effects on the soles of characters and flat road surfaces.

[0033] To facilitate the understanding of the present embodiment, first, a virtual scene generation method disclosed by the present embodiment is introduced in detail, as shown in the following formula (I): Figure 1 The method comprises the following steps.

[0034] Step S102: Acquire a scene model; wherein the scene model includes: a terrain module and at least one object module spliced ​​with the terrain module;

[0035] The above scene model refers to a scene model built in a modular production method. Specifically, you can install the Terrain tool in the game engine (such as Neox2.0) to build the scene in a modular production method. First, dig a hole in the plane to get the terrain module. In fact, it is like building blocks. A complex scene is made by piecing together multiple small modules of the same specifications. Then, pre-made object modules (such as Figure 2 As shown, it includes object modules of various shapes) spliced ​​to the terrain module to obtain Figure 3 The scene model shown here is identical in shape between the object and terrain modules to ensure smooth integration between them. For example, the top view of the object module is square. Besides squares, triangles and hexagons can also serve as object modules. Finally, export the scene model from Neox to .fbx or .obj, then import it into 3ds Max.

[0036] Step S104, in response to the deletion operation on the specified face in the terrain module, obtaining a first model face of the scene model; wherein the first model face has a specified orientation; the specified face is a face in the terrain module that is blocked by the object module;

[0037] Since the scene model is composed of the object module and the terrain module, the splicing area of ​​the terrain module, that is, the specified surface, will also participate in the rendering process to increase the rendering performance. Therefore, the specified surface in the terrain module can be deleted in the Max software. The first model surface of the scene model obtained is as follows: Figure 4 That is, in 3dmax, delete the surface with high and low difference in Terrain, and keep the upper and lower plane parts. The above specified direction is usually the horizontal plane of the terrain module. In the terrain module, since there are multiple heights, each height has the horizontal plane of the terrain module, such as Figure 4 The shown includes four layers.

[0038] Step S106 , merging the first model surface and the surface with the specified orientation in the object module to obtain a merged surface;

[0039] Since the terrain module and the object module are spliced ​​together and may have different textures, in order to reduce splicing defects and rendering effects, the first model surface and the surface with a specified orientation in the object module can be merged. Specifically, in the Max software, merge the surfaces in the object module that are connected to the first model surface, such as Figure 5The partial model of the scene model shown in FIG. 1 , wherein the square-shaped area is the first model surface; the triangular-shaped area is the surface of the object module that has the same orientation as the first model surface. The surface with a specified orientation in the object module can also be understood as the upper and lower planes of the object module. For example, see Figure 5 As shown, the first model surface of the grid-shaped area 1 can be merged with the surface of the triangular area 2, the first model surface of the grid-shaped area 3 can be merged with the surface of the triangular area 4, and the surface of the dotted area (that is, the triangular area) can be merged with the first model surface with the same orientation, and finally the above-mentioned merged surface can be obtained, as shown in FIG. Figure 6 As shown, the plane at each height is a complete merged surface.

[0040] Step S108 , rendering the merged faces and faces other than those in the specified direction in the object module to generate a target virtual scene.

[0041] The faces other than the specified directions in the object module above refer to the side faces of the object module, such as Figure 5 The scene model shown includes faces other than the merged faces. Specifically, the merged faces and faces other than the specified directions in the object module can be input into the game engine, and the baking tool of the ue4 engine can be used through the plug-in to make a lighting effect map for the merged faces and faces other than the specified directions in the object module. Since the rendering results need to be transmitted back to the game engine, the rendering parameters need to be set before rendering. The same rendering parameters need to be set in the game engine and the ue4 engine borrowed by the plug-in. For example, the accuracy of the rendering parameters is 1024. Finally, after the parameters are set, the lighting effect map is rendered to the merged faces and faces other than the specified directions in the object module to generate the above-mentioned target virtual scene, as shown in the figure. Figure 7 As shown in the figure, only the area pointed by the arrow has a seam, and the other areas are a complete plane.

[0042] An embodiment of the present invention provides a method for generating a virtual scene, which includes obtaining a scene model; the scene model includes a terrain module and at least one object module spliced ​​with the terrain module; in response to a deletion operation on a specified face in the terrain module, obtaining a first model face with a specified orientation in the scene model; the specified face is a face in the terrain module that is blocked by the object module; merging the first model face with the face with the specified orientation in the object module to obtain a merged face; rendering the merged face and faces other than the specified orientation in the object module to generate a target virtual scene. In this method, the overall scene model is constructed in a modular manner, and faces in the terrain module that are blocked by the object module are deleted, thereby reducing unnecessary rendering and lowering the performance loss of the game; faces with the same orientation in the terrain module and the object module are merged, thereby solving the connection defects between modules in the virtual scene and improving the effect of the virtual scene.

[0043] Since there are splicing defects between the first model surface and the surface with the specified orientation in the object module, and the surface mapping is different, in order to improve the effect of the virtual model and improve rendering efficiency, the merged surface and the surfaces other than the specified orientation in the object module are rendered to generate the target virtual scene. A possible implementation method is as follows:

[0044] (1) Mapping the merged surface to obtain the target merged surface;

[0045] The above-mentioned merged surface may include multiple surfaces, so each merged surface needs to be mapped. Specifically, the channel map of the merged surface can be determined first, and then the merged surface is mapped based on the channel map to obtain the above-mentioned target merged surface.

[0046] A possible implementation method is: responding to a target material creation operation for the merged surface to obtain a target material; responding to a drawing operation for a target channel map, mixing a preset mixed map into the target material according to a preset channel order to obtain a target channel map; responding to a mapping operation for the merged surface, mapping the merged surface according to the target channel map and a preset surface map to obtain a target merged surface.

[0047] The preset channel order mentioned above can be ARGB, and the preset mixed map can be set according to actual needs. Specifically, you can export the merged surface as an fbx file in the Max software and import it into Unity. Use the third-party plug-in T4M to paste 4 surface maps for mixing in ARGB order on the T4M panel, select one of them to start drawing, and finally get the drawn target channel map, that is, the ARGB map. Then export the merged surface in the Max software to the game engine Neox2, use the material shader / x11pbr_miniterrain.surf, import the target channel map drawn in Unity into the game engine Neox2, and paste the target channel map with the surface map at the specified position of the material ball to obtain the above-mentioned target merged surface. It should be noted that because the four ARGB channels each represent a map, the order must be consistent with the order in Uniy to restore the effect. There is also a normal channel for the corresponding position in the material ball.

[0048] In the above method, the merged surface is enriched by setting the target channel map to the merged surface and performing mixed mapping processing.

[0049] (2) Rendering is performed on the target merged faces and faces other than those with the specified orientation in the object module to generate the target virtual scene.

[0050] In fact, since the planes of the scene model have been merged, it is only necessary to create one light effect map, and use the light effect map to render the surface of the scene model.

[0051] In the above method, by mapping the merged surface, the plane can be mapped Figure 1 The merged faces that have been textured and the faces other than those with the specified orientation in the object module will be rendered. The generated target virtual scene can solve the problem of texture gaps and the gaps caused by the edges of light effect maps. The expanded drawing range of the surface makes the drawing more vivid and flexible, which is more conducive to making picture layers, and the package size is smaller and the performance is better.

[0052] A possible implementation method is as follows: in response to an acquisition operation on a face other than a specified orientation of the object module, the model side face of the object module is acquired from the scene model; in response to a rendering operation on the target merged face and the model side face, the target merged face and the model side face are rendered according to pre-configured rendering parameters and a pre-drawn lighting effect map to generate a target virtual scene.

[0053] The pre-drawn light effect map is created in the game engine through a plug-in using the UE4 engine. After creation, it is returned to the game engine. Using pre-configured rendering parameters and the pre-drawn light effect map, the target merged surface and model side are rendered to generate the target virtual scene. In addition, because the rendering process requires the use of both the UE4 engine and the game engine, the rendering parameters of the UE4 engine and the game engine must be pre-set before importing the target merged surface and model side. For example, the rendering parameter precision must be set to 1024. This rendering process can also be called baking.

[0054] In Max, the faces of the scene model outside the specified orientation (i.e., the model's side faces) are exported to the game engine. Simultaneously, the target merged faces are also exported to the game engine in Unity. A lighting map is then created using the UE4 engine plugin. Finally, the target merged faces and model's side faces are rendered in the game engine using pre-configured rendering parameters and pre-drawn lighting maps to generate the target virtual scene.

[0055] In the above method, since the plane of the terrain module is merged with the plane of the object module, a light effect map can be drawn to render the scene model, which solves the defects at the seams of the planes and further improves the effect of the virtual scene.

[0056] In order to enable mapping and rendering operations on the merged surface and the side surface of the model in the subsequent rendering process, and at the same time to simplify the light effect map to one, thereby improving the rendering accuracy, the first model surface and the surface with a specified orientation in the object module are merged to obtain the merged surface. After the step, the above method also includes: responding to the UV expansion operation on the merged surface, performing 1UV expansion processing and 2UV expansion processing on the merged surface respectively, to obtain a first expansion result and a second expansion result; wherein the first expansion result is used for mapping processing in the merged surface, and the second expansion result is used for rendering the light effect in the merged surface.

[0057] It's important to note that the Terrain tool has a heightmap drawing channel for creating undulations, but it doesn't support editing triangle routing, UV unwrapping, or secondary UV processing. The T4M (Texture Tour Mask) tool, which blends four textures through the ARGB channels, is a static model and can't be used to create heights. However, the advantage of T4M is that it can be edited in professional modeling software like Max and Maya and then imported into the engine. It can edit triangle routing, perform UV unwrapping, and perform secondary UV processing. The benefit of triangle routing is that it can create richer and more detailed contours, allowing for the creation of any smooth shape.

[0058] In Max, the merged surfaces were processed with 1UV and 2UV respectively. The 1UV expansion operation was to solve the seam problem with the module caused by the size value of the Terrain tool, and the UV at the previous gap can be seamlessly connected together without any seams. The 2UV expansion operation was to solve the seams caused by insufficient lighting effect accuracy, and to maximize the use of the lighting effect map.

[0059] In the above method, by performing 1uv expansion processing and 2uv expansion processing on the merged surface, the mapping effect and rendering accuracy of the merged surface are improved.

[0060] Furthermore, in response to an acquisition operation for a face other than the specified orientation of the object module, after the step of acquiring the model side of the object module from the scene model, the above method also includes: responding to a UV expansion operation for the model side, performing 2UV expansion processing on the model side to obtain a third expansion result; wherein the third expansion result is used to render light effects on the model side.

[0061] In Max, the sides of the model were individually 2UV expanded. The purpose of the 2UV expansion operation is to avoid wasting 2U. The top and bottom surfaces are merged onto the Terrain, leaving a large gap in the module 2U. Therefore, the lighting effect map accuracy is improved by reorganizing the 2U. In this method, the rendering accuracy of the object module is improved by 2UV expansion of the side of the model.

[0062] Specifically, after performing 1UV unwrapping on the merged surface, the merged surface will store the 1UV unwrapping result. When mapping the merged surface, the 1UV unwrapping result, i.e., the first unwrapping result, can be used to map the merged surface. After performing 2UV unwrapping on the merged surface and the side surface of the model, the merged surface and the side surface of the model will store the 2UV unwrapping result. When rendering the target merged surface and the side surface of the model, the 2UV unwrapping results, i.e., the second and third unwrapping results, can be used to render the merged surface, thereby improving rendering accuracy.

[0063] In addition, the advantage of being able to edit 1u is that the gaps can be removed by UV connection, and the UV space can be used to the maximum extent. The advantage of being able to edit 2u is that the utilization rate of the light effect map is maximized, and only manual control can be used to subjectively control the weight of the light effect.

[0064] The following describes the method of constructing the above-mentioned scene model: in response to the digging operation of the digging module with a first specified size, the digging module is controlled to perform digging processing in the initial terrain module to obtain the terrain module in the scene model; in response to the splicing operation of the object module with a second specified size, the object module is controlled to be spliced ​​to the specified position of the terrain module to construct the scene model.

[0065] The first specified size is usually the same as the second specified size. The second specified size refers to the size of the object module after it is transformed into a whole cube. Specifically, in the Terrain tool, according to actual needs, the digging module is controlled to dig holes in the initial terrain module, and then Figure 2 The object modules shown are spliced ​​to the designated positions of the terrain modules as needed, and the following can be obtained in the end: Figure 3 Compared to traditional methods of making field maps, the modular production approach reduces the loss of game performance.

[0066] This approach solves the problem of gaps between terrain and modular components, as well as gaps caused by light effect map edges. It provides a more integrated and space-saving design. Modular components' light effect maps are more precise, and the terrain light effect maps are combined into a single map, saving performance. The expanded surface drawing range makes drawing more vivid and flexible, and is more conducive to creating layered graphics. This results in a smaller package size and improved performance.

[0067] Corresponding to the above method embodiment, the embodiment of the present invention provides a device for generating a virtual scene, such as Figure 8 As shown, the device includes:

[0068] An acquisition module 81 is configured to acquire a scene model, wherein the scene model includes a terrain module and at least one object module spliced ​​with the terrain module;

[0069] A deletion module 82, in response to a deletion operation on a specified face in the terrain module, obtains a first model face of the scene model; wherein the first model face has a specified orientation; the specified face is a face in the terrain module that is blocked by the object module;

[0070] a merging module 83 for merging the first model surface and the surface with a specified orientation in the object module to obtain a merged surface;

[0071] The generation module 84 is used to render the merged faces and faces other than those with the specified directions in the object module to generate a target virtual scene.

[0072] An embodiment of the present invention provides a device for generating a virtual scene, which obtains a scene model; the scene model includes a terrain module and at least one object module spliced ​​with the terrain module; in response to a deletion operation on a specified face in the terrain module, obtains a first model face with a specified orientation in the scene model; the specified face is a face in the terrain module that is blocked by the object module; the first model face and the face with the specified orientation in the object module are merged to obtain a merged face; the merged face and the faces other than the specified orientation in the object module are rendered to generate a target virtual scene. In this method, the overall scene model is constructed in a modular manner, and the faces in the terrain module that are blocked by the object module are deleted, which reduces unnecessary rendering and reduces the performance loss of the game. The faces with the same orientation in the terrain module and the object module are merged, which solves the connection defects between modules in the virtual scene and improves the effect of the virtual scene.

[0073] Furthermore, the generation module is further configured to: perform mapping processing on the merged surface to obtain a target merged surface; and perform rendering processing on the target merged surface and surfaces other than those with a specified orientation in the object module to generate a target virtual scene.

[0074] Furthermore, the above-mentioned generation module is also used to: respond to the target material creation operation for the merged surface to obtain the target material; respond to the drawing operation for the target channel map, mix the preset mixed map into the target material according to the preset channel order to obtain the target channel map; respond to the mapping operation for the merged surface, map the merged surface according to the target channel map and the preset surface map to obtain the target merged surface.

[0075] Furthermore, the above-mentioned generation module is also used to: respond to the acquisition operation of the face other than the specified orientation of the object module, and obtain the model side of the object module from the scene model; respond to the rendering operation of the target merged face and the model side, and render the target merged face and the model side according to the pre-configured rendering parameters and the pre-drawn lighting effect map to generate the target virtual scene.

[0076] Furthermore, the above-mentioned device also includes a first UV expansion unit, which is used to: respond to the UV expansion operation on the merged surface, perform 1uv expansion processing and 2uv expansion processing on the merged surface respectively, and obtain a first expansion result and a second expansion result; wherein the first expansion result is used for mapping processing in the merged surface, and the second expansion result is used for rendering light effects in the merged surface.

[0077] Furthermore, the above-mentioned device also includes a second UV expansion unit, which is used to: respond to the UV expansion operation on the side of the model, perform 2UV expansion processing on the side of the model, and obtain a third expansion result; wherein the third expansion result is used to render light effects on the side of the model.

[0078] Furthermore, the above-mentioned device also includes a model building unit, which is used to: respond to the digging operation of the digging module with a first specified size, control the digging module to perform digging processing in the initial terrain module, and obtain the terrain module in the scene model; respond to the splicing operation of the object module with a second specified size, control the object module to be spliced ​​to the specified position of the terrain module, and build the scene model.

[0079] The device for generating a virtual module provided in the embodiment of the present invention has the same technical features as the method for generating a virtual module provided in the above embodiment, and therefore can solve the same technical problems and achieve the same technical effects.

[0080] This embodiment further provides an electronic device, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the above-mentioned method for generating a virtual scene. The electronic device can be a server or a terminal device.

[0081] See also Figure 9 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores computer-executable instructions that can be executed by the processor 100. The processor 100 executes the computer-executable instructions to implement the above-mentioned virtual scene generation method.

[0082] Furthermore, Figure 9 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 100 , the communication interface 103 and the memory 101 are connected via the bus 102 .

[0083] The memory 101 can include a random access memory (RAM) and can also include a non-volatile memory such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which can be wired or wireless), and the Internet, a wide area network, a local area network, a metropolitan area network, etc. can be used. The bus 102 can be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 9 Only one bidirectional arrow is used to represent the bus in the figure, but it does not mean that there is only one bus or only one type of bus.

[0084] The processor 100 can be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above method can be completed by the integrated logic circuit of hardware in the processor 100 or the instruction in the form of software. The processor 100 described above 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 gates or transistor logic devices, discrete hardware components. Each method, step and logic block disclosed in the embodiment of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiment of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium in the art. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and combines the hardware to complete the steps of the method of the above embodiment.

[0085] The embodiment also provides a computer readable storage medium, the computer readable storage medium stores computer executable instructions, when the computer executable instructions are called and executed by the processor, the computer executable instructions cause the processor to realize the above-mentioned virtual scene generation method.

[0086] The computer program product of the virtual scene generation method, device, electronic device and system provided by the embodiment of the application comprises a computer readable storage medium storing program codes, the program codes comprise instructions for executing the method described in the foregoing method embodiments, and specific implementation can be referred to the method embodiments, and details are not described herein.

[0087] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the foregoing method embodiments, and details are not described herein.

[0088] In addition, in the description of the embodiment of the application, unless otherwise explicitly specified and limited, the terms “mounting”, “connection”, “connecting” should be understood in a broad sense, for example, can be fixed connection, can also be detachable connection, or integrally connected; can be mechanical connection, can also be electrical connection; can be directly connected, can also be indirectly connected through an intermediate medium, can be the communication inside two elements. For those skilled in the art, the specific meaning of the above terms in the application can be understood according to specific circumstances.

[0089] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the application or the part of the technical solutions that essentially contribute to the prior art or the part of the technical solutions can be embodied in the form of software products. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0090] In the description of the application, it should be noted that the terms “center”, “upper”, “lower”, “left”, “right”, “vertical”, “horizontal”, “inner”, “outer” and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, therefore cannot be understood as a limitation on the application. In addition, the terms “first”, “second”, “third” are only for the purpose of description, and cannot be understood as indicating or implying relative importance.

[0091] Finally, it should be noted that the above embodiments are only specific implementation methods of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above embodiments within the technical scope disclosed by the present invention, or replace some of the technical features therein with equivalents. Such modifications, changes or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A method for generating a virtual scene, characterized in that: The method comprises: Acquire a scene model; wherein the scene model includes: a terrain module and at least one object module spliced ​​with the terrain module; In response to a deletion operation on a specified face in the terrain module, obtaining a first model face of the scene model; wherein the first model face has a specified orientation; and the specified face is a face in the terrain module that is blocked by the object module; Merging the first model surface and a surface in the object module that has the specified orientation and is connected to the first model surface to obtain a merged surface; Rendering is performed on the merged surface and the surfaces other than those in the specified direction in the object module to generate a target virtual scene.

2. The method according to claim 1, characterized in that The step of rendering the merged surface and the surfaces in the object module other than those in the specified direction to generate a target virtual scene includes: Performing mapping processing on the merged surface to obtain a target merged surface; Rendering is performed on the target merged surface and the surfaces other than the specified orientation in the object module to generate a target virtual scene.

3. The method according to claim 2, characterized in that The step of performing mapping processing on the merged surface to obtain a target merged surface includes: In response to a target material creation operation for the merged surface, the target material is obtained; In response to a drawing operation on a target channel map, a preset mixed map is mixed into the target material according to a preset channel order to obtain the target channel map; In response to the mapping operation on the merged surface, the merged surface is mapped according to the target channel map and a preset surface map to obtain the target merged surface.

4. The method according to claim 2, characterized in that The step of rendering the target merged surface and the surfaces other than those in the specified direction in the object module to generate a target virtual scene includes: In response to an acquisition operation for a face of the object module other than the specified direction, acquiring a model side face of the object module from the scene model; In response to the rendering operation on the target merged surface and the side surface of the model, the target merged surface and the side surface of the model are rendered according to pre-configured rendering parameters and a pre-drawn light effect map to generate the target virtual scene.

5. The method according to claim 1, wherein After the step of merging the first model surface and the surface having the specified orientation in the object module to obtain a merged surface, the method further includes: In response to the UV expansion operation on the merged surface, the merged surface is subjected to 1UV expansion processing and 2UV expansion processing respectively to obtain a first expansion result and a second expansion result; wherein, the first expansion result is used for mapping processing on the merged surface, and the second expansion result is used for rendering light effects in the merged surface.

6. The method according to claim 3, characterized in that After the step of obtaining the model side of the object module from the scene model in response to the operation of obtaining the face of the object module other than the specified direction, the method further includes: In response to the UV unfolding operation on the side surface of the model, a 2UV unfolding process is performed on the side surface of the model to obtain a third unfolding result; wherein the third unfolding result is used to render a light effect on the side surface of the model.

7. The method according to claim 1, characterized in that The scenario model is constructed in the following way: In response to a hole digging operation on a hole digging module having a first specified size, controlling the hole digging module to perform a hole digging process in an initial terrain module to obtain a terrain module in the scene model; In response to the splicing operation on the object module with the second specified size, the object module is controlled to be spliced ​​to the specified position of the terrain module to construct the scene model.

8. A device for generating a virtual scene, characterized in that: The device comprises: An acquisition module, configured to acquire a scene model; wherein the scene model includes: a terrain module and at least one object module spliced ​​with the terrain module; a deletion module, which responds to a deletion operation on a specified face in the terrain module and obtains a first model face of the scene model; wherein the first model face has a specified orientation; and the specified face is a face in the terrain module that is blocked by the object module; a merging module, configured to merge the first model surface and a surface in the object module that has the specified orientation and is connected to the first model surface, to obtain a merged surface; The generation module is used to render the merged surface and the surfaces other than the specified orientation in the object module to generate a target virtual scene.

9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the method for generating a virtual scene according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method for generating a virtual scene according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data processing method, device and equipment of game scene, and readable storage medium

    CN110368694A

  • Three-dimensional scene generation method and device, equipment and storage medium

    CN112516597A