A method and device for texture processing, a computer device, and a storage medium
By adjusting and synthesizing the transparency of the map sequence of the smoke effect animation, configuration information is generated to solve the problem of stuttering smoke effect, achieving a smoother display of smoke effect.
Patent Information
- Application Number
- CN202111582895.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-12-22
AI Technical Summary
In game development, when playing cartoon sequence frame maps using particle emitters, the smoke effect has obvious lag in slow motion, affecting the user experience.
By adjusting the transparency of the map sequence in the smoke effect animation, synthesize the superimposed map and performing blur processing, determine the brightness information and arrangement order of the pixel points, and generate configuration information for the target map to achieve the smoke effect.
It improves the performance quality of the smoke effect, avoids the phenomenon of stuttering in slow motion, and improves the gaming experience.
Smart Images

Figure CN114419237B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to a method and apparatus for texture processing, a computer device, and a storage medium. Background Art
[0002] During game development, in order to improve the display effect of game graphics, special effects are designed. For example, smoke special effects, etc.
[0003] In the related art, a particle emitter is used to play a cartoon sequence frame texture to achieve a cartoon smoke effect. However, in the case of slow motion in the game, the smoke of the sequence frame will have a very obvious stuttering effect, seriously affecting the user's game experience. Summary of the Invention
[0004] Embodiments of this application provide a method and apparatus for texture processing, a computer device, and a storage medium, which can improve the smoke effect of the texture.
[0005] Embodiments of this application provide a method for texture processing, including:
[0006] Obtain a texture sequence in a smoke effect animated image;
[0007] Adjust the transparency of the texture sequence to obtain a processed texture sequence;
[0008] Perform a superimposing process on the processed texture sequence to obtain a superimposed texture frame;
[0009] Select a texture frame from the texture sequence as a target texture;
[0010] Generate configuration information for the target texture to produce a smoke effect based on the superimposed texture. The configuration information includes multiple marked pixel points in the superimposed texture and the arrangement order corresponding to the multiple marked pixel points.
[0011] Correspondingly, embodiments of this application also provide a texture processing apparatus, including:
[0012] An obtaining unit, configured to obtain a texture sequence in a smoke effect animated image;
[0013] An adjusting unit, configured to adjust the transparency of the texture sequence to obtain a processed texture sequence;
[0014] A processing unit, configured to perform a superimposing process on the processed texture sequence to obtain a superimposed texture frame;
[0015] A selecting unit, configured to select a texture frame from the texture sequence as a target texture;
[0016] A generating unit, configured to generate configuration information for generating a smoke effect for the target texture based on the superimposed texture, where the configuration information includes a plurality of marked pixel points in the superimposed texture and the arrangement order corresponding to the plurality of marked pixel points.
[0017] In some embodiments, the apparatus further includes:
[0018] A display unit, configured to display the smoke effect of the target texture based on the configuration information when receiving an effect display instruction for the target texture.
[0019] In some embodiments, the display unit includes:
[0020] A first determination subunit, configured to determine a plurality of pixels to be adjusted corresponding to the plurality of marked pixel points from the target texture according to the position correspondence between the superimposed texture and the target texture;
[0021] A second determination subunit, configured to determine the adjustment order of the plurality of pixels to be adjusted according to the arrangement order;
[0022] An adjustment subunit, configured to sequentially adjust the brightness of the plurality of pixels to be adjusted to a target brightness based on the adjustment order.
[0023] In some embodiments, the generating unit includes:
[0024] A first acquisition subunit, configured to acquire the brightness information of the superimposed texture;
[0025] A third determination subunit, configured to determine the arrangement order based on the brightness information to obtain the configuration information.
[0026] In some embodiments, the third determination subunit is specifically configured to:
[0027] Determine a target area corresponding to the target pattern of the target texture from the superimposed texture;
[0028] Determine the brightness sub-information corresponding to the target area from the brightness information;
[0029] Determine the arrangement order based on the brightness sub-information.
[0030] In some embodiments, the third determination subunit is specifically configured to:
[0031] Determine a target area corresponding to the target pattern of the target texture from the superimposed texture;
[0032] Determine the brightness sub-information corresponding to the target area from the brightness information;
[0033] Sort all the marked pixel points in the target area according to the magnitude of the brightness value to obtain the arrangement order.
[0034] In some embodiments, the adjustment unit includes:
[0035] A first adjustment subunit, configured to adjust the transparency of each frame of the texture map sequence to a preset transparency to obtain multiple frames of processed texture maps;
[0036] A fourth determination subunit, configured to obtain the processed texture map sequence based on the multiple frames of processed texture maps.
[0037] In some embodiments, the processing unit includes:
[0038] A synthesis subunit, configured to synthesize multiple frames of processed texture maps in the processed texture map sequence to obtain a frame of synthesized texture map;
[0039] A processing subunit, configured to perform blurring processing on the synthesized texture map to obtain a blurred synthesized texture map;
[0040] A second adjustment subunit, configured to adjust the brightness of the blurred synthesized texture map to obtain the superimposed texture map.
[0041] In some embodiments, the second adjustment subunit is specifically configured to:
[0042] Map the brightness information of the blurred synthesized texture map to a preset brightness range.
[0043] In some embodiments, the selection unit includes:
[0044] Select a frame of texture map with the largest pattern from the texture map sequence to obtain the target texture map.
[0045] In some embodiments, the generation unit includes:
[0046] A fifth determination subunit, configured to determine the smoothness of the smoke effect;
[0047] A generation subunit, configured to generate configuration information for generating a smoke effect for the target texture map based on the smoothness and the superimposed texture map.
[0048] Correspondingly, an embodiment of the present application further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the texture map processing method provided in any embodiment of the present application.
[0049] Correspondingly, an embodiment of the present application further provides a storage medium, which stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the texture map processing method as described above.
[0050] In the embodiment of the present application, the transparency of the texture sequence in the animated GIF of the smoke effect is adjusted, and then multiple frames of textures in the texture sequence after the transparency adjustment are synthesized into one frame of superimposed texture. The superimposed texture is blurred and then the brightness is adjusted to obtain the adjusted texture. The arrangement order of each pixel point is determined based on the brightness information of each pixel point of the adjusted texture. A target texture is selected from the texture sequence, and the adjustment sequence of each pixel point in the target texture is obtained according to the arrangement order. Finally, the brightness of the pixel points in the target texture is adjusted in sequence based on the adjustment sequence, so that the target texture shows the smoke effect, which can improve the smoke effect of the texture. Description of the Drawings
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0052] Figure 1 It is a schematic flowchart of a texture processing method provided by an embodiment of the present application.
[0053] Figure 2 It is a schematic diagram of an application scenario of a texture processing method provided by an embodiment of the present application.
[0054] Figure 3 It is a schematic diagram of another application scenario of a texture processing method provided by an embodiment of the present application.
[0055] Figure 4 It is a schematic diagram of another application scenario of a texture processing method provided by an embodiment of the present application.
[0056] Figure 5 It is a schematic flowchart of another texture processing method provided by an embodiment of the present application.
[0057] Figure 6 It is a block diagram of the structure of a texture processing device provided by an embodiment of the present application.
[0058] Figure 7 It is a schematic diagram of the structure of a computer device provided by an embodiment of the present application. Detailed Embodiments
[0059] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0060] The embodiments of the present application provide a method, an apparatus, a storage medium, and a computer device for texture mapping processing. Specifically, the texture mapping processing method in the embodiments of the present application can be executed by a computer device, where the computer device can be a terminal or a server, etc. The terminal can be a smart phone, a tablet computer, a notebook computer, a touch screen, a personal computer (PC), a personal digital assistant (PDA), and other terminal devices. The server can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0061] For example, the computer device can be a terminal, and the terminal can obtain a texture sequence in an animated smoke effect picture; adjust the transparency of the texture sequence to obtain a processed texture sequence; perform an overlay process on the processed texture sequence to obtain a frame of overlaid texture; select a frame of texture from the texture sequence as the target texture; generate configuration information for generating a smoke effect for the target texture based on the overlaid texture, where the configuration information includes multiple marked pixel points in the overlaid texture and the arrangement order corresponding to the multiple marked pixel points.
[0062] Based on the above problems, the embodiments of the present application provide a first texture mapping processing method, an apparatus, a computer device, and a storage medium, which can improve the smoke effect of the texture.
[0063] The following will be described in detail respectively. It should be noted that the description order of the following embodiments does not limit the preferred order of the embodiments.
[0064] The embodiments of the present application provide a texture mapping processing method, which can be executed by a terminal or a server. The embodiments of the present application will be described by taking the texture mapping processing method executed by a terminal as an example.
[0065] Please refer to Figure 1 , Figure 1 , which is a schematic flowchart of a texture mapping processing method provided by the embodiments of the present application. The specific process of the texture mapping processing method can be as follows:
[0066] 101. Obtain the texture map sequence in the animated GIF of the smoke effect.
[0067] In the embodiment of the present application, the texture map sequence includes multiple frames of texture maps. The multiple frames of texture maps refer to the static texture maps displayed during the playback of the animated GIF of the smoke effect. Since the dynamic performance of the smoke effect shows the process of smoke change, different-sized smoke patterns can be included in each frame of the texture map.
[0068] For example, please refer to Figure 2 , Figure 2 , which is a schematic diagram of the application scenario of a texture map processing method provided by the embodiment of the present application. In Figure 2 , the change process from texture map A to texture map D can be the playback process of the animated GIF of the smoke effect. From texture map A to texture map D, the white smoke in the texture map slowly dissolves and disappears. Then the texture map sequence constituting the animated GIF of the smoke effect can be: texture map A, texture map B, texture map C, texture map D. Among them, texture map A, texture map B, texture map C, and texture map D can be drawn in advance by designers or downloaded from the texture map resource library.
[0069] 102. Adjust the transparency of the texture map sequence to obtain a processed texture map sequence.
[0070] Among them, adjusting the transparency of the texture map sequence means separately adjusting the transparency of the multiple frames of texture maps in the texture map sequence to obtain the adjusted multiple frames of texture maps.
[0071] In some embodiments, in order to improve the overlay effect of the multiple frames of texture maps, the step of "adjusting the transparency of the texture map sequence to obtain a processed texture map sequence" may include the following operations:
[0072] Adjust the transparency of each frame of the texture map sequence to a preset transparency to obtain multiple frames of processed texture maps;
[0073] Based on the multiple frames of processed texture maps, obtain a processed texture map sequence.
[0074] In the embodiment of the present application, in order to ensure the performance consistency of the multiple frames of texture maps in the texture map sequence, the transparency of each frame of the texture map can be adjusted to the same transparency, that is, the preset transparency. For example, the preset transparency can be 25%.
[0075] Furthermore, by separately adjusting the transparency of each frame of the texture map sequence to 25%, multiple frames of processed texture maps can be obtained, and thus a processed texture map sequence can be obtained.
[0076] 103. Perform an overlay process on the processed texture map sequence to obtain one frame of overlaid texture map.
[0077] Among them, the overlay process refers to synthesizing the multiple frames of processed texture maps in the processed texture map sequence into one frame of picture.
[0078] In some embodiments, in order to improve the superimposition effect of the processed texture map sequence, the step of "performing a superimposition process on the processed texture map sequence to obtain a superimposed texture map in one frame" may include the following operations:
[0079] Synthesize multiple processed texture maps in the processed texture map sequence to obtain a synthesized texture map in one frame;
[0080] Perform a blurring process on the synthesized texture map to obtain a blurred synthesized texture map;
[0081] Adjust the brightness of the blurred synthesized texture map to obtain the superimposed texture map.
[0082] First, multiple processed texture maps in the processed texture map sequence can be synthesized into one frame of picture through image processing software to obtain the synthesized texture map. The image processing software can use Photoshop, etc.
[0083] In the embodiments of the present application, since each texture map in the texture map sequence includes smoke patterns of different sizes, after synthesizing multiple processed texture maps into one texture map, gradients will be generated at the edges of the smoke patterns in the synthesized texture map.
[0084] For example, please refer to Figure 3 , Figure 3 which is a schematic diagram of an application scenario of another texture map processing method provided by the embodiments of the present application. In Figure 3 , the texture map sequence can be: texture map A, texture map B, texture map C, texture map D. First, adjust the transparency of texture map A, texture map B, texture map C, and texture map D to a preset transparency respectively, and then synthesize each texture map after adjusting the transparency into one texture map, that is, synthesized texture map E. Since the smoke pattern sizes in texture map A, texture map B, texture map C, and texture map D are different, a gradient at the edge of the smoke pattern is displayed in synthesized texture map E.
[0085] In the embodiments of the present application, in order to avoid the influence of the gradient at the edge of the smoke pattern in the synthesized texture map, the synthesized texture map can be blurred. Specifically, the synthesized texture map can be blurred through image processing software to obtain a blurred synthesized texture map.
[0086] For example, please refer to Figure 4 , Figure 4 which is a schematic diagram of an application scenario of another texture map processing method provided by the embodiments of the present application. In Figure 4 , the synthesized texture map E is blurred through image processing software to obtain a blurred synthesized texture map F, and the gradient at the edge of the smoke pattern in the blurred synthesized texture map F smoothly transitions.
[0087] Further, the brightness difference between each pixel in the blurred composite texture map is small and the overall is on the dark side. To increase the brightness difference between pixels and improve the texture map brightness, the brightness of the blurred composite texture map can be adjusted.
[0088] In some embodiments, to improve the brightness adjustment effect, the step of "adjusting the brightness of the blurred composite texture map" includes:
[0089] Mapping the brightness information of the blurred composite texture map to a preset brightness range.
[0090] Among them, the preset brightness range can be the 0-1 interval. Mapping the brightness information of the blurred composite texture map to the 0-1 interval also means performing normalization processing on the blurred composite texture map.
[0091] Specifically, for a grayscale image (or each color component of a color channel), grayscale normalization is to make the grayscale values of its pixels distributed between 0 and 255, avoiding insufficient image contrast (unbalanced distribution of image pixel brightness) which may interfere with subsequent processing. The principle of image normalization can be as follows:
[0092] y = (x - MinValue) / (MaxValue - MinValue);
[0093] Where x represents the grayscale value of the pixel before normalization, y represents the grayscale value of the pixel after normalization, MaxValue represents the maximum value of the original image grayscale, and MinValue represents the minimum value of the original image grayscale. By performing normalization processing on the blurred composite texture map, the brightness information of the pixels in the blurred composite texture map is mapped to the 0-1 interval.
[0094] 104. Select a frame of texture map from the texture map sequence as the target texture map.
[0095] Among them, the target texture map refers to a frame of texture map used to be dissolved to produce a smoke effect.
[0096] In some embodiments, each frame of the texture map sequence includes a pattern, that is, a smoke pattern. To improve the smoke effect of the texture map, the step of "selecting a frame of texture map from the texture map sequence as the target texture map" can include the following operations:
[0097] Select a frame of texture map with the largest pattern from the texture map sequence to obtain the target texture map.
[0098] Specifically, in the texture map sequence, each frame of the texture map includes a smoke pattern, and the size of the smoke pattern in each frame of the texture map can be different.
[0099] For example, see Figure 1Among them, there are texture map A, texture map B, texture map C, and texture map D. Among them, the smoke pattern in texture map A is the largest, so texture map A can be selected as the target texture map.
[0100] 105. Generate configuration information for generating a smoke effect for the target texture map based on the superimposed texture map.
[0101] Among them, the configuration information includes multiple marked pixel points in the superimposed texture map and the arrangement order corresponding to the multiple marked pixel points. This configuration information can be used as a configuration file for making the target texture map produce a smoke effect.
[0102] In some embodiments, in order to achieve the smoke effect of the texture map, the step of "generating configuration information for generating a smoke effect for the target texture map based on the superimposed texture map" may include the following operations:
[0103] Obtain the brightness information of the superimposed texture map;
[0104] Determine the arrangement order based on the brightness information to obtain the configuration information.
[0105] Among them, the brightness information includes the brightness of each pixel point in the superimposed texture map, that is, the gray value. Then, determine the arrangement order of multiple marked pixel points in the superimposed texture map according to the brightness information.
[0106] In some embodiments, in order to save processing resources, the step of "determining the arrangement order based on the brightness information" may include the following operations:
[0107] Determine the target area corresponding to the target pattern of the target texture map from the superimposed texture map;
[0108] Determine the brightness sub-information corresponding to the target area from the brightness information;
[0109] Determine the arrangement order based on the brightness sub-information.
[0110] Among them, the target texture map includes a target pattern, and the target pattern is also the smoke pattern in the target texture map.
[0111] In the embodiments of the present application, the superimposed texture map is synthesized from multiple frames of texture maps in the smoke effect animation, and the target texture map is one frame of texture map in the smoke effect animation. Therefore, the superimposed texture map and the target texture map have the same size, so that each pixel point in the superimposed texture map corresponds to each pixel point in the target texture map one by one.
[0112] Specifically, to select the target area from the superimposed texture map, according to the correspondence between the pixel points in the superimposed texture map and the pixel points in the target texture map, select the area corresponding to the target pattern from the superimposed texture map to obtain the target area, and the pixel points in this target area can be marked pixel points.
[0113] Among them, the luminance sub - information includes the luminance values of each marked pixel in the target area. Further, the arrangement order of each marked pixel is determined according to the gray - scale value of the marked pixel.
[0114] In some embodiments, the step of "determining the arrangement order based on the luminance sub - information" includes:
[0115] Sort all the marked pixels in the target area according to the magnitude of the luminance values to obtain the arrangement order.
[0116] In the embodiments of the present application, in order to ensure regular dissolution of the smoke pattern during the smoke effect, the pixels can be sorted according to the magnitude of the luminance values of the pixels. For example, the marked pixels can be sorted from large to small according to their luminance values.
[0117] For example, the marked pixels included in the target area can be: pixel 1, pixel 2, pixel 3, pixel 4, pixel 5, etc. Among them, the luminance value of pixel 1 can be: 0.2, the luminance value of pixel 2 can be: 0.8, the luminance value of pixel 3 can be: 0.5, the luminance value of pixel 4 can be: 0.1, and the luminance value of pixel 5 can be: 0.9. Sort each marked pixel from large to small according to the luminance value, and the obtained arrangement order is: pixel 5, pixel 2, pixel 3, pixel 1, pixel 4.
[0118] In some embodiments, after generating the configuration information of the target texture map, the configuration information can be saved as a configuration file for implementing the smoke effect of the configured target texture map. The method can further include the following steps:
[0119] When receiving an effect display instruction for the target texture map, display the smoke effect of the target texture map based on the configuration information.
[0120] Among them, the effect display instruction instructs to display the smoke effect of the target texture map. When receiving the effect display instruction, the target texture map and the configuration information can be loaded, and the target texture map can be processed through the configuration information, that is, the smoke effect of the target texture map can be realized.
[0121] In some embodiments, in order to improve the smoke effect of the target texture map, the step of "displaying the smoke effect of the target texture map based on the configuration information" can include the following operations:
[0122] Determine a plurality of pixels to be adjusted corresponding to the plurality of marked pixels from the target texture map according to the position correspondence between the superimposed texture map and the target texture map;
[0123] Determine the adjustment order of the plurality of pixels to be adjusted according to the arrangement order;
[0124] Based on the adjustment order, sequentially adjust the luminance of the plurality of pixels to be adjusted to the target luminance.
[0125] Among them, the position correspondence relationship refers to the correspondence relationship between each pixel point in the pasted image after superposition and each pixel point in the target image. Since multiple marked pixel points in the target image are determined according to the target pattern in the target image, multiple pixel points to be adjusted in the target image are also the pixel points that make up the target pattern.
[0126] For example, the marked pixel points in the pasted image after superposition may include: pixel point 1, pixel point 2, pixel point 3, pixel point 4, pixel point 5; the pixel points to be adjusted in the target image may include: pixel point 6, pixel point 7, pixel point 8, pixel point 9, pixel point 10. Among them, the correspondence relationship between the marked pixel points in the pasted image after superposition and the pixel points to be adjusted in the target image may be: pixel point 1 corresponds to pixel point 6, pixel point 2 corresponds to pixel point 7, pixel point 3 corresponds to pixel point 8, pixel point 4 corresponds to pixel point 9, and pixel point 5 corresponds to pixel point 10.
[0127] Among them, the arrangement order of the marked pixel points may be: pixel point 5, pixel point 2, pixel point 3, pixel point 1, pixel point 4. According to the correspondence relationship between the marked pixel points and the pixel points to be adjusted, the adjustment order of the pixel points to be adjusted can be obtained as: pixel point 10, pixel point 7, pixel point 8, pixel point 6, pixel point 9.
[0128] Among them, the target brightness is used to make the pixel points hidden and displayed, so the target brightness can be: 0, that is, black. Then, according to the adjustment order of the pixel points to be adjusted in the target pattern in the target image, that is: pixel point 10, pixel point 7, pixel point 8, pixel point 6, pixel point 9, the brightness values of each pixel point are adjusted to 0 in turn, that is, each pixel point to be adjusted is hidden in turn, so as to dissolve the smoke pattern of the target image and achieve the smoke effect of the target image.
[0129] In some embodiments, when dissolving the target image, in order to meet different dissolution performance requirements, the softness and hardness of the dissolution can be set, that is, the smoothness during the dissolution process. In some embodiments, the step of "generating configuration information for the target image to produce a smoke effect based on the pasted image after superposition" may include the following operations:
[0130] Determine the smoothness of the smoke effect;
[0131] Generate configuration information for the target image to produce a smoke effect based on the smoothness and the pasted image after superposition.
[0132] Among them, the smoothness can be achieved through the Smoothstep function, that is, the softness and hardness of the dissolution are controlled through the Smoothstep function, and finally the pasted image after superposition is output as the alpha transparency channel.
[0133] Specifically, the Smoothstep function (smooth step function). The smooth step function, also known as the smooth transition function. Briefly, given two boundary values, edge0 and edge1. If the input value is less than the first boundary value edge0, the value returns 0; if it is greater than the second boundary value edge1, the value returns 1. If the input value is between the two boundary values, it will change uniformly and non-linearly. Smoothstep can also control the narrowness and width of the two boundary values. Smoothstep can control the interval values on the X-axis, so that the degree of softness can have a certain intensity.
[0134] Through the Smoothstep function, the softness of the soft dissolution can be controlled during dissolution. To a certain extent, it can even be used as a hard dissolution. Because when the Min and Max boundary values on the X-axis get closer and closer (for example, from the original 0 - 1 to 0.5 - 0.6), two originally very close pixels now become black or white.
[0135] On the contrary, when the gap between the Min and Max boundary values becomes larger and larger (for example, from 0.1 - 0.2 to 0 - 1), the originally black-and-white interval is widened. Originally, 0.1 would return 0 and 0.2 would immediately return 1. Now, 0.1 remains 0.1 and 0.2 remains 0.2 until it is less than 0 to return 0 and greater than 1 to return 1, and the transition is longer.
[0136] Adding the smoothness information generated by the Smoothstep function to the configuration information obtained based on the superimposed texture can control the softness of the dissolution by controlling the interval values.
[0137] The embodiment of the present application discloses a texture processing method, which includes: obtaining a texture sequence in a smoke effect animated image; adjusting the transparency of the texture sequence to obtain a processed texture sequence; performing a superimposition process on the processed texture sequence to obtain a frame of superimposed texture; selecting a frame of texture from the texture sequence as the target texture; generating configuration information for the target texture to produce a smoke effect based on the superimposed texture, where the configuration information includes multiple marked pixel points in the superimposed texture and the arrangement order corresponding to the multiple marked pixel points. By adjusting the transparency of the texture sequence in the smoke effect animated image, then synthesizing multiple frames of textures in the texture sequence with adjusted transparency into a frame of superimposed texture, performing a blur process on the superimposed texture, and then performing a brightness adjustment to obtain an adjusted texture, determining the arrangement order of each pixel point based on the brightness information of each pixel point in the adjusted texture, selecting a frame of target texture from the texture sequence, obtaining the adjustment sequence of each pixel point in the target texture according to the arrangement order, and finally adjusting the brightness of the pixel points in the target texture in sequence based on the adjustment sequence, so that the target texture shows a smoke effect, which can improve the smoke effect of the texture.
[0138] Based on the above-introduced content, examples will be given below to further illustrate the texture mapping processing method of the present application. Please refer to Figure 5 , Figure 5 FIG. is a schematic flowchart of another texture mapping processing method provided by an embodiment of the present application. Taking the application of this texture mapping processing method to a terminal as an example, the specific process can be as follows:
[0139] 201. The terminal receives a display instruction for the smoke effect of the target texture map, and obtains the configuration file of the target texture map according to the display instruction.
[0140] Among them, the display instruction indicates to display the smoke effect of the target texture map. The configuration file is pre-generated, and the configuration file includes configuration information, and the configuration information is generated according to the texture map sequence of the smoke effect animation. For details, please refer to the description in the above embodiment.
[0141] In the embodiment of the present application, the smoke effect implementation code, that is, the dissolution shader, can be generated according to the configuration information as follows:
[0142]
[0143]
[0144]
[0145]
[0146]
[0147]
[0148]
[0149]
[0150]
[0151] 202. The terminal performs dissolution processing on the target texture map according to the configuration file to display the smoke effect of the target texture map.
[0152] Specifically, by running the configuration information, that is, the above dissolution shader, direct dissolution on the target texture map is realized to obtain the smoke effect, which can avoid obvious jamming effects when playing the smoke texture map sequence frames, thereby improving the smoke display effect of the texture map.
[0153] An embodiment of the present application discloses a method for processing a sticker, the method including: the terminal receives a display instruction for the smoke effect of a target sticker, obtains a configuration file of the target sticker according to the display instruction, and performs a dissolution process on the target sticker according to the configuration file to display the smoke effect of the target sticker. In this way, the smoke performance effect of the sticker can be improved.
[0154] To facilitate better implementation of the sticker processing method provided in the embodiments of the present application, the embodiments of the present application also provide a sticker processing device based on the above sticker processing method. The meanings of the nouns are the same as those in the above sticker processing method, and the specific implementation details can refer to the descriptions in the method embodiments.
[0155] Please refer to Figure 6 , Figure 6 which is a structural block diagram of a sticker processing device provided in an embodiment of the present application. The device includes:
[0156] An obtaining unit 301, configured to obtain a sticker sequence in a smoke effect animated image;
[0157] An adjusting unit 302, configured to adjust the transparency of the sticker sequence to obtain a processed sticker sequence;
[0158] A processing unit 303, configured to perform a superimposing process on the processed sticker sequence to obtain a frame of superimposed sticker;
[0159] A selecting unit 304, configured to select a frame of sticker from the sticker sequence as the target sticker;
[0160] A generating unit 305, configured to generate configuration information for generating a smoke effect for the target sticker based on the superimposed sticker. The configuration information includes a plurality of marked pixel points in the superimposed sticker and the arrangement order corresponding to the plurality of marked pixel points.
[0161] In some embodiments, the device may further include:
[0162] A display unit, configured to, when receiving an effect display instruction for the target sticker, display the smoke effect of the target sticker based on the configuration information.
[0163] In some embodiments, the display unit may include:
[0164] A first determining subunit, configured to determine a plurality of pixels to be adjusted corresponding to the plurality of marked pixel points from the target sticker according to the position correspondence between the superimposed sticker and the target sticker;
[0165] A second determining subunit, configured to determine the adjustment order of the plurality of pixels to be adjusted according to the arrangement order;
[0166] An adjustment subunit, configured to sequentially adjust the brightness of the plurality of pixels to be adjusted to a target brightness based on the adjustment order.
[0167] In some embodiments, the generating unit 305 may include:
[0168] A first obtaining subunit, configured to obtain the brightness information of the superimposed map;
[0169] A third determining subunit, configured to determine the arrangement order based on the brightness information to obtain the configuration information.
[0170] In some embodiments, the third determining subunit may specifically be configured to:
[0171] Determine a target area corresponding to the target pattern of the target map from the superimposed map;
[0172] Determine the brightness sub-information corresponding to the target area from the brightness information;
[0173] Determine the arrangement order based on the brightness sub-information.
[0174] In some embodiments, the third determining subunit may specifically be configured to:
[0175] Determine a target area corresponding to the target pattern of the target map from the superimposed map;
[0176] Determine the brightness sub-information corresponding to the target area from the brightness information;
[0177] Sort all the marked pixels in the target area according to the magnitude of the brightness value to obtain the arrangement order.
[0178] In some embodiments, the adjustment unit 302 may include:
[0179] A first adjustment subunit, configured to adjust the transparency of each frame of the map sequence to a preset transparency to obtain multiple processed maps;
[0180] A fourth determining subunit, configured to obtain the processed map sequence based on the multiple processed maps.
[0181] In some embodiments, the processing unit 303 may include:
[0182] A synthesizing subunit, configured to synthesize multiple processed maps in the processed map sequence to obtain a synthesized map;
[0183] A processing subunit, configured to perform a blurring process on the synthesized map to obtain a blurred synthesized map;
[0184] A second adjustment subunit, configured to adjust the brightness of the blurred composite map to obtain the superimposed map.
[0185] In some embodiments, the second adjustment subunit may specifically be configured to:
[0186] Map the brightness information of the blurred composite map to a preset brightness range.
[0187] In some embodiments, the selection unit 304 may include:
[0188] Select a frame of map with the largest pattern from the map sequence to obtain the target map.
[0189] In some embodiments, the generation unit 305 may include:
[0190] A fifth determination subunit, configured to determine the smoothness of the smoke effect;
[0191] A generation subunit, configured to generate configuration information for generating a smoke effect for the target map based on the smoothness and the superimposed map.
[0192] An embodiment of the present application discloses a map processing device. The acquisition unit 301 acquires a map sequence in a smoke effect animation, the adjustment unit 302 adjusts the transparency of the map sequence to obtain a processed map sequence, the processing unit 303 performs a superimposition process on the processed map sequence to obtain a frame of superimposed map, the selection unit 304 selects a frame of map from the map sequence as the target map, and the generation unit 305 generates configuration information for generating a smoke effect for the target map based on the superimposed map. The configuration information includes a plurality of marked pixel points in the superimposed map and the arrangement order corresponding to the plurality of marked pixel points. In this way, the map processing efficiency can be improved.
[0193] Correspondingly, an embodiment of the present application further provides a computer device, and the computer device may be a terminal. As Figure 7 shown, Figure 7 is a schematic structural diagram of the computer device provided by the embodiment of the present application. The computer device 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer-readable storage media, and a computer program stored on the memory 502 and executable on the processor. Among them, the processor 501 is electrically connected to the memory 502. Those skilled in the art can understand that the structural diagram of the computer device shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange different components.
[0194] The processor 501 is the control center of the computer device 500, connecting various parts of the entire computer device 500 through various interfaces and circuits. By running or loading software programs and / or modules stored in the memory 502, and by invoking the data stored in the memory 502, it executes various functions of the computer device 500 and processes data, thereby monitoring the computer device 500 as a whole.
[0195] In the embodiment of the present application, the processor 501 in the computer device 500 will load the instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 will run the application programs stored in the memory 502 to implement various functions:
[0196] Obtain the texture sequence in the smoke effect animation; adjust the transparency of the texture sequence to obtain the processed texture sequence; perform a superimposition process on the processed texture sequence to obtain a frame of superimposed texture; select a frame of texture from the texture sequence as the target texture; generate configuration information for generating the smoke effect for the target texture based on the superimposed texture, where the configuration information includes multiple marked pixel points in the superimposed texture and the arrangement order corresponding to the multiple marked pixel points.
[0197] For the specific implementation of each of the above operations, reference can be made to the previous embodiments and will not be elaborated here.
[0198] Optionally, as Figure 7 shown, the computer device 500 further includes: a touch display screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. Among them, the processor 501 is electrically connected to the touch display screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507 respectively. Those skilled in the art can understand that Figure 7 the computer device structure shown in
[0199] The touch display screen 503 can be used to display a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface. The touch display screen 503 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the computer device. These graphical user interfaces can be composed of graphics, guiding information, icons, videos, and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. The touch panel can be used to collect touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute the corresponding program. Optionally, the touch panel can include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch orientation of the user, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 501, and can receive and execute the commands sent by the processor 501. The touch panel can cover the display panel. After the touch panel detects a touch operation on or near it, it is transmitted to the processor 501 to determine the type of touch event. Subsequently, the processor 501 provides a corresponding visual output on the display panel according to the type of touch event. In the embodiments of the present application, the touch panel and the display panel can be integrated into the touch display screen 503 to implement input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two independent components to implement input and output functions. That is, the touch display screen 503 can also be used as part of the input unit 506 to implement the input function.
[0200] The radio frequency circuit 504 can be used to transmit and receive radio frequency signals to establish wireless communication with a network device or other computer devices through wireless communication, and transmit and receive signals with the network device or other computer devices.
[0201] The audio circuit 505 can be used to provide an audio interface between the user and the computer device through a speaker and a microphone. The audio circuit 505 can transmit the electrical signal converted from the received audio data to the speaker, and the speaker converts it into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 505 and then converted into audio data. After the audio data is output to the processor 501 for processing, it is transmitted through the radio frequency circuit 504 to, for example, another computer device, or the audio data is output to the memory 502 for further processing. The audio circuit 505 may also include an earphone jack to provide communication between a peripheral earphone and the computer device.
[0202] The input unit 506 can be used to receive input digital, character information or user characteristic information (such as fingerprint, iris, face information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
[0203] The power supply 507 is used to supply power to each component of the computer device 500. Optionally, the power supply 507 can be logically connected to the processor 501 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 507 can also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0204] Although Figure 7 not shown in the figure, the computer device 500 may also include a camera, a sensor, a Wi-Fi module, a Bluetooth module, etc., which will not be elaborated here.
[0205] In the above embodiments, the descriptions of the respective embodiments have their own focuses. For parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0206] As can be seen from the above, the computer device provided in this embodiment obtains a texture map sequence in a smoke effect animated image; adjusts the transparency of the texture map sequence to obtain a processed texture map sequence; performs a superimposition process on the processed texture map sequence to obtain a superimposed texture map for one frame; selects one frame of texture map from the texture map sequence as the target texture map; generates configuration information for generating a smoke effect for the target texture map based on the superimposed texture map, where the configuration information includes a plurality of marked pixel points in the superimposed texture map and the arrangement order corresponding to the plurality of marked pixel points.
[0207] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed through instructions, or through instructions to control related hardware. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0208] Therefore, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored. The computer programs can be loaded by a processor to execute the steps in any one of the texture map processing methods provided by the embodiments of the present application. For example, the computer program can execute the following steps:
[0209] Obtain a texture map sequence in a smoke effect animated image;
[0210] Adjust the transparency of the texture map sequence to obtain a processed texture map sequence;
[0211] Perform superposition processing on the processed texture map sequence to obtain a frame of superposed texture map;
[0212] Select a frame of texture map from the texture map sequence as the target texture map;
[0213] Generate configuration information for generating a smoke effect for the target texture map based on the superposed texture map. The configuration information includes multiple marked pixel points in the superposed texture map and the corresponding arrangement order of the multiple marked pixel points.
[0214] For the specific implementation of each of the above operations, reference can be made to the previous embodiments and will not be elaborated here.
[0215] Among them, the storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.
[0216] Since the computer program stored in the storage medium can execute the steps in any of the texture map processing methods provided in the embodiments of the present application, the beneficial effects achievable by any of the texture map processing methods provided in the embodiments of the present application can be realized. For details, refer to the previous embodiments and will not be elaborated here.
[0217] The above has introduced in detail a texture map processing method, device, storage medium and computer device provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A method for processing a texture map, characterized in that, The method includes: Obtain a texture sequence in the animated GIF of the smoke effect; Adjust the transparency of the texture sequence to obtain a processed texture sequence; Perform an overlay process on the processed texture sequence to obtain a frame of overlaid texture; Select a frame of texture from the texture sequence as the target texture; Generate configuration information for the target texture to produce a smoke effect based on the overlaid texture, where the configuration information includes multiple marked pixel points in the overlaid texture and the arrangement order corresponding to the multiple marked pixel points.
2. The method according to claim 1, characterized in that, The method further includes: When receiving an effect display instruction for the target texture, display the smoke effect of the target texture based on the configuration information.
3. The method according to claim 2, wherein The displaying the smoke effect of the target texture based on the configuration information includes: Determine multiple pixels to be adjusted corresponding to the multiple marked pixel points from the target texture according to the position correspondence between the overlaid texture and the target texture; Determine the adjustment order of the multiple pixels to be adjusted according to the arrangement order; Successively adjust the brightness of the multiple pixels to be adjusted to the target brightness based on the adjustment order.
4. The method according to claim 1, wherein The generating the configuration information for the target texture to produce a smoke effect based on the overlaid texture includes: Obtain the brightness information of the overlaid texture; Determine the arrangement order based on the brightness information to obtain the configuration information.
5. The method according to claim 4, wherein The target texture includes a target pattern; The determining the arrangement order based on the brightness information includes: Determine a target area corresponding to the target pattern of the target texture from the overlaid texture; Determine the brightness sub-information corresponding to the target area from the brightness information; Determine the arrangement order based on the brightness sub-information.
6. The method according to claim 5, characterized in that The brightness sub-information includes the brightness value of each marked pixel point in the target area; The determining the arrangement order based on the brightness sub-information includes: Sort all the marked pixel points in the target area according to the magnitude of the brightness value to obtain the arrangement order.
7. The method according to claim 1, characterized in that, The adjusting the transparency of the texture sequence to obtain a processed texture sequence includes: Adjust the transparency of each frame of texture in the texture sequence to a preset transparency to obtain multiple frames of processed texture; Obtain the processed texture sequence based on the multiple frames of processed texture.
8. The method according to claim 1, wherein The performing an overlay process on the processed texture sequence to obtain a frame of overlaid texture includes: Synthesize multiple frames of processed texture in the processed texture sequence to obtain a frame of synthesized texture; Perform a blur process on the synthesized texture to obtain a blurred synthesized texture; Adjust the brightness of the blurred synthesized texture to obtain the overlaid texture.
9. The method according to claim 8, characterized in that, The adjusting the brightness of the blurred synthesized texture includes: Map the brightness information of the blurred synthesized texture to a preset brightness range.
10. The method according to claim 1, wherein Each frame of texture in the texture sequence includes a pattern; The selecting a frame of texture from the texture sequence as the target texture includes: Select a frame of texture with the largest pattern from the texture sequence to obtain the target texture.
11. The method according to claim 1, characterized in that, Generating configuration information for generating a smoke effect for the target map based on the superimposed map includes: Determining the smoothness of the smoke effect; Generating configuration information for generating a smoke effect for the target map based on the smoothness and the superimposed map.
12. A texture processing device, characterized in that, The apparatus includes: An acquisition unit, configured to acquire a map sequence in a smoke effect animation; An adjustment unit, configured to adjust the transparency of the map sequence to obtain a processed map sequence; A processing unit, configured to perform a superimposing process on the processed map sequence to obtain a frame of superimposed map; A selection unit, configured to select a frame of map from the map sequence as the target map; A generation unit, configured to generate configuration information for generating a smoke effect for the target map based on the superimposed map, where the configuration information includes a plurality of marked pixel points in the superimposed map and the arrangement order corresponding to the plurality of marked pixel points.
13. A computer device, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, wherein, When the processor executes the program, it implements the map processing method according to any one of claims 1 to 11.
14. A storage medium, characterized in that, The storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by the processor to execute the map processing method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Tear effect picture generation method and device, storage medium and electronic device
CN112164121A
Display picture implementation method and device with flashing effect, electronic equipment and readable storage medium
CN112669415A