CN112164121A - Tearing effect graph generation method and device, storage medium and electronic device - Google Patents

Tearing effect graph generation method and device, storage medium and electronic device Download PDF

Info

Publication number
CN112164121A
CN112164121A CN202011064962.5A CN202011064962A CN112164121A CN 112164121 A CN112164121 A CN 112164121A CN 202011064962 A CN202011064962 A CN 202011064962A CN 112164121 A CN112164121 A CN 112164121A
Authority
CN
China
Prior art keywords
texture
sub
area
axis
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.)
Granted
Application number
CN202011064962.5A
Other languages
Chinese (zh)
Other versions
CN112164121B (en
Inventor
陈瑽
涂振东
李郭昌
庄涛
张峰
徐丹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Perfect Chijin Technology Co Ltd
Original Assignee
Beijing Perfect Chijin Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Perfect Chijin Technology Co Ltd filed Critical Beijing Perfect Chijin Technology Co Ltd
Priority to CN202011064962.5A priority Critical patent/CN112164121B/en
Priority to PCT/CN2020/133794 priority patent/WO2022068040A1/en
Publication of CN112164121A publication Critical patent/CN112164121A/en
Application granted granted Critical
Publication of CN112164121B publication Critical patent/CN112164121B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • 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/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor

Abstract

The application discloses a method and a device for generating a tearing effect graph, a storage medium and an electronic device. Wherein, the method comprises the following steps: acquiring a first texture mapping, wherein the first texture mapping is used for representing the tearing effect of a first subarea in the game background; twisting the first texture map to obtain a second texture map, and processing the first texture map to obtain an edge texture map; and obtaining a tearing effect map of a target area in the game background by using the second texture map and the edge texture map, wherein the target area comprises a first subarea and a second subarea, and the first subarea and the second subarea are symmetrical subareas in the game background. The method and the device solve the technical problem that the game special effect performance is delayed in the related technology.

Description

Tearing effect graph generation method and device, storage medium and electronic device
Technical Field
The application relates to the field of game processing, in particular to a method and device for generating a tearing effect graph, a storage medium and an electronic device.
Background
The network game is an individual online game which takes the internet as a transmission medium, a game operator server and a user computer as processing terminals, and game client software as an information interaction window and aims to realize entertainment, leisure, communication and virtual achievement and has considerable sustainability.
The traditional network game realizes the special effect of the game in the following ways: when the player uses the game special effect, the game client initiates a use request to the game server, the game server returns special effect expression content to the game client after receiving the use request, and the game client receives and performs corresponding special effect expression (such as bleeding, retreating, tearing and the like). In this way, the game server drives the use of the special effects, which increases the cost of the game server, and under the condition of bad network environment, the game client cannot timely receive the special effect expression returned by the game server, thereby causing the delay of the special effect expression.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the application provides a method and a device for generating a tearing effect graph, a storage medium and an electronic device, so as to at least solve the technical problem that the game special effect expression is delayed in the related technology.
According to an aspect of the embodiments of the present application, there is provided a method for generating a tearing effect map, including: acquiring a first texture mapping, wherein the first texture mapping is used for representing the tearing effect of a first subarea in the game background; twisting the first texture map to obtain a second texture map, and processing the first texture map to obtain an edge texture map; and obtaining a tearing effect map of a target area in the game background by using the second texture map and the edge texture map, wherein the target area comprises a first subarea and a second subarea, and the first subarea and the second subarea are symmetrical subareas in the game background.
Optionally, before obtaining the first texture map, the method further comprises: positioning a target area needing to be rendered into a tearing effect in a game background; the target region is divided into a first sub-region and a second sub-region which are symmetrical.
Optionally, the target region is a rectangular region, and dividing the target region into a first sub-region and a second sub-region that are symmetrical includes: the target area is divided into a first sub-area and three second sub-areas by a first axis and a second axis passing through the center of the target area, wherein the edge of the target area, which is perpendicular to the first axis, is different from the edge, which is perpendicular to the second axis.
Optionally, obtaining the tear effect map of the target area in the game background by using the second texture map and the edge texture map comprises: under the condition that the second sub-area and the first sub-area are symmetrical about the first axis, the coordinates of the pixel points in the second texture mapping on the second axis are negated to obtain a texture mapping displayed on the second sub-area, and the coordinates of the pixel points in the edge texture mapping on the second axis are negated to obtain a texture edge displayed on the second sub-area; under the condition that the second sub-area and the first sub-area are symmetrical about a second axis, the coordinates of the pixel points in the second texture mapping on the first axis are negated to obtain a texture mapping displayed on the second sub-area, and the coordinates of the pixel points in the edge texture mapping on the first axis are negated to obtain a texture edge displayed on the second sub-area; and under the condition that the second sub-area and the first sub-area are symmetrical about the center of the target area, the coordinates of the pixel points in the second texture mapping on the first axis and the coordinates of the pixel points in the second texture mapping on the second axis are inverted to obtain the texture mapping displayed on the second sub-area, and the coordinates of the pixel points in the edge texture mapping on the first axis and the coordinates of the pixel points in the second axis are inverted to obtain the texture edge displayed on the second sub-area.
Optionally, the warping the first texture map, and obtaining the second texture map includes: adjusting the first texture map into a fan-shaped second texture map; obtaining a tearing effect map of the target area in the game background by using the second texture map and the edge texture map comprises: and outputting the second texture mapping to a color node of the screen to be fused with the edge texture mapping to obtain a tearing effect mapping of the target area in the game background.
Optionally, adjusting the first texture map into a second texture map of a sector includes: negating the V axis of the coordinate of the first texture map, and then fusing the negatively-negated V axis with the U axis of the first texture map to obtain a fusion result; and performing enhancement processing on the fusion result by using the enhancement parameters, and performing radial range control on the enhanced fusion result by using the radial parameters to obtain a second texture mapping.
Optionally, outputting the second texture map to a color node of the screen comprises: and processing the second texture mapping by using the phase parameter, the gradual change smoothing parameter and the bright part strength parameter, and outputting the processed second texture mapping to a color node of a screen.
Optionally, the processing the first texture map to obtain the edge texture map includes: and performing highlighting and dissolution disturbance treatment on the edge of the first texture mapping to obtain an edge texture mapping.
According to another aspect of the embodiments of the present application, there is also provided a device for generating a tearing effect map, including: the acquiring unit is used for acquiring a first texture map, wherein the first texture map is used for representing the tearing effect of a first subarea in the game background; the processing unit is used for carrying out distortion processing on the first texture mapping to obtain a second texture mapping and processing the first texture mapping to obtain an edge texture mapping; and the generating unit is used for obtaining a tearing effect graph of a target area in the game background by utilizing the second texture map and the edge texture map, wherein the target area comprises a first subarea and a second subarea, and the first subarea and the second subarea are symmetrical subareas in the game background.
Optionally, the apparatus further comprises: the area dividing unit is used for positioning a target area needing to render a tearing effect in a game background before acquiring the first texture map; the target region is divided into a first sub-region and a second sub-region which are symmetrical.
Optionally, the target region is a rectangular region, and the region dividing unit is further configured to: the target area is divided into a first sub-area and three second sub-areas by a first axis and a second axis passing through the center of the target area, wherein the edge of the target area, which is perpendicular to the first axis, is different from the edge, which is perpendicular to the second axis.
Optionally, the processing unit is further configured to: under the condition that the second sub-area and the first sub-area are symmetrical about the first axis, the coordinates of the pixel points in the second texture mapping on the second axis are negated to obtain a texture mapping displayed on the second sub-area, and the coordinates of the pixel points in the edge texture mapping on the second axis are negated to obtain a texture edge displayed on the second sub-area; under the condition that the second sub-area and the first sub-area are symmetrical about a second axis, the coordinates of the pixel points in the second texture mapping on the first axis are negated to obtain a texture mapping displayed on the second sub-area, and the coordinates of the pixel points in the edge texture mapping on the first axis are negated to obtain a texture edge displayed on the second sub-area; and under the condition that the second sub-area and the first sub-area are symmetrical about the center of the target area, the coordinates of the pixel points in the second texture mapping on the first axis and the coordinates of the pixel points in the second texture mapping on the second axis are inverted to obtain the texture mapping displayed on the second sub-area, and the coordinates of the pixel points in the edge texture mapping on the first axis and the coordinates of the pixel points in the second axis are inverted to obtain the texture edge displayed on the second sub-area.
Optionally, the processing unit is further configured to: adjusting the first texture map into a fan-shaped second texture map; and the generating unit is used for outputting the second texture mapping to the color node of the screen so as to be fused with the edge texture mapping to obtain the tearing effect mapping of the target area in the game background.
Optionally, the processing unit is further configured to: negating the V axis of the coordinate of the first texture map, and then fusing the negatively-negated V axis with the U axis of the first texture map to obtain a fusion result; and performing enhancement processing on the fusion result by using the enhancement parameters, and performing radial range control on the enhanced fusion result by using the radial parameters to obtain a second texture mapping.
Optionally, the generating unit is further configured to: and processing the second texture mapping by using the phase parameter, the gradual change smoothing parameter and the bright part strength parameter, and outputting the processed second texture mapping to a color node of a screen.
Optionally, the processing unit is further configured to: and performing highlighting and dissolution disturbance treatment on the edge of the first texture mapping to obtain an edge texture mapping.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program which, when executed, performs the above-described method.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the above method through the computer program.
In the embodiment of the application, the terminal acquires a first texture map used for representing the tearing effect of a first subarea in a game background; twisting the first texture map to obtain a second texture map, and processing the first texture map to obtain an edge texture map; the second texture mapping and the edge texture mapping are utilized to obtain the tearing effect mapping of the target area in the game background, so that the game special effect processing can be finished on the terminal without being finished through a server, and the technical problem that the game special effect expression is delayed in the related technology can be solved.
Drawings
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 embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a diagram of a hardware environment of a method for generating a tear effect graph according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for generating an alternative tearing effect map according to an embodiment of the present application;
FIG. 3 is a schematic illustration of an alternative tearing effect according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an alternative in-engine image processing according to an embodiment of the present application;
FIG. 5 is a schematic diagram of an alternative in-engine image processing according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an alternative in-engine image processing according to an embodiment of the present application;
FIG. 7 is a schematic diagram of an alternative in-engine image processing according to an embodiment of the present application;
FIG. 8 is a schematic diagram of an alternative tear effect map generation apparatus according to an embodiment of the present application; and the number of the first and second groups,
fig. 9 is a block diagram of a terminal according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiments of the present application, a method embodiment of a method for generating a tearing effect graph is provided.
Alternatively, in the present embodiment, the generation method of the tear effect map may be applied to a hardware environment formed by the terminal 101 and the server 103 as shown in fig. 1. As shown in fig. 1, a server 103 is connected to a terminal 101 through a network, which may be used to provide services (such as game services, application services, etc.) for the terminal or a client installed on the terminal, and a database 105 may be provided on the server or separately from the server for providing data storage services for the server 103, and the network includes but is not limited to: the terminal 101 is not limited to a PC, a mobile phone, a tablet computer, and the like.
The method for generating the tear effect map according to the embodiment of the present application may be executed by the terminal 101, and the terminal 101 executing the method for generating the tear effect map according to the embodiment of the present application may also be executed by a client installed thereon. Fig. 2 is a flowchart of a method for generating an alternative tearing effect map according to an embodiment of the present application, and as shown in fig. 2, the method may include the following steps:
step S202, the terminal obtains a first texture mapping, and the first texture mapping is used for representing the tearing effect of the first sub-area in the game background.
The client-side formed after the game application is installed on the terminal, a user can carry out game interaction through the client-side, and the tearing effect is the special effect displayed in the client-side, and can be displayed by the tearing effect if the user splits an object by using the prop knife.
In step S204, the terminal distorts the first texture map to obtain a second texture map, and processes the first texture map to obtain an edge texture map.
And step S206, the terminal obtains a tearing effect image of a target area in the game background by using the second texture map and the edge texture map, wherein the target area comprises a first subarea and a second subarea, and the first subarea and the second subarea are symmetrical subareas in the game background.
Through the steps, the terminal acquires a first texture mapping used for expressing the tearing effect of the first subarea in the game background; twisting the first texture map to obtain a second texture map, and processing the first texture map to obtain an edge texture map; the second texture mapping and the edge texture mapping are utilized to obtain the tearing effect mapping of the target area in the game background, so that the game special effect processing can be finished on the terminal without being finished through a server, and the technical problem that the game special effect expression is delayed in the related technology can be solved.
At present, almost no technical scheme for realizing the tearing effect exists, and the paper tearing effect is relatively close to the paper tearing effect, namely a mode of removing part pictures in a one-way small disturbance mode. The scheme provides a multi-directional tearing effect, such as a tearing effect from the center to two sides or from the center to the cross direction around, and the effect is shown in fig. 3. The technical solution of the present application is further detailed below with reference to the steps shown in fig. 2.
In the technical solution provided in step S202, the terminal obtains a first texture map, where the first texture map is used to represent a tearing effect of the first sub-area in the game background, and the texture map may be a texture map prepared by art in advance.
In the scheme, before the first texture map is acquired, a target area in the game background, such as an area where a target is cut by a knife of a player, which needs to be rendered to generate a tearing effect is located; the target area is divided into a first sub-area and a second sub-area which are symmetrical, the number of the first sub-area and the second sub-area is one, for example, when the target area is a rectangle, the first sub-area and the second sub-area are two small symmetrical rectangles, and when the target area is an ellipse, the first sub-area and the second sub-area are two symmetrical semi-ellipses.
The number of the second sub-regions may also be multiple, for example, when the target region is a rectangular region, and the target region is divided into a first sub-region and a second sub-region which are symmetrical, the target region may be divided into one first sub-region and three second sub-regions by using a first axis (e.g., a horizontal axis) and a second axis (e.g., a vertical axis) passing through the center of the target region, and a side of the target region perpendicular to the first axis is different from a side of the target region perpendicular to the second axis.
In the technical solution provided in step S204, the terminal performs warping processing on the first texture map to obtain a second texture map, and performs processing on the first texture map to obtain an edge texture map.
In the above solution, when the first texture map is warped to obtain the second texture map, the first texture map may be adjusted to be the second fan-shaped texture map, for example, in a game engine (e.g., a unity game engine), a V-axis of coordinates of the first texture map is taken as negative, and then the V-axis after the negative is taken is fused with a U-axis of the first texture map to obtain a fusion result; and performing enhancement processing on the fusion result by using the enhancement parameters, and performing radial range control on the enhanced fusion result by using the radial parameters to obtain a second texture mapping.
In the above scheme, when the first texture map is processed to obtain the edge texture map, the edge of the first texture map may be subjected to highlighting and dissolution disturbance processing in the game engine to obtain the edge texture map.
In the technical solution provided in step S206, the terminal obtains a tearing effect map of the target area in the game background by using the second texture map and the edge texture map.
In the above solution, obtaining the tearing effect map of the target area in the game background by using the second texture map and the edge texture map includes the following three cases:
one is that, under the condition that the second sub-region and the first sub-region are symmetrical about a first axis (such as an X axis), the coordinates of the pixel points in the second texture map on a second axis (such as a Y axis) are negated to obtain the texture map displayed on the second sub-region, and the coordinates of the pixel points in the edge texture map on the second axis are negated to obtain the texture edge displayed on the second sub-region;
secondly, under the condition that the second sub-area and the first sub-area are symmetrical about a second axis, the coordinates of the pixel points in the second texture mapping on the first axis are negated to obtain the texture mapping displayed on the second sub-area, and the coordinates of the pixel points in the edge texture mapping on the first axis are negated to obtain the texture edge displayed on the second sub-area;
and thirdly, under the condition that the second sub-area and the first sub-area are symmetrical about the center of the target area, negating the coordinates of the pixel points in the second texture mapping on the first axis and the coordinates of the pixel points in the second texture mapping on the second axis to obtain a texture mapping displayed on the second sub-area, and negating the coordinates of the pixel points in the edge texture mapping on the first axis and the coordinates of the pixel points in the second axis to obtain a texture edge displayed on the second sub-area.
In the above scheme, when the second texture map and the edge texture map are used to obtain the tearing effect map of the target area in the game background, the second texture map is output to the color node of the screen (for example, the second texture map is processed by using the phase parameter, the gradual change smoothing parameter and the bright part intensity parameter, and the processed second texture map is output to the color node of the screen), so as to be fused with the edge texture map, and obtain the tearing effect map of the target area in the game background.
As an alternative example, the following detailed description will further describe the technical solution of the present application by taking the example shown in fig. 4 in conjunction with the specific implementation manner:
step S402, determining the background position according to the current camera, setting a rectangle with the size of the tearing space, and confirming the central point.
Step S404, a rectangular surface is created from the top left corner of the rectangle to the center point (or the surface can be created in other directions), and the surface is mirror-copied three times in three directions, i.e. right, down, and right, and four surfaces also form a large rectangle with the center point as the center. Then, based on the upper left surface, the shader is manufactured by warping from the center point to the upper left and using the warping change of the process as a parameter.
In step S406, a semicircular texture (denoted as texture 1) is distorted and deformed, and finally becomes a controllable segment sector from the lower right to the upper left.
Texture Coordinates are model Texture information nodes, and the Texture on a model is mapped into an adjustable sector, which is the meaning of the nodes (i.e. Clamp, One Minus and the like nodes, which are nodes provided by the Unity engine).
The UV of texture coordinates is first processed separately, taking the V-axis negative at the One Minus node and Clamp node, and shifting the center point from top right to bottom right. The processed UV axis is fused at a multiplex node (the fusion uses an algorithm of the multiplex node, the core is to Multiply two input data), a parameter is added and Power calculation is performed with the fused result (the exp Power input by the node generally indicates strengthening and adjusting a black-and-white edge, the smaller the value is, the whiter the whole texture is, the larger the value is, the blacker the whole texture is), the intensity is increased, a parameter is added to indicate the radial range, the value can be reduced to a lower value, and the structural diagram of the scheme in Unity is shown in fig. 4.
The scheme can adjust the smoothness and the strength of the edge of the sector gradual change, the sector can be in black-white gradual change, the brightness is from white to black (the white is more bright), and the texture display alpha transparent channel can be adjusted through the sector, so that the scheme needs to form the cross-shaped tear, and the texture can be changed into an adjustable transparent 1/4 circle.
Step S408 is to take the output of step S406 as the input of the transparent channel, and take the two parameters (i.e. the two float values of parameter a and parameter B) as parameters to perform linear difference calculation, as shown in fig. 5.
Since the purpose of the solution is to complete the cross tearing effect, a texture is changed into an adjustable transparent 1/4 circle, so that the same texture can be copied into four parts, and thus a cross tearing effect can be pieced together, step S406 is to make one layer of texture fade from top right to top left in a fan-shaped manner by adjusting the transparency, which is equivalent to making the second layer of texture appear in a similar manner.
The two floats may be derived from two control nodes added to Unity, such as one with a value of 0 and one with a value of 1, and are used to control the alpha (i.e., α channel) in step S406, and the linear difference is implemented by the Lerp node, which has three values, respectively A, B, alpha, so as to control the intensity of the alpha.
And processing the result and the Screen coordinate through an Add node (namely, an addition node which can complete a set of operations of adding the position information to the change of the alpha channel and assigning a value to the UV information of the Screen, namely, modifying and deforming the alpha channel to control the texture change of the model), inputting the UV information into a color node of a Screen as UV, and outputting RGBA in the node for processing. The transparent animation of the whole alpha is controlled by four parameters: gradual smoothness smooth, bright intensity, and overall phase values a and B.
In step S406 and step S408, using several parameters, the radial fan deformation adjusted by black-and-white gradual change is mapped onto the screen parameters of the face pointed by the camera (i.e. the face with the shader, and the image of the face is the image taken by the camera, like the screenshot, so when the distortion deformation is made, the change is the image pointed by the camera when the deformation occurs, which can ensure that the effect is still normal when the angle of the camera is changed).
In step S410, the image is distorted and the edge is disturbed, strengthened and dissolved. As shown in fig. 6 and 7 (fig. 6 and 7 are rotated to see the content in the figure because of the large content), two different gray textures are first used to move at the same speed and direction, the two textures are overlapped, and are fused with the texture (texture 1) coordinates, so that a rapid edge perturbation is completed, and the structure in unity is shown in fig. 6.
And processing the obtained disturbing image of the texture 1, and only outputting the effect of one edge. Specifically, a certain channel value of the disturbing image is output twice, one of the channel values is superposed with a width parameter, because only two colors, namely black and white, can be subtracted, and the channel with the width only keeps the width part, so that the efficiency is higher. The edge is fused with a color parameter to obtain the final output of step S410.
And S512, overlapping the results obtained in the step S508 and the step S510 to form a final shader, and assigning the final shader to other three surfaces, wherein the surfaces are in mirror image relationship, so that the distortion animation is deformed towards four different directions, and the tearing and dissolving effect towards four directions simultaneously is completed.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
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 implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
According to another aspect of the embodiment of the present application, there is also provided a tearing effect map generation apparatus for implementing the tearing effect map generation method. Fig. 8 is a schematic diagram of an alternative tearing-effect-diagram generating device according to an embodiment of the present application, and as shown in fig. 8, the device may include:
an obtaining unit 801, configured to obtain a first texture map, where the first texture map is used to represent a tearing effect of a first sub-area in a game background;
a processing unit 803, configured to perform warping processing on the first texture map to obtain a second texture map, and perform processing on the first texture map to obtain an edge texture map;
a generating unit 805, configured to obtain a tearing effect map of a target region in the game background by using the second texture map and the edge texture map, where the target region includes the first sub-region and a second sub-region, and the first sub-region and the second sub-region are symmetric sub-regions in the game background.
It should be noted that the acquiring unit 801 in this embodiment may be configured to execute step S202 in this embodiment, the processing unit 803 in this embodiment may be configured to execute step S204 in this embodiment, and the generating unit 805 in this embodiment may be configured to execute step S206 in this embodiment.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may operate in a hardware environment as shown in fig. 1, and may be implemented by software or hardware.
Through the modules, the terminal acquires a first texture mapping used for representing the tearing effect of a first subarea in the game background; twisting the first texture map to obtain a second texture map, and processing the first texture map to obtain an edge texture map; the second texture mapping and the edge texture mapping are utilized to obtain the tearing effect mapping of the target area in the game background, so that the game special effect processing can be finished on the terminal without being finished through a server, and the technical problem that the game special effect expression is delayed in the related technology can be solved.
Optionally, the apparatus further comprises: the area dividing unit is used for positioning a target area needing to render a tearing effect in the game background before acquiring the first texture map; dividing the target region into the first sub-region and the second sub-region which are symmetrical.
Optionally, the target region is a rectangular region, and the region dividing unit is further configured to: dividing the target area into one first sub-area and three second sub-areas by using a first axis and a second axis passing through the center of the target area, wherein the edge of the target area, which is perpendicular to the first axis, is different from the edge of the target area, which is perpendicular to the second axis.
Optionally, the processing unit is further configured to: under the condition that the second sub-area and the first sub-area are symmetrical about the first axis, the coordinates of pixel points in the second texture mapping on the second axis are inverted to obtain a texture mapping displayed on the second sub-area, and the coordinates of the pixel points in the edge texture mapping on the second axis are inverted to obtain a texture edge displayed on the second sub-area; under the condition that the second sub-area and the first sub-area are symmetrical about the second axis, inverting the coordinates of the pixel points in the second texture mapping on the first axis to obtain a texture mapping displayed on the second sub-area, and inverting the coordinates of the pixel points in the edge texture mapping on the first axis to obtain a texture edge displayed on the second sub-area; and under the condition that the second sub-area and the first sub-area are symmetrical about the center of the target area, negating the coordinates of the pixel points in the second texture mapping on the first axis and the coordinates on the second axis to obtain a texture mapping displayed on the second sub-area, and negating the coordinates of the pixel points in the edge texture mapping on the first axis and the coordinates on the second axis to obtain a texture edge displayed on the second sub-area.
Optionally, the processing unit is further configured to: adjusting the first texture map to the second texture map of a sector; and the generating unit is used for outputting the second texture map to a color node of a screen so as to be fused with the edge texture map to obtain a tearing effect map of the target area in the game background.
Optionally, the processing unit is further configured to: negating the V axis of the coordinate of the first texture map, and then fusing the negatively-negated V axis with the U axis of the first texture map to obtain a fusion result; and utilizing enhancement parameters to enhance the fusion result, and utilizing radial parameters to control the radial range of the enhanced fusion result to obtain the second texture mapping.
Optionally, the generating unit is further configured to: and processing the second texture mapping by using the phase parameter, the gradual change smoothing parameter and the bright part strength parameter, and outputting the processed second texture mapping to a color node of a screen.
Optionally, the processing unit is further configured to: and carrying out highlighting and dissolution disturbance treatment on the edge of the first texture mapping to obtain the edge texture mapping.
At present, almost no technical scheme for realizing the tearing effect exists, and the paper tearing effect is relatively close to the paper tearing effect, namely a mode of removing part of a mapping by one-way small disturbance. The scheme provides a multi-directional tearing effect, such as a tearing effect from the center to two sides or from the center to the peripheral cross direction.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may be operated in a hardware environment as shown in fig. 1, and may be implemented by software, or may be implemented by hardware, where the hardware environment includes a network environment.
According to another aspect of the embodiment of the present application, there is also provided a server or a terminal for implementing the method for generating the tearing effect graph.
Fig. 9 is a block diagram of a terminal according to an embodiment of the present application, and as shown in fig. 9, the terminal may include: one or more processors 201 (only one shown in fig. 9), a memory 203, and a transmission means 205. as shown in fig. 9, the terminal may further include an input-output device 207.
The memory 203 may be configured to store software programs and modules, such as program instructions/modules corresponding to the method and apparatus for generating a tearing effect graph in the embodiment of the present application, and the processor 201 executes various functional applications and data processing by running the software programs and modules stored in the memory 203, that is, implements the method for generating a tearing effect graph. The memory 203 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 examples, the memory 203 may further include memory located remotely from the processor 201, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 205 is used for receiving or sending data via a network, and can also be used for data transmission between a processor and a memory. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 205 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmission device 205 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
Wherein the memory 203 is specifically used for storing application programs.
The processor 201 may call the application stored in the memory 203 via the transmission means 205 to perform the following steps:
acquiring a first texture mapping, wherein the first texture mapping is used for representing a tearing effect of a first subarea in a game background;
twisting the first texture mapping to obtain a second texture mapping, and processing the first texture mapping to obtain an edge texture mapping;
and obtaining a tearing effect map of a target area in the game background by using the second texture map and the edge texture map, wherein the target area comprises a first sub-area and a second sub-area, and the first sub-area and the second sub-area are symmetric sub-areas in the game background.
The processor 201 is further configured to perform the following steps:
under the condition that the second sub-area and the first sub-area are symmetrical about the first axis, the coordinates of pixel points in the second texture mapping on the second axis are inverted to obtain a texture mapping displayed on the second sub-area, and the coordinates of the pixel points in the edge texture mapping on the second axis are inverted to obtain a texture edge displayed on the second sub-area;
under the condition that the second sub-area and the first sub-area are symmetrical about the second axis, inverting the coordinates of the pixel points in the second texture mapping on the first axis to obtain a texture mapping displayed on the second sub-area, and inverting the coordinates of the pixel points in the edge texture mapping on the first axis to obtain a texture edge displayed on the second sub-area;
and under the condition that the second sub-area and the first sub-area are symmetrical about the center of the target area, negating the coordinates of the pixel points in the second texture mapping on the first axis and the coordinates on the second axis to obtain a texture mapping displayed on the second sub-area, and negating the coordinates of the pixel points in the edge texture mapping on the first axis and the coordinates on the second axis to obtain a texture edge displayed on the second sub-area.
By adopting the embodiment of the application, the terminal acquires the first texture map used for expressing the tearing effect of the first subarea in the game background; twisting the first texture mapping to obtain a second texture mapping, and processing the first texture mapping to obtain an edge texture mapping; and obtaining a tearing effect graph of a target area in the game background by utilizing the second texture mapping and the edge texture mapping, thereby finishing the processing of the game special effect on a terminal without a server, and solving the technical problem of delay in the game special effect expression in the related technology.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 9 is only an illustration, and the terminal may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a Mobile Internet Device (MID), a PAD, etc. Fig. 9 is a diagram illustrating a structure of the electronic device. For example, the terminal may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 9, or have a different configuration than shown in FIG. 9.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Embodiments of the present application also provide a storage medium. Alternatively, in this embodiment, the storage medium may be a program code for executing the method for generating the tear effect map.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
acquiring a first texture mapping, wherein the first texture mapping is used for representing a tearing effect of a first subarea in a game background;
twisting the first texture mapping to obtain a second texture mapping, and processing the first texture mapping to obtain an edge texture mapping;
and obtaining a tearing effect map of a target area in the game background by using the second texture map and the edge texture map, wherein the target area comprises a first sub-area and a second sub-area, and the first sub-area and the second sub-area are symmetric sub-areas in the game background.
Optionally, the storage medium is further arranged to store program code for performing the steps of:
under the condition that the second sub-area and the first sub-area are symmetrical about the first axis, the coordinates of pixel points in the second texture mapping on the second axis are inverted to obtain a texture mapping displayed on the second sub-area, and the coordinates of the pixel points in the edge texture mapping on the second axis are inverted to obtain a texture edge displayed on the second sub-area;
under the condition that the second sub-area and the first sub-area are symmetrical about the second axis, inverting the coordinates of the pixel points in the second texture mapping on the first axis to obtain a texture mapping displayed on the second sub-area, and inverting the coordinates of the pixel points in the edge texture mapping on the first axis to obtain a texture edge displayed on the second sub-area;
and under the condition that the second sub-area and the first sub-area are symmetrical about the center of the target area, negating the coordinates of the pixel points in the second texture mapping on the first axis and the coordinates on the second axis to obtain a texture mapping displayed on the second sub-area, and negating the coordinates of the pixel points in the edge texture mapping on the first axis and the coordinates on the second axis to obtain a texture edge displayed on the second sub-area.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including instructions for causing one or more computer devices (which may be personal computers, servers, network devices, or the like) to execute all or part of the steps of the method described in the embodiments of the present application.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (11)

1. A method for generating a tearing effect graph is characterized by comprising the following steps:
acquiring a first texture mapping, wherein the first texture mapping is used for representing a tearing effect of a first subarea in a game background;
twisting the first texture mapping to obtain a second texture mapping, and processing the first texture mapping to obtain an edge texture mapping;
and obtaining a tearing effect map of a target area in the game background by using the second texture map and the edge texture map, wherein the target area comprises a first sub-area and a second sub-area, and the first sub-area and the second sub-area are symmetric sub-areas in the game background.
2. The method of claim 1, wherein prior to obtaining the first texture map, the method further comprises:
positioning a target area needing to be rendered into a tearing effect in the game background;
dividing the target region into the first sub-region and the second sub-region which are symmetrical.
3. The method of claim 2, wherein the target region is a rectangular region, and wherein dividing the target region into the first and second symmetric sub-regions comprises:
dividing the target area into one first sub-area and three second sub-areas by using a first axis and a second axis passing through the center of the target area, wherein the edge of the target area, which is perpendicular to the first axis, is different from the edge of the target area, which is perpendicular to the second axis.
4. The method of claim 3, wherein obtaining the tear effect map of the target area in the game background using the second texture map and the edge texture map comprises:
under the condition that the second sub-area and the first sub-area are symmetrical about the first axis, the coordinates of pixel points in the second texture mapping on the second axis are inverted to obtain a texture mapping displayed on the second sub-area, and the coordinates of the pixel points in the edge texture mapping on the second axis are inverted to obtain a texture edge displayed on the second sub-area;
under the condition that the second sub-area and the first sub-area are symmetrical about the second axis, inverting the coordinates of the pixel points in the second texture mapping on the first axis to obtain a texture mapping displayed on the second sub-area, and inverting the coordinates of the pixel points in the edge texture mapping on the first axis to obtain a texture edge displayed on the second sub-area;
and under the condition that the second sub-area and the first sub-area are symmetrical about the center of the target area, negating the coordinates of the pixel points in the second texture mapping on the first axis and the coordinates on the second axis to obtain a texture mapping displayed on the second sub-area, and negating the coordinates of the pixel points in the edge texture mapping on the first axis and the coordinates on the second axis to obtain a texture edge displayed on the second sub-area.
5. The method according to any one of claims 1 to 4,
performing warping processing on the first texture map to obtain a second texture map, including: adjusting the first texture map to the second texture map of a sector;
obtaining a tearing effect map of a target area in the game background by using the second texture map and the edge texture map comprises: and outputting the second texture mapping to a color node of a screen to be fused with the edge texture mapping to obtain a tearing effect mapping of the target area in the game background.
6. The method of claim 5, wherein adjusting the first texture map to the second texture map of a sector comprises:
negating the V axis of the coordinate of the first texture map, and then fusing the negatively-negated V axis with the U axis of the first texture map to obtain a fusion result;
and utilizing enhancement parameters to enhance the fusion result, and utilizing radial parameters to control the radial range of the enhanced fusion result to obtain the second texture mapping.
7. The method of claim 5, wherein outputting the second texture map to a color node of a screen comprises:
and processing the second texture mapping by using the phase parameter, the gradual change smoothing parameter and the bright part strength parameter, and outputting the processed second texture mapping to a color node of a screen.
8. The method of claim 1, wherein processing the first texture map to obtain an edge texture map comprises:
and carrying out highlighting and dissolution disturbance treatment on the edge of the first texture mapping to obtain the edge texture mapping.
9. A generation device of a tearing effect picture is characterized by comprising:
the method comprises an acquiring unit, a judging unit and a judging unit, wherein the acquiring unit is used for acquiring a first texture map, and the first texture map is used for representing the tearing effect of a first subarea in a game background;
the processing unit is used for carrying out distortion processing on the first texture mapping to obtain a second texture mapping and processing the first texture mapping to obtain an edge texture mapping;
a generating unit, configured to obtain a tearing effect map of a target region in the game background by using the second texture map and the edge texture map, where the target region includes the first sub-region and the second sub-region, and the first sub-region and the second sub-region are symmetric sub-regions in the game background.
10. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program when executed performs the method of any of the preceding claims 1 to 8.
11. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the method of any of the preceding claims 1 to 8 by means of the computer program.
CN202011064962.5A 2020-09-30 2020-09-30 Tearing effect graph generation method and device, storage medium and electronic device Active CN112164121B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202011064962.5A CN112164121B (en) 2020-09-30 2020-09-30 Tearing effect graph generation method and device, storage medium and electronic device
PCT/CN2020/133794 WO2022068040A1 (en) 2020-09-30 2020-12-04 Method and apparatus for generating tear effect image, and storage medium and electronic apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011064962.5A CN112164121B (en) 2020-09-30 2020-09-30 Tearing effect graph generation method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN112164121A true CN112164121A (en) 2021-01-01
CN112164121B CN112164121B (en) 2021-11-23

Family

ID=73862387

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011064962.5A Active CN112164121B (en) 2020-09-30 2020-09-30 Tearing effect graph generation method and device, storage medium and electronic device

Country Status (2)

Country Link
CN (1) CN112164121B (en)
WO (1) WO2022068040A1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6456289B1 (en) * 1999-04-23 2002-09-24 Georgia Tech Research Corporation Animation system and method for a animating object fracture
CN106204697A (en) * 2016-07-14 2016-12-07 燕山大学 A kind of cloth tear dynamic simulator system
CN106462989A (en) * 2014-06-23 2017-02-22 微软技术许可有限责任公司 Saliency-preserving distinctive low-footprint photograph aging effect
CN109118556A (en) * 2018-08-21 2019-01-01 苏州蜗牛数字科技股份有限公司 A kind of method that realizing UI interface cartoon transition effect, system and storage medium
CN109663357A (en) * 2018-12-19 2019-04-23 北京像素软件科技股份有限公司 Game special implementation method and device
CN110251940A (en) * 2019-07-10 2019-09-20 网易(杭州)网络有限公司 A kind of method and apparatus that game picture is shown
CN110917617A (en) * 2019-11-15 2020-03-27 深圳市瑞立视多媒体科技有限公司 Method, device and equipment for generating water ripple image and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104571887B (en) * 2014-12-31 2017-05-10 北京奇虎科技有限公司 Static picture based dynamic interaction method and device
CN107682731A (en) * 2017-10-24 2018-02-09 北京奇虎科技有限公司 Video data distortion processing method, device, computing device and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6456289B1 (en) * 1999-04-23 2002-09-24 Georgia Tech Research Corporation Animation system and method for a animating object fracture
CN106462989A (en) * 2014-06-23 2017-02-22 微软技术许可有限责任公司 Saliency-preserving distinctive low-footprint photograph aging effect
CN106204697A (en) * 2016-07-14 2016-12-07 燕山大学 A kind of cloth tear dynamic simulator system
CN109118556A (en) * 2018-08-21 2019-01-01 苏州蜗牛数字科技股份有限公司 A kind of method that realizing UI interface cartoon transition effect, system and storage medium
CN109663357A (en) * 2018-12-19 2019-04-23 北京像素软件科技股份有限公司 Game special implementation method and device
CN110251940A (en) * 2019-07-10 2019-09-20 网易(杭州)网络有限公司 A kind of method and apparatus that game picture is shown
CN110917617A (en) * 2019-11-15 2020-03-27 深圳市瑞立视多媒体科技有限公司 Method, device and equipment for generating water ripple image and storage medium

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
EMRE ÖNAL: "CLOTH TEARING SIMULATION", 《HTTPS://OPEN.METU.EDU.TR/HANDLE/11511/22534》 *
HIGHWAY: "在GMS2中使用Surfaces实现屏幕撕裂/波纹效果", 《HTTPS://INDIENOVA.COM/U/ROOT/BLOGREAD/5375》 *
刘宇涵 等: "拉伸、碰撞情景下布料撕裂的实时仿真模拟", 《小型微型计算机系统》 *
周绍胜: "基于质点—弹簧模型的布料自动撕裂模拟研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
谢佳翊 等: "基于质点-弹簧模型的冰雹打击树叶的模拟方法", 《图学学报》 *

Also Published As

Publication number Publication date
CN112164121B (en) 2021-11-23
WO2022068040A1 (en) 2022-04-07

Similar Documents

Publication Publication Date Title
US10110936B2 (en) Web-based live broadcast
CN111145326B (en) Processing method of three-dimensional virtual cloud model, storage medium, processor and electronic device
CN103530018B (en) The method for building up and mobile terminal at widget interface in Android operation system
CN110189248B (en) Image fusion method and device, storage medium and electronic equipment
CN108765520B (en) Text information rendering method and device, storage medium and electronic device
CN107680042B (en) Rendering method, device, engine and storage medium combining texture and convolution network
US9892525B2 (en) Saliency-preserving distinctive low-footprint photograph aging effects
CN110930486A (en) Rendering method and device of virtual grass in game and electronic equipment
CN111710020B (en) Animation rendering method and device and storage medium
CN107610046A (en) Background-blurring method, apparatus and system
CN111450529A (en) Game map acquisition method and device, storage medium and electronic device
CN110930484B (en) Animation configuration method and device, storage medium and electronic device
CN112164121B (en) Tearing effect graph generation method and device, storage medium and electronic device
CN111562869B (en) Screenshot method and device, storage medium and electronic device
CN112927365A (en) Method and device for rendering mountain in three-dimensional virtual scene of application program
CN113034658A (en) Method and device for generating model map
CN112231020A (en) Model switching method and device, electronic equipment and storage medium
CN114428573B (en) Special effect image processing method and device, electronic equipment and storage medium
KR102617789B1 (en) Picture processing methods and devices, storage media and electronic devices
WO2022033162A1 (en) Model loading method and related apparatus
CN111462343B (en) Data processing method and device, electronic equipment and storage medium
CN113450444A (en) Method and device for generating illumination map, storage medium and electronic equipment
CN113318444B (en) Role rendering method and device, electronic equipment and storage medium
CN110992869B (en) Layer display method and related equipment
CN117058281A (en) Virtual expression generation method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant