A method and device for texture processing, computer equipment and storage medium

By setting a first channel image and a second channel image in the target texture, and adjusting the brightness of the target pattern in combination with a preset brightness variation law, the problem of poor star flickering effect in the prior art is solved, and a better flickering effect and visual experience are achieved.

CN116236779BActive Publication Date: 2026-07-14NETEASE (HANGZHOU) NETWORK CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2021-12-08
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

In existing technologies, the star flickering effect produced by the noise mapping UV flow method is poor, and there are obvious UV flow traces.

Method used

By acquiring the first channel image of the target texture, the initial brightness of the target pattern is determined. Based on the preset brightness change pattern and the current display duration, the brightness of the target pattern is adjusted to achieve a flashing effect. By combining the first channel image and the second channel image, a target texture with a flashing effect is generated.

Benefits of technology

The flickering effect of the target texture has been improved, UV flow marks have been reduced, and the realism and aesthetics of the flickering effect of the virtual character have been enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116236779B_ABST
    Figure CN116236779B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a map processing method and device, computer equipment and a storage medium. The present application sets a first channel map and a second channel map in a target map, first creates a plurality of target patterns in the first channel map, then generates corresponding patterns in the second channel map according to the positions of the plurality of target patterns in the first channel map, sets the initial brightness of the corresponding patterns, sets the brightness change of the corresponding patterns within a time period through a preset brightness change rule, and adjusts the brightness change of the target patterns according to the brightness change. In this way, the different target patterns can be staggered in the target map, and the flickering effect of the target map can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to a texture processing method, apparatus, computer device, and storage medium. Background Technology

[0002] During game development, art designers often add star effects to virtual characters to enhance their visual appeal, making them appear to twinkle when they appear in the game.

[0003] In related technologies, a method using noise mapping UV flow (which refers to moving the UV coordinates of a texture along the horizontal (U) or vertical (V) direction to create complex animation illusions) is used to achieve the twinkling effect of stars. However, this method produces obvious traces of UV flow, resulting in a poor twinkling effect. Summary of the Invention

[0004] This application provides a texture processing method, apparatus, computer device, and storage medium that can improve the flickering effect of target textures.

[0005] This application provides a texture processing method, including:

[0006] Obtain a first channel image of the target texture, the first channel image including a target pattern configured with a blinking effect in the target texture;

[0007] Determine the initial brightness of the target pattern;

[0008] Based on the preset brightness change pattern of the target pattern over time, the current display duration of the target texture, and the initial brightness, the current brightness of the target pattern is determined.

[0009] The brightness of the target pattern in the first channel image is adjusted according to the current brightness so that the target pattern flashes in the target texture.

[0010] Accordingly, this application also provides a texture processing apparatus, including:

[0011] The acquisition unit is used to acquire a first channel image of a target texture, the first channel image including a target pattern configured with a flashing effect in the target texture;

[0012] The first determining unit is used to determine the initial brightness of the target pattern;

[0013] The second determining unit is used to determine the current brightness of the target pattern based on the preset brightness change pattern of the target pattern in the time dimension, the current display duration of the target texture, and the initial brightness.

[0014] An adjustment unit is used to adjust the brightness of the target pattern in the first channel image according to the current brightness, so that the target pattern flashes in the target texture.

[0015] In some embodiments, the second determining unit includes:

[0016] The first determining subunit is used to determine the brightness after processing based on the preset brightness change pattern, the current display duration, and the initial brightness.

[0017] The processing subunit is used to normalize the processed brightness to obtain the current brightness.

[0018] In some embodiments, the first determining subunit is specifically used for:

[0019] The first cycle value is determined based on the initial brightness, the first preset value, and the first parameter;

[0020] The second cycle value is determined based on the current display duration and the second parameter;

[0021] The processed brightness is determined based on the first cycle value and the second cycle value.

[0022] In some embodiments, the first determining subunit is specifically used for:

[0023] Calculate the difference between the initial brightness and the first preset value; calculate the product of the difference and the first parameter to obtain the first cycle value;

[0024] The second cycle value is determined based on the current display duration and the second parameter;

[0025] The processed brightness is determined based on the first cycle value and the second cycle value.

[0026] In some embodiments, the first determining subunit is specifically used for:

[0027] The first cycle value is determined based on the initial brightness, the first preset value, and the first parameter;

[0028] Calculate the product of the current display duration and the second parameter to obtain the second cycle value;

[0029] The processed brightness is determined based on the first period value and the second period value.

[0030] In some embodiments, the first determining subunit is specifically used for:

[0031] The first cycle value is determined based on the initial brightness, the first preset value, and the first parameter;

[0032] The second cycle value is determined based on the current display duration and the second parameter;

[0033] Determine the first sum of the first period value and the second period value; calculate the trigonometric function value of the first sum to obtain the processed brightness.

[0034] In some embodiments, the processing subunit is specifically used for:

[0035] Calculate the second sum of the processed brightness and the second preset value;

[0036] The current brightness is obtained by multiplying the second sum by the first preset value.

[0037] In some embodiments, the first determining unit includes:

[0038] The first acquisition subunit is used to acquire the position information of the target pattern in the first channel image;

[0039] A generation subunit is used to generate a reference pattern corresponding to the target pattern in the second channel image of the target texture based on the location information.

[0040] The second acquisition subunit is used to acquire the brightness of the symbolic pattern to obtain the initial brightness.

[0041] In some embodiments, the adjustment unit includes:

[0042] The adjustment subunit is used to adjust the brightness of the target pattern based on the current brightness of the reference pattern corresponding to the target pattern in the second channel image.

[0043] In some embodiments, the second determining unit includes:

[0044] The second determining subunit is used to determine the target brightness change pattern corresponding to the target pattern from multiple preset brightness change patterns;

[0045] The third determining subunit is used to determine the current brightness based on the target brightness change pattern, the current display duration, and the initial brightness.

[0046] Accordingly, this application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes any of the texture processing methods provided in this application.

[0047] Accordingly, this application also provides a storage medium storing multiple instructions that are suitable for a processor to load in order to execute the above-described texture processing method.

[0048] This application embodiment sets a first channel image and a second channel image in the target texture. First, multiple target patterns are created in the first channel image. Then, according to the positions of the multiple target patterns in the first channel image, corresponding patterns are generated in the corresponding positions in the second channel image, and the initial brightness of the corresponding patterns is set. The brightness change of the corresponding patterns within a time period is set by a preset brightness change rule. The brightness change of the target patterns is adjusted according to the brightness change. In this way, different target patterns can be staggered in the target texture, thereby improving the flickering effect of the target texture. Attached Figure Description

[0049] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0050] Figure 1 This is a schematic flowchart of a texture processing method provided in an embodiment of this application.

[0051] Figure 2 This is a schematic diagram illustrating an application scenario of a texture processing method provided in an embodiment of this application.

[0052] Figure 3 This is a schematic flowchart of another texture processing method provided in an embodiment of this application.

[0053] Figure 4 This is a structural block diagram of a texture processing device provided in an embodiment of this application.

[0054] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0055] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0056] This application provides a texture processing method, apparatus, storage medium, and computer device. Specifically, the texture processing method of this application can be executed by a computer device, which can be a terminal or a server. The terminal can be a smartphone, tablet computer, laptop computer, touch screen, personal computer (PC), personal digital assistant (PDA), or other terminal device. The server can be an independent physical server, a server cluster or 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 communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0057] For example, the computer device can be a terminal that can acquire a first channel image of a target texture, the first channel image including a target pattern configured with a flashing effect in the target texture; determine the initial brightness of the target pattern; determine the current brightness of the target pattern based on a preset brightness change pattern of the target pattern in the time dimension, the current display duration of the target texture, and the initial brightness; and adjust the brightness of the target pattern in the first channel image according to the current brightness so that the target pattern flashes in the target texture.

[0058] Based on the above problems, this application provides a first texture processing method, apparatus, computer device and storage medium, which can improve the flickering effect of the target texture.

[0059] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0060] This application provides a texture processing method, which can be executed by a terminal or a server. This application uses the example of the texture processing method being executed by a terminal for illustration.

[0061] Please see Figure 1 , Figure 1 This is a flowchart illustrating a texture processing method provided in an embodiment of this application. The specific flow of the texture processing method is as follows:

[0062] 101. Obtain the first channel image of the target texture.

[0063] In this embodiment, the target texture refers to an image with special effects, such as flashing. Target textures can be applied in games to add special effects to virtual characters.

[0064] Specifically, a target texture can include multiple channel maps, each with a different function. For example, a target texture can include a first channel map.

[0065] The first channel image includes target patterns configured with a blinking effect in the target texture. There can be multiple target patterns. The multiple target patterns in the first channel image can be the same pattern (patterns with the same shape and size) or different patterns (patterns with different shapes and / or sizes). In actual application scenarios, the designers can set them according to actual needs.

[0066] 102. Determine the initial brightness of the target pattern.

[0067] Initial brightness refers to the initial grayscale value of the target pattern. When generating a target pattern on a target texture, an initial grayscale value can be set for the target pattern.

[0068] In some embodiments, to improve the performance of the target texture, the step "determine the initial brightness of the target pattern" may include the following operations:

[0069] Obtain the position information of the target pattern in the first channel image;

[0070] Based on the location information, a reference pattern corresponding to the target pattern is generated in the second channel image of the target texture.

[0071] Obtain the brightness of the symbolic pattern to get the initial brightness.

[0072] The location information refers to the location points of the target pattern.

[0073] In this embodiment of the application, the target texture may further include a second channel image. The first channel image provides the pattern, and the second channel image provides the brightness. When it is necessary to adjust different attributes of the target texture, different channel images can be selected for adjustment to facilitate operation and avoid affecting other attributes when adjusting one attribute of the target texture.

[0074] Here, the referential pattern refers to the position of the target pattern in the second channel image, and this referential pattern can be used to provide brightness for the target pattern in the first channel.

[0075] For example, please see Figure 2 , Figure 2 This is a schematic diagram illustrating an application scenario of a texture processing method provided in an embodiment of this application. Figure 2 The left image shows the first channel image of the target texture, which includes multiple target patterns: target pattern 1, target pattern 2, target pattern 3, target pattern 4, and target pattern 5. Based on the position of each target pattern in the first channel image, multiple corresponding reference patterns are generated in the second channel image of the target texture. (See [link]). Figure 2 The right-hand image shows that multiple symbolic patterns are generated in the second channel image: symbolic pattern 1, symbolic pattern 2, symbolic pattern 3, symbolic pattern 4, and symbolic pattern 5.

[0076] The correspondence between the target pattern in the first channel diagram and the reference pattern in the second channel diagram is as follows: target pattern 1 corresponds to reference pattern 1, target pattern 2 corresponds to reference pattern 2, target pattern 3 corresponds to reference pattern 3, target pattern 4 corresponds to reference pattern 4, and target pattern 5 corresponds to reference pattern 5.

[0077] Specifically, when generating the referential pattern, an initial grayscale value, i.e., an initial brightness, can be set for each referential pattern. The initial brightness of different referential patterns can be set to be the same or different. In the embodiments of this application, the initial brightness of different referential patterns can be set to be different, thereby enabling different target patterns to flicker at staggered times and ensuring the flickering effect.

[0078] For example, when generating symbolic pattern 1, the brightness value for symbolic pattern 1 is set to 'a'; when generating symbolic pattern 2, the brightness value for symbolic pattern 2 is set to 'b'; when generating symbolic pattern 3, the brightness value for symbolic pattern 3 is set to 'c'; when generating symbolic pattern 4, the brightness value for symbolic pattern 4 is set to 'd'; and when generating symbolic pattern 5, the brightness value for symbolic pattern 5 is set to 'e'. Therefore, the initial brightness of target pattern 1 is determined to be 'a', the initial brightness of target pattern 2 is 'b', the initial brightness of target pattern 3 is 'c', the initial brightness of target pattern 4 is 'd', and the initial brightness of target pattern 5 is 'e'.

[0079] In this embodiment of the application, the brightness can be mapped to the range of 0-1, where 0 can represent black (i.e., the darkest) and 1 can represent white (i.e., the brightest).

[0080] 103. Based on the preset brightness change pattern of the target pattern over time, the current display duration of the target texture, and the initial brightness, determine the current brightness of the target pattern.

[0081] The current display duration of the target texture refers to the duration from the start time of the current display of the target texture to the current time.

[0082] For example, if the start time of the current display of the target texture is 19:00:00 and the current time is 19:00:20, then the current display duration of the target texture can be determined to be 20 seconds.

[0083] The preset brightness variation pattern of the target pattern in the time dimension refers to the brightness at each point in time within a specified time period.

[0084] In this embodiment, the preset brightness variation law can be a preset calculation formula, as follows:

[0085] Y = Sin((Cross_tex.r – 0.5) * parameter 1 + time * parameter 2);

[0086] Where Y refers to the calculated brightness value; Cross_tex.r refers to the initial brightness; Parameter 1 is the period range parameter, which refers to the flashing period of the set target pattern; Time refers to the display duration; Parameter 2 is the flashing speed parameter, which refers to the flashing speed of the set target pattern within the flashing period.

[0087] In some embodiments, to ensure the validity of the brightness value obtained according to the preset calculation formula, the step "determine the current brightness of the target pattern based on the preset brightness change pattern of the target pattern in the time dimension, the current display duration of the target texture, and the initial brightness" may include the following operations:

[0088] The brightness after processing is determined based on the preset brightness change pattern, the current display duration, and the initial brightness.

[0089] The processed brightness is normalized to obtain the current brightness.

[0090] Specifically, the brightness is calculated using a preset formula based on the current display duration and initial brightness. The resulting value is used as the processed brightness, which is then normalized to obtain the current brightness. This ensures that the current brightness remains within the range of 0-1, thus maintaining its validity.

[0091] Specifically, the current brightness refers to the value calculated from the initial brightness based on the current display duration and a preset calculation formula.

[0092] In some embodiments, the step "determine the processed brightness based on a preset brightness variation pattern, the current display duration, and the initial brightness" may include the following operations:

[0093] The first cycle value is determined based on the initial brightness, the first preset value, and the first parameter;

[0094] The second cycle value is determined based on the current display duration and the second parameter;

[0095] The brightness after processing is determined based on the first cycle value and the second cycle value.

[0096] In some embodiments, the step "determine the first cycle value based on the initial brightness, the first preset value, and the first parameter" may include the following operations:

[0097] Calculate the difference between the initial brightness and the first preset value;

[0098] The first period value is obtained by multiplying the difference by the first parameter.

[0099] The value of the first period can be calculated using the following formula:

[0100] (Cross_tex.r–0.5)*parameter1;

[0101] Where Cross_tex.r refers to the initial brightness, 0.5 refers to the first preset value, and the first parameter is also known as parameter 1. Then, based on the initial brightness, the first preset value and the first parameter, the first cycle value is calculated according to the formula: (Cross_tex.r–0.5)*parameter 1.

[0102] For example, if the initial brightness can be 0 and parameter 1 can be 2π, then the first cycle value calculated according to the formula (Cross_tex.r–0.5)*parameter 1 can be -π.

[0103] In some embodiments, the step "determine the second cycle value based on the current display duration and the second parameter" may include the following operations:

[0104] Calculate the product of the current display duration and the second parameter to obtain the second cycle value.

[0105] The value of the first period can be calculated using the following formula:

[0106] Time * parameter 2;

[0107] Here, "time" refers to the current display duration, and "parameter 2" refers to the second parameter. Then, based on the current display duration and the second parameter, the second cycle value is calculated according to the formula: time * parameter 2.

[0108] For example, if the current display duration can be π, and parameter 2 can be 1, then the calculated value of the second cycle can be π.

[0109] In some embodiments, the step "determine the processed brightness based on the first cycle value and the second cycle value" may include the following operations:

[0110] Determine the first sum of the first periodic value and the second periodic value;

[0111] Calculate the trigonometric function value of the first sum to obtain the processed brightness.

[0112] The calculated brightness can be calculated using the following formula:

[0113] Y = Sin((Cross_tex.r – 0.5) * parameter 1 + time * parameter 2);

[0114] Where (Cross_tex.r–0.5)*parameter1 refers to the first period value, and time*parameter2 refers to the second period value, then the formula Y=Sin((Cross_tex.r–0.5)*parameter1+time*parameter2) can be simplified to: Y=Sin(first period value+second period value).

[0115] For example, the first period value can be -π, the second period value can be π, the sum of the first period value and the second period value is 0, then the trigonometric function value of the sum is calculated, that is, Sin(0), and the value obtained is 0, that is, the brightness after processing is 0.

[0116] In some embodiments, the step "normalizing the processed brightness to obtain the current brightness" may include the following operations:

[0117] Calculate the second sum of the processed brightness and the second preset value;

[0118] Calculate the product of the second sum and the first preset value to obtain the current brightness.

[0119] In this embodiment of the application, the normalization of the processed brightness can be calculated according to the following formula:

[0120] (Y+1.0)*0.5;

[0121] Here, 1.0 refers to the second preset value, 0.5 refers to the first preset value, and Y is the processed brightness calculated by the above steps.

[0122] For example, the processed brightness can be 0. Calculating using the formula (Y+1.0)*0.5 yields a value of 0.5, meaning the current brightness is 0.5. This allows for the calculation of the target pattern's current brightness. Adjusting the target pattern's brightness based on this current brightness then creates the flickering effect that occurs as the target pattern changes over time.

[0123] In some embodiments, the first channel image of the target texture may include multiple target patterns. In order to make different target patterns exhibit different flickering effects and highlight the staggered flickering of each target pattern on the target texture, multiple preset brightness change rules can be set. Then, the step "determine the current brightness of the target pattern based on the preset brightness change rules of the target pattern in the time dimension, the current display duration of the target texture, and the initial brightness" may include the following operations:

[0124] Determine the target brightness variation pattern corresponding to the target pattern from multiple preset brightness variation patterns;

[0125] The current brightness is determined based on the target brightness variation pattern, the current display duration, and the initial brightness.

[0126] In this embodiment, the preset brightness variation law is a preset calculation formula: Y = Sin((Cross_tex.r – 0.5) * parameter 1 + time * parameter 2). Here, parameter 1 is the period range parameter, which refers to the flashing period of the set target pattern; time refers to the display duration; and parameter 2 is the flashing speed parameter, which refers to the flashing speed of the set target pattern within the flashing period. By setting parameter 1 or parameter 2 to different values, the flashing period and flashing speed can be made different, thereby enabling different target patterns to achieve different flashing effects based on different preset variation laws.

[0127] Specifically, parameters 1 and 2 can be set for each target pattern to produce different flashing effects for all different target patterns, or parameters 1 and 2 can be set for some target patterns to produce different flashing effects for some target patterns.

[0128] For example, multiple preset brightness variation patterns can include: a first preset brightness variation pattern and a second preset brightness variation pattern.

[0129] In this context, parameters 1 and 2 in the preset calculation formulas corresponding to the first and second preset brightness change rules are different. Multiple target patterns can include: a first target pattern, a second target pattern, a third target pattern, etc. The first target pattern can be preset to correspond to the first preset brightness change rule, and the second and third target patterns can be preset to correspond to the second brightness change rule.

[0130] Furthermore, when adjusting the brightness of the first target pattern, the current brightness of the first target pattern can be calculated according to the first preset brightness change law, and then adjusted; when adjusting the brightness of the second target pattern, the current brightness of the second target pattern can be calculated according to the second preset brightness change law, and then adjusted. In this way, the brightness of each target pattern can be calculated according to the preset brightness change law corresponding to the target pattern, so as to obtain different brightness change effects of each target pattern.

[0131] 104. Adjust the brightness of the target pattern in the first channel image according to the current brightness so that the target pattern blinks in the target texture.

[0132] After calculating the current brightness of the target pattern, the brightness of the target pattern can be adjusted according to the current brightness, so that the brightness of the target pattern changes over time, thereby producing a flickering effect.

[0133] In some embodiments, the current brightness refers to the current brightness of the reference pattern in the second channel image. The display pattern is provided by the first channel image, and the display brightness is provided by the second channel image. A target texture with a flickering effect is generated by combining the first channel image and the second channel image. Then, the step "adjusting the brightness of the target pattern in the first channel image according to the current brightness" may include the following operations:

[0134] The brightness of the target pattern is adjusted based on the current brightness of the reference pattern corresponding to the target pattern in the second channel image.

[0135] In this embodiment, based on the position of the target pattern in the first channel image of the target texture, a reference pattern corresponding to the position of the target pattern is generated in the second channel image of the target texture. The size of the reference pattern is the same as the size of the corresponding target pattern. When generating the reference pattern, an initial brightness is randomly assigned to the reference pattern. Then, based on a preset brightness change rule, the target brightness (i.e., the current brightness) of the initial brightness of the reference pattern at different times is calculated. The current brightness of the corresponding target pattern is determined based on the current brightness of the reference pattern in the second channel image. Then, the brightness of the target pattern is adjusted, thereby achieving the effect of the target pattern flashing in the target texture over time.

[0136] This application discloses a texture processing method, which includes: acquiring a first channel image of a target texture, the first channel image including a target pattern with a blinking effect configured in the target texture; determining the initial brightness of the target pattern; determining the current brightness of the target pattern based on a preset brightness change rule of the target pattern in the time dimension, the current display duration of the target texture, and the initial brightness; and adjusting the brightness of the target pattern in the first channel image according to the current brightness, so that the target pattern blinks in the target texture. This solution sets a first channel image and a second channel image in the target texture. First, multiple target patterns are created in the first channel image. Then, corresponding patterns are generated in the second channel image according to the positions of the multiple target patterns in the first channel image, and the initial brightness of the corresponding patterns is set. The brightness change of the corresponding patterns within a time period is set according to a preset brightness change rule. The brightness change of the target patterns is adjusted according to this brightness change, thereby achieving staggered blinking of different target patterns in the target texture, which can improve the blinking effect of the target texture.

[0137] Based on the above description, the following examples will further illustrate the texture processing method of this application. Please refer to... Figure 3 , Figure 3 This is a flowchart illustrating another texture processing method provided in an embodiment of this application. Taking the application of this texture processing method to a terminal as an example, the specific process can be as follows:

[0138] 201. Obtain the initial texture map containing multiple target patterns.

[0139] In this application, the texture can be applied to a virtual character in a game to create a twinkling star effect. The target pattern can be a star pattern, such as a five-pointed star, a cross, or other star patterns.

[0140] The initial texture refers to an image containing multiple target patterns, which can be arbitrarily distributed within the initial texture.

[0141] 202. Process the initial texture based on multiple target patterns to obtain a composite texture.

[0142] Specifically, processing the initial texture based on multiple target patterns means generating corresponding rectangular patterns in the initial texture based on the positions of the multiple target patterns in the initial texture.

[0143] In this process, the target pattern and the rectangular pattern are located in different channels of the initial texture. For example, the initial texture may include a first channel and a second channel. Multiple target patterns may be located in the first channel of the initial texture, and rectangular patterns may be located in the second channel of the initial texture. The position of each target pattern in the first channel corresponds to the position of each rectangular pattern in the second channel.

[0144] In this embodiment, the Substance Designer software can be used to process an initial texture image containing multiple target patterns to obtain a composite texture image. The specific processing method is as follows:

[0145] First, an initial texture containing multiple target patterns is randomly distributed onto a larger image. Then, at the location of each target pattern, a rectangle with a random grayscale value is generated, large enough to encompass the edge of the target pattern. Next, the first channel containing the target pattern is merged with the second channel containing the rectangular pattern. The first channel can be the G channel of the initial texture, and the second channel can be the R channel of the initial texture. This results in each target pattern in the G channel corresponding to a rectangle in the R channel, representing a different grayscale value.

[0146] 203. Determine the brightness variation pattern of the target image channel in the composite texture based on preset rules.

[0147] In this embodiment of the application, the preset rule is a trigonometric function formula, as follows:

[0148] Y = Sin((Cross_tex.r – 0.5) * parameter 1 + time * parameter 2);

[0149] Here, Cross_tex.r refers to the pixel value of the R channel in the composite texture, that is, the grayscale value. The value of Cross_tex.r is in the range of 0-1; parameter 1 refers to the period range parameter; parameter 2 refers to the motion speed parameter; and time refers to the display duration of the composite texture.

[0150] In the embodiments of this application, the purpose of designing the above trigonometric function formula is to expand the grayscale value of the rectangular pattern of the R channel in the composite texture from 0-1 to the range of -1 to 1, and to make the grayscale value change with time, so that the calculated Y value is the grayscale value that changes with the time period.

[0151] Then, the Y value is processed according to the following formula to ensure its validity:

[0152] (y+1.0)*0.5;

[0153] The Y value is processed again using the above formula so that the resulting value changes over time in the range of 0-1, where 0 can represent black (the target pattern disappears) and 1 can represent white (the target pattern appears).

[0154] 204. Adjust the brightness of the target pattern in the composite texture based on the brightness variation law so that the target pattern in the composite texture blinks, thus obtaining a composite texture with a blinking effect.

[0155] Specifically, after determining the brightness change pattern of the R channel through preset rules, the grayscale value of the rectangular pattern of the R channel changes with time. Then, the grayscale value is multiplied with the target pattern of the G channel, so that the target pattern at the corresponding position of the G channel can be made to flash with time.

[0156] For example, its implementation code can be as follows:

[0157] / / Star

[0158] #if ENABLE_CROss_STAR_TEX

[0159] FLOAT4 cross_tex-SANPLE_TEXTURE_LEVEL(Tex13,f_uv.xy*CrossTexScale+Cross0ffset,-1);

[0160] FLOAT shiny_cross-(sin((cross_tex.r-0.5)*CrossTexPeriod+

[0161] FrameTime*CrossTexSpeed)+1.0)*0.5;mtl.emissive+-shiny_cross

[0162] *cross_tex.g*mask.g*base col*CrossTexIntensity;

[0163] #endif

[0164] Finally, to achieve the twinkling star effect on the virtual character in the game, the composite texture can be multiplied with the mask image of the target pattern position, and then the result of the multiplication can be added to the base color of the virtual character model (the virtual character model will correspond to a default base color texture). This will create a twinkling star effect on the virtual character.

[0165] This application discloses a texture processing method, which includes: acquiring an initial texture including multiple target patterns; processing the initial texture according to the multiple target patterns to obtain a composite texture; generating a brightness variation law of the target image channels in the composite texture based on preset rules; and adjusting the brightness of the target patterns in the composite texture based on the brightness variation law to make the target patterns in the composite texture flicker, thereby obtaining a composite texture with a flickering effect. This improves the flickering effect of the texture.

[0166] To facilitate better implementation of the texture processing method provided in the embodiments of this application, the embodiments of this application also provide a texture processing apparatus based on the above texture processing method. The meanings of the terms used are the same as in the above texture processing method, and specific implementation details can be found in the descriptions in the method embodiments.

[0167] Please see Figure 4 , Figure 4 This application provides a structural block diagram of a texture processing apparatus, which includes:

[0168] The acquisition unit 301 is used to acquire a first channel image of a target texture, wherein the first channel image includes a target pattern configured with a flashing effect in the target texture.

[0169] The first determining unit 302 is used to determine the initial brightness of the target pattern;

[0170] The second determining unit 303 is used to determine the current brightness of the target pattern based on the preset brightness change pattern of the target pattern in the time dimension, the current display duration of the target texture, and the initial brightness.

[0171] The adjustment unit 304 is used to adjust the brightness of the target pattern in the first channel image according to the current brightness, so that the target pattern flashes in the target texture.

[0172] In some embodiments, the second determining unit 303 may include:

[0173] The first determining subunit is used to determine the brightness after processing based on the preset brightness change pattern, the current display duration, and the initial brightness.

[0174] The processing subunit is used to normalize the processed brightness to obtain the current brightness.

[0175] In some embodiments, the first determining subunit may specifically be used for:

[0176] The first cycle value is determined based on the initial brightness, the first preset value, and the first parameter;

[0177] The second cycle value is determined based on the current display duration and the second parameter;

[0178] The processed brightness is determined based on the first cycle value and the second cycle value.

[0179] In some embodiments, the first determining subunit may specifically be used for:

[0180] Calculate the difference between the initial brightness and the first preset value; calculate the product of the difference and the first parameter to obtain the first cycle value;

[0181] The second cycle value is determined based on the current display duration and the second parameter;

[0182] The processed brightness is determined based on the first cycle value and the second cycle value.

[0183] In some embodiments, the first determining subunit may specifically be used for:

[0184] The first cycle value is determined based on the initial brightness, the first preset value, and the first parameter;

[0185] Calculate the product of the current display duration and the second parameter to obtain the second cycle value;

[0186] The processed brightness is determined based on the first cycle value and the second cycle value.

[0187] In some embodiments, the first determining subunit may specifically be used for:

[0188] The first cycle value is determined based on the initial brightness, the first preset value, and the first parameter;

[0189] The second cycle value is determined based on the current display duration and the second parameter;

[0190] Determine the first sum of the first period value and the second period value; calculate the trigonometric function value of the first sum to obtain the processed brightness.

[0191] In some embodiments, the processing subunit may specifically be used for:

[0192] Calculate the second sum of the processed brightness and the second preset value;

[0193] The current brightness is obtained by multiplying the second sum by the first preset value.

[0194] In some embodiments, the first determining unit 302 may include:

[0195] The first acquisition subunit is used to acquire the position information of the target pattern in the first channel image;

[0196] A generation subunit is used to generate a reference pattern corresponding to the target pattern in the second channel image of the target texture based on the location information.

[0197] The second acquisition subunit is used to acquire the brightness of the symbolic pattern to obtain the initial brightness.

[0198] In some embodiments, the adjustment unit 304 may include:

[0199] The adjustment subunit is used to adjust the brightness of the target pattern based on the current brightness of the reference pattern corresponding to the target pattern in the second channel image.

[0200] In some embodiments, the second determining unit 303 may include:

[0201] The second determining subunit is used to determine the target brightness change pattern corresponding to the target pattern from multiple preset brightness change patterns;

[0202] The third determining subunit is used to determine the current brightness based on the target brightness change pattern, the current display duration, and the initial brightness.

[0203] This application discloses a texture processing apparatus. An acquisition unit 301 acquires a first channel image of a target texture, the first channel image including a target pattern with a flashing effect configured in the target texture. A first determining unit 302 determines the initial brightness of the target pattern. A second determining unit 303 determines the current brightness of the target pattern based on a preset brightness change pattern of the target pattern over time, the current display duration of the target texture, and the initial brightness. An adjustment unit 304 adjusts the brightness of the target pattern in the first channel image according to the current brightness, so that the target pattern flashes in the target texture. This improves texture processing efficiency.

[0204] Accordingly, embodiments of this application also provide a computer device, which can be a terminal. For example... Figure 5 As shown, Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device 500 includes a processor 501 with one or more processing cores, a memory 502 with one or more computer-readable storage media, and a computer program stored on the memory 502 and executable on the processor. The processor 501 and the memory 502 are electrically connected. Those skilled in the art will understand that the computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0205] The processor 501 is the control center of the computer device 500. It connects various parts of the computer device 500 through various interfaces and lines. By running or loading software programs and / or modules stored in the memory 502, and calling data stored in the memory 502, it performs various functions of the computer device 500 and processes data, thereby monitoring the computer device 500 as a whole.

[0206] In this embodiment, the processor 501 in the computer device 500 loads the instructions corresponding to the processes of one or more applications into the memory 502 according to the following steps, and the processor 501 runs the applications stored in the memory 502 to achieve various functions:

[0207] The first channel image of the target texture is obtained, which includes a target pattern configured with a blinking effect in the target texture; the initial brightness of the target pattern is determined; the current brightness of the target pattern is determined based on the preset brightness change pattern of the target pattern in the time dimension, the current display duration of the target texture, and the initial brightness; the brightness of the target pattern in the first channel image is adjusted according to the current brightness so that the target pattern blinks in the target texture.

[0208] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0209] Optional, such as Figure 5 As shown, the computer device 500 also includes: a touch screen display 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. The processor 501 is electrically connected to the touch screen display 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507. Those skilled in the art will understand that... Figure 5 The computer device structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0210] The touch display screen 503 can be used to display a graphical user interface (GUI) and receive operation commands generated by the user interacting with the GUI. The touch display screen 503 may include a display panel and a touch panel. 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, guidance information, icons, videos, and any combination thereof. Optionally, the display panel can be configured using a liquid crystal display (LCD), an organic light-emitting diode (OLED), or other similar devices. The touch panel can be used to collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel), generate corresponding operation commands, and execute the corresponding program according to the operation commands. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch location and the signal generated by the touch operation, transmitting the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 501. It can also receive and execute commands from the processor 501. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 501 to determine the type of touch event. Subsequently, the processor 501 provides corresponding visual output on the display panel based on the type of touch event. In this embodiment, the touch panel and the display panel can be integrated into the touch display screen 503 to achieve input and output functions. However, in some embodiments, the touch panel and the touch display screen 503 can be implemented as two independent components to achieve input and output functions. That is, the touch display screen 503 can also be used as part of the input unit 506 to achieve input functions.

[0211] The radio frequency circuit 504 can be used to transmit and receive radio frequency signals to establish wireless communication with network devices or other computer devices, and to transmit and receive signals with network devices or other computer devices.

[0212] Audio circuitry 505 can be used to provide an audio interface between a user and a computer device via a speaker and a microphone. Audio circuitry 505 converts received audio data into electrical signals, transmits them to the speaker, and the speaker converts them into sound signals for output. Conversely, the microphone converts collected sound signals into electrical signals, which are then received by audio circuitry 505, converted back into audio data, and output to processor 501 for processing. The audio data is then transmitted via radio frequency circuitry 504 to, for example, another computer device, or output to memory 502 for further processing. Audio circuitry 505 may also include an earphone jack to facilitate communication between peripheral headphones and the computer device.

[0213] The input unit 506 can be used to receive input numbers, characters, or user characteristic information (such as fingerprints, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.

[0214] Power supply 507 is used to supply power to various components of computer device 500. Optionally, power supply 507 can be logically connected to processor 501 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. Power supply 507 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0215] although Figure 5 As not shown in the diagram, the computer device 500 may also include a camera, sensor, wireless fidelity module, Bluetooth module, etc., which will not be described in detail here.

[0216] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0217] As can be seen from the above, the computer device provided in this embodiment acquires a first channel image of a target texture, the first channel image including a target pattern configured with a flashing effect in the target texture; determines the initial brightness of the target pattern; determines the current brightness of the target pattern based on the preset brightness change law of the target pattern in the time dimension, the current display duration of the target texture and the initial brightness; and adjusts the brightness of the target pattern in the first channel image according to the current brightness so that the target pattern flashes in the target texture.

[0218] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0219] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of computer programs that can be loaded by a processor to execute the steps of any of the texture processing methods provided in embodiments of this application. For example, the computer program can execute the following steps:

