CN113908542A - Method and device for processing terrain data in game - Google Patents

Method and device for processing terrain data in game Download PDF

Info

Publication number
CN113908542A
CN113908542A CN202111088157.0A CN202111088157A CN113908542A CN 113908542 A CN113908542 A CN 113908542A CN 202111088157 A CN202111088157 A CN 202111088157A CN 113908542 A CN113908542 A CN 113908542A
Authority
CN
China
Prior art keywords
data
game
texture
target object
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.)
Pending
Application number
CN202111088157.0A
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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202111088157.0A priority Critical patent/CN113908542A/en
Publication of CN113908542A publication Critical patent/CN113908542A/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
    • A63F13/5378Controlling 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 for displaying an additional top view, e.g. radar screens or maps
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • A63F13/525Changing parameters of virtual cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping

Abstract

The application discloses a method for processing terrain data in a game, which comprises the following steps: determining a target object to be processed in topographic data of the game; acquiring a texture map and a normal map contained in the target object; outputting first flat mapping data corresponding to the texture mapping and second flat mapping data corresponding to the normal mapping according to each preset coordinate direction of the topographic data; and obtaining a target object for displaying in a game interface of the user side according to the first tile mapping data and the second tile mapping data. By adopting the method, the problem of drawing the texture of the map caused by overlarge topographic relief in the game is solved.

Description

