Information processing method and device, readable storage medium and electronic device

By analyzing the color data of the animation frames of virtual game characters to determine the terrain type and render decals, the problem of the limited generation of footprints for virtual game characters was solved, thus improving the realism and experience of the game.

CN114419207BActive Publication Date: 2026-02-13NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111648262.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-29
Publication Date
2026-02-13
Estimated Expiration
2041-12-29

AI Technical Summary

Technical Problem

In existing technologies, the footprints generated by virtual game characters on different surfaces cannot be effectively distinguished, resulting in significant limitations in decal generation and an inability to realistically simulate the effect of characters stepping on different surfaces.

Method used

By acquiring the target animation frames of virtual game characters, analyzing their target position color data in the game scene, using the color data to determine the terrain type, and rendering and displaying decals on the corresponding terrain, the dependence on terrain grid conversion is avoided.

Benefits of technology

It enables precise generation of decals for virtual game characters on different surfaces, reducing limitations and improving the realism and immersive experience of the game.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114419207B_ABST
    Figure CN114419207B_ABST
Patent Text Reader

Abstract

The application discloses an information processing method and device, a readable storage medium and an electronic device. The method comprises the following steps: obtaining a target animation frame of a virtual game character, wherein the target animation frame is used to represent a target position of a target part of the virtual game character contacting a terrain in a game scene; obtaining target color data corresponding to the target animation frame in a planar image of the game scene; determining a target terrain to which the target position belongs based on the target color data; and rendering and displaying a target decal corresponding to the target part of the virtual game character on the target terrain. The application solves the technical problem of large limitation of generating corresponding decals for parts of a virtual game character.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computer, in particular to an information processing method and device, readable storage medium and electronic device. BACKGROUND

[0002] At present, in order to enhance the experience and reality of the game, the virtual game character in the game will leave footprints in walking, and the footprints generated by stepping on different ground should also be different.

[0003] In the related art, it is usually determined whether the virtual game character steps on the sand by acquiring the terrain layer, and if it is the sand, the footprints are generated. However, for the model grid converted from the terrain grid, it is unable to distinguish whether the character steps on the sand, thereby there is a problem of large limitation of generating corresponding decals for the parts of the virtual game character.

[0004] For the above problem of large limitation of generating corresponding decals for the parts of the virtual game character, there is no effective solution at present. SUMMARY

[0005] Embodiments of the present application provide an information processing method and device, readable storage medium and electronic device to at least solve the technical problem of large limitation of generating corresponding decals for the parts of the virtual game character.

[0006] According to an embodiment of the present application, an information processing method is provided, which comprises: acquiring a target animation frame of a virtual game character, wherein the target animation frame is used to represent a target part of the virtual game character contacting a target position of a terrain in a game scene; acquiring target color data corresponding to the target animation frame in a planar image of the game scene; determining a target terrain to which the target position belongs based on the target color data; and rendering and displaying a target decal corresponding to the target part of the virtual game character on the target terrain.

[0007] Optionally, the target image is acquired, wherein the target image is obtained by shooting the game scene by a virtual camera; and the planar image is acquired based on the target image.

[0008] Optionally, the planar image is acquired based on the target image, comprising: converting the target image into the planar image based on a first two-dimensional map.

[0009] Optionally, the planar image is converted based on the first two-dimensional map, comprising: merging the target image into a target map, wherein the target map is used to carry the target image; writing pixels in the merged target map into the first two-dimensional map to obtain a second two-dimensional map; and determining the second two-dimensional map as the planar image.

[0010] Optionally, a virtual camera is created at the preset position of the game scene.

[0011] Optionally, a terrain bounding box of the game scene is acquired; and a top center of the terrain bounding box is determined as the preset position.

[0012] Optionally, a three-dimensional vector is determined based on the center of the terrain bounding box; and a position represented by the three-dimensional vector is determined as the top center of the terrain bounding box.

[0013] Optionally, the three-dimensional vector is determined based on the center of the terrain bounding box, including: a sum of a coordinate corresponding to the center of the terrain bounding box on a target coordinate axis and a length of a center axis of the terrain bounding box on the target coordinate axis is determined as a target coordinate corresponding to the target coordinate axis; and the three-dimensional vector is determined based on the target coordinate.

[0014] Optionally, the target color data corresponding to the target animation frame is acquired, including: red channel data, green channel data and blue channel data corresponding to the target position are acquired; and the target terrain to which the target position belongs is determined based on the target color data, including: in response to the red channel data being greater than the green channel data, and the green channel data being greater than the blue channel data, it is determined that the target position belongs to the target terrain.

[0015] Optionally, the target animation frame of the virtual game character is acquired, including: an animation clip of the virtual game character is acquired; a target identifier is identified from the animation clip, and an animation frame identified by the target identifier is determined as the target animation frame.

[0016] Optionally, the target terrain is a terrain mesh with a number of faces lower than a target threshold.

[0017] According to an embodiment of the present application, an information processing device is provided, which comprises a first acquisition unit configured to acquire a target animation frame of a virtual game character, wherein the target animation frame is used to represent a target position at which a target part of the virtual game character contacts a terrain in a game scene; a second acquisition unit configured to acquire target color data corresponding to the target animation frame in a planar image of the game scene; a determination unit configured to determine that the target position is on a target terrain based on the target color data; and a rendering display unit configured to render and display a target decal corresponding to the target part of the virtual game character on the target terrain.

[0018] In order to achieve the above-mentioned purpose, according to an embodiment of the present application, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, wherein when the computer program is run by a processor, the computer readable storage medium controls a device where the computer readable storage medium is located to execute the information processing method of the embodiment of the present application.

[0019] In order to achieve the above object, according to one of the embodiments of the present application, an electronic device is provided, comprising a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute the information processing method in any of the above.

[0020] In at least some embodiments of the present application, a target animation frame of a virtual game character is obtained, wherein the target animation frame is used to represent a target position of a target part of the virtual game character contacting a terrain in a game scene; target color data corresponding to the target animation frame is obtained in a planar image of the game scene; a target terrain to which the target position belongs is determined based on the target color data; and a target decal corresponding to the target part of the virtual game character is rendered and displayed on the target terrain. That is, the color data corresponding to the position of the virtual game character is obtained to determine the target terrain, and the target decal corresponding to the target part of the virtual game character is rendered and displayed, so as to generate the decal corresponding to the terrain for the virtual game character, thereby reducing the limitation of generating the decal corresponding to the part of the virtual game character, and further solving the technical problem of large limitation of generating the decal corresponding to the part of the virtual game character. BRIEF DESCRIPTION OF DRAWINGS

[0021] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and serve to explain the principles of the application. In the drawings:

[0022] Figure 1 is a hardware structure block diagram of a mobile terminal according to an information processing method of one of the embodiments of the present application;

[0023] Figure 2 is a flowchart of an information processing method according to one of the embodiments of the present application;

[0024] Figure 3 is a schematic diagram of a software operation interface for adding an animation event to a character footprint according to one of the embodiments of the present application;

[0025] Figure 4 is a schematic diagram of hanging a prefabricated group triggering a footprint decal on a character footprint according to one of the embodiments of the present application;

[0026] Figure 5 is a schematic diagram of creating an orthogonal camera at the top center of a scene according to one of the embodiments of the present application;

[0027] Figure 6 is a schematic diagram of rendering a planar image of a scene according to one of the embodiments of the present application;

[0028] Figure 7is a schematic diagram of a terrain color sampling software operation interface according to an embodiment of the present application;

[0029] Figure 8 is a schematic diagram of a footprint mapping according to an embodiment of the present application;

[0030] Figure 9 is a schematic diagram of generating a footprint effect according to an embodiment of the present application.

[0031] Figure 10 is a structural block diagram of an information processing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to make the personnel in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.

[0033] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0034] According to one of the embodiments of the present application, an embodiment of an information processing method is provided. It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.

[0035] This method embodiment can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, the mobile terminal can be a smartphone (such as an Android phone, iOS phone, etc.), tablet computer, PDA, mobile Internet Device (MID), PAD, game console, and other terminal devices. Figure 1 This is a hardware structure block diagram of a mobile terminal for an information processing method according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a central processing unit (CPU), graphics processing unit (GPU), digital signal processing (DSP) chip, microprocessor (MCU), programmable logic device (FPGA), neural network processor (NPU), tensor processor (TPU), artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data are also shown. Optionally, the mobile terminal may further include a transmission device 106 for communication functions, an input / output device 108, and a display device 110. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0036] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the information processing method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the aforementioned information processing method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0037] The transmission device 106 is configured to receive or send data via a network. The network can include a wireless network provided by a communication provider of the mobile terminal. In one embodiment, the transmission device 106 includes a network interface controller (NIC) that is configured to connect to other network devices via a base station to communicate with the Internet. In one embodiment, the transmission device 106 can be a radio frequency (RF) module that is configured to communicate with the Internet via a wireless network.

[0038] The input of the input / output device 108 can be from a human interface device (HID). For example, a keyboard and a mouse, a gamepad, other special game controllers (e.g., a steering wheel, a fishing rod, a dance pad, a remote controller, etc.). Some human interface devices can provide both input and output functions. For example, a force feedback and vibration of a gamepad, an audio output of a controller, etc.

[0039] The display device 110 can be, for example, a heads-up display (HUD), a touch screen liquid crystal display (LCD), and a touch display (also referred to as a "touch screen" or "touch display screen"). The liquid crystal display can enable a user to interact with a user interface of the mobile terminal. In some embodiments, the mobile terminal has a graphical user interface (GUI) that a user can interact with through finger contacts and / or gestures on the touch-sensitive surface. The user interactions can optionally include creating web pages, drawing, word processing, creating electronic documents, games, video conferencing, instant messaging, email, voice communication, digital video playing, digital music playing, and / or web browsing, etc. Executable instructions for performing the user interactions are configured / stored in one or more computer program products or readable storage media that are executable by the one or more processors.

[0040] In the present embodiment, an information processing method running on the mobile terminal is provided, Figure 2 is a flowchart of an information processing method according to an embodiment of the present application. As shown in Figure 2 the method includes the following steps:

[0041] In step S202, a target animation frame of a virtual game character is obtained, wherein the target animation frame is used to represent a target position of a target part of the virtual game character contacting a terrain in a game scene.

[0042] In the technical solution provided in the step S202 of the present application, the target animation frame can be a frame in which a virtual game character steps on the ground in a game scene, the target part can be a foot of the virtual game character, or other part that needs to be rendered and displayed with a corresponding decal on a target terrain, the game scene can be an environment in which the virtual game character is located in the game, and the target position can be a specific position of the virtual game character in the game scene.

[0043] Optionally, the target animation frame can be automatically intercepted by software or a script.

[0044] Optionally, the terrain type and the specific position of the virtual game character in the game scene are determined according to the obtained target animation frame, and a trigger event is added to the corresponding target animation frame. The trigger event can be a footstep event of the virtual game character, or other event that needs to be triggered.

[0045] In step S204, target color data corresponding to the target animation frame is obtained in a planar image of the game scene.

[0046] In the technical solution provided in the step S204 of the present application, the planar image of the game scene can be a two-dimensional image of the environment in which the virtual game character is located in the game, and the target color data can be the color of the specific position of the virtual game character.

[0047] Optionally, the planar image of the game scene can be obtained by sampling using a script to create a virtual camera at the top center of the game scene. The virtual camera can be a virtual orthogonal camera, which can also be referred to as an orthogonal camera. The target color data can be determined by the color three primary colors (RGB) values of a color map of the target position of the virtual game character, in which R represents red channel data, G represents green channel data, and B represents blue channel data.

[0048] Optionally, a virtual camera is created at the center of the game scene by a script, the game scene is sampled by the virtual orthogonal camera, the planar image of the game scene is obtained, and the target color data corresponding to the target animation frame of the virtual game character is determined and sampled in the planar image of the game scene.

[0049] In step S206, a target terrain to which the target position belongs is determined based on the target color data.

[0050] In the technical solution provided in the step S206 of the present application, the target terrain can be a type of ground on which the virtual game character needs to generate a footprint in the game scene.

[0051] Optionally, the target terrain to which the target position belongs is determined by judging the target color data of the target position of the virtual game character.

[0052] For example, the color of sand is more yellow than other ground, so whether the virtual game character steps on the sand can be determined by sampling the RGB value of the colorMap of the target position of the virtual game character in the shader. When the R value of the colorMap is greater than the G value and the G value is greater than the B value, the color tends to be yellow, and it can be determined that the target position belongs to the sand ground.

[0053] Step S208, rendering and displaying the target decal corresponding to the target part of the virtual game character on the target terrain.

[0054] In the technical solution provided by the above step S208 of the present application, the target decal can be a decal on the foot of the virtual game character.

[0055] Optionally, after determining the target terrain where the virtual game character is located, the target decal corresponding to the target part is rendered and displayed.

[0056] Optionally, the rendering and display of the target decal corresponding to the target part can be determined by the weight (inSand) value of the linear difference value mixing, wherein when inSand is 1, the pixel result after sampling of the footprint map is returned in the shader, and when inSand is 0, the shader returns 0 and does not display any rendering performance. Through the above steps S202 to S208 of the present application, the target animation frame of the virtual game character is obtained, wherein the target animation frame is used to represent the target position of the target part of the virtual game character contacting the terrain in the game scene; the target color data corresponding to the target animation frame is obtained in the planar image of the game scene; the target terrain to which the target position belongs is determined based on the target color data; and the target decal corresponding to the target part of the virtual game character is rendered and displayed on the target terrain. That is, the present application determines the target terrain based on the color data corresponding to the position of the virtual game character, renders and displays the target decal corresponding to the target part of the virtual game character, achieves the purpose of generating the decal corresponding to the terrain for the virtual game character, thereby realizing the technical effect of reducing the limitation of generating the decal corresponding to the part of the virtual game character, and further solving the technical problem of large limitation of generating the decal corresponding to the part of the virtual game character.

[0057] The above method of the embodiment will be further introduced below.

[0058] As an optional implementation, step S202, obtaining a target image, wherein the target image is obtained by shooting the game scene by a virtual camera; and the planar image is obtained based on the target image.

[0059] In this embodiment, the target image can be an image captured by a virtual camera on a game scene in which the virtual game character is located, wherein the virtual camera can be an orthographic camera and located at the top center of the game scene.

[0060] Optionally, a virtual camera is created by a script, the position of the virtual camera is set at the top center of the game scene, the virtual game character is captured by the virtual camera to obtain the target image, the target image is placed in a two-dimensional map for rendering, pixels are read from the rendered map and written into the two-dimensional map to obtain the planar image.

[0061] As an optional implementation, the planar image is obtained based on the target image, comprising: converting the target image into the planar image based on the first two-dimensional map.

[0062] In this embodiment, a two-dimensional map is newly created, and the rendered map is placed in the two-dimensional map to obtain the first two-dimensional map, wherein the rendered map can be obtained by: newly creating a rendered map, merging the target image of the virtual game character with the rendered map, and the merged map is the rendered map.

[0063] As an optional implementation, the target image is converted into the planar image based on the first two-dimensional map, comprising: merging the target image into a target map, wherein the target map is used to carry the target image; writing the pixels in the merged target map into the first two-dimensional map to obtain a second two-dimensional map; and determining the second two-dimensional map as the planar image.

[0064] In this embodiment, the target map can be a rendered map used to carry the target image captured by the virtual camera, and merging the target image into the target map can be including information used to generate the target image in the target map, so that the information of the target image is attached to the target map, that is, the target map is equivalent to the medium in which the target image is located, in this case, the pixel information read from the target map is written in the first two-dimensional map to obtain the second two-dimensional map, and then the second two-dimensional map is the planar image, thereby achieving the purpose of converting the target image into the planar image.

[0065] As an optional implementation, the virtual camera is created at a preset position of the game scene.

[0066] In this embodiment, the virtual camera is created by a script, and the position of the virtual camera is set at the preset position of the game scene, and optionally, the preset position can be the top center of the game scene, wherein the virtual camera can be an orthographic camera.

[0067] Optionally, the embodiment can create a virtual camera through a script, and can be to create a virtual camera; if there is no virtual camera for rendering, a game object is added in the scene, and a component is added to the game object, wherein the component type can be a virtual camera.

[0068] Optionally, the position of the virtual camera can be determined, that is, the top center of the game scene, which can include obtaining the terrain bounding box of the target terrain in the game scene, and assigning a three-dimensional vector (x, y, z) to the camera; a three-dimensional vector (x1, y1, z1) is newly created; (x1, y1, z1) is assigned to (x, y, z), wherein the x1 coordinate of the newly created three-dimensional vector (x1, y1, z1) is the X coordinate of the center of the terrain bounding box of the target terrain, the y1 coordinate is the Y coordinate of the center of the bounding box plus the actual length of the Y axis of the bounding box, and the z1 coordinate is the Z coordinate of the center of the terrain bounding box of the target terrain. As an optional implementation, the terrain bounding box of the game scene is obtained; the top center of the terrain bounding box is determined as the top center of the game scene.

[0069] In this embodiment, the top center of the terrain bounding box can be the position of the orthographic camera, wherein the top center can be determined by the X coordinate of the center of the terrain bounding box, the Y coordinate of the center of the terrain bounding box plus the actual length of the Y axis of the terrain bounding box, and the Z coordinate of the center of the terrain bounding box.

[0070] Optionally, the terrain bounding box in the game scene is obtained by a Get Terrain Bounds method.

[0071] As an optional implementation, a three-dimensional vector is determined based on the center of the terrain bounding box; and the position represented by the three-dimensional vector is determined as the top center of the terrain bounding box.

[0072] In this embodiment, determining the three-dimensional vector based on the center of the terrain bounding box can include that the center of one side of the terrain bounding box is the X coordinate, the center of the other side of the terrain bounding box is the Z coordinate, and the Y coordinate of the terrain bounding box plus the actual length of the Y axis of the terrain bounding box is the Y coordinate, and the center of the terrain bounding box can be determined through the three-dimensional vector (X, Y, Z).

[0073] As an optional implementation, determining the three-dimensional vector based on the center of the terrain bounding box includes: determining the sum of the coordinates of the center of the terrain bounding box on the target coordinate axis and the length of the center axis of the terrain bounding box on the target coordinate axis as the target coordinate corresponding to the target coordinate axis; and determining the three-dimensional vector based on the target coordinate, so that the height of the virtual camera is greater than the height of the terrain bounding box.

[0074] In this embodiment, the target coordinate axis can be the Y axis, the sum of the Y coordinate corresponding to the Y axis of the terrain bounding box and the actual length of the center axis corresponding to the Y axis of the terrain bounding box can be obtained, and the sum is taken as the target coordinate of the three-dimensional vector. The target coordinate can be the Y coordinate corresponding to the Y axis, and then the three-dimensional vector is determined based on the Y coordinate, so that the virtual camera height is just above the height of the bounding box.

[0075] As an optional implementation, in step S204, the target color data corresponding to the target animation frame is obtained, including: obtaining red channel data, green channel data and blue channel data corresponding to the target position; determining the target terrain to which the target position belongs based on the target color data, including: in response to the red channel data being greater than the green channel data, and the green channel data being greater than the blue channel data, it is determined that the target terrain to which the target position belongs.

[0076] In this embodiment, according to the judgment on the target color data corresponding to the target animation frame of the virtual game character, the terrain type to which the target position belongs can be determined. When the red channel data is greater than the green channel data, and the green channel data is greater than the blue channel data, it can be judged that the color tends to be yellow, so that the target terrain of the virtual game character tends to be yellow, for example, the target terrain is sand.

[0077] As an optional implementation, the target animation frame of the virtual game character is obtained, including: obtaining an animation clip of the virtual game character; identifying a target identifier from the animation clip, and determining an animation frame identified by the target identifier as the target animation frame.

[0078] In this embodiment, the target identifier can be an identifier of a terrain type in which the virtual game character is located and in which footprints need to be generated. The terrain type can include grass, snow and sand, etc., which are not limited here.

[0079] For example, when a segment that needs to generate footprints appears in the animation clip, the target identifier identifies the animation frame and determines it as the target animation frame.

[0080] As an optional implementation, in step S206, the target terrain is a terrain mesh with a face number lower than a target threshold.

[0081] In this embodiment, the target terrain can be a static model mesh with a lower face number.

[0082] In the embodiment, a target animation frame of a virtual game character is acquired, where the target animation frame is used to represent a target position of a target part of the virtual game character contacting a terrain in a game scene; target color data corresponding to the target animation frame is acquired in a planar image of the game scene; a target terrain to which the target position belongs is determined based on the target color data; and a target decal corresponding to the target part of the virtual game character is rendered and displayed on the target terrain. That is, the application finds an animation frame in which footprints need to appear in an animation segment, adds a footprint triggering event to the corresponding animation frame, creates a virtual camera at the top center of the scene, acquires a planar image of the game scene by using the virtual camera, determines a specific position where the virtual game character is located in the planar image of the game scene, samples and judges color data of the position, determines a terrain where the virtual game character is located, renders and displays a target decal corresponding to the target part of the virtual game character, and achieves the purpose of generating a decal corresponding to the terrain for the game character, thereby reducing the limitation of generating a decal corresponding to a part of the virtual game character, and further solving the technical problem of the limitation of generating a decal corresponding to a part of the virtual game character.

[0083] The technical solutions of the embodiments of the application will be further described below in combination with preferred embodiments.

[0084] At present, in order to enhance the experience and reality of a game, it is required that a game character in the game has footprints when stepping on a sand ground or the like, and the footprints are not obvious or do not exist when stepping on a grass ground.

[0085] In the prior art, footprints are mainly made by triggering an animation event according to animation footstep stepping on the ground in a game engine (Unity), and a decal material for generating footprints is hung on the bottom of the character, and the footprints effect is triggered by the animation event.

[0086] In another prior art, a terrain layer (Terrain layer) is acquired by using a game engine script (Unity API), so as to determine whether a place stepped on by a character is a sand ground, and footprints are generated if the place is a sand ground.

[0087] However, the Unity terrain performance is poor, and the terrain used in the game of the application will finally convert a terrain grid into a model grid, and the converted terrain cannot acquire information of a place stepped on by a character through the Unity API, and thus it is unable to determine whether the character steps on a sand ground.

[0088] However, this application proposes an information processing method that does not require obtaining a terrain layer through an engine to determine the terrain where the character model is located. Instead, it applies a decal material to the character's feet to generate footprints, triggers the footprint effect through an animation event, pre-baks a scene plan view, and determines whether the character is standing on sand based on the scene plan view information. If the character is on sand, a footprint decal is generated and the corresponding footprint is displayed. This reduces the limitations of determining the terrain where the virtual game character is located and solves the technical problem of the large limitations in generating corresponding decals for parts of the virtual game character.

[0089] The next step further describes the steps for creating in-game model terrain footprints provided by this invention. These steps include:

[0090] The first step is to find the frame in the character's animation clip where the character's foot touches the ground, and add a trigger event (footStep) to the corresponding frame.

[0091] like Figure 3 As shown, Figure 3 This is a schematic diagram of a software operation interface for adding animation events to a character's footprint according to an embodiment of the present invention. In the Event field, the start and end points of the time segment to which the animation needs to be added are selected, and footStep is entered in the String field.

[0092] The second step is to attach a pre-made set to the character's feet to trigger the footprint decals.

[0093] like Figure 4 As shown, Figure 4 This is a schematic diagram of attaching a pre-made set for triggering footprint decals to the feet of a character according to an embodiment of the present invention. The pre-made set for triggering footprint decals is attached to the feet of a virtual game character.

[0094] The third step is to use a script to create an orthogonal camera at the top center of the scene.

[0095] like Figure 5 As shown, Figure 5 This is a schematic diagram of creating an orthogonal camera at the top center of a scene according to an embodiment of the present invention. First, a camera is created using a script and set as an orthogonal camera. Then, the bounding box range of the terrain is obtained, and the position of the orthogonal camera is set at the top center of the bounding box.

[0096] Optionally, the script creates a virtual camera, which may include: creating a camera; if there is no camera for rendering, adding a new game object in the scene and adding a component on the game object, wherein the component type can be a camera; and setting the camera to an orthographic camera.

[0097] Optionally, the step of determining the position of the virtual camera, i.e. the top center of the game scene, can comprise: obtaining a terrain bounding box of a target terrain in the game scene, and assigning a three-dimensional vector (x, y, z) to the camera; creating a new three-dimensional vector (x1, y1, z1); and assigning (x1, y1, z1) to (x, y, z), wherein the x1 coordinate of the newly created three-dimensional vector (x1, y1, z1) is the X coordinate of the center of the terrain bounding box of the target terrain, the y1 coordinate is the Y coordinate of the center of the bounding box plus the actual length of the Y axis of the bounding box, and the z1 coordinate is the Z coordinate of the center of the terrain bounding box of the target terrain.

[0098] As shown in Figure 6 , Figure 6 is a schematic diagram of rendering a scene plan according to an embodiment of the present application. First, a new rendering map is created, and an image taken by an orthogonal camera is placed in the rendering map. Then, a new two-dimensional map is created, and the rendering map above is placed in the two-dimensional map. Saving the two-dimensional map can obtain a plan of the scene.

[0099] Optionally, the step of creating a new rendering map can comprise: setting the resolution, format, read-write mode, etc. of the new rendering map.

[0100] Optionally, the step of creating a new two-dimensional map can comprise: setting the resolution, format, read-write mode, etc. of the new two-dimensional map.

[0101] Optionally, the step of writing the byte array into a file and storing it according to the set saving path.

[0102] The fifth step is to sample the plan of the scene in the decal shader.

[0103] The color sampler is used in the shader to sample the entire game scene rendered by the script above.

[0104] The sixth step is to sample the color of the position of the character to determine whether the character is standing on sand.

[0105] As shown in Figure 7 , Figure 7 is a schematic diagram of a terrain color sampling software operation interface according to an embodiment of the present application. The color of sand is more yellow than that of other terrains, so the color three-primary color (RGB) value of the color map sampled by the position of the character can be used to determine whether the character is standing on sand, wherein R represents red channel data, G represents green channel data, and B represents blue channel data.

[0106] Optionally, when the R value of the colorMap is greater than the G value and the G value is greater than the B value, the color tends to be yellow.

[0107] Step 7, rendering the footprint decal.

[0108] As Figure 8 shown, Figure 8 is a schematic diagram of a footprint decal according to an embodiment of the present application, which can be determined according to the weight (inSand) value of linear difference blending, wherein when inSand is 1, the shader finally renders and returns the pixel result after sampling the footprint decal, and when inSand is 0, the shader returns 0 and does not display any rendering performance.

[0109] Optionally, the footprint decal is rendered when the inSand value is equal to 1.

[0110] According to the method for generating a footprint of a model terrain in a game provided by the present application, first, an animation frame in which the footprint needs to appear is found in an animation segment, and a footprint triggering event is added to the corresponding animation frame, then a virtual camera is created at the top center of a scene, a planar image of the game scene is obtained by using the virtual camera, the specific position where the virtual game character is located is determined in the planar image of the game scene, and the color data of the position is sampled and judged, so as to determine the terrain where the virtual game character is located, and a target decal corresponding to the target part of the virtual game character is rendered and displayed, thereby achieving the purpose of generating a decal corresponding to the terrain for the game character, as Figure 9 shown, Figure 9 is a schematic diagram of generating a footprint effect according to an embodiment of the present application, thereby realizing the technical effect of reducing the limitation of judging the terrain where the virtual game character is located, and solving the technical problem of large limitation of generating a corresponding decal for the part of the virtual game character.

[0111] Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and a general hardware platform as required, and of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk), and includes a plurality of instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the method described in each embodiment of the present application.

[0112] Embodiments of the present application also provide an information processing device for implementing the above-mentioned embodiments and preferred embodiments, which have been described above. As used below, the terms "unit" and "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, hardware, or a combination of software and hardware can also be implemented and contemplated.

[0113] Figure 10 is a structural block diagram of an information processing device according to an embodiment of the present application. As shown in Figure 10 the information processing device 10 can include a first acquisition unit 1001, a second acquisition unit 1002, a determination unit 1003, and a rendering display unit 1004.

[0114] The first acquisition unit 1001 is configured to acquire a target animation frame of a virtual game character, wherein the target animation frame is used to indicate a target position of a target part of the virtual game character contacting a terrain in a game scene.

[0115] The second acquisition unit 1002 is configured to acquire target color data corresponding to the target animation frame in a planar image of the game scene.

[0116] The determination unit 1003 is configured to determine that the target position is on a target terrain based on the target color data.

[0117] The rendering display unit 1004 is configured to render and display a target decal corresponding to the target part of the virtual game character on the target terrain.

[0118] Optionally, the device further includes a third acquisition unit configured to acquire a target image, wherein the target image is obtained by a virtual camera shooting the game scene; and a fourth acquisition unit configured to acquire the planar image based on the target image.

[0119] Optionally, the fourth acquisition unit includes an acquisition module configured to acquire the planar image based on the target image; and a conversion module configured to convert the target image into the planar image based on a first two-dimensional decal. Optionally, the conversion module is configured to merge the target image into a target decal, wherein the target decal is used to carry the target image; write pixels in the merged target decal into the first two-dimensional decal to obtain a second two-dimensional decal; and determine the second two-dimensional decal as the planar image.

[0120] Optionally, the third acquisition unit includes a creation module configured to create the virtual camera at a preset position of the game scene.

[0121] Optionally, the creating module comprises a sub-acquiring module configured to acquire a terrain bounding box of the game scene; and a sub-determining module configured to determine a top center of the terrain bounding box as the preset position, such as a top center of the game scene.

[0122] Optionally, the apparatus further comprises a first determining unit configured to determine a three-dimensional vector based on the center of the terrain bounding box; and a second determining unit configured to determine a position represented by the three-dimensional vector as the top center of the terrain bounding box.

[0123] Optionally, the first determining unit comprises a first determining module configured to determine a target coordinate corresponding to a target coordinate axis as a sum of a coordinate of the center of the terrain bounding box on the target coordinate axis and a length of a center axis of the terrain bounding box on the target coordinate axis; and a second determining module configured to determine the three-dimensional vector based on the target coordinate, wherein a target vector in the three-dimensional vector is configured to make the height of the virtual camera greater than the height of the terrain bounding box.

[0124] Optionally, the second acquiring unit 1002 comprises a second acquiring module configured to acquire red channel data, green channel data and blue channel data corresponding to the target position; and a third determining module configured to determine that the target position belongs to the target terrain in response to the red channel data being greater than the green channel data, and the green channel data being greater than the blue channel data.

[0125] Optionally, the first acquiring unit 1001 comprises a third acquiring module configured to acquire an animation clip of the virtual game character; and a processing module configured to identify a target identifier from the animation clip, and determine an animation frame identified by the target identifier as the target animation frame.

[0126] Optionally, the target terrain is a terrain mesh with a number of faces lower than a target threshold.

[0127] In the information processing apparatus of this embodiment, first, the target animation frame of the virtual game character is acquired by the first acquiring unit, wherein the target animation frame is configured to represent that a target part of the virtual game character contacts a target position of terrain in a game scene; second, target color data corresponding to the target animation frame is acquired in a planar image of the game scene by the second acquiring unit; and finally, the target position is determined to be on the target terrain based on the target color data by the determining unit, and the target decal corresponding to the target part of the virtual game character is rendered and displayed on the target terrain by the rendering and displaying unit, so that the purpose of generating the decal corresponding to the terrain for the game character is achieved, thereby realizing the technical effect of reducing the limitation of generating the decal corresponding to the terrain for the part of the virtual game character, and further solving the technical problem of large limitation of generating the decal corresponding to the terrain for the part of the virtual game character.

[0128] It should be noted that the above various units and modules can be implemented by software or hardware, and for the latter, the implementation can be achieved by the following ways, but is not limited to: the above units and modules are located in the same processor; or the above various units and modules are located in different processors in any combination.

[0129] Embodiments of the present application also provide a non-volatile storage medium having a computer program stored therein, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.

[0130] Optionally, in the embodiment, the above non-volatile storage medium can be configured to store a computer program for executing the following steps:

[0131] S1, obtaining a target animation frame of a virtual game character, wherein the target animation frame is used to represent a target position of a target part of the virtual game character contacting a terrain in a game scene;

[0132] S2, obtaining target color data corresponding to the target animation frame in a planar image of the game scene;

[0133] S3, determining a target terrain to which the target position belongs based on the target color data;

[0134] S4, rendering and displaying a target decal corresponding to the target part of the virtual game character on the target terrain.

[0135] Optionally, in the embodiment, the above non-volatile storage medium can include but is not limited to: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various storage media that can store computer programs.

[0136] Embodiments of the present application also provide an electronic device comprising a memory having a computer program stored therein and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.

[0137] Optionally, the above electronic device can further comprise a transmission device connected to the processor and an input and output device connected to the processor.

[0138] Optionally, in the embodiment, the processor can be configured to execute the following steps by the computer program:

[0139] S1, acquire a target animation frame of a virtual game character, wherein the target animation frame is used to represent a target position of a target part of the virtual game character contacting a terrain in a game scene;

[0140] S2, acquire target color data corresponding to the target animation frame in a planar image of the game scene;

[0141] S3, determine a target terrain to which the target position belongs based on the target color data;

[0142] S4, render and display a target decal corresponding to the target part of the virtual game character on the target terrain.

[0143] Optionally, specific examples in the embodiments can refer to the examples described in the above embodiments and optional implementation manners, and the embodiments will not be described here again.

[0144] The serial numbers of the above embodiments of the application are only for description, and do not represent the advantages and disadvantages of the embodiments.

[0145] In the above embodiments of the application, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0146] In several embodiments provided in the present application, it should be understood that the disclosed technical contents can be implemented by other manners. Among them, the above-described device embodiments are only schematic, for example, the division of the units can be a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be through some interface, indirect coupling or communication connection between units or modules, which can be electrical or other forms.

[0147] The units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or can be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0148] In addition, each functional unit in each embodiment of the application can be integrated in a processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The above integrated unit can be realized in the form of hardware or in the form of software functional unit.

