CN117392286A - Crack effect display method and device, electronic equipment and storage medium - Google Patents

Crack effect display method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117392286A
CN117392286A CN202311397541.8A CN202311397541A CN117392286A CN 117392286 A CN117392286 A CN 117392286A CN 202311397541 A CN202311397541 A CN 202311397541A CN 117392286 A CN117392286 A CN 117392286A
Authority
CN
China
Prior art keywords
crack
map
effect
target
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311397541.8A
Other languages
Chinese (zh)
Inventor
张霖雲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202311397541.8A priority Critical patent/CN117392286A/en
Publication of CN117392286A publication Critical patent/CN117392286A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation
    • G06T13/603D [Three Dimensional] animation of natural phenomena, e.g. rain, snow, water or plants

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The disclosure provides a method, a device, an electronic device and a storage medium for displaying a crack effect, wherein the method comprises the following steps: determining a mask map, a height map and a color gradient map corresponding to the crack effect; synthesizing the mask map, the height map and the color gradient map to obtain a crack map corresponding to the crack effect; and displaying the crack effect at a target position based on the crack map. According to the method and the device, the display of the crack effect can be realized on the target object without changing the shape of the target object, so that the cost is low, and the universality is good.

Description

Crack effect display method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of computer graphics, and in particular relates to a method and a device for displaying a crack effect, electronic equipment and a storage medium.
Background
This section is intended to provide a background or context to the embodiments of the disclosure recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
In an electronic game such as an action-like game, when a user manipulates a virtual weapon such as a knife, sword, or the like to attack a target object such as a floor, a wall, or the like, a crack effect is displayed on the target object, for example, the floor is chopped with a knife, and a crack effect is displayed on the floor.
However, the cracking effect in the prior art generally requires changing the shape of the target object itself, and has problems of high cost and poor versatility.
Disclosure of Invention
Accordingly, an object of the present disclosure is to provide a method, an apparatus, an electronic device, and a storage medium for displaying a crack effect, which at least solve one of the technical problems in the related art to a certain extent.
In view of the above object, a first aspect of exemplary embodiments of the present disclosure provides a method for displaying a crack effect, including:
determining a mask map, a height map and a color gradient map corresponding to the crack effect;
synthesizing the mask map, the height map and the color gradient map to obtain a crack map corresponding to the crack effect;
and displaying the crack effect at a target position based on the crack map.
Based on the same inventive concept, a second aspect of exemplary embodiments of the present disclosure provides a display device of a crack effect, including:
the mapping data determining module is configured to determine a mask map, a height map and a color gradient map corresponding to the crack effect;
the crack mapping determining module is configured to synthesize the mask map, the height map and the color gradient map to obtain a crack mapping corresponding to the crack effect;
And the crack effect display module is configured to display the crack effect at a target position based on the crack map.
Based on the same inventive concept, a third aspect of exemplary embodiments of the present disclosure provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method according to the first aspect when executing the program.
Based on the same inventive concept, a fourth aspect of the exemplary embodiments of the present disclosure provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method according to the first aspect.
As can be seen from the foregoing, the method, the device, the electronic device and the storage medium for displaying the crack effect provided by the embodiments of the present disclosure, where the method includes: determining a mask map, a height map and a color gradient map corresponding to the crack effect; synthesizing the mask map, the height map and the color gradient map to obtain a crack map corresponding to the crack effect; and displaying the crack effect at a target position based on the crack map. According to the method and the device, the display of the crack effect can be realized on the target object without changing the shape of the target object, so that the cost is low, and the universality is good.
Drawings
In order to more clearly illustrate the technical solutions of the present disclosure or related art, the drawings required for the embodiments or related art description will be briefly described below, and it is apparent that the drawings in the following description are only embodiments of the present disclosure, and other drawings may be obtained according to these drawings without inventive effort to those of ordinary skill in the art.
FIG. 1 is a schematic illustration of a cracking effect provided by exemplary embodiments of the present disclosure;
fig. 2 is a schematic view of an application scenario of a method for displaying a crack effect according to an exemplary embodiment of the present disclosure;
FIG. 3 is a flow chart of a method for displaying a crack effect provided by an exemplary embodiment of the present disclosure;
FIG. 4 is a schematic illustration of a mask pattern provided by an exemplary embodiment of the present disclosure;
FIG. 5 is a schematic illustration of a height map provided by an exemplary embodiment of the present disclosure;
FIG. 6 is a schematic illustration of a color gradation diagram provided by an exemplary embodiment of the present disclosure;
FIG. 7 is a schematic diagram of a split map partitioning method provided by an exemplary embodiment of the present disclosure;
FIG. 8 is a schematic illustration of a smooth transition diagram provided by an exemplary embodiment of the present disclosure;
FIG. 9 is a schematic diagram of an output mask diagram provided by an exemplary embodiment of the present disclosure;
FIG. 10 is another schematic illustration of a crack effect provided by exemplary embodiments of the present disclosure;
FIG. 11 is a flow diagram of a manner of determining a specified order provided by exemplary embodiments of the present disclosure;
fig. 12 is a schematic view of another application scenario of the method for displaying a crack effect according to the exemplary embodiment of the present disclosure;
fig. 13 is a schematic view of another application scenario of the method for displaying a crack effect according to the exemplary embodiment of the present disclosure;
fig. 14 is a schematic view of another application scenario of the method for displaying a crack effect according to the exemplary embodiment of the present disclosure;
fig. 15 is a schematic view of another application scenario of the method for displaying a crack effect according to the exemplary embodiment of the present disclosure;
fig. 16 is a schematic view of another application scenario of the method for displaying a crack effect according to the exemplary embodiment of the present disclosure;
fig. 17 is a schematic structural view of a display device for a crack effect provided by an exemplary embodiment of the present disclosure;
fig. 18 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present disclosure.
Detailed Description
It can be appreciated that before using the technical solutions disclosed in the embodiments of the present application, the user should be informed and authorized by appropriate means of the type, the usage range, the usage scenario, etc. of the personal information related to the present application according to the relevant laws and regulations.
For example, in response to receiving an active request from a user, a prompt is sent to the user to explicitly prompt the user that the operation it is requesting to perform will require personal information to be obtained and used with the user. Therefore, the user can autonomously select whether to provide personal information for software or hardware such as electronic equipment, application programs, servers or storage media for executing the operation of the technical scheme according to the prompt information.
As an alternative but non-limiting implementation, in response to receiving an active request from a user, the manner in which the prompt information is sent to the user may be, for example, a popup, in which the prompt information may be presented in a text manner. In addition, a selection control for the user to select to provide personal information to the electronic device in a 'consent' or 'disagreement' manner can be carried in the popup window.
It will be appreciated that the above-described notification and user authorization acquisition process is merely illustrative and not limiting of the implementation of the present application, and that other ways of satisfying relevant legal regulations may be applied to the implementation of the present application.
It will be appreciated that the data (including but not limited to the data itself, the acquisition or use of the data) involved in the present technical solution should comply with the corresponding legal regulations and the requirements of the relevant regulations.
For purposes of making the objects, technical solutions, and advantages of the present disclosure more apparent, the principle and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are presented merely to enable one skilled in the art to better understand and practice the present disclosure and are not intended to limit the scope of the present disclosure in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In this document, it should be understood that any number of elements in the drawings is for illustration and not limitation, and that any naming is used only for distinction and not for any limitation.
The principles and spirit of the present disclosure are explained in detail below with reference to several representative embodiments thereof.
In an electronic game such as an action-like game, when a user manipulates a virtual weapon such as a knife, sword, or the like to attack a target object such as a floor, a wall, or the like, a crack effect is displayed on the target object, for example, the floor is chopped with a knife, and a crack effect is displayed on the floor.
Referring to fig. 1, the crack effect refers to a downward depth at a crack where a target object is broken is simulated in visual effect, and a crack is broken downward in visual effect as if the surface of the target object were seen by a user.
However, the cracking effect in the related art generally requires changing the shape of the target object itself, and there are problems of high cost and poor versatility.
Specifically, the schemes for realizing the crack effect in the related art are as follows: a scheme for changing the material of the target object and a scheme for constructing a crack model.
The scheme for changing the material of the target object, specifically, fusing the map of the crack effect in the shader of the target object is characterized in that the crack effect and the target object are fused naturally.
However, the crack effect is presented as a kind of skill, preferably as a separate effect. Specifically, the cracking effect needs to adapt to different target objects, if the corresponding material needs to be changed for each target object, the cracking effect is quite heavy, and the universality of the material of the target object in the existing scene is not reasonable.
The method for constructing the crack model comprises the steps of constructing a scheme of the crack model, specifically, using the crack model to 'dig out' a target object model by adopting a template test or a depth test method, and finally, selecting a rendering crack model at the crack of the target object as a display effect, wherein the target object model is still rendered at other positions. The scheme is characterized in that the visual effect is relatively real.
However, the scheme of constructing the fracture model requires modifying the values of the template buffer or the order of the rendering queues; the scheme for constructing the crack model has poor universality, and if the shape and the size of the crack effect need to be changed, only the crack model can be reconstructed; the scheme for constructing the crack model can only act on the surface of a flat target object, is not suitable for the surface of the target object with high and low fluctuation, and is limited in applicable scene. In addition, the special effects engineer is not familiar with the templates and depth testing of the engine, and more technical support is required when using the special effects engineer.
In order to solve the above problems, the present disclosure provides a display scheme of a crack effect, specifically including: determining a mask map, a height map and a color gradient map corresponding to the crack effect; synthesizing the mask map, the height map and the color gradient map to obtain a crack map corresponding to the crack effect; and displaying the crack effect at a target position based on the crack map. According to the method and the device, the display of the crack effect can be realized without changing the shape of the target object, the cost is low, and the universality is good.
Having described the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are specifically described below.
Referring to fig. 2, another application scenario of the method for displaying a crack effect according to an exemplary embodiment of the present disclosure is illustrated.
The application scenario includes a local terminal device 110 and a server 120. The local terminal device 110 and the server 120 may be connected through a wired or wireless communication network, so as to implement data interaction.
The local terminal device 110 may be an electronic device with data transmission and multimedia input/output functions near the user side, such as a desktop computer, a mobile phone, a mobile computer, a tablet computer, a media player, a car-mounted computer, an intelligent wearable device, a personal digital assistant (personal digital assistant, PDA), or other electronic devices capable of implementing the above functions, etc. The electronic device may include a processor for presenting a graphical user interface that may display a music game interface, and a display screen having a touch input function for processing the music game data, generating the graphical user interface, and controlling the display of the graphical user interface on the display screen.
The server 120 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or may be a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Network, content delivery networks), basic cloud computing services such as big data and artificial intelligence platforms, and the like.
In some exemplary embodiments, the method for displaying the crack effect may be run on the local terminal device 110 or the server 120.
When the method for displaying the crack effect operates on the server 120, the server 120 is used for providing a display service of the crack effect for a user of a terminal device, a client in communication with the server 120 is installed in the terminal device, the user can input an instruction for displaying the target crack effect at a target position of a target model through the client, after clicking a confirmation button, the client sends the instruction for displaying the target crack effect at the target position of the target model to the server 120, and the server 120 determines a mask graph, a height graph and a color gradient graph corresponding to the crack effect; synthesizing the mask map, the height map and the color gradient map to obtain a crack map corresponding to the crack effect; and displaying the crack effect at a target position based on the crack map. The server 120 may also send a display of the target crack effect to the client, which presents the display of the target crack effect to the user. Wherein the terminal device may be the aforementioned local terminal device 110.
When the method for displaying the crack effect is run on the server 120, the method can be implemented and executed based on the cloud interaction system.
The cloud interaction system comprises a client device and a cloud game server.
In some example embodiments, various cloud applications may be run under the cloud interaction system, such as: and (5) cloud game. Taking cloud game as an example, cloud game refers to a game mode based on cloud computing. In the running mode of the cloud game, the running main body of the game program and the game picture presentation main body are separated, the storage and running of the control method of the moving state in the game are completed on the cloud game server, and the client device is used for receiving and sending data and presenting the game picture, for example, the client device can be a display device with a data transmission function close to a user side, such as a mobile terminal, a television, a computer, a palm computer and the like; but the cloud game server which performs information processing is a cloud. When playing the game, the player operates the client device to send an operation instruction to the cloud game server, the cloud game server runs the game according to the operation instruction, codes and compresses data such as game pictures and the like, returns the data to the client device through a network, and finally decodes the data through the client device and outputs the game pictures.
In the above embodiments, the explanation was given taking the example that the display method of the crack effect is run on the server 120, but the disclosure is not limited thereto, and in some exemplary embodiments, the display method of the crack effect may also be run on the local terminal device 110.
The local terminal device 110 may include a display screen and a processor. The local terminal equipment 110 is provided with a client, a user can input an instruction for displaying the target crack effect at the target position of the target model through the client, after clicking a confirmation button, the client sends the instruction for displaying the target crack effect at the target position of the target model to a processor, and the processor determines a mask graph, a height graph and a color gradient graph corresponding to the crack effect; synthesizing the mask map, the height map and the color gradient map to obtain a crack map corresponding to the crack effect; and displaying the crack effect at a target position based on the crack map. The processor can also send a display screen of the target crack effect to the client, and the client displays the display screen of the target crack effect to a user through the display screen.
In some exemplary embodiments, taking a game as an example, the local terminal device 110 stores a game program and is used to present a game screen. The local terminal device 110 is used to interact with the player through a graphical user interface, i.e. to download and install a game program and run it conventionally through an electronic device. The manner in which the local terminal device 110 provides the graphical user interface to the player may include a variety of ways, for example, it may be rendered for display on a display screen of the terminal, or it may be provided to the player by holographic projection. For example, the local terminal device 110 may include a display screen for presenting a graphical user interface including game visuals, and a processor for running the game, generating the graphical user interface, and controlling the display of the graphical user interface on the display screen.
In some exemplary embodiments, the disclosure provides a method for displaying a crack effect, and a graphical user interface is provided through a terminal device, where the terminal device may be the aforementioned local terminal device 110 or the aforementioned client device in the cloud interaction system.
A method for displaying a crack effect according to an exemplary embodiment of the present disclosure will be described below in conjunction with the application scenarios of fig. 1 and 2. It should be noted that the above application scenario is only shown for the convenience of understanding the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in any way in this respect. Rather, embodiments of the present disclosure may be applied to any scenario where applicable.
Referring to fig. 3, a flow chart of a method for displaying a crack effect according to an embodiment of the disclosure is shown.
The display method of the crack effect comprises the following steps:
step S210, determining a mask diagram, a height diagram and a color gradient diagram corresponding to the crack effect.
In practice, referring to fig. 4, a mask is used to control the shape of the target fracture.
Referring to fig. 5, a height map for controlling a depth effect of a target crack, wherein white represents a depth deviation completely without deviation, and black represents a depth deviation; it can be realized that the target crack conforms to the depth change from deep to shallow from inside to outside, and the deepest part is the middle part.
Referring to fig. 6, a color gradation diagram for controlling a color gradation effect of a target crack, wherein the innermost is white, which means the brightest color, and the lighter the outermost color, the brightest effect of exposing magma at the center of the target crack.
And S220, synthesizing the mask map, the height map and the color gradient map to obtain a crack map corresponding to the crack effect.
And in the implementation, storing the mask map, the height map and the color gradient map into R, G and B channels respectively to synthesize the target crack map.
In this embodiment, the synthesizing the mask map, the height map, and the color gradient map to obtain the crack map corresponding to the crack effect includes:
determining a shape of the crack map based on the mask map;
determining a depth effect of the crack map based on the height map;
and determining the shading effect of the crack mapping based on the color gradient map.
In this embodiment, the determining, based on the altitude map, the depth effect of the crack map includes:
determining the offset step number and the offset amplitude;
and shifting the vertex of the crack map based on the height map, the shifting step number and the shifting amplitude to obtain the depth effect of the crack map.
In a specific implementation, when the position information of the crack map vertex is represented by UV coordinates, a formula for performing offset processing on the crack map vertex at the target position based on the altitude map, the preset offset step number and the preset offset amplitude is represented as follows:
UV’=UV+f(S,A,H);
wherein, UV' represents UV coordinates after the crack map vertex is deviated, UV represents UV coordinates before the crack map vertex is deviated, f represents a deviation function, S represents a preset deviation step number (Steps), a represents a preset deviation Amplitude (Amplitude), and H represents a height map.
As a specific example, the preset offset step number may be 5 and the preset offset amplitude may be 10 to 15.
In the above embodiment, after the offset processing is performed on the crack map vertex of the target position, the depth sensation can be simulated at all angles, and the method is a visual spoofing effect, and the original shape of the target model at the position where the crack effect is generated is not required to be changed.
In this embodiment, at least one of the mask map, the height map, and the color gradient map corresponding to the target crack effect is replaced, so that different target crack maps can be obtained.
When the method is implemented, the mask diagram is replaced, and the shape of the target crack can be changed;
Replacing the height map, and changing the depth effect of the target crack;
the color gradient effect of the target crack can be changed by replacing the color gradient map.
In the above embodiments, the content of the target crack map is described, in some embodiments, the size of the target crack map may be fixedly preset, in other embodiments, the size of the target crack map may be dynamically adjusted, and in the following, the dynamically adjusted size of the target crack map will be described.
In this embodiment, the method for determining the target fracture map includes:
determining a preset crack mapping;
and processing the preset crack mapping based on the size information of the target crack effect to obtain the target crack mapping.
In a specific implementation, the processing the preset crack map based on the size information of the target crack effect to obtain the target crack map includes:
and carrying out stretching treatment and/or shrinkage treatment on the preset crack mapping based on the size information of the target crack effect to obtain the target crack mapping.
As a specific example, according to the size information of the target crack effect, the rolling parameter of the preset crack map is adjusted to implement stretching treatment and/or shrinkage treatment on the preset crack map.
Wherein, the role of Tilling is to determine the size of a picture;
if the values of tilling. X and tilling. Y are both 0.5, then the size of the picture is 0.5 x 0.5;
if the values of tilling. X and tilling. Y are both 1, then the size of the picture is 1*1;
if the values of tilling. X and tilling. Y are both 2, then the size of the picture is 2 x 2.
In the above embodiment, the preset shape of the crack map is stretched or shrunk by changing the Tilling, however, this may cause deformation of the preset shape of the crack map, so, in order to avoid deformation of the preset shape of the crack map, the present disclosure also provides a determination method for stitching to obtain the target crack map, details of which are described in the following embodiments.
And step S230, displaying the crack effect at the target position based on the crack mapping.
In this embodiment, displaying the crack effect at the target location based on the crack map includes:
determining size information of the crack effect;
processing the crack map based on the size information of the crack effect to obtain a target crack map;
and displaying the crack effect at the target position based on the target crack map.
In this embodiment, the processing the crack map based on the size information of the crack effect to obtain a target crack map includes:
dividing the crack map into a first end crack map, a second end crack map, and an intermediate crack map;
determining size information of the first end crack map and the second end crack map;
obtaining a target number of the middle crack map based on the crack effect, the first end crack map and the second end crack map;
and splicing the first end crack mapping, the second end crack mapping and the target number of the middle crack mapping to obtain the target crack mapping.
Referring to fig. 7, as a specific example, a preset crack map 301 is divided into a first end crack map 302, a middle crack map 303, and a second end crack map 304.
In this embodiment, the dividing the crack map into a first end crack map, a second end crack map, and an intermediate crack map includes:
determining a mask map for division;
the split map is divided into the first end split map, the second end split map, and the intermediate split map based on the division mask map moving on the split map.
In this embodiment, displaying the crack effect at the target location based on the target crack map includes:
and moving the positions of the division masks according to a specified sequence, and controlling the first end crack mapping, the second end crack mapping and the middle crack mapping to be displayed at the target positions.
In this embodiment, the method further includes, after the first end crack map, the second end crack map, and the intermediate crack map are displayed in the target position in the specified order, controlling the first end crack map, the second end crack map, and the intermediate crack map to be displayed in the target position, where the first end crack map, the second end crack map, and the intermediate crack map are displayed in the specified order:
recording the first end crack map, the second end crack map, the intermediate crack map and display positions thereof, and controlling deletion of the display positions of the first end crack map, the second end crack map and the intermediate crack map in response to a deletion operation of the record so as to cancel the display.
The specific implementation method comprises the following steps: the growth direction and length of the target fracture effect can be controlled. The shape of the crack can be divided into a head part, a tail part and a middle part, and then the head part, the tail part and the middle part can be spliced according to the length each time, so that the shape of the crack can be ensured, and the shapes of the head part, the tail part and the middle part can be cut out by adjusting parameters in materials.
A complete slit can be considered to be made up of three parts, a head, a middle, and a tail. The length of the crack is not changed, and the crack has a head part and a tail part, and the effect of prolonging the length of the crack is achieved by superposing a plurality of middle sections. The head, the middle and the tail all share the same parent material and the map, so that the advantage is that no matter how many sections of heads exist, the middle and the tail can be combined into one batch for rendering, and the performance is improved.
The range to be displayed is controlled by moving the black-and-white mask in the Y-axis direction of the slit, so that the cutting effect is achieved. For example, if a head is to be cut, one such black and white mask is required, and then the middle and tail mask is moved down in sequence by the white portions of the mask. Only one parameter needs to be added to the parent material to control the extent of the mask, and the UV coordinates themselves can be used as a mask, with the advantage that they do not take up space nor require additional mapping and are not changed by resolution changes.
Specifically, the black-and-white mask is calculated by a smooth gradual change map:
referring to fig. 8, the smooth gradation map refers to a vertical-direction black-to-white gradation map in which the Y-coordinate of the UV-coordinate that has not been modified is long by default, and the Y-axis (G-channel) in the XY-axis (RG-channel) of the UV-coordinate is a smooth gradation map from 0 to 1 in value. What is needed here is a desired mask by some transformation of the UV coordinates, i.e. an output mask as shown in fig. 9 (black and white mask as described earlier), which is derived from the UV gradient map of the smooth gradient map. The output mask is a hard-sided, black up and down, and white in the middle. The hard edges are cut by subtracting to control the starting point of the fade and then removing the fractional part using the floor function. The method is specifically calculated by the following formula:
Out=floor(uv.y-MoveTop)*floor((1-uv.y)-MoveDown);
Out is the final output mask map, and the range of this white bar is controlled by changing the values of the two parameters MoveUp and MoveDown.
Where this fade starts, it is initially defaulted to 0 uppermost and then transitions to 1 lowermost by subtracting a value from the Y coordinate of uv. The above part can now be controlled by subtraction, all first 0, from a certain point on the transition from 0 to 1. This is to control the white area of the mask.
The mask pattern is multiplied by the original crack map to cut out the desired part, for example, the lower pattern can cut out the tail of the crack.
The program is transmitted into the length data of the nearest collision body, a plurality of sections of the middle section can be calculated according to the length data, the tail part is generated first, the middle section of a plurality of sections is generated again, and finally the head part is generated, so that the effect of crack growth is achieved. And the array is written in turn during regeneration, and the array can be traversed to clear the cracks when the cracks disappear.
Firstly, each part is very abrupt if appearing instantly and simultaneously, the reasonable effect is that the part grows gradually from the tail to the head, the growth effect is very complex if the part is made by a model, and model animation needs to be added, but the realization is realized based on mapping at present, so that the method is relatively simple. This is also one of the benefits of using mapping.
Firstly, the problem of crack generation with different lengths is not considered, and firstly, a basic method is described that the crack which comprises a tail part, a middle part and a head part is generated.
Firstly, three parts can be cut by the cutting method, and the method can change the display range of the crack by moving the mask, then the effect of growing animation can be simulated by slowly moving the mask range, when the mask range is expanded from the bottom to the top in a set time, the display range of the crack is gradually expanded from the tail to the head, and then the effect of growing the crack from the tail to the head can be simulated.
Mask range of movement range = mathf. Lerp (start point of movement, end point of movement, time of movement)
Based on this principle, the number of intermediate sections to be added can now be calculated based on the length to which the crack that has propagated in on the side of the program needs to be grown, considering that cracks of different lengths are generated first.
Middle number= (total length- (head length + tail length))/middle length
It is just as basic crack generation, but is generated several times more when generating the middle section. The tail, middle and head blocks are stored as a prefab (module) and then generated beginning at the designated world location to generate a head module.
Then the MoveDown needs to be moved to let the head module slowly show up for a prescribed time opnefactor head.
The world location point generated by the next segment is then updated forward,
it is also noted that since all the generated modules need to be destroyed uniformly when the crack effect disappears, the modules are sequentially questioned into an array when being generated, and finally the list is destroyed.
The principle of generating the middle section and the tail section is consistent with that of the head module, namely the middle section module needs to traverse an array for multiple times.
The appearance direction of the cracks is based on the movement of the mapping mask, the designated sequence is that the first end crack mapping is displayed firstly, then the middle crack mapping is displayed, and finally the mask is required to be moved up and down when the second end crack mapping is displayed; the specified sequence is to display the middle crack mapping first and then to display the mask spreading from the center when the first end crack mapping and the second end crack mapping are displayed simultaneously.
Referring to fig. 10, the effect of the generated target fracture is illustrated.
In this embodiment, displaying the crack effect at the target location based on the crack map includes:
and controlling the projection of the crack mapping to the target position so as to display the crack effect.
In the above-described exemplary embodiments, the display manner of the crack effect is described, and the display timing of the crack effect, that is, the trigger condition of the display manner of the crack effect will be described below.
In this exemplary embodiment, displaying the crack map at the target location includes:
and responding to the instruction for displaying the crack effect at the target position, and displaying the crack effect at the target position based on the crack mapping.
In this exemplary embodiment, the generation manner of the instruction includes:
and responding to the specified interaction behavior aiming at the target model through the specified model, and obtaining the instruction based on the specified interaction behavior.
The specific implementation method comprises the following steps: the specified model is a model acting on the surface of the target model;
the target model refers to a model acted on a surface by the specified model;
the appointed interaction behavior refers to interaction behavior of the appointed model aiming at the target model.
As a specific example, assuming that the specified model is a weapon model such as a knife, a sword, an axe, etc., the target model is a ground model, and the specified interaction behavior is actions such as splitting, chopping, sliding, etc., the specified interaction behavior of the target model through the specified model is specifically: the weapon models such as knives, swords and axes are used for carrying out actions such as splitting, chopping, sliding and the like on the ground model.
In the above-described embodiment, the instruction is described based on the specified interaction behavior with respect to the target model by the specified model, and a manner of determining the specified interaction behavior will be described below.
In this exemplary embodiment, specifying a determination manner of the interaction behavior includes:
traversing the edge of the appointed model and the surface of the target model to perform collision detection;
in response to a collision of an edge of the specified model with a face of the target model, it is determined that there is the specified interaction behavior for the target model by the specified model.
In specific implementation, the collision detection is performed by traversing the edge of the designated model and the surface of the target model, and specifically comprises the following steps:
judging whether the edge of the appointed model is intersected with the plane to which the surface of the target model belongs;
in response to determining that an edge of the specified model intersects a plane to which a face of the target model belongs, determining whether the intersection point of the intersection is on the face of the target model;
in response to determining that the intersection point of the intersections is on a face of the target model, it is determined that the specified interaction behavior exists.
In specific implementation, the surface of the target model is a triangular surface of the target model.
In the present exemplary embodiment, the instruction includes position information and direction information of the target position and the target crack effect; the generation mode of the instruction specifically comprises the following steps:
determining a trigger position and a trigger direction of the appointed interaction behavior;
and obtaining the position information and the direction information of the target position and the target crack effect based on the trigger position and the trigger direction.
The specific implementation method comprises the following steps: the trigger position is a contact position when the specified model is in contact with the target model;
the trigger direction is a movement direction of the specified model after contacting the target model.
And obtaining the position information and the direction information of the target position and the target crack effect based on the trigger position and the trigger direction, wherein the method specifically comprises the following steps:
based on the trigger position, obtaining position information of the target position and the target crack effect;
and obtaining the direction information of the target position and the target crack effect based on the triggering direction.
In this exemplary embodiment, the instruction further includes size information of the target position and the target crack effect; the generation mode of the instruction specifically comprises the following steps:
Determining the triggering speed of the appointed interaction behavior;
and obtaining the size information of the target position and the target crack effect based on the triggering speed.
The specific implementation method comprises the following steps: the trigger speed is the speed at which the specified model is in contact with the target model.
The influence of the triggering speed of the appointed interaction behavior on the sizes of the target position and the target crack effect is considered, and the faster the triggering speed is, the larger the sizes of the target position and the target crack effect are.
In this exemplary embodiment, the generation manner of the instruction specifically includes:
determining quality information of the specified model;
and obtaining the size information of the target position and the target crack effect based on the triggering speed and the quality information of the specified model.
Wherein the influence of the mass of the specified model on the target position and the size of the target fracture effect is also considered, and the heavier the mass of the specified model is, the larger the target position and the size of the target fracture effect are.
In this exemplary embodiment, the display mode of the crack effect includes:
determining an angle between the trigger direction and a normal to the trigger position;
Judging whether the angle is smaller than a preset angle threshold value or not;
in response to determining that the angle is less than the angle threshold, determining the specified order as displaying the intermediate fracture map first, and then displaying the first end fracture map and the second end fracture map simultaneously;
or alternatively, the first and second heat exchangers may be,
and in response to determining that the angle is equal to or greater than the angle threshold, determining the specified order to display the first end fracture map first, then the intermediate fracture map, and finally the second end fracture map.
In specific implementation, the specified sequence is obtained based on the trigger direction.
Referring to fig. 11, the determination of the order is specified, comprising the steps of:
step S410, determining an angle between the triggering direction and a normal line of the triggering position;
step S420, judging whether the angle is smaller than a preset angle threshold value;
step S430, in response to determining that the angle is less than the angle threshold, determining that the specified order is to display the middle crack map first, and then simultaneously display the first end crack map and the second end crack map;
or alternatively, the first and second heat exchangers may be,
step S440, in response to determining that the angle is equal to or greater than the angle threshold, determining that the specified order is to display the first end crack map first, then the intermediate crack map, and finally the second end crack map.
Referring to fig. 12, as a specific example, the specification model 501 specifies an interaction behavior with respect to the target model 502, specifies a trigger position of the interaction behavior as a trigger position 503, specifies a trigger direction of the interaction behavior as a trigger direction 504, and a normal line of the trigger position 503 as a normal line 505.
Determining an angle between the trigger direction 504 and a normal 505 to the trigger position 503;
judging whether the angle is smaller than a preset angle threshold (assuming that the angle threshold is 15 degrees), it can be seen that in fig. 12, if the angle is larger than 15 degrees, the designated sequence is determined to display the first end crack map first, then the middle crack map, and finally the second end crack map.
Referring to fig. 13, the sequence of displaying the first end crack map 302, the middle crack map 303, and the second end crack map 304 is shown, specifically: in the first stage, a first end crack map 302 is displayed, in the second stage, an intermediate crack map 303 is displayed again on the basis that the first end crack map 302 has been displayed, and in the third stage, a second end crack map 304 is displayed again on the basis that the first end crack map 302 and the intermediate crack map 303 have been displayed, so that a complete crack effect is obtained.
In some embodiments, the display sequence may also be to display the second end crack map first, then the middle crack map, and finally the first end crack map.
Referring to fig. 14, the sequence of displaying the second end crack map 304, the middle crack map 303, and the first end crack map 302 is shown, specifically: in the first stage, the second end crack map 304 is displayed, in the second stage, the intermediate crack map 303 is displayed again on the basis that the second end crack map 304 has been displayed, and in the third stage, the first end crack map 302 is displayed again on the basis that the second end crack map 304 and the intermediate crack map 303 have been displayed, so that a complete crack effect is obtained.
Referring to fig. 15, as a specific example, the specification model 601 specifies an interaction behavior with respect to the target model 602, specifies a trigger position of the interaction behavior as a trigger position 603, specifies a trigger direction of the interaction behavior as a trigger direction 604, and a normal line of the trigger position 603 as a normal line 605.
Determining an angle between the trigger direction 604 and a normal 605 of the trigger position 603;
judging whether the angle is smaller than a preset angle threshold (assuming that the angle threshold is 15 degrees), it can be seen that in fig. 15, the designated order is determined to display the middle crack map first and then display the first end crack map and the second end crack map at the same time.
Referring to FIG. 16, the sequence of displaying the middle crack map 303 is shown, followed by the first end crack map 302 and the second end crack map 304. Specific: in the first stage, the intermediate crack map 303 is displayed, and in the second stage, the first end crack map 302 and the second end crack map 304 are displayed simultaneously on the basis that the intermediate crack map 303 has been displayed, so as to obtain a complete crack effect.
As can be seen from the above, the method for displaying a crack effect provided by the embodiments of the present disclosure includes: determining a mask map, a height map and a color gradient map corresponding to the crack effect; synthesizing the mask map, the height map and the color gradient map to obtain a crack map corresponding to the crack effect; and displaying the crack effect at a target position based on the crack map. According to the method and the device, the display of the crack effect can be realized without changing the shape of the target object, the cost is low, and the universality is good.
It should be noted that the method of the embodiments of the present disclosure may be performed by a single device, such as a computer or a server. The method of the embodiment can also be applied to a distributed scene, and is completed by mutually matching a plurality of devices. In the case of such a distributed scenario, one of the devices may perform only one or more steps of the methods of embodiments of the present disclosure, the devices interacting with each other to accomplish the methods.
It should be noted that the foregoing describes some embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments described above and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Based on the same inventive concept, the present disclosure also provides a display device of a crack effect, corresponding to the method of any embodiment described above.
Referring to fig. 17, a schematic structural diagram of a display device for a crack effect according to an embodiment of the disclosure is shown.
The display device of crack effect includes following module:
a map data determining module 910 configured to determine a mask map, a height map, and a color gradation map corresponding to the crack effect;
the crack map determining module 920 is configured to synthesize the mask map, the height map, and the color gradient map, and obtain a crack map corresponding to the crack effect;
A crack effect display module 930 configured to display the crack effect at a target location based on the crack map.
In some exemplary embodiments, the crack map determination module 920 is configured to:
determining a shape of the crack map based on the mask map;
determining a depth effect of the crack map based on the height map;
and determining the shading effect of the crack mapping based on the color gradient map.
In some exemplary embodiments, the crack map determination module 920 is configured to:
determining the offset step number and the offset amplitude;
and shifting the vertex of the crack map based on the height map, the shifting step number and the shifting amplitude to obtain the depth effect of the crack map.
In some exemplary embodiments, the crack effect display module 930 is configured to:
determining size information of the crack effect;
processing the crack map based on the size information of the crack effect to obtain a target crack map;
and displaying the crack effect at the target position based on the target crack map.
In some exemplary embodiments, the crack effect display module 930 is configured to:
Dividing the crack map into a first end crack map, a second end crack map, and an intermediate crack map;
determining size information of the first end crack map and the second end crack map;
obtaining a target number of the middle crack map based on the crack effect, the first end crack map and the second end crack map;
and splicing the first end crack mapping, the second end crack mapping and the target number of the middle crack mapping to obtain the target crack mapping.
In some exemplary embodiments, the crack effect display module 930 is configured to:
determining a mask map for division;
the split map is divided into the first end split map, the second end split map, and the intermediate split map based on the division mask map moving on the split map.
In some exemplary embodiments, the crack effect display module 930 is configured to:
and moving the positions of the division masks according to a specified sequence, and controlling the first end crack mapping, the second end crack mapping and the middle crack mapping to be displayed at the target positions.
In some exemplary embodiments, the crack effect display module 930 is configured to:
recording the first end crack map, the second end crack map, the intermediate crack map and display positions thereof, and controlling deletion of the display positions of the first end crack map, the second end crack map and the intermediate crack map in response to a deletion operation of the record so as to cancel the display.
In some exemplary embodiments, the crack effect display module 930 is configured to:
and controlling the projection of the crack mapping to the target position so as to display the crack effect.
In some exemplary embodiments, the crack effect display module 930 is configured to: :
and responding to the instruction for displaying the crack effect at the target position, and displaying the crack effect at the target position based on the crack mapping.
In some exemplary embodiments, the crack effect display module 930 is configured to:
and responding to the specified interaction behavior aiming at the target model through the specified model, and obtaining the instruction based on the specified interaction behavior.
In some exemplary embodiments, the crack effect display module 930 is configured to:
Traversing the edge of the appointed model and the surface of the target model to perform collision detection;
in response to a collision of an edge of the specified model with a face of the target model, it is determined that there is the specified interaction behavior for the target model by the specified model.
In some exemplary embodiments, the instructions include location information and direction information of the target location and the target fracture effect; a crack effect display module 930 configured to:
determining a trigger position and a trigger direction of the appointed interaction behavior;
and obtaining the position information and the direction information of the target position and the target crack effect based on the trigger position and the trigger direction.
In some exemplary embodiments, the instructions further include size information of the target location and the target fracture effect; a crack effect display module 930 configured to:
determining the triggering speed of the appointed interaction behavior;
and obtaining the size information of the target position and the target crack effect based on the triggering speed.
In some exemplary embodiments, the crack effect display module 930 is configured to:
determining quality information of the specified model;
And obtaining the size information of the target position and the target crack effect based on the triggering speed and the quality information of the specified model.
In some exemplary embodiments, the crack effect display module 930 is configured to:
determining an angle between the trigger direction and a normal to the trigger position;
judging whether the angle is smaller than a preset angle threshold value or not;
in response to determining that the angle is less than the angle threshold, determining the specified order as displaying the intermediate fracture map first, and then displaying the first end fracture map and the second end fracture map simultaneously;
or alternatively, the first and second heat exchangers may be,
and in response to determining that the angle is equal to or greater than the angle threshold, determining the specified order to display the first end fracture map first, then the intermediate fracture map, and finally the second end fracture map.
For convenience of description, the above devices are described as being functionally divided into various modules, respectively. Of course, the functions of the various modules may be implemented in the same one or more pieces of software and/or hardware when implementing the present disclosure.
The device of the foregoing embodiment is used to implement the display method of the corresponding crack effect in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which are not described herein.
Based on the same inventive concept, the present disclosure also provides an electronic device corresponding to the method of any embodiment, including a memory, a processor, and a computer program stored on the memory and capable of running on the processor, where the processor implements the method for displaying a crack effect according to any embodiment when executing the program.
Fig. 18 shows a more specific hardware architecture of an electronic device according to this embodiment, where the device may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 implement communication connections therebetween within the device via a bus 1050.
The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit ), microprocessor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc. for executing relevant programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory ), static storage device, dynamic storage device, or the like. Memory 1020 may store an operating system and other application programs, and when the embodiments of the present specification are implemented in software or firmware, the associated program code is stored in memory 1020 and executed by processor 1010.
The input/output interface 1030 is used to connect with an input/output module for inputting and outputting information. The input/output module may be configured as a component in a device (not shown in the figure) or may be external to the device to provide corresponding functionality. Wherein the input devices may include a keyboard, mouse, touch screen, microphone, various types of sensors, etc., and the output devices may include a display, speaker, vibrator, indicator lights, etc.
Communication interface 1040 is used to connect communication modules (not shown) to enable communication interactions of the present device with other devices. The communication module may implement communication through a wired manner (such as USB, network cable, etc.), or may implement communication through a wireless manner (such as mobile network, WIFI, bluetooth, etc.).
Bus 1050 includes a path for transferring information between components of the device (e.g., processor 1010, memory 1020, input/output interface 1030, and communication interface 1040).
It should be noted that although the above-described device only shows processor 1010, memory 1020, input/output interface 1030, communication interface 1040, and bus 1050, in an implementation, the device may include other components necessary to achieve proper operation. Furthermore, it will be understood by those skilled in the art that the above-described apparatus may include only the components necessary to implement the embodiments of the present description, and not all the components shown in the drawings.
The electronic device of the foregoing embodiment is configured to implement the method for displaying the corresponding crack effect in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which are not described herein.
The memory 1020 stores machine readable instructions executable by the processor 1010, which when the electronic device is running, communicate between the processor 1010 and the memory 1020 over the bus 1030, causing the processor 1010 to execute the following instructions when running:
determining a mask map, a height map and a color gradient map corresponding to the crack effect;
synthesizing the mask map, the height map and the color gradient map to obtain a crack map corresponding to the crack effect;
and displaying the crack effect at a target position based on the crack map.
In a possible implementation manner, in the instructions executed by the processor 1010, the synthesizing the mask map, the height map, and the color gradient map to obtain a crack map corresponding to the crack effect includes:
determining a shape of the crack map based on the mask map;
determining a depth effect of the crack map based on the height map;
and determining the shading effect of the crack mapping based on the color gradient map.
In a possible implementation manner, in the instructions executed by the processor 1010, the determining, based on the altitude map, a depth effect of the crack map includes:
determining the offset step number and the offset amplitude;
and shifting the vertex of the crack map based on the height map, the shifting step number and the shifting amplitude to obtain the depth effect of the crack map.
In a possible implementation manner, in the instructions executed by the processor 1010, the displaying the crack effect at the target location based on the crack map includes:
determining size information of the crack effect;
processing the crack map based on the size information of the crack effect to obtain a target crack map;
and displaying the crack effect at the target position based on the target crack map.
In a possible implementation manner, in the instructions executed by the processor 1010, the processing the crack map based on the size information of the crack effect to obtain a target crack map includes:
dividing the crack map into a first end crack map, a second end crack map, and an intermediate crack map;
determining size information of the first end crack map and the second end crack map;
Obtaining a target number of the middle crack map based on the crack effect, the first end crack map and the second end crack map;
and splicing the first end crack mapping, the second end crack mapping and the target number of the middle crack mapping to obtain the target crack mapping.
In a possible implementation, the instructions executed by the processor 1010 divide the crack map into a first end crack map, a second end crack map, and an intermediate crack map, including:
determining a mask map for division;
the split map is divided into the first end split map, the second end split map, and the intermediate split map based on the division mask map moving on the split map.
In a possible implementation manner, in the instructions executed by the processor 1010, the displaying the crack effect at the target location based on the target crack map includes:
and moving the positions of the division masks according to a specified sequence, and controlling the first end crack mapping, the second end crack mapping and the middle crack mapping to be displayed at the target positions.
In a possible implementation, in the instructions executed by the processor 1010, the controlling the displaying of the first end crack map, the second end crack map, and the intermediate crack map after the target position in a specified order, the method further includes:
recording the first end crack map, the second end crack map, the intermediate crack map and display positions thereof, and controlling deletion of the display positions of the first end crack map, the second end crack map and the intermediate crack map in response to a deletion operation of the record so as to cancel the display.
In a possible implementation manner, in the instructions executed by the processor 1010, the displaying the crack effect at the target location based on the crack map includes:
and controlling the projection of the crack mapping to the target position so as to display the crack effect.
In a possible implementation manner, in the instructions executed by the processor 1010, the displaying the crack map at the target location includes:
and responding to the instruction for displaying the crack effect at the target position, and displaying the crack effect at the target position based on the crack mapping.
In a possible implementation manner, in an instruction executed by the processor 1010, the method further includes:
and responding to the specified interaction behavior aiming at the target model through the specified model, and obtaining the instruction based on the specified interaction behavior.
In a possible implementation manner, in an instruction executed by the processor 1010, the method further includes:
traversing the edge of the appointed model and the surface of the target model to perform collision detection;
in response to a collision of an edge of the specified model with a face of the target model, it is determined that there is the specified interaction behavior for the target model by the specified model.
In a possible implementation manner, the instructions executed by the processor 1010 include position information and direction information of the target position and the target crack effect;
the step of obtaining the instruction based on the specified interaction behavior comprises the following steps:
determining a trigger position and a trigger direction of the appointed interaction behavior;
and obtaining the position information and the direction information of the target position and the target crack effect based on the trigger position and the trigger direction.
In a possible implementation manner, the instructions executed by the processor 1010 further include size information of the target position and the target crack effect;
The step of obtaining the instruction based on the specified interaction behavior comprises the following steps:
determining the triggering speed of the appointed interaction behavior;
and obtaining the size information of the target position and the target crack effect based on the triggering speed.
In a possible implementation manner, in the instructions executed by the processor 1010, the instructions are obtained based on the specified interaction behavior, and further include:
determining quality information of the specified model;
and obtaining the size information of the target position and the target crack effect based on the triggering speed and the quality information of the specified model.
In a possible implementation manner, in an instruction executed by the processor 1010, the method further includes:
determining an angle between the trigger direction and a normal to the trigger position;
judging whether the angle is smaller than a preset angle threshold value or not;
in response to determining that the angle is less than the angle threshold, determining the specified order as displaying the intermediate fracture map first, and then displaying the first end fracture map and the second end fracture map simultaneously;
or alternatively, the first and second heat exchangers may be,
and in response to determining that the angle is equal to or greater than the angle threshold, determining the specified order to display the first end fracture map first, then the intermediate fracture map, and finally the second end fracture map.
Based on the same inventive concept, corresponding to any of the above embodiments, the present disclosure further provides a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method for displaying a crack effect as described in any of the above embodiments.
The non-transitory computer readable storage media described above can be any available media or data storage device that can be accessed by a computer, including, but not limited to, magnetic storage (e.g., floppy disks, hard disks, magnetic tapes, magneto-optical disks (MOs), etc.), optical storage (e.g., CD, DVD, BD, HVD, etc.), and semiconductor storage (e.g., ROM, EPROM, EEPROM, nonvolatile storage (NAND FLASH), solid State Disk (SSD)), etc.
The storage medium of the above embodiment stores computer instructions for causing the computer to perform the method for displaying a crack effect according to any one of the above exemplary method portions, and has the advantages of the corresponding method embodiments, which are not described herein.
Based on the same inventive concept, corresponding to the method for displaying a crack effect described in any of the above embodiments, the present disclosure further provides a computer program product comprising computer program instructions. In some embodiments, the computer program instructions may be executable by one or more processors of a computer to cause the computer and/or the processor to perform the method of displaying a crack effect. Corresponding to the execution subject corresponding to each step in each embodiment of the method for displaying a crack effect, the processor for executing the corresponding step may belong to the corresponding execution subject.
The computer program product of the foregoing embodiment is configured to enable the computer and/or the processor to perform the method for displaying a crack effect according to any one of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein.
Those skilled in the art will appreciate that embodiments of the present disclosure may be implemented as a system, method, or computer program product. Accordingly, the present disclosure may be embodied in the following forms, namely: all hardware, all software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software, is generally referred to herein as a "circuit," module, "or" system. Furthermore, in some embodiments, the present disclosure may also be embodied in the form of a computer program product in one or more computer-readable media, which contain computer-readable program code.
Any combination of one or more computer readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive example) of the computer-readable storage medium could include, for example: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer, for example, through the internet using an internet service provider.
It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable medium that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable medium produce an article of manufacture including instruction means which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
Furthermore, although the operations of the methods of the present disclosure are depicted in the drawings in a particular order, this is not required to or suggested that these operations must be performed in this particular order or that all of the illustrated operations must be performed in order to achieve desirable results. Rather, the steps depicted in the flowcharts may change the order of execution. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to perform, and/or one step decomposed into multiple steps to perform.
It should be noted that unless otherwise defined, technical or scientific terms used in the embodiments of the present disclosure should be given the ordinary meaning as understood by one of ordinary skill in the art to which the present disclosure pertains. The terms "first," "second," and the like, as used in embodiments of the present disclosure, do not denote any order, quantity, or importance, but rather are used to distinguish one element from another. The word "comprising" or "comprises", and the like, means that elements or items preceding the word are included in the element or item listed after the word and equivalents thereof, but does not exclude other elements or items. The terms "connected" or "connected," and the like, are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", etc. are used merely to indicate relative positional relationships, which may also be changed when the absolute position of the object to be described is changed. The article "a" or "an" preceding an element does not exclude the presence of a plurality of such elements.
While the spirit and principles of the present disclosure have been described with reference to several particular embodiments, it is to be understood that this disclosure is not limited to the particular embodiments disclosed nor does it imply that features in these aspects are not to be combined to benefit from this division, which is done for convenience of description only. The disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.

