A method, device, electronic device and storage medium for generating game character makeup

By obtaining and configuring the makeup part attribute information of the face of the game character and generating and storing the makeup texture data, the problem of low makeup parameter adjustment efficiency in the existing technology is solved, and efficient makeup configuration and rendering effects are achieved.

CN114288672BActive Publication Date: 2025-05-27BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111680819.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2025-05-27
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

In the prior art, the parameter adjustment of game character makeup requires artists to manually fill in forms and adjust, resulting in low development efficiency and artists need to spend a lot of time to configure makeup effects.

Method used

By obtaining the coloring data of the game character's face, determining the attribute information corresponding to the makeup part to be generated, and configuring makeup parameter values ​​for these attribute information, including interpolation coefficients within the editable parameter interval, generating makeup texture data to present makeup effects, and storing these parameter values ​​and texture data.

Benefits of technology

It realizes that artists can directly configure makeup effects in the makeup editor, saves artists time to adjust makeup preview effects, improves game development efficiency, and only needs to transmit interpolation coefficients during runtime to render makeup effects, reducing data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114288672B_ABST
    Figure CN114288672B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, electronic device and storage medium for generating game character makeup. Through the pre-configured correspondence between each makeup part and the attribute information in the coloring data, the makeup effect of each makeup part can be directly configured in the makeup editor, and the artist can preview the configuration effect by adjusting the makeup parameter values of the attribute information corresponding to each makeup part. The makeup parameter values adjusted by the artist can be saved locally for previewing the effect next time. The saved makeup texture data after editing can be directly parsed and rendered, and only the interpolation coefficient within the editable parameter range of the makeup part needs to be transmitted during runtime, without reading other parameters configured by the artist.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a method, device, electronic device, and storage medium for generating game character makeup looks. Background Art

[0002] The face sculpting system is currently one of the standard configuration systems in most RPG (Role-playing game) type games. Through the face sculpting system, players can create the makeup image of their favorite game characters with a high degree of freedom.

[0003] In the related art, the parameter adjustment range and effects corresponding to the character makeup in the game need to be set during development. However, the configuration preview of the makeup parts can only be viewed by assigning values to the parameters in the Material and rendering. The parameters need to be manually filled in and adjusted by artists to achieve the adjustment of the makeup parts. In this way, the art production staff need to spend a lot of time and workload on the configuration of the makeup effects, and the game development efficiency is low. Summary of the Invention

[0004] To solve the above technical problems or at least partially solve the above technical problems, embodiments of the present application provide a method, device, electronic device, and storage medium for generating game character makeup looks.

[0005] According to one aspect of the embodiments of the present application, a method for generating game character makeup looks is provided, including:

[0006] Obtain the shading data corresponding to the face of the game character, where the shading data contains the attribute information corresponding to each makeup part;

[0007] Determine the attribute information corresponding to the makeup part of the makeup to be generated in the shading data;

[0008] Configure makeup parameter values for the attribute information corresponding to the makeup part, where the makeup parameter values include interpolation coefficients within the editable parameter range of the makeup to be generated;

[0009] Generate makeup texture data corresponding to the makeup part according to the makeup parameter values, where the makeup texture data is used to render the makeup part to present the makeup effect corresponding to the makeup parameter values;

[0010] Store the makeup parameter values and the makeup texture data corresponding to the makeup parameter values.

[0011] Optionally, the method further includes:

[0012] Obtain the target mask channel for cropping the makeup texture data;

[0013] Determine the cropping area information corresponding to the cropping area according to the makeup texture data and the target mask channel;

[0014] Crop the makeup texture data according to the cropping area information to obtain the cropped target makeup texture data;

[0015] Store the target makeup texture data and update the attribute information associated with the makeup part according to the cropping area information.

[0016] Optionally, the determining the cropping area information corresponding to the cropping area according to the makeup texture data and the target mask channel includes:

[0017] Obtain the pixel values of each pixel in the target mask channel of the makeup texture data;

[0018] Find the target pixels with non-zero pixel values and obtain the target pixel coordinates of the target pixels;

[0019] Determine the extreme values of the target pixel coordinates on each coordinate axis;

[0020] Determine the cropping area information according to the extreme values.

[0021] Optionally, the method further includes:

[0022] Obtain the target makeup texture data to be packaged;

[0023] Perform a packaging process on the target makeup texture data to be packaged to obtain a makeup texture set;

[0024] Replace the target makeup texture data to be packaged with the makeup texture set.

[0025] Optionally, obtaining the target makeup texture data to be packaged includes:

[0026] Determine the target attribute information of the target makeup texture data;

[0027] Use the target makeup texture data with the same target attribute information as the target makeup texture data to be packaged.

[0028] Optionally, the method further includes:

[0029] Merge the makeup texture data with the facial texture data of the game character's face to generate the rendering texture data of the game character's face;

[0030] Render the game character's face with the rendering texture data to display the makeup effect of the game character's face.

[0031] Optionally, the merging of the makeup texture data with the facial texture data of the game character's face includes:

[0032] Identifying the position information and coverage range of the makeup area on the game character's face;

[0033] Overlaying the makeup texture data onto the facial texture data according to the position information and the coverage range.

[0034] According to another aspect of the embodiments of the present application, there is provided a game character makeup generation device, including:

[0035] An acquisition module, configured to acquire coloring data corresponding to the face of a game character, where the coloring data includes attribute information corresponding to each makeup area;

[0036] A establishment module, configured to determine the attribute information corresponding to the makeup area of the makeup to be generated in the coloring data;

[0037] A configuration module, configured to configure makeup parameter values for the attribute information corresponding to the makeup area, where the makeup parameter values include interpolation coefficients within an editable parameter range of the makeup to be generated;

[0038] A generation module, configured to generate makeup texture data corresponding to the makeup area according to the makeup parameter values, where the makeup texture data is used to render the makeup area to present a makeup effect corresponding to the makeup parameter values;

[0039] A storage module, configured to store the makeup parameter values and the makeup texture data corresponding to the makeup parameter values.

[0040] According to another aspect of the embodiments of the present application, there is also provided a storage medium, which includes a stored program, and when the program runs, it executes the above steps.

[0041] According to another aspect of the embodiments of the present application, there is provided an electronic device, including: a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;

[0042] The memory is used to store a computer program;

[0043] The processor is configured to implement the above method steps when executing the computer program.

[0044] According to another aspect of the embodiments of the present application, there is provided a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above method steps are implemented.

[0045] The above technical solutions provided by the embodiments of the present application have the following advantages compared with the prior art:

[0046] In the technical solution of the embodiment of the present application, by pre-configuring the correspondence between each makeup part and the attribute information in the coloring data, directly configure the makeup effects of each makeup part in the makeup editor, and the art personnel can preview the configuration effect by adjusting the makeup parameter values of the corresponding attribute information of each makeup part. For the makeup parameter values adjusted by the art personnel, they can be saved locally for previewing the effect next time. For the saved makeup texture data after editing, it can be directly parsed and rendered. During runtime, only the interpolation coefficients within the editable parameter range of the makeup part need to be transmitted, without reading other parameters configured by the art personnel. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present invention and used together with the specification to explain the principles of the present invention.

[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0049] Figure 1 is a schematic diagram of the hardware environment of an optional method for generating a game character makeup according to an embodiment of the present application;

[0050] Figure 2 is a schematic flowchart of a method for generating a game character makeup provided by an embodiment of the present application;

[0051] Figure 3 is a schematic flowchart of a method for generating a game character makeup provided by another embodiment of the present application;

[0052] Figure 4 is a schematic flowchart of a method for generating a game character makeup provided by another embodiment of the present application;

[0053] Figure 5 is a schematic flowchart of a method for generating a game character makeup provided by another embodiment of the present application;

[0054] Figure 6 is a schematic flowchart of a method for generating a game character makeup provided by another embodiment of the present application;

[0055] Figure 7 is a schematic diagram of the makeup editing interface for implementing the method for generating a game character makeup according to an embodiment of the present application;

[0056] Figure 8 Schematic diagram of a makeup editing interface for an embodiment of a method for generating a game character makeup provided by another embodiment of the present application;

[0057] Figure 9 Schematic diagram of a makeup editing interface for an embodiment of a method for generating a game character makeup provided by another embodiment of the present application;

[0058] Figure 10 Schematic diagram of a makeup editing interface for an embodiment of a method for generating a game character makeup provided by another embodiment of the present application;

[0059] Figure 11 Schematic diagram of a makeup editing interface for an embodiment of a method for generating a game character makeup provided by another embodiment of the present application;

[0060] Figure 12 Block diagram of a game character makeup generation device provided by an embodiment of the present application;

[0061] Figure 13 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0062] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are some but not all of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0063] The technical solution of the embodiment of the present application pre-configures the corresponding relationship between each makeup part and the attribute information in the coloring data, directly configures the makeup effects of each makeup part in the makeup editor, and the art personnel can preview the configuration effect by adjusting the makeup parameter values of the corresponding attribute information of each makeup part. The makeup parameter values adjusted by the art personnel can be saved locally for previewing the effect next time. The makeup texture data saved after editing can be directly parsed and rendered, and only the interpolation coefficients of the makeup parts within the editable parameter range need to be transmitted during operation, without reading other parameters configured by the art personnel.

