Method, device and storage medium for generating fragmentation animation
Patent Information
- Application Number
- CN202211427993.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-15
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2042-11-15
AI Technical Summary
[0004]本发明至少部分实施例提供了一种碎裂动画的生成方法、装置和存储介质,以至少解决现有技术中碎裂效果显示效果差,导致用户体验差的技术问题
[0009]In at least some embodiments of the present invention, a crack map and a target model are obtained; the target model is cut based on the crack map to obtain a fragment model; texture sampling is performed on the target model and the fragment model respectively to obtain the first texture coordinates corresponding to the target model and the second texture coordinates corresponding to the fragment model; a three-dimensional shattering animation is generated based on the crack map, the first texture coordinates, and the second texture coordinates, thereby achieving the purpose of generating a three-dimensional shattering animation, thus realizing the technical effect of improving the artistic effect of the shattering effect, and solving the technical problem of poor display effect of shattering effect in the prior art, which leads to poor user experience.
Smart Images

Figure CN115713586B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of 3D animation production, and more specifically, to a method, apparatus, and storage medium for generating fragmented animation. Background Technology
[0002] With the advancement of technology and the widespread adoption of smart devices, people have increasingly higher demands for the display quality on device screens. However, in current technologies, displaying a shattered image on a device results in poor image quality, leading to a poor user experience.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] At least some embodiments of the present invention provide a method, apparatus and storage medium for generating shattering animations, so as to at least solve the technical problem of poor display effect of shattering effect in the prior art, which leads to poor user experience.
[0005] According to one embodiment of the present invention, a method for generating a shattering animation is provided, comprising: acquiring a crack map and a target model; cutting the target model based on the crack map to obtain a fragment model; performing texture sampling on the target model and the fragment model respectively to obtain a first texture coordinate corresponding to the target model and a second texture coordinate corresponding to the fragment model; and generating a three-dimensional shattering animation based on the crack map, the first texture coordinate, and the second texture coordinate.
[0006] According to one embodiment of the present invention, a device for generating a shattering animation is provided, characterized in that it includes: an acquisition module for acquiring a crack texture map and a target model; a cutting module for cutting the target model based on the crack texture map to obtain a fragment model; a sampling module for performing texture sampling on the target model and the fragment model respectively to obtain a first texture coordinate corresponding to the target model and a second texture coordinate corresponding to the fragment model; and a generation module for generating a three-dimensional shattering animation based on the crack texture map, the first texture coordinate, and the second texture coordinate.
[0007] According to one embodiment of the present invention, a non-volatile storage medium is provided, wherein a computer program is stored in the non-volatile storage medium, and the computer program is configured to execute the method for generating the shattering animation in the embodiment of the present invention when run by a processor.
[0008] According to one embodiment of the present invention, an electronic device is provided, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to execute the method for generating shattering animations according to the embodiments of the present invention.
[0009] In at least some embodiments of the present invention, a crack map and a target model are obtained; the target model is cut based on the crack map to obtain a fragment model; texture sampling is performed on the target model and the fragment model respectively to obtain the first texture coordinates corresponding to the target model and the second texture coordinates corresponding to the fragment model; a three-dimensional shattering animation is generated based on the crack map, the first texture coordinates, and the second texture coordinates, thereby achieving the purpose of generating a three-dimensional shattering animation, thus realizing the technical effect of improving the artistic effect of the shattering effect, and solving the technical problem of poor display effect of shattering effect in the prior art, which leads to poor user experience. Attached Figure Description
[0010] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:
[0011] Figure 1 This is a hardware structure block diagram of a mobile terminal for a method of generating a shattering animation according to an embodiment of the present invention.
[0012] Figure 2 This is a flowchart of a method for generating a shattering animation according to one embodiment of the present invention;
[0013] Figure 3 This is a schematic diagram of the target model in a method for generating a shattering animation according to an embodiment of the present invention;
[0014] Figure 4A It is the initial texture in a method for generating a shattering animation in an embodiment of the present invention;
[0015] Figure 4B This is an initial texture that undergoes partial lighting processing in a method for generating a shattering animation according to an embodiment of the present invention;
[0016] Figure 4C It is a crack texture in a method for generating a shattering animation in an embodiment of the present invention;
[0017] Figure 5 It is a texture map of the target model in a method for generating a shattering animation in an embodiment of the present invention;
[0018] Figure 6 It is a texture map of the fragment model in a method for generating a fragmentation animation in an embodiment of the present invention;
[0019] Figure 7 This is a three-dimensional fragmentation animation of a fragment model in a fragmentation animation generation method in an embodiment of the present invention;
[0020] Figure 8This is a structural block diagram of a device for generating a shattering animation according to one embodiment of the present invention;
[0021] Figure 9 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation
[0022] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0024] According to one embodiment of the present invention, an embodiment of a method for generating a shattering animation is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0025] This method embodiment can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, the mobile terminal can be a smartphone (such as an Android phone, iOS phone, etc.), tablet computer, PDA, mobile Internet Device (MID), PAD, game console, and other terminal devices. Figure 1 This is a hardware structure block diagram of a mobile terminal for a method of generating a shattering animation according to an embodiment of the present invention. For example... Figure 1 As shown, a mobile terminal may include one or more ( Figure 1Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a central processing unit (CPU), graphics processing unit (GPU), digital signal processing (DSP) chip, microprocessor (MCU), programmable logic device (FPGA), neural network processor (NPU), tensor processor (TPU), artificial intelligence (AI) type processor, etc.) and a memory 104 for storing data are also shown. Optionally, the mobile terminal may further include a transmission device 106 for communication functions, an input / output device 108, and a display device 110. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0026] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the method for generating the shattering animation in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby realizing the aforementioned method for generating the shattering animation. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0027] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0028] The inputs in input / output device 108 can come from multiple human interface devices (HIDs). Examples include keyboards and mice, gamepads, and other dedicated game controllers (such as steering wheels, fishing rods, dance mats, and remote controls). Some HIDs, in addition to providing input functions, can also provide output functions, such as force feedback and vibration from gamepads, and audio output from controllers.
[0029] Display device 110 may be, for example, a head-up display (HUD), a touchscreen liquid crystal display (LCD), and a touch display (also referred to as a "touchscreen" or "touch display"). The LCD allows a user to interact with the user interface of the mobile terminal. In some embodiments, the mobile terminal has a graphical user interface (GUI), which allows the user to interact with the GUI by touching and / or gesturing on a touch-sensitive surface. Optional human-computer interaction functions include: creating web pages, drawing, word processing, creating electronic documents, playing games, video conferencing, instant messaging, sending and receiving emails, a call interface, playing digital video, playing digital music, and / or web browsing, etc. Executable instructions for performing the above human-computer interaction functions are configured / stored in one or more processor-executable computer program products or readable storage media.
[0030] In one embodiment of this disclosure, the method for generating a shattering animation can run on a local terminal device or a server. When the method for generating a shattering animation runs on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and client devices.
[0031] In one possible implementation, embodiments of the present invention provide a method for generating a shattering animation. Figure 2 This is a flowchart of the generation of a three-dimensional fragmentation animation according to one embodiment of the present invention, such as... Figure 2 As shown, the method includes the following steps:
[0032] Step S202: Obtain the crack texture and target model.
[0033] Specifically, the crack texture mentioned above can be a crack pattern of fragile items, such as the crack pattern of broken glass or broken crystal. The target model corresponds to the 3D model of the crack texture. For example, if the crack texture is a glass crack texture, the target model can be a glass model. It should be noted that this glass model can be a model of a single piece of glass, or a model of a glass object, such as a wine glass or a tabletop.
[0034] As an alternative implementation, if the target model is a glass model of a piece of glass, the target model can be as follows: Figure 3 As shown.
[0035] Optionally, generating the crack texture map corresponding to the 3D shattering animation includes: constructing cracks in different directions to generate an initial texture map; and applying lighting processing to the initial texture map to obtain the crack texture map. For example, after determining the desired 3D shattering animation, firstly, crack textures in different directions are constructed according to the desired 3D shattering animation, resulting in... Figure 4A The initial texture shown is as follows: Figure 4A As shown, Figure 4A The white lines are used to represent the cracks that have been drawn.
[0036] Optionally, the initial texture is subjected to lighting processing to obtain a crack texture, including: determining a target fragment of a preset shape in the initial texture; and applying lighting processing to a portion of the area where the target fragment is located to obtain the crack texture. Here, the fragment in the initial texture refers to an area composed of cracks in different directions. The preset shape can be a shape preset by the artists.
[0037] As an optional implementation, after obtaining the initial texture, lighting processing is applied to the initial texture to add lighting effects and enhance the three-dimensionality of the crack texture, such as... Figure 4B As shown, Figure 4B The lower half is the section where lighting effects have been added. Figure 4B The upper part is the initial texture without lighting effects. Figure 4A After adding lighting effects to all the initial textures shown, the result is as follows: Figure 4C The crack texture shown.
[0038] Step S204: Cut the target model based on the crack map to obtain the fragment model.
[0039] In one alternative embodiment, the target model can be cut according to the direction of the crack in the crack map to obtain multiple fragment models.
[0040] Step S206: Perform texture sampling on the target model and the fragment model respectively to obtain the first texture coordinates corresponding to the target model and the second texture coordinates corresponding to the fragment model.
[0041] In an optional embodiment, the first texture coordinates corresponding to the target model are used to characterize the UV coordinates corresponding to the target model, and the second texture coordinates corresponding to the fragment model are used to characterize the UV coordinates of the fragment model.
[0042] As an optional implementation, after obtaining the target model and the fragment model, glass texture sampling can be performed on the fragment model to obtain, as shown below. Figure 5 The texture map of the glass fragments shown. Figure 5 Irregular small fragments are used to represent the texture of the fragment model. Furthermore, texture sampling can also be performed on the target model to obtain, for example... Figure 6 The texture map of the target model shown.
[0043] Step S208: Generate a 3D shattering animation based on the crack map, the first texture coordinates, and the second texture coordinates.
[0044] As an optional implementation, the crack map can be texture-sampled using the first texture coordinates to obtain the color of the R channel of the crack map, i.e., the first preset channel color. This R channel color can be used as the self-illumination color of the fragment model. Alternatively, a preset ablation map can be texture-sampled using the second texture coordinates to obtain the color of the R channel of the preset ablation map, i.e., the second preset channel color. Furthermore, a preset refraction map (Noise) can be texture-sampled based on the first texture coordinates to obtain the color of the R channel of the preset refraction map, i.e., the third channel color. After obtaining the R channel color of the preset ablation map, the second channel color can be processed using the ablation function MF_Dissolve to obtain the ablation result MF_DissolveResult. Subsequently, the first channel color is multiplied by the ablation result MF_DissolveResult to obtain the product of the first channel color and the ablation result MF_DissolveResult, which is used as the opacity of the fragment model, i.e., the first target color.
[0045] Then, the product of the ablation result MF_DissolveResult and the third channel color is obtained to get the second target color, which can be used as the refraction of the fragment model.
[0046] Finally, vertex animation processing is performed on the fragment model based on the texture color, the first target color, the second target color, the second texture coordinates, and the offset degree to obtain a 3D fragmentation animation.
[0047] As an optional implementation, the three-dimensional fragmentation animation generated using the method provided by this invention can, as... Figure 7 As shown, it achieves a good three-dimensional art effect.
[0048] In the above embodiments of the present invention, after obtaining the crack map and the target model, the target model is cut based on the crack map to obtain a three-dimensional fragment model, which can make the subsequently generated three-dimensional fragmentation animation more realistic. Subsequently, the target model and the fragment model are sampled to obtain the first texture coordinates and the second texture coordinates. Finally, the crack map, the first texture coordinates and the second texture coordinates are rendered to obtain a more three-dimensional fragmentation animation, which achieves the technical effect of improving the user experience and solves the technical problem of poor fragmentation effect display in the prior art, resulting in a poor user experience.
[0049] Optionally, a 3D fragmentation animation is generated based on the crack map, the first texture coordinates, and the second texture coordinates, including: performing texture sampling on the crack map using the first texture coordinates to obtain the texture color of the crack map; and performing vertex animation processing on the fragment model based on the texture color and the second texture coordinates to obtain the 3D fragmentation animation.
[0050] As an optional implementation, the texture color can be the color of the R channel obtained by sampling the crack texture using the first texture coordinates, and the texture color can be used as the self-illuminating color of the fragment model.
[0051] In the above optional embodiments, texture sampling is performed based on the first texture coordinates and the crack map to obtain the texture color, which facilitates subsequent vertex animation processing based on the texture color and the second texture coordinates, thereby improving the generation efficiency of the 3D shattering animation.
[0052] Optionally, vertex animation processing is performed on the fragment model based on texture color and second texture coordinates to obtain a 3D fragmentation animation, including: obtaining the degree of control offset, wherein the degree of control offset is used to control the degree of offset of the fragment model; and vertex animation processing is performed on the fragment model based on texture color, second texture coordinates and control offset to obtain a 3D fragmentation animation.
[0053] As an optional implementation, the aforementioned control offset can be a WPO (World Position Offset) parameter, and can be used as the global position offset of the fragment model.
[0054] Optionally, vertex animation processing is performed on the fragment model based on texture color, second texture coordinates, and offset degree to obtain a 3D fragmentation animation, including: texture sampling of the crack map using the first texture coordinates to obtain a first channel color, wherein the first channel color is the color of the first preset channel of the crack map; texture sampling of a preset ablation map using the second texture coordinates to obtain a second channel color, wherein the second channel color is the color of the second preset channel of the preset ablation map; processing the second channel color using an ablation function to generate an ablation result; obtaining the product of the ablation result and the first channel color to obtain a first target color; and vertex animation processing is performed on the fragment model based on texture color, first target color, second texture coordinates, and offset degree to obtain a 3D fragmentation animation.
[0055] As an optional implementation, the first and second preset channels can be R channels. The ablation map can be a map used to control the ablation effect. The first target color can be used as the opacity of the fragment model.
[0056] Optionally, vertex animation processing is performed on the fragment model based on the texture color, the first target color, the second texture coordinates, and the offset degree to obtain a 3D fragmentation animation, including: performing texture sampling on a preset refraction map based on the first texture coordinates to obtain a third channel color, wherein the third channel color is the color of the third preset channel of the preset refraction map; obtaining the product of the ablation result and the third channel color to obtain the second target color; and performing vertex animation processing on the fragment model based on the texture color, the first target color, the second target color, the second texture coordinates, and the offset degree to obtain a 3D fragmentation animation.
[0057] As an optional implementation, the third preset channel is the R channel. The preset refraction map is used to preserve the grayscale information of the model and to calculate the refraction of the fragment model. The second target color can be used as the refraction of the fragment model.
[0058] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0059] This embodiment also provides a device for generating shattering animations, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the terms "unit" and "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0060] Figure 8 This is a structural block diagram of a device for generating shattering animation according to one embodiment of the present invention, such as... Figure 8 As shown, the device includes:
[0061] Module 82 is used to acquire crack textures and target models.
[0062] The cutting module 84 is used to cut the target model based on the crack map to obtain the fragment model.
[0063] The sampling module 86 is used to perform texture sampling on the target model and the fragment model respectively, so as to obtain the first texture coordinates corresponding to the target model and the second texture coordinates corresponding to the fragment model.
[0064] The generation module 88 is used to generate a 3D fracturing animation based on the crack map, the first texture coordinates, and the second texture coordinates.
[0065] In at least some embodiments of the present invention, after obtaining the crack map and the target model, the target model is cut based on the crack map to obtain a three-dimensional fragment model, which can make the three-dimensional fragmentation animation more realistic. Subsequently, the target model and the fragment model are sampled to obtain the first texture coordinates and the second texture coordinates. Finally, the crack map, the first texture coordinates and the second texture coordinates are rendered to obtain a more three-dimensional fragmentation animation, which achieves the technical effect of improving the user experience and solves the technical problem of poor fragmentation effect display in the prior art, resulting in a poor user experience.
[0066] Optionally, the generation module includes: a sampling unit for sampling the crack map using the first texture coordinates to obtain the texture color of the crack map; and an animation processing unit for performing vertex animation processing on the fragment model based on the texture color and the second texture coordinates to obtain a three-dimensional fragmentation animation.
[0067] Optionally, the animation processing unit includes: an acquisition subunit for acquiring the control offset degree, wherein the control offset degree is used to control the offset degree of the fragment model; and an animation processing subunit for performing vertex animation processing on the fragment model based on the texture color, the second texture coordinates and the control offset degree to obtain a three-dimensional fragmentation animation.
[0068] Optionally, the animation processing subunit is further configured to perform texture sampling on the crack map using the first texture coordinates to obtain a first channel color, wherein the first channel color is the color of the first preset channel of the crack map; perform texture sampling on the preset ablation map using the second texture coordinates to obtain a second channel color, wherein the second channel color is the color of the second preset channel of the preset ablation map; process the second channel color using the ablation function to generate an ablation result; obtain the product of the ablation result and the first channel color to obtain a first target color; and perform vertex animation processing on the fragment model based on the texture color, the first target color, the second texture coordinates, and the offset degree to obtain a three-dimensional fragmentation animation.
[0069] Optionally, the animation processing subunit is also used to perform texture sampling on the preset refraction map based on the first texture coordinates to obtain the third channel color, wherein the third channel color is the color of the third preset channel of the preset refraction map; obtain the product of the ablation result and the third channel color to obtain the second target color; and perform vertex animation processing on the fragment model based on the texture color, the first target color, the second target color, the second texture coordinates and the offset degree to obtain a three-dimensional fragmentation animation.
[0070] Optionally, the acquisition module includes: a determination unit for determining a target fragment of a preset shape in the initial texture map; and a lighting unit for applying lighting to a portion of the area where the target fragment is located to obtain a crack texture map.
[0071] Optionally, the lighting unit includes: a determining subunit for determining a target fragment of a preset shape in the initial texture; and a processing subunit for performing lighting processing on a portion of the area where the target fragment is located to obtain a crack texture.
[0072] Embodiments of the present invention also provide a non-volatile storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when running.
[0073] Optionally, in this embodiment, the aforementioned non-volatile storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0074] Optionally, in this embodiment, the non-volatile storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0075] Optionally, in this embodiment, the non-volatile storage medium can be configured to store a computer program for performing the following steps: performing texture sampling on the crack map using the first texture coordinates to obtain the texture color of the crack map; and performing vertex animation processing on the fragment model based on the texture color and the second texture coordinates to obtain a three-dimensional fragmentation animation.
[0076] Optionally, in this embodiment, the non-volatile storage medium can be configured to store a computer program for performing the following steps: obtaining a control offset degree, wherein the control offset degree is used to control the offset degree of the fragment model; performing vertex animation processing on the fragment model based on the texture color, the second texture coordinates and the control offset degree to obtain a three-dimensional fragmentation animation.
[0077] Optionally, in this embodiment, the aforementioned non-volatile storage medium can be configured to store a computer program for performing the following steps: performing texture sampling on a crack map using first texture coordinates to obtain a first channel color, wherein the first channel color is the color of a first preset channel of the crack map; performing texture sampling on a preset ablation map using second texture coordinates to obtain a second channel color, wherein the second channel color is the color of a second preset channel of the preset ablation map; processing the second channel color using an ablation function to generate an ablation result; obtaining the product of the ablation result and the first channel color to obtain a first target color; and performing vertex animation processing on the fragment model based on the map color, the first target color, the second texture coordinates, and the offset degree to obtain a three-dimensional fragmentation animation.
[0078] Optionally, in this embodiment, the non-volatile storage medium can be configured to store a computer program for performing the following steps: performing texture sampling on a preset refraction map based on the first texture coordinates to obtain a third channel color, wherein the third channel color is the color of the third preset channel of the preset refraction map; obtaining the product of the ablation result and the third channel color to obtain a second target color; performing vertex animation processing on the fragment model based on the map color, the first target color, the second target color, the second texture coordinates, and the offset degree to obtain a three-dimensional fragmentation animation.
[0079] Optionally, in this embodiment, the non-volatile storage medium can be configured to store a computer program for performing the following steps: constructing cracks in different directions to generate an initial texture; and performing lighting processing on the initial texture to obtain a crack texture.
[0080] Optionally, in this embodiment, the non-volatile storage medium can be configured to store a computer program for performing the following steps: determining a target fragment of a preset shape in the initial texture map; and performing lighting processing on a portion of the area where the target fragment is located to obtain a crack texture map.
[0081] Optionally, in this embodiment, the aforementioned non-volatile storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0082] In the non-volatile storage medium of this embodiment, after acquiring the crack map and the target model, the target model is cut based on the crack map to obtain a three-dimensional fragment model, which can make the three-dimensional fragmentation animation more realistic. Subsequently, the target model and the fragment model are sampled to obtain the first texture coordinates and the second texture coordinates. Finally, the crack map, the first texture coordinates and the second texture coordinates are rendered to obtain a more three-dimensional fragmentation animation, which achieves the technical effect of improving the user experience and solves the technical problem of poor fragmentation effect display in the prior art, resulting in a poor user experience.
[0083] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (such as a CD-ROM, USB flash drive, portable hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the method according to the embodiments of the present invention.
[0084] In exemplary embodiments of the present invention, a computer-readable storage medium stores a program product capable of implementing the methods described above in this embodiment. In some possible implementations, various aspects of the embodiments of the present invention can also be implemented as a program product comprising program code, which, when run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this embodiment according to various exemplary embodiments of the present invention.
[0085] According to embodiments of the present invention, a program product for implementing the above-described method may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In the embodiments of the present invention, the computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0086] The aforementioned program product may take the form of any combination of one or more computer-readable media. Such computer-readable storage media may be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (not exhaustive) of computer-readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0087] It should be noted that the program code contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0088] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0089] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0090] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0091] S1, obtain the crack texture and target model;
[0092] S2, the target model is cut based on the crack map to obtain the fragment model;
[0093] S3, perform texture sampling on the target model and the fragment model respectively to obtain the first texture coordinates corresponding to the target model and the second texture coordinates corresponding to the fragment model;
[0094] S4 generates a 3D shattering animation based on the crack map, the first texture coordinates, and the second texture coordinates.
[0095] Optionally, the processor described above can also be configured to perform the following steps via a computer program: perform texture sampling on the crack map using the first texture coordinates to obtain the texture color of the crack map; and perform vertex animation processing on the fragment model based on the texture color and the second texture coordinates to obtain a three-dimensional fragmentation animation.
[0096] Optionally, the processor described above can also be configured to perform the following steps via a computer program: obtaining the degree of control offset, wherein the degree of control offset is used to control the degree of offset of the fragment model; performing vertex animation processing on the fragment model based on the texture color, the second texture coordinates and the degree of control offset to obtain a three-dimensional fragmentation animation.
[0097] Optionally, the processor described above can also be configured to perform the following steps via a computer program: performing texture sampling on the crack map using first texture coordinates to obtain a first channel color, wherein the first channel color is the color of a first preset channel of the crack map; performing texture sampling on a preset ablation map using second texture coordinates to obtain a second channel color, wherein the second channel color is the color of a second preset channel of the preset ablation map; processing the second channel color using an ablation function to generate an ablation result; obtaining the product of the ablation result and the first channel color to obtain a first target color; and performing vertex animation processing on the fragment model based on the texture color, the first target color, the second texture coordinates, and the offset degree to obtain a three-dimensional fragmentation animation.
[0098] Optionally, the processor may also be configured to perform the following steps via a computer program: perform texture sampling on a preset refraction map based on the first texture coordinates to obtain a third channel color, wherein the third channel color is the color of the third preset channel of the preset refraction map; obtain the product of the ablation result and the third channel color to obtain a second target color; and perform vertex animation processing on the fragment model based on the texture color, the first target color, the second target color, the second texture coordinates, and the offset degree to obtain a three-dimensional fragmentation animation.
[0099] Optionally, the processor described above can also be configured to perform the following steps via a computer program: constructing cracks in different directions to generate an initial texture; and performing lighting processing on the initial texture to obtain a crack texture.
[0100] Optionally, the processor may also be configured to perform the following steps via a computer program: determine a target fragment of a preset shape in the initial texture map; and perform lighting processing on a portion of the area where the target fragment is located to obtain a crack texture map.
[0101] In the electronic device of this embodiment, after acquiring the crack map and the target model, the target model is cut based on the crack map to obtain a three-dimensional fragment model, which can make the three-dimensional fragmentation animation more realistic. Subsequently, the target model and the fragment model are sampled to obtain the first texture coordinates and the second texture coordinates. Finally, the crack map, the first texture coordinates and the second texture coordinates are rendered to obtain a more three-dimensional fragmentation animation, which achieves the technical effect of improving the user experience and solves the technical problem of poor fragmentation effect display in the prior art, resulting in a poor user experience.
[0102] Figure 9 This is a schematic diagram of an electronic device according to an embodiment of the present invention. Figure 9 As shown, the electronic device 900 is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0103] like Figure 9 As shown, the electronic device 900 is presented in the form of a general-purpose computing device. The components of the electronic device 900 may include, but are not limited to: at least one processor 910, at least one memory 920, a bus 930 connecting different system components (including memory 920 and processor 910), and a display 940.
[0104] The memory 920 stores program code that can be executed by the processor 910, causing the processor 910 to perform the steps described in the method section of the present invention, according to various exemplary embodiments of the present invention.
[0105] The memory 920 may include a readable medium in the form of volatile memory cells, such as random access memory (RAM) 9201 and / or cache memory 9202, and may further include read-only memory (ROM) 9203, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
[0106] In some instances, memory 920 may also include a program / utility 9204 having a set (at least one) of program modules 9205, including but not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Memory 920 may further include memory remotely located relative to processor 910, which can be connected to electronic device 900 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0107] Bus 930 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, peripheral bus, graphics acceleration port, processor 910, or a local bus using any of the various bus structures.
[0108] The display 940 may be, for example, a touchscreen liquid crystal display (LCD) that allows a user to interact with the user interface of the electronic device 900.
[0109] Optionally, the electronic device 900 can also communicate with one or more external devices 1000 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 900, and / or any device that enables the electronic device 900 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via the input / output (I / O) interface 950. Furthermore, the electronic device 900 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via the network adapter 960. Figure 9 As shown, network adapter 960 communicates with other modules of electronic device 900 via bus 930. It should be understood that, although... Figure 9 As not shown, other hardware and / or software modules may be used in conjunction with electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0110] The aforementioned electronic device 900 may also include: a keyboard, a cursor control device (such as a mouse), an input / output interface (I / O interface), a network interface, a power supply, and / or a camera.
[0111] Those skilled in the art will understand that Figure 9 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, the electronic device 900 may also include components that are more... Figure 9 The more or fewer components shown, or having the same Figure 1 Different configurations are shown. The memory 920 can be used to store computer programs and corresponding data, such as the computer program and corresponding data corresponding to the three-dimensional fragmentation animation generation method in this embodiment of the invention. The processor 910 executes various functional applications and data processing by running the computer program stored in the memory 920, thereby realizing the aforementioned three-dimensional fragmentation animation generation method.
[0112] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0113] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0114] In the several embodiments provided by this invention, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection can be through some interfaces; the indirect coupling or communication connection of units or modules can be electrical or other forms.
[0115] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0116] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0117] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0118] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for generating a shattering animation, characterized in that, include: Obtain the crack texture and target model; The target model is cut based on the crack map to obtain a fragment model; Texture sampling is performed on the target model and the fragment model respectively to obtain the first texture coordinates corresponding to the target model and the second texture coordinates corresponding to the fragment model; A 3D fragmentation animation is generated based on the crack map, the first texture coordinates, and the second texture coordinates. The 3D fragmentation animation is obtained by performing vertex animation processing on the fragment model based on the map color, the first target color, the second texture coordinates, and controlling the offset degree of the fragment model. The first target color is obtained by multiplying the ablation result and the first channel color. The ablation result is obtained by processing the second channel color using an ablation function. The second channel color is obtained by texture sampling a preset ablation map based on the second texture coordinates. The map color and the first channel color are obtained by texture sampling the crack map based on the first texture coordinates. The first channel color is the color of the first preset channel of the crack map, and the second channel color is the color of the second preset channel of the preset ablation map.
2. The method according to claim 1, characterized in that, Based on the crack map, the first texture coordinates, and the second texture coordinates, a 3D fracturing animation is generated, including: The crack map is texture sampled using the first texture coordinates to obtain the texture color of the crack map; Vertex animation processing is performed on the fragment model based on the texture color and the second texture coordinates to obtain the three-dimensional fragmentation animation.
3. The method according to claim 2, characterized in that, Vertex animation processing is performed on the fragment model based on the texture color and the second texture coordinates to obtain the 3D fragmentation animation, including: Obtain the degree of control offset, wherein the degree of control offset is used to control the degree of offset of the fragment model; The fragment model is subjected to vertex animation processing based on the texture color, the second texture coordinates, and the control offset degree to obtain the three-dimensional fragmentation animation.
4. The method according to claim 1, characterized in that, The method further includes: Based on the first texture coordinates, the preset refraction map is texture sampled to obtain the third channel color, wherein the third channel color is the color of the third preset channel of the preset refraction map; The second target color is obtained by multiplying the ablation result and the third channel color. The fragment model is subjected to vertex animation processing based on the texture color, the first target color, the second target color, the second texture coordinates, and the offset degree to obtain the three-dimensional fragmentation animation.
5. The method according to claim 1, characterized in that, The crack texture map corresponding to the 3D shattering animation includes: Construct cracks in different directions to generate an initial texture; The initial texture is subjected to lighting processing to obtain the crack texture.
6. The method according to claim 5, characterized in that, The initial texture is subjected to lighting processing to obtain the crack texture, including: Determine the target fragment of a preset shape in the initial texture; A portion of the area where the target fragment is located is illuminated to obtain the crack texture.
7. A device for generating shattering animation, characterized in that, include: The acquisition module is used to acquire crack textures and target models. A cutting module is used to cut the target model based on the crack map to obtain a fragment model; The sampling module is used to perform texture sampling on the target model and the fragment model respectively to obtain the first texture coordinates corresponding to the target model and the second texture coordinates corresponding to the fragment model; A generation module is used to generate a 3D fragmentation animation based on the crack map, the first texture coordinates, and the second texture coordinates. The 3D fragmentation animation is obtained by performing vertex animation processing on the fragment model based on the map color, the first target color, the second texture coordinates, and controlling the offset degree of the fragment model. The first target color is obtained by multiplying the ablation result and the first channel color. The ablation result is obtained by processing the second channel color using an ablation function. The second channel color is obtained by texture sampling a preset ablation map based on the second texture coordinates. The map color and the first channel color are obtained by texture sampling the crack map based on the first texture coordinates. The first channel color is the color of the first preset channel of the crack map, and the second channel color is the color of the second preset channel of the preset ablation map.
8. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores a computer program, wherein the computer program is configured to execute the method for generating the shattering animation as described in any one of claims 1 to 6 when run by a processor.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method for generating the shattering animation as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Crushing effect processing method and device, storage medium and electronic equipment
CN113694522A
Animation implementation method and device of target model, storage medium and electronic equipment
CN114663560A
Baking method and device of dynamic object, medium and electronic equipment
CN115272559A