Claims (19)

1. A method for displaying a crack effect, comprising:
determining a mask map, a height map and a color gradient map corresponding to the crack effect;
synthesizing the mask map, the height map and the color gradient map to obtain a crack map corresponding to the crack effect;
and displaying the crack effect at a target position based on the crack map.
2. The method of claim 1, wherein the synthesizing the mask map, the height map, and the color gradient map to obtain a crack map corresponding to the crack effect comprises:
determining a shape of the crack map based on the mask map;
Determining a depth effect of the crack map based on the height map;
and determining the shading effect of the crack mapping based on the color gradient map.
3. The method of claim 2, wherein the determining a depth effect of the fracture map based on the height map comprises:
determining the offset step number and the offset amplitude;
and shifting the vertex of the crack map based on the height map, the shifting step number and the shifting amplitude to obtain the depth effect of the crack map.
4. The method of claim 1, wherein displaying the fracture effect at a target location based on the fracture map comprises:
determining size information of the crack effect;
processing the crack map based on the size information of the crack effect to obtain a target crack map;
and displaying the crack effect at the target position based on the target crack map.
5. The method of claim 4, wherein processing the crack map based on the size information of the crack effect to obtain a target crack map comprises:
dividing the crack map into a first end crack map, a second end crack map, and an intermediate crack map;
Determining size information of the first end crack map and the second end crack map;
obtaining a target number of the middle crack map based on the crack effect, the first end crack map and the second end crack map;
and splicing the first end crack mapping, the second end crack mapping and the target number of the middle crack mapping to obtain the target crack mapping.
6. The method of claim 5, wherein the dividing the crack map into a first end crack map, a second end crack map, and an intermediate crack map comprises:
determining a mask map for division;
the split map is divided into the first end split map, the second end split map, and the intermediate split map based on the division mask map moving on the split map.
7. The method of claim 6, wherein the displaying the fracture effect at the target location based on the target fracture map comprises:
and moving the positions of the division masks according to a specified sequence, and controlling the first end crack mapping, the second end crack mapping and the middle crack mapping to be displayed at the target positions.
8. The method of claim 7, wherein the controlling displays the first end crack map, the second end crack map, and the intermediate crack map in a specified order after the target location, the method further comprising:
recording the first end crack map, the second end crack map, the intermediate crack map and display positions thereof, and controlling deletion of the display positions of the first end crack map, the second end crack map and the intermediate crack map in response to a deletion operation of the record so as to cancel the display.
9. The method of claim 1, wherein displaying the fracture effect at a target location based on the fracture map comprises:
and controlling the projection of the crack mapping to the target position so as to display the crack effect.
10. The method of claim 5, wherein displaying the crack map at a target location comprises:
and responding to the instruction for displaying the crack effect at the target position, and displaying the crack effect at the target position based on the crack mapping.
11. The method according to claim 10, wherein the method further comprises:
And responding to the specified interaction behavior aiming at the target model through the specified model, and obtaining the instruction based on the specified interaction behavior.
12. The method of claim 11, wherein the method further comprises:
traversing the edge of the appointed model and the surface of the target model to perform collision detection;
in response to a collision of an edge of the specified model with a face of the target model, it is determined that there is the specified interaction behavior for the target model by the specified model.
13. The method of claim 11, wherein the instructions include location information and direction information for the target location and the target fracture effect;
the step of obtaining the instruction based on the specified interaction behavior comprises the following steps:
determining a trigger position and a trigger direction of the appointed interaction behavior;
and obtaining the position information and the direction information of the target position and the target crack effect based on the trigger position and the trigger direction.
14. The method of claim 13, wherein the instructions further include size information for the target location and the target fracture effect;
the step of obtaining the instruction based on the specified interaction behavior comprises the following steps:
Determining the triggering speed of the appointed interaction behavior;
and obtaining the size information of the target position and the target crack effect based on the triggering speed.
15. The method of claim 14, wherein the deriving the instruction based on the specified interaction behavior further comprises:
determining quality information of the specified model;
and obtaining the size information of the target position and the target crack effect based on the triggering speed and the quality information of the specified model.
16. The method of claim 15, wherein the method further comprises:
determining an angle between the trigger direction and a normal to the trigger position;
judging whether the angle is smaller than a preset angle threshold value or not;
in response to determining that the angle is less than the angle threshold, determining the specified order as displaying the intermediate fracture map first, and then displaying the first end fracture map and the second end fracture map simultaneously;
or alternatively, the first and second heat exchangers may be,
and in response to determining that the angle is equal to or greater than the angle threshold, determining the specified order to display the first end fracture map first, then the intermediate fracture map, and finally the second end fracture map.
17. A display device for a crack effect, comprising:
the mapping data determining module is configured to determine a mask map, a height map and a color gradient map corresponding to the crack effect;
the crack mapping determining module is configured to synthesize the mask map, the height map and the color gradient map to obtain a crack mapping corresponding to the crack effect;
and the crack effect display module is configured to display the crack effect at a target position based on the crack map.
18. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of claims 1 to 16 when the program is executed.
19. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1 to 16.
CN202311397541.8A 2023-10-25 2023-10-25 Crack effect display method and device, electronic equipment and storage medium Pending CN117392286A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311397541.8A CN117392286A (en) 2023-10-25 2023-10-25 Crack effect display method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311397541.8A CN117392286A (en) 2023-10-25 2023-10-25 Crack effect display method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117392286A true CN117392286A (en) 2024-01-12