Method and device for processing terrain data in game
Technical Field
The application relates to the technical field of data processing, in particular to a method and a device for processing topographic data in a game.
Background
Currently, there is an increasing number of open world themed games, with a large amount of natural terrain contained in the scene area of such games. By natural topography is meant a simulation of real world topography, such as different terrains like mountains, plains, forests etc. When the terrain is in large fluctuation, the terrain displayed in the game interface can be stretched in different degrees, and the visual effect is influenced.
In the prior art, the following processing schemes are generally adopted to restore the visual effect: firstly, the model is added to cover the edge to shield or hide the stretched part, thereby repairing the visual effect. Secondly, the reduction of the terrain slope can stretch the environmental map to a certain degree. However, excessive stacking of models increases performance consumption and grade reduction may increase limitations in visual performance.
Therefore, it is very important to solve the problem of texture stretching caused by excessive terrain relief in the game.
Disclosure of Invention
The method for processing the terrain data in the game solves the problem of drawing of the texture of the map caused by overlarge terrain undulation in the game.
The embodiment of the application provides a method for processing terrain data in a game, which comprises the following steps: determining a target object to be processed in topographic data of the game; acquiring a texture map and a normal map contained in the target object; outputting first flat mapping data corresponding to the texture mapping and second flat mapping data corresponding to the normal mapping according to each preset coordinate direction of the topographic data; and obtaining a target object for displaying in a game interface of the user side according to the first tile mapping data and the second tile mapping data.
Optionally, the determining a target object to be processed in the topographic data of the game includes: acquiring an object in the topographic data of the game, and determining the object as a target object to be processed according to an angle between the object and a horizontal plane of the topographic data; or acquiring attribute configuration data of the object in the topographic data, and if the attribute configuration data comprises a preset stretching processing mark, determining that the object is the target object to be processed.
Optionally, the determining, according to an angle between the object and a horizontal plane of the terrain data, that the object is a target object to be processed includes: and if the angle between the surface line of the object and the horizontal plane is smaller than a first gradient threshold value, or the included angle between the normal direction corresponding to the surface of the object and the normal direction corresponding to the horizontal plane is larger than a second gradient threshold value, taking the object as the target object.
Optionally, the method further includes: and picking up an object of which the distance between the object and the virtual camera is less than a preset distance threshold value in the terrain data according to the position movement of the virtual camera corresponding to the game relative to the terrain data.
Optionally, the outputting first tile mapping data corresponding to the texture map and second tile mapping data corresponding to the normal map according to each predetermined coordinate direction of the terrain data includes: identifying world space texture coordinates of the texture map through a graph material function corresponding to the texture map, and performing tiling mapping in the three-dimensional position coordinate direction of the topographic data to obtain first tiling mapping data; and identifying world space texture coordinates of the normal map through a graph material function corresponding to the normal map, and performing tiling mapping in the three-dimensional position coordinate direction of the topographic data to obtain second tiling mapping data.
Optionally, the image texture function is a world-consistent texture function including a plurality of nodes.
Optionally, the method further includes: respectively converting the texture mapping and the normal mapping into a corresponding texture object and a normal texture object, and respectively inputting texture object nodes contained in the corresponding world consistent texture functions; respectively picking up respective absolute world coordinate values of the texture map and the normal map, and respectively inputting the respective absolute world coordinate values into absolute world coordinate nodes contained in world material functions corresponding to the texture map and the normal map; and acquiring texture repetition degree data of the texture map and the normal map, and respectively inputting texture size nodes contained in the world material function corresponding to the texture map and the normal map.
Optionally, the method further includes: and acquiring respective fusion transition parameter values of the texture map and the normal map, and respectively inputting projection transition contrast nodes contained in the world material functions corresponding to the texture map and the normal map.
Optionally, the method further includes: and setting the Alpha channels of the texture mapping and the normal mapping to be in an opening state.
Optionally, the method further includes: and acquiring world space vertex normals of the target object, and respectively inputting world space normal nodes contained in world consistent texture functions corresponding to the texture maps and the normal maps, so as to determine the normal directions of upper directional axes of the texture maps and the normal maps.
Optionally, the method further includes: and according to the world texture coordinate data of the normal map, carrying out reverse operation on the upper direction of the normal map.
Optionally, the method is used for a server; the method further comprises the following steps: providing the target object for displaying in the game interface of the user terminal to the user terminal; wherein, the user terminal is used for rendering the target object in a game interface.
Optionally, the method is used for the user side; the method further comprises the following steps: rendering the target object in a game interface of the user terminal.
An embodiment of the present application further provides a processing apparatus for terrain data in a game, including: a target object determination unit for determining a target object to be processed in topographic data of the game; the data extraction unit is used for acquiring a texture map and a normal map contained in the target object; a mapping unit, configured to output first tile mapping data corresponding to the texture map and second tile mapping data corresponding to the normal map according to each predetermined coordinate direction of the terrain data; and the display unit is used for obtaining a target object for displaying in a game interface of the user side according to the first tile mapping data and the second tile mapping data.
The embodiment of the application further provides a method for processing terrain data in a game, which comprises the following steps: obtaining a target object in topographic data of the game; the target object is a target object which is processed by the processing method of the topographic data in the game and is used for being displayed in a game interface of a user side; rendering the target object in a game interface of the game.
Optionally, the obtaining a target object in the topographic data of the game includes: in response to detecting user authorization information for acquiring the GPU configuration information of the user side, acquiring the GPU configuration information of the user side; and if the GPU configuration information of the user side meets preset configuration conditions, acquiring the target object.
Optionally, the obtaining a target object in the topographic data of the game includes: and acquiring the target object in response to the detection that the network transmission speed of the user side meets a preset network speed condition or the detection of definition configuration information of the user side.
An embodiment of the present application further provides a device for processing terrain data in a game, including: an object acquisition unit for acquiring a target object in topographic data of a game; the target object is a target object which is processed by the processing method of the topographic data in the game and is used for being displayed in a game interface of a user side; the display unit is used for rendering the target object in a game interface of the game.
Compared with the prior art, the method has the following advantages:
according to the method and the device for processing the topographic data in the game, the texture map and the normal map contained in the target object in the topographic data of the game are acquired; outputting first flat mapping data corresponding to the texture mapping and second flat mapping data corresponding to the normal mapping according to each preset coordinate direction of the topographic data; and obtaining a target object for displaying in a game interface of the user side according to the first tile mapping data and the second tile mapping data. The texture mapping and the normal mapping contained in the target object are respectively subjected to tiled mapping on textures in different preset coordinate directions, so that the map in the game is closer to reality, and the problem of mapping texture stretching caused by overlarge topographic relief in the game is solved. Furthermore, the texture map and the normal map are respectively tiled and mapped by utilizing the specific graphic material function, so that the map in the game is closer to the actual visual appearance under the condition of not increasing the additional resource consumption of a user side. Furthermore, the target object is rendered in a game interface of the user side, and better visual experience is provided for the user.
According to the method and the device for processing the topographic data in the game, the target object in the topographic data of the game is obtained; the target object is a target object which is processed by the method and used for being displayed in a game interface of a user side; rendering the target object in a game interface of the game. The texture mapping and the normal mapping contained in the target object are respectively subjected to tiled mapping on textures in different preset coordinate directions, so that the map in the game is closer to reality. Furthermore, the texture mapping and the normal mapping are respectively tiled and mapped by utilizing the specific graph material function, so that the problem of mapping texture stretching caused by overlarge topographic relief in the game can be solved under the condition of not increasing the additional resource consumption of a user side. Furthermore, the target object is rendered in a game interface of the user side, and better visual experience is provided for the user.
Drawings
FIG. 1 is an example of a system architecture of a method provided by an embodiment of the present application;
fig. 2 is a process flow chart of a method for processing terrain data in a game according to a first embodiment of the present application;
FIG. 3 is a schematic diagram of a topographical object configured based on blueprint nodes according to a first embodiment of the present application;
FIG. 3A is a schematic diagram illustrating different visual effects obtained by different input information of an image texture function according to a first embodiment of the present application;
FIG. 4 is a schematic diagram of a visual effect of a target object obtained by applying the processing method of the in-game terrain data according to the first embodiment of the present application;
fig. 4A is a schematic view of a visual effect of a 110-degree slope obtained after processing by applying the processing method of the in-game terrain data provided in the first embodiment of the present application;
fig. 5 is an example of a user terminal included in a system architecture diagram of a method provided in an embodiment of the present application;
FIG. 6 is an example of a server involved in a system architecture diagram of a method provided by an embodiment of the present application;
fig. 7 is a process flow chart of a method for processing terrain data in a game according to a second embodiment of the present application;
fig. 8 is a schematic diagram of a device for processing terrain data in a game according to a third embodiment of the present application.
Fig. 9 is a schematic diagram of a device for processing terrain data in a game according to a fourth embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
The embodiment of the application provides a method and a device for processing terrain data in a game. The following examples are individually set forth.
In a game having a large number of natural terrains, a user can move in various terrains in a game scene area and perform game operations such as fighting, construction, detection of mineral resources or planting. By natural topography is meant a simulation of real world topography, such as different terrains like mountains, plains, forests etc. When the terrain is in large fluctuation, the terrain displayed in the game interface can be stretched in different degrees, so that the visual effect rendered in the game is poor. For example, for cliffs, steep slopes, steep sills, etc., the visual effect of the decal after stretching is quite different from that of real natural terrain. In the technical scheme of the prior art, generally, in the case of stretching a relatively obvious map, models such as rocks and mountains are adopted to cover the stretched terrain map, or the slope of the terrain is reduced to solve the stretching influence. However, the use of the masking scheme significantly increases the performance consumption of the client when there is too many model stacks. Reducing the slope to alleviate the stretch of the artwork increases the limitations of the artistic expression.
In the method provided by the embodiment of the application, the problem of the chartlet stretching possibly occurring when the terrain gradient is large is solved by using the graphic material function, so that the visual effect of the terrain in the game is closer to reality.
For ease of understanding, a description of the system architecture of the method provided by the embodiments of the present application is given below in conjunction with fig. 1. In the system architecture example shown in fig. 1, the method comprises the following steps: a user terminal 101, a server terminal 102 and a development terminal 103. The user terminal 101 in this embodiment may be, but is not limited to, a portable terminal, a mobile phone, a PAD, a personal computer, or an electronic device with an image processing function, and is used for running a game program including natural terrain, and the visual appearance of the game program is closer to reality in the case where there is a large slope and/or undulation in the natural terrain. The user terminal 101 and the server terminal 102 are connected to each other through a communication network, which may include a mobile network, a gateway, and the internet, or may be composed of a local area network and the internet. For example: the user terminal 101 is connected to the server terminal 102 via a mobile network, a gateway, and the internet. The following steps are repeated: the user terminal 101 is connected to the server terminal 102 via a local area network and the internet. The user terminal 101 receives information input by the game user, loads and executes a game program, and the game program is communicated with the game program executed by the server terminal 102 through a communication protocol. The game program executed by the server 102 may provide, but is not limited to, the following functions: configuration, management, related data calculation or other processing such as storage, data interaction processing with other game users (if multiple game users or networked games for team or match-up), etc. The development end 103 generates design data such as scene maps, various templates, user interfaces, user interaction and the like in the game according to information such as virtual camera lens movement, role operation, game running logic and the like in a pre-designed game, and realizes association and running logic of various resources in the game. In the embodiment of the present application, the development end 103, in particular, generates the terrain data including one or more terrain objects in the game, and the terrain data is uploaded to the service end 102 along with the game generated by the development end 103 and is loaded to the user end 101 along with the game user loading the game, or is gradually loaded to the user end 101 along with the game user operating in the game, and is rendered as a scene map or terrain in the game at the user end 101.
A method for processing topographic data in a game according to a first embodiment of the present application will be described below with reference to fig. 2 to 6. The method for processing terrain data in the game shown in fig. 2 comprises the following steps: step S201 to step S204.
Step S101, determining a target object to be processed in the topographic data of the game.
In this embodiment, the game refers to a terrain-like game including terrain data simulating natural terrain, such as an open-world theme game. The terrain data comprises one or more terrain objects, and each terrain object in the game may be considered an object formed based on a terrain shape and a terrain surface type. The terrain modeling can be a polygon, and the terrain surface type can be a terrain map. The terrain surface type may be any of the following terrain materials from the image: mountainous regions, plains, forests, deserts, water areas, swamps or terrains made of personalized customized materials and the like. The terrain map is applied to the terrain modeling surface, so that the rendered terrain object can present a visual appearance similar to the terrain in the real world in a game interface of a user side, and particularly present a three-dimensional appearance. For example, appearing as three-dimensional mountains, deserts, etc. The terrain map may be a two-dimensional picture, and is particularly applied to a terrain modeling surface according to UV coordinates, so that the terrain object is rendered to appear as a three-dimensional appearance. The UV coordinate is a coordinate of the picture in the horizontal and vertical directions of the display, and the value of the UV coordinate is 0-1. For example, the U-th pixel in the horizontal direction represents the horizontal position of the pixel, and the V-th pixel in the vertical direction represents the vertical position of the pixel. Each point on the terrain map can be corresponding to the surface of the terrain modeling through the UV coordinates, the position of a gap between each point and each other is subjected to smooth interpolation processing, and if the gradient of the terrain modeling is large, the problem of map stretching, particularly texture stretching, is caused when the two-dimensional terrain map is projected on the polygonal terrain modeling surface.
This step is to determine a terrain object to be processed in the game due to the gradient of the terrain shape, the terrain object being the target object. In practice, it can be determined whether the object is a target object with a large gradient or a large undulation degree according to the angle between the vertex of the object currently picked up in the game and the horizontal plane of the terrain data or the preset mark of each object. Specifically, the determining a target object to be processed in the topographic data of the game includes: acquiring an object in topographic data of a game, and determining the object as a target object to be processed according to an angle between the object and a horizontal plane of the topographic data; or acquiring attribute configuration data of the object in the topographic data, and if the attribute configuration data comprises a preset stretching processing mark, determining that the object is a target object to be processed. Wherein, the stretching processing mark is a mark which is set for creating an object (especially a terrain object) and indicates that the object has larger gradient or larger fluctuation degree and needs processing.
Further, the determining the object as a target object to be processed according to an angle between the object and a horizontal plane of the terrain data includes: and if the angle between the surface line of the object and the horizontal plane is smaller than a first gradient threshold value, or the included angle between the normal direction corresponding to the surface of the object and the normal direction corresponding to the horizontal plane is larger than a second gradient threshold value, taking the object as the target object. For example, the angle between the surface line of the object and the horizontal plane is less than 120 degrees, or the angle between the normal corresponding to the surface of at least some slope of the object and the normal corresponding to the horizontal plane is greater than 70 degrees, which may be regarded as a slope or a heave.
In this embodiment, the topographic data refers to topographic data currently loaded into the memory. In fact, the topographic data can be dynamically loaded according to the position of the character in the game, or the topographic data of the whole game can be loaded at one time. The method also comprises the following steps: and according to the position movement of the virtual camera corresponding to the game relative to the terrain data, picking up an object of which the distance between the object and the virtual camera in the terrain data is smaller than a preset distance threshold value, and further judging whether the picked object is a target object needing stretching processing. The virtual camera in this embodiment refers to a game component that observes a game world in a different mode and/or a different viewpoint in a game, for example, a game scene observed from a viewpoint of a character in a game corresponding to a game user.
Step S102, obtaining a texture map and a normal map contained in the target object.
In this embodiment, data forming the topographic surface type of the target object, that is, a topographic map, is specifically obtained, and a texture map, that is, a normal map, in the topographic map is further extracted for processing in subsequent steps, so as to solve the problem of mapping texture stretching.
Step S103, outputting first tile mapping data corresponding to the texture map and second tile mapping data corresponding to the normal map according to each predetermined coordinate direction of the terrain data.
In this embodiment, the predetermined coordinate direction is a coordinate direction in a world position coordinate system in the game, such as XYZ three-dimensional coordinate direction. During implementation, the world space texture coordinates of the target object can be identified by using the graph material function, and the textures in different directions of XYZ are tiled and mapped, so that the problem of terrain mapping stretching is solved. Specifically, the world space texture coordinates of the texture map are identified through a graph material function corresponding to the texture map, and tiling mapping is performed in the three-dimensional position coordinate direction of the topographic data to obtain first tiling mapping data; and identifying world space texture coordinates of the normal map through a graph material function corresponding to the normal map, and performing tiling mapping in the three-dimensional position coordinate direction of the topographic data to obtain second tiling mapping data.
The image material function is a world consistent texture function (WorldAlignedTexture) including a plurality of nodes. Specifically, the input information of each node in the corresponding world-consistent texture function is acquired for the texture map and the normal map, and is input to the corresponding node for data processing. In practice, the method may specifically include: respectively converting the texture mapping and the normal mapping into a corresponding texture object and a normal texture object, and respectively inputting texture object nodes contained in the corresponding world consistent texture functions; respectively picking up respective absolute world coordinate values of the texture map and the normal map, and respectively inputting the respective absolute world coordinate values into absolute world coordinate nodes contained in world material functions corresponding to the texture map and the normal map; and acquiring texture repetition degree data of the texture map and the normal map, and respectively inputting texture size nodes contained in the world material function corresponding to the texture map and the normal map. So-called texture repetition degree data can be obtained from the feature data of the target object. For example, the absolute world coordinate values of the current object (i.e., the target object) are picked up by the WorldPosition node in the graph material function and directly inserted into an absolute world coordinate node (AbsoluteWorldPosition) to better match the texture of each predetermined coordinate direction, thereby solving the problem of map stretching. For example, the texture repetition degree data may be data for controlling a horizontal tiling amount and a vertical tiling amount of a point in a map, may be determined according to a specific game scene, and may also obtain an empirical value, for example, an effect that the data in a realistic scene makes a size of a target object presented in an interface close to an actual size.
In this embodiment, the visual effect of the seam portion in different projection directions can be buffered by obtaining the data of transition fusion between the mapping textures in different position coordinate directions. The method specifically comprises the following steps: and acquiring respective fusion transition parameter values of the texture map and the normal map, and respectively inputting projection transition contrast nodes contained in the world material functions corresponding to the texture map and the normal map.
In this embodiment, if the texture map is applied to the terrain modeling surface of the target object (i.e. the terrain object) in the form of a texture mask, the method further includes: and setting the Alpha channels of the texture mapping and the normal mapping to be in an opening state.
In this embodiment, the method further includes: and acquiring world space vertex normals of the target object, and respectively inputting world space normal nodes contained in world consistent texture functions corresponding to the texture maps and the normal maps, so as to determine the normal directions of upper directional axes of the texture maps and the normal maps. This may result in a higher degree of matching between the mapped textures for each predetermined coordinate direction.
In this embodiment, in order to reduce the effect of the terrain stretching degree and maintaining the terrain in a horizontal plane when the terrain map is applied to the terrain object, the method further includes: and according to the world texture coordinate data of the normal map, carrying out reverse operation on the upper direction of the normal map. For example, a map of the Z position coordinate direction of the normal map is multiplied by a negative number to change direction.
In practice, the input information for the image material function may be determined based on the visual effect. Taking a texture mapping of a target object as an example, specifically, determining texture repetition degree data corresponding to the texture mapping based on a visual effect to be used as input information of a texture size node corresponding to the texture mapping when a world consistent texture function corresponding to a texture thematic map is obtained; and/or determining a fusion transition parameter value corresponding to the texture map based on the visual effect, wherein the fusion transition parameter value is used as input information of a projection transition contrast node corresponding to the texture map, and the fusion transition parameter value is data representing transition fusion between mapping textures in different position coordinate directions. And carrying out similar or same treatment on the normal map of the target object and the texture map of the target object, thereby obtaining the visual effect of the close reality of the target object.
Referring to FIG. 3, an example of texture mapping based on a graphics texture function is shown, and the same or similar processing may be applied to normal mapping. The specific processing depends on the information of each input map. Different parameters need to be obtained for different effect maps. The figure shows four nodes of the WorldAlignedTexture function, which specifically includes: TextureObject 301, which needs to input a texture object, specifically, the input may be a texture object 301-1 converted by a texture map; texturesize 302, which inputs UV repetition 302-1, which may be a texture map; WorldPosition 303, whose input may be absolute world position 303-1, whose role is to pick up absolute world position coordinates of the current terrain; the input of the ProjectionTransitionContrast 304 can be a fusion transition value 304-1 between textures in different mapping directions when mapping according to a predetermined coordinate direction, because for mapping in the three-dimensional direction of a steep slope, the joint between the textures generated in different mapping directions can be relatively hard and needs to be buffered for transition; the output tiles the mapping data 305 in a predetermined coordinate direction, which may include a plurality of selectable output directions, such as XYZ three-dimensional mapping directions, XY horizontal plane mapping directions, Z vertical plane mapping directions of the world-position coordinate system of the game. Of course, if the texture map is needed as a mask for terrain modeling (i.e., modeling of the target object), the Alpha channel of the texture may also be opened, so that the map resource is a four-channel resource.
Referring to fig. 3A, fig. 3A shows a comparison of visual effects obtained by different input information of the image texture function, which includes: adjusted pre-visual effect 301a and adjusted post-visual effect 302 a; the texture repetition degree data corresponding to the adjusted visual effect 301a is 100, and the texture repetition degree data corresponding to the adjusted visual effect 302a is 200.
And step S104, obtaining a target object for displaying in a game interface of a user side according to the first tile mapping data and the second tile mapping data.
In the step, a target object displayed in a game interface of a user end is obtained, and specifically, a texture map and a normal map of the target object represented by UV coordinate data are respectively mapped and output from a three-dimensional direction of a world position coordinate system of a game, that is, from XYZ directions, so as to obtain basic color mapping data and normal map mapping data of the target object (that is, a terrain object), and the basic color mapping data and the normal map mapping data constitute the target object displayed in the game interface of the user end. The basic color mapping data is first tile mapping data, and the normal pattern mapping data is second tile mapping data. Of course, mapping output from the XY direction (i.e., the horizontal plane of the three-dimensional world position coordinate system of the game) or from only the Z direction (i.e., the vertical plane of the three-dimensional world position coordinate system of the game) may be selected.
The target object processed by the method provided by the embodiment can be rendered into a map or a terrain and landform in a game through the display unit of the user side according to the data corresponding to the target object, and the visual effect of the target object is closer to the visual appearance of a real terrain instead of stretching in a stripe shape.
Referring to fig. 4, a visual effect of a steep slope rendered by a user side after applying the method for processing terrain data in a game provided by the embodiment is shown. In the figure, the method comprises the following steps: the steep visual appearance 401 before processing and the steep visual appearance 402 after processing can be seen that the steep visual appearance 401 before processing has obvious texture stretch and is obviously different from the real terrain, and the steep visual appearance 402 after processing is obviously closer to the visual appearance of the real terrain.
Referring to fig. 4A, a visual effect of a 110-degree slope rendered by the user side after applying the processing method of the terrain data in the game provided by the embodiment is shown, where the 110-degree slope is an angle between a ground surface line of an object (i.e., the mountain) and a horizontal plane in the game, and is 110 degrees. In the figure, the method comprises the following steps: the pre-treatment 110 degree slope visual appearance 401a, and the post-treatment 110 degree slope visual appearance 402a, it can be seen that the post-treatment 110 degree slope visual appearance 402a has little texture stretch and a more natural visual appearance effect than the pre-treatment 110 degree slope visual appearance 401 a.
The method for processing the topographic data in the game provided by the embodiment of the application can be executed at a user side and also can be executed at a server side.
In the embodiment executed by the user terminal, the device implemented according to the processing method of the topographic data in the game can be stored in the user terminal 101. Referring to fig. 5, an example of the user terminal shown in the figure includes: the storage 101-1, the processing device 101-2 of the terrain data in the game, the processor 101-3 and the display unit 101-4 are used for directly or indirectly carrying out data transmission and interaction among the parts. The memory 101-1 stores a processing device 101-2 of in-game terrain data comprising one or more functional modules in the form of software or firmware. The processor 101-3 loads the program and the function module in the memory 101-1, and executes various function applications and data processing corresponding to the processing device 101-2 of the topographic data in the game. The display unit 101-4 renders the visual appearance of the terrain data in the game to be shown as a map or a terrain feature in the game according to various functional applications and data processing corresponding to the processing device 101-2 of the terrain data in the game at the user terminal 101. The method is used for the user side; the method further comprises the following steps: rendering the target object in a game interface of the user terminal. Specifically, the map or the terrain and the landform in the game can be rendered through the display unit of the user side according to the data corresponding to the target object, and the visual effect of the map or the terrain and the landform is closer to the real terrain instead of stretching in a stripe shape.
In the method for processing the topographic data in the game provided by the embodiment of the application, in the implementation executed by the server, a device implemented according to the method for processing the topographic data in the game may be stored in the server 102. Referring to fig. 6, an example of the ue shown in the figure includes: the memory 102-1, the processing device 102-2 of the terrain data in the game and the processor 102-3 carry out data transmission and interaction among the parts directly or indirectly. The memory 102-1 stores a processing device 102-2 of in-game terrain data comprising one or more functional modules in the form of software or firmware. The processor 102-3 loads the program and the function module in the memory 102-1, and executes various function applications and data processing corresponding to the processing device 102-2 of the terrain data in the game. When the method is used for a server; the method further comprises the following steps: providing the target object for displaying in the game interface of the user terminal to the user terminal; wherein, the user terminal is used for rendering the target object in a game interface. The display unit of the user side renders the data corresponding to the target object into a map or a terrain and landform in the game, and the visual effect of the game avoids the stretching of stripes and is closer to the real terrain.
It should be noted that, in the case of no conflict, the features given in this embodiment and other embodiments of the present application may be combined with each other, and the steps S201 and S202 or similar terms do not limit the steps to be executed sequentially.
Thus, the method provided by the present embodiment is described, in which a texture map and a normal map included in a target object in topographic data of a game are obtained; outputting first flat mapping data corresponding to the texture mapping and second flat mapping data corresponding to the normal mapping according to each preset coordinate direction of the topographic data; and rendering a visual appearance corresponding to the target object in an interface of the game according to the first tiled mapping data and the second tiled mapping data. The texture mapping and the normal mapping contained in the target object are respectively subjected to tiled mapping on textures in different preset coordinate directions, so that the map in the game is closer to reality, and the problem of mapping texture stretching caused by overlarge topographic relief in the game is solved. Furthermore, the texture map and the normal map are respectively tiled and mapped by utilizing the specific graphic material function, so that the map in the game is closer to the actual visual appearance under the condition of not increasing the additional resource consumption of a user side. Furthermore, the target object is rendered in a game interface of the user side, and better visual experience is provided for the user.
A second embodiment of the present application provides a processing apparatus for topographic data in a game, corresponding to the first embodiment. The device is described below with reference to fig. 7. The processing device of topographic data in the game shown in fig. 7 includes:
a target object determination unit 701 for determining a target object to be processed in topographic data of the game;
a data extracting unit 702, configured to obtain a texture map and a normal map included in the target object;
a mapping unit 703, configured to output first tile mapping data corresponding to the texture map and second tile mapping data corresponding to the normal map according to each predetermined coordinate direction of the terrain data;
a display unit 704, configured to obtain a target object for displaying in a game interface of a user end according to the first tile mapping data and the second tile mapping data.
Optionally, the target object determining unit 701 is specifically configured to: acquiring an object in the topographic data of the game, and determining the object as a target object to be processed according to an angle between the object and a horizontal plane of the topographic data; or acquiring attribute configuration data of the object in the topographic data, and if the attribute configuration data comprises a preset stretching processing mark, determining that the object is the target object to be processed.
Optionally, the target object determining unit 701 is specifically configured to: and if the angle between the surface line of the object and the horizontal plane is smaller than a first gradient threshold value, or the included angle between the normal direction corresponding to the surface of the object and the normal direction corresponding to the horizontal plane is larger than a second gradient threshold value, taking the object as the target object.
Optionally, the target object determining unit 701 is specifically configured to: and picking up an object of which the distance between the object and the virtual camera is less than a preset distance threshold value in the terrain data according to the position movement of the virtual camera corresponding to the game relative to the terrain data.
Optionally, the mapping unit 703 is specifically configured to: identifying world space texture coordinates of the texture map through a graph material function corresponding to the texture map, and performing tiling mapping in the three-dimensional position coordinate direction of the topographic data to obtain first tiling mapping data; and identifying world space texture coordinates of the normal map through a graph material function corresponding to the normal map, and performing tiling mapping in the three-dimensional position coordinate direction of the topographic data to obtain second tiling mapping data.
Optionally, the image texture function is a world-consistent texture function including a plurality of nodes.
Optionally, the mapping unit 703 is specifically configured to: respectively converting the texture mapping and the normal mapping into a corresponding texture object and a normal texture object, and respectively inputting texture object nodes contained in the corresponding world consistent texture functions;
respectively picking up respective absolute world coordinate values of the texture map and the normal map, and respectively inputting the respective absolute world coordinate values into absolute world coordinate nodes contained in world material functions corresponding to the texture map and the normal map;
and acquiring texture repetition degree data of the texture map and the normal map, and respectively inputting texture size nodes contained in the world material function corresponding to the texture map and the normal map.
Optionally, the mapping unit 703 is specifically configured to: and acquiring respective fusion transition parameter values of the texture map and the normal map, and respectively inputting projection transition contrast nodes contained in the world material functions corresponding to the texture map and the normal map.
Optionally, the mapping unit 703 is specifically configured to: and setting the Alpha channels of the texture mapping and the normal mapping to be in an opening state.
Optionally, the mapping unit 703 is specifically configured to: and acquiring world space vertex normals of the target object, and respectively inputting world space normal nodes contained in world consistent texture functions corresponding to the texture maps and the normal maps, so as to determine the normal directions of upper directional axes of the texture maps and the normal maps.
Optionally, the mapping unit 703 is specifically configured to: and according to the world texture coordinate data of the normal map, carrying out reverse operation on the upper direction of the normal map.
Optionally, the device is configured at a server; the display unit 704 is specifically configured to: providing the target object for displaying in the game interface of the user terminal to the user terminal; wherein, the user terminal is used for rendering the target object in a game interface.
Optionally, the device is configured at a user end; the display unit 704 is specifically configured to: rendering the target object in a game interface of the user terminal.
Based on the foregoing embodiments, a third embodiment of the present application provides a method for processing topographic data in a game, where the method is applied to a user end. The method is described below with reference to fig. 8. The method for processing terrain data in a game shown in fig. 8 includes: step S801 to step S802.
Step S801, obtaining a target object in topographic data of the game; the target object is a target object which is processed by the method and used for being displayed in a game interface of a user side.
Fig. 1 is a system architecture example of the method in this embodiment, fig. 5 is a structure example of the user side, and reference is made to the corresponding parts for related concepts and detailed description information, which are not repeated herein.
The method provided by the embodiment can be deployed at a user end, and aims to render the target object in a game interface of the user end so as to show a visual effect close to the real appearance of natural terrain for a game user and improve user experience.
The target object obtained in this step is a target object processed by the method provided in the first embodiment and used for being displayed in the game interface at the user side.
In this embodiment, since the method provided in the first embodiment processes the target object, the visual effect close to the real appearance of the natural terrain can be provided without additionally increasing the performance consumption of the user side, and therefore, the terrain data processed by such a method can be obtained under the condition that the network transmission speed or the GPU configuration is not good enough. Specifically, in one embodiment, the obtaining of the target object in the topographic data of the game includes: in response to detecting user authorization information for acquiring the GPU configuration information of the user side, acquiring the GPU configuration information of the user side; and if the GPU configuration information of the user side meets preset configuration conditions, acquiring the target object. In one embodiment, the obtaining of the target object in the topographic data of the game comprises: and acquiring the target object in response to the detection that the network transmission speed of the user side meets a preset network speed condition or the detection of definition configuration information of the user side.
Step S802, rendering the target object in a game interface of the game.
The target object is rendered in a game interface of a user end so as to show a visual effect close to the real appearance of natural terrain for a game user and improve the user experience.
Up to this point, the method provided by the present embodiment is explained, which is performed by obtaining a target object in topographic data of a game; the target object is a target object which is processed by the method provided by the embodiment of the application and is used for being displayed in a game interface of a user side; rendering the target object in a game interface of the game. The texture mapping and the normal mapping contained in the target object are respectively subjected to tiled mapping on textures in different preset coordinate directions, so that the map in the game is closer to reality. Furthermore, the texture mapping and the normal mapping are respectively tiled and mapped by utilizing the specific graph material function, so that the problem of mapping texture stretching caused by overlarge topographic relief in the game can be solved under the condition of not increasing the additional resource consumption of a user side. Furthermore, the target object is rendered in a game interface of the user side, and better visual experience is provided for the user.
A fourth embodiment of the present application provides a processing apparatus for topographic data in a game, corresponding to the third embodiment. The device is described below with reference to fig. 9. The processing device of topographic data in the game shown in fig. 9 includes:
an object acquisition unit 901 for acquiring a target object in topographic data of a game; the target object is a target object which is processed by the method and used for being displayed in a game interface of a user side;
a presentation unit 902 for rendering the target object in a game interface of the game.
Optionally, the object obtaining unit 901 is specifically configured to: in response to detecting user authorization information for acquiring the GPU configuration information of the user side, acquiring the GPU configuration information of the user side; and if the GPU configuration information of the user side meets preset configuration conditions, acquiring the target object.
Optionally, the object obtaining unit 901 is specifically configured to: and acquiring the target object in response to the detection that the network transmission speed of the user side meets a preset network speed condition or the detection of definition configuration information of the user side.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
1. Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
2. As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Although the present application has been described with reference to the preferred embodiments, it is not intended to limit the present application, and those skilled in the art can make variations and modifications without departing from the spirit and scope of the present application, therefore, the scope of the present application should be determined by the claims that follow.

