Makeup drawing method, device and electronic device in game

By providing a graphical user interface and GPU texture update technology in the game, it solves the problems of low makeup drawing accuracy and poor degree of freedom in the existing technology, achieves high-precision and high-freedom virtual character makeup drawing, and improves the game experience.

CN112370786BActive Publication Date: 2024-08-23NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011275447.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-13
Publication Date
2024-08-23
Estimated Expiration
2040-11-13

AI Technical Summary

Technical Problem

The existing methods for drawing character makeup in games do not have high drawing accuracy, and players have poor freedom in custom drawing, making it difficult to achieve multi-layer image blending effects and personalized design of three-dimensional virtual character makeup.

Method used

By providing a graphical user interface, it responds to the player's makeup drawing operation on the virtual character, determines the target makeup and tool parameters of the drawing tool, records the target drawing area according to the movement of the drawing tool, and updates the texture through the GPU to achieve high-precision makeup drawing.

Benefits of technology

It improves the accuracy of makeup drawing and the player's degree of freedom in custom drawing of virtual characters, enhancing the makeup experience and immersion in the game.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112370786B
    Figure CN112370786B
Patent Text Reader

Abstract

The present invention provides a makeup drawing method, device and electronic device in a game, the method comprising: responding to a makeup drawing trigger operation for a virtual character, determining a target makeup to be drawn, and tool parameters of a drawing tool required to draw the target makeup; the virtual character comprises a three-dimensional character model and a texture covering the surface of the three-dimensional character model; responding to the movement of the drawing tool on the virtual character, determining a target drawing area; updating the texture of the target drawing area according to the tool parameters of the drawing tool, and obtaining a drawing result of the target makeup. The present invention draws makeup for a virtual character of a three-dimensional character model through a drawing tool, and the drawing tool can move freely on the virtual character according to the player's needs, thereby increasing the player's freedom to customize the drawing of the virtual character and also increasing the drawing accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of game interaction technology, and in particular to a makeup drawing method, device and electronic equipment in a game. Background Art

[0002] In the related art, the method of drawing the character's makeup in the game usually requires the player to select a texture corresponding to the area to be drawn in the virtual character's texture according to the needs, and then dynamically draw the content on the skinned mesh model according to the pre-stored content in the texture. However, this method does not have high drawing accuracy for the character's makeup, and the player has little freedom to customize the drawing of the virtual character. Summary of the invention

[0003] The purpose of the present invention is to provide a makeup drawing method, device and electronic equipment for a game, so as to improve drawing accuracy and the freedom of a player to customize drawing of a virtual character.

[0004] In a first aspect, an embodiment of the present invention provides a method for drawing makeup in a game, providing a graphical user interface through a terminal device, the graphical user interface including at least a virtual character, the virtual character including a three-dimensional character model and a texture covering the surface of the three-dimensional character model; the method includes: responding to a makeup drawing trigger operation for the virtual character, determining a target makeup to be drawn, and tool parameters of a drawing tool required to draw the target makeup; responding to the movement of the drawing tool on the virtual character, determining a target drawing area; and updating the texture of the target drawing area according to the tool parameters of the drawing tool to obtain a drawing result of the target makeup.

[0005] In an optional embodiment, the step of determining the target drawing area in response to the movement of the drawing tool on the virtual character includes: in response to a touch start operation on the drawing tool, recording the current position of the drawing tool on the virtual character; in response to a move operation on the drawing tool, controlling the drawing tool to move from the current position, and recording the position of the drawing tool on the virtual character during the movement; in response to a touch end operation on the drawing tool, stopping the movement of the drawing tool, and determining the position passed by the drawing tool from the current position as the target drawing area.

[0006] In an optional embodiment, the step of recording the position of the drawing tool on the virtual character during the movement includes: recording the position of the drawing tool on the virtual character through a preset virtual camera during the movement of the drawing tool.

[0007] In an optional embodiment, the step of updating the map of the target drawing area according to the tool parameters of the drawing tool to obtain the drawing result of the target makeup includes: sending the target drawing area and the tool parameters of the drawing tool to the GPU; using the GPU, based on the tool parameters of the drawing tool, coloring the map of the target drawing area to obtain a colored map of the target drawing area; determining the overlapping area of ​​the map of the target makeup and the colored map, updating the overlapping area in the map of the target makeup to the overlapping area of ​​the colored map, and obtaining the drawing result of the target makeup.

[0008] In an optional embodiment, the tool parameters of the drawing tool include the type of the drawing tool; the shading map of the target drawing area is specifically obtained by the GPU in the following manner: determining the map of the drawing tool based on the type of the drawing tool; mixing the map of the drawing tool with preset blue noise to obtain the shading intensity of the drawing tool; and shading the map of the target drawing area based on the shading intensity.

[0009] In an optional embodiment, after the step of mixing the map of the drawing tool with the preset blue noise to obtain the coloring intensity of the drawing tool, the method further includes: performing Gaussian blur processing on the coloring intensity to obtain a final coloring intensity.

[0010] In an optional embodiment, the step of coloring the map of the target drawing area based on the tinting intensity includes: determining the color drawing range of the drawing tool according to the tinting intensity, the color of the map of the target drawing area before drawing, the image mask corresponding to the target makeup and the color of the preset final map; coloring the map of the target drawing area according to the tinting intensity and the color drawing range of the drawing tool.

[0011] In an optional embodiment, the step of determining the color drawing range of the drawing tool based on the tinting intensity, the color of the map of the target drawing area before drawing, the image mask corresponding to the target makeup and the color of the preset final map includes: determining the color of the map of the target drawing area before drawing as the minimum value of the color drawing range of the drawing tool; subtracting the color of the map of the target drawing area before drawing from the color of the final map to obtain a color difference; and determining the product of the color difference, the image mask and the tinting intensity, plus the sum of the color of the map of the target drawing area before drawing as the maximum value of the color drawing range of the drawing tool.

[0012] In an optional embodiment, the color of the map of the target drawing area before drawing is obtained in the following manner: in response to a touch start instruction of a drawing tool, the current map of the virtual character is recorded; from the current map, the current color of the map of the target drawing area is determined, and the current color is determined as the color of the map of the target drawing area before drawing.

[0013] In an optional embodiment, the tool parameters of the drawing tool include the color of the drawing tool; the color of the final map is determined by: determining the color of the drawing tool as the color of the final map; or, determining the final map from multiple preset maps according to the tool parameters to determine the color of the final map; wherein each preset map corresponds to a tool parameter.

[0014] In an optional embodiment, after the above-mentioned step of determining the overlapping area between the target makeup map and the shading map, updating the overlapping area in the target makeup map to the overlapping area in the shading map, and obtaining the drawing result of the target makeup, the method further includes: enlarging the overlapping area in the drawing result; and performing Gaussian blur processing on the color of the enlarged overlapping area to obtain the final drawing result.

[0015] In an optional embodiment, before the step of updating the map of the target drawing area according to the tool parameters of the drawing tool to obtain the drawing result of the target makeup, the method also includes: setting the resolution of the map of the target makeup in the map of the virtual character to a preset first resolution; setting the resolution of the map of the virtual character except the map of the target makeup to a preset second resolution; wherein the first resolution is higher than the second resolution.

[0016] In a second aspect, an embodiment of the present invention provides a makeup drawing device for a game, which provides a graphical user interface through a terminal device, and the graphical user interface includes at least a virtual character, and the virtual character includes a three-dimensional character model and a texture covering the surface of the three-dimensional character model; the device includes: a drawing trigger module, which is used to respond to a makeup drawing trigger operation for the virtual character, determine a target makeup to be drawn, and tool parameters of a drawing tool required to draw the target makeup; a drawing area determination module, which is used to determine a target drawing area in response to the movement of a drawing tool on the virtual character; and a texture update module, which is used to update the texture of the target drawing area according to the tool parameters of the drawing tool to obtain a drawing result of the target makeup.

[0017] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the makeup drawing method in the game described in any one of the aforementioned embodiments.

[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the makeup drawing method in the game described in any one of the aforementioned implementations.

[0019] The embodiments of the present invention bring the following beneficial effects:

[0020] The embodiment of the present invention provides a makeup drawing method, device and electronic device in a game, which first responds to a makeup drawing trigger operation for a virtual character, determines the target makeup to be drawn, and the tool parameters of the drawing tool required to draw the target makeup, wherein the virtual character includes a three-dimensional character model and a texture covering the surface of the three-dimensional character model; then responds to the movement of the drawing tool on the virtual character, determines the target drawing area; then updates the texture of the target drawing area according to the tool parameters of the drawing tool, and obtains the drawing result of the target makeup. This method uses a drawing tool to draw makeup for a virtual character of a three-dimensional character model, and the drawing tool can move freely on the virtual character according to the player's needs, thereby increasing the player's freedom to customize the virtual character and also improving the drawing accuracy.

[0021] Other features and advantages of the present invention will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present invention.

[0022] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are specifically listed below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0024] Figure 1 A flowchart of a makeup drawing method in a game provided by an embodiment of the present invention;

[0025] Figure 2 A flowchart of another makeup drawing method in a game provided by an embodiment of the present invention;

[0026] Figure 3 A flowchart of another makeup drawing method in a game provided by an embodiment of the present invention;

[0027] Figure 4 A schematic diagram of the structure of a makeup drawing device in a game provided by an embodiment of the present invention;

[0028] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0030] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] In the related art, there are three methods for character makeup drawing. The first is to use Skinned Decal as the underlying technology, and dynamically draw the content on the model of the skeleton skinned animation through the content stored in the texture, that is, to add decals to the model of the skeleton skinned animation, but this method does not achieve the multi-layer image mixing effect, and the drawing accuracy is not high. The second is the makeup drawing method commonly used in online games. This method synthesizes the texture or directly switches the texture during operation, but the player in this method has poor freedom to customize the drawing of the virtual character. The third is to use the makeup brush function of the photo editing software for drawing, but this function can only modify the makeup in two-dimensional space, and cannot be directly applied to the three-dimensional model in the game, and it is difficult to apply it to the three-dimensional virtual character in the game.

[0032] Based on the above problems, the embodiments of the present invention provide a method, device and electronic device for makeup drawing in games. The technology can be applied to the scenes of character makeup drawing in games, especially the scenes of character makeup drawing in mobile games.

[0033] In order to facilitate understanding of the embodiments of the present invention, a makeup drawing method in a game disclosed in the embodiments of the present invention is first introduced in detail. The method is applied to a terminal device, which may be a mobile terminal (e.g., a mobile phone, a tablet computer, a laptop computer, etc.) or a computer; a graphical user interface is provided through the terminal device, and the graphical user interface includes at least one virtual character, and the virtual character includes a three-dimensional character model and a texture covering the surface of the three-dimensional character model; Figure 1 As shown, the method comprises the following steps:

[0034] Step S102, in response to a makeup drawing triggering operation for a virtual character, determining a target makeup to be drawn and tool parameters of a drawing tool required for drawing the target makeup.

[0035] In the game, the virtual character is a three-dimensional character model, the surface of which is covered with a map, and each map has a corresponding color. The target makeup includes eye makeup, eyebrows, eye shadow, blush, contact lenses and lipstick, etc. Each target makeup is provided with a corresponding button in the graphical user interface, and the player can trigger the button corresponding to the target makeup to be drawn to draw the target makeup to be drawn.

[0036] The tool parameters of the drawing tool required for drawing the target makeup include one or more of the color, size, shape, and hardness of the target tool; the drawing tool can be displayed as a virtual brush or a virtual pointer in the graphical user interface. In specific implementation, when the player triggers the button of the target makeup that he wants to draw in the graphical user interface, multiple selection buttons of the tool parameters of the drawing tool of the target makeup corresponding to the button can be displayed in the graphical user interface. Each selection button corresponds to a different drawing color. The player can trigger the selection button corresponding to the color he wants to draw according to the needs to complete the setting of the tool parameters of the drawing tool, that is, set the tool parameters to the color corresponding to the triggered button.

[0037] Step S104: determining a target drawing area in response to the movement of the drawing tool on the virtual character.

[0038] The player can select a drawing tool and drag it to move on the virtual character. At this time, the preset script at the CPU (Central Processing Unit) in the electronic device will record the player's input operations and convert the player's input operations into drawing instructions to control the movement of the drawing tool on the virtual character through the drawing instructions. During the movement, the position of the drawing tool in the virtual character's map is recorded, and a target drawing area is generated according to the position passed by the drawing tool.

[0039] Step S106, updating the map of the target drawing area according to the tool parameters of the drawing tool to obtain the drawing result of the target makeup.

[0040] In a specific implementation, the texture of the target drawing area can be updated according to the tool parameters of the drawing tool, and the texture of the target makeup is adjusted with the updated texture of the target drawing area to obtain the drawing result of the target makeup. For example, when the tool parameter of the drawing tool is a specified color, the color of the texture of the target drawing area is updated to the specified color, and the overlapping area of ​​the texture of the target makeup with the texture of the target drawing area is replaced with the overlapping area of ​​the texture of the target drawing area with the color updated, thereby obtaining the texture of the target makeup with the color updated, that is, obtaining the drawing result of the target makeup.

[0041] After obtaining the drawing result of the target makeup, the drawing result will be displayed in the map area of ​​the target makeup in the graphical user interface so that the player can watch and confirm whether the drawing result is the effect he wants. If it is not the effect he wants, he can continue to draw the target makeup using the drawing tool.

[0042] An embodiment of the present invention provides a makeup drawing method in a game, which first responds to a makeup drawing trigger operation for a virtual character, determines the target makeup to be drawn, and the tool parameters of the drawing tool required to draw the target makeup, wherein the virtual character includes a three-dimensional character model and a texture covering the surface of the three-dimensional character model; then responds to the movement of the drawing tool on the virtual character, determines the target drawing area; then updates the texture of the target drawing area according to the tool parameters of the drawing tool, and obtains the drawing result of the target makeup. This method uses a drawing tool to draw makeup for a virtual character of a three-dimensional character model, and the drawing tool can move freely on the virtual character according to the player's needs, thereby increasing the player's freedom to customize the virtual character and also improving the drawing accuracy.

[0043] The embodiment of the present invention further provides another makeup drawing method in a game, which is implemented on the basis of the above embodiment. The method focuses on describing the specific process of determining the target drawing area in response to the movement of the drawing tool on the virtual character (specifically implemented by the following steps S204-S208); Figure 2 As shown, the method comprises the following steps:

[0044] Step S202, in response to a makeup drawing triggering operation for a virtual character, determining a target makeup to be drawn and tool parameters of a drawing tool required for drawing the target makeup.

[0045] Step S204 , in response to a touch start operation on the drawing tool, recording a current position of the drawing tool on the virtual character.

[0046] The touch start operation of the drawing tool may refer to the operation of the player starting to trigger the drawing tool, and the touch start operation of the drawing tool may also be understood as the operation of the drawing tool putting down the pen. In specific implementation, when the player is on a PC (Personal Computer) side, the touch start operation of the drawing tool may be the operation of the player clicking the drawing tool in the graphical user interface with a mouse; when the player is on a mobile terminal with a touch function (for example, a mobile phone, a tablet computer, etc.), the touch start operation of the drawing tool may be the operation of the player pressing the drawing tool displayed on the screen with a finger or a stylus.

[0047] When a trigger start operation acting on a drawing tool is received, the current position of the drawing tool in the virtual character needs to be recorded immediately, so as to subsequently record the positions passed by the drawing tool on the virtual character and determine the target drawing area.

[0048] Step S206, in response to the moving operation on the drawing tool, controlling the drawing tool to move from the current position, and recording the position of the drawing tool on the virtual character during the movement.

[0049] The above-mentioned moving operation on the drawing tool can be an operation of the player drawing on the virtual character, and the moving operation of the drawing tool can also be understood as an operation of the drawing tool being in the drawing state. In specific implementation, when the player is on the PC side, the moving operation of the drawing tool can be an operation of the player clicking the drawing tool in the graphical user interface with the mouse, and then dragging the drawing tool to move on the virtual character with the mouse; when the player is on a mobile terminal with a touch function, the moving operation of the drawing tool can be an operation of the player pressing and holding the drawing tool with a mobile phone or a touch screen, and dragging the drawing tool to move on the virtual character.

[0050] According to the moving operation, the position of the drawing tool on the virtual character can be adjusted, that is, the drawing tool is controlled to move from the current position, and each time the drawing tool moves a position, the position of the drawing tool on the virtual character will be recorded, thereby obtaining each position passed by the drawing tool during drawing.

[0051] In a specific implementation, the step of recording the position of the drawing tool on the virtual character during the movement process includes: recording the position of the drawing tool on the virtual character through a preset virtual camera during the movement of the drawing tool. The virtual camera is pre-set in the electronic device. When the drawing tool starts to move, or after the drawing tool moves a certain distance, the virtual camera is called through a preset script, and the virtual camera is used to record (or shoot) each position of the drawing tool during the movement process, so as to color each position later.

[0052] The certain distance that the drawing tool moves is set in advance by the R&D personnel, and the certain distance can be set to a relatively small value, such as a few pixels or a few tenths of a millimeter. After the drawing tool moves a certain distance, the position of the drawing tool on the virtual character is recorded, which can filter out some invalid operations. For example, if the player accidentally clicks the drawing tool and triggers the moving operation, but the moving distance is short, it can be considered an invalid operation and the position will not be recorded, thereby saving some unnecessary memory.

[0053] Step S208, in response to the touch end operation on the drawing tool, the movement of the drawing tool is stopped, and the position passed by the drawing tool from the current position is determined as the target drawing area.

[0054] The above-mentioned touch-end operation of the drawing tool may refer to the player ending the operation of touching the drawing tool, and the touch-end operation of the drawing tool may also be understood as the operation of lifting the drawing tool pen. In specific implementation, when the player is on the PC side, the touch-end operation of the above-mentioned drawing tool may be the player stopping the operation of clicking the drawing tool in the graphical user interface with the mouse; when the player is on a mobile terminal with touch function, the touch-end operation of the above-mentioned drawing tool may be the player lifting the finger or stylus pressing the drawing tool.

[0055] When a trigger end operation acting on the drawing tool is received, the movement of the drawing tool in the virtual character is ended, and a target drawing area is obtained, wherein the target drawing area includes the position where the drawing tool moves from the current position to the end of the movement.

[0056] Step S210, updating the map of the target drawing area according to the tool parameters of the drawing tool to obtain the drawing result of the target makeup.

[0057] Before the above step S210, the resolution of the texture of the target makeup in the virtual character's texture can also be set to a preset first resolution; the resolution of the texture of the virtual character except the texture of the target makeup can be set to a preset second resolution; wherein the first resolution is higher than the second resolution.

[0058] In specific implementation, the detail mapping technology can be used to set the resolution of the target makeup texture in the virtual character's texture to a higher first resolution, and set the resolution of the textures other than the target makeup texture in the virtual character's texture to a lower second resolution, so that the virtual character's texture can use smaller textures to achieve local high precision. For example, the resolution of the virtual character's global texture is 1024*1024. In order to achieve higher details, the texture of the target makeup (eyebrows, lips, etc.) can be separately allocated with a 128*128 or 256*256 texture, and mapped separately using another set of texture coordinates, so that the local texture (the texture of the target makeup) can achieve an effect close to that of the global texture with a resolution of 4096*4096.

[0059] The above-mentioned detail map can also be called a detail map or a secondary map, which means that a second set of textures can be overlaid on the original map. In specific implementation, setting the resolution of the map of the target makeup to the first resolution is equivalent to overlaying the second texture on the map of the virtual character, so that when viewed from a close distance, the map of the target makeup has clear details, and when viewed from a distance, it also has a normal level of detail, without the need to use a very high global map of the virtual character to achieve these two goals. Therefore, setting different resolutions for different areas can achieve high mapping accuracy while ensuring that less memory is used.

[0060] The makeup drawing method in the above game first responds to the makeup drawing trigger operation for the virtual character, determines the target makeup to be drawn, and the tool parameters of the drawing tool required to draw the target makeup; then responds to the touch start operation on the drawing tool, records the current position of the drawing tool on the virtual character; then responds to the move operation on the drawing tool, controls the drawing tool to move from the current position, and records the position of the drawing tool on the virtual character during the movement; then responds to the touch end operation on the drawing tool, stops the movement of the drawing tool, and determines the position passed by the drawing tool from the current position as the target drawing area; then updates the map of the target drawing area according to the tool parameters of the drawing tool, and obtains the drawing result of the target makeup. This method can control the drawing tool to move freely on the virtual character according to the player's needs, and the player can freely draw the target makeup, so that highly personalized custom drawing can be achieved, and it is closer to the makeup experience in reality, thereby increasing the player's game immersion and game experience.

[0061] The embodiment of the present invention further provides another makeup drawing method in a game, which is implemented on the basis of the above embodiment. The method focuses on describing the specific process of updating the texture of the target drawing area according to the tool parameters of the drawing tool to obtain the drawing result of the target makeup (specifically implemented by the following steps S306-S310); Figure 3 As shown, the method comprises the following steps:

[0062] Step S302, in response to a makeup drawing triggering operation for a virtual character, determining a target makeup to be drawn and tool parameters of a drawing tool required for drawing the target makeup.

[0063] Step S304: determining a target drawing area in response to the movement of the drawing tool on the virtual character.

[0064] Step S306: Send the target drawing area and tool parameters of the drawing tool to the GPU.

[0065] The above-mentioned GPU (Graphic Processing Unit) can also be called a display core, a visual processor, or a display chip. It is usually a microprocessor that is specifically used to perform image and graphic related operations on a terminal device.

[0066] Step S308 , using the GPU, based on the tool parameters of the drawing tool, coloring the map of the target drawing area to obtain a colored map of the target drawing area.

[0067] After the GPU receives the target drawing area and the tool parameters of the drawing tool, it will draw the target drawing area in the render texture (RenderTexture, RT for short) according to the tool parameters of the drawing tool, that is, it will use the shader in the Render Texture to shade the target drawing area to obtain the shaded map of the target drawing area. The RenderTexture is usually a special type of texture created and updated at runtime, which can render the three-dimensional model in the game.

[0068] The use of the above-mentioned GPU can improve the image processing speed of the CPU. Coloring the target drawing area and rendering the drawing tools in the GPU can improve the drawing speed. Moreover, when the number of faces of the three-dimensional character model of the virtual character is large, the CPU running in mobile terminals such as mobile phones is difficult to support such a large amount of calculations. Therefore, by using the GPU, the performance overhead of the CPU can be reduced, thereby ensuring that the mobile terminal can run in real time and improving the drawing efficiency. In specific implementation, the three-dimensional character model is usually composed of small triangles one by one, and each small triangle represents a face in the three-dimensional character model. Therefore, the large number of faces of the three-dimensional character model also represents a large number of small triangles.

[0069] In a specific implementation, the tool parameters of the drawing tool include the type of the drawing tool; the shading map of the target drawing area, which is obtained by the GPU through the following steps 10-12:

[0070] Step 10: Determine the texture of the drawing tool based on the type of the drawing tool.

[0071] The types of drawing tools include one or more of color, size, hardness and shape, which are set according to R&D requirements and are not specifically limited here. Specifically, different drawing tool maps can be obtained according to different combinations of color, size, hardness and shape, and different setting contents corresponding to each type in each combination. For example, the color of the drawing tool is set to red, the size of the drawing tool is 10*10, and the shape of the drawing tool is circular. According to these settings, a map with a red color, a size of 10*10 and a circular shape can be automatically obtained. This map is the map of the drawing tool.

[0072] Step 11, mixing the texture of the drawing tool with the preset blue noise to obtain the coloring intensity of the drawing tool.

[0073] The above blue noise usually refers to uniformly distributed random unbiased noise. A blue noise is mixed with the texture of the drawing tool to obtain the tinting intensity of the drawing tool. When the target drawing area is drawn with the tinting intensity, the phenomenon of harsh edges can be avoided. At the same time, the use of the blue noise can reduce the color banding in the texture and make the edges of the texture softer.

[0074] Step 12: coloring the texture of the target drawing area based on the coloring intensity.

[0075] In some embodiments, in order to achieve an image softening effect, after the drawing tool's texture is mixed with the preset blue noise to obtain the drawing tool's coloring intensity, the drawing tool's coloring intensity needs to be Gaussian blurred to obtain the final coloring intensity, and then the texture of the target drawing area is colored by the final coloring intensity. The above Gaussian blur processing can be implemented by shader.

[0076] The above-mentioned Gaussian blur processing, also known as Gaussian smoothing processing, can reduce image noise and reduce the level of detail. The image generated by this blurring technology has a visual effect like observing the image through a frosted glass, which is significantly different from the bokeh effect of the lens and the effect in the shadow of ordinary lighting.

[0077] In specific implementation, the above step 12 can be implemented through the following steps 20-21:

[0078] Step 20, determining the color drawing range of the drawing tool according to the coloring intensity, the color of the map of the target drawing area before drawing, the image mask corresponding to the target makeup and the color of the preset final map.

[0079] The color of the texture of the target drawing area before drawing is obtained in the following manner: in response to the touch start command of the drawing tool, the current texture of the virtual character is recorded; from the current texture, the current color of the texture of the target drawing area is determined, and the current color is determined as the color of the texture of the target drawing area before drawing. It can also be understood that when the player starts drawing, the texture of the virtual character at the current moment (equivalent to the current texture mentioned above) is recorded, and then the texture of the target drawing area and its color are determined from the current texture. Specifically, the color of the texture of the target drawing area includes the color of each pixel in the texture of the target drawing area.

[0080] The tool parameters of the drawing tool at least include the color of the drawing tool; the color of the final map is determined by: determining the color of the drawing tool as the color of the final map; or, determining the final map from a plurality of preset maps according to the tool parameters to determine the color of the final map; wherein each preset map corresponds to a tool parameter.

[0081] In addition to color, the tool parameters of the above-mentioned drawing tools may also include hardness, size or shape, etc. Drawing tools with different types of tool parameters correspond to different preset maps, and the correspondence between each preset map and the tool parameters is set in advance. Therefore, according to the tool parameters, a final map and the color of the final map can be determined from multiple preset maps. In some embodiments, the color of the drawing tool can also be directly determined as the color of the final map. The color of the final map includes the color of each pixel in the final map.

[0082] The image mask corresponding to the above-mentioned target makeup is also the Mask of the drawable area corresponding to the target makeup to be drawn. The Mask is provided by the artist and is used to calibrate the drawable area. For example, when drawing blush, the artist will provide a Mask that marks the drawable blush area. In cases where it is not easy to operate on a mobile phone, for example, when the mobile platform screen is small and difficult to operate accurately, the Mask provided by the artist can control and limit the drawing boundaries, maximum color depth, etc., thereby ensuring the player's final drawing quality.

[0083] Step 21, coloring the map of the target drawing area according to the coloring intensity and color drawing range of the drawing tool.

[0084] In the drawing process, the obtained coloring intensity and color drawing range of the drawing tool are used to color the map of the target drawing area, so that a colored map with better visual viewing effect can be obtained.

[0085] Setting the color drawing range of the drawing tool can prevent the drawing tool from drawing too dark a color in one stroke during the drawing process, thereby improving the drawing effect. In specific implementation, the above step 20 can also be implemented through the following steps 30-32:

[0086] Step 30, determining the color of the texture of the target drawing area before drawing as the minimum value of the color drawing range of the drawing tool.

[0087] Step 31, subtract the color of the texture of the target drawing area before drawing from the color of the final texture to obtain a color difference.

[0088] Step 32, the product of the color difference, the image mask and the coloring intensity, plus the sum of the colors of the map of the target drawing area before drawing, is determined as the maximum value of the color drawing range of the drawing tool.

[0089] Specifically, assuming that the map color of the target drawing area before drawing is O, the color of the final map is T, the image mask corresponding to the target makeup is M, and the coloring intensity of the drawing tool is I, then the color drawing range of the drawing tool is [O, O+M*(T–O)*I].

[0090] Step S310, determining the overlapping area between the target makeup map and the shading map, updating the overlapping area in the target makeup map to the overlapping area in the shading map, and obtaining the drawing result of the target makeup.

[0091] There is an overlapping area between the target makeup map and the shading map, and the overlapping area is also the area in the target makeup that needs to be colored. After determining the overlapping area between the target makeup map and the shading map, the shading parameters in the overlapping area of ​​the shading map can be interpolated to the overlapping area of ​​the target makeup map to update the target makeup map and obtain the drawing result of the target makeup.

[0092] Step S312, enlarging the overlapping area in the drawing result, and performing Gaussian blur processing on the color of the enlarged overlapping area to obtain the final drawing result.

[0093] In order to achieve a softening effect and a better viewing effect of the target makeup drawing result, after step S310, the preset script of the CPU will issue an instruction to enlarge the overlapping area in the drawing result, that is, the drawing area of ​​the map of the target makeup this time, and then perform a Gaussian blur process on the color of the enlarged area to obtain the final drawing result after the processing is completed. The Gaussian blur process is also implemented by the shader.

[0094] The makeup drawing method in the above game first responds to the makeup drawing trigger operation for the virtual character, determines the target makeup to be drawn, and the tool parameters of the drawing tool required to draw the target makeup; then responds to the movement of the drawing tool on the virtual character, determines the target drawing area; then sends the target drawing area and the tool parameters of the drawing tool to the GPU, so that the GPU can color the map of the target drawing area based on the tool parameters of the drawing tool to obtain the coloring map of the target drawing area; then determines the overlapping area of ​​the map of the target makeup and the coloring map, updates the overlapping area in the map of the target makeup to the overlapping area of ​​the coloring map, obtains the drawing result of the target makeup, and finally enlarges the overlapping area in the drawing result, performs Gaussian blur processing on the color of the enlarged overlapping area, and obtains the final drawing result. This method can realize GPU-based character makeup drawing on mobile devices, improves the player's freedom of character customization within an affordable performance cost, and at the same time, through some auxiliary technologies, reduces the difficulty of players drawing customized makeup when the mobile terminal is difficult to operate, brings players a unique makeup experience, and improves the player's gaming experience.

[0095] Corresponding to the above method embodiment, the embodiment of the present invention provides a makeup drawing device in a game, which provides a graphical user interface through a terminal device, and the graphical user interface at least includes a virtual character, and the virtual character includes a three-dimensional character model and a map covering the surface of the three-dimensional character model; Figure 4 The device comprises:

[0096] The drawing trigger module 40 is used to respond to the makeup drawing trigger operation for the virtual character, determine the target makeup to be drawn, and the tool parameters of the drawing tool required for drawing the target makeup.

[0097] The drawing area determination module 41 is used to determine a target drawing area in response to the movement of the drawing tool on the virtual character.

[0098] The texture updating module 42 is used to update the texture of the target drawing area according to the tool parameters of the drawing tool to obtain the drawing result of the target makeup.

[0099] The makeup drawing device in the above-mentioned game first responds to the makeup drawing trigger operation for the virtual character, determines the target makeup to be drawn, and the tool parameters of the drawing tool required to draw the target makeup, wherein the virtual character includes a three-dimensional character model and a texture covering the surface of the three-dimensional character model; then responds to the movement of the drawing tool on the virtual character, determines the target drawing area; then updates the texture of the target drawing area according to the tool parameters of the drawing tool, and obtains the drawing result of the target makeup. This method uses the drawing tool to draw the makeup of the virtual character of the three-dimensional character model, and the drawing tool can move freely on the virtual character according to the player's needs, thereby increasing the player's freedom to customize the virtual character and also improving the drawing accuracy.

[0100] Furthermore, the drawing area determination module 41 is used to: respond to a touch start operation on the drawing tool, record the current position of the drawing tool on the virtual character; respond to a move operation on the drawing tool, control the drawing tool to move from the current position, and record the position of the drawing tool on the virtual character during the movement; respond to a touch end operation on the drawing tool, stop the movement of the drawing tool, and determine the position passed by the drawing tool from the current position as the target drawing area.

[0101] Specifically, the drawing area determination module 41 is further used to: during the movement of the drawing tool, record the position of the drawing tool on the virtual character through a preset virtual camera.

[0102] Furthermore, the above-mentioned texture update module 42 is used to: send the target drawing area and the tool parameters of the drawing tool to the GPU; through the GPU, based on the tool parameters of the drawing tool, color the texture of the target drawing area to obtain the colored texture of the target drawing area; determine the overlapping area between the texture of the target makeup and the colored texture, update the overlapping area in the texture of the target makeup to the overlapping area of ​​the colored texture, and obtain the drawing result of the target makeup.

[0103] Specifically, the tool parameters of the above-mentioned drawing tool include the type of the drawing tool; the shading map of the above-mentioned target drawing area is obtained by the GPU in the following manner: determining the map of the drawing tool based on the type of the drawing tool; mixing the map of the drawing tool with preset blue noise to obtain the shading intensity of the drawing tool; and shading the map of the target drawing area based on the shading intensity.

[0104] In a specific implementation, the above device further includes a first fuzzy processing module, which is used to: perform Gaussian fuzzy processing on the coloring intensity to obtain a final coloring intensity.

[0105] Furthermore, the above-mentioned texture updating module 42 includes: a color range determining unit, which is used to determine the color drawing range of the drawing tool according to the coloring intensity, the color of the texture of the target drawing area before drawing, the image mask corresponding to the target makeup and the color of the preset final texture; a coloring unit, which is used to color the texture of the target drawing area according to the coloring intensity and color drawing range of the drawing tool.

[0106] Specifically, the color range determination unit is used to: determine the color of the map of the target drawing area before drawing as the minimum value of the color drawing range of the drawing tool; subtract the color of the map of the target drawing area before drawing from the color of the final map to obtain a color difference; and determine the product of the color difference, the image mask and the coloring intensity, plus the sum of the colors of the map of the target drawing area before drawing as the maximum value of the color drawing range of the drawing tool.

[0107] In a specific implementation, the above-mentioned device also includes a pre-drawing color determination module, which is used to: record the current texture of the virtual character in response to the touch start instruction of the drawing tool; determine the current color of the texture of the target drawing area from the current texture, and determine the current color as the color of the texture of the target drawing area before drawing.

[0108] In a specific implementation, the tool parameters of the drawing tool include the color of the drawing tool; the device further includes a final texture color determination module, which is used to: determine the color of the drawing tool as the color of the final texture; or, determine the final texture from a plurality of preset textures according to the tool parameters to determine the color of the final texture; wherein each preset texture corresponds to a tool parameter.

[0109] Furthermore, the above-mentioned device also includes a second blur processing module, which is used to: enlarge the overlapping area in the drawing result; and perform Gaussian blur processing on the color of the enlarged overlapping area to obtain the final drawing result.

[0110] Furthermore, the above-mentioned device also includes a resolution setting module, which is used to: set the resolution of the map of the target makeup in the virtual character's map to a preset first resolution; set the resolution of the map of the virtual character except the map of the target makeup to a preset second resolution; wherein the first resolution is higher than the second resolution.

[0111] The implementation principle and technical effects of the in-game makeup drawing device provided in the embodiment of the present invention are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0112] The embodiment of the present invention further provides an electronic device, such as Figure 5As shown, the electronic device includes a processor 101 and a memory 100. The memory 100 stores machine executable instructions that can be executed by the processor 101. The processor 101 executes the machine executable instructions to implement the makeup drawing method in the above game.

[0113] Further, Figure 5 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 101 , the communication interface 103 and the memory 100 are connected via the bus 102 .

[0114] The memory 100 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0115] The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 101 or the instructions in the form of software. The above processor 101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can 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 gates or transistor logic devices, discrete hardware components.

[0116] The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100, and completes the steps of the method of the aforementioned embodiment in combination with its hardware.

[0117] An embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the makeup drawing method in the above-mentioned game. The specific implementation can be found in the method embodiment, which will not be repeated here.

[0118] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, electronic device, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0119] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0120] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A makeup drawing method in a game, characterized in that: A graphical user interface is provided through a terminal device, the graphical user interface includes at least a virtual character, the virtual character includes a three-dimensional character model and a map covering the surface of the three-dimensional character model; the method includes: In response to a makeup drawing triggering operation for the virtual character, determining a target makeup to be drawn and tool parameters of a drawing tool required for drawing the target makeup; In response to the movement of the drawing tool on the virtual character, determining a target drawing area; According to the tool parameters of the drawing tool, the map of the target drawing area is updated to obtain the drawing result of the target makeup; The step of updating the map of the target drawing area according to the tool parameters of the drawing tool to obtain the drawing result of the target makeup includes: Based on the tool parameters of the drawing tool, the map of the target drawing area is colored to obtain a colored map of the target drawing area; the color drawing range of the drawing tool is determined according to the coloring intensity of the drawing tool, the color of the map of the target drawing area before drawing, the image mask corresponding to the target makeup, and the color of the preset final map; An overlapping area between the texture of the target makeup and the shading texture is determined, and the overlapping area in the texture of the target makeup is updated to the overlapping area of ​​the shading texture, so as to obtain a drawing result of the target makeup.

2. The method according to claim 1, characterized in that The step of determining a target drawing area in response to the movement of the drawing tool on the virtual character comprises: In response to a touch start operation on the drawing tool, recording a current position of the drawing tool on the virtual character; In response to a movement operation on the drawing tool, controlling the drawing tool to move from the current position, and recording the position of the drawing tool on the virtual character during the movement; In response to a touch end operation on the drawing tool, the movement of the drawing tool is stopped, and the position passed by the drawing tool from the current position is determined as a target drawing area.

3. The method according to claim 2, characterized in that The step of recording the position of the drawing tool on the virtual character during the movement process includes: During the movement of the drawing tool, the position of the drawing tool on the virtual character is recorded through a preset virtual camera.

4. The method according to claim 1, characterized in that: The step of coloring the map of the target drawing area based on the tool parameters of the drawing tool to obtain the colored map of the target drawing area includes: Sending the target drawing area and tool parameters of the drawing tool to the GPU; The GPU is used to color the map of the target drawing area based on the tool parameters of the drawing tool to obtain a colored map of the target drawing area.

5. The method according to claim 4, characterized in that Tool parameters of the drawing tool, including the type of the drawing tool; The shading map of the target drawing area is obtained by the GPU in the following manner: determining a texture of the drawing tool based on the type of the drawing tool; Mixing the texture of the drawing tool with preset blue noise to obtain the coloring intensity of the drawing tool; The texture of the target drawing area is colored based on the coloring intensity.

6. The method according to claim 5, characterized in that After the step of mixing the map of the drawing tool with the preset blue noise to obtain the coloring intensity of the drawing tool, the method further includes: Gaussian blur processing is performed on the tinting intensity to obtain a final tinting intensity.

7. The method according to claim 5, characterized in that The step of coloring the map of the target drawing area based on the coloring intensity includes: Determining a color drawing range of the drawing tool according to the tinting intensity, the color of the map of the target drawing area before drawing, the image mask corresponding to the target makeup, and the color of the preset final map; The map of the target drawing area is colored according to the coloring intensity of the drawing tool and the color drawing range.

8. The method according to claim 7, characterized in that The step of determining the color drawing range of the drawing tool according to the tinting intensity, the color of the map of the target drawing area before drawing, the image mask corresponding to the target makeup and the color of the preset final map includes: Determine the color of the texture of the target drawing area before drawing as the minimum value of the color drawing range of the drawing tool; Subtract the color of the target drawing area before drawing from the color of the final map to obtain a color difference; The product of the color difference, the image mask and the coloring intensity is added to the sum of the colors of the map of the target drawing area before drawing to determine the maximum value of the color drawing range of the drawing tool.

9. The method according to claim 7, characterized in that: The color of the texture of the target drawing area before drawing is obtained as follows: In response to a touch start instruction of the drawing tool, recording a current texture of the virtual character; The current color of the map of the target drawing area is determined from the current map, and the current color is determined as the color of the map of the target drawing area before drawing.

10. The method according to claim 7, characterized in that The tool parameters of the drawing tool include the color of the drawing tool; the color of the final map is determined by: Determine the color of the drawing tool as the color of the final map; Alternatively, a final texture is determined from a plurality of preset textures according to the tool parameters to determine the color of the final texture; wherein each of the preset textures corresponds to a tool parameter.

11. The method according to claim 4, characterized in that After the step of determining the overlapped area between the map of the target makeup and the shading map, updating the overlapped area in the map of the target makeup to the overlapped area of ​​the shading map, and obtaining the drawing result of the target makeup, the method further includes: Amplifying the overlapping area in the drawing result; The colors of the enlarged overlapping areas are subjected to Gaussian blur processing to obtain the final drawing result.

12. The method according to claim 1, characterized in that Before the step of updating the map of the target drawing area according to the tool parameters of the drawing tool to obtain the drawing result of the target makeup, the method further includes: Setting the resolution of the texture of the target makeup in the texture of the virtual character to a preset first resolution; The resolution of the textures of the virtual character, except for the texture of the target makeup, is set to a preset second resolution; wherein the first resolution is higher than the second resolution.

13. A makeup drawing device in a game, characterized in that: A graphical user interface is provided through a terminal device, wherein the graphical user interface includes at least a virtual character, and the virtual character includes a three-dimensional character model and a map covering the surface of the three-dimensional character model; the device includes: A drawing trigger module, used to respond to a makeup drawing trigger operation for the virtual character, determine a target makeup to be drawn, and tool parameters of a drawing tool required to draw the target makeup; a drawing area determination module, configured to determine a target drawing area in response to movement of the drawing tool on the virtual character; A texture updating module, used for updating the texture of the target drawing area according to the tool parameters of the drawing tool, to obtain the drawing result of the target makeup; The texture update module is specifically used for: Based on the tool parameters of the drawing tool, the map of the target drawing area is colored to obtain a colored map of the target drawing area; the color drawing range of the drawing tool is determined according to the coloring intensity of the drawing tool, the color of the map of the target drawing area before drawing, the image mask corresponding to the target makeup, and the color of the preset final map; An overlapping area between the texture of the target makeup and the shading texture is determined, and the overlapping area in the texture of the target makeup is updated to the overlapping area of ​​the shading texture, so as to obtain a drawing result of the target makeup.

14. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the makeup drawing method in the game according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the makeup drawing method in a game as described in any one of claims 1 to 12.