CN111870955A - Height map generation method, device, equipment and storage medium - Google Patents

Height map generation method, device, equipment and storage medium Download PDF

Info

Publication number
CN111870955A
CN111870955A CN202010724145.1A CN202010724145A CN111870955A CN 111870955 A CN111870955 A CN 111870955A CN 202010724145 A CN202010724145 A CN 202010724145A CN 111870955 A CN111870955 A CN 111870955A
Authority
CN
China
Prior art keywords
sampling
height map
effective
coordinate
area
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
CN202010724145.1A
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.)
Shanghai Mihoyo Tianming Technology Co Ltd
Original Assignee
Shanghai Mihoyo Tianming 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 Shanghai Mihoyo Tianming Technology Co Ltd filed Critical Shanghai Mihoyo Tianming Technology Co Ltd
Priority to CN202010724145.1A priority Critical patent/CN111870955A/en
Publication of CN111870955A publication Critical patent/CN111870955A/en
Pending legal-status Critical Current

Links

Images

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/53Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game
    • A63F13/537Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game using indicators, e.g. showing the condition of a game character on screen
    • 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/30Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by output arrangements for receiving control signals generated by the game device
    • A63F2300/303Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by output arrangements for receiving control signals generated by the game device for displaying additional data, e.g. simulating a Head Up Display

Abstract

The embodiment of the invention discloses a height map generation method, a height map generation device, height map generation equipment and a storage medium, wherein the method comprises the following steps: determining a sampling area of a target height map based on an effective area of the target height map, wherein the coverage area of the sampling area is larger than that of the effective area; sampling the scene model based on the sampling area to obtain height information of sampling points; and generating the target height map based on the height information of each sampling point. According to the height map generation method provided by the embodiment of the invention, the height map with the sampling area larger than the effective area is generated by adjusting the sampling area for generating the height map, so that accurate height information can be obtained at the height map boundary based on the expansion data outside the effective area contained in the height map when the height map is subjected to interpolation sampling in the rendering process of a game scene, the technical problem of poor game picture display effect caused by inaccurate height information at the height map boundary is avoided, and the display effect of the scene picture is improved.

Description

Height map generation method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of image rendering, in particular to a height map generation method, device, equipment and storage medium.
Background
With the development of network technology, people have higher and higher requirements for the experience of game pictures in games. For example, during the game, the display effect of the game picture may affect the game experience of the user.
In the current generation of game scenes, generally, a height map is generated by first sampling a scene model, and then the height map is sampled to generate the game scene. However, when a game scene is generated by using a plurality of height maps, because interpolation calculation is performed when the height maps are sampled, the height information obtained at the boundary of the height maps is not accurate, that is, the height information at the boundary between two height maps connected in the horizontal direction is not accurate, which may cause a crack in a scene element rendered in the game scene corresponding to the boundary of the height maps, that is, a poor display effect of a game screen.
Disclosure of Invention
The embodiment of the invention provides a height map generation method, a height map generation device, height map generation equipment and a storage medium, and aims to improve the display effect of scene pictures.
In a first aspect, an embodiment of the present invention provides a height map generation method, including:
determining a sampling area of the target height map based on the effective area of the target height map, wherein the coverage area of the sampling area is larger than that of the effective area;
sampling the scene model based on the sampling area to obtain height information of the sampling point;
and generating a target height map based on the height information of each sampling point.
In a second aspect, an embodiment of the present invention further provides an altitude map generation apparatus, including:
the sampling area determining module is used for determining a sampling area of the target height map based on the effective area of the target height map, wherein the coverage area of the sampling area is larger than that of the effective area;
the height information determining module is used for sampling the scene model based on the sampling area and acquiring the height information of the sampling point;
and the target height map generating module is used for generating a target height map based on the height information of each sampling point.
In a third aspect, an embodiment of the present invention further provides a computer device, where the computer device includes:
one or more processors;
storage means for storing one or more programs
When executed by one or more processors, cause the one or more processors to implement a height map generation method as provided by any of the embodiments of the present invention.
In a fourth aspect, the embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the height map generating method provided in any embodiment of the present invention.
The method comprises the steps of determining a sampling area of a target height map through an effective area based on the target height map, wherein the coverage area of the sampling area is larger than that of the effective area; sampling the scene model based on the sampling area to obtain height information of the sampling point; the method comprises the steps of generating a target height map based on height information of each sampling point, generating a height map with the sampling area larger than an effective area by adjusting the sampling area for generating the height map, so that accurate height information can be obtained at a height map boundary based on extended data outside the effective area contained in the height map when the height map is subjected to interpolation sampling in the process of rendering a game scene, the technical problem of poor game picture display effect caused by inaccurate height information at the height map boundary is avoided, and the scene picture display effect is improved.
Drawings
FIG. 1 is a flow chart of a height map generation method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a height map generation method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a height map generating apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a height map generating method according to an embodiment of the present invention. The present embodiment is applicable to the case when generating a height map. The method may be performed by a height map generating device, which may be implemented in software and/or hardware, which may be configured in a computer device, for example. As shown in fig. 1, the method includes:
s110, determining a sampling area of the target height map based on the effective area of the target height map, wherein the coverage area of the sampling area is larger than that of the effective area.
In the present embodiment, the target height map may be understood as a height map to be generated. It is understood that each height map corresponds to a certain effective area, and the effective area of the height map can be understood as the area of the height map corresponding to the effective representation in the scene model. For example, a height map may correspond to a range of 128 m in a game scene, and the range of 128 m in the game scene is the valid range of the height map.
Generally, the height map is generated based on sampled data by sampling the scene model. Conventionally, a sampling range of a scene model corresponds to an effective range of a height map, that is, if a height map of an area a (128 m × 128 m) needs to be generated, the area a in the scene model is sampled, and the height map is generated based on the sampled data. However, when a game scene is rendered, the height map needs to be sampled and subjected to interpolation calculation to obtain height information, and the game scene is rendered based on the height information obtained by sampling the height map, so that the height information obtained by interpolation is inaccurate at the boundary of the height map, namely the boundary of two height maps connected in the horizontal direction, and a crack exists in the representation of a scene element in the game scene rendered based on the height map. In order to solve the above technical problem, in this embodiment, the sampling range of the target height map is expanded, so that the height map includes edge data of a height map adjacent to the height map, and the height information obtained by interpolation is accurate height information. Alternatively, determining the sampling area of the target height map based on the effective area of the target height map may be to enlarge the effective area to obtain the sampling area. It will be appreciated that the coverage of the sampling area is greater than the coverage of the active area.
In one embodiment, the sampling region may be derived based on the coordinates of the active region. Optionally, determining a sampling region of the target height map based on the effective region of the target height map includes: acquiring an effective area of a target height map; and determining an effective coordinate range corresponding to the effective area, expanding the effective coordinate range to obtain a sampling coordinate range, and determining the sampling area based on the sampling coordinate range. Specifically, an effective coordinate range of the effective area corresponding to the scene model can be determined, the effective coordinate range is expanded, a sampling coordinate range is obtained, and therefore the sampling area is determined. The expansion mode of the effective coordinate range is not limited, and at least one coordinate of the effective coordinate range is expanded outwards to obtain a sampling coordinate range with a coverage range larger than the effective coordinate range. The sampling coordinate range is expanded based on the effective coordinate range so as to determine the sampling area, and the sampling area can be rapidly determined.
And S120, sampling the scene model based on the sampling area, and acquiring height information of the sampling points.
In this embodiment, after the sampling region is determined, the scene model is sampled in the sampling region to obtain height information of the sampling point. The sampling frequency for sampling the scene model may be set according to actual requirements, and is not limited herein. In one embodiment, sampling may be performed in the sampling region by way of ray detection, so as to obtain height information of the sampling point. The density of the ray detection can be set according to actual requirements. For example, the density information may be set to 1 × 1 unit, that is, the scene model is subjected to top-down ray detection at a density of every 1 × 1 units in the scene.
And S130, generating a target height map based on the height information of each sampling point.
In this embodiment, after the height information of each sampling point is obtained, for each sampling point, a corresponding coordinate point of the sampling point in the target height map is determined, color information of the corresponding coordinate point is determined based on the height information of the sampling point, and the color information of the corresponding coordinate point of each sampling point is synthesized to generate the target height map. Wherein, the color information of the coordinate point corresponding to the sampling point is determined based on the height information of the sampling point, which may be: and taking the height information of the sampling point as the gray value of a certain set color channel (such as a red channel) in the color information of the corresponding coordinate point, and combining the set gray values of other channels to obtain the color information of the coordinate point. For example, if the height information of the sampling point is 152, 152 is taken as the gray scale value of the red channel corresponding to the coordinate point in the target height map, and if the set gray scale value of the other channels is 255, the color information of the coordinate point corresponding to the sampling point is (152, 255, 255).
In one embodiment of the present invention, generating a target height map based on height information of each sampling point includes: generating a sampling height map of the corresponding resolution of the sampling area based on the height information of each sampling point; and scaling the sampling height map to obtain a target height map of the resolution corresponding to the effective area. It will be appreciated that as the coverage area corresponding to the sampling region increases, a corresponding increase in resolution of the height map generated based on the sampled data results. For example, if the effective area is 128 × 128 and the sampling area obtained by expanding the effective area is 130 × 130, a height map with a resolution of 130 × 130 is generated, that is, the resolution of the height map is not an integral power of 2, which may affect the sampling efficiency of the video card when the height map is sampled. In order to ensure the sampling efficiency when the target height map is sampled, after the sampling height map of the corresponding resolution of the sampling area is generated based on the height information of the sampling points, the sampling height map is zoomed to obtain the target height map of the corresponding resolution of the effective area, namely, the sampling height map is zoomed back to the resolution of the corresponding effective area. Optionally, the sampling height map may be scaled to the target height map by using a conventional bilinear interpolation image scaling method.
On the basis of the scheme, the sampling height map can be scaled to the target height map by improving on the basis of the traditional bilinear interpolation image scaling method in consideration of the fact that some invalid points may exist on the sampling height map in the scaling process. Optionally, scaling the sampled height map to obtain a target height map with a resolution corresponding to the effective area, where the scaling includes: and scaling the sampling height map into a target height map by using the image scaling method based on the weighted average value of the domain effective values. Namely, on the basis of the traditional image scaling method of bilinear interpolation, the method of taking the weighted average value of effective values in four fields is adjusted to scale.
In addition, since the area of the height information included in the height map is larger than the effective area, it is necessary to correspondingly adjust the uv coordinates of the sample when sampling the height map in the process of rendering the scene image so that the uv coordinates of the sample can be matched with the height information in the target height map. Optionally, sampling the height map during rendering of the scene image includes: determining an original sampling coordinate corresponding to the height map sampling point, shifting the original sampling coordinate based on the expansion range of the sampling area to obtain a shifted sampling coordinate, and sampling the height map based on the shifted sampling coordinate to obtain height map sampling data. For example, it is assumed that the effective area of the height map is an area formed by an abscissa x range [128, 256] and an ordinate y range [128, 256], and the sampling area obtained by expanding the effective area is an area formed by an abscissa x range [127, 257] and an ordinate y range [127, 257], that is, the height map includes height information in the area formed by the abscissa x range [127, 257] and the ordinate y range [127, 257 ]. Correspondingly, when the height map is sampled, the uv coordinates need to be correspondingly shifted, and assuming that height information at coordinates (152 ) needs to be acquired, and the corresponding original sampling coordinate uv coordinates are (0.1875 ), the original sampling coordinates are shifted to obtain shifted sampling coordinate uv coordinates (0.1923 ), and sampling is performed based on the shifted sampling coordinates.
The method comprises the steps of determining a sampling area of a target height map through an effective area based on the target height map, wherein the coverage area of the sampling area is larger than that of the effective area; sampling the scene model based on the sampling area to obtain height information of the sampling point; the method comprises the steps of generating a target height map based on height information of each sampling point, generating a height map with the sampling area larger than an effective area by adjusting the sampling area for generating the height map, so that accurate height information can be obtained at a height map boundary based on extended data outside the effective area contained in the height map when the height map is subjected to interpolation sampling in the rendering process of a game scene, the technical problem of poor game picture display effect caused by inaccurate height information at the height map boundary is avoided, and the display effect of the scene picture is improved.
On the basis of the scheme, the method further comprises the following steps: acquiring rendering parameters corresponding to the target height map, and constructing a corresponding relation between the rendering parameters and the target height map; rendering a scene picture according to the target height map and the rendering parameters associated with the target height map and displaying the scene picture. Optionally, the rendering parameters may include color information, density information, and the like, and the target height map is associated with the rendering parameters, so that a corresponding scene picture can be rendered based on the rendering parameters and the target height map.
Example two
Fig. 2 is a flowchart of a height map generating method according to a second embodiment of the present invention. The present embodiment is further optimized based on the above embodiments. As shown in fig. 2, the method includes:
and S210, acquiring an effective area of the target height map.
S220, determining the effective coordinates of the transverse edge and the effective coordinates of the longitudinal edge corresponding to the effective area.
In this embodiment, the effective region is expanded based on the coordinate values to obtain a sampling region. The coordinate values capable of representing the effective area include a transverse edge effective coordinate and a longitudinal edge effective coordinate, wherein the transverse edge effective coordinate includes a minimum coordinate value and a maximum coordinate value in a transverse direction (such as an x-axis direction), and the longitudinal edge effective coordinate includes a minimum coordinate value and a maximum coordinate value in a longitudinal direction (such as a y-axis direction). Illustratively, assuming that the effective area is an area made up of a coordinate point (128 ), a coordinate point (128, 256), a coordinate point (256, 128), and a coordinate point (256 ), the lateral edge effective coordinates are 128 and 256, and the longitudinal edge effective coordinates are 128 and 256.
And S230, expanding the transverse effective range of the effective coordinate range based on the transverse edge effective coordinate to obtain a transverse edge sampling coordinate.
Optionally, the effective area may be expanded based on the effective coordinates of the horizontal edge and the effective coordinates of the vertical edge, so that the effective area can be covered by the acquisition area on each boundary of the effective area, and the height map can contain data of the height map adjacent to the height map in any direction, so that transition in each direction can be smoother.
In one embodiment, the horizontal edge valid coordinates include a horizontal left edge valid coordinate and a horizontal right edge valid coordinate, the horizontal edge sample coordinates include a horizontal left edge sample coordinate and a horizontal right edge sample coordinate, and the horizontal valid range of the valid coordinate range is expanded based on the horizontal edge valid coordinates to obtain the horizontal edge sample coordinates, including: the effective coordinate of the transverse left edge is shifted to the left by a set transverse offset to obtain a sampling coordinate of the transverse left edge; and shifting the effective coordinate of the transverse right edge to the right by a set transverse offset to obtain a sampling coordinate of the transverse right edge. Optionally, the horizontal offset may be preset, and after the horizontal edge effective coordinate is determined, the horizontal edge effective coordinate is expanded outward to set the horizontal offset, so as to obtain the horizontal edge sampling coordinate. Optionally, the horizontal edge valid coordinate includes a horizontal left edge valid coordinate and a horizontal right edge valid coordinate, and the horizontal edge sample coordinate includes a horizontal left edge sample coordinate and a horizontal right edge sample coordinate. Wherein, the effective coordinate of the left transverse edge is the minimum coordinate value in the transverse direction (such as the x-axis direction) of the effective area, and the effective coordinate of the right transverse edge is the maximum coordinate value in the transverse direction of the effective area; the horizontal edge sampling coordinate is the minimum coordinate value in the horizontal direction of the sampling area, and the horizontal right edge sampling coordinate is the maximum coordinate value in the horizontal direction of the sampling area. The lateral offset can be set according to actual requirements. Illustratively, the lateral offset may be 1. Illustratively, assuming the horizontal edge valid coordinates are 128 and 256, i.e., the horizontal left edge valid coordinate is 128 and the horizontal right edge valid coordinate is 256, the horizontal left edge valid coordinate is shifted to the left by 1 to obtain the horizontal left edge sample coordinate 127, and the horizontal right edge valid coordinate is shifted to the right by 1 to obtain the horizontal right edge sample coordinate 257, i.e., the horizontal edge sample coordinates are 127 and 257.
S240, expanding the longitudinal effective range of the effective coordinate range based on the longitudinal effective edge coordinate to obtain a longitudinal edge sampling coordinate.
In the present embodiment, the manner of expanding the effective range in the longitudinal direction of the effective coordinate range is similar to the manner of expanding the effective range in the lateral direction. In one embodiment, the effective longitudinal edge coordinates include effective longitudinal upper edge coordinates and effective longitudinal lower edge coordinates, the sampled longitudinal edge coordinates include sampled longitudinal upper edge coordinates and sampled longitudinal lower edge coordinates, and the effective longitudinal coordinate range is expanded based on the effective longitudinal edge coordinates to obtain sampled longitudinal edge coordinates, including: moving the effective coordinates of the longitudinal upper edge upwards to set longitudinal offset to obtain sampling coordinates of the longitudinal upper edge; and moving the effective coordinate of the longitudinal lower edge downwards to set the longitudinal offset to obtain the sampling coordinate of the longitudinal lower edge.
Optionally, the longitudinal edge valid coordinate includes a longitudinal upper edge valid coordinate and a longitudinal lower edge valid coordinate, and the longitudinal edge sample coordinate includes a longitudinal upper edge sample coordinate and a longitudinal lower edge sample coordinate. Wherein, the effective coordinate of the longitudinal upper edge is the minimum coordinate value in the longitudinal direction (such as the y-axis direction) of the effective area, and the effective coordinate of the longitudinal lower edge is the maximum coordinate value in the longitudinal direction of the effective area; the longitudinal edge sampling coordinate is the minimum coordinate value in the longitudinal direction of the sampling area, and the longitudinal lower edge sampling coordinate is the maximum coordinate value in the longitudinal direction of the sampling area. The longitudinal offset can be set according to actual requirements. Illustratively, the longitudinal offset may be 1. Illustratively, assuming that the effective coordinates of the longitudinal edges are 128 and 256, i.e., the effective coordinates of the longitudinal upper edges are 128 and the effective coordinates of the longitudinal lower edges are 256, the effective coordinates of the longitudinal upper edges are shifted up by 1 to obtain the sampling coordinates 127 of the longitudinal upper edges, and the effective coordinates of the longitudinal lower edges are shifted down by 1 to obtain the sampling coordinates 257 of the longitudinal lower edges, i.e., the sampling coordinates of the longitudinal edges are 127 and 257.
And S250, determining a sampling coordinate range according to the transverse edge sampling coordinate and the longitudinal edge sampling coordinate.
In this embodiment, after the horizontal edge sampling coordinate and the vertical edge sampling coordinate are determined, the horizontal edge sampling coordinate and the vertical edge sampling coordinate are combined to obtain a sampling coordinate range. Taking the horizontal edge sampling coordinates as 127 and 257 and the vertical edge sampling coordinates as 127 and 257 as examples, the sampling coordinate range is the horizontal coordinate range [127, 257], and the vertical coordinate range [127, 257 ].
And S260, determining a sampling area based on the sampling coordinate range.
S270, sampling the scene model based on the sampling area, and acquiring height information of the sampling points.
And S280, generating a target height map based on the height information of each sampling point.
On the basis of the embodiment, the embodiment of the invention concretizes the range of the sampling coordinate obtained by expanding the range of the effective coordinate, and determines the effective coordinates of the transverse edge and the effective coordinates of the longitudinal edge corresponding to the effective area; expanding the transverse effective range of the effective coordinate range based on the transverse edge effective coordinate to obtain a transverse edge sampling coordinate; expanding the longitudinal effective range of the effective coordinate range based on the longitudinal effective edge coordinates to obtain longitudinal edge sampling coordinates; the sampling coordinate range is determined according to the transverse edge sampling coordinate and the longitudinal edge sampling coordinate, the sampling coordinate range is reasonably determined, the storage and running space occupation caused by the overlarge sampling coordinate range is avoided, and the accuracy of the height information of the junction of the height map is ensured.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a height map generating apparatus according to a third embodiment of the present invention. The height map generating means may be implemented in software and/or hardware, for example, the height map generating means may be configured in a computer device. As shown in fig. 3, the apparatus includes a sampling region determining module 310, an altitude information determining module 320, and a target altitude map generating module 330, wherein:
a sampling area determining module 310, configured to determine a sampling area of the target height map based on the effective area of the target height map, where a coverage area of the sampling area is larger than a coverage area of the effective area;
the height information determining module 320 is configured to sample the scene model based on the sampling region to obtain height information of the sampling point;
and a target height map generating module 330, configured to generate a target height map based on the height information of each sampling point.
The embodiment of the invention determines the sampling area of the target height map based on the effective area of the target height map through a sampling area determining module, wherein the coverage area of the sampling area is larger than that of the effective area; the height information determining module samples the scene model based on the sampling area to obtain the height information of the sampling point; the target height map generating module generates a target height map based on the height information of each sampling point, and generates a height map with the sampling area larger than the effective area by adjusting the sampling area for generating the height map, so that accurate height information can be obtained at the height map boundary based on the expansion data outside the effective area contained in the height map when the height map is subjected to interpolation sampling in the rendering process of a game scene, the technical problem of poor game picture display effect caused by inaccurate height information at the height map boundary is avoided, and the display effect of the scene picture is improved.
Optionally, on the basis of the foregoing scheme, the sampling region determining module 310 includes:
the effective area determining unit is used for acquiring an effective area of the target height map;
and the sampling area determining unit is used for determining an effective coordinate range corresponding to the effective area, expanding the effective coordinate range to obtain a sampling coordinate range, and determining the sampling area based on the sampling coordinate range.
Optionally, on the basis of the foregoing scheme, the sampling region determining unit includes:
the effective coordinate determination subunit is used for determining the effective coordinates of the transverse edge and the effective coordinates of the longitudinal edge corresponding to the effective area;
the transverse sampling coordinate subunit is used for expanding the transverse effective range of the effective coordinate range based on the transverse edge effective coordinate to obtain a transverse edge sampling coordinate;
the longitudinal sampling coordinate subunit is used for expanding the longitudinal effective range of the effective coordinate range based on the longitudinal effective edge coordinates to obtain longitudinal edge sampling coordinates;
and the sampling coordinate determining subunit is used for determining a sampling coordinate range according to the transverse edge sampling coordinate and the longitudinal edge sampling coordinate.
Optionally, on the basis of the foregoing scheme, the horizontal edge valid coordinate includes a horizontal left edge valid coordinate and a horizontal right edge valid coordinate, the horizontal edge sampling coordinate includes a horizontal left edge sampling coordinate and a horizontal right edge sampling coordinate, and the horizontal sampling coordinate subunit is specifically configured to:
the effective coordinate of the transverse left edge is shifted to the left by a set transverse offset to obtain a sampling coordinate of the transverse left edge;
and shifting the effective coordinate of the transverse right edge to the right by a set transverse offset to obtain a sampling coordinate of the transverse right edge.
Optionally, on the basis of the foregoing scheme, the longitudinal edge valid coordinate includes a longitudinal upper edge valid coordinate and a longitudinal lower edge valid coordinate, the longitudinal edge sampling coordinate includes a longitudinal upper edge sampling coordinate and a longitudinal lower edge sampling coordinate, and the longitudinal sampling coordinate subunit is specifically configured to:
moving the effective coordinates of the longitudinal upper edge upwards to set longitudinal offset to obtain sampling coordinates of the longitudinal upper edge;
and moving the effective coordinate of the longitudinal lower edge downwards to set the longitudinal offset to obtain the sampling coordinate of the longitudinal lower edge.
Optionally, on the basis of the above scheme, the target height map generating module 330 includes:
the sampling height map generating unit is used for generating a sampling height map of a corresponding resolution of a sampling area based on the height information of each sampling point;
and the target height map generating unit is used for scaling the sampling height map to obtain a target height map with the resolution corresponding to the effective area.
Optionally, on the basis of the above scheme, the target height map generating unit is specifically configured to:
and scaling the sampling height map into a target height map by using the image scaling method based on the weighted average value of the domain effective values.
The height map generation device provided by the embodiment of the invention can execute the height map generation method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary computer device 412 suitable for use in implementing embodiments of the present invention. The computer device 412 shown in FIG. 4 is only one example and should not impose any limitations on the functionality or scope of use of embodiments of the present invention.
As shown in FIG. 4, computer device 412 is in the form of a general purpose computing device. Components of computer device 412 may include, but are not limited to: one or more processors 416, a system memory 428, and a bus 418 that couples the various system components (including the system memory 428 and the processors 416).
Bus 418 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and processor 416, or a local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 412 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 412 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 428 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)430 and/or cache memory 432. The computer device 412 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage 434 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 418 by one or more data media interfaces. Memory 428 can include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 440 having a set (at least one) of program modules 442 may be stored, for instance, in memory 428, such program modules 442 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. The program modules 442 generally perform the functions and/or methodologies of the described embodiments of the invention.
The computer device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing device, display 424, etc.), with one or more devices that enable a user to interact with the computer device 412, and/or with any devices (e.g., network card, modem, etc.) that enable the computer device 412 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 422. Also, computer device 412 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet) through network adapter 420. As shown, network adapter 420 communicates with the other modules of computer device 412 over bus 418. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the computer device 412, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processor 416 executes various functional applications and data processing by executing programs stored in the system memory 428, for example, to implement the height map generating method provided by the embodiment of the present invention, the method includes:
determining a sampling area of the target height map based on the effective area of the target height map, wherein the coverage area of the sampling area is larger than that of the effective area;
sampling the scene model based on the sampling area to obtain height information of the sampling point;
and generating a target height map based on the height information of each sampling point.
Of course, those skilled in the art will understand that the processor may also implement the technical solution of the height map generation method provided in any embodiment of the present invention.
EXAMPLE five
The fifth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a height map generating method provided in the fifth embodiment of the present invention, where the method includes:
determining a sampling area of the target height map based on the effective area of the target height map, wherein the coverage area of the sampling area is larger than that of the effective area;
sampling the scene model based on the sampling area to obtain height information of the sampling point;
and generating a target height map based on the height information of each sampling point.
Of course, the computer program stored on the computer-readable storage medium provided by the embodiments of the present invention is not limited to the above method operations, and may also perform operations related to the height map generation method provided by any embodiments of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A height map generation method, comprising:
determining a sampling area of a target height map based on an effective area of the target height map, wherein the coverage area of the sampling area is larger than that of the effective area;
sampling the scene model based on the sampling area to obtain height information of sampling points;
and generating the target height map based on the height information of each sampling point.
2. The method of claim 1, wherein determining the sampling area of the target height map based on the active area of the target height map comprises:
acquiring an effective area of a target height map;
and determining an effective coordinate range corresponding to the effective area, expanding the effective coordinate range to obtain the sampling coordinate range, and determining the sampling area based on the sampling coordinate range.
3. The method according to claim 2, wherein the determining a valid coordinate range corresponding to the valid region, and expanding the valid coordinate range to obtain the sampling coordinate range comprises:
determining effective coordinates of a transverse edge and effective coordinates of a longitudinal edge corresponding to the effective area;
expanding the transverse effective range of the effective coordinate range based on the transverse edge effective coordinate to obtain a transverse edge sampling coordinate;
expanding the longitudinal effective range of the effective coordinate range based on the longitudinal effective edge coordinate to obtain a longitudinal edge sampling coordinate;
and determining the sampling coordinate range according to the transverse edge sampling coordinate and the longitudinal edge sampling coordinate.
4. The method of claim 3, wherein the lateral edge valid coordinates comprise lateral left edge valid coordinates and lateral right edge valid coordinates, and the lateral edge sample coordinates comprise lateral left edge sample coordinates and lateral right edge sample coordinates, and wherein expanding the lateral valid range of the valid coordinate range based on the lateral edge valid coordinates results in lateral edge sample coordinates comprising:
moving the effective coordinates of the transverse left edge to the left by a set transverse offset to obtain sampling coordinates of the transverse left edge;
and shifting the effective coordinate of the transverse right edge to the right by a set transverse offset to obtain a sampling coordinate of the transverse right edge.
5. The method of claim 3, wherein the longitudinal edge valid coordinates comprise a longitudinal upper edge valid coordinate and a longitudinal lower edge valid coordinate, and the longitudinal edge sample coordinates comprise a longitudinal upper edge sample coordinate and a longitudinal lower edge sample coordinate, and wherein expanding the longitudinal valid range of the valid coordinate range based on the longitudinal valid edge coordinates results in longitudinal edge sample coordinates comprising:
moving the effective coordinates of the longitudinal upper edge upwards to set longitudinal offset to obtain sampling coordinates of the longitudinal upper edge;
and moving the effective coordinates of the longitudinal lower edge downwards to set longitudinal offset to obtain sampling coordinates of the longitudinal lower edge.
6. The method of claim 1, wherein the generating the target height map based on the height information of each of the sampling points comprises:
generating a sampling height map of the corresponding resolution of the sampling area based on the height information of each sampling point;
and scaling the sampling height map to obtain a target height map of the resolution corresponding to the effective area.
7. The method of claim 6, wherein the scaling the sampled height map to obtain a target height map of the resolution corresponding to the active area comprises:
and scaling the sampling height map into the target height map by using an image scaling method based on the weighted average value of the domain effective values.
8. An altitude map generation apparatus, comprising:
the sampling area determining module is used for determining a sampling area of the target height map based on an effective area of the target height map, wherein the coverage area of the sampling area is larger than that of the effective area;
the height information determining module is used for sampling the scene model based on the sampling area and acquiring the height information of the sampling point;
and the target height map generating module is used for generating the target height map based on the height information of each sampling point.
9. A computer device, the device comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the height map generating method as recited in any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a height map generating method according to any one of claims 1 to 7.
CN202010724145.1A 2020-07-24 2020-07-24 Height map generation method, device, equipment and storage medium Pending CN111870955A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010724145.1A CN111870955A (en) 2020-07-24 2020-07-24 Height map generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010724145.1A CN111870955A (en) 2020-07-24 2020-07-24 Height map generation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111870955A true CN111870955A (en) 2020-11-03

Family

ID=73200634

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010724145.1A Pending CN111870955A (en) 2020-07-24 2020-07-24 Height map generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111870955A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104134201A (en) * 2014-07-31 2014-11-05 广东威创视讯科技股份有限公司 Texture image stitching method and device
CN106997612A (en) * 2016-01-13 2017-08-01 索尼互动娱乐股份有限公司 The apparatus and method of image rendering
CN107358643A (en) * 2017-07-04 2017-11-17 网易(杭州)网络有限公司 Image processing method, device, electronic equipment and storage medium
CN108939556A (en) * 2018-07-27 2018-12-07 珠海金山网络游戏科技有限公司 A kind of screenshot method and device based on gaming platform
CN111292389A (en) * 2020-02-19 2020-06-16 网易(杭州)网络有限公司 Image processing method and device
CN111383349A (en) * 2018-12-27 2020-07-07 珠海金山网络游戏科技有限公司 Terrain scene editing method and device, computing equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104134201A (en) * 2014-07-31 2014-11-05 广东威创视讯科技股份有限公司 Texture image stitching method and device
CN106997612A (en) * 2016-01-13 2017-08-01 索尼互动娱乐股份有限公司 The apparatus and method of image rendering
CN107358643A (en) * 2017-07-04 2017-11-17 网易(杭州)网络有限公司 Image processing method, device, electronic equipment and storage medium
CN108939556A (en) * 2018-07-27 2018-12-07 珠海金山网络游戏科技有限公司 A kind of screenshot method and device based on gaming platform
CN111383349A (en) * 2018-12-27 2020-07-07 珠海金山网络游戏科技有限公司 Terrain scene editing method and device, computing equipment and storage medium
CN111292389A (en) * 2020-02-19 2020-06-16 网易(杭州)网络有限公司 Image processing method and device

Similar Documents

Publication Publication Date Title
CN111882634A (en) Image rendering method, device and equipment and storage medium
CN109472852B (en) Point cloud image display method and device, equipment and storage medium
CN107741964A (en) A kind of interest point indication method, device, equipment and medium
CN111222509A (en) Target detection method and device and electronic equipment
CN111127603B (en) Animation generation method and device, electronic equipment and computer readable storage medium
CN111798554A (en) Rendering parameter determination method, device, equipment and storage medium
CN111870953A (en) Height map generation method, device, equipment and storage medium
CN113657518A (en) Training method, target image detection method, device, electronic device, and medium
CN111125564B (en) Thermodynamic diagram generation method, thermodynamic diagram generation device, thermodynamic diagram generation computer device and thermodynamic diagram generation storage medium
CN112528707A (en) Image processing method, device, equipment and storage medium
CN111870955A (en) Height map generation method, device, equipment and storage medium
CN110619028A (en) Map display method, device, terminal equipment and medium for house source detail page
CN114924822B (en) Screenshot method and device of three-dimensional topological structure, electronic equipment and storage medium
CN114723640B (en) Obstacle information generation method and device, electronic equipment and computer readable medium
US8269769B1 (en) Occlusion prediction compression system and method
CN115330925A (en) Image rendering method and device, electronic equipment and storage medium
CN111078812B (en) Fence generation method and device and electronic equipment
CN111696154B (en) Coordinate positioning method, device, equipment and storage medium
CN113626120A (en) Method and device for determining display page, electronic equipment and storage medium
CN112465692A (en) Image processing method, device, equipment and storage medium
CN110650239B (en) Image processing method, image processing device, computer equipment and storage medium
CN115129278A (en) Image display control method, system, readable storage medium and electronic device
CN111862342A (en) Texture processing method and device for augmented reality, electronic equipment and storage medium
CN112233206B (en) Character image generation method, device, equipment and storage medium
CN111870954B (en) Altitude map generation method, device, equipment and storage medium

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