Terrain model control method and device, storage medium and electronic device

CN116310168BActive Publication Date: 2026-10-09NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310180732.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-20
Publication Date
2026-10-09
Estimated Expiration
2043-02-20

AI Technical Summary

Technical Problem

[0004]本申请至少部分实施例提供了一种地形模型的控制方法、装置、存储介质以及电子装置,以至少解决地形模型的生成效率低的技术问题

Benefits of technology

[0009] In at least some embodiments of this application, a generation instruction for a first game scene model is received; in response to the first model height exceeding a specified model height, a second game scene model is determined from a specified base model library based on the first model height; a geometric transformation is performed on the second game scene model to adjust the second game scene model from a second model height to a first model height, and the transformed second game scene model is rendered at a target terrain unit to generate the first game scene model. That is, based on the generation instruction for the first game scene model, the first model height corresponding to the first game scene model is determined. If the first model height exceeds a specified model height, a geometric transformation is performed on the second game scene model determined from the specified base model library to adjust the second game scene model from a second model height to a first model height, and the transformed second game scene model is rendered at a target terrain unit to generate the first game scene model. This achieves the purpose of real-time modification of the terrain model, thereby solving the technical problem of low terrain model generation efficiency and realizing the technical effect of improving the terrain model generation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116310168B_ABST
    Figure CN116310168B_ABST
Patent Text Reader

Abstract

The application discloses a terrain model control method and device, a storage medium, and an electronic device. The method comprises the following steps: receiving a generation instruction for a first game scene model; in response to the first model height exceeding a specified model height, determining a second game scene model from a specified base model library according to the first model height; performing geometric transformation on the second game scene model, so that the second game scene model is adjusted from a second model height to the first model height, and the transformed second game scene model is rendered at a target terrain unit. The application solves the technical problem of low generation efficiency of a terrain model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and more specifically, to a method, apparatus, storage medium, and electronic device for controlling a terrain model. Background Technology

[0002] Currently, the main method for generating terrain models is to move the position of terrain vertices based on the height of the raised brush and the ground level. However, since the height of the raised brush and the ground level need to be determined in advance, the terrain created by this method is fixed and cannot change in real time, resulting in the technical problem of low efficiency in terrain model generation.

[0003] There is currently no effective solution to the technical problem of low generation efficiency of the aforementioned terrain models. Summary of the Invention

[0004] At least some embodiments of this application provide a method, apparatus, storage medium, and electronic device for controlling a terrain model, in order to at least solve the technical problem of low efficiency in generating terrain models.

[0005] According to one embodiment of this application, a method for controlling a terrain model is provided. A game terrain scene is provided through a graphical user interface. The game terrain scene includes multiple terrain units that can be used to construct the game scene model. The method may include: receiving a generation instruction for a first game scene model, wherein the generation instruction includes a first model height corresponding to the first game scene model and a target terrain unit for generating the first game scene model; responding to a first model height exceeding a specified model height, determining a second game scene model from a specified base model library based on the first model height, wherein the second game scene model includes a second model height, and the second model height is ≤ less than or equal to the specified model height; performing a geometric transformation on the second game scene model to adjust the second game scene model from the second model height to the first model height, and rendering the transformed second game scene model at the target terrain unit.

[0006] According to one embodiment of this application, a terrain model control device is also provided, which provides a game terrain scene through a graphical user interface. The game terrain scene includes multiple terrain units that can be used to build the game scene model. The device may include: a receiving unit for receiving a generation instruction for a first game scene model, wherein the generation instruction includes a first model height corresponding to the first game scene model and a target terrain unit for generating the first game scene model; a determining unit for determining a second game scene model from a specified base model library based on the first model height in response to the first model height exceeding a specified model height, wherein the second game scene model includes a second model height, and the second model height is less than or equal to the specified model height; and a transformation unit for performing a geometric transformation on the second game scene model to adjust the second game scene model from the second model height to the first model height, and rendering the transformed second game scene model at the target terrain unit.

[0007] According to one embodiment of this application, a computer-readable storage medium is also provided, which stores a computer program, wherein the computer program is configured to execute the control method of the terrain model described above when it is run.

[0008] According to one embodiment of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to execute the above-described terrain model control method.

[0009] In at least some embodiments of this application, a generation instruction for a first game scene model is received; in response to the first model height exceeding a specified model height, a second game scene model is determined from a specified base model library based on the first model height; a geometric transformation is performed on the second game scene model to adjust the second game scene model from a second model height to a first model height, and the transformed second game scene model is rendered at a target terrain unit to generate the first game scene model. That is, based on the generation instruction for the first game scene model, the first model height corresponding to the first game scene model is determined. If the first model height exceeds a specified model height, a geometric transformation is performed on the second game scene model determined from the specified base model library to adjust the second game scene model from a second model height to a first model height, and the transformed second game scene model is rendered at a target terrain unit to generate the first game scene model. This achieves the purpose of real-time modification of the terrain model, thereby solving the technical problem of low terrain model generation efficiency and realizing the technical effect of improving the terrain model generation efficiency. Attached Figure Description

[0010] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0011] Figure 1 This is a hardware structure block diagram of a terminal device for a terrain model control method according to an embodiment of this application;

[0012] Figure 2 This is a flowchart of a terrain model control method according to an embodiment of this application;

[0013] Figure 3 This is a schematic diagram of a surface module in a related art according to an embodiment of this application;

[0014] Figure 4 This is a schematic diagram of a special terrain model according to an embodiment of this application;

[0015] Figure 5 This is a schematic diagram of a surface module being pulled up according to an embodiment of this application;

[0016] Figure 6(a) is a schematic diagram of a 4-field and an 8-field according to an embodiment of the present application;

[0017] Figure 6(b) is a schematic diagram of an infinitely extended surface module according to an embodiment of this application;

[0018] Figure 7 This is a schematic diagram of a large rift valley according to an embodiment of this application;

[0019] Figure 8 This is a schematic diagram of a ramp according to an embodiment of this application;

[0020] Figure 9 This is a schematic diagram of the vertex connection of the edge lines of a model according to an embodiment of this application;

[0021] Figure 10 This is a schematic diagram of the normal connection of the edge lines of a model according to an embodiment of this application;

[0022] Figure 11 This is a schematic diagram of an intermediate transition zone according to an embodiment of this application;

[0023] Figure 12 This is a schematic diagram of an intermediate transition zone according to an embodiment of this application;

[0024] Figure 13 This is a schematic diagram of a lower transition zone according to an embodiment of this application;

[0025] Figure 14This is a schematic diagram of a surface material according to an embodiment of this application;

[0026] Figure 15 This is a schematic diagram of a three-directional projection according to an embodiment of this application;

[0027] Figure 16 This is a schematic diagram of a noise map according to an embodiment of this application;

[0028] Figure 17 This is a schematic diagram of a detailed crack according to an embodiment of this application;

[0029] Figure 18 This is a schematic diagram illustrating the final material usage of a shader according to an embodiment of this application;

[0030] Figure 19 This is a schematic diagram illustrating the effect of different materials on the ground surface according to an embodiment of this application;

[0031] Figure 20 This is a schematic diagram illustrating the effect of a wall module according to an embodiment of this application;

[0032] Figure 21 This is a schematic diagram illustrating a wall and cliff effect according to an embodiment of this application;

