CN116785697A - Method and device for generating water area in target virtual scene - Google Patents

Method and device for generating water area in target virtual scene Download PDF

Info

Publication number
CN116785697A
CN116785697A CN202310773098.3A CN202310773098A CN116785697A CN 116785697 A CN116785697 A CN 116785697A CN 202310773098 A CN202310773098 A CN 202310773098A CN 116785697 A CN116785697 A CN 116785697A
Authority
CN
China
Prior art keywords
curve
model
terrain
target
coil
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310773098.3A
Other languages
Chinese (zh)
Inventor
汤志
杨唯
万平
孟岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Kingsoft Digital Network Technology Co Ltd
Original Assignee
Zhuhai Kingsoft Digital Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuhai Kingsoft Digital Network Technology Co Ltd filed Critical Zhuhai Kingsoft Digital Network Technology Co Ltd
Priority to CN202310773098.3A priority Critical patent/CN116785697A/en
Publication of CN116785697A publication Critical patent/CN116785697A/en
Pending legal-status Critical Current

Links

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images
    • A63F2300/663Methods for processing data by generating or executing the game program for rendering three dimensional images for simulating liquid objects, e.g. water, gas, fog, snow, clouds

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application provides a water area generating method and device in a target virtual scene, wherein the water area generating method in the target virtual scene comprises the following steps: generating a curve coil in response to a curve coil generation instruction, and generating an initial water area model according to the curve coil; determining a target terrain in a target virtual scene, and adjusting the target terrain according to the initial water area model to obtain a first adjusted terrain; and carrying out fusion processing on the initial water area model and the first adjustment terrain to generate a target water area fused with the first adjustment terrain. The initial water area model can be added in the target terrain according to the actual application, the target terrain is automatically modified and fused according to the initial water area model, the target water area fused with the target terrain is quickly generated, the problems that the water area is manufactured by frequently modifying the terrain manually in the prior art, the operation is complex and the workload is large are avoided, the productivity is liberated, and the method and the device are more in line with the trend of generating industrialization of game resources.

Description

Method and device for generating water area in target virtual scene
Technical Field
The application relates to the technical field of computers, in particular to a water area generation method in a target virtual scene. The application also relates to a water area generating device in the target virtual scene, a computing device and a computer readable storage medium.
Background
With the development of internet technology, users have increasingly higher requirements on picture details and picture quality involved in scenes such as games, movies, and the like, and content creators have increasingly more content to create. In the process of making games and movie scenes, a water area is used as a common element in a picture, and frequent modification is needed.
The existing manufacturing method is to manually brush and modify the topography to manufacture the water area, so that the topography is required to be frequently modified manually, the operation is very tedious, and the workload is large. Therefore, there is a need to provide an efficient water generation method to solve the above problems.
Disclosure of Invention
In view of this, the embodiment of the application provides a method for generating a water area in a target virtual scene. The application also relates to a water area generating device in the target virtual scene, a computing device and a computer readable storage medium, so as to solve the problems of complicated manufacturing and large workload in the prior art that the water area is manufactured manually.
According to a first aspect of an embodiment of the present application, there is provided a method for generating a water area in a target virtual scene, including:
generating a curve coil in response to a curve coil generation instruction, and generating an initial water area model according to the curve coil;
Determining a target terrain in a target virtual scene, and adjusting the target terrain according to the initial water area model to obtain a first adjusted terrain;
and fusing the initial water area model with the first adjustment terrain to generate a target water area fused with the first adjustment terrain.
According to a second aspect of an embodiment of the present application, there is provided a water area generating apparatus in a target virtual scene, including:
a model generation module configured to generate a curvilinear coil in response to a curvilinear coil generation instruction, and to generate an initial water model from the curvilinear coil;
the terrain obtaining module is configured to determine target terrain in a target virtual scene, and adjust the target terrain according to the initial water area model to obtain first adjusted terrain;
and the water area generating module is configured to fuse the initial water area model with the first adjustment terrain and generate a target water area fused with the first adjustment terrain.
According to a third aspect of embodiments of the present application there is provided a computing device comprising a memory, a processor and computer instructions stored on the memory and executable on the processor, when executing the computer instructions, implementing the steps of a method of water generation in the target virtual scene.
According to a fourth aspect of embodiments of the present application there is provided a computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of a method of water generation in a virtual scene of interest.
According to the water area generating method in the target virtual scene, a curve coil is generated in response to a curve coil generating instruction, and an initial water area model is generated according to the curve coil; determining a target terrain in a target virtual scene, and adjusting the target terrain according to the initial water area model to obtain a first adjusted terrain; and fusing the initial water area model with the first adjustment terrain to generate a target water area fused with the first adjustment terrain.
According to the water area generating method in the target virtual scene, the initial water area model is generated according to the curve coil, the initial water area model can be added into the target terrain according to actual application, the target terrain is automatically modified and fused according to the initial water area model, and the target water area fused with the target terrain is quickly generated, so that the problems that the water area is manufactured by frequently modifying the terrain manually in the prior art, the operation is complicated and the workload is large are solved, the productivity is liberated, and the method is more in line with the trend of generating industrialization of game resources.
Drawings
Fig. 1 is a schematic view of a method for generating a water area in a target virtual scene according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for generating a water area in a virtual target scene according to an embodiment of the present application;
FIG. 2a is a schematic diagram of an initial water surface model in a method for generating a water area in a target virtual scene according to an embodiment of the present application;
FIG. 2b is a schematic diagram of a shoal model at a lake in a method for generating a water area in a virtual scene of interest according to an embodiment of the present application;
FIG. 2c is a schematic diagram of a lake bottom model in a method for generating a water area in a target virtual scene according to an embodiment of the present application;
FIG. 2d is a schematic diagram of a method for generating a water area in a virtual target scene according to an embodiment of the present application;
FIG. 2e is a schematic diagram of a nested arrangement of three coils in a method for generating a water area in a virtual target scene according to an embodiment of the present application;
FIG. 2f is a schematic diagram illustrating resampling of curve vertices in a method for generating a water area in a virtual target scene according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating a specific process of a method for generating a water area in a virtual target scene according to an embodiment of the present application;
Fig. 4 is a schematic structural diagram of a water area generating device in a target virtual scene according to an embodiment of the present application;
FIG. 5 is a block diagram of a computing device according to one embodiment of the application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. The present application may be embodied in many other forms than those herein described, and those skilled in the art will readily appreciate that the present application may be similarly embodied without departing from the spirit or essential characteristics thereof, and therefore the present application is not limited to the specific embodiments disclosed below.
The terminology used in the one or more embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the application. As used in one or more embodiments of the application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present application refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that, although the terms first, second, etc. may be used in one or more embodiments of the application to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first may also be referred to as a second, and similarly, a second may also be referred to as a first, without departing from the scope of one or more embodiments of the application. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
First, terms related to one or more embodiments of the present application will be explained.
Lake: the lake basin and the water body contained by the lake basin, wherein the lake basin is a natural depression which can store water and is relatively sealed on the ground surface.
mesh: is a polygonal mesh, which is a data structure used for modeling various irregular objects in computer graphics, and comprises a plurality of vertexes and a triangle array, wherein vertex information comprises coordinates and normals of the surface.
In the present application, a method for generating a water area in a target virtual scene is provided, and the present application relates to a device for generating a water area in a target virtual scene, a computing device, and a computer-readable storage medium, which are described in detail in the following embodiments.
Fig. 1 is a schematic view of a method for generating a water area in a target virtual scene according to an embodiment of the present application.
The user 102 and the terminal 104 are included in fig. 1, wherein the user 102 may be understood as a person drawing an image, such as a game developer, designer, etc.; the terminal 104 may be understood as a smart device such as a cell phone, a notebook, a desktop computer, etc.
In particular, a water area is understood to be an area containing water, such as a stream, pond, lake, sea, etc.
For easy understanding, the following embodiments take the user 102 as a designer, the terminal 104 as a desktop computer, and the water area as a lake as examples, and describe in detail a method for generating a water area in a target virtual scene according to the embodiments of the present application.
In practical application, under the condition that a lake needs to be generated in map generation of a game scene, a designer a inputs a curve coil a into a desktop computer, an initial lake model a is obtained according to the curve coil a, the topography of a target virtual scene is adjusted according to the initial lake model a, an adjusted topography a is obtained, the initial lake model a and the adjusted topography a are subjected to fusion processing, a target lake fused with the adjusted topography a is obtained, and the target lake is displayed on the desktop computer of the designer a, so that the designer a obtains the target lake meeting the requirements of the designer.
According to the lake generation method in the target virtual scene, the initial lake model is generated according to the curve coil, the initial lake model can be added into the target topography according to actual application, and the target topography is automatically modified and fused according to the initial lake model, so that the target lake fused with the target topography is quickly generated, the problems that the lake is manufactured by manually frequently modifying the topography in the prior art, the operation is complicated and the workload is large are solved, the productivity is liberated, and the method is more in line with the trend of generating industrialization of game resources.
Referring to fig. 2, fig. 2 shows a flowchart of a method for generating a water area in a target virtual scene according to an embodiment of the application, which specifically includes the following steps:
step 202: and generating a curve coil in response to a curve coil generation instruction, and generating an initial water area model according to the curve coil.
The curve coil generating instruction may be understood as an instruction, such as a code instruction or an input operation instruction, sent by a user and used for generating a curve coil, which is received by a terminal (i.e., the curve coil is drawn by the user on a drawing interface of the terminal through a mouse or the like); a curvilinear coil is understood to mean a closed loop connected by a curve, such as a circle, ellipse, irregular circle, etc.; the initial water area model is understood to be the initial water area model generated from the input curve coil.
For easy understanding, the embodiments of the present disclosure will take an example in which a water area generating method in a target virtual scene is applied to generate a lake scene as an example.
Then, in response to the instruction for generating the curve coil, generating the curve coil and generating an initial water area model according to the curve coil, it can be understood that in response to the instruction for generating the curve coil sent by the user side, generating the curve coil, such as an irregular curve circle, and generating an initial lake model according to the curve coil.
Specifically, the curve coil generation instruction may carry the number of coils, and one curve coil is generated when the number of coils is 1, and two nested curve coils are generated when the number of coils is 2.
In one or more embodiments of the present disclosure, an initial water area model may be generated according to an input curve coil, where the initial water area model is composed of a water bottom, a water area shoal, and a water surface, and then a single curve coil may be input first, an initial water surface model is generated according to the single curve coil, a water area shoal model is generated according to the initial water surface model, and then a water bottom model is generated according to the water area shoal model, and a target water surface model; that is, an initial model including a shoal model, a water bottom model and a target water surface model can be generated according to a single curve coil, the workload of a user can be reduced by inputting the single curve coil, and the user can obtain an initial water area model by inputting the single curve coil. The specific implementation mode is as follows:
The number of the curve coils is one;
correspondingly, the generating an initial water area model according to the curve coil comprises the following steps:
generating an initial water surface model according to one curve coil;
extruding and descending the initial water surface model inwards to generate a water area shoal model, and extruding and descending the water area shoal model inwards to generate a water bottom model;
extruding the edge of the shallow model of the water area outwards to generate a target water surface model;
and generating an initial water area model according to the water area shoal model, the underwater model and the target water surface model.
Still taking the lake generation as an example, a detailed description will be given of a water area generation method in the target virtual scene. The initial water surface model can be understood as a water surface mesh which is preliminarily generated according to a single curve coil; referring to fig. 2a, fig. 2a is a schematic diagram illustrating an initial water surface model in a water area generating method in a target virtual scene according to an embodiment of the present application.
The water area shoal model can be understood as a lake side shoal model, namely the lake side shoal model is formed by extruding the initially generated water surface mesh inwards and downwards, wherein the inwards extruding can be set according to actual needs, for example, the inwards extruding angle is 30 degrees, the extruding depth is 2 meters, and the embodiment of the application is not limited in any way; referring to fig. 2b, fig. 2b is a schematic diagram of a lake side shoal model in a method for generating a water area in a target virtual scene according to an embodiment of the present application.
The water bottom model can be understood as a lake bottom model, namely the lake bottom model formed by inward extrusion of the shoal mesh at the lake side and downward extrusion; referring to fig. 2c, fig. 2c is a schematic diagram of a lake bottom model in a water area generating method in a target virtual scene according to an embodiment of the present application.
The target water surface model may be understood as extracting the inner side of the shoal mesh at the lake side, extruding outwards along the edge to form the target water surface, wherein the extrusion outwards is similar to the extrusion inwards, and may be set according to actual needs, for example, the extrusion angle is 160 degrees outwards, and the extrusion length is 3 meters, which is not limited in any way in the embodiment of the present application.
The initial water model is understood to be a model composed of the above-mentioned water shoal model, the underwater model, and the target water surface model.
In practical application, under the condition that the number of the curve coils is one, initially generating a water surface according to the curve coils, extruding and descending the water surface inwards to form a water area shoal model, extruding and descending the inner side of a water area shoal mesh inwards to form a water bottom model, extracting the inner side of the water area shoal mesh and extruding outwards along the edge to generate a target water surface model, and combining the water area shoal model, the water bottom model and the target water surface model to generate an initial water area model.
According to the water area generating method in the target virtual scene, the initial water area model can be generated rapidly according to the single curve coil, then the water area shoal model, the water bottom model and the target water surface model can be generated reasonably, the initial water area model is generated according to the water area shoal model, the water bottom model and the target water surface model, the workload of a user can be reduced through the mode of inputting the single curve coil, and the user can obtain the initial water area model only by inputting the single curve coil.
In one or more embodiments of the present disclosure, a curve coil is input by a user according to a form of points, the curve coil is formed by the points, a curve coil is formed by connecting the points, in the case of generating an initial water surface model according to a curve coil, the input curve coil is rotated to show a cross section of the curve coil, the points of the curve coil are adjusted so that the points on the cross section of the curve coil are located on the same horizontal plane, a region with a gentle topography is realized, and a more realistic surface is generated on the water surface of a plane, then the water surface of the plane can be generated according to the curve coil, and the topography is combined to increase the authenticity. The specific implementation mode is as follows:
The generating an initial water surface model according to one curve coil comprises the following steps:
determining all vertexes of one curve coil, and selecting a target vertex from all vertexes, wherein the target vertex is any one vertex in all vertexes;
according to the height of the target vertex in the cross section of the curve coil, the heights of other vertices except the target vertex in the curve coil are adjusted to obtain a target curve coil;
and generating an initial water surface model according to the target curve coil.
Wherein, a vertex can be understood as a point that is built up as a curved coil; the target vertex can be understood as any one of all selected vertices; the cross section of the curved coil is understood to be the surface exhibited by a rotation of the curved coil by 90 °; the target curve coil is understood to be a curve coil after adjusting other vertices of the curve coil except for the selected vertex.
In the specific implementation, any one of all vertexes is selected from all vertexes for constructing the curve coil, the heights of the other vertexes except the selected vertexes in the curve coil are adjusted according to the height of a surface displayed by rotating the selected vertexes by 90 degrees on the curve coil, the adjusted curve coil is obtained, and the initial water surface generated according to the adjusted curve coil is generated.
In practical application, in a region with a gentle topography, a plane water surface can be generated to enrich visual effects, and the combination of the plane water surface and the region with the gentle topography is more realistic, specifically, a single-circle curve coil is constructed, the vertexes of the curve coil are flattened, the modes of lowest, middle, highest and the like can be selected, the vertexes of the curve coil are flattened to the same height, and referring to fig. 2d, fig. 2d shows a schematic diagram of the vertexes of the flattening curve coil in the water area generating method in the target virtual scene provided by the implementation of the application; reducing the number of points of the curve coil, converting the curve coil into mesh for storage, correcting the normal under the condition that the reverse surface appears, and preventing the reverse surface from generating a water surface model; the water surface model may be given a texture, such as a greenish black color to indicate cloudy water, or a blue color to indicate clear water; marking the model as water, and subsequently not influencing the topography; the type of water-edge-covering stone, such as granite, sandstone, etc., is marked to show different visual effects.
According to the water area generating method in the target virtual scene, the vertexes of the curve coils are determined, the vertexes of the curve coils except the vertexes are adjusted to the same height, the target curve coils are generated, and therefore an initial water surface model is accurately generated according to the target curve coils.
In one or more embodiments of the present disclosure, in a case where an initial water area model needs to be generated in a region with a steeper topography, three curve coils may be input, and the three curve coils are sequentially nested and arranged, and by connecting points of two curve coils and pasting triangles generated by the connected lines, a water area shoal model, a water bottom model, and a target water surface model are generated; the initial water area model is generated according to the water area shoal model, the water bottom model and the target water surface model more accurately, so that the initial water area model can be fused with a steeper area better. The specific implementation mode is as follows:
the number of the curve coils is three;
correspondingly, the generating an initial water area model according to the curve coil comprises the following steps:
determining curve peaks of a first curve coil, a second curve coil and a third curve coil in the three curve coils respectively, wherein the first curve coil, the second curve coil and the third curve coil are sequentially nested and arranged;
resampling curve peaks of the first curve coil, the second curve coil and the third curve coil, generating a water bottom model according to the resampled first curve coil and the resampled second curve coil, and generating a water area shoal model according to the resampled second curve coil and the resampled third curve coil;
Extruding the edge of the shallow model of the water area outwards to generate a target water surface model;
and generating an initial water area model according to the water area shoal model, the underwater model and the target water surface model.
The region of steeper topography is understood to be a region of higher gradient, such as a canyon; the first curve coil, the second curve coil and the third curve coil are sequentially nested and arranged, and fig. 2e can be referred to, where fig. 2e shows a schematic diagram of three coils nested and arranged in a water area generating method in a target virtual scene according to an embodiment of the present application; the innermost curve coil is a first curve coil, the middle curve coil is a second curve coil, and the outermost curve coil is a third curve coil.
Specifically, taking a generated lake as an example, three curve coils are constructed, curve peaks of the three curve coils are respectively determined, the three curve coils are arranged in a nested mode, curve peaks of the first curve coil, the second curve coil and the third curve coil are resampled, then a lake bottom model is generated according to the resampled first curve coil and second curve coil, the lake bottom model can be marked, if the lake bottom material is marked as sludge to represent a turbid lake bottom, or the lake bottom material is marked as cobble to represent a clear lake bottom, rendering generation can be directly carried out according to the marked lake bottom material under the condition that a target lake is generated, and naturally, the lake bottom model can be generated without marking, and under the condition that the target lake is generated, the lake bottom material is determined first and then rendering generation is carried out; the embodiment of the application is not limited; and generating a shoal model at the lake side according to the resampled second curve coil and third curve coil.
Extracting a second curve coil, generating a new mesh according to the second curve coil, patting the new mesh, expanding the new mesh outwards, marking the new mesh as a water surface, generating a target water surface model, packaging the lake bottom and the water surface, marking, and generating an initial lake model according to the lake side shoal model, the lake bottom model and the target water surface model.
According to the method for generating the water area in the target virtual scene, the water area shoal model, the water bottom model and the target water surface model can be generated according to the three curve coils, so that the initial water area model can be generated more accurately according to the water area shoal model, the water bottom model and the target water surface model, and the initial water area model can be fused with a steeper region better in the following process.
In one or more embodiments of the present disclosure, resampling curve vertices of the first curve coil, the second curve coil, and the third curve coil aligns a vertex number of the curve coil with a largest vertex number of the three curve coils, so as to facilitate subsequent connection of vertices between two adjacent curve coils. The specific implementation mode is as follows:
the resampling of the curve vertices of the first curve coil, the second curve coil, and the third curve coil comprises:
Traversing curve vertexes of the first curve coil, the second curve coil and the third curve coil, and respectively determining the vertex numbers of the curve vertexes of the first curve coil, the second curve coil and the third curve coil;
determining a curve coil with the largest number of peaks of curve peaks from the first curve coil, the second curve coil and the third curve coil;
and resampling the curve peaks of other curve coils according to the coil segment number of the curve coil with the maximum peak number.
In practical application, traversing the first curve coil, the second curve coil and the third curve coil, converting the three curve coils into a mesh storage mode, storing the mesh storage mode as a point, wherein the converted curve coils have more vertexes than those in the curve coils before conversion, because the original curve may be NURBS (non-uniform rational B spline) or Bezier curve, and only a few small control points are provided, for example, the first curve coil before conversion has 10 vertexes, and the first curve coil after conversion into the mesh storage mode has 20 vertexes; the number of curve coil points is reduced, and the normal direction is corrected.
Calculating the peak numbers of the peak points of the respective curves after the first curve coil, the second curve coil and the third curve coil are converted into the mesh storage mode, and finding out the curve coil with the largest peak number, if the first curve coil converted into the mesh storage mode has 20 peak points, the second curve coil converted into the mesh storage mode has 25 peak points, the third curve coil converted into the mesh storage mode has 30 peak points, and then the curve coil with the largest peak number is the third curve coil.
Then, resampling the first curved line coil and the second curved line coil according to the number of coil segments of the third curved line coil with the largest number of vertices, that is, the number of coil segments of the first curved line coil and the second curved line coil is set to be the same as the number of coil segments of the third curved line coil, see fig. 2f, fig. 2f shows a schematic diagram of resampling the vertices of the curves in the water area generating method in the target virtual scene according to an embodiment of the present application.
According to the water area generation method in the target virtual scene, resampling is conducted on curve peaks of the first curve coil, the second curve coil and the third curve coil, so that a water bottom model and a water area shoal model can be generated reasonably in the follow-up process.
In one or more embodiments of the present disclosure, after resampling the curve vertices, the number of curve vertices of two-by-two curve coils is the same, so as to connect vertices between two adjacent two-by-two curve coils; when connecting curve vertexes, placing the two curve coils on the same horizontal plane to connect the two curve vertexes with the shortest distance in the two curve coils; specifically, under the condition of generating the underwater model, connecting two curve peaks with shortest distances between the peak points of each curve in the resampled first curve coil and the resampled second curve coil to accurately generate the underwater model. The specific implementation mode is as follows:
the generating the underwater model according to the resampled first curve coil and the resampled second curve coil comprises the following steps:
determining a first curve top point of a resampled first curve coil and a second curve top point of a resampled second curve coil, and classifying Y axes of the first curve top point and the second curve top point as 0;
traversing the first curve top point, connecting the first curve top point with the second curve top point closest to the first curve top point, and generating a water bottom model according to the connection relation.
In practical application, determining the position coordinates of a first curve vertex of a resampled first curve coil and the position coordinates of a second curve vertex of a resampled second curve coil, wherein the resampled first curve coil and the resampled second curve coil have the same curve point number, so that the first curve vertex and the second curve vertex can be correspondingly connected; the Y-axis at the first curve apex and the second curve apex are normalized to 0, so that the first curve coil and the second curve coil are located on the same horizontal plane.
Traversing a first curve vertex of a first curve coil, determining a certain first curve vertex, searching a corresponding second curve vertex closest to the first curve vertex, and connecting the first curve vertex with the corresponding second curve vertex closest to the first curve vertex in a memorial way to form a line; generating a mesh according to the lines, namely, attaching a surface patch to the lines; and under the condition that no surface piece exists between the lines, namely a gap exists, the gap is filled up to generate a water bottom model, and then the Y axis of each vertex is restored to the corresponding height before.
According to the water area generation method in the target virtual scene, the resampled first curve coils and the resampled second curve coils are the same in number of curve peaks, the curve coils are placed on the same horizontal plane, and the curve coils closest to each other in the two curve coils are connected, so that a water bottom model is accurately generated according to the resampled first curve coils and second curve coils.
In one or more embodiments of the present disclosure, a water area shoal model is accurately generated from the resampled second curve coil and third curve coil. The specific implementation mode is as follows:
the generating a water area shoal model according to the resampled second curve coil and the resampled third curve coil comprises the following steps:
Determining a second curve top point of the resampled second curve coil and a third curve top point of the resampled third curve coil, and returning Y axes of the second curve top point and the third curve top point to 0;
traversing the second curve top point, connecting the second curve top point with the third curve top point closest to the second curve top point, and generating a water area shoal model according to the connection relation.
The specific implementation is similar to the method for generating the lake bottom model, and is not repeated here.
According to the water area generating method in the target virtual scene, the water area shoal model is accurately generated according to the resampled second curve coil and third curve coil.
Step 204: and determining a target terrain in the target virtual scene, and adjusting the target terrain according to the initial water area model to obtain a first adjusted terrain.
The target virtual scene may be understood as a game scene or an animation scene, and the target terrain in the target virtual scene may be understood as the terrain in the scene to which the initial lake model is to be applied in the game scene or the animation scene, or the pre-stored terrain, where the terrain includes but is not limited to plain, canyon, and the like, and the description is not limited thereto; the first adjusted terrain may be understood as an adjusted terrain resulting from an adjustment of the terrain based on the initial water model.
Then, taking the target terrain as a pre-stored terrain as an example for detailed explanation, determining the target terrain in the target virtual scene, adjusting the target terrain according to the initial water area model, and obtaining the first adjusted terrain, it can be understood that the pre-stored terrain is obtained, and adjusting the pre-stored terrain according to the initial water area model, so as to obtain the adjusted terrain.
In one or more embodiments of the present disclosure, a ray is emitted through a target terrain pixel, so that in a case where the ray collides with a water bottom model, a height of a terrain of the target terrain corresponding to a collision position of the water bottom model is accurately adjusted, and a first adjusted terrain is obtained. The specific implementation mode is as follows:
the adjusting the target terrain according to the initial water area model to obtain a first adjusted terrain comprises the following steps:
placing the initial water area model on the target terrain, and traversing all terrain pixels of the target terrain to emit rays upwards;
and when the rays collide with the water bottom model of the initial water area model, adjusting the height of the terrain corresponding to the collision position of the water bottom model in the target terrain according to the height of the collision position of the water bottom model, and obtaining a first adjusted terrain.
Each topography pixel is understood to be a pixel of the target topography; rays are understood to mean that shooting is performed from each pixel as a starting point in a certain direction, and if an object is hit during shooting, information of the object and the hit position can be obtained; a collision is understood as a ray hit; the impact location is understood to be the location where the ray hits.
In practical application, the initial water area model is placed on pre-stored terrains, each pixel in the pre-stored terrains emits rays upwards, under the condition that the rays hit the water bottom model in the initial water area model, the height of the water bottom model is obtained according to the ray hit, the height of the terrains corresponding to the hitting position of the water bottom model in the pre-stored terrains is adjusted according to the height of the water bottom model, the adjusted terrains are obtained, and the water bottom model is matched with the terrains corresponding to the pre-stored terrains.
According to the method for generating the water area in the target virtual scene, the rays are emitted through the target terrain pixels, so that the heights of the target terrain and the terrain corresponding to the collision position of the underwater model can be accurately adjusted under the condition that the rays collide with the underwater model, and the first adjusted terrain is obtained.
In one or more embodiments of the present disclosure, after the initial water area model and the target terrain are obtained, the initial water area model may be mapped onto the target terrain, and in particular, the outer edge of the initial water area model may be obtained, so as to reasonably map the outer edge of the initial water area model to the target terrain. The specific implementation mode is as follows:
before the traversing each terrain pixel of the target terrain emits rays upwards, the method further comprises:
and acquiring the outer edge of the initial water area model, and mapping the outer edge of the initial water area model to the target terrain.
The outer edge is understood as the circle of the line at the edge of the initial water area model, namely the outermost curve line; the mapping is understood to mean that the circle of lines at the edge of the initial water model is illuminated onto the target terrain.
In practical application, the outer edge of the initial water area model is obtained, and the outer edge of the initial water area model is mapped to the target terrain, so that it can be understood that the outermost curve coil of the initial water area model is obtained, and the position of the point on the outermost curve coil is irradiated to the target terrain.
According to the water area generation method in the target virtual scene, the outermost curve coil of the initial water area model is obtained, and the positions of points on the outermost curve coil are irradiated to the target terrain, so that the subsequent fusion processing of the initial water area model and the target terrain is facilitated.
Step 206: and carrying out fusion processing on the initial water area model and the first adjustment terrain to generate a target water area fused with the first adjustment terrain.
The fusion process can be understood as fusing the model and the terrain, so that the model and the terrain are more compatible; the target water area is understood to be the area of water that merges with the target terrain.
Taking lake generation as an example, specifically, the initial water area model and the first adjusted terrain are fused to generate a target water area fused with the first adjusted terrain, which can be understood as that the initial lake model and the adjusted terrain are fused to generate a fused lake fused with the adjusted terrain.
In one or more embodiments of the present disclosure, a fusion process of a preset manner is performed on a first adjustment terrain through a first terrain mask and a second terrain mask, and by performing the fusion process, a target water area with a more realistic effect can be obtained, so that user experience is improved. The specific implementation mode is as follows:
the fusing processing is performed on the initial water area model and the first adjustment terrain to generate a target water area fused with the first adjustment terrain, and the method comprises the following steps:
Determining a first terrain mask of the terrain corresponding to the collision position of the lake bottom model in the first adjustment terrain according to the collision position of the water bottom model of the initial water area model;
determining a second terrain mask of the first adjusted terrain, which corresponds to the collision position of the target water surface model, according to the collision position of the rays colliding with the target water surface model of the initial water surface model;
and according to the first terrain mask and the second terrain mask, carrying out fusion processing of a preset mode on the first adjusted terrain to generate a target water area fused with the first adjusted terrain.
The first terrain mask is understood to be a terrain part of the first adjustment terrain, which corresponds to the hitting position of the water bottom model of the initial water area model, and is used as the first terrain mask; the second terrain mask can be understood as a terrain part of the first adjusted terrain at the hit position corresponding to the target water surface model of the initial water area model is taken as the second terrain mask; the fusion processing in the preset manner can be understood as a preset fusion processing manner which can make the effect closer to reality, such as a fusion processing of blurring and adding noise points.
Specifically, the terrain part of the first adjusted terrain at the hitting position corresponding to the underwater model of the initial water area model is used as a first terrain mask, the terrain part of the first adjusted terrain at the hitting position corresponding to the target water surface model of the initial water area model is used as a second terrain mask, and fusion processing such as blurring and noise adding is performed on the adjusted terrain according to the first terrain mask and the second terrain mask, so that a water area fused with the adjusted terrain is generated.
In practical application, because the water bottom is at the bottommost of the initial lake model, under the condition that each pixel on the terrain emits rays upwards, the rays preferentially hit the water bottom, the mask (mask) range of the lake bottom mesh affecting the terrain is calculated, namely, the terrain part of the hit position corresponding to the lake bottom mesh is calculated, the mask value corresponding to the terrain part is set to be 1, the part of the mask which is 1 is blurred, namely, the terrain part of the hit position corresponding to the lake bottom in the terrain after blurring adjustment is performed, and distortion noise points are added to the part of the mask which is 1.
And traversing each pixel on the terrain, emitting rays upwards, using the water surface mesh as collision, under the condition that the water surface mesh is hit, setting the mask value corresponding to the position of the pixel representing the current terrain just below the water surface as 1, selecting the terrain range below the water surface, recording in a mode of setting the mask as 1, adding noise points according to the mask, and generating a lake fused with the adjusted terrain.
According to the method for generating the water area in the target virtual scene, the first terrain is subjected to fusion processing in the preset mode through the first terrain mask and the second terrain mask, and the target water area with a more real effect can be obtained through the fusion processing, so that user experience is improved.
In one or more embodiments of the present disclosure, a candidate water area is generated according to the implementation, where the candidate water area has no submarine vegetation, beach vegetation, and the like, and the visual effect is not abundant and not realistic; according to the embodiment of the application, the candidate water area can be rendered according to the attribute information of the candidate water area, the underwater vegetation distribution information, the water surface expansion range and the beach vegetation distribution information, so that a target water area which is richer in visual effect and is fused with the adjusted terrain is generated. The specific implementation mode is as follows:
the fusing processing of the first adjustment terrain in a preset mode is performed according to the first terrain mask and the second terrain mask, and a target water area fused with the first adjustment terrain is generated, which comprises the following steps:
according to the first terrain mask and the second terrain mask, carrying out fusion processing of a preset mode on the first adjusted terrain to generate a candidate water area fused with the first adjusted terrain;
Determining water area attribute information of the candidate water area, water bottom vegetation distribution information of a water bottom model of the candidate water area, a water surface expansion range of a target water surface model and beach vegetation distribution information of a water area shoal model;
and rendering the candidate water area according to the water area attribute information, the underwater vegetation distribution information, the water surface expansion range and the beach vegetation distribution information to generate a target water area fused with the first adjustment topography.
Along the above example, the candidate water area can be understood as a lake candidate which is fused with the adjusted terrain and comprises a lake bottom, a shoal at the lake edge and a water surface; the water area attribute information is understood to be related information of lake attribute, including but not limited to attribute information of lake type, lake range, etc., such as cloudy lake or clear lake, etc.
The water bottom vegetation distribution information can be understood as the vegetation types in the lake bottom, such as the vegetation types of the foxtail, the black algae, the green chlorella and the like, and the distribution conditions of various vegetation, such as the foxtail, the black algae and the green chlorella which respectively occupy one third of the lake bottom and are distributed in a staggered and disordered way and the like.
The water surface expansion range is understood to be the furthest range to which the target water surface can flow in the case of water surface fluctuations, such as 2 meters, 3 meters, etc.
The beach vegetation distribution information can be understood as the vegetation type of the shoal and the distribution of various vegetation, which are similar to the above-mentioned submarine vegetation distribution information.
Specifically, taking lake generation as an example, according to the first terrain mask and the second terrain mask, carrying out fusion processing of a preset mode on the first adjusted terrain to generate a lake which is fused with the first adjusted terrain and comprises a lake bottom, a lake side shoal and a water surface; and rendering the lake comprising the lake bottom, the lake side shoal and the water surface according to the attribute information of the lake type, the lake range and the like, the vegetation type in the lake bottom, the distribution condition of various vegetation, the furthest range to which the target water surface can flow under the condition of water surface fluctuation, the vegetation type of the lake side shoal and the distribution condition of various vegetation.
In practical application, synthesizing a lake bottom mesh, a lake side shoal mesh and a target water surface mesh, generating a mask according to all mesh data, and marking the range influenced by an initial lake in the adjusted topography; calculating a mask below the water surface, traversing each pixel on the terrain, emitting rays upwards, using the water surface mesh as collision, and if the water surface mesh is not hit, emitting downwards again, and when the water surface mesh is hit, setting the mask value corresponding to the position of the water surface mesh as 1, and marking the water surface mesh as the underwater mask; expanding the underwater mask outwards, for example, expanding by 2 meters, and storing the underwater mask as a layer 1, wherein the layer 1 records underwater vegetation distribution information; blurring the underwater mask, storing the blurred mask as a layer 2, wherein the layer 2 records the distribution range of underwater textures and can be a part of a topographic layer later; calculating the edge part of the lake beach mask, deleting the area exceeding the terrain gradient by a certain angle, for example deleting the area exceeding the terrain gradient by more than 30 degrees, so as to keep the lake beach model attached to the terrain and closer to the reality effect, and storing the lake beach mask as a layer 3, wherein beach vegetation distribution information is recorded in the layer 3; and rendering the lake comprising the lake bottom, the lake side shoal and the water surface according to the attribute information of various lake types, the lake range and the like, the vegetation types in the lake bottom, the distribution situation of various vegetation, the furthest range to which the target water surface can flow under the condition of water surface fluctuation, the vegetation types of the lake side shoal and the distribution situation of various vegetation, and generating the lake with richer visual effect and the regulated terrain fusion.
According to the water area generation method in the target virtual scene, the candidate water area is rendered according to the attribute information of the candidate water area, the underwater vegetation distribution information, the water surface expansion range and the beach vegetation distribution information, so that a more real target water area which is richer in visual effect and fused with the adjusted terrain is generated.
In one or more embodiments of the present disclosure, an underwater island model may be further added to the initial water area model, corresponding to the existence of an underwater island in a real lake, and in the case that a user needs to add an underwater island in a water area, a curve coil may be extruded inward and lifted to reasonably generate the underwater island model, enrich the initial water area model, and achieve a richer visual effect. The specific implementation mode is as follows:
the generating of the curve coil in response to the curve coil generation instruction further includes:
determining all vertexes of the curve coil, and selecting a target vertex from all vertexes, wherein the target vertex is any one vertex in all vertexes;
according to the height of the target vertex in the cross section of the curve coil, the heights of other vertices except the target vertex in the curve coil are adjusted to obtain a target curve coil;
And extruding and rising the target curve coil inwards to generate a water island model.
Among these, the islands-in-water model is understood to be a raised large stone that can be placed in the original water model.
Specifically, the water island model is extruded inwards and descends with the initial water surface model, and the water area shoal model is generated, but only the target curve coil is extruded inwards and ascended to generate the water island model, which is not described herein.
According to the method for generating the water area in the target virtual scene, the curve coil is extruded inwards and ascended to reasonably generate the island model in water, and the initial water area model is enriched, so that a richer visual effect is achieved.
In one or more embodiments of the present disclosure, when an aquatic island needs to be placed on a target terrain, the aquatic island model is adjusted to the first adjusted terrain to obtain a second adjusted terrain, and then the initial water area model, the aquatic island model and the second adjusted terrain are subjected to fusion treatment, so as to realize fusion of the initial water area model, the aquatic island model and the target terrain, and display a target lake including the aquatic island existing in the target terrain with a more realistic display effect. The specific implementation mode is as follows:
After the first adjustment topography is obtained, the method further comprises:
adjusting the first adjustment terrain according to the island model to obtain a second adjustment terrain;
and carrying out fusion treatment on the initial water area model, the underwater island model and the second regulation topography to generate a target water area fused with the second regulation topography.
Specifically, under the condition that the underwater island model is of a first type, the first adjustment terrain is adjusted according to the underwater island model, and the second adjustment terrain is obtained. The specific implementation mode is as follows:
and adjusting the first adjustment terrain according to the island model to obtain a second adjustment terrain, wherein the method comprises the following steps of:
placing the water island model on the first adjusted terrain and traversing each terrain pixel of the first adjusted terrain to emit rays upwards under the condition that the water island model is determined to be of a first type;
and when the rays collide with the underwater island model, adjusting the height of the terrain corresponding to the collision position of the underwater island model in the first adjustment terrain according to the height of the collision position of the underwater island model, so as to obtain a second adjustment terrain.
Wherein the first type is understood to not preserve the original topography; similar to the first adjustment topography obtained by the ray collision described above, the second adjustment topography is obtained, which is not described here again.
Specifically, when the underwater island model is of the second type, the first adjustment terrain is adjusted according to the underwater island model, and the second adjustment terrain is obtained. The specific implementation mode is as follows:
and adjusting the first adjustment terrain according to the island model to obtain a second adjustment terrain, wherein the method comprises the following steps of:
and under the condition that the water island model is determined to be of a second type, placing the water island model on the first adjusted terrain, and adjusting the height of the terrain corresponding to the water island model in the first adjusted terrain to be the terrain height corresponding to the target terrain to obtain a second adjusted terrain.
Wherein the second type can be understood as preserving the original topography; the height of the first adjusted terrain corresponding to the underwater island model is adjusted to the terrain height corresponding to the target terrain, that is, the height of the first adjusted terrain corresponding to the underwater island model is adjusted to the original terrain height.
In practical application, according to the previous mark for reserving the topography, the islands in water of different types are distinguished into the types for reserving the original topography and not reserving the original topography; the method comprises the steps that an underwater island which does not store original topography influences a topography mesh, an influence mask is calculated, and edge blurring and noise points are added according to the mask; calculating influence terrain mesh of islands in water for storing original terrains, adding edge blurring to the mask, and replacing the affected terrains in the first adjusted terrains to unaffected terrains; the island region above the water surface is stored as an island layer.
According to the method for generating the water area in the target virtual scene, different second adjustment terrains can be obtained according to different types of the underwater island models, different underwater island effects are achieved, specifically, the method for generating the water area in the target virtual scene influences terrains for the underwater island models, the method for generating the water area in the target virtual scene does not influence terrains for the underwater island models, different modes are provided for users, and user experience is improved.
The manner of the fusion process is similar to the above implementation, and will not be described here again.
According to the water area generation method in the target virtual scene, the underwater island model is used for adjusting the first adjustment terrain to obtain the second adjustment terrain, and then the initial water area model, the underwater island model and the second adjustment terrain are subjected to fusion treatment to achieve fusion of the initial water area model, the underwater island model and the target terrain, so that a target water area containing the underwater island in the target terrain is more real in display effect.
Referring to fig. 3, taking an example that the method for generating a water area in a target virtual scene is applied to generating a lake, fig. 3 shows a specific process flow chart of the method for generating a water area in a target virtual scene according to an embodiment of the present application, which specifically includes the following steps:
step one: starting.
Lake generation in the target virtual scene is started.
Step two: a control curve is input and a topography is input.
The control curve can be understood as that in the above embodiment, the control curve is carried in the curve coil generating command.
And obtaining a curve coil and a target terrain according to the input control curve and the input terrain.
Step three: and generating a lake agent model according to the input control curve.
The lake agent model may be understood as a lake bottom model, an island model, and/or a target water surface model in the above embodiments.
The implementation of generating the lake agent model according to the input control curve can be referred to the above embodiment, and will not be described herein.
Step four: the separation agent model is a lake bottom agent model, a island agent model in a lake and a water surface agent model.
Wherein, the lake bottom agent model can be understood as the lake bottom model in the above embodiment; the in-lake island agent model may be understood as the in-lake island model in the above embodiment; the surface proxy model may be understood as the target surface model in the above embodiment.
Step five: and obtaining the terrain according to the input terrain and the lake bottom proxy model to generate a lake bottom part.
Specifically, adjusting the target terrain according to a lake bottom model of the initial lake model to obtain a first adjusted terrain; the specific implementation can be referred to the above embodiments, and will not be described herein.
Step six: and obtaining the terrain generating island part in the lake according to the island agent model in the lake and the terrain generating lake bottom part.
Specifically, the islands in the lake are placed on the first adjusted terrain to obtain the second adjusted terrain, and the specific implementation can be referred to the above embodiment, which is not described herein.
Step seven: and obtaining a terrain generation map layer part according to the terrain generation island part and the water surface proxy model.
Specifically, each mask is stored in a different layer, and the above embodiments may be referred to, which is not described herein.
Step eight: and obtaining segmentation according to the water surface proxy model to regenerate the water surface.
Specifically, all the water surface mesh are combined, the area without topography below the water surface is deleted, the bounding box of the topography is calculated, boolean operation is carried out by using the bounding box and the water surface mesh, the water surface mesh outside the topography bounding box is cut, wiring operation of rearranging the model is carried out on the cut water surface mesh, and disordered and slender wiring is changed into regular triangular wiring.
Step nine: and generating a layer part of the terrain and cutting to regenerate a water surface merging result.
Specifically, the merging result can be understood as the obtained target lake. Reference may be made specifically to the above embodiments, and details are not repeated here.
According to the lake generation method in the target virtual scene, the initial lake model is generated according to the curve coil, the initial lake model can be added into the target topography according to actual application, and the target topography is automatically modified and fused according to the initial lake model, so that the target lake fused with the target topography is quickly generated, the problems that the lake is manufactured by manually frequently modifying the topography in the prior art, the operation is complicated and the workload is large are solved, the productivity is liberated, and the method is more in line with the trend of generating industrialization of game resources.
Corresponding to the method embodiment, the application also provides an embodiment of a method and a device for generating a water area in a target virtual scene, and fig. 4 shows a schematic structural diagram of the method and the device for generating a water area in a target virtual scene according to an embodiment of the application.
As shown in fig. 4, the apparatus includes:
a model generation module 402 configured to generate a curvilinear coil in response to a curvilinear coil generation instruction, and to generate an initial water model from the curvilinear coil;
A terrain obtaining module 404 configured to determine a target terrain in a target virtual scene, and adjust the target terrain according to the initial water area model to obtain a first adjusted terrain;
a water generation module 406 configured to fuse the initial water model with the first adjusted terrain and generate a target water fused with the first adjusted terrain.
Optionally, the model generation module 402 is further configured to:
generating an initial water surface model according to one curve coil;
extruding and descending the initial water surface model inwards to generate a water area shoal model, and extruding and descending the water area shoal model inwards to generate a water bottom model;
extruding the edge of the shallow model of the water area outwards to generate a target water surface model;
and generating an initial water area model according to the water area shoal model, the underwater model and the target water surface model.
Optionally, the model generation module 402 is further configured to:
determining all vertexes of one curve coil, and selecting a target vertex from all vertexes, wherein the target vertex is any one vertex in all vertexes;
According to the height of the target vertex in the cross section of the curve coil, the heights of other vertices except the target vertex in the curve coil are adjusted to obtain a target curve coil;
and generating an initial water surface model according to the target curve coil.
Optionally, the model generation module 402 is further configured to:
determining curve peaks of a first curve coil, a second curve coil and a third curve coil in the three curve coils respectively, wherein the first curve coil, the second curve coil and the third curve coil are sequentially nested and arranged;
resampling curve peaks of the first curve coil, the second curve coil and the third curve coil, generating a water bottom model according to the resampled first curve coil and the resampled second curve coil, and generating a water area shoal model according to the resampled second curve coil and the resampled third curve coil;
extruding the edge of the lake shoal model outwards to generate a target water surface model;
and generating an initial water area model according to the water area shoal model, the underwater model and the target water surface model.
Optionally, the model generation module 402 is further configured to:
Traversing curve vertexes of the first curve coil, the second curve coil and the third curve coil, and respectively determining the vertex numbers of the curve vertexes of the first curve coil, the second curve coil and the third curve coil;
determining a curve coil with the largest number of peaks of curve peaks from the first curve coil, the second curve coil and the third curve coil;
and resampling the curve peaks of other curve coils according to the coil segment number of the curve coil with the maximum peak number.
Optionally, the model generation module 402 is further configured to:
determining a first curve top point of a resampled first curve coil and a second curve top point of a resampled second curve coil, and classifying Y axes of the first curve top point and the second curve top point as 0;
traversing the first curve top point, connecting the first curve top point with the second curve top point closest to the first curve top point, and generating a water bottom model according to the connection relation.
Optionally, the model generation module 402 is further configured to:
determining a second curve top point of the resampled second curve coil and a third curve top point of the resampled third curve coil, and returning Y axes of the second curve top point and the third curve top point to 0;
Traversing the second curve top point, connecting the second curve top point with the third curve top point closest to the second curve top point, and generating a water area shoal model according to the connection relation.
Optionally, the terrain acquisition module 404 is further configured to:
placing the initial water area model on the target terrain, and traversing all terrain pixels of the target terrain to emit rays upwards;
and when the rays collide with the water bottom model of the initial water area model, adjusting the height of the terrain corresponding to the collision position of the water bottom model in the target terrain according to the height of the collision position of the water bottom model, and obtaining a first adjusted terrain.
Optionally, the apparatus further comprises:
a mapping module configured to:
and acquiring the outer edge of the initial water area model, and mapping the outer edge of the initial water area model to the target terrain.
Optionally, the water generation module 406 is further configured to:
determining a first terrain mask of the terrain corresponding to the collision position of the water bottom model in the first adjustment terrain according to the collision position of the water bottom model of the initial water area model;
Determining a second terrain mask of the first adjusted terrain, which corresponds to the collision position of the target water surface model, according to the collision position of the rays colliding with the target water surface model of the initial water surface model;
and according to the first terrain mask and the second terrain mask, carrying out fusion processing of a preset mode on the first adjusted terrain to generate a target water area fused with the first adjusted terrain.
Optionally, the water generation module 406 is further configured to:
according to the first terrain mask and the second terrain mask, carrying out fusion processing of a preset mode on the first adjusted terrain to generate a candidate water area fused with the first adjusted terrain;
determining water area attribute information of the candidate water area, water bottom vegetation distribution information of a water bottom model of the candidate water area, a water surface expansion range of a target water surface model and beach vegetation distribution information of a water area shoal model;
and rendering the candidate water area according to the water area attribute information, the underwater vegetation distribution information, the water surface expansion range and the beach vegetation distribution information to generate a target water area fused with the first adjustment topography.
Optionally, the apparatus further comprises:
an islands-in-water model generation module configured to:
determining all vertexes of the curve coil, and selecting a target vertex from all vertexes, wherein the target vertex is any one vertex in all vertexes;
according to the height of the target vertex in the cross section of the curve coil, the heights of other vertices except the target vertex in the curve coil are adjusted to obtain a target curve coil;
and extruding and rising the target curve coil inwards to generate a water island model.
Optionally, the apparatus further comprises:
a target water generation module configured to:
adjusting the first adjustment terrain according to the island model to obtain a second adjustment terrain;
and carrying out fusion treatment on the initial water area model, the underwater island model and the second regulation topography to generate a target water area fused with the second regulation topography.
Optionally, the apparatus further comprises:
a second adjusted terrain acquisition module configured to:
placing the water island model on the first adjusted terrain and traversing each terrain pixel of the first adjusted terrain to emit rays upwards under the condition that the water island model is determined to be of a first type;
And when the rays collide with the underwater island model, adjusting the height of the terrain corresponding to the collision position of the underwater island model in the first adjustment terrain according to the height of the collision position of the underwater island model, so as to obtain a second adjustment terrain.
And under the condition that the water island model is determined to be of a second type, placing the water island model on the first adjusted terrain, and adjusting the height of the terrain corresponding to the water island model in the first adjusted terrain to be the terrain height corresponding to the target terrain to obtain a second adjusted terrain.
According to the water area generating device in the target virtual scene, the initial water area model is generated according to the curve coil, the initial water area model can be added into the target terrain according to actual application, the target terrain is automatically modified and fused according to the initial water area model, the target water area fused with the target terrain is quickly generated, the problems that the water area is manufactured by frequently modifying the terrain manually in the prior art, the operation is complex and the workload is large are solved, the productivity is liberated, and the method is more in line with the trend of generating industrialization of game resources.
The above is a schematic scheme of a water area generating device in a target virtual scene in this embodiment. It should be noted that, the technical solution of the water area generating device in the target virtual scene and the technical solution of the water area generating method in the target virtual scene belong to the same concept, and details of the technical solution of the water area generating device in the target virtual scene, which are not described in detail, can be referred to the description of the technical solution of the water area generating method in the target virtual scene.
Referring to fig. 5, fig. 5 illustrates a block diagram of a computing device 500 provided in accordance with an embodiment of the present application. The components of the computing device 500 include, but are not limited to, a memory 510 and a processor 520. Processor 520 is coupled to memory 510 via bus 530 and database 550 is used to hold data.
Computing device 500 also includes access device 540, access device 540 enabling computing device 500 to communicate via one or more networks 560. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. The access device 540 may include one or more of any type of network interface, wired or wireless (e.g., a Network Interface Card (NIC)), such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the application, the above-described components of computing device 500, as well as other components not shown in FIG. 5, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device illustrated in FIG. 5 is for exemplary purposes only and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as desired.
Computing device 500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smart phone), wearable computing device (e.g., smart watch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 500 may also be a mobile or stationary server.
Wherein the processor 520 implements the steps of the method for generating a water area in the target virtual scene when executing the computer instructions.
The foregoing is a schematic illustration of a computing device of this embodiment. It should be noted that, the technical solution of the computing device and the technical solution of the water area generating method in the target virtual scene belong to the same concept, and details of the technical solution of the computing device, which are not described in detail, can be referred to the description of the technical solution of the water area generating method in the target virtual scene.
An embodiment of the present application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the steps of a method for generating a water area in a virtual scene as described above.
The above is an exemplary version of a computer-readable storage medium of the present embodiment. It should be noted that, the technical solution of the storage medium and the technical solution of the water area generating method in the target virtual scene belong to the same concept, and details of the technical solution of the storage medium, which are not described in detail, can be referred to the description of the technical solution of the water area generating method in the target virtual scene.
The foregoing describes certain embodiments of the present application. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The computer instructions include computer program code that may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
It should be noted that, for the sake of simplicity of description, the foregoing method embodiments are all expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily all required for the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
The preferred embodiments of the application disclosed above are intended only to assist in the explanation of the application. Alternative embodiments are not intended to be exhaustive or to limit the application to the precise form disclosed. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and the practical application, to thereby enable others skilled in the art to best understand and utilize the application. The application is limited only by the claims and the full scope and equivalents thereof.

Claims (15)

1. A method for generating a water area in a virtual target scene, comprising:
generating a curve coil in response to a curve coil generation instruction, and generating an initial water area model according to the curve coil;
determining a target terrain in a target virtual scene, and adjusting the target terrain according to the initial water area model to obtain a first adjusted terrain;
and carrying out fusion processing on the initial water area model and the first adjustment terrain to generate a target water area fused with the first adjustment terrain.
2. The method of claim 1, wherein the number of curvilinear coils is one;
correspondingly, the generating an initial water area model according to the curve coil comprises the following steps:
generating an initial water surface model according to one curve coil;
extruding and descending the initial water surface model inwards to generate a water area shoal model, and extruding and descending the water area shoal model inwards to generate a water bottom model;
extruding the edge of the shallow model of the water area outwards to generate a target water surface model;
and generating an initial water area model according to the water area shoal model, the underwater model and the target water surface model.
3. The method of claim 2, wherein said generating an initial water surface model from one of said curvilinear coils comprises:
determining all vertexes of one curve coil, and selecting a target vertex from all vertexes, wherein the target vertex is any one vertex in all vertexes;
according to the height of the target vertex in the cross section of the curve coil, the heights of other vertices except the target vertex in the curve coil are adjusted to obtain a target curve coil;
And generating an initial water surface model according to the target curve coil.
4. The method of claim 1, wherein the number of curvilinear coils is three;
correspondingly, the generating an initial water area model according to the curve coil comprises the following steps:
determining curve peaks of a first curve coil, a second curve coil and a third curve coil in the three curve coils respectively, wherein the first curve coil, the second curve coil and the third curve coil are sequentially nested and arranged;
resampling curve peaks of the first curve coil, the second curve coil and the third curve coil, generating a water bottom model according to the resampled first curve coil and the resampled second curve coil, and generating a water area shoal model according to the resampled second curve coil and the resampled third curve coil;
extruding the edge of the shallow model of the water area outwards to generate a target water surface model;
and generating an initial water area model according to the water area shoal model, the underwater model and the target water surface model.
5. The method of claim 4, wherein resampling curve vertices of the first curve coil, the second curve coil, and the third curve coil comprises:
Traversing curve vertexes of the first curve coil, the second curve coil and the third curve coil, and respectively determining the vertex numbers of the curve vertexes of the first curve coil, the second curve coil and the third curve coil;
determining a curve coil with the largest number of peaks of curve peaks from the first curve coil, the second curve coil and the third curve coil;
and resampling the curve peaks of other curve coils according to the coil segment number of the curve coil with the maximum peak number.
6. The method of claim 4, wherein generating the water bottom model from the resampled first curve coil and the second curve coil comprises:
determining a first curve top point of a resampled first curve coil and a second curve top point of a resampled second curve coil, and classifying Y axes of the first curve top point and the second curve top point as 0;
traversing the first curve top point, connecting the first curve top point with the second curve top point closest to the first curve top point, and generating a water bottom model according to the connection relation.
7. The method of claim 4, wherein generating a water shoal model from the resampled second curve coil and third curve coil comprises:
Determining a second curve top point of the resampled second curve coil and a third curve top point of the resampled third curve coil, and returning Y axes of the second curve top point and the third curve top point to 0;
traversing the second curve top point, connecting the second curve top point with the third curve top point closest to the second curve top point, and generating a water area shoal model according to the connection relation.
8. The method of claim 2 or 4, wherein said adjusting the target terrain based on the initial water model to obtain a first adjusted terrain comprises:
placing the initial water area model on the target terrain, and traversing all terrain pixels of the target terrain to emit rays upwards;
and when the rays collide with the water bottom model of the initial water area model, adjusting the height of the terrain corresponding to the collision position of the water bottom model in the target terrain according to the height of the collision position of the water bottom model, and obtaining a first adjusted terrain.
9. The method of claim 8, wherein before the traversing each terrain pixel of the target terrain emits radiation upward, further comprising:
And acquiring the outer edge of the initial water area model, and mapping the outer edge of the initial water area model to the target terrain.
10. The method of claim 8, wherein the fusing the initial water model with the first adjusted terrain to generate a target water fused with the first adjusted terrain comprises:
determining a first terrain mask of the terrain corresponding to the collision position of the water bottom model in the first adjustment terrain according to the collision position of the water bottom model of the initial water area model;
determining a second terrain mask of the first adjusted terrain, which corresponds to the collision position of the target water surface model, according to the collision position of the rays colliding with the target water surface model of the initial water surface model;
and according to the first terrain mask and the second terrain mask, carrying out fusion processing of a preset mode on the first adjusted terrain to generate a target water area fused with the first adjusted terrain.
11. The method of claim 10, wherein the performing a fusion process of the first adjusted terrain in a preset manner according to the first terrain mask and the second terrain mask to generate a target water area fused with the first adjusted terrain comprises:
According to the first terrain mask and the second terrain mask, carrying out fusion processing of a preset mode on the first adjusted terrain to generate a candidate water area fused with the first adjusted terrain;
determining water area attribute information of the candidate water area, water bottom vegetation distribution information of a water bottom model of the candidate water area, a water surface expansion range of a target water surface model and beach vegetation distribution information of a water area shoal model;
and rendering the candidate water area according to the water area attribute information, the underwater vegetation distribution information, the water surface expansion range and the beach vegetation distribution information to generate a target water area fused with the first adjustment topography.
12. The method of claim 1, wherein the generating a curvilinear coil in response to a curvilinear coil generation instruction further comprises:
determining all vertexes of the curve coil, and selecting a target vertex from all vertexes, wherein the target vertex is any one vertex in all vertexes;
according to the height of the target vertex in the cross section of the curve coil, the heights of other vertices except the target vertex in the curve coil are adjusted to obtain a target curve coil;
And extruding and rising the target curve coil inwards to generate a water island model.
13. The method of claim 12, wherein after obtaining the first adjusted terrain, further comprising:
adjusting the first adjustment terrain according to the island model to obtain a second adjustment terrain;
and carrying out fusion treatment on the initial water area model, the underwater island model and the second regulation topography to generate a target water area fused with the second regulation topography.
14. The method of claim 13, wherein said adjusting the first adjusted terrain based on the aquatic island model to obtain a second adjusted terrain comprises:
placing the water island model on the first adjusted terrain and traversing each terrain pixel of the first adjusted terrain to emit rays upwards under the condition that the water island model is determined to be of a first type;
when the rays collide with the underwater island model, adjusting the height of the terrain corresponding to the collision position of the underwater island model in the first adjustment terrain according to the height of the collision position of the underwater island model, so as to obtain a second adjustment terrain;
Or under the condition that the water island model is determined to be of the second type, placing the water island model on the first adjusted terrain, and adjusting the height of the terrain corresponding to the water island model in the first adjusted terrain to the height of the terrain corresponding to the target terrain to obtain a second adjusted terrain.
15. A water area generating device in a target virtual scene, comprising:
a model generation module configured to generate a curvilinear coil in response to a curvilinear coil generation instruction, and to generate an initial water model from the curvilinear coil;
the terrain obtaining module is configured to determine target terrain in a target virtual scene, and adjust the target terrain according to the initial water area model to obtain first adjusted terrain;
and the water area generating module is configured to fuse the initial water area model with the first adjustment terrain and generate a target water area fused with the first adjustment terrain.
CN202310773098.3A 2023-06-27 2023-06-27 Method and device for generating water area in target virtual scene Pending CN116785697A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310773098.3A CN116785697A (en) 2023-06-27 2023-06-27 Method and device for generating water area in target virtual scene

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310773098.3A CN116785697A (en) 2023-06-27 2023-06-27 Method and device for generating water area in target virtual scene

Publications (1)

Publication Number Publication Date
CN116785697A true CN116785697A (en) 2023-09-22

Family

ID=88039857

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310773098.3A Pending CN116785697A (en) 2023-06-27 2023-06-27 Method and device for generating water area in target virtual scene

Country Status (1)

Country Link
CN (1) CN116785697A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117495694A (en) * 2023-11-09 2024-02-02 大庆安瑞达科技开发有限公司 Method for fusing video and map three-dimensional scene, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117495694A (en) * 2023-11-09 2024-02-02 大庆安瑞达科技开发有限公司 Method for fusing video and map three-dimensional scene, electronic equipment and storage medium
CN117495694B (en) * 2023-11-09 2024-05-31 大庆安瑞达科技开发有限公司 Method for fusing video and map three-dimensional scene, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
WO2019154035A1 (en) Method for implanting advertisements in video, and computer device
CN103686125B (en) Depth estimation device, method and image processing apparatus, method
US8334872B2 (en) Inverse kinematics for motion-capture characters
US7149368B2 (en) System and method for synthesis of bidirectional texture functions on arbitrary surfaces
WO2023138062A1 (en) Image processing method and apparatus
CN112669447A (en) Model head portrait creating method and device, electronic equipment and storage medium
CN109118588B (en) Automatic color LOD model generation method based on block decomposition
EP4036790A1 (en) Image display method and device
US6816159B2 (en) Incorporating a personalized wireframe image in a computer software application
Price et al. Object-based vectorization for interactive image editing
JP2007220049A (en) Image-based protruded displacement mapping method and bi-layered displacement mapping method using the same
JP3626144B2 (en) Method and program for generating 2D image of cartoon expression from 3D object data
CN116785697A (en) Method and device for generating water area in target virtual scene
CN112258655A (en) Three-dimensional grid simplification method applied to VR virtual bank
CN107330964A (en) A kind of display methods and system of complex three-dimensional object
CN112717414B (en) Game scene editing method and device, electronic equipment and storage medium
KR20080018404A (en) Computer readable recording medium having background making program for making game
US11893705B2 (en) Reference image generation apparatus, display image generation apparatus, reference image generation method, and display image generation method
CN109523622A (en) A kind of non-structured light field rendering method
CN111951156A (en) Method for drawing photoelectric special effect of graph
KR100411760B1 (en) Apparatus and method for an animation image synthesis
CN116402973A (en) Oblique photography model optimization method and system based on LOD reconstruction
JP2006284704A (en) Three-dimensional map simplification device and three-dimensional map simplification method
US10186073B2 (en) Image processing device, image processing method, and data structure of image file
JP2003168130A (en) System for previewing photorealistic rendering of synthetic scene in real-time

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination