Method and device for acquiring water marginal area, electronic equipment and storage medium

By creating camera components on the water body area to obtain depth information, generating and blurring the map, and directly determining the water body edge area, solving the problem of inefficient acquisition of water body edge areas in the prior art, and achieving efficient rendering and operation.

CN119648893APending Publication Date: 2025-03-18NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411545541.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

In the prior art, the efficiency of obtaining the edge areas of water bodies is inefficient, and it is necessary to import model resources into DCC software for baking or manually drawing, which is cumbersome and time-consuming.

Method used

Create a camera component that is perpendicular to the water surface on the water surface of the water body area, obtains the depth information of the model area captured by the camera component, generates an initial map based on the first distance and depth information, and obtains the target map through fuzzing to determine the edge area of ​​the water body.

Benefits of technology

This method does not require external software to directly generate edge area maps in real time based on the distance between the camera component and the water surface and the depth information of the model area, improving the rendering efficiency of the edge area of ​​the water body and making the operation simple and convenient.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648893A_ABST
    Figure CN119648893A_ABST
Patent Text Reader

Abstract

The invention provides a water marginal area acquisition method and device, electronic equipment and a storage medium, and the method comprises the steps: creating a camera assembly which is perpendicular to the water surface for shooting above the water surface of a water area; controlling the camera assembly to shoot towards the water surface, and obtaining depth information of the model area captured by the camera assembly; generating an initial map based on the first distance and depth information of the model region; wherein the initial map is used for indicating a first sub-region located above the water surface of the water body region and a second sub-region located below the water surface of the water body region in the model region; performing fuzzy processing on the initial map to obtain a target map; wherein the target map comprises an edge region generated by performing fuzzy processing on a boundary contour of the first sub-region and the second sub-region. In the mode, the operation of obtaining the edge area of the water surface as the water body edge area is simple and convenient, and the rendering efficiency of the water body edge area is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of game technology, and in particular to a method, device, electronic equipment and storage medium for acquiring an edge area of ​​a water body. Background Art

[0002] In water body rendering, it is often necessary to obtain the edge area of ​​the water body, which is usually the boundary area between the water body and the land. The edge area can be used to create the interactive effect of the flowing water body and the shore. In the prior art, the water body and the land model near the water body can be imported into the DCC (Digital Content Creation) software through the function of baking maps in the DCC software. By adjusting the ray step size of AO (Ambient Occlusion), the distance field of the edge boundary between the water body and the land model can be baked out. The edge area of ​​the water body, that is, the boundary area between the water body and the land, is determined according to the distance field. This method requires the model and other resource information to be imported into the DCC software. The operation is very cumbersome and the efficiency of obtaining the edge area is low. In another way, the edge area of ​​the water body can also be drawn by hand-painting, which is also inefficient and affects the subsequent rendering efficiency of the edge area of ​​the water body. Summary of the invention

[0003] In view of this, an object of the present invention is to provide a method, device, electronic device and storage medium for obtaining a water body edge area, so as to conveniently and quickly determine the water body edge area and improve the rendering efficiency of the water body edge area.

[0004] In a first aspect, an embodiment of the present invention provides a method for obtaining an edge area of ​​a water body, the method comprising: creating a camera component above the water surface of the water body area for shooting perpendicular to the water surface; wherein the camera component is at a first distance from the water surface of the water body area; controlling the camera component to shoot toward the water surface to obtain depth information of a model area captured by the camera component; generating an initial map based on the first distance and the depth information of the model area; wherein the initial map is used to indicate: a first sub-area in the model area located above the water surface of the water body area, and a second sub-area located below the water surface of the water body area; blurring the initial map to obtain a target map; wherein the target map includes: an edge area generated by blurring the boundary contour of the first sub-area and the second sub-area; based on the target map, determining the first sub-area above the water surface of the water body area and the edge area of ​​the water body area in the scene model.

[0005] In a second aspect, an embodiment of the present invention further provides a device for acquiring an edge area of ​​a water body, the device comprising: a first creation module, used to create a camera component above the water surface of the water body area for shooting perpendicular to the water surface; wherein the camera component is at a first distance from the water surface of the water body area; a first acquisition module, used to acquire depth information of a model area captured by the camera component; a first generation module, used to generate an initial map based on the first distance and the depth information of the model area; wherein the initial map is used to indicate: a first sub-area in the model area above the water surface of the water body area, and a second sub-area below the water surface of the water body area; a first processing module, used to blur the initial map to obtain a target map; wherein the target map includes: an edge area generated by blurring the boundary contour of the first sub-area and the second sub-area; a first determination module, used to determine the first sub-area above the water surface of the water body area and the edge area of ​​the water body area in the scene model based on the target map.

[0006] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned method for obtaining the edge area of ​​a water body.

[0007] In a fourth aspect, an embodiment of the present invention provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the above-mentioned method for obtaining the edge area of ​​a water body.

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

[0009] The above-mentioned method, device, electronic device and storage medium for obtaining the edge area of ​​the water body create a camera component above the water surface of the water body area for shooting perpendicular to the water surface; wherein the camera component is at a first distance from the water surface of the water body area; the camera component is controlled to shoot toward the water surface to obtain depth information of the model area captured by the camera component; based on the first distance and the depth information of the model area, an initial map is generated; wherein the initial map is used to indicate: a first sub-area in the model area located above the water surface of the water body area, and a second sub-area located below the water surface of the water body area; the initial map is blurred to obtain a target map; wherein the target map includes: an edge area generated by blurring the boundary contour of the first sub-area and the second sub-area; based on the target map, the first sub-area above the water surface of the water body area and the edge area of ​​the water body area in the scene model are determined.

[0010] In this method, there is no need to import the model resources into external software. The initial map for indicating the first sub-area above the water surface of the water body area in the model area and the second sub-area below the water surface of the water body area can be directly generated in real time according to the first distance between the camera component and the water surface and the depth information of the model area adjacent to the water body area. By blurring the initial map, the boundary contour between the first sub-area and the second sub-area in the initial map is converted into a blurred boundary area, and a target map with a transition edge area is obtained, and then the edge area with the transition is used as the water body edge area. This method is simple and convenient to obtain the edge area of ​​the water surface as the water body edge area, which is conducive to improving the rendering efficiency of the water body edge area.

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

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

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

[0014] Figure 1 A flow chart of a method for obtaining a water body edge area provided by an embodiment of the present invention;

[0015] Figure 2 A schematic diagram of a target map having a gradient effect in the edge area provided by an embodiment of the present invention;

[0016] Figure 3 A schematic diagram of rendering the edge area of ​​a water body provided in the related art;

[0017] Figure 4 A schematic diagram of another method for rendering the edge area of ​​a water body provided in the related art;

[0018] Figure 5 A schematic diagram of a device for acquiring edge areas of a water body provided by an embodiment of the present invention;

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

[0020] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0021] Based on this, the present invention provides a method, device, electronic device and storage medium for obtaining the edge area of ​​a water body, which can be applied to obtaining the edge area of ​​a water body in a virtual scene.

[0022] To facilitate understanding of this embodiment, a method for obtaining a water body edge area disclosed in an embodiment of the present invention is first introduced in detail. The scene model of the virtual scene includes a water body area and a model area adjacent to the water body area. The model area can be one or more models adjacent to the water body area. The model area has a boundary with the water body area, for example, a land model partially blocked by the water surface, a tree model rooted in the water body area and breaking through the water, an island model surrounded by water, etc. Figure 1 As shown, the method includes:

[0023] Step S102: creating a camera assembly on the water surface of the water body area for shooting perpendicular to the water surface; wherein the camera assembly is at a first distance from the water surface of the water body area;

[0024] Specifically, the water body region has water body parameters, such as the boundary range, scaling, position, rotation parameters, etc. of the water surface. According to the water body parameters of the water body region, the camera parameters of the camera component, such as the orthogonal width of the camera component, are determined. According to the orthogonal width of the camera component, the range of the water surface region that the camera component is facing can be determined, and then a suitable size can be set for the rendering target component.

[0025] The rendering target component can be written with the depth information of the model area captured by the camera component. Rendering target components of different sizes have different resolutions. The rendering target component is set to a suitable size to avoid poor device performance due to too high a resolution or unclear images due to too low a resolution.

[0026] At a position located at a first distance above the water surface in the water area, a camera assembly is created perpendicular to the water surface for shooting. The first distance usually refers to the distance between the camera assembly and the water surface in the water area. In practical applications, the height of the water surface can be obtained in advance, the position of the camera assembly can be set above the water surface, and the preset height of the camera assembly can be obtained according to the position; the distance between the camera assembly and the water surface can be obtained by performing a difference operation between the preset height and the height of the water surface.

[0027] It should be noted that by creating the camera component perpendicular to the water surface, it can be ensured that the depth information of the model area captured by the camera component is in a vertical direction and can correspond to the water surface.

[0028] Step S104, controlling the camera assembly to shoot toward the water surface to obtain depth information of the model area captured by the camera assembly;

[0029] Specifically, the water area in the scene model is hidden, the camera component is kept perpendicular to the water surface of the water area, and the camera component is photographed toward the water surface. When the camera component photographs the model area, the depth value of each model position in the model area is captured. The depth value indicates the distance between the model position of the model area and the camera component photographing the scene model.

[0030] Then, the depth value of the model area captured by the camera component is written into the preset rendering target component to obtain a depth map of the model area. The pixel positions in the depth map have a mapping relationship with the model positions of the model area. That is, each pixel position in the depth map of the model area is mapped to a corresponding position in the model area adjacent to the water area in the virtual scene.

[0031] Here, the pixel position can be associated with the depth value of the model position captured by the camera component when shooting the model area, and the depth value corresponding to each pixel position in the depth map of the model area can be obtained, so as to determine the distance between the model position of the model area in the virtual scene and the camera component, and obtain the depth information of the model area.

[0032] In this step, the scene model can be photographed by a camera component to obtain a depth map including the scene model, and the depth information of the model area can be obtained from the depth map.

[0033] Step S106: Generate an initial map based on the first distance and the depth information of the model area; wherein the initial map is used to indicate: a first sub-area in the model area that is above the water surface of the water body area, and a second sub-area that is below the water surface of the water body area;

[0034] Specifically, according to the first distance, a first pixel position whose depth value is less than the first distance can be determined from the depth map of the model area, and the first pixel position constitutes a first pixel area, wherein the area mapped by the first pixel area in the scene model includes a first sub-area, that is, the area in the model area above the water surface of the water body area. A second pixel position whose depth value is greater than the first distance can be determined from the depth map of the model area, and the second pixel position constitutes a second pixel area, wherein the area mapped by the second pixel area in the scene model includes a second sub-area, that is, the area in the model area below the water surface of the water body area.

[0035] Furthermore, the depth values ​​corresponding to each first pixel position and each second pixel position in the depth map of the model area are respectively assigned specified depth values, such as assigning a depth value corresponding to each first pixel position in the depth map to be 1, so that the color of the first pixel position appears white; assigning a depth value corresponding to each second pixel position to be 0, so that the color of the second pixel position appears black; the specified depth value will cause the depth map of the model area to present an effect of only black and white. Here, according to the mapping relationship between the pixel position of the depth map of the model area and the model position of the model area, the first pixel area in the depth map that has a mapping relationship with the first sub-area above the water surface of the water body area is displayed as white, and the second pixel area in the depth map that has a mapping relationship with the second sub-area below the water surface of the water body area is displayed as black. A white boundary outline will appear in the depth map, and an initial map showing a boundary outline is obtained.

[0036] Step S108, blurring the initial map to obtain a target map; wherein the target map includes: an edge region generated by blurring the boundary contour between the first sub-region and the second sub-region.

[0037] The above blurring process can be a Gaussian blurring process on the initial map. After the initial map is Gaussian blurred, the boundary contour between the first sub-region and the second sub-region in the initial map is also blurred, and the blurred boundary region is used as the transition between the first sub-region and the second sub-region. The boundary region is determined as the edge region of the water body, and the transition region between the first sub-region and the second sub-region is softer and more natural. The producer can determine the edge region in the target map as needed to create some effects on the edge region of the water body.

[0038] Step S110: Based on the target map, determine a first sub-region above the water surface of the water region and an edge region of the water region in the scene model.

[0039] Specifically, the pixel position in the first pixel area with the first specified depth value and the position of the edge area in the target map can be determined in the target map; then, based on the mapping relationship, the position of the first sub-area and the position of the edge area of ​​the water area can be determined in the scene model.

[0040] Then, the pre-created water body material code is obtained, and the target texture is mounted on the corresponding position of the water body material according to the first sub-area above the water surface of the water body area and the edge area of ​​the water body area. In actual application, after the target texture is mounted on the water surface, the model area above the water surface, the water body edge area and the water body area in the scene model can be determined according to the target texture, and then the desired effect can be produced for the water body edge area.

[0041] The above-mentioned method for obtaining the edge area of ​​the water body creates a camera component above the water surface of the water body area for shooting perpendicular to the water surface; wherein the camera component is at a first distance from the water surface of the water body area; the camera component is controlled to shoot toward the water surface to obtain depth information of the model area captured by the camera component; an initial map is generated based on the first distance and the depth information of the model area; wherein the initial map is used to indicate: a first sub-area in the model area located above the water surface of the water body area, and a second sub-area located below the water surface of the water body area; the initial map is blurred to obtain a target map; wherein the target map includes: an edge area generated by blurring the boundary contour of the first sub-area and the second sub-area; based on the target map, the first sub-area above the water surface of the water body area and the edge area of ​​the water body area in the scene model are determined. In this method, there is no need to import the model resources into external software. The initial map for indicating the first sub-area above the water surface of the water body area in the model area and the second sub-area below the water surface of the water body area can be directly generated in real time according to the first distance between the camera component and the water surface and the depth information of the model area adjacent to the water body area. By blurring the initial map, the boundary contour between the first sub-area and the second sub-area in the initial map is converted into a blurred boundary area, and a target map with a transition edge area is obtained, and then the edge area with the transition is used as the water body edge area. This method is simple and convenient to obtain the edge area of ​​the water surface as the water body edge area, which is conducive to improving the rendering efficiency of the water body edge area.

[0042] In one approach, you can create a camera component above the water surface in a water area by:

[0043] Obtain parameter information of a water body area; based on the parameter information, determine camera parameters of a camera component; wherein the camera parameters include: an orthogonal width of the camera component; based on the orthogonal width in the camera parameters, determine a preset size of a rendering target component; wherein the rendering target component is used to write depth information of a model area captured by the camera component; based on the camera parameters, create a camera component perpendicular to the water surface of the water body area at a first distance above the water surface of the water body area for shooting.

[0044] The parameter information of the water area may be the boundary range of the water surface, the scaling ratio of the water surface, the position of the water surface, the rotation parameters of the water surface, etc., which are set when the water area is created in the virtual scene. The camera parameters of the camera component for shooting the scene model are determined by these parameter information, and the camera parameters include the orthogonal width of the camera. That is, according to these parameter information, a suitable orthogonal width can be set for the camera component to ensure that the camera component shoots the water surface within the boundary range of the water surface and captures the depth information of the model area adjacent to the water area.

[0045] According to the orthogonal width of the camera component, the size of the water surface area that the camera component is facing can be determined, and then the appropriate size can be set for the rendering target component, for example, the size of the rendering target component RenderTerget can be set according to the orthogonal width. The rendering target component can be understood as a blank map with information written into it. When the camera component captures the depth information of the model area, it is written into the rendering target component. Here, the appropriate size is set for the rendering target component to avoid the device performance being reduced due to too high resolution, or the image clarity being reduced due to too low resolution.

[0046] Then, according to the position of the camera parameter at a first distance above the water surface of the water body area, a camera component is created perpendicular to the water surface for shooting. For example, the height of the water surface is obtained in advance, the position of the camera component is set above the water surface, and the preset height of the camera component is obtained according to the position. Then, the difference between the preset height and the height of the water surface is calculated, and the distance between the camera component and the water surface of the water body area is obtained as the first distance.

[0047] The following embodiments provide specific implementation methods for obtaining depth information of a model area.

[0048] Specifically, the water area in the scene model is hidden, and the camera component is controlled to shoot toward the water surface; when the camera component shoots the model area, the depth value of the model position captured by the camera component is obtained; wherein the depth value is used to indicate the depth information of the model position of the model area; the depth value of the model area captured by the camera component is written into the rendering target component to obtain a depth map of the model area; wherein the pixel position of the depth map of the model area has a mapping relationship with the model position of the model area, and the pixel position is associated with the depth value of the model position captured by the camera component when shooting the model area; from the depth map of the model area, the depth information of the model area is obtained.

[0049] Here, the parameters of the camera component are maintained unchanged, the water area in the scene model is hidden, the camera component is kept perpendicular to the water surface of the water area, and the camera component is shot toward the water surface. When the camera component shoots the model area, the depth value captured by the camera component for the model position of the model area is obtained. The depth value indicates the distance between the model position of the model area and the camera component that shoots the scene model.

[0050] Then, the depth value of the model area captured by the camera component is written into the rendering target component to obtain a depth map of the model area; the pixel position in the depth map has a mapping relationship with the model position of the model area. That is to say, each pixel position in the depth map of the model area will be mapped to the corresponding position in the model area adjacent to the water area in the virtual scene. Here, the pixel position can be associated with the depth value of the model position captured by the camera component shooting the model area, and the depth value corresponding to each pixel position in the depth map of the model area can be obtained, thereby determining the distance between the model position of the model area in the virtual scene and the camera component, and obtaining the depth information of the model area.

[0051] The following embodiments provide a specific implementation method for generating an initial map.

[0052] Specifically, a depth map of the model area is obtained; based on a first distance, a first pixel area located above the water surface of the water body area and a second pixel area located below the water surface of the water body area in the depth map of the model area are determined; wherein the area in which the first pixel area is mapped in the model area includes a first sub-area; the area in which the second pixel area is mapped in the model area includes a second sub-area; and an initial map is generated based on the first pixel area and the second pixel area.

[0053] Here, a depth map of the model area photographed by the camera assembly perpendicular to the water surface of the water body area can be obtained, and a first pixel area located above the water surface of the water body area and a second pixel area located below the water surface of the water body area can be determined from the depth map of the model area according to the first distance. The area mapped in the model area by the first pixel area includes a first sub-area, and the area mapped in the model area by the second pixel area includes a second sub-area. Then, based on the first pixel area and the second pixel area, an initial map for indicating the first sub-area and the second sub-area is generated.

[0054] Specifically, a first pixel position whose depth value in the depth map of the model area is less than a first pixel position of a first distance is obtained, and the first pixel position constitutes a first pixel area; a second pixel position whose depth value in the depth map of the model area is greater than the first distance is obtained, and the second pixel position constitutes a second pixel area.

[0055] It can be understood that if the depth value of the pixel position in the depth map of the model area is equal to the first distance, it means that the model position mapped by the pixel position in the model area is located on the water surface of the water body area. Taking the water surface as the reference, if the depth value of a certain pixel position in the depth map of the model area is less than the first distance, it means that the model position mapped by the pixel position in the model area is located above the water surface of the water body area, and the pixel position is determined as the first pixel position; if the depth value of a certain pixel position in the depth map of the model area is greater than the first distance, it means that the model position mapped by the pixel position in the model area is located below the water surface of the water body area, and the pixel position is determined as the second pixel position. In this way, by traversing each pixel position in the depth map of the model area, multiple first pixel positions and multiple second pixel positions can be determined, and the pixel area composed of the first pixel position is determined as the first pixel area, and the pixel area composed of the second pixel position is determined as the second pixel area. Correspondingly, the area mapped by the first pixel area in the scene model includes the first sub-area, and the area mapped by the second pixel area in the scene model includes the second sub-area.

[0056] Furthermore, according to the first pixel region and the second pixel region, the process of generating the initial map is as follows:

[0057] Based on the first pixel region and the second pixel region, a binarization process is performed on the depth map of the model region to obtain an initial map showing a boundary contour of the first sub-region and the second sub-region.

[0058] Specifically, the depth values ​​of the pixel positions in the first pixel area in the depth map of the model area are set to the first specified depth values, and the depth values ​​of the pixel positions in the second pixel area are set to the second specified depth values, to obtain an initial map showing the boundary outline of the first sub-area and the second sub-area.

[0059] The above-mentioned first specified depth value and second specified depth value can be 0 or 1, and the first specified depth value and the second specified depth value are different. The setting of the specified depth value will cause the depth image to present only black and white effects. For example, the depth value corresponding to each first pixel position in the depth map is assigned a value of 1, so that the color of the first pixel position is white; the depth value corresponding to each second pixel position is assigned a value of 0, so that the color of the second pixel position is black; here, according to the mapping relationship between the pixel position of the depth map and the model position of the scene model, the first pixel area in the depth map of the model area that has a mapping relationship with the first sub-area above the water surface of the water body area will be displayed as white, and the second pixel area that has a mapping relationship with the second sub-area below the water surface of the water body area will be displayed as black, and the white boundary outline of the first sub-area and the second sub-area will be displayed in the depth map of the model area, and the depth map showing the white boundary outline will be used as the initial map.

[0060] Furthermore, the initial map is subjected to Gaussian blur processing to obtain a target map having a gradient effect in the edge area.

[0061] The entire initial map can be processed through Gaussian blur processing. Since the initial map only has black, white, and the boundary between black and white, after Gaussian blur processing on the initial map, black is still black, white is still white, but the boundary becomes wider, becoming a gradient area from black to white.

[0062] Here, after the initial map is Gaussian blurred, the boundary contour between the first sub-region and the second sub-region in the initial map is also blurred to obtain a blurred boundary region, which can be regarded as the edge region of the water body.

[0063] For example, the initial map includes a first pixel region displayed in white and a second pixel region displayed in black, and the initial map is obtained by displaying a white boundary outline of the first sub-region and the second sub-region. After blurring the initial map, the following is obtained: Figure 2 The blurred boundary area presents a gradient effect from white to gray and then to black. This boundary area is used as the edge area of ​​the water body, and the transition area between white and black is softer and more natural.

[0064] Using the target map as a mask, the producer can choose not to display certain areas in the target map, or display certain areas in the target map as the required effect, so as to facilitate the subsequent rendering of the edge area of ​​the water body. For example, the edge area in the target map is used as the boundary area between the water surface and the land, so as to render the boundary area between the water surface and the land to obtain the interactive effect of flowing water and the shore.

[0065] Furthermore, based on the target map and the mapping relationship, the first sub-area above the water surface of the water area and the edge area of ​​the water area in the scene model are determined; based on the first sub-area above the water surface of the water area and the edge area of ​​the water area, the target map is mounted on a preset water material corresponding to the water area.

[0066] Specifically, after obtaining the target map, the pixel position in the first pixel area with the first specified depth value and the position of the edge area in the target map can be determined in the target map; then, based on the mapping relationship, the position of the first sub-area and the position of the edge area of ​​the water area can be determined in the scene model.

[0067] Then, the pre-created water body material code is obtained, and the target texture is mounted on the corresponding position of the water body material according to the first sub-area above the water surface of the water body area and the edge area of ​​the water body area. Figure 2 Take the target map shown as an example, and use the Lerp interpolation function to input the target map into the program. The Lerp interpolation function is used to perform linear interpolation between two parameters, such as linear interpolation between 0 and 1. For the area with a value of 0 in the target map, the water material is displayed, and the area with a value of 1 is displayed white. This ensures that only the edge effect is produced for the edge area, and does not affect the normal display of other content in the scene model.

[0068] In practical applications, after the target map is mounted on the water surface, the model area above the water surface, the edge area of ​​the water body, and the water body area in the scene model can be determined according to the target map, and then the desired effect can be produced for the edge area of ​​the water body. For example, based on the target map, the depth value of the pixel position in the target map is obtained, and the information of the scene model is determined according to the depth value. For example, the area in the target map with a value of 1 and a white color can be the shore above the sea surface, the area with a value of 0 and a black color can be the deep sea below the sea surface, and the area with a gradient effect between 1 and 0 can be the slope between the shore and the deep sea. After extracting the information about the shore, the deep sea, and the slope between the shore and the deep sea, the information can be used to produce the desired effect.

[0069] In the related art, by obtaining the first distance of the water body area and the depth information of the model area adjacent to the water body area, the distance between the position point under the water surface of the water body area in the model area and the water surface is obtained by calculating the depth difference, and the position point is rendered according to the distance between the position point and the water surface to generate the rendered water body edge area. For example, Figure 3As shown in the figure, the underwater position points closer to the water surface are rendered white, and the underwater position points farther from the water surface are rendered black, and the edge area of ​​the water body is rendered. However, depth is not a boundary after all. Since depth extends along the Z axis, it is greatly affected by the change of line of sight. It is fine when the line of sight is opposite to it, but once it is tangent, it will be exposed. Figure 4 As shown in the figure, when the columnar object is inserted vertically into the horizontal plane, the white edge area that should be rendered around the column is rendered below the columnar body, resulting in artifacts. In addition, for water areas, only translucent materials support depth acquisition. Some stylized water surfaces do not require translucent materials. Forcibly turning on translucent materials to obtain depth is not worth the effort.

[0070] In the present application, a depth map can be obtained by photographing a scene model through a camera component. Specifically, after hiding the water body area, the camera component can be controlled to photograph the model area, and a depth map can be obtained based on the depth information of the model area captured by the camera component. Then, based on the first distance, a first pixel area above the water surface of the water body area and a second pixel area below the water surface of the water body area are determined from the depth map of the model area, and the depth map of the model area is binarized and Gaussian blurred to obtain a natural, soft edge area as a transition area. This method processes the depth map of the model area, avoids the interference of the water material on the depth information of the model area, and determines the boundary contour from the depth map of the model area by judging the first pixel area above the water surface of the water body area and the second pixel area below the water surface of the water body area, thereby determining the edge area of ​​the water body. This method is more reasonable.

[0071] Corresponding to the above method embodiment, see Figure 5 A schematic diagram of a device for acquiring edge areas of a water body is shown, the device comprising:

[0072] A first creation module 502 is used to create a camera assembly on the water surface of the water body area for shooting perpendicular to the water surface; wherein the camera assembly is at a first distance from the water surface of the water body area;

[0073] A first acquisition module 504 is used to control the camera assembly to shoot toward the water surface and acquire depth information of the model area captured by the camera assembly;

[0074] A first generating module 506 is used to generate an initial map based on the first distance and the depth information of the model area; wherein the initial map is used to indicate: a first sub-area of ​​the model area located above the water surface of the water body area, and a second sub-area located below the water surface of the water body area;

[0075] The first processing module 508 is used to perform blur processing on the initial map to obtain a target map; wherein the target map includes: an edge area generated by blurring the boundary contour of the first sub-area and the second sub-area;

[0076] The first determination module 510 is used to determine, based on the target map, a first sub-region above the water surface of the water region and an edge region of the water region in the scene model.

[0077] In this method, there is no need to import model resources into external software. An initial map for indicating a first sub-area above the water surface of the water body area in the model area and a second sub-area below the water surface of the water body area can be directly generated in real time according to the first distance between the camera component and the water surface and the depth information of the model area adjacent to the water body area. By blurring the initial map, the boundary contour between the first sub-area and the second sub-area in the initial map is converted into a blurred edge area, and a target map with a transition edge area is obtained. The edge area with a transition is then used as a water body edge area. The acquisition operation of the water body edge area is simple and convenient, which is conducive to improving the rendering efficiency of the water body edge area.

[0078] The above-mentioned first creation module is also used to obtain parameter information of the water body area; based on the parameter information, determine the camera parameters of the camera component; wherein the camera parameters include: the orthogonal width of the camera component; based on the orthogonal width in the camera parameters, determine the preset size of the rendering target component; wherein the rendering target component is used to write the depth information of the model area captured by the camera component; based on the camera parameters, create a camera component perpendicular to the water surface of the water body area at a first distance above the water surface of the water body area for shooting.

[0079] The above-mentioned device also includes a second acquisition module, which is used to hide the water area in the scene model and control the camera component to shoot towards the water surface; when the camera component shoots the model area, the depth value of the model position captured by the camera component is obtained; wherein the depth value is used to indicate the depth information of the model position of the model area; the depth value of the model area captured by the camera component is written into the rendering target component to obtain a depth map of the model area; wherein the pixel position of the depth map of the model area has a mapping relationship with the model position of the model area, and the pixel position is associated with the depth value of the model position captured by the camera component when shooting the model area; and the depth information of the model area is obtained from the depth map of the model area.

[0080] The above-mentioned device also includes a second determination module, which is used to obtain a depth map of the model area; based on the first distance, determine a first pixel area above the water surface of the water body area and a second pixel area below the water surface of the water body area in the depth map of the model area; wherein the area mapped by the first pixel area in the model area includes a first sub-area; the area mapped by the second pixel area in the model area includes a second sub-area; based on the first pixel area and the second pixel area, generate an initial map.

[0081] The above-mentioned device also includes a first component module, which is used to obtain a first pixel position in the depth map of the model area whose depth value is less than a first distance, and the first pixel position constitutes a first pixel area; obtain a second pixel position in the depth map of the model area whose depth value is greater than the first distance, and the second pixel position constitutes a second pixel area.