Family

ID=89464469

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311397541.8A Pending CN117392286A (en) 2023-10-25 2023-10-25 Crack effect display method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117392286A (en)

Similar Documents

Publication Publication Date Title
US9426259B2 (en) Client server interaction for graphical/audio applications
US11468915B2 (en) Automatic video montage generation
CN112074876A (en) Authoring content in a three-dimensional environment
KR101267120B1 (en) Mapping graphics instructions to associated graphics data during performance analysis
US9552342B2 (en) Generating a collage for rendering on a client computing device
CN109771951A (en) Method, apparatus, storage medium and the electronic equipment that map generates
Dirksen Three. js essentials
KR20210030384A (en) 3D transition
EP4058162A1 (en) Programmatically configuring materials
US20090201288A1 (en) Rendering 3D Computer Graphics Using 2D Computer Graphics Capabilities
US20120133660A1 (en) Data processing method and apparatus in heterogeneous multi-core environment
US10293259B2 (en) Control of audio effects using volumetric data
Moreau-Mathis Babylon. js Essentials
US20200082586A1 (en) Generating and providing composition effect tutorials for creating and editing digital content
CN117252959A (en) Method and device for generating special effect animation, electronic equipment and storage medium
CN117392286A (en) Crack effect display method and device, electronic equipment and storage medium
US20150269781A1 (en) Rapid Virtual Reality Enablement of Structured Data Assets
US11928762B2 (en) Asynchronous multi-user real-time streaming of web-based image edits using generative adversarial network(s)
KR101806922B1 (en) Method and apparatus for producing a virtual reality content
CN113192173B (en) Image processing method and device of three-dimensional scene and electronic equipment
Dirksen Three. js Cookbook
CN103295181B (en) A kind of stacking method and device of particle file and video
CN110169087B (en) Redirecting audio output
US20190340830A1 (en) Projection of content libraries in three-dimensional environment
US11907646B1 (en) HTML element based rendering supporting interactive objects

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