[0220] Obtain the first channel image of the target texture, the first channel image including the target pattern configured with a blinking effect in the target texture;

[0221] Determine the initial brightness of the target pattern;

[0222] The current brightness of the target pattern is determined based on the preset brightness change pattern of the target pattern over time, the current display duration of the target texture, and the initial brightness.

[0223] Adjust the brightness of the target pattern in the first channel image according to the current brightness so that the target pattern blinks in the target texture.

[0224] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0225] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0226] Since the computer program stored in the storage medium can execute the steps of any of the texture processing methods provided in the embodiments of this application, the beneficial effects that any of the texture processing methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.

[0227] The foregoing has provided a detailed description of a texture processing method, apparatus, storage medium, and computer device provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A texture processing method, characterized in that, The method includes: Obtain a first channel image of the target texture, the first channel image including a target pattern configured with a blinking effect in the target texture; Determine the initial brightness of the target pattern; Based on the preset brightness change pattern of the target pattern over time, the current display duration of the target texture, and the initial brightness, the current brightness of the target pattern is determined. The brightness of the target pattern in the first channel image is adjusted according to the current brightness so that the target pattern flashes in the target texture. Determining the initial brightness of the target pattern includes: Obtain the position information of the target pattern in the first channel image; Based on the location information, a reference pattern corresponding to the target pattern is generated in the second channel image of the target texture; Obtain the brightness of the symbolic pattern to get the initial brightness; The current brightness is the current brightness corresponding to the symbolic pattern; The step of adjusting the brightness of the target pattern in the first channel image according to the current brightness includes: The brightness of the target pattern is adjusted based on the current brightness of the reference pattern corresponding to the target pattern in the second channel image.

2. The method according to claim 1, characterized in that, The step of determining the current brightness of the target pattern based on the preset brightness variation pattern of the target pattern over time, the current display duration of the target texture, and the initial brightness includes: Based on the preset brightness change pattern, the current display duration, and the initial brightness, the brightness is determined after processing. The processed brightness is normalized to obtain the current brightness.

3. The method according to claim 2, characterized in that, The brightness determined based on the preset brightness variation pattern, the current display duration, and the initial brightness includes: The first cycle value is determined based on the initial brightness, the first preset value, and the first parameter; The second cycle value is determined based on the current display duration and the second parameter; The processed brightness is determined based on the first cycle value and the second cycle value.

4. The method according to claim 3, characterized in that, The step of determining the first cycle value based on the initial brightness, the first preset value, and the first parameter includes: Calculate the difference between the initial brightness and the first preset value; The first period value is obtained by multiplying the difference by the first parameter.

5. The method according to claim 3, characterized in that, The step of determining the second cycle value based on the current display duration and the second parameter includes: The second cycle value is obtained by multiplying the current display duration by the second parameter.

6. The method according to claim 3, characterized in that, Determining the processed brightness based on the first period value and the second period value includes: Determine the first sum of the first periodic value and the second periodic value; Calculate the trigonometric function value of the first sum to obtain the processed brightness.

7. The method according to claim 2, characterized in that, The normalization process for the processed brightness to obtain the current brightness includes: Calculate the second sum of the processed brightness and the second preset value; The current brightness is obtained by multiplying the second sum by the first preset value.

8. The method according to claim 1, characterized in that, The first channel includes multiple target patterns, and the preset brightness variation pattern includes multiple preset brightness variation patterns; The step of determining the current brightness of the target pattern based on the preset brightness variation pattern of the target pattern over time, the current display duration of the target texture, and the initial brightness includes: The target brightness variation pattern corresponding to the target pattern is determined from multiple preset brightness variation patterns; Based on the target brightness variation pattern, the current display duration, and the initial brightness, the current brightness is determined.

9. A texture processing apparatus, characterized in that, The device includes: The acquisition unit is used to acquire a first channel image of a target texture, the first channel image including a target pattern configured with a flashing effect in the target texture; The first determining unit is used to determine the initial brightness of the target pattern; The second determining unit is used to determine the current brightness of the target pattern based on the preset brightness change pattern of the target pattern in the time dimension, the current display duration of the target texture, and the initial brightness. An adjustment unit is configured to adjust the brightness of the target pattern in the first channel image according to the current brightness, so that the target pattern flashes in the target texture. Determining the initial brightness of the target pattern includes: Obtain the position information of the target pattern in the first channel image; Based on the location information, a reference pattern corresponding to the target pattern is generated in the second channel image of the target texture; Obtain the brightness of the symbolic pattern to get the initial brightness; The current brightness is the current brightness corresponding to the symbolic pattern; The step of adjusting the brightness of the target pattern in the first channel image according to the current brightness includes: The brightness of the target pattern is adjusted based on the current brightness of the reference pattern corresponding to the target pattern in the second channel image.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein, When the processor executes the program, it implements the texture processing method as described in any one of claims 1 to 8.

11. A storage medium, characterized in that, The storage medium stores a plurality of instructions, which are adapted for loading by a processor to execute the texture processing method according to any one of claims 1 to 8.