[0082] The above-mentioned device also includes a second generation module, which is used to binarize the depth map of the model area based on the first pixel area and the second pixel area to obtain an initial map showing the boundary contour outline of the first sub-area and the second sub-area.

[0083] The above-mentioned device also includes a first display module, which is used to set the depth value of the pixel position in the first pixel area in the depth map of the model area to the first specified depth value, and set the depth value of the pixel position in the second pixel area to the second specified depth value, so as to obtain an initial map showing the outline of the boundary between the first sub-area and the second sub-area.

[0084] The first processing module is used to perform Gaussian blur processing on the initial map to obtain a target map with a gradient effect in the edge area.

[0085] The above-mentioned device also includes a first mounting module, which is used to determine the first sub-area above the water surface of the water body area and the edge area of ​​the water body area in the scene model based on the target map and the mapping relationship; based on the first sub-area above the water surface of the water body area and the edge area of ​​the water body area, the target map is mounted on a preset water body material corresponding to the water body area.

[0086] This embodiment also provides an electronic device, including a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the above-mentioned method for obtaining the edge area of ​​the water body. The electronic device can be a server or a terminal device. Figure 6 As shown, the electronic device includes a processor 100 and a memory 101, wherein the memory 101 stores computer executable instructions that can be executed by the processor 100, and the processor 100 executes the computer executable instructions to implement the above-mentioned method for acquiring the edge area of ​​a water body.

[0087] Further, Figure 6 The electronic device shown also includes a bus 102 and a communication interface 103, and the processor 100, the communication interface 103 and the memory 101 are connected through the bus 102. Among them, the memory 101 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 102 can be an ISA bus, a PCI bus or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the diagram, but it does not mean that there is only one bus or one type of bus. The processor 100 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 100. The above processor 100 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and completes the steps of the method of the above embodiment in combination with its hardware.

[0088] The processor in the above-mentioned electronic device can implement the following operations of the above-mentioned method for obtaining the edge area of ​​the water body by executing computer-executable instructions: creating a camera component above the water surface of the water body area for shooting perpendicular to the water surface; wherein the camera component is at a first distance from the water surface of the water body area; controlling the camera component to shoot toward the water surface to obtain depth information of the model area captured by the camera component; generating an initial map based on the first distance and the depth information of the model area; wherein the initial map is used to indicate: a first sub-area in the model area located above the water surface of the water body area, and a second sub-area located below the water surface of the water body area; blurring the initial map to obtain a target map; wherein the target map includes: an edge area generated by blurring the boundary contour of the first sub-area and the second sub-area; based on the target map, determining the first sub-area above the water surface of the water body area and the edge area of ​​the water body area in the scene model.

[0089] In this method, there is no need to import model resources into external software. An initial map for indicating a first sub-area above the water surface of the water body area in the model area and a second sub-area below the water surface of the water body area can be directly generated in real time according to the first distance between the camera component and the water surface and the depth information of the model area adjacent to the water body area. By blurring the initial map, the boundary contour between the first sub-area and the second sub-area in the initial map is converted into a blurred edge area, and a target map with a transition edge area is obtained. The edge area with a transition is then used as a water body edge area. The acquisition operation of the water body edge area is simple and convenient, which is conducive to improving the rendering efficiency of the water body edge area.

[0090] The processor in the above-mentioned electronic device can implement the following operations of the above-mentioned method for obtaining the edge area of ​​the water body by executing computer-executable instructions: obtaining parameter information of the water body area; determining the camera parameters of the camera component based on the parameter information; wherein the camera parameters include: the orthogonal width of the camera component; determining the preset size of the rendering target component based on the orthogonal width in the camera parameters; wherein the rendering target component is used to write the depth information of the model area captured by the camera component; based on the camera parameters, creating a camera component perpendicular to the water surface of the water body area at a first distance above the water surface of the water body area for shooting.

[0091] The processor in the above-mentioned electronic device can implement the following operations of the above-mentioned method for obtaining the edge area of ​​the water body by executing computer-executable instructions: hiding the water body area in the scene model and controlling the camera component to shoot toward the water surface; when the camera component shoots the model area, obtaining the depth value of the model position captured by the camera component; wherein the depth value is used to indicate the depth information of the model position of the model area; writing the depth value of the model area captured by the camera component into the rendering target component to obtain a depth map of the model area; wherein the pixel position of the depth map of the model area has a mapping relationship with the model position of the model area, and the pixel position is associated with the depth value of the model position captured by the camera component when shooting the model area; and obtaining the depth information of the model area from the depth map of the model area.

[0092] The processor in the above-mentioned electronic device can implement the following operations of the above-mentioned method for obtaining the edge area of ​​the water body by executing computer-executable instructions: obtaining a depth map of the model area; determining, based on the first distance, a first pixel area above the water surface of the water body area and a second pixel area below the water surface of the water body area in the depth map of the model area; wherein the area mapped by the first pixel area in the model area includes a first sub-area; the area mapped by the second pixel area in the model area includes a second sub-area; and generating an initial map based on the first pixel area and the second pixel area.

[0093] The processor in the above-mentioned electronic device can implement the following operations of the above-mentioned method for obtaining the edge area of ​​the water body by executing computer-executable instructions: obtaining the first pixel position in the depth map of the model area whose depth value is less than the first distance, and the first pixel position constitutes the first pixel area; obtaining the second pixel position in the depth map of the model area whose depth value is greater than the first distance, and the second pixel position constitutes the second pixel area.

[0094] The processor in the above-mentioned electronic device can implement the following operations of the above-mentioned method for obtaining the edge area of ​​the water body by executing computer-executable instructions: based on the first pixel area and the second pixel area, the depth map of the model area is binarized to obtain an initial map showing the outline of the boundary contour of the first sub-area and the second sub-area.

[0095] The processor in the above-mentioned electronic device can implement the following operations of the above-mentioned method for obtaining the edge area of ​​the water body by executing computer-executable instructions: setting the depth value of the pixel position in the first pixel area in the depth map of the model area to the first specified depth value, and setting the depth value of the pixel position in the second pixel area to the second specified depth value, so as to obtain an initial map showing the outline of the boundary contour between the first sub-area and the second sub-area.

[0096] The processor in the above electronic device can implement the following operations of the above water body edge area acquisition method by executing computer executable instructions: Gaussian blur processing is performed on the initial map to obtain a target map with a gradient effect in the edge area.

[0097] The processor in the above-mentioned electronic device can implement the following operations of the above-mentioned method for obtaining the edge area of ​​the water body by executing computer-executable instructions: based on the target map and the mapping relationship, determine the first sub-area above the water surface of the water body area and the edge area of ​​the water body area in the scene model; based on the first sub-area above the water surface of the water body area and the edge area of ​​the water body area, mount the target map on the preset water body material corresponding to the water body area.

[0098] This embodiment also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned method for obtaining the edge area of ​​a water body.

[0099] The computer executable instructions stored in the above-mentioned computer-readable storage medium can implement the following operations in the above-mentioned method for obtaining the edge area of ​​the water body by executing the computer executable instructions: creating a camera component above the water surface of the water body area for shooting perpendicular to the water surface; wherein the camera component is at a first distance from the water surface of the water body area; controlling the camera component to shoot toward the water surface to obtain depth information of the model area captured by the camera component; generating an initial map based on the first distance and the depth information of the model area; wherein the initial map is used to indicate: a first sub-area in the model area that is above the water surface of the water body area, and a second sub-area that is below the water surface of the water body area; blurring the initial map to obtain a target map; wherein the target map includes: an edge area generated by blurring the boundary contour of the first sub-area and the second sub-area; based on the target map, determining the first sub-area above the water surface of the water body area and the edge area of ​​the water body area in the scene model.

[0100] In this method, there is no need to import model resources into external software. An initial map for indicating a first sub-area above the water surface of the water body area in the model area and a second sub-area below the water surface of the water body area can be directly generated in real time according to the first distance between the camera component and the water surface and the depth information of the model area adjacent to the water body area. By blurring the initial map, the boundary contour between the first sub-area and the second sub-area in the initial map is converted into a blurred edge area, and a target map with a transition edge area is obtained. The edge area with a transition is then used as a water body edge area. The acquisition operation of the water body edge area is simple and convenient, which is conducive to improving the rendering efficiency of the water body edge area.

[0101] The computer executable instructions stored in the above-mentioned computer-readable storage medium can implement the following operations in the above-mentioned method for obtaining the edge area of ​​the water body by executing the computer executable instructions: obtaining parameter information of the water body area; determining the camera parameters of the camera component based on the parameter information; wherein the camera parameters include: the orthogonal width of the camera component; determining the preset size of the rendering target component based on the orthogonal width in the camera parameters; wherein the rendering target component is used to write the depth information of the model area captured by the camera component; based on the camera parameters, creating a camera component perpendicular to the water surface of the water body area at a first distance above the water surface of the water body area for shooting.

[0102] The computer executable instructions stored in the above-mentioned computer-readable storage medium can implement the following operations in the above-mentioned method for obtaining the edge area of ​​the water body by executing the computer executable instructions: hiding the water body area in the scene model, and controlling the camera component to shoot toward the water surface; when the camera component shoots the model area, obtaining the depth value of the model position captured by the camera component; wherein the depth value is used to indicate the depth information of the model position of the model area; writing the depth value of the model area captured by the camera component into the rendering target component to obtain a depth map of the model area; wherein the pixel position of the depth map of the model area has a mapping relationship with the model position of the model area, and the pixel position is associated with the depth value of the model position captured by the camera component when shooting the model area; and obtaining the depth information of the model area from the depth map of the model area.

[0103] The computer executable instructions stored in the above-mentioned computer-readable storage medium can implement the following operations in the above-mentioned method for obtaining the edge area of ​​the water body by executing the computer executable instructions: obtaining a depth map of the model area; determining, based on a first distance, a first pixel area above the water surface of the water area and a second pixel area below the water surface of the water area in the depth map of the model area; wherein the area mapped by the first pixel area in the model area includes a first sub-area; the area mapped by the second pixel area in the model area includes a second sub-area; and generating an initial map based on the first pixel area and the second pixel area.

[0104] The computer executable instructions stored in the above-mentioned computer-readable storage medium can implement the following operations in the above-mentioned method for obtaining the edge area of ​​the water body by executing the computer executable instructions: obtaining a first pixel position in the depth map of the model area whose depth value is less than a first distance, and the first pixel position constitutes a first pixel area; obtaining a second pixel position in the depth map of the model area whose depth value is greater than the first distance, and the second pixel position constitutes a second pixel area.

[0105] The computer executable instructions stored in the above-mentioned computer-readable storage medium can be executed to implement the following operations in the above-mentioned method for obtaining the edge area of ​​the water body: based on the first pixel area and the second pixel area, the depth map of the model area is binarized to obtain an initial map showing the outline of the boundary contour of the first sub-area and the second sub-area.

[0106] The computer executable instructions stored in the above-mentioned computer-readable storage medium can be executed to implement the following operations in the above-mentioned method for obtaining the edge area of ​​the water body: the depth value of the pixel position in the first pixel area in the depth map of the model area is set to the first specified depth value, and the depth value of the pixel position in the second pixel area is set to the second specified depth value, so as to obtain an initial map showing the outline of the boundary contour of the first sub-area and the second sub-area.

[0107] The computer executable instructions stored in the above-mentioned computer-readable storage medium can be executed to implement the following operations in the above-mentioned method for obtaining the edge area of ​​the water body: Gaussian blurring is performed on the initial map to obtain a target map with a gradient effect in the edge area.

