Mapping effect control method and device, product and electronic equipment
By responding to texture adjustment operations in video games or special effects movies, determining gradient and highlight control parameters, and generating display effects, it solves the storage and efficiency problems when the demand for hair design surges, and achieves efficient texture control and hair design.
Patent Information
- Application Number
- CN202410932762.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-10-29
AI Technical Summary
In video games or special effects movies, when the demand for hair styling surges, the efficiency of manually drawing textures does not match the surge rate of demand, resulting in excessive storage resources and inefficiency.
By responding to the map adjustment operation, the gradient control parameters and highlight control parameters are determined, and corresponding display effects are generated to achieve gradient control, highlight control or gradient highlight control. There is no need to manually draw maps, reducing the number of stored maps and improving hair design efficiency. .
It achieves efficient storage and efficiency improvement when the demand for hair design surges, saves storage resources, solves the problem of low efficiency of manual drawing of textures, and improves the response efficiency of hair design.
Smart Images

Figure CN118864656A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method for controlling a mapping effect, a device for controlling a mapping effect, a computer program product, and an electronic device. Background Art
[0002] In the fields of electronic games or special effects movies, the demand for making character models / anthropomorphic models is commonplace. Generally speaking, in order to achieve a more prominent visual effect or to highlight the character's personality traits, the model's hairstyle will be designed, for example, the hairstyle color will be designed to be a gradient type or a highlighted type.
[0003] In the implementation process, it is usually necessary to draw a corresponding map for the hairstyle color design result so that the map can be bound to the model to achieve the specified hairstyle effect. However, when the demand for hairstyle design surges, a corresponding number of maps will be generated and need to be stored, which will occupy more storage resources.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute an existing solution known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present application is to provide a method for controlling a texture effect, a texture effect control device, a computer-readable storage medium, and an electronic device, which can directly determine a gradient control parameter and / or a highlight control parameter in response to a texture adjustment operation, thereby realizing gradient control, highlight control, or gradient highlight control for the texture, without the need to manually draw textures for different hairstyle requirements, which can reduce the number of textures that need to be stored and save storage resources. In addition, when the demand for hair style design surges, the problem of the inconsistency between the efficiency of manually drawing textures and the rate of demand surge can be solved. Since the efficiency of hair style design is improved by color control of the texture, the efficiency of responding to hair style design needs can be improved.
[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0007] According to one aspect of the present application, a method for controlling a mapping effect is provided, the method comprising:
[0008] In response to the mapping adjustment operation, a gradient control parameter and / or a highlight control parameter is determined; wherein the gradient control parameter is used to limit the gradient degree, and the highlight control parameter is used to limit the highlight range;
[0009] Generating a display effect corresponding to the map based on the gradient control parameter and / or the highlight control parameter;
[0010] Output display effect.
[0011] In an exemplary embodiment of the present application, in response to the mapping adjustment operation, determining the gradient control parameter and / or the highlight control parameter includes:
[0012] In response to the mapping adjustment operation, determining a gradient control parameter; wherein the gradient control parameter includes a first gradient control parameter and a second gradient control parameter corresponding to opposite control directions;
[0013] And / or, in response to the texture adjustment operation, determining a highlighting control parameter; wherein the highlighting control parameter includes at least two highlighting parameters, and different highlighting parameters are used to perform intermittent highlighting control on the texture.
[0014] In an exemplary embodiment of the present application, generating a display effect corresponding to a map based on a gradient control parameter includes:
[0015] The sum of the first gradual change control parameter and the second gradual change control parameter is determined as an upper limit value, and the difference between the first gradual change control parameter and the second gradual change control parameter is determined as a lower limit value;
[0016] Determine the gradient control range according to the upper limit value and the lower limit value;
[0017] Based on the pixel value of each pixel in the map, the specified gradient color, and the gradient control range, a display effect corresponding to the map is generated.
[0018] In an exemplary embodiment of the present application, based on the pixel value of each pixel point in the map, the specified gradient color, and the gradient control range, a display effect corresponding to the map is generated, including:
[0019] Determine the pixel value of each pixel in the map, and determine the horizontal value / vertical value of each pixel value;
[0020] Compare the horizontal value / vertical value with the gradient control range to obtain the comparison result corresponding to each pixel point;
[0021] Based on the comparison results and the specified gradient colors, a display effect corresponding to the map is generated.
[0022] In an exemplary embodiment of the present application, generating a display effect corresponding to a texture based on a highlighting control parameter includes:
[0023] Determine a highlight area from the map based on the highlight control parameters;
[0024] Generates a display effect corresponding to the highlighted area in the map according to the specified highlight color.
[0025] In an exemplary embodiment of the present application, generating a display effect corresponding to the map based on the gradient control parameter and the highlight control parameter includes:
[0026] Determine a gradient control range according to a first gradient control parameter and a second gradient control parameter;
[0027] Determine a highlight area from the map based on the highlight control parameters;
[0028] Based on the pixel value of each pixel point in the non-highlighted area of the texture, the specified gradient color, and the gradient control range, a display effect corresponding to the non-highlighted area is generated;
[0029] Generates a display effect corresponding to the highlighted area according to the specified highlight color.
[0030] In an exemplary embodiment of the present application, it further includes:
[0031] If a target gradient control range corresponding to the highlighted area is detected, a highlighted gradient effect corresponding to the highlighted area is generated based on the pixel value of each pixel in the highlighted area, the highlighted gradient color, and the target gradient control range.
[0032] In an exemplary embodiment of the present application, it further includes:
[0033] In response to the parameter adjustment operation, adjusting the first gradient control parameter, the second gradient control parameter and / or the highlight control parameter to obtain an adjustment result;
[0034] Update the display based on the adjustment results.
[0035] According to one aspect of the present application, a mapping effect control device is provided, comprising:
[0036] A parameter determination unit, for determining a gradient control parameter and / or a highlight control parameter in response to a mapping adjustment operation; wherein the gradient control parameter is used to limit a gradient degree, and the highlight control parameter is used to limit a highlight range;
[0037] An effect generating unit, used for generating a display effect corresponding to the map based on the gradient control parameter and / or the highlight control parameter;
[0038] The display unit is used to output display effects.
[0039] In an exemplary embodiment of the present application, the parameter determination unit determines the gradient control parameter and / or the highlight control parameter in response to the mapping adjustment operation, including:
[0040] In response to the mapping adjustment operation, determining a gradient control parameter; wherein the gradient control parameter includes a first gradient control parameter and a second gradient control parameter corresponding to opposite control directions;
[0041] And / or, in response to the texture adjustment operation, determining a highlighting control parameter; wherein the highlighting control parameter includes at least two highlighting parameters, and different highlighting parameters are used to perform intermittent highlighting control on the texture.
[0042] In an exemplary embodiment of the present application, the effect generating unit generates a display effect corresponding to the map based on the gradient control parameter, including:
[0043] The sum of the first gradual change control parameter and the second gradual change control parameter is determined as an upper limit value, and the difference between the first gradual change control parameter and the second gradual change control parameter is determined as a lower limit value;
[0044] Determine the gradient control range according to the upper limit value and the lower limit value;
[0045] Based on the pixel value of each pixel in the map, the specified gradient color, and the gradient control range, a display effect corresponding to the map is generated.
[0046] In an exemplary embodiment of the present application, the effect generation unit generates a display effect corresponding to the map based on the pixel value of each pixel point in the map, the specified gradient color, and the gradient control range, including:
[0047] Determine the pixel value of each pixel in the map, and determine the horizontal value / vertical value of each pixel value;
[0048] Compare the horizontal value / vertical value with the gradient control range to obtain the comparison result corresponding to each pixel point;
[0049] Based on the comparison results and the specified gradient colors, a display effect corresponding to the map is generated.
[0050] In an exemplary embodiment of the present application, the effect generating unit generates a display effect corresponding to the map based on the highlighting control parameter, including:
[0051] Determine a highlight area from the map based on the highlight control parameters;
[0052] Generates a display effect corresponding to the highlighted area in the map according to the specified highlight color.
[0053] In an exemplary embodiment of the present application, the effect generation unit generates a display effect corresponding to the map based on the gradient control parameter and the highlight control parameter, including:
[0054] Determine a gradient control range according to a first gradient control parameter and a second gradient control parameter;
[0055] Determine a highlight area from the map based on the highlight control parameters;
[0056] Based on the pixel value of each pixel point in the non-highlighted area of the texture, the specified gradient color, and the gradient control range, a display effect corresponding to the non-highlighted area is generated;
[0057] Generates a display effect corresponding to the highlighted area according to the specified highlight color.
[0058] In an exemplary embodiment of the present application, it further includes:
[0059] The highlight gradient unit is used to generate a highlight gradient effect corresponding to the highlight area based on the pixel value of each pixel point in the highlight area, the highlight gradient color, and the target gradient control range if a target gradient control range corresponding to the highlight area is detected.
[0060] In an exemplary embodiment of the present application, it further includes:
[0061] A parameter adjustment unit, configured to adjust the first gradient control parameter, the second gradient control parameter and / or the highlight control parameter in response to the parameter adjustment operation to obtain an adjustment result;
[0062] The effect updating unit is used to update the display effect based on the adjustment result.
[0063] According to one aspect of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, any one of the above methods is implemented.
[0064] According to one aspect of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform any one of the above methods by executing the executable instructions.
[0065] The exemplary embodiments of the present application may have some or all of the following beneficial effects:
[0066] In the method for controlling the texture effect provided in an example embodiment of the present application, the gradient control parameters and / or highlight control parameters can be directly determined in response to the texture adjustment operation, thereby realizing the gradient control, highlight control or gradient highlight control for the texture, without the need to manually draw textures for different hairstyle requirements, which can reduce the number of textures that need to be stored and save storage resources. In addition, when the demand for hair style design surges, the problem of the inconsistency between the efficiency of manually drawing textures and the rate of demand surge can be solved. Since the efficiency of hair style design is improved by color control of the texture, the efficiency of responding to hair style design needs can be improved.
[0067] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0069] Figure 1 A flowchart of a method for controlling a mapping effect according to an embodiment of the present application is schematically shown;
[0070] Figure 2 A schematic diagram a schematically shows the display effect of a sticker according to an embodiment of the present application;
[0071] Figure 3 A schematic diagram b schematically shows the display effect of a sticker according to an embodiment of the present application;
[0072] Figure 4 A schematic diagram c schematically shows the display effect of a sticker according to an embodiment of the present application;
[0073] Figure 5 A flowchart of a mapping effect control method according to another embodiment of the present application is schematically shown;
[0074] Figure 6 The structure block diagram of a mapping effect control device according to an embodiment of the present application is schematically shown;
[0075] Figure 7 The structure diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0076] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present application will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical solutions of the present application may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present application.
[0077] In addition, the accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0078] See also Figure 1 , Figure 1 The flowchart of the mapping effect control method according to an embodiment of the present application is schematically shown. Figure 1 As shown, the mapping effect control method may include: steps S110 to S130.
[0079] Step S110: In response to the mapping adjustment operation, determine the gradient control parameter and / or the highlight control parameter; wherein the gradient control parameter is used to limit the gradient degree, and the highlight control parameter is used to limit the highlight range.
[0080] Step S120: generating a display effect corresponding to the texture based on the gradient control parameter and / or the highlight control parameter.
[0081] Step S130: output display effect.
[0082] Implementation Figure 1 The method shown can directly determine the gradient control parameters and / or highlight control parameters in response to the map adjustment operation, thereby realizing gradient control, highlight control, or gradient highlight control for the map, without the need to manually draw maps for different hairstyle requirements, which can reduce the number of maps that need to be stored and save storage resources. In addition, when the demand for hair style design surges, the problem of the inconsistency between the efficiency of manually drawing maps and the surge rate of demand can be solved. Since the hair style design efficiency is improved by color control of the map, the efficiency of responding to the hair style design demand can be improved.
[0083] Next, the above steps of this exemplary embodiment are described in more detail.
[0084] In step S110, in response to the mapping adjustment operation, a gradient control parameter and / or a highlight control parameter are determined; wherein the gradient control parameter is used to limit the gradient degree, and the highlight control parameter is used to limit the highlight range.
[0085] Specifically, in order to reduce the number of textures that need to be stored, the present application defines gradient control parameters and highlight control parameters, and can change the style of existing textures through gradient control parameters and highlight control parameters, so as to adapt to different hairstyle requirements. When it is necessary to change the hairstyle of a character model / anthropomorphic model, etc., the style of the texture applied to the model can be changed to a style that meets the requirements by adjusting the gradient control parameters and highlight control parameters.
[0086] The degree of gradient defined by the gradient control parameter can be understood as the highlighted area of the gradient feature and / or the gradient range of the gradient feature. The highlight range defined by the highlight control parameter refers to the partial area of the map that needs to be highlighted. For the highlight range, pure color highlighting or gradient highlighting can be performed, which is not limited in the embodiments of the present application.
[0087] As an optional embodiment, in response to the mapping adjustment operation, determining the gradient control parameter and / or the highlight control parameter includes:
[0088] In response to the mapping adjustment operation, determining a gradient control parameter; wherein the gradient control parameter includes a first gradient control parameter and a second gradient control parameter corresponding to opposite control directions;
[0089] And / or, in response to the texture adjustment operation, determining a highlighting control parameter; wherein the highlighting control parameter includes at least two highlighting parameters, and different highlighting parameters are used to perform intermittent highlighting control on the texture.
[0090] It can be seen that the implementation of this optional embodiment can facilitate users to achieve the desired mapping effect by controlling the gradient control parameters and / or the highlighting control parameters without the need for mapping drawing, thereby improving the efficiency of obtaining the mapping effect.
[0091] Specifically, the first gradient control parameter and the second gradient control parameter can be used to control the gradient degree in opposite directions. For example, the first gradient control parameter is used to control the gradient degree from top to bottom, and the second gradient control parameter is used to control the gradient degree from bottom to top. In the program, the first gradient control parameter is implemented as cBaseThreshold, and the second gradient control parameter is implemented as cBaseFeather. Optionally, the first gradient control parameter can also be implemented as cBaseFeather, and the second gradient control parameter can be implemented as cBaseThreshold, which is not limited in the embodiments of the present application.
[0092] In addition, the texture adjustment operation may act on at least one of cBaseThreshold and cBaseFeather to adjust the value of cBaseThreshold or cBaseFeather, thereby affecting the final display effect through the value.
[0093] In addition, the mapping adjustment operation can also act on the highlighting control parameters including at least two highlighting parameters (e.g., cDyeFistLine.x and cDyeFistLine.y) to determine the area that needs to be highlighted based on the values of cDyeFistLine.x and / or cDyeFistLine.y; wherein different highlighting parameters are at least used to limit the direction of the highlighted area (e.g., U, V) and determine the size of the highlighted area.
[0094] In step S120, a display effect corresponding to the texture is generated based on the gradient control parameter and / or the highlight control parameter.
[0095] Specifically, the display effect can be a gradient effect, a solid color highlight effect, a gradient highlight effect, a plurality of gradient highlight effects coexisting, a gradient background and a gradient highlight foreground, a gradient background and a solid color highlight foreground, etc., which is not limited in the embodiments of the present application.
[0096] As an optional embodiment of step S120, generating a display effect corresponding to the map based on the gradient control parameter includes:
[0097] Step S1201a: determining the sum of the first gradual change control parameter and the second gradual change control parameter as the upper limit value, and determining the difference between the first gradual change control parameter and the second gradual change control parameter as the lower limit value;
[0098] Step S1202a: determining a gradual change control range according to an upper limit value and a lower limit value;
[0099] Step S1203a: Based on the pixel value of each pixel in the texture, the specified gradient color, and the gradient control range, a display effect corresponding to the texture is generated.
[0100] It can be seen that by implementing this optional embodiment, the final gradient display effect can be determined based on the first gradient control parameter and the second gradient control parameter defined in the present application and the pixel values in the texture head map. A texture that meets the requirements can be obtained without manual drawing, which can save texture storage resources.
[0101] Specifically, the gradient control range is used to limit the area where the gradient effect is highlighted. The pixel value of each pixel in the map can be the X pixel value of the pixel or the V pixel value, which is not limited in the embodiment of the present application; wherein the value range of the X pixel value and the V pixel value can be [0,1]. That is, it can be understood that the present application can achieve both horizontal gradient effects and vertical gradient effects. Specifying gradient colors refers to at least two colors used to achieve gradients. The specified gradient colors can be the original colors of the map or specified colors.
[0102] Optionally, the code for generating a display effect corresponding to the map based on the gradient control parameter can be implemented as follows:
[0103]
[0104] Among them, the function "smoothstep" is used to generate a smooth transition value from 0 to 1 to achieve a gradient effect. "IN.TexCoord.y" refers to the V pixel value of each pixel in the texture, and the V pixel value refers to the value of the texture in the V direction. "half" is used to adjust the accuracy of the result. "baseMask" is used to calculate the mask value between [0,1], that is, the parameter used to calculate the color interpolation. "cBaseThreshold" and "cBaseFeather" are a set of parameters, both of which are used to control the degree of gradient. The values of "cBaseThreshold" and "cBaseFeather" are both between [0,1]. When "cBaseThreshold" is 0, that is, when "cBaseThreshold" changes between 0 and 1, the two colors are spliced without gradient, and no gradient effect will be produced. The two parameters "cBaseThreshold" and "cBaseFeather" interact with each other between [0,1] to produce a gradient effect. In addition, the area that produces the gradient effect supports user definition. "gradientCol" is the result of color interpolation and mixing, which is obtained by interpolating and mixing the two colors "cBasicColor01" and "cBasicColor02" under the action of "baseMask". "lerp" is used to calculate the interpolation and mixing effect.
[0105] As an optional embodiment of step S1203a, based on the pixel value of each pixel point in the texture, the specified gradient color, and the gradient control range, generating a display effect corresponding to the texture includes:
[0106] Step S1203a-1: Determine the pixel value of each pixel point in the map, and determine the horizontal value / vertical value of each pixel value;
[0107] Step S1203a-2: Compare the horizontal value / vertical value with the gradient control range to obtain a comparison result corresponding to each pixel point;
[0108] Step S1203a-3: Based on each comparison result and the specified gradient color, generate a display effect corresponding to the texture.
[0109] It can be seen that by implementing this optional embodiment, the position of the horizontal value / vertical value in the gradient control range can be determined by comparing the horizontal value / vertical value with the gradient control range, and the degree of gradient that the pixel value of the horizontal value / vertical value should display can be determined using this as the comparison result.
[0110] Specifically, the horizontal value / vertical value can be understood as the U pixel value / V pixel value. The comparison result represents the position of the horizontal value / vertical value in the gradient control range. Based on each comparison result and the specified gradient color, the display effect corresponding to the map can be referred to. Figure 2 .
[0111] As an optional embodiment of step S120, generating a display effect corresponding to the map based on the highlighting control parameter includes:
[0112] Step S1201b: determining a highlighting area from the map based on the highlighting control parameters;
[0113] Step S1202b: Generate a display effect corresponding to the highlighted area in the texture according to the specified highlighted color.
[0114] It can be seen that by implementing this optional embodiment, the highlighting area can be determined by adjusting the highlighting control parameters, and the highlighting effect can be automatically achieved based on the highlighting area.
[0115] Specifically, the highlighted area determined from the texture based on the highlight control parameters can be found in Figure 3 .like Figure 3 As shown in the figure, the highlighted areas are three vertical strips. For these highlighted areas, the display effect corresponding to the highlighted areas in the texture can be generated according to the specified highlight color; wherein the specified highlight color can be the original texture color or another specified color. For example, in Figure 3 , the specified highlight color can be white.
[0116] It should be noted that, in one case, the core idea of achieving highlights is to divide the map into equal parts. Since the UV value range is [0,1], the results of the equal division can include: [0,0.1], [0.1,0.2], [0.1,0.3], etc.
[0117] Optionally, the code for generating a display effect corresponding to the texture based on the highlighting control parameter may be implemented as follows:
[0118]
[0119] Among them, the value range of cDyeFistLine.x and cDyeFistLine.y is [0,1]. For example, when the cDyeFistLine.x input is 0 and cDyeFistLine.y is 0.1, it is considered that the first part of the ten-part UV is selected, and the first part can be used as the highlight area. The result of "Left1" is used to clarify one of the ten-part results to be selected, and the result of "Right1" is used to clarify the other part of the ten-part results to be selected. The final highlighted area is the value of the result of "Left1" multiplied by the result of "Right1". "cDyeFistLine.x" and "cDyeFistLine.y" are a set of corresponding parameters, both used to control the degree of gradient, and the values of "cDyeFistLine.x" and "cDyeFistLine.y" are both between [0,1]. "saturate" is used to standardize the color to between [0,1]. "clamp" is used to limit the value of the tensor to a specified range. "half firstLine" is the result of "saturate" normalized by the value of "Left1" multiplied by "Right1".
[0120] As an optional embodiment of step S120, generating a display effect corresponding to the texture based on the gradient control parameter and the highlight control parameter includes:
[0121] Step S1201c: determining a gradual change control range according to the first gradual change control parameter and the second gradual change control parameter;
[0122] Step S1202c: determining a highlighting area from the map based on the highlighting control parameter;
[0123] Step S1203c: generating a display effect corresponding to the non-highlighted area based on the pixel value of each pixel point in the non-highlighted area of the texture, the specified gradient color, and the gradient control range;
[0124] Step S1204c: Generate a display effect corresponding to the highlighted area according to the specified highlighting color.
[0125] It can be seen that the implementation of this optional embodiment can achieve both gradient effect and highlighting effect, and can meet the diverse effect customization needs.
[0126] Specifically, the gradient effect and the highlighting effect can be achieved at the same time. Optionally, the area in the map where the highlighting can be achieved can also include multiple areas. Figure 4 , Figure 4 FIG. 4 schematically shows a display effect diagram of a sticker according to an embodiment of the present application. Figure 4 As shown, the highlighted area can show a non-gradient effect or a gradient effect. Figure 2 In addition to the gradient effects shown, non-gradient effects can also be displayed.
[0127] As an optional embodiment, it also includes:
[0128] Step S1205c: If a target gradient control range corresponding to the highlighted area is detected, a highlighted gradient effect corresponding to the highlighted area is generated based on the pixel value of each pixel in the highlighted area, the highlighted gradient color, and the target gradient control range.
[0129] It can be seen that by implementing this optional embodiment, a gradient effect can be achieved in the highlighted area, enriching the diversity of the display effects.
[0130] Specifically, the method for determining the target gradual control range is consistent with the method for determining the aforementioned gradual control range, but the gradual control parameter corresponding to the target gradual control range is different from the gradual control parameter of the gradual control range.
[0131] In step S130, a display effect is output.
[0132] Specifically, the display effect can be implemented in the shader and output through the display screen. The shader is used to implement image rendering and can replace the editable program of the fixed rendering pipeline. Specifically, the vertex shader is mainly responsible for the calculation of the geometric relationship of the vertices, and the pixel shader is mainly responsible for the calculation of the color of the fragment.
[0133] As an optional embodiment, it also includes:
[0134] Step S140: In response to the parameter adjustment operation, adjusting the first gradient control parameter, the second gradient control parameter and / or the highlighting control parameter to obtain an adjustment result;
[0135] Step S150: updating the display effect based on the adjustment result.
[0136] It can be seen that the implementation of this optional embodiment can facilitate the user to adjust various parameters at any time based on the display effect until the desired display effect is obtained.
[0137] Specifically, if there is a need to adjust the display effect, the first gradient control parameter, the second gradient control parameter and / or the highlight control parameter may continue to be adjusted until the updated display effect meets the need.
[0138] See also Figure 5 , Figure 5 The flowchart of a method for controlling a mapping effect according to another embodiment of the present application is schematically shown. Figure 5As shown, the mapping effect control method includes: steps S510a to S514a, steps S510b to S512b or steps S510c to S514c. After steps S514a, S512b and S514c, steps S520 and S530 may also be included.
[0139] Steps S510a to S514a include:
[0140] Step S510a: In response to the mapping adjustment operation, determining a gradient control parameter; wherein the gradient control parameter includes a first gradient control parameter and a second gradient control parameter corresponding to opposite control directions.
[0141] Step S512a: determine the sum of the first gradual change control parameter and the second gradual change control parameter as the upper limit value, and determine the difference between the first gradual change control parameter and the second gradual change control parameter as the lower limit value; determine the gradual change control range according to the upper limit value and the lower limit value.
[0142] Step S514a: Determine the pixel value of each pixel in the map, and determine the horizontal value / vertical value in each pixel value; compare the horizontal value / vertical value with the gradient control range to obtain the comparison result corresponding to each pixel; based on each comparison result and the specified gradient color, generate a display effect corresponding to the map.
[0143] Steps S510b to S512b include:
[0144] Step S510b: In response to the texture adjustment operation, determining highlighting control parameters; wherein the highlighting control parameters include at least two highlighting parameters, and different highlighting parameters are used to perform intermittent highlighting control on the texture.
[0145] Step S512b: determining a highlighted area from the texture based on the highlight control parameters, and generating a display effect corresponding to the highlighted area in the texture according to the designated highlight color.
[0146] Steps S510c to S514c include:
[0147] Step S510c: In response to the texture adjustment operation, determine the gradient control parameters and the highlight control parameters; wherein the gradient control parameters include a first gradient control parameter and a second gradient control parameter corresponding to opposite control directions, and the highlight control parameters include at least two highlight parameters, and different highlight parameters are used to perform intermittent highlight control on the texture.
[0148] Step S512c: determine the gradient control range according to the first gradient control parameter and the second gradient control parameter; determine the highlighted area from the map based on the highlight control parameter; generate a display effect corresponding to the non-highlighted area based on the pixel value of each pixel in the non-highlighted area of the map, the specified gradient color, and the gradient control range, and generate a display effect corresponding to the highlighted area according to the specified highlight color.
[0149] Step S514c: If a target gradient control range corresponding to the highlighted area is detected, a highlighted gradient effect corresponding to the highlighted area is generated based on the pixel value of each pixel in the highlighted area, the highlighted gradient color, and the target gradient control range.
[0150] Step S520: output display effect.
[0151] Step S530: In response to the parameter adjustment operation, the first gradient control parameter, the second gradient control parameter and / or the highlight control parameter are adjusted to obtain an adjustment result; and the display effect is updated based on the adjustment result.
[0152] It should be noted that steps S510a to S514a, steps S510b to S512b, steps S510c to S514c, steps S520 and S530 are Figure 1 The steps and embodiments shown correspond to Figure 5 For the specific implementation of the steps, please refer to Figure 1 The steps and embodiments shown are not described in detail here.
[0153] It can be seen that the implementation Figure 5 The method shown can directly determine the gradient control parameters and / or highlight control parameters in response to the map adjustment operation, thereby realizing gradient control, highlight control, or gradient highlight control for the map, without the need to manually draw maps for different hairstyle requirements, which can reduce the number of maps that need to be stored and save storage resources. In addition, when the demand for hair style design surges, the problem of the inconsistency between the efficiency of manually drawing maps and the surge rate of demand can be solved. Since the hair style design efficiency is improved by color control of the map, the efficiency of responding to the hair style design demand can be improved.
[0154] See also Figure 6 , Figure 6 The structure block diagram of the sticker effect control device according to an embodiment of the present application is schematically shown. Figure 1 The method shown corresponds to Figure 6 As shown, the mapping effect control device 600 includes:
[0155] The parameter determination unit 601 is used to determine the gradient control parameter and / or the highlight control parameter in response to the map adjustment operation; wherein the gradient control parameter is used to limit the gradient degree, and the highlight control parameter is used to limit the highlight range;
[0156] An effect generating unit 602, configured to generate a display effect corresponding to the texture based on the gradient control parameter and / or the highlight control parameter;
[0157] The display unit 603 is used to output display effects.
[0158] It can be seen that the implementation Figure 6 The device shown can directly determine the gradient control parameters and / or highlight control parameters in response to the map adjustment operation, thereby realizing gradient control, highlight control, or gradient highlight control for the map, without the need to manually draw maps for different hairstyle requirements, which can reduce the number of maps that need to be stored and save storage resources. In addition, when the demand for hair style design surges, the problem of the inconsistency between the efficiency of manually drawing maps and the surge rate of demand can be solved. Since the hair style design efficiency is improved by color control of the map, the efficiency of responding to the hair style design demand can be improved.
[0159] In an exemplary embodiment of the present application, the parameter determination unit 601 determines the gradient control parameter and / or the highlight control parameter in response to the map adjustment operation, including:
[0160] In response to the mapping adjustment operation, determining a gradient control parameter; wherein the gradient control parameter includes a first gradient control parameter and a second gradient control parameter corresponding to opposite control directions;
[0161] And / or, in response to the texture adjustment operation, determining a highlighting control parameter; wherein the highlighting control parameter includes at least two highlighting parameters, and different highlighting parameters are used to perform intermittent highlighting control on the texture.
[0162] It can be seen that the implementation of this optional embodiment can facilitate users to achieve the desired mapping effect by controlling the gradient control parameters and / or the highlighting control parameters without the need for mapping drawing, thereby improving the efficiency of obtaining the mapping effect.
[0163] In an exemplary embodiment of the present application, the effect generating unit 602 generates a display effect corresponding to the map based on the gradient control parameter, including:
[0164] The sum of the first gradual change control parameter and the second gradual change control parameter is determined as an upper limit value, and the difference between the first gradual change control parameter and the second gradual change control parameter is determined as a lower limit value;
[0165] Determine the gradient control range according to the upper limit value and the lower limit value;
[0166] Based on the pixel value of each pixel in the map, the specified gradient color, and the gradient control range, a display effect corresponding to the map is generated.
[0167] It can be seen that by implementing this optional embodiment, the final gradient display effect can be determined based on the first gradient control parameter and the second gradient control parameter defined in the present application and the pixel values in the texture head map. A texture that meets the requirements can be obtained without manual drawing, which can save texture storage resources.
[0168] In an exemplary embodiment of the present application, the effect generation unit 602 generates a display effect corresponding to the map based on the pixel value of each pixel point in the map, the specified gradient color, and the gradient control range, including:
[0169] Determine the pixel value of each pixel in the map, and determine the horizontal value / vertical value of each pixel value;
[0170] Compare the horizontal value / vertical value with the gradient control range to obtain the comparison result corresponding to each pixel point;
[0171] Based on the comparison results and the specified gradient colors, a display effect corresponding to the map is generated.
[0172] It can be seen that by implementing this optional embodiment, the position of the horizontal value / vertical value in the gradient control range can be determined by comparing the horizontal value / vertical value with the gradient control range, and the degree of gradient that the pixel value of the horizontal value / vertical value should display can be determined using this as the comparison result.
[0173] In an exemplary embodiment of the present application, the effect generating unit 602 generates a display effect corresponding to the map based on the highlighting control parameter, including:
[0174] Determine a highlight area from the map based on the highlight control parameters;
[0175] Generates a display effect corresponding to the highlighted area in the map according to the specified highlight color.
[0176] It can be seen that by implementing this optional embodiment, the highlighting area can be determined by adjusting the highlighting control parameters, and the highlighting effect can be automatically achieved based on the highlighting area.
[0177] In an exemplary embodiment of the present application, the effect generating unit 602 generates a display effect corresponding to the map based on the gradient control parameter and the highlight control parameter, including:
[0178] Determine a gradient control range according to a first gradient control parameter and a second gradient control parameter;
[0179] Determine a highlight area from the map based on the highlight control parameters;
[0180] Based on the pixel value of each pixel point in the non-highlighted area of the texture, the specified gradient color, and the gradient control range, a display effect corresponding to the non-highlighted area is generated;
[0181] Generates a display effect corresponding to the highlighted area according to the specified highlight color.
[0182] It can be seen that the implementation of this optional embodiment can achieve both gradient effect and highlighting effect, and can meet the diverse effect customization needs.
[0183] In an exemplary embodiment of the present application, it further includes:
[0184] The highlight gradient unit is used to generate a highlight gradient effect corresponding to the highlight area based on the pixel value of each pixel point in the highlight area, the highlight gradient color, and the target gradient control range if a target gradient control range corresponding to the highlight area is detected.
[0185] It can be seen that by implementing this optional embodiment, a gradient effect can be achieved in the highlighted area, enriching the diversity of the display effects.
[0186] In an exemplary embodiment of the present application, it further includes:
[0187] A parameter adjustment unit, configured to adjust the first gradient control parameter, the second gradient control parameter and / or the highlight control parameter in response to the parameter adjustment operation to obtain an adjustment result;
[0188] The effect updating unit is used to update the display effect based on the adjustment result.
[0189] It can be seen that the implementation of this optional embodiment can facilitate the user to adjust various parameters at any time based on the display effect until the desired display effect is obtained.
[0190] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0191] Since the various functional modules of the sticker effect control device of the example embodiment of the present application correspond to the steps of the example embodiment of the sticker effect control method described above, for details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the sticker effect control method described above in the present application.
[0192] See also Figure 7 , Figure 7A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0193] It should be noted that Figure 7 The computer system 700 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0194] like Figure 7 As shown, computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 into a random access memory (RAM) 703. Various programs and data required for system operation are also stored in RAM 703. CPU 701, ROM 702 and RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to bus 704.
[0195] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.
[0196] In particular, according to an embodiment of the present application, the process described with reference to the flowchart above can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 709, and / or installed from a removable medium 711. When the computer program is executed by a central processing unit (CPU) 701, various functions defined in the method and apparatus of the present application are executed.
[0197] The exemplary embodiments of the present disclosure also provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the above-mentioned mapping effect control method is implemented.
[0198] In one embodiment, the computer program product may be a tangible product containing a computer program, such as a computer-readable storage medium storing a computer program. The readable storage medium may be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory (Flash), mechanical hard disk (HDD), solid-state drive (SSD), and the like. Exemplarily, the computer program product may be implemented as a non-volatile storage medium storing a computer program, such as a read-only memory, a NAND flash memory, and the like.
[0199] In one embodiment, the computer program product may be an intangible product including a computer program. Exemplarily, the computer program product may be implemented as a virtual digital product, such as a digital file storing an executable file, an installation package, etc. of the computer program.
[0200] The code of the computer program can be written in one or more programming languages. Programming languages such as C language, Java, C++, etc. The program code can be executed entirely on the user computing device, or partially on the user computing device, or as a separate software package, or partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, such as a local area network (LAN), a wide area network (WAN), etc., or can be connected to an external computing device (e.g., an Internet connection provided by an operator).
[0201] Computer programs can be carried or transmitted through electrical, magnetic, optical, electromagnetic, infrared and other signals. Electronic devices can convert signals carrying computer programs into digital signals, thereby running the computer programs. When a computer program runs on an electronic device, its code is used to enable the electronic device to execute (more specifically, it can enable the processor of the electronic device to execute) the method steps of various exemplary embodiments of the present disclosure, such as the above-mentioned mapping effect control method, which includes the following steps: in response to a mapping adjustment operation, determining gradient control parameters and / or highlighting control parameters; wherein the gradient control parameters are used to limit the gradient degree, and the highlighting control parameters are used to limit the highlighting range; generating a display effect corresponding to the mapping based on the gradient control parameters and / or the highlighting control parameters; and outputting the display effect.
[0202] By executing the above method steps through a computer program, the gradient control parameters and / or highlight control parameters can be directly determined in response to the map adjustment operation, thereby realizing gradient control, highlight control or gradient highlight control for the map, without the need to manually draw maps for different hairstyle requirements, which can reduce the number of maps that need to be stored and save storage resources. In addition, when the demand for hair style design surges, the problem of the inconsistency between the efficiency of manually drawing maps and the surge rate of demand can be solved. Since the efficiency of hair style design is improved by color control of the map, the efficiency of responding to hair style design needs can be improved.
[0203] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0204] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0205] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the claims.
Claims
1. A mapping effect control method, characterized in that: include: In response to the mapping adjustment operation, a gradient control parameter and / or a highlight control parameter is determined; wherein the gradient control parameter is used to limit the gradient degree, and the highlight control parameter is used to limit the highlight range; Generate a display effect of a texture based on the gradient control parameter and / or the highlight control parameter; The display effect is output.
2. The method according to claim 1, characterized in that In response to the mapping adjustment operation, gradient control parameters and / or highlight control parameters are determined, including: In response to the mapping adjustment operation, a gradient control parameter is determined; wherein the gradient control parameter includes a first gradient control parameter and a second gradient control parameter corresponding to opposite control directions; And / or, in response to the texture adjustment operation, determining a highlighting control parameter; wherein the highlighting control parameter includes at least two highlighting parameters, and different highlighting parameters are used to perform intermittent highlighting control on the texture.
3. The method according to claim 2, characterized in that Generating a display effect corresponding to the map based on the gradient control parameter, including: Determine the sum of the first gradual change control parameter and the second gradual change control parameter as an upper limit value, and determine the difference between the first gradual change control parameter and the second gradual change control parameter as a lower limit value; Determine a gradual change control range according to the upper limit value and the lower limit value; Based on the pixel value of each pixel point in the map, the specified gradient color, and the gradient control range, a display effect corresponding to the map is generated.
4. The method according to claim 3, characterized in that Based on the pixel value of each pixel point in the map, the specified gradient color, and the gradient control range, a display effect corresponding to the map is generated, including: Determine the pixel value of each pixel in the map, and determine the horizontal value / vertical value of each pixel value; Comparing the horizontal value / vertical value with the gradient control range to obtain a comparison result corresponding to each pixel point; Based on the comparison results and the specified gradient colors, a display effect corresponding to the map is generated.
5. The method according to claim 2, characterized in that: Generating a display effect corresponding to the map based on the highlighting control parameter includes: Determining a highlighted area from the texture based on the highlight control parameters; A display effect corresponding to the highlighted area in the map is generated according to the specified highlighted color.
6. The method according to claim 2, characterized in that Generating a display effect corresponding to the map based on the gradient control parameter and the highlight control parameter, including: Determine a gradual change control range according to the first gradual change control parameter and the second gradual change control parameter; Determine a highlight area from the map based on the highlight control parameters; Based on the pixel value of each pixel point in the non-highlighted area of the texture, the specified gradient color, and the gradient control range, a display effect corresponding to the non-highlighted area is generated; A display effect corresponding to the highlighted area is generated according to the specified highlighted color.
7. The method according to claim 6, characterized in that Also includes: If a target gradient control range corresponding to the highlighted area is detected, a highlighted gradient effect corresponding to the highlighted area is generated based on the pixel value of each pixel in the highlighted area, the highlighted gradient color, and the target gradient control range.
8. The method according to claim 2, characterized in that: Also includes: In response to the parameter adjustment operation, the first gradient control parameter, the second gradient control parameter and / or the highlight control parameter are adjusted to obtain an adjustment result; The display effect is updated based on the adjustment result.
9. A mapping effect control device, characterized in that: include: A parameter determination unit, for determining a gradient control parameter and / or a highlight control parameter in response to a mapping adjustment operation; wherein the gradient control parameter is used to limit a gradient degree, and the highlight control parameter is used to limit a highlight range; An effect generating unit, configured to generate a display effect corresponding to the texture based on the gradient control parameter and / or the highlight control parameter; The display unit is used to output the display effect.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
11. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 8 by executing the executable instructions.
