CN111870954B - Altitude map generation method, device, equipment and storage medium - Google Patents

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

Info

Publication number
CN111870954B
CN111870954B CN202010723757.9A CN202010723757A CN111870954B CN 111870954 B CN111870954 B CN 111870954B CN 202010723757 A CN202010723757 A CN 202010723757A CN 111870954 B CN111870954 B CN 111870954B
Authority
CN
China
Prior art keywords
height map
height
combined
merging
map
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.)
Active
Application number
CN202010723757.9A
Other languages
Chinese (zh)
Other versions
CN111870954A (en
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 CN202010723757.9A priority Critical patent/CN111870954B/en
Publication of CN111870954A publication Critical patent/CN111870954A/en
Application granted granted Critical
Publication of CN111870954B publication Critical patent/CN111870954B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the invention discloses a method, a device, equipment and a storage medium for generating a height map, wherein the method comprises the following steps: acquiring element height information of scene elements in a target scene; generating a plurality of layers of original height maps based on the element height information, and determining the height map information of each layer of original height maps; and merging the original height maps based on the height map information to obtain at least one merged height map. According to the height map generation method provided by the embodiment of the invention, the multi-layer height maps are generated and then combined, so that the number of the height maps is reduced while the display effect of a scene is improved, the data storage pressure is reduced, and the scene picture with good display effect is generated based on a small number of the height maps.

Description

Altitude 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 method, a device, equipment and a storage medium for generating a height map.
Background
With the development of network technology, the experience requirements of people on game pictures in games are higher and higher. For example, during a game, the presentation effect of the game screen may affect the game experience of the user.
In the current generation of game scenes, height information is typically stored using a height map (height map) in a surface construction tool (terrain) to represent distribution information of grass, and an image of grass in the game scene is generated based on the height map in terrain. However, due to the characteristics of terrain, terrain can be brushed once only at one position, so that only one place capable of growing grass is arranged at the same horizontal position at different heights (such as the upper side and the lower side of a cliff), and the display effect of game pictures is poor.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a storage medium for generating a height map, which are used for generating a scene picture with good display effect based on a small amount of height maps, reducing the number of the height maps while improving the display effect of the scene and relieving the data storage pressure.
In a first aspect, an embodiment of the present invention provides a method for generating a height map, including:
acquiring element height information of scene elements in a target scene;
generating a plurality of layers of original height maps based on the element height information, and determining the height map information of each layer of original height maps;
and merging the original height maps based on the height map information to obtain at least one merged height map.
In a second aspect, an embodiment of the present invention further provides a height map generating apparatus, including:
the element height acquisition module is used for acquiring element height information of scene elements in the target scene;
the original height map generation module is used for generating a plurality of layers of original height maps based on the element height information and determining the height map information of each layer of original height map;
and the height map merging module is used for merging the original height maps based on the height map information to obtain at least one merged height map.
In a third aspect, an embodiment of the present invention further provides a computer apparatus, including:
one or more processors;
storage means for storing one or more programs
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the height map generation method as provided by any embodiment of the present invention.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a height map generation method as provided by any of the embodiments of the present invention.
The embodiment of the invention obtains the element height information of the scene element in the target scene; generating a plurality of layers of original height maps based on the element height information, and determining the height map information of each layer of original height maps; the original height maps are combined based on the height map information to obtain at least one combined height map, and the height maps are combined after being generated into a plurality of layers of height maps, so that the number of the height maps is reduced while the display effect of the game scene is improved, the data storage pressure is reduced, and the scene picture with good display effect is generated based on a small number of the height maps.
Drawings
FIG. 1 is a flow chart of a height map generating method according to a first embodiment of the present invention;
FIG. 2 is a flow chart of a height map generating method according to a second embodiment of the present invention;
FIG. 3 is a schematic flow chart of a height map merging method according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a height map generating apparatus according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of a computer device according to a fifth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
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 a case when a height map is generated, particularly to a case when a height map of grass in a game scene is generated. The method may be performed by a height map generating apparatus, which may be implemented in software and/or hardware, e.g. configurable in a computer device. As shown in fig. 1, the method includes:
s110, acquiring element height information of scene elements in the target scene.
In this embodiment, the target scene may be a scene in which grass needs to be rendered. It will be appreciated that the terrain in the game scene is built based on the model. The multiple models are fused to form a terrain effect in the game scene. In this embodiment, in order to improve the exhibiting effect of the grass, the grass can grow on the surface of any compliant object, and instead of using a layer of height map in terrain to generate the grass, the height information of the grass is determined based on the object on which the grass grows, and a multi-layer height map is constructed based on the height information of the grass, so that an image of the grass can be rendered at a corresponding position of each layer.
Optionally, a scene element refers to an element in the scene that needs to be generated. In this embodiment, the original scene element is a grass element in the scene. Alternatively, the height information of each layer of grass to be generated may be acquired by a height acquisition tool. It will be appreciated that grass needs to be rendered on the surface of the object. Therefore, the height information of the object requiring the growing grass can be detected as the height information of the grass by means of the radiation detection. In one embodiment, obtaining element height information of a scene element in a target scene includes: and acquiring a scene model of the target scene, and performing ray detection on the scene model by using a ray detection method to obtain the height information of each layer of scene elements. Alternatively, a scene of which the grass needs to be rendered can be used as a target scene, a scene model of the target scene is obtained, ray detection is used for the scene model from top to bottom, and the height information of the object is determined by utilizing the rays and collision points generated by collision of the collision body, so that the height information of the grass is obtained as element height information.
In one embodiment, the density of radiation detection may also be set according to the object size. When the ray detection is carried out, the ray detection is used for the scene model from top to bottom according to the set density information, the height information of the collision point of the ray is obtained, and the height information of the collision point is used as the height information of grass. The density of the ray detection can be set according to the actual object size. For example, the density information may be set to 1×1 units, i.e., the scene model is subjected to top-down ray detection at a density of every 1×1 units in the scene.
S120, generating a plurality of layers of original height maps based on the element height information, and determining the height map information of each layer of original height maps.
In this embodiment, the scene elements are divided into multiple layers according to the element height information of the scene elements, an original height map corresponding to each layer of scene elements is constructed for each layer of scene elements, and the height map information of each layer of original height map is determined. The height map information of each layer of original height map comprises the effective area and the height information of the layer.
In one embodiment, if the element height information is obtained based on ray detection, the scene element may be divided into multiple layers according to the object identifier of the object to which the ray detection collision point belongs, and the collision points with the same object identifier may be divided into the same layer. Specifically, after the collision point is obtained. And acquiring the height information of the collision points and the object identifications of the objects to which the collision points belong, classifying the collision points belonging to the same object (namely, the object identifications of the objects to which the collision points belong) into one type, and generating a layer of height map as the collision points of the same type.
S130, merging the original height maps based on the height map information to obtain at least one merged height map.
In this embodiment, if different original height maps are generated based on different objects, each object will have a corresponding original height map, so that the number of original height maps is large, and the storage space is occupied. In order to slow down the storage pressure and reduce the storage cost, the original height maps can be combined after being generated to obtain combined height maps, and the combined height maps are stored.
Alternatively, the original height map may be traversed, and the height maps (including the original height map and the combined height map) that are matched with each other are combined until all the original height maps are traversed, so as to obtain the combined height map.
In one embodiment of the present invention, merging the original height map based on the height map information to obtain at least one merged height map includes: traversing the original height map, taking the original height map traversed currently as a height map to be combined, and matching the height map to be combined with a combined result height map in the current combined result set according to the height map information of the height map to be combined; and obtaining a target merging height map according to the matching result, updating a merging result set based on the target merging height map until all original height maps are traversed, and taking the merging result height map in the merging result set as a merging height map. Alternatively, a merged result set may be constructed, which contains the height map after the merged process. And matching the height map to be combined with the combined result height map contained in the combined result set, judging whether the height map is matched with the combined result height map to be combined, generating a target combined height map according to the matched result, adding the target combined height map into the combined result set until all original height maps are traversed, and obtaining the combined result set containing the combined height map. The method comprises the steps of combining a to-be-combined height map and a combined result height map, wherein whether the combined result height map is matched with the to-be-combined height map or not can be judged according to the scene display effect of the height map obtained after the to-be-combined height map and the combined result height map are combined.
Based on the scheme, the method for obtaining the target merging height map according to the matching result and updating the merging result set based on the target merging height map comprises the following steps: if the merging result height map matched with the height map to be merged exists, merging the height map to be merged into the merging result height map to obtain the target merging height map. Optionally, if there is a merging result height map matching with the height map to be merged in the merging result set, modifying the merging result height map based on the height map information of the height map to be merged, merging the height map to be merged into the merging result height map, and obtaining the target merging height map. For example, assuming that the height map to be combined is the height map 1, if there is a combining result height map-combining height map 1 in the combining result set, which matches the height map to be combined, the height map 1 is combined into the combining height map 1 to obtain the target combining height map-combining height map 2.
Based on the scheme, the method for obtaining the target merging height map according to the matching result and updating the merging result set based on the target merging height map comprises the following steps: if the merging result height map matched with the height map to be merged does not exist, the height map to be merged is taken as a target merging height map, and the target merging height map is added into the merging result set. Specifically, if the merging result set does not have the merging result height map matched with the height map to be merged, the height map to be merged is directly added into the merging result set as a target merging height map. For example, assuming that the height map to be combined is the height map 1, if there is no combined result height map matching the height map to be combined in the combined result set, the height map 1 is added to the combined result set as a target combined height map. Therefore, when the merging result set is constructed, the merging result set is empty, and when the original height map starts to be traversed, the first traversed original height map can be directly added into the merging result set.
In this embodiment, an original height map is generated and the original height maps are combined, so that the combined height map needs to be operated before the game is run, that is, in the game manufacturing stage, the original height map is generated based on the element height map information of the scene elements in the target scene, and the combined height map is obtained by combining. In the game running stage, the combined height map is sampled, and the surface details (such as grass elements) in the game scene are rendered based on the sampled data.
The embodiment of the invention obtains the element height information of the scene element in the target scene; generating a plurality of layers of original height maps based on the element height information, and determining the height map information of each layer of original height maps; the original height maps are combined based on the height map information to obtain at least one combined height map, and the height maps are combined after being generated into a plurality of layers of height maps, so that the number of the height maps is reduced while the display effect of the scene is improved, the data storage pressure is reduced, and the scene picture with good display effect is generated based on a small number of the height maps.
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:
s210, acquiring element height information of scene elements in the target scene.
S220, generating a plurality of layers of original height maps based on the element height information, and determining the height map information of each layer of original height maps.
S230, traversing the original height map, and taking the original height map traversed currently as the height map to be combined.
S240, traversing the merging result height map in the merging result set, taking the merging result height map traversed currently as a candidate merging height map, and judging whether the to-be-merged height map is matched with the candidate merging height map or not based on the height map information.
In the present embodiment, the original height map is generated with the resolution of the final height map combination as the resolution of the original height map. That is, the resolution of the original height map is not limited by the effective area to which the original height map corresponds. The resolution of the original height map corresponding to the stones with small volume is the same as that of the original height map corresponding to the lawns with large area, and the difference is only that the effective areas in the original height maps are different. Therefore, when judging whether the to-be-combined height map is matched with the candidate combining height map, only the fact that whether the effective areas of the to-be-combined height map and the candidate combining height map have an overlapping area is needed to be judged. In one embodiment, determining whether the to-be-combined height map and the candidate combined height map match based on the height map information includes: judging whether an overlapping area exists between an effective area of the height map to be combined and an effective area of the candidate combined height map; and if the effective area of the height map to be combined and the effective area of the candidate combining height map have an overlapping area, judging that the height map to be combined and the candidate combining height map are not matched. Specifically, whether the height map to be combined is matched with the candidate combining height map is judged according to whether an overlapping area exists between the effective area of the height map to be combined and the effective area of the candidate combining height map. If the effective areas of the to-be-combined height map and the candidate combining height map have overlapping areas, which means that scene elements with different heights need to be generated at the same horizontal position, if the to-be-combined height map is combined in one height map, the display effect of the scene elements with different heights cannot be guaranteed to be generated at the same horizontal position, so that when the effective areas of the to-be-combined height map and the candidate combining height map have overlapping areas, it is determined that the to-be-combined height map is not matched with the candidate combining height map, and the to-be-combined height map and the candidate combining height map are not combined.
On the basis of the scheme, the method further comprises the following steps: if the effective area of the height map to be combined and the effective area of the candidate combined height map do not have an overlapping area, determining the height information of the combined local height map based on the height map to be combined and the candidate combined height map, and judging whether the fall between the height information of the local height map and the height information of the candidate combined height map is higher than a set fall threshold; if the fall between the height information of the local height map and the height information of the candidate merging height map is not higher than a set fall threshold, judging that the height map to be merged is matched with the candidate merging height map; if the fall between the height information of the local height map and the height information of the candidate merging height map is higher than a set fall threshold, the height map to be merged and the candidate merging height map are not matched.
Specifically, if there is no overlapping area between the to-be-combined height map and the effective area of the candidate combined height map, which means that scene elements with different heights do not need to be generated at the same horizontal position, the to-be-combined height map and the candidate combined height map can be combined in one height map. However, in order to ensure the display effect of the scene elements generated based on the height map after the merging, it is also necessary to continuously determine whether the merging is possible based on the height information of the local height map obtained after the merging and the height information of the candidate merging height map. Assuming that a larger drop exists at the position where the edge of the effective range of the merged local height map is connected with the candidate merged height map (i.e. the drop is higher than a set drop threshold), the rendering result is affected when the height map is interpolated and sampled to render the scene element, and the problem that the display effect of the rendered scene element is poor is generated, for example, the display effect (similar to the display effect of a waterfall) of grass growing along the drop stretch in space is possibly generated, so that when the drop between the height information of the local height map and the height information of the candidate merged height map is higher than the set drop threshold, the to-be-merged height map and the candidate merged height map are determined to be not matched, and the to-be-merged height map and the candidate merged height map are not merged. When the fall between the height information of the local height map and the height information of the candidate merging height map is not higher than the set fall threshold, the display effect of the scene elements is not affected, and the height map to be merged and the candidate merging height map are judged to be matched. The height information of the effective edge of the local height map can be determined according to the height map information of the combined local height map. It should be noted that, as long as the difference between the height information of any part of the local height map edge and the height information of any position of the candidate merging height map edge is higher than the set difference threshold, the height map to be merged and the candidate merging height map cannot be merged in order to ensure the display effect of the scene elements rendered based on the height map.
S250, stopping traversing if the height map to be combined is matched with the candidate combined height map.
And stopping traversing when the height map to be combined is matched with the candidate combining height map, and combining the candidate combining height map as a combining result height map matched with the height map to be combined.
And S260, if the to-be-combined height map is not matched with the candidate combined height map, continuing traversing until a combined result height map matched with the to-be-combined height map is obtained or traversing is completed on all the combined result height maps.
When the height map to be combined is not matched with the candidate combined height map, continuing traversing until a combined result height map matched with the height map to be combined is obtained for combining; or traversing all the merging result height maps, and judging that the merging result height map matched with the height map to be merged does not exist in the merging result set.
S270, obtaining a target merging height map according to the matching result, updating a merging result set based on the target merging height map until all original height maps are traversed, and taking the merging result height map in the merging result set as a merging height map.
According to the embodiment of the invention, on the basis of the scheme, the to-be-combined height map and the combining result height map are matched, whether the to-be-combined height map is matched with the combining result height map or not is judged according to whether the effective area of the to-be-combined height map and the effective area of the candidate combining height map are overlapped, so that the matching result is more accurate, and the accuracy of the combining height map obtained based on the matching result is further improved.
Example III
The embodiment of the present invention provides a preferred embodiment based on the above-described embodiment.
In this embodiment, in order to make the rendering of the grass element image not limited by the number of layers of the height map, the rendering of the grass element image is performed by generating a multi-layer height map, but generating a corresponding height map based on each object (i.e., an object) results in a large number of height maps and high storage cost. According to the embodiment of the invention, after the height map corresponding to each object is generated, the height maps are combined, and part of the height maps are combined into the same height map, so that the number of the height maps is reduced, and the storage pressure is reduced.
Fig. 3 is a flow chart of a height chart merging method according to a third embodiment of the present invention. And in the initial stage of merging, constructing a merging result height map set, traversing the height maps formed by each object one by one, judging whether the object can be merged with the height maps in the merging result set, if the merging result height map exists, merging the merging result height map, otherwise, adding the height map into the result height map set as a new result height map.
Specifically, whether the height map corresponding to the object can be combined with the height map in the combination result set can be judged based on the following method: whether the effective range of the height map formed by the object has corresponding range values in the result height map can be judged first, if the effective range of the height map formed by the object has corresponding range values in the result height map, the height map corresponding to the object can not be combined with the height map in the combined result set, namely, the height map with the overlapped part can not be combined; and secondly, judging whether a larger drop is generated at the joint of the edge of the effective range of the combined local height map and the result height map, if so, influencing the result (such as that grass can grow along the drop stretching in the space) when the height map is interpolated and sampled at the position adjacent to the height map, so that it is judged that the height map corresponding to the object cannot be combined with the height map in the combined result set.
It should be noted that, the height map merging method provided by the embodiment of the invention can effectively reduce the number of the height maps. Taking a land block as an example for testing, the 1434 Zhang Gaodu images formed by 1434 objects in the land block are combined and then reduced to 7 height images, so that the storage space is greatly reduced.
Example IV
Fig. 4 is a schematic structural diagram of a height map generating apparatus according to a fourth 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 arranged in a computer device. As shown in fig. 4, the apparatus includes an element height acquisition module 410, an original height map generation module 420, and a height map merging module 430, wherein:
an element height obtaining module 410, configured to obtain element height information of a scene element in a target scene;
an original height map generating module 420, configured to generate a plurality of layers of original height maps based on the element height information, and determine height map information of each layer of original height maps;
the height map merging module 430 is configured to merge the original height maps based on the height map information to obtain at least one merged height map.
According to the embodiment of the invention, the element height information of the scene elements in the target scene is acquired through the element height acquisition module; the original height map generating module generates a plurality of layers of original height maps based on the element height information, and determines the height map information of each layer of original height map; the height map merging module merges the original height maps based on the height map information to obtain at least one merged height map, and merges the height maps through generating multiple layers of height maps, so that the number of the height maps is reduced while the display effect of the scene is improved, the data storage pressure is reduced, and the scene picture with good display effect is generated based on a small number of the height maps.
Optionally, on the basis of the above scheme, the altitude map merging module 430 includes:
the height map matching unit is used for traversing the original height map, taking the original height map traversed currently as a height map to be combined, and matching the height map to be combined with the combined result height map in the current combined result set according to the height map information of the height map to be combined;
and the merging set updating unit is used for obtaining a target merging height map according to the matching result, updating the merging result set based on the target merging height map until all the original height maps are traversed, and taking the merging result height map in the merging result set as a merging height map.
Optionally, on the basis of the above scheme, the height map matching unit is specifically configured to:
traversing the merging result height map in the merging result set, taking the merging result height map traversed currently as a candidate merging height map, and judging whether the height map to be merged is matched with the candidate merging height map or not based on height map information;
if the height map to be combined is matched with the candidate combined height map, stopping traversing;
if the to-be-combined height map is not matched with the candidate combined height map, continuing traversing until a combined result height map matched with the to-be-combined height map is obtained or traversing is completed on all the combined result height maps.
Optionally, on the basis of the above scheme, the height map matching unit is specifically configured to:
judging whether an overlapping area exists between an effective area of the height map to be combined and an effective area of the candidate combined height map;
and if the effective area of the height map to be combined and the effective area of the candidate combining height map have an overlapping area, judging that the height map to be combined and the candidate combining height map are not matched.
Optionally, on the basis of the above scheme, the height map matching unit is further configured to:
if the effective area of the height map to be combined and the effective area of the candidate combined height map do not have an overlapping area, determining the height information of the combined local height map based on the height map to be combined and the candidate combined height map, and judging whether the fall between the height information of the local height map and the height information of the candidate combined height map is higher than a set fall threshold;
if the fall between the height information of the local height map and the height information of the candidate merging height map is not higher than a set fall threshold, judging that the height map to be merged is matched with the candidate merging height map;
if the fall between the height information of the local height map and the height information of the candidate merging height map is higher than a set fall threshold, the height map to be merged and the candidate merging height map are not matched.
Optionally, based on the above scheme, the merging set updating unit is specifically configured to:
if the merging result height map matched with the height map to be merged exists, merging the height map to be merged into the merging result height map to obtain the target merging height map.
Optionally, based on the above scheme, the merging set updating unit is specifically configured to:
if the merging result height map matched with the height map to be merged does not exist, the height map to be merged is taken as a target merging height map, and the target merging height map is added into the merging result set.
The height map generating device provided by the embodiment of the invention can execute the height map generating method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executing method.
Example five
Fig. 5 is a schematic structural diagram of a computer device according to a fifth embodiment of the present invention. Fig. 5 illustrates a block diagram of an exemplary computer device 512 suitable for use in implementing embodiments of the present invention. The computer device 512 shown in fig. 5 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in FIG. 5, computer device 512 is in the form of a general purpose computing device. Components of computer device 512 may include, but are not limited to: one or more processors 516, a system memory 528, a bus 518 that connects the various system components (including the system memory 528 and the processor 516).
Bus 518 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor 516, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include 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 512 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 512 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 528 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 530 and/or cache memory 532. The computer device 512 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage 534 may be used to read from or write to a non-removable, non-volatile magnetic media (not shown in FIG. 5, commonly referred to as a "hard disk drive"). Although not shown in fig. 5, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 518 through one or more data media interfaces. Memory 528 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of embodiments of the invention.
A program/utility 540 having a set (at least one) of program modules 542 may be stored in, for example, memory 528, such program modules 542 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 542 generally perform the functions and/or methods in the described embodiments of the invention.
The computer device 512 may also communicate with one or more external devices 514 (e.g., keyboard, pointing device, display 524, etc.), one or more devices that enable a user to interact with the computer device 512, and/or any devices (e.g., network card, modem, etc.) that enable the computer device 512 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 522. Also, the computer device 512 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet, through a network adapter 520. As shown, network adapter 520 communicates with other modules of computer device 512 via bus 518. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with computer device 512, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
Processor 516 executes various functional applications and data processing by running programs stored in system memory 528, such as implementing a height map generation method provided by an embodiment of the present invention, the method comprising:
acquiring element height information of scene elements in a target scene;
generating a plurality of layers of original height maps based on the element height information, and determining the height map information of each layer of original height maps;
and merging the original height maps based on the height map information to obtain at least one merged height map.
Of course, those skilled in the art will understand that the processor may also implement the technical solution of the height map generating method provided in any embodiment of the present invention.
Example six
The sixth embodiment of the present invention also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the height map generating method provided by the embodiment of the present invention, the method comprising:
acquiring element height information of scene elements in a target scene;
generating a plurality of layers of original height maps based on the element height information, and determining the height map information of each layer of original height maps;
and merging the original height maps based on the height map information to obtain at least one merged height map.
Of course, the computer-readable storage medium provided by the embodiments of the present invention, on which the computer program stored, is not limited to the method operations described above, but may also perform the related operations of the height map generation method provided by any of the embodiments of the present invention.
The computer storage media of embodiments of the invention may take the form of 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. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 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.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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 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 ++ 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. 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, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (10)

1. A height map generation method, comprising:
acquiring element height information of scene elements in a target scene;
generating a plurality of layers of original height maps based on the element height information, and determining the height map information of each layer of original height maps;
combining the original height maps based on the height map information to obtain at least one combined height map;
acquiring element height information of scene elements in a target scene, including:
and acquiring a scene model of the target scene, and performing ray detection on the scene model by using a ray detection method to obtain element height information of each layer of scene elements, wherein the ray detection density is set according to the actual size of the scene elements in the target scene.
2. The method of claim 1, wherein the merging the original height map based on the height map information to obtain at least one merged height map comprises:
traversing the original height map, taking the original height map traversed currently as a height map to be combined, and matching the height map to be combined with a combined result height map in a current combined result set according to the height map information of the height map to be combined;
and obtaining a target merging height map according to the matching result, updating the merging result set based on the target merging height map until all the original height maps are traversed, and taking the merging result height map in the merging result set as the merging height map.
3. The method according to claim 2, wherein the matching the height map to be combined with the combined result height map in the current combined result set according to the height map information of the height map to be combined includes:
traversing the merging result height map in the merging result set, taking the currently traversed merging result height map as a candidate merging height map, and judging whether the height map to be merged is matched with the candidate merging height map or not based on the height map information;
if the height map to be combined is matched with the candidate combining height map, stopping traversing;
if the height map to be combined is not matched with the candidate combined height map, continuing to traverse until the combined result height map matched with the height map to be combined is obtained or traversing is completed.
4. The method of claim 3, wherein the determining whether the height map to be combined and the candidate combined height map match based on the height map information comprises:
judging whether an overlapping area exists between the effective area of the height map to be combined and the effective area of the candidate combined height map;
and if the effective area of the height map to be combined and the effective area of the candidate combining height map have an overlapping area, judging that the height map to be combined and the candidate combining height map are not matched.
5. The method as recited in claim 4, further comprising:
if the effective area of the height map to be combined and the effective area of the candidate combined height map do not have an overlapping area, determining the height information of the combined local height map based on the height map to be combined and the candidate combined height map, and judging whether the fall between the height information of the local height map and the height information of the candidate combined height map is higher than a set fall threshold;
if the fall between the height information of the local height map and the height information of the candidate merging height map is not higher than a set fall threshold, judging that the height map to be merged is matched with the candidate merging height map;
and if the fall between the height information of the local height map and the height information of the candidate merging height map is higher than a set fall threshold, judging that the height map to be merged and the candidate merging height map are not matched.
6. The method of claim 2, wherein the obtaining a target merged height map from the matching result and updating the set of merged results based on the target merged height map comprises:
and if the merging result height map matched with the height map to be merged exists, merging the height map to be merged into the merging result height map to obtain the target merging height map.
7. The method of claim 2, wherein the obtaining a target merged height map from the matching result and updating the set of merged results based on the target merged height map comprises:
and if the merging result height map matched with the height map to be merged does not exist, taking the height map to be merged as the target merging height map, and adding the target merging height map into the merging result set.
8. A height map generating apparatus, comprising:
the element height acquisition module is used for acquiring element height information of scene elements in the target scene;
the original height map generation module is used for generating a plurality of layers of original height maps based on the element height information and determining the height map information of each layer of original height map;
the height map merging module is used for merging the original height maps based on the height map information to obtain at least one merged height map;
the element height acquisition module is specifically used for:
and acquiring a scene model of the target scene, and performing ray detection on the scene model by using a ray detection method to obtain element height information of each layer of scene elements, wherein the ray detection density is set according to the actual size of the scene elements in the target scene.
9. A computer device, the device comprising:
one or more processors;
a storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the height map generation method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the height map generation method according to any one of claims 1-7.
CN202010723757.9A 2020-07-24 2020-07-24 Altitude map generation method, device, equipment and storage medium Active CN111870954B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010723757.9A CN111870954B (en) 2020-07-24 2020-07-24 Altitude map generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010723757.9A CN111870954B (en) 2020-07-24 2020-07-24 Altitude map generation method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111870954A CN111870954A (en) 2020-11-03
CN111870954B true CN111870954B (en) 2024-02-13

Family

ID=73200510

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010723757.9A Active CN111870954B (en) 2020-07-24 2020-07-24 Altitude map generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111870954B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109701273A (en) * 2019-01-16 2019-05-03 腾讯科技(北京)有限公司 Processing method, device, electronic equipment and the readable storage medium storing program for executing of game data
CN110044275A (en) * 2018-01-15 2019-07-23 株式会社三丰 For measuring the method, system and data medium of the height map on the surface of object
CN110090447A (en) * 2019-05-09 2019-08-06 腾讯科技(深圳)有限公司 Collision body stacking method, generation method, device, equipment and storage medium
CN110420461A (en) * 2019-07-25 2019-11-08 福建省天奕网络科技有限公司 A kind of play trip stratification air navigation aid based on height map
CN110706324A (en) * 2019-10-18 2020-01-17 网易(杭州)网络有限公司 Method and device for rendering weather particles
CN111135565A (en) * 2019-12-02 2020-05-12 网易(杭州)网络有限公司 Terrain splicing method and device in game scene, processor and electronic device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110044275A (en) * 2018-01-15 2019-07-23 株式会社三丰 For measuring the method, system and data medium of the height map on the surface of object
CN109701273A (en) * 2019-01-16 2019-05-03 腾讯科技(北京)有限公司 Processing method, device, electronic equipment and the readable storage medium storing program for executing of game data
CN110090447A (en) * 2019-05-09 2019-08-06 腾讯科技(深圳)有限公司 Collision body stacking method, generation method, device, equipment and storage medium
CN110420461A (en) * 2019-07-25 2019-11-08 福建省天奕网络科技有限公司 A kind of play trip stratification air navigation aid based on height map
CN110706324A (en) * 2019-10-18 2020-01-17 网易(杭州)网络有限公司 Method and device for rendering weather particles
CN111135565A (en) * 2019-12-02 2020-05-12 网易(杭州)网络有限公司 Terrain splicing method and device in game scene, processor and electronic device

Also Published As

Publication number Publication date
CN111870954A (en) 2020-11-03

Similar Documents

Publication Publication Date Title
CN110163903B (en) Three-dimensional image acquisition and image positioning method, device, equipment and storage medium
US11328401B2 (en) Stationary object detecting method, apparatus and electronic device
US20200082571A1 (en) Method and apparatus for calibrating relative parameters of collector, device and storage medium
WO2020098531A1 (en) Object loading method, device, storage medium, and electronic device
CN108604379A (en) System and method for determining the region in image
CN111882634B (en) Image rendering method, device, equipment and storage medium
CN111870952B (en) Altitude map generation method, device, equipment and storage medium
CN109992640B (en) Method, device, equipment and storage medium for determining position grid
CN110648363A (en) Camera posture determining method and device, storage medium and electronic equipment
CN114758337B (en) Semantic instance reconstruction method, device, equipment and medium
CN112101305A (en) Multi-path image processing method and device and electronic equipment
CN112232311B (en) Face tracking method and device and electronic equipment
CN112023400A (en) Height map generation method, device, equipment and storage medium
CN111870953A (en) Height map generation method, device, equipment and storage medium
CN109934072B (en) Personnel counting method and device
CN113989616A (en) Target detection method, device, equipment and storage medium
CN111870954B (en) Altitude map generation method, device, equipment and storage medium
CN110197459B (en) Image stylization generation method and device and electronic equipment
CN111815748A (en) Animation processing method and device, storage medium and electronic equipment
CN114820953B (en) Data processing method, device, equipment and storage medium
CN111382643A (en) Gesture detection method, device, equipment and storage medium
CN109389119A (en) Point of interest area determination method, device, equipment and medium
CN113763438B (en) Point cloud registration method, device, equipment and storage medium
CN111652831B (en) Object fusion method and device, computer-readable storage medium and electronic equipment
CN114821055A (en) House model construction method and device, readable storage medium and electronic equipment

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
GR01 Patent grant
GR01 Patent grant