Virtual expression generation method and device, storage medium and electronic equipment
By creating separate sets of textures for virtual eye sockets and eyeballs and controlling their switching via code, the problem of high cost in generating virtual expressions was solved, enabling highly customizable virtual expressions and reducing art production costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT DIGITAL (SHENZHEN) CO LTD
- Filing Date
- 2022-05-05
- Publication Date
- 2026-05-12
AI Technical Summary
The generation cost of virtual expressions in existing technologies is relatively high, especially when using skeletal deformation or drawing virtual expression textures, which results in serious waste of resources and excessively high art costs.
By acquiring a pre-configured set of virtual eye sockets and virtual eyeballs textures, and synthesizing virtual expressions using display parameters, the virtual eye sockets and eyeballs are created separately and switched using code, achieving a high degree of freedom in customizing virtual expressions.
It reduces the cost of generating virtual emoticons, lessens the burden of art production, and enables highly customizable virtual emoticons.
Smart Images

Figure CN117058281B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a method and apparatus for generating virtual facial expressions, a storage medium, and an electronic device. Background Technology
[0002] Currently, in the process of creating a large number of virtual expressions, artists usually draw them in advance and modify the eye mesh through skeletal deformation to achieve different virtual expressions, or they draw different complete virtual expression textures to achieve different effects.
[0003] If a skeletal deformation scheme is used, a higher polygon count and more skeletal control nodes are required to achieve the desired effect, which places higher demands on rendering performance. Furthermore, drawing different complete virtual facial expression textures requires adding a virtual facial expression texture for each virtual expression. If there are requirements such as changing the pupil color, the number of facial expression textures increases exponentially, resulting in excessively high art costs and wasted resources.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This application provides a method and apparatus for generating virtual emoticons, a storage medium, and an electronic device, to at least solve the technical problem of high generation cost of virtual emoticons in related technologies.
[0006] According to one aspect of the embodiments of this application, a method for generating virtual expressions is provided, comprising: acquiring a first texture set and a second texture set, wherein the first texture set includes a pre-configured texture for representing a virtual eye socket of a target virtual object, and the second texture set includes a pre-configured texture for representing a virtual eyeball of the target virtual object; acquiring a first eye socket texture from the first texture set, acquiring a first eyeball texture from the second texture set, and acquiring a first display parameter, wherein the first display parameter is a display parameter for displaying the virtual eyeball represented by the first eyeball texture in the virtual eye socket represented by the first eye socket texture; and, according to the first display parameter, combining the first eye socket texture and the first eyeball texture to form a first virtual expression of the target virtual object.
[0007] According to another aspect of the embodiments of this application, a virtual expression generation apparatus is also provided, comprising: a first acquisition module, configured to acquire a first texture set and a second texture set, wherein the first texture set includes a pre-configured texture for representing a virtual eye socket of a target virtual object, and the second texture set includes a pre-configured texture for representing a virtual eyeball of the target virtual object; a second acquisition module, configured to acquire a first eye socket texture from the first texture set, acquire a first eyeball texture from the second texture set, and acquire a first display parameter, wherein the first display parameter is a display parameter for displaying the virtual eyeball represented by the first eyeball texture in the virtual eye socket represented by the first eye socket texture; and a synthesis module, configured to synthesize the first eye socket texture and the first eyeball texture into a first virtual expression of the target virtual object according to the first display parameter.
[0008] Optionally, the device is further configured to: when the current virtual expression of the target virtual object is a virtual expression synthesized by combining the second eye socket image in the first image set and the second eyeball image in the second image set, obtain a target switching request; the device is configured to obtain the first eye socket image in the first image set and the first eyeball image in the second image set in the following manner: when the target switching request is used to request switching the virtual eyeball in the current virtual expression, the second eye socket image is used as the first eye socket image, and the first eyeball image selected in the second image set is obtained, wherein the first eyeball image is different from the second eyeball image.
[0009] Optionally, the device is further configured to obtain a target switching request when the current virtual expression of the target virtual object is a virtual expression synthesized by combining the second eye socket image in the first image set and the second eyeball image in the second image set; the device is configured to obtain the first eye socket image in the first image set and the first eyeball image in the second image set in the following manner: when the target switching request is used to request switching the virtual eye socket in the current virtual expression, the first eye socket image selected in the first image set is obtained, and the second eyeball image is used as the first eyeball image, wherein the first eye socket image is different from the second eye socket image.
[0010] Optionally, the device is further configured to: when the current virtual expression of the target virtual object is a virtual expression synthesized by combining the second eye socket image in the first image set and the second eyeball image in the second image set, obtain a target switching request; the device is configured to obtain the first eye socket image in the first image set and the first eyeball image in the second image set in the following manner: when the target switching request is used to request switching the virtual eye socket and virtual eyeball in the current virtual expression, obtain the first eye socket image selected in the first image set and obtain the first eyeball image selected in the second image set, wherein the first eye socket image is different from the second eye socket image and the first eyeball image is different from the second eyeball image.
[0011] Optionally, the device is further configured to: when the current virtual expression of the target virtual object is a virtual expression synthesized by combining the second eye socket image in the first image set and the second eyeball image in the second image set according to the second display parameters, obtain a target switching request, wherein the second display parameters are display parameters for displaying the virtual eyeball represented by the second eyeball image in the virtual eye socket represented by the second eye socket image; the device is configured to obtain the first eye socket image in the first image set, obtain the first eyeball image in the second image set, and obtain the first display parameters in the following manner: when the target switching request is used to request switching the display parameters of the virtual eyeball in the current virtual expression, the second eye socket image is used as the first eye socket image, the second eyeball image is used as the first eyeball image, and the first display parameters are obtained, wherein the first display parameters are different from the second display parameters.
[0012] Optionally, the device is configured to synthesize the first eye socket texture and the first eyeball texture into a first virtual expression of the target virtual object according to the first display parameters in the following manner: when the first display parameters include the eye socket range of the virtual eye socket represented by the first eye socket texture, the virtual eyeball represented by the first eyeball texture is added to the middle of the eye socket range to obtain a first expression texture to be used; and the first virtual expression is generated according to the first expression texture.
[0013] Optionally, the device is configured to generate the first virtual expression based on the first expression map in one of the following ways: if the first display parameters further include the eyeshadow range of the virtual eye socket represented by the first eye socket map, add the eyeshadow of the virtual eyeball represented by the first eyeball map to the first expression map within the eyeshadow range to obtain a second expression map; generate the first virtual expression based on the second expression map; if the first display parameters further include the blinking position coordinates of the virtual eyeball represented by the first eyeball map, add the eyeshadow of the virtual eyeball represented by the first eyeball map to the first expression map. The blinking point of the ball is added to the blinking position coordinates to obtain a third expression map; the first virtual expression is generated based on the third expression map; if the first display parameters also include the eyeshadow range of the virtual eye socket represented by the first eye socket map and the blinking position coordinates of the virtual eyeball represented by the first eyeball map, the eyeshadow of the virtual eyeball represented by the first eyeball map is added to the eyeshadow range of the first expression map, and the blinking point of the virtual eyeball represented by the first eyeball map is added to the blinking position coordinates to obtain a fourth expression map; the first virtual expression is generated based on the fourth expression map.
[0014] Optionally, the device is further configured to: after generating the first virtual expression based on the first expression map, upon receiving a color update instruction, modify the color of the virtual eyeball represented by the first eyeball map according to the color update instruction to update the first virtual expression; upon receiving a scaling update instruction, scale the virtual eyeball represented by the first eyeball map according to the scaling update instruction to update the first virtual expression; and upon receiving a position update instruction, modify the display position of the virtual eyeball represented by the first eyeball map inside the virtual eye socket according to the position update instruction to update the first virtual expression.
[0015] Optionally, the device is configured to obtain a first set of textures and a second set of textures by: classifying the textures of the virtual expressions to be synthesized to obtain multiple sets of textures representing different expression types, wherein the multiple sets of textures are stored in a database according to the different expression types; and in response to an expression type selection operation, obtaining the first set of textures and the second set of textures from the multiple sets of textures respectively.
[0016] Optionally, the device is configured to acquire a first eye socket texture from the first texture set by: determining a first loading path for the first eye socket texture in response to the expression type selection operation; and determining the first eye socket texture from the first texture set according to the first loading path. The device is configured to acquire a first eyeball texture from the second texture set by: determining a second loading path for the first eyeball texture in response to the expression type selection operation; and determining the first eyeball texture from the second texture set according to the second loading path.
[0017] Optionally, the device is further configured to: obtain the object type of the virtual object to be configured; if the object type indicates that the virtual object to be configured is controlled by the target account, configure the first virtual emoticon to the virtual object to be configured; if the object type indicates that the virtual object to be configured is controlled by the server, configure a preset virtual emoticon to the virtual object to be configured.
[0018] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described method for generating virtual expressions when running.
[0019] According to another aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the virtual emoticon generation method described above.
[0020] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-described method for generating virtual expressions through the computer program.
[0021] In this embodiment, a first texture set and a second texture set are obtained. The first texture set includes a pre-configured texture representing a virtual eye socket of a target virtual object, and the second texture set includes a pre-configured texture representing a virtual eyeball of the target virtual object. A first eye socket texture from the first texture set is obtained, a first eyeball texture from the second texture set is obtained, and a first display parameter is obtained. The first display parameter is used to display the virtual eyeball represented by the first eyeball texture in the virtual eye socket represented by the first eye socket texture. Based on the first display parameter, the first eye socket texture and the first eyeball texture are combined to form a first virtual expression of the target virtual object. By creating the virtual eye socket and the virtual eyeball separately and controlling the switching of the virtual eye socket with code, a highly customizable virtual expression function is achieved. This allows for the combination of different virtual eye sockets and virtual eyeballs to achieve a highly customizable virtual expression function, thereby reducing the cost of art production and lowering the cost of generating virtual expressions. This solves the technical problem of high generation cost of virtual expressions in related technologies. Attached Figure Description
[0022] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0023] Figure 1 This is a schematic diagram of an application environment for an optional virtual expression generation method according to an embodiment of this application;
[0024] Figure 2 This is a flowchart illustrating an optional method for generating virtual emoticons according to an embodiment of this application;
[0025] Figure 3 This is a schematic diagram of an optional method for generating virtual emoticons according to an embodiment of this application;
[0026] Figure 4 This is a schematic diagram of another optional method for generating virtual expressions according to an embodiment of this application;
[0027] Figure 5 This is a schematic diagram of another optional method for generating virtual expressions according to an embodiment of this application;
[0028] Figure 6 This is a schematic diagram of another optional method for generating virtual expressions according to an embodiment of this application;
[0029] Figure 7 This is a schematic diagram of another optional method for generating virtual expressions according to an embodiment of this application;
[0030] Figure 8 This is a schematic diagram of another optional method for generating virtual expressions according to an embodiment of this application;
[0031] Figure 9 This is a schematic diagram of another optional method for generating virtual expressions according to an embodiment of this application;
[0032] Figure 10 This is a schematic diagram of another optional method for generating virtual expressions according to an embodiment of this application;
[0033] Figure 11 This is a schematic diagram of another optional method for generating virtual expressions according to an embodiment of this application;
[0034] Figure 12 This is a schematic diagram of another optional method for generating virtual expressions according to an embodiment of this application;
[0035] Figure 13 This is a schematic diagram of an optional virtual facial expression generation device according to an embodiment of this application;
[0036] Figure 14 This is a schematic diagram of the structure of an optional virtual emoticon generation product according to an embodiment of this application;
[0037] Figure 15 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of this application. Detailed Implementation
[0038] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0039] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0040] First, some nouns or terms that appear in the description of the embodiments of this application shall be interpreted as follows:
[0041] UV: The mapping of a 3D model in a game onto a 2D plane, used as a reference for drawing model textures;
[0042] Functional textures: The four channels of the texture are used to store different rendering data.
[0043] The present application will be described below with reference to embodiments:
[0044] According to one aspect of the embodiments of this application, a method for generating virtual expressions is provided. Optionally, in this embodiment, the above-described method for generating virtual expressions can be applied to, for example... Figure 1 The hardware environment shown consists of server 101 and terminal device 103. For example... Figure 1As shown, server 101 is connected to terminal 103 via a network and can be used to provide services for terminal devices or applications installed on terminal devices. Applications can be video applications, instant messaging applications, browser applications, educational applications, game applications, etc. Database 105 can be set up on the server or independently of the server to provide data storage services for server 101, such as a game data storage server. The network can include, but is not limited to, wired networks and wireless networks. The wired network includes local area networks (LANs), metropolitan area networks (MANs), and wide area networks (WANs). The wireless network includes Bluetooth, Wi-Fi, and other networks that enable wireless communication. Terminal device 103 can be a terminal configured with an application, and can include, but is not limited to, at least one of the following: mobile phones (such as Android phones, iOS phones, etc.), laptops, tablets, PDAs, MIDs (Mobile Internet Devices), PADs, desktop computers, smart TVs, smart voice interaction devices, smart home appliances, and in-vehicle terminal computer devices. The server can be a single server, a server cluster consisting of multiple servers, or a cloud server. The application 107 using the virtual emoticon generation method described above is displayed through terminal device 103 or other connected display devices.
[0045] Combination Figure 1 As shown, the above-mentioned method for generating virtual expressions can be implemented in terminal device 103 through the following steps:
[0046] S1, acquire a first texture set and a second texture set on the terminal device 103, wherein the first texture set includes a pre-configured texture for representing the virtual eye socket of the target virtual object, and the second texture set includes a pre-configured texture for representing the virtual eyeball of the target virtual object;
[0047] S2, on the terminal device 103, obtain the first eye socket texture from the first texture set, obtain the first eyeball texture from the second texture set, and obtain the first display parameter, wherein the first display parameter is a display parameter used to display the virtual eyeball represented by the first eyeball texture in the virtual eye socket represented by the first eye socket texture;
[0048] S3, on the terminal device 103, the first eye socket texture and the first eyeball texture are combined into the first virtual expression of the target virtual object according to the first display parameters.
[0049] Optionally, in this embodiment, the method for generating virtual expressions described above can also be implemented via a server, for example, Figure 1 It is implemented in server 101 shown; or it is implemented jointly by the terminal device and the server.
[0050] The above is merely an example, and this embodiment does not impose any specific limitations.
[0051] Alternatively, as an alternative implementation method, such as Figure 2 As shown, the method for generating the aforementioned virtual emoticons includes:
[0052] S202, obtain a first texture set and a second texture set, wherein the first texture set includes a pre-configured texture for representing the virtual eye socket of the target virtual object, and the second texture set includes a pre-configured texture for representing the virtual eyeball of the target virtual object;
[0053] S204, obtain the first eye socket texture from the first texture set, obtain the first eyeball texture from the second texture set, and obtain the first display parameter, wherein the first display parameter is a display parameter used to display the virtual eyeball represented by the first eyeball texture in the virtual eye socket represented by the first eye socket texture;
[0054] S206, Based on the first display parameters, the first eye socket texture and the first eyeball texture are combined to form the first virtual expression of the target virtual object.
[0055] Optionally, in the embodiments of this application, the above-described method for generating virtual expressions can be applied to application scenarios that require the use of virtual expressions, including but not limited to game applications, as well as applications that require the use of virtual expressions, such as live streaming applications, video production applications, information interaction in instant messaging applications, and design applications for virtual characters or virtual animals.
[0056] For example, Figure 3 This is a schematic diagram of an optional virtual emoticon generation method according to an embodiment of this application, such as... Figure 3 As shown, the above-mentioned method for generating virtual expressions can be applied to the process of generating virtual expressions for game characters. A first eye socket image is selected from the first image set based on interactive operations, and a first eyeball image is selected from the second image set based on interactive operations. Then, based on the first display parameters, the first eye socket image and the first eyeball image are combined into the first virtual expression of the target virtual object.
[0057] Optionally, in this embodiment of the application, the first texture set and the second texture set are texture sets composed of textures pre-made by artists, wherein the textures in the first texture set represent the virtual eye sockets of the target virtual object, and the textures in the second texture set represent the virtual eyeballs of the target virtual object.
[0058] For example, Figure 4 This is a schematic diagram of another optional method for generating virtual emoticons according to an embodiment of this application, such as... Figure 4As shown, the first set of textures may include, but is not limited to, virtual eye sockets 402, 404, 406 and 408, and the second set of textures may include, but is not limited to, virtual eyeballs 410, 412, 414 and 416. It may include, but is not limited to, selecting virtual eye sockets 404 and virtual eyeballs 410 according to interactive operations, and combining the first eye socket texture and the first eyeball texture into the first virtual expression of the target virtual object according to the first display parameters.
[0059] Optionally, in the embodiments of this application, the virtual eye socket may include, but is not limited to, the virtual eye socket of an animated character, the virtual eye socket of a virtual person, the virtual eye socket of a virtual animal, etc., and the virtual eyeball may include, but is not limited to, the virtual eyeball of an animated character, the virtual eyeball of a virtual person, the virtual eyeball of a virtual animal, etc.
[0060] Optionally, in this embodiment of the application, the above-mentioned acquisition of the first eye socket texture in the first texture set may include, but is not limited to, selecting the first eye socket texture from the first texture set according to the expression type of the virtual expression configured for the target virtual object in advance, and the above-mentioned acquisition of the first eyeball texture in the second texture set may include, but is not limited to, selecting the first eyeball texture from the second texture set according to the expression type of the virtual expression configured for the target virtual object in advance.
[0061] Optionally, in this embodiment of the application, the first display parameter may include, but is not limited to, the functional map corresponding to the first eye socket map. The functional map may include, but is not limited to, a four-channel map, such as an RGBA functional map. The RGB channels of the functional map store the eye socket range, the eye shadow range, and the highlight flicker range, respectively. The Alpha channel may store other related parameters of the virtual eyeball and the virtual eye socket, such as the shape of the eye socket.
[0062] It should be noted that the first display parameter mentioned above is a display parameter used to display the virtual eyeball in the virtual eye socket. For example, the position of the virtual eyeball displayed on the virtual eye socket, the range of the virtual eyeshadow when the virtual eyeball is displayed in the virtual eye socket, and the range of the highlight flashing points when the virtual eyeball is displayed in the virtual eye socket.
[0063] For example, Figure 5 This is a schematic diagram of another optional method for generating virtual emoticons according to an embodiment of this application, such as... Figure 5As shown, the first display parameter may include, but is not limited to, determining the corresponding functional texture based on the first eye socket texture selected from the first texture set. The functional texture includes at least three channels: RGB, where the R channel records the eye socket range of the first eye socket texture, the G channel records the eyeshadow range of the first eye socket texture, and the B channel records the range of the highlight flicker points corresponding to the first eye socket texture.
[0064] Optionally, in this embodiment of the application, the first virtual expression of the target virtual object, which is synthesized from the first eye socket texture and the first eyeball texture according to the first display parameters, may include, but is not limited to, drawing the virtual eyeball represented by the first eyeball texture in the eye socket area indicated by the first display parameters, drawing the eyeshadow of the virtual eyeball in the eyeshadow area indicated by the first display parameters, and drawing the highlight flashing point of the virtual eyeball in the highlight flashing point area indicated by the first display parameters.
[0065] For example, Figure 6 This is a schematic diagram of another optional method for generating virtual emoticons according to an embodiment of this application, such as... Figure 6 As shown, the process may include, but is not limited to, determining a first eye socket texture from a first texture set, determining a first display parameter corresponding to the first eye socket texture, determining a first eyeball texture from a second texture set, and combining the first eye socket texture and the first eyeball texture into a first virtual expression of the target virtual object based on the first display parameter.
[0066] This application embodiment employs a method of acquiring a first texture set and a second texture set. The first texture set includes pre-configured textures representing virtual eye sockets of a target virtual object, and the second texture set includes pre-configured textures representing virtual eyeballs of the target virtual object. The method involves acquiring a first eye socket texture from the first texture set, acquiring a first eyeball texture from the second texture set, and acquiring a first display parameter. The first display parameter is used to display the virtual eyeball represented by the first eyeball texture within the virtual eye socket represented by the first eye socket texture. Based on the first display parameter, the first eye socket texture and the first eyeball texture are combined to form a first virtual expression of the target virtual object. By creating the virtual eye socket and virtual eyeball separately and controlling the switching of the virtual eye socket using code, a highly customizable virtual expression function is achieved. This allows for the combination of different virtual eye socket and virtual eyeball effects, thereby reducing the cost of art production and lowering the cost of generating virtual expressions. Furthermore, this solves the technical problem of high virtual expression generation costs in related technologies.
[0067] Furthermore, by creating the virtual eye sockets and virtual eyeballs separately, and then controlling the switching of the virtual eye sockets through code, while using algorithms to process the virtual eyeballs including but not limited to color changes, scaling, and displacement, different combinations of virtual eye sockets and virtual eyeballs can be achieved, as well as the virtual eyeballs' perspective-following effect. This allows for the realization of almost all eye expression effects while reducing the cost of art production. Players can freely combine virtual eye sockets and virtual eyeballs, achieving a high degree of freedom in customizing player expressions.
[0068] As an alternative solution,
[0069] The method also includes: obtaining a target switching request when the current virtual expression of the target virtual object is a virtual expression obtained by compositing the second eye socket texture from the first texture set and the second eyeball texture from the second texture set;
[0070] Obtaining the first eye socket texture from the first texture set and the first eyeball texture from the second texture set includes: when the target switching request is used to request switching the virtual eyeball in the current virtual expression, using the second eye socket texture as the first eye socket texture and obtaining the selected first eyeball texture from the second texture set, wherein the first eyeball texture is different from the second eyeball texture.
[0071] Optionally, in the embodiments of this application, the target switching request may include, but is not limited to, a switching request generated by the user or the system. In other words, the user may perform an interactive operation to trigger the execution of the target switching request, or a corresponding time point may be pre-configured, and then the system may trigger the execution of the target switching request at the aforementioned time point.
[0072] Optionally, in this embodiment of the application, the above-mentioned target switching request for requesting to switch virtual eyeballs may include, but is not limited to, changing the above-mentioned second eyeball texture to the above-mentioned first eyeball texture, while keeping the second eye socket texture unchanged, so as to quickly generate virtual expressions that only switch virtual eyeballs.
[0073] Optionally, in this embodiment of the application, the above-mentioned second eyeball texture and the above-mentioned second eye socket texture are the current virtual expressions of the target virtual object. The above-mentioned target switching request can switch the current virtual expressions of the target virtual object. The difference between the above-mentioned second eyeball texture and the above-mentioned first eyeball texture may include, but is not limited to, differences in the shape, size, color, etc. of the virtual eyeball.
[0074] For example, Figure 7 This is a schematic diagram of another optional method for generating virtual emoticons according to an embodiment of this application, such as... Figure 7 As shown, the steps may include, but are not limited to, the following:
[0075] S1, Obtain the target switching request and perform interactive operations on "Switch Eyeball";
[0076] S2, Select the first eyeball texture from the second texture set;
[0077] S3, use the second eye socket texture as the first eye socket texture, and obtain the first eyeball texture selected in the second texture set. Combine the second eye socket texture and the first eyeball texture to obtain the virtual expression.
[0078] The above is merely an example, and the embodiments in this application do not impose any specific limitations.
[0079] In this embodiment, when the current virtual expression of the target virtual object is a virtual expression synthesized from the second eye socket texture in the first texture set and the second eyeball texture in the second texture set, a target switching request is obtained. When the target switching request requests to switch the virtual eyeball in the current virtual expression, the second eye socket texture is used as the first eye socket texture, and the first eyeball texture selected in the second texture set is obtained. The first eyeball texture and the second eyeball texture are made differently. By creating the virtual eye socket and the virtual eyeball separately, and using code to control the switching of the virtual eyeball, a new virtual expression can be generated, realizing a highly customizable virtual expression function. This achieves the goal of allowing the combination of virtual eye socket and different virtual eyeball effects to realize a highly customizable virtual expression function, thereby reducing the cost of art production and the technical effect of reducing the generation cost of virtual expressions. In turn, it solves the technical problem of high generation cost of virtual expressions in related technologies.
[0080] As an alternative solution,
[0081] The above method also includes: obtaining a target switching request when the current virtual expression of the target virtual object is a virtual expression obtained by compositing the second eye socket texture in the first texture set and the second eyeball texture in the second texture set;
[0082] Obtaining the first eye socket texture from the first texture set and the first eyeball texture from the second texture set includes: when the target switching request is used to request switching the virtual eye socket in the current virtual expression, obtaining the first eye socket texture selected in the first texture set and using the second eyeball texture as the first eyeball texture, wherein the first eye socket texture and the second eye socket texture are different.
[0083] Optionally, in the embodiments of this application, the target switching request may include, but is not limited to, a switching request generated by the user or the system. In other words, the user may perform an interactive operation to trigger the execution of the target switching request, or a corresponding time point may be pre-configured, and then the system may trigger the execution of the target switching request at the aforementioned time point.
[0084] Optionally, in this embodiment of the application, the above-mentioned target switching request for requesting to switch the virtual eye socket may include, but is not limited to, changing the above-mentioned second eye socket texture to the above-mentioned first eye socket texture, while keeping the second eyeball texture unchanged, so as to quickly generate a virtual expression that only switches the virtual eye socket.
[0085] Optionally, in this embodiment of the application, the second eyeball texture and the second eye socket texture are the current virtual expressions of the target virtual object. The target switching request can switch the current virtual expressions of the target virtual object. The second eye socket texture may differ from the first eye socket texture in terms of shape, size, color, etc., and may also include, but is not limited to, adjusting the display parameters corresponding to the second eye socket texture to the display parameters corresponding to the first eye socket texture.
[0086] For example, Figure 8 This is a schematic diagram of another optional method for generating virtual emoticons according to an embodiment of this application, such as... Figure 8 As shown, the steps may include, but are not limited to, the following:
[0087] S1, Obtain the target switching request and perform an interactive operation on "Switch eye socket";
[0088] S2, Select the first eye socket texture from the first texture set;
[0089] S3, use the second eyeball texture as the first eyeball texture, and obtain the first eye socket texture selected in the first texture set. Combine the second eyeball texture and the first eye socket texture to obtain the virtual expression.
[0090] The above is merely an example, and the embodiments in this application do not impose any specific limitations.
[0091] In this embodiment, when the current virtual expression of the target virtual object is a virtual expression synthesized by combining the second eye socket texture from the first texture set and the second eyeball texture from the second texture set, a target switching request is obtained, the first eye socket texture from the first texture set is obtained, and the first eyeball texture from the second texture set is obtained. This includes: when the target switching request is used to request switching the virtual eye socket in the current virtual expression, the first eye socket texture selected in the first texture set is obtained, and the second eyeball texture is used as the first eyeball texture. The first eye socket texture and the second eye socket texture are created differently. By creating the virtual eye socket and the virtual eyeball separately, and using code to control only the switching of the virtual eye socket, a new virtual expression can be generated. This achieves a high degree of freedom in customizing virtual expressions, allowing different virtual eye socket effects and virtual eyeballs to be combined to achieve a high degree of freedom in customizing virtual expressions. This reduces the cost of art production and lowers the cost of generating virtual expressions, thus solving the technical problem of high generation costs for virtual expressions in related technologies.
[0092] As an alternative solution,
[0093] The above method also includes: obtaining a target switching request when the current virtual expression of the target virtual object is a virtual expression obtained by compositing the second eye socket texture in the first texture set and the second eyeball texture in the second texture set;
[0094] Obtaining the first eye socket texture from the first texture set and the first eyeball texture from the second texture set includes: when the target switching request is used to request switching the virtual eye socket and virtual eyeball in the current virtual expression, obtaining the first eye socket texture selected in the first texture set and obtaining the first eyeball texture selected in the second texture set, wherein the first eye socket texture is different from the second eye socket texture and the first eyeball texture is different from the second eyeball texture.
[0095] Optionally, in the embodiments of this application, the target switching request may include, but is not limited to, a switching request generated by the user or the system. In other words, the user may perform an interactive operation to trigger the execution of the target switching request, or a corresponding time point may be pre-configured, and then the system may trigger the execution of the target switching request at the aforementioned time point.
[0096] Optionally, in this embodiment of the application, the target switching request is used to request the simultaneous switching of the virtual eye socket and the virtual eyeball. This may include, but is not limited to, changing the second eye socket texture to the first eye socket texture and changing the second eyeball texture to the first eyeball texture to achieve rapid generation of a new virtual expression, and the new virtual expression simultaneously replaces the virtual eye socket and the virtual eyeball.
[0097] Optionally, in this embodiment, the second eyeball texture and the second eye socket texture are the current virtual expressions of the target virtual object. The target switching request can switch the current virtual expressions of the target virtual object. The second eye socket texture may differ from the first eye socket texture in, but is not limited to, the shape, size, and color of the virtual eye socket. It may also include, but is not limited to, adjusting the display parameters corresponding to the second eye socket texture to the display parameters corresponding to the first eye socket texture. The second eyeball texture may differ from the first eyeball texture in, but is not limited to, the shape, size, and color of the virtual eyeball.
[0098] For example, Figure 9 This is a schematic diagram of another optional method for generating virtual emoticons according to an embodiment of this application, such as... Figure 9 As shown, the steps may include, but are not limited to, the following:
[0099] S1, Obtain the target switching request and perform an interactive operation on "Switch Emoji";
[0100] S2, Select the first eye socket texture from the first texture set, and select the first eyeball texture from the second texture set;
[0101] S3: Obtain the first eye socket texture selected in the first texture set, and obtain the first eyeball texture selected in the second texture set. Combine the first eye socket texture and the first eyeball texture to obtain a virtual expression.
[0102] The above is merely an example, and the embodiments in this application do not impose any specific limitations.
[0103] In this embodiment, when the current virtual expression of the target virtual object is a virtual expression synthesized from the second eye socket texture in the first texture set and the second eyeball texture in the second texture set, a target switching request is obtained. When the target switching request requests to switch the virtual eye socket and virtual eyeball in the current virtual expression, the first eye socket texture selected in the first texture set and the first eyeball texture selected in the second texture set are obtained. The first eye socket texture is different from the second eye socket texture, and the first eyeball texture is different from the second eyeball texture. By creating the virtual eye socket and virtual eyeball separately and controlling the switching of the virtual eye socket and virtual eyeball simultaneously using code, a new virtual expression can be generated. This achieves a high degree of freedom in customizing virtual expressions, allowing different virtual eye socket effects and different virtual eyeball effects to be combined to achieve a high degree of freedom in customizing virtual expressions. This reduces the cost of art production and lowers the cost of generating virtual expressions, thus solving the technical problem of high generation cost of virtual expressions in related technologies.
[0104] As an alternative solution,
[0105] The above method further includes: when the current virtual expression of the target virtual object is a virtual expression obtained by compositing the second eye socket texture in the first texture set and the second eyeball texture in the second texture set according to the second display parameters, obtaining a target switching request, wherein the second display parameters are display parameters used to display the virtual eyeball represented by the second eyeball texture in the virtual eye socket represented by the second eye socket texture;
[0106] Obtain the first eye socket texture from the first texture set, obtain the first eyeball texture from the second texture set, and obtain the first display parameters, including: when the target switching request is used to request switching the display parameters of the virtual eyeball in the current virtual expression, use the second eye socket texture as the first eye socket texture, use the second eyeball texture as the first eyeball texture, and obtain the first display parameters, wherein the first display parameters are different from the second display parameters.
[0107] Optionally, in the embodiments of this application, the target switching request may include, but is not limited to, a switching request generated by the user or the system. In other words, the user may perform an interactive operation to trigger the execution of the target switching request, or a corresponding time point may be pre-configured, and then the system may trigger the execution of the target switching request at the aforementioned time point.
[0108] Optionally, in this embodiment of the application, the above-mentioned target switching request is used to request the switching of the second display parameter of the virtual eye socket to the first display parameter, so as to realize the rapid adjustment of the display parameters of the virtual eyeball in the virtual eye socket.
[0109] It should be noted that the above display parameters can be adjusted using the material ball.
[0110] Optionally, in this embodiment of the application, the above-mentioned second eyeball texture and the above-mentioned second eye socket texture are the current virtual expressions of the target virtual object. The above-mentioned target switching request can switch the current virtual expressions of the target virtual object. The difference between the above-mentioned first display parameters and second display parameters may include, but is not limited to, the different sizes of the eye shadow range of the virtual eyeball in the virtual eye socket, and at least one of the different color-changing information, scaling information and position information of the virtual eyeball.
[0111] For example, Figure 10 This is a schematic diagram of another optional method for generating virtual emoticons according to an embodiment of this application, such as... Figure 10 As shown, the steps may include, but are not limited to, the following:
[0112] S1, obtain the target switching request and perform the interactive operation on "adjust highlight point";
[0113] S2, obtain the first display parameter from the material sphere;
[0114] S3, Based on the first display parameters, the first eye socket texture and the first eyeball texture are combined to obtain a virtual expression.
[0115] The above is merely an example, and the embodiments in this application do not impose any specific limitations.
[0116] In this embodiment, when the current virtual expression of the target virtual object is a virtual expression synthesized by combining the second eye socket image from the first image set and the second eyeball image from the second image set according to the second display parameters, a target switching request is obtained. The second display parameters are used to display the virtual eyeball represented by the second eyeball image within the virtual eye socket represented by the second eye socket image. When the target switching request requests a change in the display parameters of the virtual eyeball in the current virtual expression, the second eye socket image is used as the first eye socket image, the second eyeball image is used as the first eyeball image, and the first display parameters are obtained. The method involves creating virtual eye sockets and virtual eyeballs separately and configuring corresponding material spheres. By modifying the material spheres using code, the display parameters of the virtual eyeballs within the virtual eye sockets can be changed, generating new virtual expressions. This achieves a high degree of freedom in customizing virtual expressions, allowing virtual eye sockets and virtual eyeballs to be combined with different display parameters. This reduces the cost of art production and lowers the cost of generating virtual expressions, thus solving the technical problem of high virtual expression generation costs in related technologies.
[0117] In addition, the size and direction of the virtual eyeballs can be configured according to the player's preferences, including but not limited to. For example, the virtual eyeballs can be shrunk to express shock, or the virtual eyeballs can be tilted upwards when in normal state to show a shy expression in conjunction with a custom blush effect, thus achieving a high degree of freedom in eye expression effects.
[0118] Meanwhile, when needing to create dazzling virtual eye effects in cartoon style, the HSV color-changing scheme can be used, including but not limited to, to ensure that the color gradient effect is preserved during the color-changing process. In addition to freely combining eye socket and eyeball effects, players can achieve any facial expression without having to draw a massive number of facial textures. For players, the process of creating virtual expressions is simple: just replace the textures of the virtual eye socket and virtual eyeball. By adjusting the parameters appropriately, players can obtain custom expressions that meet their actual needs, optimizing the user experience and improving the efficiency of creating complex virtual expressions.
[0119] As an optional approach, based on the first display parameters, the first eye socket texture and the first eyeball texture are combined to form the first virtual expression of the target virtual object, including:
[0120] If the first display parameters include the orbital range of the virtual eye socket represented by the first eye socket texture, the virtual eyeball represented by the first eyeball texture is added to the middle of the orbital range to obtain the first expression texture to be used;
[0121] Generate the first virtual emoticon based on the first emoticon image.
[0122] Optionally, in the embodiments of this application, the expression texture may include, but is not limited to, dividing the expression texture into eye socket texture, eyeball texture and function texture. By designing two sets of UVs, one set is used to flatten the face of the target virtual object, and the other set is used to process the eye area. Finally, the eye area effect is blended with the facial effect.
[0123] For example, Figure 11 This is a schematic diagram of another optional method for generating virtual emoticons according to an embodiment of this application, such as... Figure 11 As shown, the steps may include, but are not limited to, the following:
[0124] S1, flatten the face of the target virtual object, such as UV1. At this time, only the parts of the target virtual object's face other than the eye expression are processed.
[0125] S2, flatten the eye area of the target virtual object, such as UV2, and add the first eye socket map and the first eyeball map to UV2;
[0126] S3, based on the first display parameters, add a virtual eyeball to the middle of the eye socket area to achieve the processing of the eye area effect.
[0127] The above is merely an example, and the embodiments in this application do not impose any specific limitations.
[0128] As an optional approach, a first virtual emoticon is generated based on the first emoticon image, including one of the following:
[0129] If the first display parameters also include the eyeshadow range of the virtual eye socket represented by the first eye socket texture, the eyeshadow of the virtual eyeball represented by the first eyeball texture is added to the middle of the eyeshadow range in the first expression texture to obtain the second expression texture; and the first virtual expression is generated based on the second expression texture.
[0130] If the first display parameters also include the blinking position coordinates of the virtual eye represented by the first eye map, the blinking point of the virtual eye represented by the first eye map is added to the blinking position coordinates in the first expression map to obtain the third expression map; and the first virtual expression is generated based on the third expression map.
[0131] If the first display parameters also include the eyeshadow range of the virtual eye socket represented by the first eye socket texture and the blinking position coordinates of the virtual eyeball represented by the first eyeball texture, the eyeshadow of the virtual eyeball represented by the first eyeball texture is added to the middle of the eyeshadow range in the first expression texture, and the blinking point of the virtual eyeball represented by the first eyeball texture is added to the blinking position coordinates to obtain the fourth expression texture; the first virtual expression is generated based on the fourth expression texture.
[0132] Optionally, in this embodiment, the aforementioned eyeshadow range represents the shadow range of the upper eyelid of the virtual eyeball, and the aforementioned flashing position coordinates represent the display position coordinates of the highlight of the virtual eyeball.
[0133] Optionally, in this embodiment, the second, third, and fourth emoticon images are all first virtual emoticons with modified display parameters.
[0134] As an optional approach, after generating the first virtual emoticon based on the first emoticon image, the method further includes:
[0135] Upon receiving a color update instruction, the color of the virtual eye represented by the first eyeball texture is modified according to the color update instruction in order to update the first virtual expression;
[0136] Upon receiving a scaling update instruction, the virtual eyeball represented by the first eyeball texture is scaled according to the scaling update instruction in order to update the first virtual expression;
[0137] Upon receiving a location update command, the display position of the virtual eyeball represented by the first eyeball texture inside the virtual eye socket is modified according to the location update command in order to update the first virtual expression.
[0138] Optionally, in the embodiments of this application, the above-mentioned method of modifying the first eyeball texture according to the color update instruction, scaling update instruction and position update instruction may include, but is not limited to, modifying only the left eye or the right eye in the first eyeball texture, and then using a UV folding scheme to deform the other side accordingly.
[0139] Optionally, in the embodiments of this application, the above-mentioned color update instruction, scaling update instruction and position update instruction are all adjustment instructions executed on the eyeball by the shader, and the relevant parameters of the material ball are modified by the algorithm to update the first virtual expression.
[0140] As an optional approach, obtaining the first texture set and the second texture set includes:
[0141] The various textures to be synthesized virtual expressions are classified to obtain multiple texture sets representing different expression types. These multiple texture sets are stored in a database according to different expression types.
[0142] In response to the expression type selection operation, the first and second image sets are obtained from multiple image sets respectively.
[0143] Optionally, in this embodiment of the application, each texture of the virtual emoticon to be synthesized is designed by an art designer, and the emoticon type corresponding to the emoticon ID is predefined, for example, 0: normal, 1: closed eyes, 2: smiling, etc. During production, the texture names are processed according to the previously defined specifications so that when generating emoticons later, the texture of the corresponding emoticon type can be selected directly by adjusting the emoticon ID.
[0144] As an alternative solution,
[0145] Obtaining the first eye socket texture from the first texture set includes: in response to an expression type selection operation, determining the first loading path of the first eye socket texture; and determining the first eye socket texture from the first texture set based on the first loading path.
[0146] Obtaining the first eyeball image from the second image set includes: in response to an expression type selection operation, determining a second loading path for the first eyeball image; and determining the first eyeball image from the second image set based on the second loading path.
[0147] Optionally, in this embodiment, the first loading path and the second loading path can be stored in a database configuration file, and can be stored in a key-value format, for example, the key is the emoji ID and the value is the loading path of the emoji.
[0148] As an alternative approach, the method also includes:
[0149] Obtain the object type of the virtual object to be configured;
[0150] If the object type indicates that the virtual object to be configured is controlled by the target account, the first virtual object is configured to the virtual object to be configured.
[0151] When the virtual object whose object type indicates that the virtual emoticon to be configured is controlled by the server, the preset virtual emoticon is configured to the virtual object of the virtual emoticon to be configured.
[0152] Optionally, in this embodiment of the application, the above-mentioned object types may include, but are not limited to, virtual objects controlled by the user's login target account, such as game protagonists, and virtual objects automatically controlled by the server according to preset rules, such as NPCs.
[0153] It should be noted that when the virtual object to be configured is a virtual object controlled by the target account, the first virtual emoticon will be configured for that virtual object. When the virtual object to be configured is a virtual object controlled by the server, the pre-generated preset virtual emoticon will be configured for that virtual object.
[0154] The following specific examples will further explain this application:
[0155] This application provides a solution for highly customizable eye expressions in game characters, and optimizes the game production process. The solution is as follows: the eye texture is split into three parts: an eye texture without the pupil (corresponding to the aforementioned eyeball), a functional texture of the pupil area, and a separate pupil texture. These are integrated into a material sphere using an algorithm, and the changes in expression and pupil are controlled by the material sphere parameters.
[0156] By creating the eye sockets and pupils separately, controlling the switching of eye sockets through code, and using shader algorithms to process the pupils by changing their color, scaling, and displacement, different combinations of eye socket and pupil effects and eyeball perspective following effects can be achieved. This allows for the creation of almost all cartoon eye expression effects while reducing the cost of art production, reducing the package size, and enabling highly customizable player expressions.
[0157] In addition, to simplify the workflow and reduce the performance overhead of the game, a solution for non-highly customizable NPC expressions is also provided, which uses preset image sets of expressions and controls the generation with shader switches.
[0158] Specifically, this includes, but is not limited to, the following:
[0159] Model Design:
[0160] Two sets of UV filters need to be designed: one to flatten the face and the other to treat the eye area. Finally, the effect of the eye area will be blended with the effect of the face.
[0161] Eye socket texture design (corresponding to the aforementioned first eye socket texture):
[0162] The eye socket texture is designed by the art team and can have some color gradient tendencies. However, due to the need to match various skins and for performance and game requirements, the eye socket texture cannot have too strong a color tendency. In order to make the transition natural, the base color of the eye socket needs to be the color of the standard skin.
[0163] Pupil texture (corresponding to the aforementioned first eyeball texture) design:
[0164] To achieve the vibrant pupil effect characteristic of cartoons, the HSV color-changing scheme can be used, among other things, to ensure that the color gradient effect is preserved during the color-changing process.
[0165] When drawing pupils, artists need to design them based on standard pupil size and position to ensure that deformation parameters can be reused in the game.
[0166] When designing the artwork, it is necessary to ensure that the center point of the pupil is consistent with the reference pupil coordinates. The reference coordinates for scaling and displacement of the pupil in the shader are the center point of the left pupil. The pupil is deformed accordingly using a UV folding scheme.
[0167] Functional texture design:
[0168] The three channels of the functional texture store the eye socket area, eyeshadow area, and highlight flicker point area, respectively. The alpha channel has no function yet and is reserved.
[0169] For example, Figure 12 This is a schematic diagram of another optional method for generating virtual emoticons according to an embodiment of this application, such as... Figure 12 As shown, the steps may include, but are not limited to, the following:
[0170] The first step is to determine whether the virtual emoticon to be generated is the main character's emoticon. If not, switch to the conventional solution to reduce rendering pressure.
[0171] The second step is to determine whether the eye socket texture needs to be switched. If it needs to be switched, the database configuration file is read to obtain the corresponding eye socket texture and the corresponding function texture loading path. After loading, the original eye socket texture and the corresponding function texture are replaced.
[0172] The third step is to determine whether to switch the pupil texture. If switching is required, the database configuration file is read to obtain the corresponding eye socket texture loading path. After loading, the original pupil texture is replaced.
[0173] The fourth step is to determine whether the pupil transformation data has changed. The data comes from the initial configuration information of each pupil stored on the server and the parameters manually adjusted by the player. If it is determined that the pupil's color change information, scaling information, and position information have been updated, then the pupil-related parameters on the material ball are modified.
[0174] All required emoticon paths are configured through a database table, which can be added without limit. The emoticon ID and corresponding emoticon type are predefined, such as 0: normal, 1: closed eyes, 2: smiling, etc. When creating and configuring the table, the emoticon naming is handled according to the previously defined specifications.
[0175] In this embodiment, since the face and expression effects are blended using a single material sphere, no additional semi-transparent layer is needed to process the expression, reducing overdraw overhead. Assuming the expression transformation variables include switching eyes (x), switching pupils (y), changing pupil color (z), pupil scaling (w), and displacement (t), a conventional atlas solution would require creating x... y z w With t types of textures, the number of textures increases exponentially for complex requirements. However, the embodiment of this application only requires creating x types of textures. 2 (eye socket and function maps) + y types of maps greatly improve the workload for artists and reduce the size of the package.
[0176] In addition to freely customizing the eye socket and eyeball effects, players can also configure the size of the eyeballs and the direction of observation according to their preferences. For example, to express shock, the eyeballs can be shrunk, or the eyeballs can be tilted upwards when in a normal state, and a shy expression can be expressed by combining them with a custom blush effect.
[0177] In theory, this method can achieve any facial expression effect without drawing a huge number of facial expression textures, providing a simplified production process for cartoon animation.
[0178] It is understood that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0179] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0180] According to another aspect of the embodiments of this application, a virtual expression generation apparatus for implementing the above-described virtual expression generation method is also provided. For example... Figure 13 As shown, the device includes:
[0181] The first acquisition module 1302 is used to acquire a first texture set and a second texture set, wherein the first texture set includes a pre-configured texture for representing a virtual eye socket of a target virtual object, and the second texture set includes a pre-configured texture for representing a virtual eyeball of the target virtual object;
[0182] The second acquisition module 1304 is used to acquire the first eye socket texture in the first texture set, acquire the first eyeball texture in the second texture set, and acquire the first display parameter, wherein the first display parameter is a display parameter used to display the virtual eyeball represented by the first eyeball texture in the virtual eye socket represented by the first eye socket texture;
[0183] The compositing module 1306 is used to compose the first eye socket texture and the first eyeball texture into a first virtual expression of the target virtual object according to the first display parameters.
[0184] As an alternative solution,
[0185] The device is further configured to: when the current virtual expression of the target virtual object is a virtual expression obtained by synthesizing the second eye socket texture from the first texture set and the second eyeball texture from the second texture set, obtain a target switching request;
[0186] The device is used to obtain a first eye socket texture from the first texture set and a first eyeball texture from the second texture set in the following manner: when the target switching request is used to request switching the virtual eyeball in the current virtual expression, the second eye socket texture is used as the first eye socket texture, and the first eyeball texture selected in the second texture set is obtained, wherein the first eyeball texture is different from the second eyeball texture.
[0187] As an alternative solution,
[0188] The device is further configured to acquire a target switching request when the current virtual expression of the target virtual object is a virtual expression obtained by synthesizing the second eye socket texture in the first texture set and the second eyeball texture in the second texture set;
[0189] The device is used to obtain a first eye socket texture from the first texture set and a first eyeball texture from the second texture set in the following manner: when the target switching request is used to request switching the virtual eye socket in the current virtual expression, the first eye socket texture selected in the first texture set is obtained, and the second eyeball texture is used as the first eyeball texture, wherein the first eye socket texture is different from the second eye socket texture.
[0190] As an alternative solution,
[0191] The device is further configured to: when the current virtual expression of the target virtual object is a virtual expression obtained by synthesizing the second eye socket texture from the first texture set and the second eyeball texture from the second texture set, obtain a target switching request;
[0192] The device is used to acquire a first eye socket texture from the first texture set and a first eyeball texture from the second texture set in the following manner: when the target switching request is used to request switching the virtual eye socket and virtual eyeball in the current virtual expression, the device acquires the first eye socket texture selected in the first texture set and the first eyeball texture selected in the second texture set, wherein the first eye socket texture is different from the second eye socket texture and the first eyeball texture is different from the second eyeball texture.
[0193] As an alternative solution,
[0194] The device is further configured to: when the current virtual expression of the target virtual object is a virtual expression obtained by synthesizing the second eye socket image in the first image set and the second eyeball image in the second image set according to the second display parameters, obtain a target switching request, wherein the second display parameters are display parameters for displaying the virtual eyeball represented by the second eyeball image in the virtual eye socket represented by the second eye socket image;
[0195] The device is used to obtain a first eye socket texture from the first texture set, obtain a first eyeball texture from the second texture set, and obtain a first display parameter in the following manner: when the target switching request is used to request switching the display parameter of the virtual eyeball in the current virtual expression, the second eye socket texture is used as the first eye socket texture, the second eyeball texture is used as the first eyeball texture, and the first display parameter is obtained, wherein the first display parameter is different from the second display parameter.
[0196] As an optional solution, the device is used to synthesize the first eye socket texture and the first eyeball texture into a first virtual expression of the target virtual object according to the first display parameters in the following manner:
[0197] If the first display parameter includes the eye socket range of the virtual eye socket represented by the first eye socket texture, the virtual eyeball represented by the first eyeball texture is added to the middle of the eye socket range to obtain the first expression texture to be used.
[0198] The first virtual emoticon is generated based on the first emoticon image.
[0199] As an optional solution, the device is used to generate the first virtual emoticon based on the first emoticon image in one of the following ways:
[0200] If the first display parameter also includes the eyeshadow area of the virtual eye socket represented by the first eye socket texture, the eyeshadow of the virtual eyeball represented by the first eyeball texture is added to the middle of the eyeshadow area in the first expression texture to obtain a second expression texture; the first virtual expression is generated according to the second expression texture.
[0201] If the first display parameter also includes the blinking position coordinates of the virtual eyeball represented by the first eyeball texture, the blinking point of the virtual eyeball represented by the first eyeball texture is added to the blinking position coordinates in the first expression texture to obtain a third expression texture; the first virtual expression is generated based on the third expression texture.
[0202] If the first display parameters also include the eyeshadow range of the virtual eye socket represented by the first eye socket texture and the blinking position coordinates of the virtual eyeball represented by the first eyeball texture, then the eyeshadow of the virtual eyeball represented by the first eyeball texture is added to the middle of the eyeshadow range in the first expression texture, and the blinking point of the virtual eyeball represented by the first eyeball texture is added to the blinking position coordinates to obtain the fourth expression texture; the first virtual expression is generated according to the fourth expression texture.
[0203] As an optional solution, the device is also used for:
[0204] After generating the first virtual expression based on the first expression texture, upon receiving a color update instruction, the color of the virtual eyeball represented by the first eyeball texture is modified according to the color update instruction to update the first virtual expression;
[0205] Upon receiving a scaling update instruction, the virtual eyeball represented by the first eyeball texture is scaled according to the scaling update instruction to update the first virtual expression;
[0206] Upon receiving a location update instruction, the display position of the virtual eyeball represented by the first eyeball texture inside the virtual eye socket is modified according to the location update instruction to update the first virtual expression.
[0207] As an optional solution, the device is used to acquire the first texture set and the second texture set in the following manner:
[0208] The various textures to be synthesized virtual expressions are classified to obtain multiple texture sets representing different expression types, wherein the multiple texture sets are stored in a database according to the different expression types;
[0209] In response to the expression type selection operation, the first image set and the second image set are obtained from the plurality of image sets respectively.
[0210] As an alternative solution,
[0211] The device is configured to acquire a first eye socket texture from the first texture set by: in response to the expression type selection operation, determining a first loading path for the first eye socket texture; and determining the first eye socket texture from the first texture set according to the first loading path.
[0212] The device is configured to acquire a first eyeball texture from the second texture set by: in response to the expression type selection operation, determining a second loading path for the first eyeball texture; and determining the first eyeball texture from the second texture set according to the second loading path.
[0213] As an optional solution, the device is also used for:
[0214] Obtain the object type of the virtual object to be configured;
[0215] If the object type indicates that the virtual object to be configured is controlled by the target account, the first virtual emoticon is configured to the virtual object to be configured.
[0216] When the object type indicates that the virtual object to be configured with the virtual emoticon is controlled by the server, the preset virtual emoticon is configured to the virtual object to be configured with the virtual emoticon.
[0217] According to one aspect of this application, a computer program product is provided, comprising a computer program / instructions containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via communication section 1409, and / or installed from removable medium 1411. When the computer program is executed by central processing unit 1401, it performs various functions provided in embodiments of this application.
[0218] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0219] Figure 14 A schematic block diagram of a computer system architecture for implementing an electronic device according to embodiments of the present application is shown.
[0220] It should be noted that, Figure 14 The computer system 1400 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0221] like Figure 14 As shown, the computer system 1400 includes a central processing unit (CPU) 1401, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1402 or programs loaded from storage section 1408 into random access memory (RAM) 1403. The RAM 1403 also stores various programs and data required for system operation. The CPU 1401, ROM 1402, and RAM 1403 are interconnected via a bus 1404. An input / output interface 1405 (i.e., I / O interface) is also connected to the bus 1404.
[0222] The following components are connected to the input / output interface 1405: an input section 1406 including a keyboard, mouse, etc.; an output section 1407 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1408 including a hard disk, etc.; and a communication section 1409 including a network interface card such as a local area network card, modem, etc. The communication section 1409 performs communication processing via a network such as the Internet. A drive 1140 is also connected to the input / output interface 1405 as needed. A removable medium 1411, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1140 as needed so that computer programs read from it can be installed into the storage section 1408 as needed.
[0223] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1409, and / or installed from removable medium 1411. When the computer program is executed by central processing unit 1401, it performs various functions defined in the system of this application.
[0224] According to another aspect of the embodiments of this application, an electronic device for implementing the above-described virtual expression generation method is also provided, the electronic device being... Figure 1 The terminal device or server shown. This embodiment uses this electronic device as an example for illustration. Figure 15 As shown, the electronic device includes a memory 1502 and a processor 1504. The memory 1502 stores a computer program, and the processor 1504 is configured to execute the steps of any of the above method embodiments via the computer program.
[0225] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.
[0226] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0227] S1, obtain a first texture set and a second texture set, wherein the first texture set includes a pre-configured texture for representing the virtual eye socket of the target virtual object, and the second texture set includes a pre-configured texture for representing the virtual eyeball of the target virtual object;
[0228] S2, obtain the first eye socket texture from the first texture set, obtain the first eyeball texture from the second texture set, and obtain the first display parameter, wherein the first display parameter is a display parameter used to display the virtual eyeball represented by the first eyeball texture in the virtual eye socket represented by the first eye socket texture;
[0229] S3, based on the first display parameters, combine the first eye socket texture and the first eyeball texture to form the first virtual expression of the target virtual object.
[0230] Alternatively, as those skilled in the art will understand, Figure 15 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, PDAs, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 15 This does not limit the structure of the aforementioned electronic devices or electronic equipment. For example, electronic devices or electronic equipment may also include components that are more... Figure 15 The more or fewer components shown (such as network interfaces, etc.), or having the same Figure 15 The different configurations shown.
[0231] The memory 1502 can be used to store software programs and modules, such as the program instructions / modules corresponding to the virtual expression generation method and apparatus in this embodiment. The processor 1504 executes various functional applications and data processing by running the software programs and modules stored in the memory 1502, thereby realizing the aforementioned virtual expression generation method. The memory 1502 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1502 may further include memory remotely located relative to the processor 1504, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Specifically, the memory 1502 may be used, but is not limited to, to store information such as virtual expressions. As an example, such as... Figure 15 As shown, the memory 1502 may include, but is not limited to, the first acquisition module 1302, the second acquisition module 1304, and the synthesis module 1306 of the virtual expression generation device. Furthermore, it may include, but is not limited to, other module units of the virtual expression generation device, which will not be elaborated upon in this example.
[0232] Optionally, the transmission device 1506 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 1506 includes a Network Interface Controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 1506 is a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0233] In addition, the aforementioned electronic device also includes: a display 1508 for displaying the aforementioned virtual expressions; and a connection bus 1510 for connecting the various module components in the aforementioned electronic device.
[0234] In other embodiments, the aforementioned terminal device or server can be a node in a distributed system, wherein the distributed system can be a blockchain system, which is a distributed system formed by connecting multiple nodes through network communication. The nodes can form a peer-to-peer (P2P) network, and any form of computing device, such as a server, terminal, or other electronic device, can become a node in the blockchain system by joining this peer-to-peer network.
[0235] According to one aspect of this application, a computer-readable storage medium is provided, from which a processor of a computer device reads computer instructions, and the processor executes the computer instructions, causing the computer device to perform the virtual expression generation method provided in various alternative implementations of the virtual expression generation aspect described above.
[0236] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0237] S1, obtain a first texture set and a second texture set, wherein the first texture set includes a pre-configured texture for representing the virtual eye socket of the target virtual object, and the second texture set includes a pre-configured texture for representing the virtual eyeball of the target virtual object;
[0238] S2, obtain the first eye socket texture from the first texture set, obtain the first eyeball texture from the second texture set, and obtain the first display parameter, wherein the first display parameter is a display parameter used to display the virtual eyeball represented by the first eyeball texture in the virtual eye socket represented by the first eye socket texture;
[0239] S3, based on the first display parameters, combine the first eye socket texture and the first eyeball texture to form the first virtual expression of the target virtual object.
[0240] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0241] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0242] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0243] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0244] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.
[0245] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0246] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0247] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for generating virtual emoticons, characterized in that, include: Obtain a first texture set and a second texture set, wherein the first texture set includes a pre-configured texture for representing the virtual eye socket of the target virtual object, and the second texture set includes a pre-configured texture for representing the virtual eyeball of the target virtual object; Obtain the first eye socket texture from the first texture set, obtain the first eyeball texture from the second texture set, and obtain the first display parameter. The first display parameter is a display parameter used to display the virtual eyeball represented by the first eyeball texture in the virtual eye socket represented by the first eye socket texture. The functional texture corresponding to the first eye socket texture is used as the first display parameter. The functional texture includes three RGB channels: the R channel records the eye socket range of the first eye socket texture, the G channel records the eyeshadow range of the first eye socket texture, and the B channel records the highlight flicker point range corresponding to the first eye socket texture. Based on the first display parameters, the first eye socket texture and the first eyeball texture are combined to form the first virtual expression of the target virtual object.
2. The method according to claim 1, characterized in that, The method further includes: when the current virtual expression of the target virtual object is a virtual expression obtained by synthesizing the second eye socket texture from the first texture set and the second eyeball texture from the second texture set, obtaining a target switching request; The step of obtaining the first eye socket texture from the first texture set and obtaining the first eyeball texture from the second texture set includes: when the target switching request is used to request switching the virtual eyeball in the current virtual expression, using the second eye socket texture as the first eye socket texture, and obtaining the first eyeball texture selected in the second texture set, wherein the first eyeball texture is different from the second eyeball texture.
3. The method according to claim 1, characterized in that, The method further includes: when the current virtual expression of the target virtual object is a virtual expression obtained by synthesizing the second eye socket texture from the first texture set and the second eyeball texture from the second texture set, obtaining a target switching request; The step of obtaining the first eye socket texture from the first texture set and obtaining the first eyeball texture from the second texture set includes: when the target switching request is used to request switching the virtual eye socket in the current virtual expression, obtaining the first eye socket texture selected in the first texture set, and using the second eyeball texture as the first eyeball texture, wherein the first eye socket texture and the second eye socket texture are different.
4. The method according to claim 1, characterized in that, The method further includes: when the current virtual expression of the target virtual object is a virtual expression obtained by synthesizing the second eye socket texture from the first texture set and the second eyeball texture from the second texture set, obtaining a target switching request; The step of obtaining the first eye socket texture from the first texture set and obtaining the first eyeball texture from the second texture set includes: when the target switching request is used to request switching the virtual eye socket and virtual eyeball in the current virtual expression, obtaining the first eye socket texture selected in the first texture set and obtaining the first eyeball texture selected in the second texture set, wherein the first eye socket texture is different from the second eye socket texture and the first eyeball texture is different from the second eyeball texture.
5. The method according to claim 1, characterized in that, The method further includes: when the current virtual expression of the target virtual object is a virtual expression obtained by synthesizing the second eye socket image in the first image set and the second eyeball image in the second image set according to the second display parameter, obtaining a target switching request, wherein the second display parameter is a display parameter for displaying the virtual eyeball represented by the second eyeball image in the virtual eye socket represented by the second eye socket image; The step of obtaining the first eye socket texture from the first texture set, obtaining the first eyeball texture from the second texture set, and obtaining the first display parameter includes: when the target switching request is used to request switching the display parameters of the virtual eyeball in the current virtual expression, using the second eye socket texture as the first eye socket texture, using the second eyeball texture as the first eyeball texture, and obtaining the first display parameter, wherein the first display parameter is different from the second display parameter.
6. The method according to claim 1, characterized in that, The step of combining the first eye socket texture and the first eyeball texture into the first virtual expression of the target virtual object according to the first display parameters includes: If the first display parameter includes the eye socket range of the virtual eye socket represented by the first eye socket texture, the virtual eyeball represented by the first eyeball texture is added to the middle of the eye socket range to obtain the first expression texture to be used. The first virtual emoticon is generated based on the first emoticon image.
7. The method according to claim 6, characterized in that, The step of generating the first virtual emoticon based on the first emoticon image includes one of the following: If the first display parameter also includes the eyeshadow area of the virtual eye socket represented by the first eye socket texture, the eyeshadow of the virtual eyeball represented by the first eyeball texture is added to the middle of the eyeshadow area in the first expression texture to obtain a second expression texture; the first virtual expression is generated based on the second expression texture; If the first display parameter also includes the blinking position coordinates of the virtual eyeball represented by the first eyeball texture, the blinking point of the virtual eyeball represented by the first eyeball texture is added to the blinking position coordinates in the first expression texture to obtain a third expression texture; the first virtual expression is generated based on the third expression texture. If the first display parameters also include the eyeshadow range of the virtual eye socket represented by the first eye socket texture and the blinking position coordinates of the virtual eyeball represented by the first eyeball texture, then in the first expression texture, the eyeshadow of the virtual eyeball represented by the first eyeball texture is added to the middle of the eyeshadow range, and the blinking point of the virtual eyeball represented by the first eyeball texture is added to the blinking position coordinates to obtain a fourth expression texture; the first virtual expression is generated according to the fourth expression texture.
8. The method according to claim 6, characterized in that, After generating the first virtual emoticon based on the first emoticon image, the method further includes: Upon receiving a color update instruction, the color of the virtual eye represented by the first eyeball texture is modified according to the color update instruction to update the first virtual expression; Upon receiving a scaling update instruction, the virtual eyeball represented by the first eyeball texture is scaled according to the scaling update instruction to update the first virtual expression; Upon receiving a location update instruction, the display position of the virtual eyeball represented by the first eyeball texture inside the virtual eye socket is modified according to the location update instruction to update the first virtual expression.
9. The method according to any one of claims 1 to 8, characterized in that, The process of obtaining the first texture set and the second texture set includes: The various textures to be synthesized virtual expressions are classified to obtain multiple texture sets representing different expression types, wherein the multiple texture sets are stored in a database according to the different expression types; In response to the expression type selection operation, the first image set and the second image set are obtained from the plurality of image sets respectively.
10. The method according to claim 9, characterized in that, The step of obtaining the first eye socket texture from the first texture set includes: in response to the expression type selection operation, determining the first loading path of the first eye socket texture; and determining the first eye socket texture from the first texture set according to the first loading path. The step of obtaining the first eyeball texture from the second texture set includes: in response to the expression type selection operation, determining a second loading path for the first eyeball texture; and determining the first eyeball texture from the second texture set according to the second loading path.
11. The method according to any one of claims 1 to 8, characterized in that, The method further includes: Obtain the object type of the virtual object to be configured; If the object type indicates that the virtual object to be configured is controlled by the target account, the first virtual emoticon is configured to the virtual object to be configured. When the object type indicates that the virtual object to be configured is controlled by the server, the preset virtual emoticon is configured to the virtual object to be configured.
12. A device for generating virtual facial expressions, characterized in that, include: The first acquisition module is used to acquire a first texture set and a second texture set, wherein the first texture set includes a pre-configured texture for representing the virtual eye socket of the target virtual object, and the second texture set includes a pre-configured texture for representing the virtual eyeball of the target virtual object; The second acquisition module is used to acquire the first eye socket texture from the first texture set, acquire the first eyeball texture from the second texture set, and acquire the first display parameter. The first display parameter is used to display the virtual eyeball represented by the first eyeball texture in the virtual eye socket represented by the first eye socket texture. The functional texture corresponding to the first eye socket texture is used as the first display parameter. The functional texture includes three RGB channels: the R channel records the eye socket range of the first eye socket texture, the G channel records the eyeshadow range of the first eye socket texture, and the B channel records the highlight flashing point range corresponding to the first eye socket texture. The compositing module is used to combine the first eye socket texture and the first eyeball texture into a first virtual expression of the target virtual object according to the first display parameters.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program can be executed by a terminal device or computer at runtime as described in any one of claims 1 to 11.
14. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method described in any one of claims 1 to 11.
15. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 11 through the computer program.