Flow direction map generation method, apparatus, and terminal device

CN115546432BActive Publication Date: 2026-08-21NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211390320.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-03
Publication Date
2026-08-21
Estimated Expiration
2042-11-03

AI Technical Summary

Technical Problem

[0002]目前,常用的Flowmap制作方式主要包括以下两种:(1)由相关人员直接绘制Flowmap,但是该制作方式仅适用于制作简单流向的Flowmap,对于复杂地形将难以得到效果较好的Flowmap,甚至存在穿帮情况;(2)使用Houdini生成Flowmap,但是该制作方式需要提供与复杂地形匹配的高精度模型用于烘焙,方可生成效果较好的Flowmap

Benefits of technology

[0008] This invention provides a method, apparatus, and terminal device for generating flow maps. First, a continuous terrain masking map corresponding to a target virtual scene is obtained. Then, a target terrain model corresponding to the target virtual scene is generated based on the continuous terrain masking map. Finally, a target flow map corresponding to the target virtual scene is obtained based on the target terrain model and a pre-made initial flow map. This method utilizes a continuous terrain masking map to generate a corresponding target terrain model, thereby generating a superior target flow map based on the target terrain model and the initial flow map. This invention eliminates the need for a high-precision map model, achieving a superior target flow map even for complex terrain models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115546432B_ABST
    Figure CN115546432B_ABST
Patent Text Reader

Abstract

The application provides a flow direction diagram generation method and device and terminal equipment, comprising: acquiring a continuous terrain mask diagram corresponding to a target virtual scene; generating a target terrain model corresponding to the target virtual scene according to the continuous terrain mask diagram; and obtaining a target flow direction diagram corresponding to the target virtual scene based on the target terrain model and a pre-prepared initial flow direction diagram. The application can realize a flow direction diagram with better effect for a terrain model with higher complexity and poorer fineness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a flow graph generation method, apparatus, and terminal device. Background Technology

[0002] Currently, the commonly used methods for creating flowmaps mainly include the following two: (1) having relevant personnel directly draw the flowmap, but this method is only suitable for creating flowmaps with simple flow directions. For complex terrains, it is difficult to obtain a good flowmap, and there may even be errors; (2) using Houdini to generate the flowmap, but this method requires providing a high-precision model that matches the complex terrain for baking in order to generate a good flowmap. In summary, for terrain models with high complexity and poor detail, the above methods are unlikely to produce a good flowmap. Summary of the Invention

[0003] In view of this, the purpose of the present invention is to provide a flow direction map generation method, apparatus and terminal device, which can generate flow direction maps with better results for terrain models with high complexity and poor detail.

[0004] In a first aspect, embodiments of the present invention provide a flow map generation method, comprising: obtaining a continuous terrain mask map corresponding to a target virtual scene; generating a target terrain model corresponding to the target virtual scene based on the continuous terrain mask map; and obtaining a target flow map corresponding to the target virtual scene based on the target terrain model and a pre-made initial flow map.

[0005] Secondly, embodiments of the present invention also provide a flow direction map generation device, comprising: a mask map acquisition module, used to acquire a continuous terrain mask map corresponding to a target virtual scene; a model generation module, used to generate a target terrain model corresponding to the target virtual scene based on the continuous terrain mask map; and an effect determination module, used to obtain a target flow direction map corresponding to the target virtual scene based on the target terrain model and a pre-made initial flow direction map.

[0006] Thirdly, embodiments of the present invention also provide a terminal device, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the method described in any of the first aspects.

[0007] Fourthly, embodiments of the present invention also provide a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method described in any one of the first aspects.

[0008] This invention provides a method, apparatus, and terminal device for generating flow maps. First, a continuous terrain masking map corresponding to a target virtual scene is obtained. Then, a target terrain model corresponding to the target virtual scene is generated based on the continuous terrain masking map. Finally, a target flow map corresponding to the target virtual scene is obtained based on the target terrain model and a pre-made initial flow map. This method utilizes a continuous terrain masking map to generate a corresponding target terrain model, thereby generating a superior target flow map based on the target terrain model and the initial flow map. This invention eliminates the need for a high-precision map model, achieving a superior target flow map even for complex terrain models.