[0064] According to one aspect of the embodiments of the present application, a method for generating a game character makeup is provided. Optionally, in this embodiment, the above method for generating a game character makeup may be applied to a hardware environment composed of a terminal 102 and a server 104 as shown in Figure 1 the following figure. As shown in Figure 1As shown, the server 104 is connected to the terminal 102 through a network and can be used to provide services (such as game services, application services, etc.) for the terminal or the client installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for the server 104.

[0065] The above network can include but is not limited to at least one of the following: wired network, wireless network. The above wired network can include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network. The above wireless network can include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal 102 is not limited to being a PC, mobile phone, tablet computer, etc.

[0066] The game character makeup generation method in the embodiments of the present application can be executed by the server 104, or by the terminal 102, or jointly executed by the server 104 and the terminal 102. Among them, when the terminal 102 executes the game character makeup generation method in the embodiments of the present application, it can also be executed by the client installed on it.

[0067] Taking the game character makeup generation method in this embodiment executed by the client running on the terminal 102 as an example, a game character makeup generation method provided by the embodiments of the present invention will be introduced.

[0068] Figure 2 It is a schematic flowchart of a game character makeup generation method provided by the embodiments of the present application. As Figure 2 shown, the method includes the following steps S11 - S15:

[0069] Step S11, obtain the coloring data corresponding to the face of the game character, and the coloring data contains the attribute information corresponding to each makeup part.

[0070] Among them, the coloring data corresponding to the face of the game character comes from a shader. A shader is used to implement image rendering and is an editable program used to replace the fixed rendering pipeline. The coloring data contains the attribute information (Property) corresponding to each makeup part. To achieve the display effect of the game character's face, it is necessary to associate the makeup parts with the corresponding attribute information and configure parameter values for the attribute information.

[0071] The makeup parts include eyebrows, eyeshadow, lipstick, facial lines, beard, etc. Each makeup part can correspond to one or more attribute information, and the coloring data contains the attribute information of each makeup part.

[0072] Step S12, determine the attribute information corresponding to the makeup part of the makeup to be generated in the coloring data.

[0073] Based on the makeup part of the makeup to be generated, one or more pieces of attribute information corresponding to the makeup part can be found from the coloring data.

[0074] Optionally, the MakeupPart data structure can be used to store the attribute information in the coloring data corresponding to a makeup part (such as facial lines or eyeshadow, etc.).

[0075] Step S13, configure makeup parameter values for the attribute information corresponding to the makeup part. The makeup parameter values include interpolation coefficients within the editable parameter range of the makeup to be generated.

[0076] Among them, the makeup parameter values can be numerical values, options, or other data (such as text, texture pictures), etc. For example, when configuring makeup parameter values for the attribute information corresponding to a makeup part, the editable range of the makeup parameter values, that is, the maximum value and the minimum value, can be configured, and the difference coefficient within this editable range can be configured. The interpolation coefficient can be used only when previewing the makeup in the makeup editor and is not saved; or the interpolation coefficient can be saved as a set and provided to players directly as a preset parameter of the makeup system in the officially launched game. Another example is that several optional options can be configured, such as lipstick colors, and only several optional color options can be configured. For another example, the makeup parameter values can be the data content corresponding to the attribute information, such as text, letters, numbers, etc.

[0077] Step S14, generate makeup texture data corresponding to the makeup part according to the makeup parameter values. The makeup texture data is used to render the makeup part to present the makeup effect corresponding to the makeup parameter values.

[0078] By configuring parameters for the attribute information corresponding to the makeup part, the makeup effect corresponding to the makeup part is adjusted. To achieve the preview and storage of the makeup effect, based on the attribute information after modifying the makeup parameter values, the makeup texture data corresponding to the makeup part is generated so that the makeup effect can be rendered based on this makeup texture data subsequently.

[0079] Step S15, store the makeup parameter values and the makeup texture data corresponding to the makeup parameter values.

[0080] To facilitate artists or players to adjust the facial makeup of game characters using the above-designed makeup parameter values, the configured makeup parameter values and the generated makeup texture data can be stored and transmitted to the makeup editor. Artists or players can directly use the makeup parameter values on the makeup editor and use the corresponding makeup texture data to render the makeup effect.

[0081] In this embodiment, by pre-configuring the correspondence between each makeup part and the attribute information in the coloring data, the makeup effects of each makeup part are directly configured in the makeup editor. The art staff can adjust the makeup parameter values of the corresponding attribute information of each makeup part to preview the configuration effect. The makeup parameter values adjusted by the art staff can be saved locally for previewing the effect next time. For the saved makeup texture data after editing, it can be directly parsed and rendered. During runtime, only the interpolation coefficients within the editable parameter range of the makeup part need to be transmitted (the extreme value data corresponding to reading this interpolation coefficient can be automatically processed by the makeup editor during runtime), and there is no need to read other parameters configured by the art staff.

[0082] Optionally, the coloring data corresponding to the face of the game character can be obtained from the merged Shader. This merged Shader can be obtained by merging the Shaders of multiple makeup parts. Each Shader is designed by the developer and contains the attribute information corresponding to each makeup part. Optionally, the coloring data corresponding to the face of the game character can also be from a single Shader, such as the Shader corresponding to a single makeup part. When obtaining the attribute information corresponding to the makeup part, it is necessary to find the Shader corresponding to this makeup part and obtain the attribute information corresponding to this makeup part from the coloring data of the corresponding Shader.

[0083] Since there are multiple makeup texture data corresponding to the same makeup part, there may be slight differences in their positions and sizes on the face of the game character. To avoid inaccurate filling areas for this makeup part when filling the makeup texture data onto the face of the game character, in another embodiment of the present application, the position and coverage range of this makeup part on the face can be identified, the cropping area information of this makeup texture data can be automatically identified, and the cropping area coordinates UVRect corresponding to this makeup texture data can be automatically filled into the corresponding attribute information.

[0084] Figure 3 It is a schematic flowchart of a method for generating a game character makeup provided in another embodiment of the present application. As Figure 3 shown, the method further includes the following steps S21 - S24:

[0085] Step S21, obtain the target mask channel based on which the makeup texture data is cropped.

[0086] Before cropping the texture data, first obtain the target mask channel (Mask Channel) that needs to be identified for cropping, that is, based on the pixel conditions in which mask channel or channels to perform cropping.

[0087] For example, the mask channel includes four channels RGBA, and at least one of them can be selected as the target mask channel for cropping.

[0088] Step S22: Determine the cropping region information corresponding to the cropping region based on the makeup texture data and the target mask channel.

[0089] In this step, the cropping region information, such as the cropping region coordinates, can be determined according to the pixel values of each pixel in the makeup texture data in the target mask channel.

[0090] Step S23: Crop the makeup texture data according to the cropping region information to obtain the cropped target makeup texture data.

[0091] Step S24: Store the target makeup texture data and update the attribute information corresponding to the makeup part according to the cropping region information.

[0092] In this embodiment, the obtained target makeup texture data after cropping can be consistent with the position and coverage range of this makeup part on the face of the game character, so that the generated makeup texture can be accurately filled into the corresponding position on the face of the game character, improving the authenticity of the makeup generation effect.

[0093] The following takes determining the cropping region information according to the pixel values of each pixel in the makeup texture data in the target mask channel as an example to illustrate the above step S22. Figure 4 It is a schematic flowchart of a method for generating a game character makeup provided in another embodiment of this application. As Figure 4 shown, step S22 includes the following steps S31 - S34:

[0094] Step S31: Obtain the pixel values of each pixel in the makeup texture data in the target mask channel.

[0095] Step S32: Find the target pixels with non - zero pixel values, and obtain the target pixel coordinates of the target pixels.

[0096] Step S33: Determine the extreme values of the target pixel coordinates on each coordinate axis.

[0097] Step S34: Determine the cropping region information according to the extreme values.

[0098] In step S32, if the target mask channel is a single - channel, the pixels with non - zero pixel values in this channel are used as target pixels. If the target channel is a multi - channel, it can be set that if the pixel value of a pixel in any channel is non - zero, then this pixel is used as a target pixel. Or, it can also be set that only when the pixel values of a pixel in each channel are all non - zero, this pixel is used as a target pixel. Or, when the pixel values of a pixel in a preset number of channels are non - zero, this pixel is used as a target pixel. For example, if the target mask channel is three RGB channels, the pixel can be used as a target pixel only when its pixel values in 2 of these channels are non - zero.

[0099] The texture data contains an array of coordinates for each pixel, and the coordinate origin (0, 0) is located at the upper left corner of the coordinate system. Obtain the two-dimensional coordinates (x, y) of these target pixels, and determine the maximum coordinate values MaxX and MaxY and the minimum coordinate values MinX and MinY of these target pixels on the X-axis and Y-axis. Use (MinX, MinY) as the upper left corner coordinates and (MaxX, MaxY) as the lower right corner coordinates. Through these two coordinates, the cropping area of the rectangle can be located, and thus the coordinate information of the cropping area range is the cropping area information.

[0100] In this embodiment, effective target pixels are selected through the pixel values of each pixel in the makeup texture data in the target mask channel, and the area range of the area containing all target pixels is determined based on the coordinates of the target pixels. This area is the area to be obtained by cropping, and the boundary coordinates of this area range are used as the cropping area information.

[0101] In an alternative embodiment, after determining the cropping area information, this information can be filled into the attribute information corresponding to this makeup part in the shading data, that is, modify the parameters of the UVRect. Among them, in the UV Rect, X and Y are used to control the offset of the UV texture, and W and H are used to control the width and height of the UV texture (texture coordinates). The UV Rect represents the offset and size of the image in the spatial rectangle in the form of normalized coordinates, and the value range is 0 - 1.

[0102] After the makeup cropping is completed, the cropped makeup texture can also be automatically packed. Figure 5 It is a schematic flowchart of a method for generating a game character's makeup provided in another embodiment of the present application. As Figure 5 shown, this method further includes the following steps S41 - S43:

[0103] Step S41, obtain the target makeup texture data to be packed;

[0104] Step S42, perform a packing process on the target makeup texture data to be packed to obtain a makeup texture set;

[0105] Step S43, replace the target makeup texture data to be packed with the makeup texture set.

[0106] In an embodiment of the present application, all the cropped makeup textures corresponding to the same makeup part can be packed into a texture data packet (atlas). For example, all the target makeup texture data corresponding to the eyebrows are packed together, and all the target makeup texture data corresponding to the eyeshadows are packed together. In the above step S41, it includes steps A1 and A2:

[0107] Step A1, determine the target attribute information of the target makeup texture data;

[0108] Step A2: Use the target makeup texture data with the same target attribute information as the target makeup texture data to be packaged.

[0109] Since there is a corresponding relationship between the makeup parts and the attribute information, that is, the attribute information corresponding to the target makeup texture data of the same makeup part is the same, only the makeup parameter values configured for the attribute information are different. Therefore, by identifying whether the attribute information corresponding to the target makeup texture data is the same, it is determined whether each target makeup texture data corresponds to the same makeup part. In this way, all adjustable makeup effects of this makeup part can be obtained from the makeup texture data packet later.

[0110] Correspondingly, the packaged makeup texture data (such as a makeup texture set) can be used to replace the original texture (that is, the target makeup texture data with the same target attribute information), and at the same time, the corresponding UV Rect parameters are updated.

[0111] In another embodiment of the present application, the cropped makeup textures corresponding to all makeup parts can also be packaged into a makeup texture set (atlas). Optionally, the target makeup texture data corresponding to the makeup parts that conform to the same makeup style are packaged together. For example, the target makeup texture data of the eyebrows, eyeshadow, lipstick, blush, etc. corresponding to the sweet style are packaged together, and the target makeup texture data of the eyebrows, eyeshadow, lipstick, facial patterns, etc. corresponding to the gothic style are packaged together. In this way, all the makeup effects on the face of the game character can be selected based on the makeup style later.

[0112] In an alternative embodiment, the makeup texture set is used to replace each makeup texture data. For example, the makeup texture data for generating eyebrows includes: "eyebrow 1", "eyebrow 2", "eyebrow3",...; after packaging, "eyebrow collection 1" is obtained, and "eyebrow collection 1" is used to replace "eyebrow 1", "eyebrow 2", "eyebrow 3",... Finally, the texture corresponding to the eyebrows is "eyebrow collection 1". At the same time, the UVRect parameter in the attribute information corresponding to the eyebrows is updated.

[0113] Optionally, the makeup texture data corresponding to the makeup area can be a texture image, and the packaged makeup texture set can be a combined texture image formed by combining multiple texture images. The final combined texture image can be set as a RenderTexture, and the target texture of the specified Camera can be set to this RenderTexture, and this RenderTexture is used to replace the makeup texture data corresponding to this makeup area in the makeup editor. RenderTexture is a special texture type defined by unity. It is a texture (Server-Side Texture) on the GPU side connected to a FrameBufferObject, that is, the GPU places the entire 3D scene into an intermediate buffer, and some operations can be performed on this intermediate buffer, such as post-processing effects, etc.

[0114] In this embodiment, by combining multiple makeup texture data corresponding to the makeup area into a RenderTexture and replacing the makeup texture data corresponding to this makeup area in the makeup editor, and then using this RenderTexture in the material panel later, the GPU rendering efficiency can be improved, the size of the RenderTexture can be customized, the rendering layer of the camera can be controlled to reduce the scene size during secondary rendering, and it can be turned on and off by the camera itself.

[0115] In an alternative embodiment, the method can also combine the makeup effect onto the face of the game character, thereby realizing the display of the makeup effect on the entire face of the game character. Figure 6 It is a schematic flowchart of a method for generating a game character's makeup provided in another embodiment of this application. As Figure 6 shown, the method further includes the following steps S51 - S52:

[0116] Step S51, combine the makeup texture data with the facial texture data of the game character's face to generate the render texture data of the game character's face;

[0117] Step S52, use the render texture data to render the game character's face to display the makeup effect on the game character's face.

[0118] When combining the makeup texture data with the facial texture data of the game character's face, it is necessary to ensure that the position and size are correct after the makeup texture data is superimposed on the facial texture. Therefore, in the above step S51, combining the makeup texture data with the facial texture data of the game character's face includes steps B1 and B2:

[0119] Step B1, identify the position information and coverage range of the makeup area on the game character's face;

[0120] Step B2, according to the position information and coverage range, superimpose the makeup texture data on the facial texture data.

[0121] By identifying the position information and coverage range of the makeup part on the face of the game character, the makeup texture data can be accurately merged into the corresponding position of the facial texture data of the game character's face.

[0122] Taking the makeup part of the eyebrows as an example below, the method of the embodiment of the present application will be described in detail.

[0123] 1. Configure the correspondence between the makeup part and the attribute information in the coloring data

[0124] As Figure 7 shown, on the main interface in the Makeup Editor, open the Engineer Mode;

[0125] Select the makeup material, such as "makeup";

[0126] Select the makeup part to be edited, such as the Eyebrow;

[0127] Select the attribute information "eyebrow map" corresponding to the eyebrows in the coloring data and add it to the list;

[0128] On the main interface, you can select to save the configuration of the makeup parameter values.

[0129] 2. Configure the makeup pre-configuration information

[0130] As Figure 8 shown, on the main interface, after closing the Engineer Mode, you can select the face of the game character for which you need to edit the makeup;

[0131] Load the configuration of the makeup parameter values saved in the Engineer Mode, or load the makeup pre-configuration information (if any);

[0132] Select the required makeup part such as the Eyebrow;

[0133] Configure data for this makeup part, and the pre-configured data can be automatically named Eyebrow01;

[0134] Fill in the pre-configured data corresponding to Eyebrow01, including eyebrow_map_ST, Offset Min and OffsetMax, difference coefficient (for preview), etc.;

[0135] Save the makeup pre-configuration information. After clicking Save, when configuring the eyebrows later, you can load the makeup pre-configuration information corresponding to the eyebrows.

[0136] Optionally, the MakeupPartConfig can store the pre-configuration information of a makeup part, such as the value or range of the corresponding coloring data attribute information set by the art designer. The MakeupPartData can store the interpolation coefficients of the makeup preset range, such as the value finally adjusted for the player, which is used for preview in the makeup editor.

[0137] 3. Automatically crop the texture

[0138] As Figure 9 shown, select the texture to be cropped, and generate the makeup texture data "_eyebrow_map" according to Eyebrow01;

[0139] Set the target mask channel Mask Channel based on which the texture is cropped;

[0140] Set the UVRect attribute of the cropped texture, eyebrow_map_ST;

[0141] As Figure 10 shown, automatically calculate the cropping area information, UVRect, according to the eyebrow texture data and the target mask channel, and fill in the cropped texture data "_eyebrow_map_ST", "_eyebrow_channel" and UV Rect data "_eyebrow_uvrect", etc.

[0142] 3. Store the makeup texture data

[0143] As Figure 11 shown, the makeup texture data before and after cropping can be saved to the pre-set storage path, and the cropped makeup texture data will be saved to the address relative to the "original picture path" under the "cropped picture path".

[0144] For example: The original picture path is: Assets / A / B / C / D / eyebrow01.tga

[0145] The "original picture path" is: Assets / A / B

[0146] The "cropped picture path" is: Assets / CropTex

[0147] Then the cropped Texture will be saved under the path Assets / CropTex / C / D / eyebrow01.tga.

[0148] 4. Merge the atlas

[0149] In the makeup editor, a function of merging atlas sets is provided, which can pack the target makeup texture data of the same makeup part together. For example, the makeup texture data of the eyebrows "eyebrow 1", "eyebrow 2", "eyebrow 3",...; after packing, "eyebrow set 1" is obtained.

[0150] Use "eyebrow set 1" to replace each makeup texture data of the eyebrows in the makeup editor, and update the UV Rect in the corresponding attribute information of the eyebrows.

[0151] Optionally, the makeup texture data corresponding to the makeup part can be a texture image, and the merged makeup texture set can be a combined texture image formed by combining multiple texture images. The default size of the combined texture image, such as 256×256, and the maximum size, such as 1024×1024, can be set in the makeup editor.

[0152] Through the above embodiments, when generating a makeup effect for the face of a game character, the art staff can preview the configuration effect by adjusting the makeup parameter values of the corresponding attribute information of each makeup part, which greatly saves the time for the art staff to configure the makeup preview effect; and the subsequent execution of the program does not need to consider the data configured by the art staff, and only needs to transfer and apply the difference coefficient for adjusting the makeup effect; in addition, the generated makeup texture data can be automatically cropped to align with the corresponding makeup position on the face of the game character, without the art staff manually adjusting the UV Rect to align, reducing the workload of the art staff in the process of editing makeup and improving the makeup editing efficiency.

[0153] The following is an embodiment of the device of the present application, which can be used to execute the method embodiment of the present application.

[0154] Figure 12 It is a block diagram of a game character makeup generation device provided by an embodiment of the present application. The device can be implemented as part or all of an electronic device through software, hardware or a combination of both. As Figure 12 shown, the game character makeup generation device includes:

[0155] An acquisition module 61, configured to acquire the coloring data corresponding to the face of the game character;

[0156] A building module 62, configured to determine the attribute information corresponding to the makeup part of the to-be-generated makeup in the coloring data;

[0157] A configuration module 63, configured to configure makeup parameter values for the attribute information corresponding to the makeup part, where the makeup parameter values include interpolation coefficients within the editable parameter range of the to-be-generated makeup;

[0158] A generation module 64 is configured to generate makeup texture data corresponding to a makeup part according to a makeup parameter value, where the makeup texture data is used to render the makeup part to present a makeup effect corresponding to the makeup parameter value;

[0159] A storage module 65 is configured to store the makeup parameter value and the makeup texture data corresponding to the makeup parameter value.

[0160] In an alternative embodiment, the apparatus further includes: a cropping area determination module and a cropping module;

[0161] Wherein, the acquisition module is further configured to acquire a target mask channel based on which the makeup texture data is cropped;

[0162] The cropping area determination module is configured to determine cropping area information corresponding to a cropping area according to the makeup texture data and the target mask channel;

[0163] The cropping module is configured to crop the makeup texture data according to the cropping area information to obtain cropped target makeup texture data;

[0164] The storage module is further configured to store the target makeup texture data and update the attribute information corresponding to the makeup part according to the cropping area information.

[0165] Optionally, the cropping area determination module is configured to obtain pixel values of each pixel in the makeup texture data in the target mask channel; find target pixels with non-zero pixel values, and obtain target pixel coordinates of the target pixels; determine extreme values of the target pixel coordinates on each coordinate axis; and determine the cropping area information according to the extreme values.

[0166] Optionally, the apparatus further includes: a packaging module and a replacement module;

[0167] Wherein, the acquisition module is further configured to acquire target makeup texture data to be packaged;

[0168] The packaging module is configured to package the target makeup texture data to be packaged to obtain a makeup texture set;

[0169] The replacement module is configured to replace the target makeup texture data to be packaged with the makeup texture set.

[0170] Optionally, the acquisition module is further configured to determine target attribute information of the target makeup texture data; and use the target makeup texture data with the same target attribute information as the target makeup texture data to be packaged.

[0171] Optionally, the apparatus further includes: a merging module.

[0172] Wherein, the merging module is configured to merge the makeup texture data with facial texture data of a game character's face to generate rendering texture data of the game character's face;

[0173] A rendering module for rendering the face of a game character using rendering texture data to display the makeup effect on the face of the game character.

[0174] Optionally, a merging module for identifying the position information and coverage range of the makeup part on the face of the game character; and overlaying the makeup texture data onto the facial texture data according to the position information and coverage range.

[0175] An embodiment of the present application further provides an electronic device. As Figure 13 shown, the electronic device may include: a processor 1501, a communication interface 1502, a memory 1503, and a communication bus 1504. Among them, the processor 1501, the communication interface 1502, and the memory 1503 communicate with each other through the communication bus 1504.

[0176] The memory 1503 is used to store a computer program.

[0177] When the processor 1501 executes the computer program stored on the memory 1503, it implements the steps of the above method embodiments.

[0178] The communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.

[0179] The communication interface is used for communication between the above electronic device and other devices.

[0180] The memory may include a Random Access Memory (RAM), and may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.

[0181] The above-mentioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0182] This application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method embodiments are implemented.

[0183] It should be noted that for the above-mentioned device, electronic device, and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For related parts, please refer to the partial description of the method embodiments.

[0184] Furthermore, it should be noted that in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the existence of additional identical elements in the process, method, article, or device comprising the element.

[0185] The above are only specific embodiments of the present invention, enabling those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but rather will be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for generating a game character makeup, characterized in that, it includes: Obtain the coloring data corresponding to the game character's face, where the coloring data contains the attribute information corresponding to each makeup part; Determine the attribute information corresponding to the makeup part of the makeup to be generated in the coloring data; Configure makeup parameter values for the attribute information corresponding to the makeup part, where the makeup parameter values include interpolation coefficients within the editable parameter range of the to-be-generated makeup; Generate makeup texture data corresponding to the makeup part according to the makeup parameter values, and the makeup texture data is used to render the makeup part to present the makeup effect corresponding to the makeup parameter values; Store the makeup parameter values and the makeup texture data corresponding to the makeup parameter values, and transmit the makeup parameter values and the makeup texture data to the makeup editor; The method further includes: Obtain the target mask channel based on which the makeup texture data is cropped; Determine the cropping area information corresponding to the cropping area according to the makeup texture data and the target mask channel; Crop the makeup texture data according to the cropping area information to obtain the cropped target makeup texture data; Store the target makeup texture data, and update the attribute information associated with the makeup part according to the cropping area information.

2. The method according to claim 1, characterized in that, The determining the cropping area information corresponding to the cropping area according to the makeup texture data and the target mask channel includes: Obtain the pixel values of each pixel in the makeup texture data in the target mask channel; Search for target pixels with non-zero pixel values, and obtain the target pixel coordinates of the target pixels; Determine the extreme values of the target pixel coordinates on each coordinate axis; Determine the cropping area information according to the extreme values.

3. The method according to claim 1, characterized in that, The method further includes: Obtain the target makeup texture data to be packaged; Perform a packaging process on the target makeup texture data to be packaged to obtain a makeup texture set; Replace the target makeup texture data to be packaged with the makeup texture set.

4. The method according to claim 3, characterized in that, Obtaining the target makeup texture data to be packaged includes: Determine the target attribute information of the target makeup texture data; Use the target makeup texture data with the same target attribute information as the target makeup texture data to be packaged.

5. The method according to claim 1, characterized in that, The method further includes: Merge the makeup texture data with the facial texture data of the game character's face to generate the rendering texture data of the game character's face; Use the rendering texture data to render the game character's face to display the makeup effect of the game character's face.

6. The method according to claim 5, characterized in that, The merging the makeup texture data with the facial texture data of the game character's face includes: Identify the position information and coverage range of the makeup part on the game character's face; Overlay the makeup texture data onto the facial texture data according to the position information and the coverage range.

7. A game character makeup generation device, characterized in that, it includes: An acquisition module for acquiring coloring data corresponding to the face of a game character, where the coloring data contains attribute information corresponding to each makeup part; A creation module for determining the attribute information corresponding to the makeup part of the makeup to be generated in the coloring data; A configuration module for configuring makeup parameter values for the attribute information corresponding to the makeup part, where the makeup parameter values include interpolation coefficients within an editable parameter range for the makeup to be generated; A generation module for generating makeup texture data corresponding to the makeup part according to the makeup parameter values, where the makeup texture data is used to render the makeup part to present the makeup effect corresponding to the makeup parameter values; A storage module for storing the makeup parameter values and the makeup texture data corresponding to the makeup parameter values; The device further includes a module for transmitting the makeup parameter values and the makeup texture data to a makeup editor; The device further includes: a cropping area determination module and a cropping module; Among them, the acquisition module is further used to acquire a target mask channel based on which the makeup texture data is cropped; The cropping area determination module is used to determine cropping area information corresponding to a cropping area according to the makeup texture data and the target mask channel; The cropping module is used to crop the makeup texture data according to the cropping area information to obtain cropped target makeup texture data; The storage module is further used to store the target makeup texture data and update the attribute information associated with the makeup part according to the cropping area information.

8. An electronic device, characterized in that, it includes: A processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus; The memory is used to store a computer program; When the processor is used to execute the computer program, it implements the method steps described in any one of claims 1-6.

9. A computer-readable storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by a processor, it implements the method steps described in any one of claims 1-6.

Citation Information

Patent Citations

  • Detail texture processing method and device

    CN111951369A

  • Game role makeup method and device and electronic equipment

    CN112973122A

  • Skin rendering method and device for game roles, and electronic equipment

    CN113069764A