[0149] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in other words, the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to make a computer device (which can be a personal computer, a server or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.

[0150] The above is only the preferred embodiment of the present application, and it should be pointed out that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.

Claims

1. An information processing method characterized by comprising: The method comprises: obtaining a target animation frame of a virtual game character, wherein the target animation frame is used to represent a target position of a target part of the virtual game character contacting a terrain in a game scene; obtaining target color data corresponding to the target animation frame in a planar image of the game scene, wherein the target color data comprises red channel data, green channel data and blue channel data; determining a target terrain to which the target position belongs based on the target color data, wherein the target terrain is a static model grid with a face number lower than a target threshold; rendering a target decal corresponding to the target part of the virtual game character on the target terrain; determining the target terrain to which the target position belongs based on the target color data comprises: in response to the red channel data being greater than the green channel data and the green channel data being greater than the blue channel data, determining that the target position belongs to the target terrain; obtaining the target color data corresponding to the target animation frame in the planar image of the game scene comprises: rendering the planar image of the game scene; performing color sampling on the rendered planar image using a color sampler in a shader, and sampling the color of the target position of the virtual game character to obtain color three-primary color values of a color map sampled for the target position of the virtual game character; and judging the color three-primary color values to obtain the target color data; The method further comprises: creating a virtual camera at a top center of the game scene, wherein the virtual camera is an orthographic camera, and the virtual camera is used to take a picture of the game scene to obtain the planar image of the game scene; The method further comprises: obtaining a target image, wherein the target image is obtained by taking a picture of the game scene by the virtual camera; merging the target image into a target texture, wherein the target texture is used to carry the target image; writing pixels in the merged target texture into a first two-dimensional texture to obtain a second two-dimensional texture; and determining the second two-dimensional texture as the planar image.

2. The method of claim 1, wherein, The method further comprises: obtaining a terrain bounding box of the game scene; determining a top center of the game scene as a top center of the terrain bounding box.

3. The method of claim 2, wherein, The method further comprises: determining a three-dimensional vector based on a center of the terrain bounding box; determining a position represented by the three-dimensional vector as the top center of the terrain bounding box.

4. The method of claim 3, wherein, Determining a three-dimensional vector based on a center of the terrain bounding box comprises: determining a target coordinate corresponding to a target coordinate axis as a sum of a coordinate of the center of the terrain bounding box on the target coordinate axis and a length of a center axis of the terrain bounding box on the target coordinate axis; determining the three-dimensional vector based on the target coordinate.

5. The method of claim 1, wherein, Obtaining a target animation frame of a virtual game character comprises: obtaining an animation clip of the virtual game character; identifying a target identifier from the animation clip, and determining an animation frame identified by the target identifier as the target animation frame.

6. An information processing apparatus, characterized by comprising: The method comprises: The first obtaining unit is configured to obtain a target animation frame of a virtual game character, wherein the target animation frame is used to represent a target position of a target part of the virtual game character contacting a terrain in a game scene. The second obtaining unit is configured to obtain target color data corresponding to the target animation frame in a planar image of the game scene, wherein the target color data comprises red channel data, green channel data and blue channel data. The determining unit is configured to determine a target terrain to which the target position belongs based on the target color data, wherein the target terrain is a static model mesh with a face number lower than a target threshold. The rendering and displaying unit is configured to render and display a target decal corresponding to the target part of the virtual game character on the target terrain. The determining unit is further configured to determine that the target position belongs to the target terrain in response to the red channel data being greater than the green channel data and the green channel data being greater than the blue channel data. The second obtaining unit is further configured to obtain the target color data corresponding to the target animation frame in the planar image of the game scene by the following steps: rendering the planar image of the game scene; performing color sampling on the rendered planar image by using a color sampler in a shader, and sampling a color of the target position of the virtual game character to obtain color three-primary color values of a color map sampled for the target position of the virtual game character; and judging the color three-primary color values to obtain the target color data. The device is further configured to create a virtual camera at a top center of the game scene, wherein the virtual camera is an orthographic camera, and the virtual camera is used to take a picture of the game scene to obtain the planar image of the game scene. The device is further configured to obtain a target image, wherein the target image is obtained by taking a picture of the game scene by using the virtual camera; merge the target image to a target texture, wherein the target texture is used to carry the target image; write pixels in the merged target texture into a first two-dimensional texture to obtain a second two-dimensional texture; and determine the second two-dimensional texture as the planar image.

7. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, wherein the computer program is configured to be executed by the processor to perform the method in any one of claims 1 to 5. 8.An electronic device comprising a memory and a processor, the electronic device comprising: The memory stores a computer program, and the processor is configured to execute the computer program to perform the method in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Robot adaptive terrain classification method and system and computer readable storage medium

    CN109376783A

  • Game map processing method, device, terminal equipment and storage medium

    CN110559665A

  • Game character walking animation processing method, terminal and storage medium

    CN111054076A

  • Method and terminal for automatically rendering object

    CN112750188A