[0009] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0010] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0011] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0012] Figure 1 A flowchart illustrating a flow diagram generation method provided in an embodiment of the present invention;

[0013] Figure 2 This is a schematic diagram of a four-sided continuous texture provided in an embodiment of the present invention;

[0014] Figure 3 This is a schematic diagram illustrating the relationship between flow direction and color value, provided as an embodiment of the present invention.

[0015] Figure 4 A schematic diagram of an initial terrain model provided in an embodiment of the present invention;

[0016] Figure 5 A schematic diagram of a first target patch provided in an embodiment of the present invention;

[0017] Figure 6 A schematic diagram of an intermediate terrain model provided in an embodiment of the present invention;

[0018] Figure 7 This is a schematic diagram of a reverse processing flow provided in an embodiment of the present invention;

[0019] Figure 8 A schematic diagram of a second target patch provided in an embodiment of the present invention;

[0020] Figure 9 A schematic diagram of an initial flow diagram provided in an embodiment of the present invention;

[0021] Figure 10 A schematic diagram illustrating an obstruction result provided in an embodiment of the present invention;

[0022] Figure 11 A schematic diagram of a target flow diagram provided in an embodiment of the present invention;

[0023] Figure 12 A schematic diagram of a flow effect provided in an embodiment of the present invention;

[0024] Figure 13 This is a schematic diagram of a flow diagram generation device provided in an embodiment of the present invention;

[0025] Figure 14 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present invention. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0027] Currently, the Flowmap production process has the following problems: (1) Manually drawing Flowmaps will be difficult to achieve ideal results in complex situations and will easily reveal errors. If you want to draw a Flowmap with high accuracy, it will greatly increase the workload of the artists and make it more difficult; (2) When a high-precision model cannot be provided, Houdini cannot be used for baking; (3) When dealing with planet-sized models, even if a high-precision model is provided, the large size of the model will make it difficult to complete the baking in a short time.

[0028] Based on this, the present invention provides a flow direction map generation method, apparatus and terminal device, which can generate flow direction maps with better results for terrain models with high complexity and poor detail.

[0029] To facilitate understanding of this embodiment, a flow graph generation method disclosed in this invention will first be described in detail. (See [link to relevant documentation]). Figure 1 The diagram shows a flow diagram generation method, which mainly includes the following steps S102 to S106:

[0030] Step S102: Obtain the continuous terrain mask map corresponding to the target virtual scene. The continuous terrain mask map is one that can seamlessly connect with other continuous terrain mask maps. For example, it may use a quadruple continuous texture, where the left and right sides, and the top and bottom sides, can seamlessly connect. In practical applications, when creating planet-level virtual models, it is common to provide a low-poly planet model, a diffuse texture, a planet model with a diffuse texture, and a terrain mask map, all of which are quadruple continuous textures, such as... Figure 2 The diagram shown is a schematic of a four-way continuous texture map, so a four-way continuous terrain mask map can be directly obtained.

[0031] Step S104: Generate a target terrain model corresponding to the target virtual scene based on the continuous terrain masking map. In one embodiment, a target container can be created in advance, and a corresponding initial terrain model can be generated within the target container based on the continuous terrain masking map. By copying multiple initial terrain models and performing stitching and reverse processing on the copied initial terrain models, the target terrain model can be obtained.

[0032] Step S106: Based on the target terrain model and the pre-made initial flow map, a target flow map corresponding to the target virtual scene is obtained. The flow map is a texture used to record 2D vector information. The color (RG, red-green) channels on the flow map record the direction of the vector field (2D vector), thus allowing a point on the virtual scene to exhibit quantitative flow characteristics, such as... Figure 3 The diagram illustrates the relationship between flow direction and color value, where the R channel influences the left-right flow direction and the G channel influences the up-down flow direction. Optionally, the initial flow map is denoted as the initial Flowmap, and the target flow map is denoted as the target Flowmap. In one implementation, the initial Flowmap can be obstructed using a target terrain model to obtain an obstruction result, and a flow map can be generated based on the obstruction result. The target Flowmap can then be obtained by baking the flow map.

[0033] The flow direction map generation method provided in this embodiment of the invention uses a continuous terrain masking map to generate a corresponding target terrain model, thereby generating a better target flow direction map based on the target terrain model and the initial flow direction map. This embodiment of the invention does not require a high-precision map model and can achieve a better target flow direction map for terrain models with high complexity.

[0034] In one implementation, a four-sided continuous terrain mask map is used. Taking a planet as the target virtual scene, this embodiment of the invention uses a four-sided continuous terrain mask map to generate a terrain model. The number of tiled textures is controlled by adjusting the number of tiles in the four-sided continuous terrain mask map, thereby ensuring high-precision texture representation even on large models at the planet level. However, without using a four-sided continuous terrain mask map, adjusting the number of tiled textures would result in a lack of seamless transitions between textures. Furthermore, considering that excessively large single texture sizes would lead to excessive memory consumption, the size of the four-sided continuous terrain mask map should be less than a preset threshold. Moreover, this embodiment of the invention can generate a terrain model from a portion of the planet, and this terrain model can represent the entire planet. Therefore, it is unnecessary to use the entire planet as a single terrain model for baking, thereby reducing the baking time and the size of the generated target flowmap.

[0035] Regarding the aforementioned step S104, this embodiment of the invention provides an implementation method for generating a target terrain model corresponding to a target virtual scene based on a continuous terrain masking map, as shown in steps 1 to 3 below:

[0036] Step 1: In response to a triggering operation on the container creation control, create the target container. The container creation control can be a grid1 node, and the target container can be a Geometry container. In one implementation, the graphical user interface can provide a grid1 node; at the obj level, in response to a triggering operation on the grid1 node, a Geometry container is created.

[0037] Step 2: In the target container, an initial terrain model corresponding to the target virtual scene is generated based on the continuous terrain masking map. In one implementation: (1) Based on the brightness value corresponding to each pixel in the continuous terrain masking map and a preset brightness threshold, at least one target region is determined from the continuous terrain masking map; (2) Model vertices corresponding to the edge points in each target region are generated; (3) Each model vertices are connected to obtain the initial terrain model corresponding to the target virtual scene. In one implementation, a double-click operation on the Geometry container can be performed to enter the Geometry container, and a terrain model can be generated in the Geometry container using the continuous terrain masking map. For example, a Trace node is provided through a graphical user interface, and in response to a trigger operation on the Trace node, an initial terrain model is generated based on the input continuous terrain masking map, wherein the continuous terrain masking map is a grayscale image. The logic is as follows: Read the brightness value of each pixel in the continuous terrain mask map, and compare the brightness value of each pixel with a preset brightness threshold. The area with a brightness value greater than the preset brightness threshold is determined as the target area. For example, if the preset brightness threshold is 0.5, then the pixels with a brightness value greater than 0.5 in the continuous map mask are determined to be in the target area. Vertices are generated at the edge points in the target area. Connecting all the vertices together will give you the initial terrain model.

[0038] In one implementation, an Extrudel node can also be provided via a graphical user interface, responding to a triggering operation on the Extrudel node to extrude the initial terrain model, i.e., by moving each target vertex a specified distance. For ease of understanding, embodiments of the present invention provide... Figure 4 The diagram shows an initial terrain model. The left image represents the initial terrain model, where the white areas (i.e., target areas with brightness values ​​greater than a preset brightness threshold) in the continuous terrain masking image are used to generate the model, while the black areas (i.e., non-target areas with brightness values ​​less than a preset brightness threshold) are not used. Please continue reading... Figure 4 The right-hand diagram shows the nodes used to generate the initial terrain model, including the Trace1 node, transform2 node, Extrudel node, and transform3 node. The Trace1 node generates the initial terrain model, while the transform2 and transform3 nodes are used to adjust the angle and size of the initial terrain model to match the Flowmap size. The Extrudel node is used to extrude the initial terrain model. For example, assuming the initial terrain model generated by the Trace1 node is in the XY plane, the transform2 node is used to rotate it to the XZ plane to adjust the angle of the initial terrain model.

[0039] Step 3: Based on multiple initial terrain models, generate a target terrain model corresponding to the target virtual scene. In one implementation, see steps 3.1 to 3.3 below:

[0040] Step 3.1: In response to a trigger operation on the patch creation control, create a first target patch; wherein the first target patch includes multiple patch vertices. In one embodiment, the patch creation control can be a grid2 node. In one embodiment, the graphical user interface can provide a grid2 node, which, in response to a trigger operation on the grid2 node, generates the first target patch and sets the segmentation of the first target patch to 3*3, that is, the parameter Rows is 3 and the parameter Columns is 3, resulting in... Figure 5 The diagram shows a first target patch, which includes 9 patch vertices.

[0041] Step 3.2: In response to the copy operation on the initial terrain model, using the vertex of each facet as the center point of the initial terrain model, the initial terrain model is copied to each facet vertex to obtain the intermediate terrain model. In one implementation, a copy control can be provided through a graphical user interface. The copy control is a Copy To Point node (copytopoint1 node). In response to the trigger operation on the copytopoint1 node, using each facet vertex as the center point of the initial terrain model, the nine initial terrain models are copied to the aforementioned nine facet vertices to obtain the intermediate terrain model. A schematic diagram of the intermediate terrain model is shown below. Figure 6 As shown. Please continue to see... Figure 6 , Figure 6 The diagram also illustrates that the nodes used to replicate the initial terrain model include the transform4 node, the grid2 node, and the copytopoint1 node. The transform4 node is used to adjust the angle and size scaling of the replicated initial terrain model, the grid2 node is used to create the first target patch, and the copytopoint1 node is used to replicate the initial terrain model.

[0042] Step 3.3 involves reverse processing the intermediate terrain model to obtain the target terrain model corresponding to the target virtual scene. In practical applications, since white areas represent lava and black areas represent land in terrain masking, it is necessary to reverse process the intermediate terrain model. Specifically, this can be achieved by performing a Boolean operation on the intermediate terrain model, i.e., subtracting the intermediate terrain model from a Box using a Boolean node, to obtain the target terrain model. See [link to relevant documentation] Figure 7 The diagram shown illustrates a reverse processing flow. Figure 7The diagram illustrates the nodes used for reverse processing, including the box1 node, transform5 node, and Boolean1 node.

[0043] This invention also provides an implementation method for creating an initial Flowmap: (1) In response to a trigger operation on a patch creation control, a second target patch is created. Optionally, a Grid node (grid1 node) is provided through a graphical user interface. In response to a trigger operation on the grid1 node, the second target patch is created and segments are set, such as... Figure 8 The diagram shows a second target patch. In practical applications, the more segments, the more detailed the effect, but the longer the baking calculation time. In addition, the second target patch does not need to be consistent with the target terrain model size, but needs to be consistent with the initial terrain model size; (2) Generate a static flow map (static flowmap) based on the surface normal of the second target patch. Optionally, a UV Texture node (uvtexture1 node) and a Labs Flowmap node (flowmap1 node) are provided through the graphical user interface. Respond to the trigger operation for the uvtexture1 node to expand the UV of the second target patch, pass the second target patch to the flowmap1 node, and then respond to the trigger operation for the flowmap1 node to generate a static flowmap (such as) based on the surface normal of the second target patch. Figure 8 (As shown), in addition Figure 8 The nodes used to generate the static flowmap are also illustrated, and will not be described in detail in this embodiment of the invention; (3) Determine the flow guide line of the static flowmap and the target flow direction corresponding to each flow guide line to obtain the initial flowmap. Optionally, the Line node (line1 node), Transform node (transform1 node) and Labs Guide Flowmap node (flowmap_guide1 node) are provided through the graphical user interface. Respond to the trigger operation for the line1 node to generate a line segment, which is the flow guide line. Then respond to the trigger operation based on the transform1 node to control the initial flow direction of the flow guide line. Then respond to the trigger operation for the flowmap_guide1 node to use the flow guide line to control the flow direction of the initial flow, and the initial flowmap can be obtained. The schematic diagram of the initial flowmap is shown below. Figure 9 As shown. In practical applications, the angle of the flow guide line is the flow direction angle of the initial flowmap. When the flow guide line completely coincides with the normal of the vertex, it indicates that the vertex is static and not flowing. Additionally, Figure 9 The diagram also illustrates the nodes used to generate the initial Flowmap, which will not be elaborated upon in this embodiment of the invention.

[0044] Based on the foregoing embodiments, this embodiment of the invention provides an implementation method for obtaining a target flow map corresponding to a target virtual scene based on a target terrain model and a pre-made initial flow map, as shown in steps a to b below:

[0045] Step a: Based on the target terrain model, obstruction processing is applied to the pre-made initial flow map to obtain the obstruction result. This obstruction processing, also known as obstruction calculation, treats the initial flow map as a vector field. Obstruction processing converts the target terrain model into voxels and rewrites the vector field at locations in contact with it, causing the affected vectors to point away from that location, thereby changing the flow direction of the initial flow map. In one implementation, a Labs Flowmap Obstacle node (flowmap_obstacle1 node) can be provided through a graphical user interface. In response to a trigger operation on the flowmap_obstacle1 node, the target terrain model is used to obstruct the initial flowmap, resulting in the following result: Figure 10 The obstructive results shown Figure 10 This illustrates that the obstruction (protrusion) in the target terrain model will change the flow direction, causing the flow to point away from the obstruction. In other words, the target terrain model affects the flow direction of the initial flow map.

[0046] Step b involves generating a flow graph corresponding to the obstruction result and baking the flow graph to obtain the target flow graph corresponding to the target virtual scene. In one implementation, a Labs Flowmap ToColor node (flowmap_to_color1 node) can be provided via a graphical user interface. Responding to trigger operations for the flowmap_to_color1 node, a flow graph is generated using the obstruction result, and the result is input to a Null node (null1 node). A Labs Maps Baker node (maps_baker1 node) can also be provided via a graphical user interface. Responding to trigger operations for the maps_baker1 node, the flow graph is baked. The baking parameters include the output path, resolution, and vertex color, thereby obtaining... Figure 11 The target flow diagram shown is as follows. Figure 11 The box marked in the figure has obvious color spots. In practical applications, the flow direction can be converted into color information, usually close to R=128, G=128, so that the color information corresponding to the pixels in the color spots can be used to represent the flow direction.

[0047] After determining the target flowmap, it can be pasted onto a specified material to achieve the corresponding flow effect in the target virtual scene. For example, pasting the generated target flowmap onto a lava planet material will produce the following result: Figure 12 The illustration shows a flow effect. In one implementation, the core idea of ​​how lowmap affects texture flow effects is as follows:

[0048] (1) float2 flow_map = Flowmap.Sample(DefaultSampler, uv).rg; where flow_map is the sampled color value. Since flowmap only has an effect on the GR channel, only a float2 type variable is needed to store the color value.

[0049] (2) flow_map = (flow_map - 0.5) * 2; Since the sampled value is in the range of [0,1], it is necessary to map the value range of this value. Specifically, it can be mapped from [0,1] to [-1,1] to represent front and back and left and right. This value can be understood as the movement distance of the pixel.

[0050] (3) float2 flow_xy=flow_map*frac(time); time is a continuously increasing variable, while frac retains the decimal part of time, that is, frac(time) is a number that cycles between 0 and 1, so flow_map*frac(time) is equivalent to expanding the value range of frac(time) from [0,1] to [-1,1];

[0051] (4) float4 lava_color=Lavamap.Sample(DefaultSampler,uv+flow_xy); This code makes uv “flow” and makes the value of uv increase or decrease over time.

[0052] In summary, the flow map generation method provided by the embodiments of the present invention can generate a flow map corresponding to a low-poly model without the need for staff to draw the flow map or bake complex models. Instead, it uses a continuous terrain mask to create the flow map for the low-poly model that has no information (bumps, terrain, etc.), thereby effectively reducing the workload of artists and lowering labor costs.

[0053] Regarding the flow diagram generation method provided in the foregoing embodiments, this invention provides a flow diagram generation apparatus, see [link to previous document]. Figure 13 The diagram shows a flow diagram generation device, which mainly includes the following parts:

[0054] The mask map acquisition module 1302 is used to acquire a continuous terrain mask map corresponding to the target virtual scene;

[0055] The model generation module 1304 is used to generate a target terrain model corresponding to the target virtual scene based on the continuous terrain masking map.

[0056] The effect determination module 1306 is used to obtain the target flow map corresponding to the target virtual scene based on the target terrain model and the pre-made initial flow map.