[0108] The computer executable instructions stored in the above-mentioned computer-readable storage medium can implement the following operations in the above-mentioned method for obtaining the edge area of ​​the water body by executing the computer executable instructions: based on the target map and the mapping relationship, determine the first sub-area above the water surface of the water body area and the edge area of ​​the water body area in the scene model; based on the first sub-area above the water surface of the water body area and the edge area of ​​the water body area, mount the target map on the preset water body material corresponding to the water body area.

[0109] The computer program product of the method, device, electronic device and storage medium for obtaining the edge area of ​​a water body provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be found in the method embodiments, which will not be repeated here.

[0110] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0111] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, and it can be the internal communication of two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0112] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0113] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0114] Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for obtaining the edge area of ​​a water body, characterized in that: The scene model of the virtual scene includes a water body area and a model area adjacent to the water body area; the method includes: Creating a camera assembly on the water surface of the water body area for shooting perpendicular to the water surface; wherein the camera assembly is at a first distance from the water surface of the water body area; Controlling the camera assembly to shoot toward the water surface to obtain depth information of the model area captured by the camera assembly; Generate an initial map based on the first distance and the depth information of the model area; wherein the initial map is used to indicate: a first sub-area of ​​the model area located above the water surface of the water body area, and a second sub-area located below the water surface of the water body area; The initial map is blurred to obtain a target map; wherein the target map includes: an edge area generated by blurring the boundary contour of the first sub-area and the second sub-area; Based on the target map, a first sub-region above the water surface of the water region and an edge region of the water region in the scene model are determined.

2. The method according to claim 1, characterized in that The step of creating a camera assembly on the water surface of the water body area for shooting perpendicular to the water surface comprises: Obtain parameter information of the water body area; Based on the parameter information, determining camera parameters of the camera assembly; wherein the camera parameters include: an orthogonal width of the camera assembly; Determining a preset size of a rendering target component based on the orthogonal width in the camera parameter; wherein the rendering target component is used to write depth information of a model area captured by the camera component; Based on the camera parameters, the camera assembly is created at a first distance above the water surface of the water area and perpendicular to the water surface of the water area for shooting.

3. The method according to claim 2, characterized in that The step of controlling the camera assembly to shoot toward the water surface and obtaining depth information of the model area captured by the camera assembly comprises: Hide the water area in the scene model, and control the camera assembly to shoot toward the water surface; When the camera component photographs the model area, a depth value of the model position captured by the camera component is obtained; wherein the depth value is used to indicate depth information of the model position of the model area; Writing the depth value of the model area captured by the camera component into the rendering target component to obtain a depth map of the model area; wherein the pixel position of the depth map of the model area has a mapping relationship with the model position of the model area, and the pixel position is associated with the depth value of the model position captured by the camera component when photographing the model area; Depth information of the model area is acquired from the depth map of the model area.

4. The method according to claim 2, characterized in that: The step of generating an initial map based on the first distance and the depth information of the model area comprises: Obtaining a depth map of the model area; Based on the first distance, determine a first pixel area located above the water surface of the water body area and a second pixel area located below the water surface of the water body area in the depth map of the model area; wherein the area in which the first pixel area is mapped in the model area includes the first sub-area; and the area in which the second pixel area is mapped in the model area includes the second sub-area; An initial map is generated based on the first pixel region and the second pixel region.

5. The method according to claim 4, characterized in that The step of determining, based on the first distance, a first pixel area located above the water surface of the water body area and a second pixel area located below the water surface of the water body area in the depth map of the model area comprises: Acquire a first pixel position in the depth map of the model area, where the depth value of the pixel position is less than the first distance, the first pixel position constituting the first pixel area; A second pixel position in the depth map of the model area having a depth value greater than the first distance is obtained, and the second pixel position constitutes the second pixel area.

6. The method according to claim 4, characterized in that The step of generating an initial map based on the first pixel area and the second pixel area comprises: Based on the first pixel region and the second pixel region, a binarization process is performed on the depth map of the model region to obtain an initial map showing a boundary contour between the first sub-region and the second sub-region.

7. The method according to claim 6, characterized in that The step of binarizing the depth map of the model area based on the first pixel area and the second pixel area to obtain an initial map showing the boundary contour of the first sub-area and the second sub-area includes: The depth values ​​of the pixel positions in the first pixel area in the depth map of the model area are set to the first specified depth value, and the depth values ​​of the pixel positions in the second pixel area are set to the second specified depth value, to obtain an initial map showing the boundary outline of the first sub-area and the second sub-area.

8. The method according to claim 1, characterized in that The step of performing blur processing on the initial map to obtain a target map comprises: The initial map is subjected to Gaussian blur processing to obtain a target map having a gradient effect in the edge area.

9. The method according to claim 1, characterized in that: The step of determining, based on the target map, a first sub-region located above the water surface of the water region and an edge region of the water region in the scene model comprises: Based on the target map and the mapping relationship, determining a first sub-region above the water surface of the water region and an edge region of the water region in the scene model; Based on a first sub-region above the water surface of the water region and an edge region of the water region, the target map is mounted on a preset water material corresponding to the water region.

10. A device for acquiring edge areas of a water body, characterized in that: The scene model of the virtual scene includes a water body area and a model area adjacent to the water body area; the device includes: A first creation module is used to create a camera assembly on the water surface of the water body area for shooting perpendicular to the water surface; wherein the camera assembly is at a first distance from the water surface of the water body area; A first acquisition module, used for controlling the camera assembly to shoot toward the water surface, and acquiring depth information of the model area captured by the camera assembly; A first generating module is used to generate an initial map based on the first distance and the depth information of the model area; wherein the initial map is used to indicate: a first sub-area of ​​the model area located above the water surface of the water area, and a second sub-area located below the water surface of the water area; A first processing module is used to perform blur processing on the initial map to obtain a target map; wherein the target map includes: an edge area generated by blurring the boundary contour of the first sub-area and the second sub-area; The first determination module is used to determine, based on the target map, a first sub-region located above the water surface of the water region in the scene model and an edge region of the water region.

11. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method for obtaining the edge area of ​​a water body according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method for obtaining the edge area of ​​a water body according to any one of claims 1 to 9.