[0033] Figure 22 This is a schematic diagram of a terrain model control device according to an embodiment of this application;

[0034] Figure 23 This is a schematic diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0035] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0036] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0037] According to one embodiment of this application, an embodiment of a terrain model control method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0038] The methods described in this application can be executed in a terminal device, computer terminal, or similar computing device. For example, when running on a terminal device, the terminal device can be a smartphone, tablet computer, PDA, mobile internet device, PAD, game console, or other similar device. Figure 1 This is a hardware structure block diagram of a terminal device for a terrain model control method according to an embodiment of this application. Figure 1 As shown, the terminal device may include one or more ( Figure 1 Only one is shown in the image. Processor 102 (processor 102 may include, but is not limited to, a central processing unit (CPU), graphics processing unit (GPU), digital signal processing (DSP) chip, microprocessor (MCU), programmable logic device (FPGA), neural network processor (NPU), tensor processor (TPU), artificial intelligence (AJ) type processor, etc.) and memory 104 for storing data. In one embodiment of this application, it may also include: input / output device 108 and display device 110.

[0039] In some optional embodiments primarily focused on gaming scenarios, the aforementioned device may also provide a human-computer interaction interface with a touch-sensitive surface. This interface can sense finger contact and / or gestures to interact with a graphical user interface (GUI). The human-computer interaction functions may include the following: creating web pages, drawing, word processing, creating electronic documents, playing games, video conferencing, instant messaging, sending and receiving emails, call interfaces, playing digital videos, playing digital music, and / or web browsing, etc. Executable instructions for performing the aforementioned human-computer interaction functions are configured / stored in one or more processor-executable computer program products or readable storage media.

[0040] Those skilled in the art will understand that Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the terminal device described above. For example, the terminal device may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0041] In one possible implementation, this application provides a method for controlling a terrain model, which provides a game terrain scene through a graphical user interface. The game terrain scene includes multiple terrain units that can be used to construct a game scene model. Figure 2 This is a flowchart of a terrain model control method according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:

[0042] Step S202: Receive generation instructions for the first game scene model.

[0043] In the technical solution provided in step S202 of this application, the first game scene model can be a terrain model that needs to be created, such as protruding peaks, recessed canyons, hillsides, and walls of different materials. The generation instruction can include the first model height corresponding to the first game scene model and the target terrain unit used to generate the first game scene model. The first model height can be the model height of the generated first game scene model, and the target terrain unit can be the terrain grid that constitutes the first game scene model. The standard height of a terrain grid can be 2 meters. This is only an example and is not specifically limited.

[0044] In this embodiment, the first game scene model can be created by generating instructions for the first game scene model, thereby achieving the technical effect of improving the generation efficiency of the terrain model.

[0045] Optionally, the aforementioned generation instructions can also be trigger instructions in a game scene. For example, in an escape room game, a player can trigger an instruction by pressing a switch, which will cause the ground to sink or a crack to appear in the game scene. It should be noted that this is only an example and does not specifically limit the type of generation instructions. Any type of instruction used to generate the first game scene model is within the protection scope of this application, and will not be listed here.

[0046] Step S204: In response to the first model height exceeding the specified model height, determine the second game scene model from the specified base model library based on the first model height.

[0047] In the technical solution provided in step S204 of this application, the basic model library may include a variety of basic terrain models with different heights, such as terrain models with heights of 1-3. The second game scene model may be the basic terrain model of the first game scene model. The second game scene model may include a second model height, wherein the second model height may be less than or equal to the specified model height.

[0048] In this embodiment, if the height of the first model exceeds the specified model height, the second game scene model can be determined from the specified basic model library based on the height of the first model.

[0049] Step S206: Perform a geometric transformation on the second game scene model to adjust the height of the second game scene model from the height of the second model to the height of the first model, and render the transformed second game scene model at the target terrain unit.

[0050] In the technical solution provided in step S206 of this application, after determining the second game scene model from the specified basic model library, the second game scene model can be geometrically transformed according to the height of the first model to adjust the height of the second game scene model from the height of the second model to the height of the first model, and the transformed second game scene model is rendered at the target terrain unit. The transformed second game scene model is the first game scene model generated based on the generation instructions in step S202.

[0051] Optionally, after geometrically transforming the second game scene model, the material texture of the stretched and transformed second game scene model can be rendered at the target terrain unit using a four-way continuous texture map, thereby generating the transformed second game scene model. This avoids deformation problems in the transformed second game scene model, thus achieving the technical effect that the surface in the transformed second game scene model can be raised at any position and that the patterns are connected to each other.

[0052] Optionally, the material regions of the transformed second game scene model can be distinguished using vertex colors. For example, the upper edge material region of the transformed second game scene model is the red channel, and the middle transition zone, which is also an infinitely stretched area, is the blue channel. The vertex color is the color obtained by superimposing the three channels. It should be noted that this is only an example and does not specifically limit the method of distinguishing the material regions of the transformed second game scene model. Any method and process used to distinguish the material regions of the transformed second game scene model is within the protection scope of the embodiments of this application, and will not be elaborated here.

[0053] Through steps S202 to S206 of this application, a generation instruction for a first game scene model is received; in response to the first model height exceeding a specified model height, a second game scene model is determined from a specified base model library based on the first model height; a geometric transformation is performed on the second game scene model to adjust its height from the second model height to the first model height, and the transformed second game scene model is rendered at the target terrain unit to generate the first game scene model. In other words, based on the generation instruction for the first game scene model, the first model height corresponding to the first game scene model is determined. If the first model height exceeds a specified model height, a geometric transformation is performed on the second game scene model determined from the specified base model library to adjust its height from the second model height to the first model height. The transformed second game scene model is then rendered at the target terrain unit to generate the first game scene model. This achieves the goal of real-time modification of the terrain model, thereby solving the technical problem of low terrain model generation efficiency and realizing the technical effect of improving the generation efficiency of terrain models.

[0054] The method described above in this embodiment will be further described below.

[0055] As an optional implementation, step S206, which involves geometrically transforming the second game scene model to adjust its height from the second model height to the first model height, includes: dividing the second game scene model into a first sub-game scene model and a second sub-game scene model based on the second model height; and performing a translation operation on the first sub-game scene model and / or the second sub-game scene model along the height direction of the second model height to adjust the second game scene model from the second model height to the first model height.

[0056] In this embodiment, the first sub-game scene model and the second sub-game scene model can be models obtained by dividing the second game scene model at a certain height. The height of the second model can be composed of the model height of the first sub-game scene model and the model height of the second sub-game scene model. For example, if the model height of the second game scene model is 2 meters, and it is divided at 1.5 meters, the model heights of the first sub-game scene model and the second sub-game scene model can be 1.5 meters and 0.5 meters, respectively. It should be noted that this is only an example and does not specifically limit the way the second game scene model is divided. Any method and process used to divide the second game scene model to obtain the first sub-game scene model and the second sub-game scene model are within the protection scope of the embodiments of this application, and will not be described in detail here.

[0057] In this embodiment, the second game scene model can be divided according to the second model height to obtain a first sub-game scene model and a second sub-game scene model. Then, the first sub-game scene model and / or the second sub-game scene model can be translated according to the height direction of the second model height to adjust the second game scene model from the second model height to the first model height, thereby stretching the terrain model and achieving the technical effect of increasing the richness of the terrain module in the game.