Claims (18)

1. A method for processing terrain data in a game, comprising:
determining a target object to be processed in topographic data of the game;
acquiring a texture map and a normal map contained in the target object;
outputting first flat mapping data corresponding to the texture mapping and second flat mapping data corresponding to the normal mapping according to each preset coordinate direction of the topographic data;
and obtaining a target object for displaying in a game interface of the user side according to the first tile mapping data and the second tile mapping data.
2. The method of claim 1, wherein determining the target object to be processed in the topographic data for the game comprises:
acquiring an object in the topographic data of the game, and determining the object as a target object to be processed according to an angle between the object and a horizontal plane of the topographic data; alternatively, the first and second electrodes may be,
acquiring attribute configuration data of the object in the topographic data, and determining the object as the target object to be processed if the attribute configuration data comprises a preset stretching processing mark.
3. The method of claim 2, wherein determining the object as the target object to be processed according to the angle between the object and the horizontal plane of the terrain data comprises:
and if the angle between the surface line of the object and the horizontal plane is smaller than a first gradient threshold value, or the included angle between the normal direction corresponding to the surface of the object and the normal direction corresponding to the horizontal plane is larger than a second gradient threshold value, taking the object as the target object.
4. The method of claim 2, further comprising:
and picking up an object of which the distance between the object and the virtual camera is less than a preset distance threshold value in the terrain data according to the position movement of the virtual camera corresponding to the game relative to the terrain data.
5. The method according to claim 1, wherein outputting first tile map data corresponding to the texture map and second tile map data corresponding to the normal map in each predetermined coordinate direction of the terrain data comprises:
identifying world space texture coordinates of the texture map through a graph material function corresponding to the texture map, and performing tiling mapping in the three-dimensional position coordinate direction of the topographic data to obtain first tiling mapping data;
and identifying world space texture coordinates of the normal map through a graph material function corresponding to the normal map, and performing tiling mapping in the three-dimensional position coordinate direction of the topographic data to obtain second tiling mapping data.
6. The method of claim 5, wherein the image material function is a world-consistent texture function comprising a plurality of nodes.
7. The method of claim 6, further comprising:
respectively converting the texture mapping and the normal mapping into a corresponding texture object and a normal texture object, and respectively inputting texture object nodes contained in the corresponding world consistent texture functions;
respectively picking up respective absolute world coordinate values of the texture map and the normal map, and respectively inputting the respective absolute world coordinate values into absolute world coordinate nodes contained in world material functions corresponding to the texture map and the normal map;
and acquiring texture repetition degree data of the texture map and the normal map, and respectively inputting texture size nodes contained in the world material function corresponding to the texture map and the normal map.
8. The method of claim 6, further comprising:
and acquiring respective fusion transition parameter values of the texture map and the normal map, and respectively inputting projection transition contrast nodes contained in the world material functions corresponding to the texture map and the normal map.
9. The method of claim 6, further comprising:
and setting the Alpha channels of the texture mapping and the normal mapping to be in an opening state.
10. The method of claim 6, further comprising:
and acquiring world space vertex normals of the target object, and respectively inputting world space normal nodes contained in world consistent texture functions corresponding to the texture maps and the normal maps, so as to determine the normal directions of upper directional axes of the texture maps and the normal maps.
11. The method of claim 6, further comprising:
and according to the world texture coordinate data of the normal map, carrying out reverse operation on the upper direction of the normal map.
12. The method of claim 1, wherein the method is used for a server; the method further comprises the following steps:
providing the target object for displaying in the game interface of the user terminal to the user terminal; wherein, the user terminal is used for rendering the target object in a game interface.
13. The method according to claim 1, wherein the method is used for a user side; the method further comprises the following steps:
rendering the target object in a game interface of the user terminal.
14. An apparatus for processing topographic data in a game, comprising:
a target object determination unit for determining a target object to be processed in topographic data of the game;
the data extraction unit is used for acquiring a texture map and a normal map contained in the target object;
a mapping unit, configured to output first tile mapping data corresponding to the texture map and second tile mapping data corresponding to the normal map according to each predetermined coordinate direction of the terrain data;
and the display unit is used for obtaining a target object for displaying in a game interface of the user side according to the first tile mapping data and the second tile mapping data.
15. A method for processing terrain data in a game, comprising:
obtaining a target object in topographic data of the game; the target object is processed by the method of claims 1-12 and is used for displaying in a game interface of a user terminal;
rendering the target object in a game interface of the game.
16. The method of claim 15, wherein obtaining the target object in the topographic data for the game comprises:
in response to detecting user authorization information for acquiring the GPU configuration information of the user side, acquiring the GPU configuration information of the user side;
and if the GPU configuration information of the user side meets preset configuration conditions, acquiring the target object.
17. The method of claim 15, wherein obtaining the target object in the topographic data for the game comprises:
and acquiring the target object in response to the detection that the network transmission speed of the user side meets a preset network speed condition or the detection of definition configuration information of the user side.
18. An apparatus for processing terrain data in a game, comprising:
an object acquisition unit for acquiring a target object in topographic data of a game; the target object is processed by the method of claims 1-12 and is used for displaying in a game interface of a user terminal;
the display unit is used for rendering the target object in a game interface of the game.
CN202111088157.0A 2021-09-16 2021-09-16 Method and device for processing terrain data in game Pending CN113908542A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111088157.0A CN113908542A (en) 2021-09-16 2021-09-16 Method and device for processing terrain data in game

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111088157.0A CN113908542A (en) 2021-09-16 2021-09-16 Method and device for processing terrain data in game

Publications (1)

Publication Number Publication Date
CN113908542A true CN113908542A (en) 2022-01-11

Family

ID=79235004

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111088157.0A Pending CN113908542A (en) 2021-09-16 2021-09-16 Method and device for processing terrain data in game

Country Status (1)

Country Link
CN (1) CN113908542A (en)

Similar Documents

Publication Publication Date Title
CN107358649B (en) Processing method and device of terrain file
US20180276882A1 (en) Systems and methods for augmented reality art creation
EP3533218B1 (en) Simulating depth of field
KR20080018404A (en) Computer readable recording medium having background making program for making game
CN107610225B (en) Method for unitizing three-dimensional oblique photography live-action model
CN112138386A (en) Volume rendering method and device, storage medium and computer equipment
CN101477701A (en) Built-in real tri-dimension rendering process oriented to AutoCAD and 3DS MAX
WO2023066121A1 (en) Rendering of three-dimensional model
CN112717414A (en) Game scene editing method and device, electronic equipment and storage medium
US20220230375A1 (en) Three-dimensional avatar generation and customization
US20130249914A1 (en) Method for Manipulating Three-Dimensional Voxel Data for On-Screen Visual
CN108230430B (en) Cloud layer mask image processing method and device
US20180253886A1 (en) Texturing of a three-dimensional (3d) model by uv map in-painting
CN112950753B (en) Virtual plant display method, device, equipment and storage medium
CN113908542A (en) Method and device for processing terrain data in game
CN110989979A (en) Terrain generation method based on UE engine
CN113935891B (en) Pixel-style scene rendering method, device and storage medium
CN114820980A (en) Three-dimensional reconstruction method and device, electronic equipment and readable storage medium
CN114832375A (en) Ambient light shielding processing method, device and equipment
WO2022022260A1 (en) Image style transfer method and apparatus therefor
CN110827400B (en) Method and device for generating model of object in three-dimensional scene and terminal
CN114219888A (en) Method and device for generating dynamic silhouette effect of three-dimensional character and storage medium
CN115035231A (en) Shadow baking method, shadow baking device, electronic apparatus, and storage medium
KR101189687B1 (en) Method for creating 3d character
CN101482978B (en) ENVI/IDL oriented implantation type true three-dimensional stereo rendering method

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