[0057] The flow direction map generation device provided in this embodiment of the invention generates a corresponding target terrain model using a continuous terrain masking map. Thus, a better target flow direction map can be generated based on the target terrain model and the initial flow direction map. This embodiment of the invention does not require a high-precision map model and can achieve a better target flow direction map for terrain models with high complexity.

[0058] In one embodiment, the model generation module 1304 is further configured to: create a target container in response to a trigger operation on a container creation control; generate an initial terrain model corresponding to the target virtual scene in the target container based on a continuous terrain mask map; and generate a target terrain model corresponding to the target virtual scene based on multiple initial terrain models.

[0059] In one implementation, the model generation module 1304 is further configured to: determine at least one target region from the continuous terrain masking map based on the brightness value corresponding to each pixel in the continuous terrain masking map and a preset brightness threshold; generate model vertices corresponding to edge points in each target region; and connect each model vertices to obtain an initial terrain model corresponding to the target virtual scene.

[0060] In one embodiment, the model generation module 1304 is further configured to: respond to a trigger operation for a patch creation control, create a first target patch; wherein the first target patch includes multiple patch vertices; respond to a copy operation for an initial terrain model, use the patch vertices as the center points of the initial terrain model, copy the initial terrain model to each patch vertex respectively, to obtain an intermediate terrain model; and perform reverse processing on the intermediate terrain model to obtain a target terrain model corresponding to the target virtual scene.

[0061] In one implementation, the effect determination module 1306 is further configured to: perform obstruction processing on the pre-made initial flow direction map based on the target terrain model to obtain obstruction results; generate a flow map corresponding to the obstruction results, and perform baking processing on the flow map to obtain a target flow direction map corresponding to the target virtual scene.

[0062] In one embodiment, the above-mentioned device further includes a flow map pasting module, used to: paste a target flow map into a specified material to achieve the flow effect corresponding to the target flow map in the target virtual scene.

[0063] In one embodiment, the above-described apparatus further includes a flow map generation module, configured to: create a second target surface in response to a trigger operation on a surface creation control; generate a static flow map based on the surface normal of the second target surface; determine the flow guide lines of the static flow map and the target flow direction corresponding to each flow guide line, thereby obtaining an initial flow map.

[0064] In one implementation, the continuous terrain masking map uses a four-way continuous terrain masking map.

[0065] The device provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned method embodiment.

[0066] This invention provides a terminal device, specifically, the terminal device includes a processor and a storage device; the storage device stores a computer program, which is executed by the processor when it runs:

[0067] A flow map generation method includes: obtaining a continuous terrain mask map corresponding to a target virtual scene; generating a target terrain model corresponding to the target virtual scene based on the continuous terrain mask map; and obtaining a target flow map corresponding to the target virtual scene based on the target terrain model and a pre-made initial flow map.

[0068] The terminal device provided in this embodiment of the invention generates a corresponding target terrain model using a continuous terrain masking map. Based on the target terrain model and the initial flow direction map, a better target flow direction map can be generated. This embodiment of the invention does not require a high-precision map model and can achieve a better target flow direction map for terrain models with high complexity.

[0069] In one implementation, the step of generating a target terrain model corresponding to a target virtual scene based on a continuous terrain masking map includes: creating a target container in response to a trigger operation on a container creation control; generating an initial terrain model corresponding to the target virtual scene in the target container based on the continuous terrain masking map; and generating a target terrain model corresponding to the target virtual scene based on multiple initial terrain models.

[0070] In one embodiment, the step of generating an initial terrain model corresponding to a target virtual scene based on a continuous terrain masking map includes: determining at least one target region from the continuous terrain masking map based on the brightness value corresponding to each pixel in the continuous terrain masking map and a preset brightness threshold; generating model vertices corresponding to edge points in each target region; and connecting each model vertices to obtain the initial terrain model corresponding to the target virtual scene.

[0071] In one implementation, the step of generating a target terrain model corresponding to a target virtual scene based on multiple initial terrain models includes: responding to a trigger operation for a patch creation control to create a first target patch; wherein the first target patch includes multiple patch vertices; responding to a copy operation for an initial terrain model, using the patch vertices as the center points of the initial terrain model, copying the initial terrain model to each patch vertex to obtain an intermediate terrain model; and performing reverse processing on the intermediate terrain model to obtain the target terrain model corresponding to the target virtual scene.

[0072] In one implementation, the step of obtaining a target flow map corresponding to a target virtual scene based on a target terrain model and a pre-made initial flow map includes: performing obstruction processing on the pre-made initial flow map based on the target terrain model to obtain an obstruction result; generating a flow map corresponding to the obstruction result and performing baking processing on the flow map to obtain a target flow map corresponding to the target virtual scene.

[0073] In one implementation, after obtaining the target flow map corresponding to the target virtual scene based on the target terrain model and the pre-made initial flow map, the method further includes: pasting the target flow map into a specified material to achieve the flow effect corresponding to the target flow map in the target virtual scene.

[0074] In one implementation, the method further includes: creating a second target patch in response to a trigger operation on a patch creation control; generating a static flow map based on the surface normal of the second target patch; and determining the flow guide lines of the static flow map and the target flow direction corresponding to each flow guide line to obtain an initial flow map.

[0075] In one implementation, the continuous terrain masking map uses a four-way continuous terrain masking map.

[0076] Figure 14 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present invention. The terminal device 100 includes: a processor 140, a memory 141, a bus 142 and a communication interface 143. The processor 140, the communication interface 143 and the memory 141 are connected through the bus 142. The processor 140 is used to execute executable modules, such as computer programs, stored in the memory 141.

[0077] The memory 141 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 143 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.

[0078] Bus 142 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 14 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0079] The memory 141 is used to store programs. After receiving an execution instruction, the processor 140 executes the program. The method executed by the device for defining the flow process disclosed in any of the foregoing embodiments of the present invention can be applied to the processor 140 or implemented by the processor 140.

[0080] Processor 140 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 140 or by instructions in software form. Processor 140 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 141, and processor 140 reads the information in memory 141 and, in conjunction with its hardware, completes the steps of the above method.

[0081] The computer program product of the readable storage medium provided in the embodiments of the present invention includes a computer-readable storage medium storing program code, wherein the program code includes instructions that can be executed:

[0082] A flow map generation method includes: obtaining a continuous terrain mask map corresponding to a target virtual scene; generating a target terrain model corresponding to the target virtual scene based on the continuous terrain mask map; and obtaining a target flow map corresponding to the target virtual scene based on the target terrain model and a pre-made initial flow map.

[0083] The readable storage medium provided in this embodiment of the invention generates a corresponding target terrain model using a continuous terrain masking map. Thus, a better target flow map can be generated based on the target terrain model and the initial flow map. This embodiment of the invention does not require a high-precision map model and can achieve a better target flow map for terrain models with high complexity.

[0084] In one implementation, the step of generating a target terrain model corresponding to a target virtual scene based on a continuous terrain masking map includes: creating a target container in response to a trigger operation on a container creation control; generating an initial terrain model corresponding to the target virtual scene in the target container based on the continuous terrain masking map; and generating a target terrain model corresponding to the target virtual scene based on multiple initial terrain models.

[0085] In one embodiment, the step of generating an initial terrain model corresponding to a target virtual scene based on a continuous terrain masking map includes: determining at least one target region from the continuous terrain masking map based on the brightness value corresponding to each pixel in the continuous terrain masking map and a preset brightness threshold; generating model vertices corresponding to edge points in each target region; and connecting each model vertices to obtain the initial terrain model corresponding to the target virtual scene.

[0086] In one implementation, the step of generating a target terrain model corresponding to a target virtual scene based on multiple initial terrain models includes: responding to a trigger operation for a patch creation control to create a first target patch; wherein the first target patch includes multiple patch vertices; responding to a copy operation for an initial terrain model, using the patch vertices as the center points of the initial terrain model, copying the initial terrain model to each patch vertex to obtain an intermediate terrain model; and performing reverse processing on the intermediate terrain model to obtain the target terrain model corresponding to the target virtual scene.

[0087] In one implementation, the step of obtaining a target flow map corresponding to a target virtual scene based on a target terrain model and a pre-made initial flow map includes: performing obstruction processing on the pre-made initial flow map based on the target terrain model to obtain an obstruction result; generating a flow map corresponding to the obstruction result and performing baking processing on the flow map to obtain a target flow map corresponding to the target virtual scene.

[0088] In one implementation, after obtaining the target flow map corresponding to the target virtual scene based on the target terrain model and the pre-made initial flow map, the method further includes: pasting the target flow map into a specified material to achieve the flow effect corresponding to the target flow map in the target virtual scene.

[0089] In one implementation, the method further includes: creating a second target patch in response to a trigger operation on a patch creation control; generating a static flow map based on the surface normal of the second target patch; and determining the flow guide lines of the static flow map and the target flow direction corresponding to each flow guide line to obtain an initial flow map.

[0090] In one implementation, the continuous terrain masking map uses a four-way continuous terrain masking map.

[0091] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion 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 described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0092] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for generating a flow diagram, characterized in that, include: Obtain a continuous terrain mask map corresponding to the target virtual scene; Based on the continuous terrain masking map, a target terrain model corresponding to the target virtual scene is generated; Based on the target terrain model and the pre-made initial flow direction map, the target flow direction map corresponding to the target virtual scene is obtained; The step of generating a target terrain model corresponding to the target virtual scene based on the continuous terrain masking map includes: In response to a triggering operation that creates a control for a container, create the target container; In the target container, at least one target region is determined from the continuous terrain masking map based on the brightness value corresponding to each pixel and a preset brightness threshold; model vertices corresponding to edge points in each target region are generated; and each model vertex is connected to obtain an initial terrain model corresponding to the target virtual scene. In response to a trigger operation on a patch creation control, a first target patch is created; wherein the first target patch includes multiple patch vertices; in response to a copy operation on the initial terrain model, the initial terrain model is copied to each of the patch vertices, using the patch vertices as the center points of the initial terrain model, to obtain an intermediate terrain model; the intermediate terrain model is then processed in reverse to obtain the target terrain model corresponding to the target virtual scene.

2. The method according to claim 1, characterized in that, The step of obtaining the target flow map corresponding to the target virtual scene based on the target terrain model and the pre-made initial flow map includes: Based on the target terrain model, the pre-made initial flow direction map is processed to obtain the obstruction result; Generate the flow graph corresponding to the obstruction result, and bake the flow graph to obtain the target flow graph corresponding to the target virtual scene.

3. The method according to claim 1, characterized in that, After the step of obtaining the target flow map corresponding to the target virtual scene based on the target terrain model and the pre-made initial flow map, the method further includes: The target flow map is pasted into the specified material to achieve the flow effect corresponding to the target flow direction in the target virtual scene.

4. The method according to claim 1, characterized in that, The method further includes: In response to a triggering operation on the patch creation control, create a second target patch; A static flow pattern is generated based on the surface normal of the second target patch; The flow direction guide lines of the static flow direction diagram and the target flow direction corresponding to each flow direction guide line are determined to obtain the initial flow direction diagram.

5. The method according to claim 1, characterized in that, The continuous terrain masking map is a four-way continuous terrain masking map.

6. A flow diagram generation device, characterized in that, include: The masking image acquisition module is used to acquire continuous terrain masking images corresponding to the target virtual scene; The model generation module is used to generate a target terrain model corresponding to the target virtual scene based on the continuous terrain masking map; The effect determination module is used to obtain the target flow map corresponding to the target virtual scene based on the target terrain model and the pre-made initial flow map; The model generation module is specifically used to respond to the trigger operation of the container creation control and create a target container; in the target container, at least one target area is determined from the continuous terrain masking map based on the brightness value corresponding to each pixel and the preset brightness threshold. Generate model vertices corresponding to edge points in each target region; connect each model vertex to obtain the initial terrain model corresponding to the target virtual scene; In response to a trigger operation on a patch creation control, a first target patch is created; wherein the first target patch includes multiple patch vertices; in response to a copy operation on the initial terrain model, the initial terrain model is copied to each of the patch vertices, using the patch vertices as the center points of the initial terrain model, to obtain an intermediate terrain model; the intermediate terrain model is then processed in reverse to obtain the target terrain model corresponding to the target virtual scene.

7. A terminal device, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method of any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Model processing method, model processing device, electronic equipment and readable storage medium

    CN114255306A

  • Model generation method and device, computer equipment and storage medium

    CN114419233A