[0058] As an optional implementation, based on the height of the second model, the second game scene model is divided into a first sub-game scene model and a second sub-game scene model, including: determining a cutting line perpendicular to the height of the second model on the second game scene model; and cutting the second game scene model into the first sub-game scene model and the second sub-game scene model according to the cutting line.

[0059] In this embodiment, a cutting line perpendicular to the height of the second game scene model can be determined first on the second game scene model. Then, the second game scene model can be divided into a first sub-game scene model and a second sub-game scene model according to the cutting line. The position of the cutting line can be the position where the second game scene model divides the first sub-game scene model and the second sub-game scene model. For example, the position at the 1.5-meter model height of the second game scene model. This is only an example and the position of the cutting line is not specifically limited.

[0060] Optionally, the cutting line does not include the structured points of the second game scene model, so that when performing translation operations on the first sub-game scene model and / or the second sub-game scene model, the technical effect of making the stretched area avoid all the structured points of the terrain model can be achieved.

[0061] As an optional implementation, the first sub-game scene model and / or the second sub-game scene model are translated along the height direction of the second model to adjust the second game scene model from the second model height to the first model height. This includes: translating the first sub-game scene model along a first target direction, and / or translating the second sub-game scene model along a second target direction to obtain a third sub-game scene model and a fourth sub-game scene model; and connecting the third and fourth sub-game scene models to adjust the second game scene model from the second model height to the first model height.

[0062] In this embodiment, the first target direction can be the direction of the first sub-game scene model relative to the second sub-game scene model, the second target direction can be the direction of the second sub-game scene model relative to the first sub-game scene model, the third sub-game scene model includes the translated first sub-game scene model or the untranslated first sub-game scene model, and the fourth sub-game scene model includes the translated second sub-game scene model or the untranslated second sub-game scene model.

[0063] In this embodiment, a third and fourth sub-game scene model can be obtained by translating the first sub-game scene model according to a first target direction and / or translating the second sub-game scene model according to a second target direction. Then, the third and fourth sub-game scene models are connected so that the height of the second game scene model is adjusted from the height of the second model to the height of the first model, thereby achieving the purpose of stretching the terrain model and realizing the technical effect of increasing the richness of the terrain module in the game.

[0064] As an optional implementation, connecting the third and fourth sub-game scene models to adjust the height of the second game scene model from the second model height to the first model height includes: connecting the third and fourth sub-game scene models with a straight line to adjust the height of the second game scene model from the second model height to the first model height.

[0065] In this embodiment, when connecting the third sub-game scene model and the fourth sub-game scene model, the program can connect the third sub-game scene model and the fourth sub-game scene model with a straight line so that the height of the second game scene model is adjusted from the height of the second model to the height of the first model, thereby achieving the technical effect of improving the generation efficiency of the terrain model.

[0066] It should be noted that the above-described method of directly connecting the third sub-game scene model and the fourth sub-game scene model is only a preferred embodiment and is not specifically limited here. Any method and process used to directly connect the third sub-game scene model and the fourth sub-game scene model is within the protection scope of the embodiments of this application, and will not be listed and described here.

[0067] As an optional implementation, step S206, rendering and generating a transformed second game scene model at the target terrain unit, includes: determining the first edge region of the third sub-game scene model, the first transition region of the third sub-game scene model, the second edge region of the fourth sub-game scene model, the second transition region of the fourth sub-game scene model, and the target region between the third and fourth sub-game scene models; rendering the material textures matching the first edge region, the first transition region, the second edge region, the second transition region, and the target region, respectively, to generate the transformed second game scene model.

[0068] In this embodiment, the first edge region of the third sub-game scene model can be the upper edge region of the transformed second game scene model, the first transition region of the third sub-game scene model can be the upper transition region of the transformed second game scene model, the second edge region of the fourth sub-game scene model can be the lower edge region of the transformed second game scene model, the second transition region of the fourth sub-game scene model can be the lower transition region of the transformed second game scene model, and the target region between the third and fourth sub-game scene models can be the stretched region of the transformed second game scene model.

[0069] In this embodiment, after translating the first sub-game scene model and / or the second sub-game scene model to obtain the third and fourth sub-game scene models, the first edge region, the first transition region, the second edge region, the second transition region, and the target region between the third and fourth sub-game scene models are determined. Then, the material textures matching the first edge region, the first transition region, the second edge region, the second transition region, and the target region are rendered respectively to generate the transformed second game scene model. This avoids deformation problems in the transformed second game scene model and achieves the technical effect that the ground surface in the transformed second game scene model can be raised at any position while ensuring that the patterns are connected.

[0070] Optionally, a four-way continuous texture can be used to render the material textures matching the first edge region, the first transition region, the second edge region, the second transition region, and the target region, respectively. This achieves the technical effect of ensuring that the image effect does not repeat excessively and maintaining randomness by shuffling the textures during sampling. Here, four-way continuous refers to a pattern form that is composed of one or several patterns forming a unit, which is repeatedly extended and expanded in all directions.

[0071] As an optional implementation, the method further includes: adjusting the size of the adjustable material map according to the size of the target area to obtain a material map that matches the target area.

[0072] In this embodiment, when rendering the transformed second game scene model, the size of the adjustable material map can be adjusted according to the size of the target area to obtain a material map that matches the target area. This avoids the situation where the material in the target area is deformed due to stretching, affecting the display effect of the transformed second game scene model, thereby achieving the technical effect that the ground surface in the transformed second game scene model can be displayed normally.

[0073] It should be noted that the above content is only a preferred embodiment for obtaining a material map that matches the target area. The method of adjusting the size of the adjustable material map according to the size of the target area to obtain a material map that matches the target area is not specifically limited here. Any method and process for adjusting the size of the adjustable material map according to the size of the target area to obtain a material map that matches the target area is within the protection scope of the embodiments of this application, and will not be described in detail here.

[0074] As an optional implementation, a translation operation is performed on the first sub-game scene model and / or the second sub-game scene model according to the height direction of the second model height, so that the second game scene model is adjusted from the second model height to the first model height. This includes: determining the game scene model that needs to be translated in the first and second sub-game scene models based on the model type of the first game scene model; and performing a translation operation on the game scene model that needs to be translated according to the height direction of the second model height, so that the second game scene model is adjusted from the second model height to the first model height.

[0075] In this embodiment, the height direction of the second model height includes the horizontal direction and / or the vertical direction, and the model type can be the display type of the first game scene model to be generated, such as cliff, crack, mountain peak, etc. This is only an example and no specific limitation is made on the model type.

[0076] In this embodiment, the game scene model that needs to be translated in the first sub-game scene model and the second sub-game scene model can be determined according to the model type of the first game scene model. Then, the game scene model that needs to be translated is translated according to the height direction of the second model height so that the second game scene model is adjusted from the height of the second model to the height of the first model.

[0077] For example, if the model type of the first game scene model is a mountain peak, and the height direction of the second model can be a vertical direction, then the game scene model that needs to be translated can be translated according to the height direction of the second model to adjust the height of the second game scene model to the height of the first model, that is, the height of the mountain peak. If the model type of the first game scene model is a crack, and the height direction of the second model can be a horizontal direction, then the game scene model that needs to be translated can be translated according to the height direction of the second model to adjust the height of the second game scene model to the height of the first model, that is, the width of the crack.

[0078] It should be noted that the aforementioned vertical pulling direction can include an upward vertical pulling direction, that is, pulling upward to form a convex model, such as a mountain peak. The aforementioned vertical direction can also include a downward vertical pulling direction, that is, pulling downward to form a concave model, such as a cliff. The vertical pulling direction is not specifically limited here. Any method and process of generating a convex or concave model by pulling in the vertical direction is within the protection scope of the embodiments of this application. Examples will not be given here.

[0079] As an optional implementation, based on the model type of the first game scene model, the game scene model that needs to be translated in the first sub-game scene model and the second sub-game scene model is determined, including: in response to the model type of the first game scene model being a raised model type, the first sub-game scene model is determined to be the game scene model that needs to be translated in the first sub-game scene model and the second sub-game scene model; in response to the model type of the first game scene model being a recessed model type, the second sub-game scene model is determined to be the game scene model that needs to be translated in the first sub-game scene model and the second sub-game scene model.

[0080] In this embodiment, the first sub-game scene model can be located above the second sub-game scene model. If the model type of the first game scene model is a raised model type, such as a mountain peak or a high wall, then the first sub-game scene model can be determined as the game scene model that needs to be translated. If the model type of the first game scene model is a recessed model type, such as a cliff or a canyon, then the second sub-game scene model can be determined as the game scene model that needs to be translated.

[0081] It should be noted that the above method of determining the game scene model that needs to be translated based on the model type of the first sub-game scene model is only a preferred implementation. There is no specific limitation on the method of determining the game scene model that needs to be translated based on the model type of the first sub-game scene model. Any method and process for determining the game scene model that needs to be translated based on the model type of the first sub-game scene model is within the protection scope of the embodiments of this application, and will not be described in detail here.

[0082] The technical solutions of the embodiments of this application will be further illustrated below with reference to preferred embodiments.

[0083] In game scenarios, terrain modules are a crucial element. Currently, terrain modules in game scenarios mainly include various different landforms, such as flat land, hillsides, and ground fissures, to increase the richness of the terrain. Furthermore, in most ordinary game scenarios, the surface model and shape are fixed before the game starts and cannot be changed in real time.

[0084] In related technologies, terrain is mainly created by raising and lowering the ground height using a raised brush and recording it in a height map. During game runtime, the terrain vertices are moved by reading the height map to generate the terrain. However, the terrain created by this method cannot be changed in real time, so it can only make the raised surface modules look like mountains, but cannot change the raised parts into walls or other specific art model effects.

[0085] Figure 3 This is a schematic diagram of a surface module in a related art according to an embodiment of this application, such as... Figure 3 As shown, in related technologies, the surface module of the editor can rise, but it cannot make adjacent models rise, which will result in a cake-like fault.

[0086] Furthermore, the technology cannot arbitrarily raise or lower the grid in the phase field when generating terrain modules, making it impossible to infinitely raise or lower the terrain modules in real time, and also unable to achieve the hollowed-out terrain effect of the Great Rift Valley. Therefore, it imposes certain limitations on the art style and landforms of the terrain modules in the game scene, which greatly reduces the richness of the terrain and the gameplay, and also limits the player's participation in the game.

[0087] However, in this application embodiment, a method for generating a real-time terrain module model is provided. This method may include: creating different height models by exhaustively exploring all possible situations, and stitching the height models together to achieve the technical effects of infinitely raising and arbitrarily increasing the surface module and creating rift valleys; specifying a rule when creating different height models, for example, in which area of ​​the height model to raise the model, avoiding all structured points of the model in that area, and creating materials that can be raised, to achieve the technical effect that adjacent areas of the raised terrain model can also be raised arbitrarily; distinguishing different areas by using different vertex colors to ensure that the parts that need to be hollowed out are hollowed out, to achieve the technical effect of generating rift valleys and other landforms that need to be hollowed out; and creating other art models in the same way as the terrain module, customizing different shapes in areas where the model can be customized, to achieve the technical effect of transforming raised parts from terrain into walls or other specific art models.

[0088] Next, we will further introduce the method for generating models using the aforementioned real-time terrain module.

[0089] In this embodiment, when creating the terrain model, the map is divided into squares so that each vertex of the model can represent a different height. Then, the height of the current four vertices is obtained by sampling the height map to achieve the splicing of different models. During the model creation process, the vertices of the model's edge lines need to be consistent with the positions of the spliced ​​vertices, and the normal directions are the same. For random diversity, the shape of the interior can be modified while keeping the outer edge unchanged. Then, different models are spliced ​​to achieve diversity processing. The standard height of the square is 2 meters.

[0090] To ensure infinite scaling of adjacent terrain areas during model creation, the model can be divided and scaled vertically at a specified position (e.g., 1.5) within a designated point model (e.g., 0-2). It's important to note that the upper edge (e.g., 1.5-2) and lower edge (e.g., 0-1.5) must be carefully considered during model creation; the vertices of the upper and lower edges of the model must not exceed these points.

[0091] Optionally, in order to allow adjacent areas of the terrain to rise, embodiments of this application calculate the minimum number of models required to create the terrain model, for example, a minimum of 48.

[0092] Table 1 is a model table required for creating a terrain model according to an embodiment of this application. As shown in Table 1, terrain models of different heights can be distinguished by different identifiers. For example, the 10th model is building cluster_4220, the 11th model is building cluster_2240, the 12th model is building cluster_2204, the 13th model is building cluster_0204, etc. Here, 4220, 2240, 2204 and 0204 are identifiers for different terrain models, used to indicate the height of different terrain models.

[0093] Table 1 is a model table for creating a terrain model according to an embodiment of this application.

[0094] 11 Building Complex_2240 12 Building Complex_2204 13 Building Complex_0204

[0095] In the process of terrain model shader creation, for terrain models with soft transition edges, upper, middle, and lower edge transition zones can be designed and distinguished using different vertex colors. Since there are infinitely rising terrain sections, pure textures cannot be used to create all textures. Therefore, in the middle transition zone, the infinitely rising sections require continuous four-sided textures. These textures can be shuffled during sampling to ensure that the visual effects do not repeat excessively, thus maintaining the randomness of the terrain model.

[0096] Optionally, a four-way continuous texture refers to a pattern formed by repeating and extending continuously in all directions from one or several patterns as a unit.

[0097] The effect of cracks is controlled by vertex color and height map. If the vertex height is below -40 and the vertex color is (0, 0, 0), it will be judged as a crack, and then the part of the terrain model with vertex color (0, 0, 0) will be clipped.

[0098] Optionally, vertex color can also be used to determine which locations on the terrain model need to be cut out.

[0099] Alternatively, to avoid performance pressure and the impact of the number of textures during the creation of the ground material, the textures can be merged to reduce the amount of textures used.

[0100] The display effect of the terrain model generated by the above method according to the embodiments of this application will be described below.

[0101] Figure 4 This is a schematic diagram of a special terrain model according to an embodiment of this application, such as... Figure 4As shown, the surface module can be infinitely stretched and raised arbitrarily. It should be noted that related technologies cannot achieve the technical effect of infinitely stretching and raising the surface module arbitrarily as described in the embodiments of this application.

[0102] The same terrain modeling method described above can also be used to create the Great Rift Valley. Figure 5 This is a schematic diagram of a surface module being pulled up according to an embodiment of this application, as shown below. Figure 5 As shown, 501 is a schematic diagram of the terrain model stretching process, and 502 is a schematic diagram of the large rift valley generated after the terrain model is stretched. 5011 represents the 1.5-meter position in the terrain model. When stretching the terrain model to this 1.5-meter position, the upper edge vertex 5012 and the lower edge vertex 5013 need to avoid this position to prevent being stretched further. It should be noted that related technologies cannot achieve the large rift valley effect achieved in the embodiments of this application.

[0103] Figure 6(a) is a schematic diagram of a 4-neighborhood and an 8-neighborhood according to an embodiment of this application. As shown in Figure 6(a), 601 is a 4-neighborhood and 602 is an 8-neighborhood. A 4-neighborhood refers to the four points above, below, left, and right of the point (x, y) where the black-filled circle is located. An 8-neighborhood refers to the eight points above, below, left, right, upper left, lower left, upper right, and lower right of the point (x, y) where the black-filled circle is located. Figure 6(b) is a schematic diagram of an infinitely rising surface module according to an embodiment of this application. As shown in Figure 6(b), regardless of whether it is in an 8-neighborhood, the surface module can rise infinitely upwards.

[0104] Figure 7 This is a schematic diagram of a large rift valley according to an embodiment of this application, such as... Figure 7 As shown, the effect of the Great Rift Valley can be achieved by first stretching the surface module downwards and then cropping the vertex colors.

[0105] Figure 8 This is a schematic diagram of a ramp according to an embodiment of this application, such as... Figure 8 As shown, the slope display effect can be achieved by connecting terrain models of different heights. For example, the terrain model with height (G-1) can be connected with the terrain model with height (1-2).

[0106] Optionally, during the creation of the terrain model, the vertices of the model's edge lines need to be consistent with the positions of the spliced ​​vertices and have the same normal direction, so that no cracks will appear when using modules such as surface subdivision.

[0107] Figure 9 This is a schematic diagram of the vertex connection of the edge lines of a model according to an embodiment of this application. Figure 9In the diagram, 901 represents the spliced ​​model, and 902 represents the original model. The black circles indicate the positions where the vertices of the model's edge lines connect with the vertices of the spliced ​​model. Figure 9 As shown, the vertices of the model's edge lines are at the same positions as the vertices of the spliced ​​parts; Figure 10 This is a schematic diagram of the normal connection of the edge lines of a model according to an embodiment of this application, such as... Figure 10 As shown, the normal 1001 of the model's edge lines has the same direction as the spliced ​​normal 1002.

[0108] Optionally, when creating a terrain model, vertex colors can be used to distinguish different material areas. The upper edge material area is in red, the middle transition zone (the infinitely stretched area) is in blue, and the lower bottom transition color area is in green. The red, green, and blue channels can be divided into three parts, each with its own channel. These can be stacked by adding more channels. For terrain models with soft transition edges, vertex colors can be used to distinguish materials, making the surface transition smoother.

[0109] Figure 11 This is a schematic diagram of an upper transition zone according to an embodiment of this application, such as... Figure 11 As shown, 1101 represents the upper transition zone, which is the red channel; Figure 12 This is a schematic diagram of an intermediate transition zone according to an embodiment of this application, such as... Figure 12 As shown, 1201 represents the intermediate transition zone, which is the blue channel; Figure 13 This is a schematic diagram of a lower transition zone according to an embodiment of this application, such as... Figure 13 As shown, 1301 represents the lower transition zone, which is the green channel.

[0110] Figure 14 This is a schematic diagram of a surface material according to an embodiment of this application, such as... Figure 14 As shown, 1401 represents the color of the surface material, which is black. It should be noted that if the terrain model is a rift valley, the 1401 part is hollow.

[0111] Optionally, in the texture part, the values ​​of metallicity, self-illumination, etc. can be obtained by decoding the alpha (A) channel of the color texture. The normal map can calculate the normal value of the blue (B) channel through the red-green (RG) channel. The B channel and the A channel store the roughness value and the height map value, respectively. Then, the six textures, namely the color map, metallic map, self-illumination map, normal map, roughness map and height map, are compressed into two textures. Two texture slots can also be reserved to achieve the technical effect of reducing the amount of textures used.

[0112] In the aforementioned RGBA color map, the A channel can be expanded to four layers, including: 0-0.25 metallicity, 0.25-0.5 self-illumination, 0.5-0.75 (spare), and 0.75-1 (spare); the normal map can include: RG (normal), B (roughness), and A (height map). Shader part: For the infinite scaling part, scaling can be achieved using 3-way projection, and multiple sampling can be used to address repetition.

[0113] Alternatively, in the embodiments of this application, a sine function (sin) can also be used to process the edges of the terrain model, so that the sides of the terrain model display different pattern effects.

[0114] Figure 15 This is a schematic diagram of a three-directional projection according to an embodiment of this application, as shown below. Figure 15 As shown, the terrain model's 3-way projection can be set by selecting the XYZ map under the World Mapping node, entering the projection transition contrast under the Blend Contrast node, entering the texture object under the Side Mapping Color node, and entering the world position and world space normal under the World Position node.

[0115] Figure 16 This is a schematic diagram of a noise map according to an embodiment of this application, such as... Figure 16 As shown, multiple sampling can be performed using a noise map to process the repetitive parts of the terrain model.

[0116] Figure 17 This is a schematic diagram of a detailed crack according to an embodiment of this application, such as... Figure 17 As shown, the crack details in the terrain material can be calculated by repeatedly stacking the mask using the sine function.

[0117] Figure 18 This is a schematic diagram illustrating the final material usage of a shader according to an embodiment of this application, such as... Figure 18 As shown, the final shader material can include: bottom color map, bottom normal blend map, noise map, side color map, side normal blend map, bottom color, side color, side color 2 (noise), bottom normal intensity, and normal intensity.

[0118] It should be noted that the method in this embodiment can be reused not only in different terrain materials, but also in different terrain modules. Figure 19 This is a schematic diagram illustrating the effect of different materials on a ground surface according to an embodiment of this application, such as... Figure 19 As shown, 1901 and 1902 represent two different surface effects made of different materials.

[0119] Figure 20This is a schematic diagram illustrating the effect of a wall module according to an embodiment of this application, as shown below. Figure 20 As shown, the surface effect of this material is displayed as a wall effect. Figure 21 This is a schematic diagram illustrating a wall and cliff effect according to an embodiment of this application, as shown below. Figure 21 As shown, 2101 displays a wall effect, and 2102 displays a cliff effect.

[0120] In this embodiment, the terrain module generation method described above divides the map into grids during the creation of the surface module, allowing the surface to rise at any position while ensuring interconnected patterns. It also features top, middle, and bottom transition lines to achieve different effect variations, such as walls. During model creation, the vertices of the model's edge lines must be consistent with the positions of the spliced ​​vertices and have the same normal direction to avoid connection problems in model and normal effects, achieving a seamless transition when using modules such as surface subdivision. Dividing and translating the model vertically at a specified point and then stretching it can create large rift valleys, thus increasing the richness of the terrain modules in the game scene. For terrain models with soft transition edges, vertex colors can be used to distinguish materials, making surface transitions smoother. This solves the technical problem of low terrain model generation efficiency and improves the efficiency of terrain model generation.

[0121] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0122] This embodiment also provides a terrain model control device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the terms "unit" and "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0123] Figure 22 This is a schematic diagram of a terrain model control device according to an embodiment of this application, such as... Figure 22As shown, the control device 220 for the terrain model includes: a receiving unit 221, a determining unit 222, and a transforming unit 223.

[0124] The receiving unit 221 is used to receive a generation instruction for the first game scene model, wherein the generation instruction includes a first model height corresponding to the first game scene model and a target terrain unit for generating the first game scene model.

[0125] The determining unit 222 is used to determine a second game scene model from a specified base model library based on the first model height in response to the first model height exceeding the specified model height, wherein the second game scene model includes a second model height, and the second model height is less than or equal to the specified model height.

[0126] Transformation unit 223 is used to perform geometric transformation on the second game scene model so that the height of the second game scene model is adjusted from the height of the second model to the height of the first model, and the transformed second game scene model is rendered at the target terrain unit.

[0127] Optionally, the transformation unit 223 includes: a partitioning module, used to partition the second game scene model into a first sub-game scene model and a second sub-game scene model based on the second model height, wherein the second model height is composed of the model height of the first sub-game scene model and the model height of the second sub-game scene model; and a translation operation module, used to perform a translation operation on the first sub-game scene model and / or the second sub-game scene model according to the height direction of the second model height, so that the second game scene model is adjusted from the second model height to the first model height.

[0128] Optionally, the partitioning module includes: a first determining submodule, used to determine a cutting line perpendicular to the height of the second game scene model on the second game scene model, wherein the cutting line does not include the structured layout of the second game scene model; and a cutting submodule, used to cut the second game scene model into a first sub-game scene model and a second sub-game scene model according to the cutting line.

[0129] Optionally, the translation operation module includes: a first translation operation submodule, used to perform a translation operation on a first sub-game scene model according to a first target direction, and / or to perform a translation operation on a second sub-game scene model according to a second target direction, to obtain a third sub-game scene model and a fourth sub-game scene model, wherein the first target direction is the direction of the first sub-game scene model relative to the second sub-game scene model, the second target direction is the direction of the second sub-game scene model relative to the first sub-game scene model, the third sub-game scene model includes the translated first sub-game scene model or the untranslated first sub-game scene model, and the fourth sub-game scene model includes the translated second sub-game scene model or the untranslated second sub-game scene model; and a connection submodule, used to connect the third sub-game scene model and the fourth sub-game scene model so that the height of the second sub-game scene model is adjusted from the height of the second model to the height of the first model.

[0130] Optionally, the connection submodule is also used to: connect the third sub-game scene model and the fourth sub-game scene model with a straight line, so that the height of the second game scene model is adjusted from the height of the second model to the height of the first model.

[0131] Optionally, the transformation unit 223 includes: a determining module, used to determine the first edge region of the third sub-game scene model, the first transition region of the third sub-game scene model, the second edge region of the fourth sub-game scene model, the second transition region of the fourth sub-game scene model, and the target region between the third sub-game scene model and the fourth sub-game scene model; and a rendering module, used to render the material texture matching the first edge region, the material texture matching the first transition region, the material texture matching the second edge region, the material texture matching the second transition region, and the material texture matching the target region, respectively, to generate the transformed second game scene model.

[0132] Optionally, the device further includes an adjustment unit for adjusting the size of the adjustable material map according to the size of the target area to obtain a material map that matches the target area.

[0133] Optionally, the translation operation module includes: a second determining submodule, used to determine the game scene model that needs to be translated in the first sub-game scene model and the second sub-game scene model based on the model type of the first game scene model; and a second translation operation submodule, used to perform a translation operation on the game scene model that needs to be translated according to the height direction of the second model height, so that the second game scene model is adjusted from the second model height to the first model height.

[0134] Optionally, the second determining submodule is further configured to: in response to the model type of the first game scene model being a raised model type, determine the first sub-game scene model as the game scene model that needs to be translated between the first and second sub-game scene models, wherein the first sub-game scene model is located above the second sub-game scene model; and in response to the model type of the first game scene model being a recessed model type, determine the second sub-game scene model as the game scene model that needs to be translated between the first and second sub-game scene models.

[0135] In the terrain model control device of this embodiment, a receiving unit is used to receive a generation instruction for a first game scene model, wherein the generation instruction includes a first model height corresponding to the first game scene model and a target terrain unit for generating the first game scene model; a determining unit is used to determine a second game scene model from a specified basic model library based on the first model height in response to the first model height exceeding a specified model height, wherein the second game scene model includes a second model height, and the second model height is less than or equal to the specified model height; a transformation unit is used to perform a geometric transformation on the second game scene model so that the second game scene model is adjusted from the second model height to the first model height, and renders the transformed second game scene model at the target terrain unit, thereby achieving the technical effect of improving the generation efficiency of the terrain model, and thus solving the technical problem of low generation efficiency of the terrain model.

[0136] It should be noted that the above-mentioned units and modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but not limited to these: all the above-mentioned units and modules are located in the same processor; or, the above-mentioned units and modules are located in different processors in any combination.

[0137] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.

[0138] Optionally, in this embodiment, the computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0139] Optionally, in this embodiment, the computer-readable storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any terminal device in a group of terminal devices.

[0140] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:

[0141] S 1, receive generation instructions for the first game scene model, wherein the generation instructions include the first model height corresponding to the first game scene model and the target terrain unit used to generate the first game scene model;

[0142] S2, in response to the first model height exceeding the specified model height, determine the second game scene model from the specified base model library based on the first model height, wherein the second game scene model includes the second model height, and the second model height is less than or equal to the specified model height;

[0143] S3 performs a geometric transformation on the second game scene model to adjust the height of the second game scene model from the height of the second model to the height of the first model, and renders the transformed second game scene model at the target terrain unit.

[0144] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: dividing the second game scene model into a first sub-game scene model and a second sub-game scene model based on the second model height, wherein the second model height is composed of the model height of the first sub-game scene model and the model height of the second sub-game scene model; performing a translation operation on the first sub-game scene model and / or the second sub-game scene model according to the height direction of the second model height, so that the second game scene model is adjusted from the second model height to the first model height.

[0145] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: determining a cutting line on the second game scene model in a height direction perpendicular to the height of the second model, wherein the cutting line does not include the structured layout of the second game scene model; and cutting the second game scene model into a first sub-game scene model and a second sub-game scene model according to the cutting line.

[0146] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: translating a first sub-game scene model according to a first target direction, and / or translating a second sub-game scene model according to a second target direction to obtain a third sub-game scene model and a fourth sub-game scene model, wherein the first target direction is the direction of the first sub-game scene model relative to the second sub-game scene model, the second target direction is the direction of the second sub-game scene model relative to the first sub-game scene model, the third sub-game scene model includes either the translated first sub-game scene model or the untranslated first sub-game scene model, and the fourth sub-game scene model includes either the translated second sub-game scene model or the untranslated second sub-game scene model; connecting the third and fourth sub-game scene models to adjust the height of the second game scene model from the height of the second model to the height of the first model.

[0147] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: connecting the third sub-game scene model and the fourth sub-game scene model by a straight line, so that the height of the second game scene model is adjusted from the height of the second model to the height of the first model.

[0148] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: determining a first edge region of the third sub-game scene model, a first transition region of the third sub-game scene model, a second edge region of the fourth sub-game scene model, a second transition region of the fourth sub-game scene model, and a target region between the third and fourth sub-game scene models; rendering the material textures matching the first edge region, the first transition region, the second edge region, the second transition region, and the target region, respectively, to generate a transformed second game scene model.

[0149] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: adjusting the size of the adjustable material map according to the size of the target area to obtain a material map that matches the target area.

[0150] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: determining the game scene model that needs to be translated in the first sub-game scene model and the second sub-game scene model based on the model type of the first game scene model; translating the game scene model that needs to be translated according to the height direction of the second model height, so that the second game scene model is adjusted from the second model height to the first model height.

[0151] Optionally, the aforementioned computer-readable storage medium is further configured to store program code for performing the following steps: in response to the model type of the first game scene model being a raised model type, determining the first sub-game scene model as the game scene model that needs to be translated between the first and second sub-game scene models, wherein the first sub-game scene model is located above the second sub-game scene model; in response to the model type of the first game scene model being a recessed model type, determining the second sub-game scene model as the game scene model that needs to be translated between the first and second sub-game scene models.

[0152] In the computer-readable storage medium of this embodiment, a generation instruction for a first game scene model is received; in response to the first model height exceeding a specified model height, a second game scene model is determined from a specified basic model library based on the first model height; a geometric transformation is performed on the second game scene model to adjust the second game scene model from the second model height to the first model height, and the transformed second game scene model is rendered at the target terrain unit, thereby achieving the technical effect of improving the generation efficiency of terrain models and solving the technical problem of low generation efficiency of terrain models.

[0153] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this application.

[0154] In exemplary embodiments of this application, a computer-readable storage medium stores a program product capable of implementing the methods described above in this embodiment. In some possible implementations, various aspects of the embodiments of this application may also be implemented as a program product including program code, which, when the program product is run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this embodiment according to various exemplary embodiments of this application.

[0155] The program product for implementing the above-described method according to embodiments of this application may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the embodiments of this application is not limited thereto. In the embodiments of this application, the computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0156] The aforementioned program product may take the form of any combination of one or more computer-readable media. Such computer-readable storage media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (not exhaustive) of computer-readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0157] It should be noted that the program code contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0158] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0159] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0160] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0161] S1, receive generation instructions for the first game scene model, wherein the generation instructions include the first model height corresponding to the first game scene model and the target terrain unit used to generate the first game scene model;

[0162] S2, in response to the first model height exceeding the specified model height, determine the second game scene model from the specified base model library based on the first model height, wherein the second game scene model includes the second model height, and the second model height is less than or equal to the specified model height;

[0163] S3 performs a geometric transformation on the second game scene model to adjust the height of the second game scene model from the height of the second model to the height of the first model, and renders the transformed second game scene model at the target terrain unit.

[0164] Optionally, the processor may also be configured to perform the following steps via a computer program: based on the second model height, divide the second game scene model into a first sub-game scene model and a second sub-game scene model, wherein the second model height is composed of the model height of the first sub-game scene model and the model height of the second sub-game scene model; perform a translation operation on the first sub-game scene model and / or the second sub-game scene model according to the height direction of the second model height, so that the second game scene model is adjusted from the second model height to the first model height.

[0165] Optionally, the processor may also be configured to perform the following steps via a computer program: on the second game scene model, determine a cutting line perpendicular to the height of the second model, wherein the cutting line does not include the structured points of the second game scene model; and cut the second game scene model into a first sub-game scene model and a second sub-game scene model according to the cutting line.

[0166] Optionally, the processor may also be configured to perform the following steps via a computer program: translating a first sub-game scene model according to a first target direction, and / or translating a second sub-game scene model according to a second target direction to obtain a third sub-game scene model and a fourth sub-game scene model, wherein the first target direction is the direction of the first sub-game scene model relative to the second sub-game scene model, the second target direction is the direction of the second sub-game scene model relative to the first sub-game scene model, the third sub-game scene model includes either the translated first sub-game scene model or the untranslated first sub-game scene model, and the fourth sub-game scene model includes either the translated second sub-game scene model or the untranslated second sub-game scene model; connecting the third and fourth sub-game scene models to adjust the height of the second game scene model from the height of the second model to the height of the first model.

[0167] Optionally, the processor may also be configured to perform the following steps via a computer program: connecting the third sub-game scene model and the fourth sub-game scene model with a straight line, so that the height of the second game scene model is adjusted from the height of the second model to the height of the first model.

[0168] Optionally, the processor may also be configured to perform the following steps via a computer program: determining a first edge region of the third sub-game scene model, a first transition region of the third sub-game scene model, a second edge region of the fourth sub-game scene model, a second transition region of the fourth sub-game scene model, and a target region between the third and fourth sub-game scene models; rendering the material textures matching the first edge region, the first transition region, the second edge region, the second transition region, and the target region, respectively, to generate the transformed second game scene model.

[0169] Optionally, the processor may also be configured to perform the following steps via a computer program: adjust the size of the adjustable material map according to the size of the target area to obtain a material map that matches the target area.

[0170] Optionally, the processor may also be configured to perform the following steps via a computer program: based on the model type of the first game scene model, determine the game scene model that needs to be translated in the first sub-game scene model and the second sub-game scene model; perform a translation operation on the game scene model that needs to be translated according to the height direction of the second model height, so that the second game scene model is adjusted from the second model height to the first model height.

[0171] Optionally, the processor may also be configured to perform the following steps via a computer program: in response to the model type of the first game scene model being a raised model type, determining the first sub-game scene model as the game scene model that needs to be translated between the first and second sub-game scene models, wherein the first sub-game scene model is located above the second sub-game scene model; in response to the model type of the first game scene model being a recessed model type, determining the second sub-game scene model as the game scene model that needs to be translated between the first and second sub-game scene models.

[0172] In the electronic device of this embodiment, a generation instruction for a first game scene model is received; in response to the first model height exceeding a specified model height, a second game scene model is determined from a specified basic model library based on the first model height; a geometric transformation is performed on the second game scene model to adjust the second game scene model from the second model height to the first model height, and the transformed second game scene model is rendered at the target terrain unit, thereby achieving the technical effect of improving the generation efficiency of terrain models, and thus solving the technical problem of low generation efficiency of terrain models.

[0173] Figure 23 This is a schematic diagram of an electronic device according to an embodiment of this application. Figure 23 As shown, electronic device 230 is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0174] like Figure 23 As shown, the electronic device 2300 is presented in the form of a general-purpose computing device. The components of the electronic device 2300 may include, but are not limited to: at least one processor 2310, at least one memory 2320, a bus 2330 connecting different system components (including memory 2320 and processor 2310), and a display 2340.

[0175] The memory 2320 stores program code that can be executed by the processor 2310, causing the processor 2310 to perform the steps described in the method section of the embodiments of this application according to various exemplary implementations of this application.

[0176] The memory 2320 may include a readable medium in the form of volatile memory cells, such as random access memory (RAM) 23201 and / or cache memory 23202, and may further include read-only memory (ROM) 23203, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.

[0177] In some instances, memory 2320 may also include a program / utility 23204 having a set (at least one) of program modules 23205, including but not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Memory 2320 may further include memory remotely located relative to processor 2310, which can be connected to electronic device 2300 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0178] Bus 2330 can represent one or more of several types of bus structures, including memory cell bus or memory cell controller, peripheral bus, graphics acceleration port, processor 2310, or local bus using any of the various bus structures.

[0179] Display 2340 may be, for example, a touch screen liquid crystal display (LCD) that allows a user to interact with the user interface of electronic device 2300.

[0180] Optionally, the electronic device 2300 can also communicate with one or more external devices 2300 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 2300, and / or any device that enables the electronic device 2300 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via the input / output (I / O) interface 2350. Furthermore, the electronic device 2300 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via the network adapter 2360. Figure 23 As shown, network adapter 2360 communicates with other modules of electronic device 2300 via bus 2330. It should be understood that, although... Figure 23 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 2300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0181] The aforementioned electronic device 2300 may further include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply, and / or a camera.

[0182] Those skilled in the art will understand that Figure 23 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, electronic device 2300 may also include components that are more... Figure 23 The more or fewer components shown, or having the same Figure 1 Different configurations are shown. The memory 2320 can be used to store computer programs and corresponding data, such as the computer program and corresponding data corresponding to the method in this embodiment. The processor 2310 executes various functional applications and data processing by running the computer program stored in the memory 2320, thereby implementing the above-described method.

[0183] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0184] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0185] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.

[0186] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0187] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0188] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0189] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for generating a terrain model, characterized in that, The method of providing a game terrain scene through a graphical user interface, the game terrain scene comprising multiple terrain units that can be used to construct game scene models, includes: Receive a generation instruction for a first game scene model, wherein the generation instruction includes a first model height corresponding to the first game scene model and a target terrain unit for generating the first game scene model; In response to the first model height exceeding the specified model height, a second game scene model is determined from the specified base model library based on the first model height, wherein the second game scene model includes a second model height, and the second model height is less than or equal to the specified model height; Perform a geometric transformation on the second game scene model to adjust the height of the second game scene model from the height of the second model to the height of the first model, and render the transformed second game scene model at the target terrain unit. The step of performing a geometric transformation on the second game scene model to adjust the height of the second game scene model from the height of the second model to the height of the first model includes: dividing the second game scene model into a first sub-game scene model and a second sub-game scene model; in response to the first game scene model being a raised model type, determining the first sub-game scene model as the game scene model that needs to be translated between the first and second sub-game scene models, wherein the first sub-game scene model is located above the second sub-game scene model; in response to the first game scene model being a recessed model type, determining the second sub-game scene model as the game scene model that needs to be translated between the first and second sub-game scene models; and performing a translation operation on the game scene model that needs to be translated to adjust the height of the second game scene model from the height of the second model to the height of the first model.

2. The method according to claim 1, characterized in that, The step of dividing the second game scene model into a first sub-game scene model and a second sub-game scene model includes: Based on the second model height, the second game scene model is divided into a first sub-game scene model and a second sub-game scene model, wherein the second model height is composed of the model height of the first sub-game scene model and the model height of the second sub-game scene model.

3. The method according to claim 2, characterized in that, Based on the height of the second model, the second game scene model is divided into a first sub-game scene model and a second sub-game scene model, including: On the second game scene model, a cutting line is determined in the height direction perpendicular to the height of the second model, wherein the cutting line does not include the structured points of the second game scene model; The second game scene model is cut into the first sub-game scene model and the second sub-game scene model according to the cutting line.

4. The method according to claim 2, characterized in that, The step of performing a translation operation on the game scene model that requires translation, so that the height of the second game scene model is adjusted from the height of the second model to the height of the first model, includes: The game scene model that needs to be translated is translated according to the height direction of the second model height, so that the second game scene model is adjusted from the height of the second model to the height of the first model.

5. The method according to claim 4, characterized in that, The height direction of the second model height includes a first target direction and a second target direction. The first target direction is the direction of the first sub-game scene model relative to the second sub-game scene model, and the second target direction is the direction of the second sub-game scene model relative to the first sub-game scene model. The step of translating the game scene model to be translated according to the height direction of the second model height, so that the second game scene model is adjusted from the second model height to the first model height, includes: In response to the fact that the model type of the first game scene model is the protruding model type, the first sub-game scene model is translated according to the first target direction to obtain the translated first sub-game scene model; the translated first sub-game scene model and the second sub-game scene model are connected so that the height of the second game scene model is adjusted from the height of the second model to the height of the first model; In response to the first game scene model being of the recessed model type, the second sub-game scene model is translated according to the second target direction to obtain the translated second sub-game scene model; the translated second sub-game scene model and the first sub-game scene model are connected to adjust the height of the second game scene model from the height of the second model to the height of the first model.

6. The method according to claim 5, characterized in that, Connecting the translated first sub-game scene model and the second sub-game scene model to adjust the height of the second game scene model from the height of the second model to the height of the first model includes: The translated first sub-game scene model and the second sub-game scene model are connected by a straight line so that the height of the second game scene model is adjusted from the height of the second model to the height of the first model; Connecting the translated second sub-game scene model and the first sub-game scene model to adjust the height of the second game scene model from the height of the second model to the height of the first model includes: The translated second sub-game scene model and the first sub-game scene model are connected by a straight line so that the height of the second game scene model is adjusted from the height of the second model to the height of the first model.

7. The method according to claim 1, characterized in that, Rendering the transformed second game scene model at the target terrain unit includes: The upper edge region, the upper transition region, the lower edge region, the lower transition region, and the stretching region between the transformed second game scene models are determined. The material maps matching the upper edge region, the upper transition region, the lower edge region, the lower transition region, and the stretched region are rendered respectively to generate the transformed second game scene model.

8. The method according to claim 7, characterized in that, The method further includes: The size of the adjustable material map is adjusted according to the size of the stretched area to obtain a material map that matches the stretched area.

9. A terrain model generation device, characterized in that, The device provides a game terrain scene through a graphical user interface, the game terrain scene including multiple terrain units that can be used to build game scene models, the device comprising: A receiving unit is configured to receive a generation instruction for a first game scene model, wherein the generation instruction includes a first model height corresponding to the first game scene model and a target terrain unit for generating the first game scene model; A determining unit is configured to, in response to the first model height exceeding a specified model height, determine a second game scene model from a specified base model library based on the first model height, wherein the second game scene model includes a second model height, and the second model height is less than or equal to the specified model height; A transformation unit is used to perform geometric transformation on the second game scene model so that the height of the second game scene model is adjusted from the height of the second model to the height of the first model, and to render and generate the transformed second game scene model at the target terrain unit. The transformation unit performs a geometric transformation on the second game scene model through the following steps to adjust the height of the second game scene model from the second model height to the first model height: dividing the second game scene model into a first sub-game scene model and a second sub-game scene model; in response to the first game scene model being a raised model type, determining the first sub-game scene model as the game scene model that needs to be translated between the first and second sub-game scene models, wherein the first sub-game scene model is located above the second sub-game scene model; in response to the first game scene model being a recessed model type, determining the second sub-game scene model as the game scene model that needs to be translated between the first and second sub-game scene models; performing a translation operation on the game scene model that needs to be translated, so that the height of the second game scene model is adjusted from the second model height to the first model height.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method described in any one of claims 1 to 8 when run by a processor.

11. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Three-dimensional ground object automatic extraction and scene reconstruction method

    CN107527038A

  • Model generation method and device and electronic equipment

    CN112529996A

  • Method and apparatus for quickly generating natural terrain

    US20150262392A1