Special effect processing method and device in virtual character extraction
Patent Information
- Application Number
- CN202211022025.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-24
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2042-08-24
AI Technical Summary
[0004]但是,虚拟角色抽取中的特效展示存在占用内存大,展示不够流畅的问题
[0073]在用户进行虚拟角色抽取过程中,对获取到的用于生成虚拟特效和虚拟角色模型的模型资源、特效资源、模型贴图按终端设备的设备参数进行压缩优化,在保证显示效果的前提下,提高了终端设备对特效的处理速度,从而提高了虚拟特效和虚拟角色模型显示的流畅度。
Smart Images

Figure CN115344390B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a method and apparatus for special effects processing in virtual character extraction. Background Technology
[0002] Many automakers introduce their own branded virtual avatars into their in-vehicle infotainment systems. These avatars interact with users, enriching the human-vehicle interaction and providing a better driving experience. However, most automakers offer a limited variety of virtual avatars, which are often acquired through system initialization and lack genuine human-virtual interaction.
[0003] Currently, some car manufacturers have launched multiple series of virtual character images based on their own brand definitions. Users can draw virtual characters by opening blind boxes. Each blind box corresponds to a series of virtual character images. When a user opens a blind box by consuming points, a character acquisition request is sent to the system. The system determines the target character from multiple characters through a set probability calculation, and then displays virtual special effects of the blind box opening process. After the virtual special effects are displayed, a three-dimensional virtual character is displayed.
[0004] However, the special effects display in virtual character extraction suffers from problems such as large memory consumption and insufficient display smoothness. Summary of the Invention
[0005] The purpose of this application is to at least solve one of the aforementioned technical defects. The technical solution provided by the embodiments of this application is as follows:
[0006] In a first aspect, embodiments of this application provide a method for processing special effects during virtual character extraction, including:
[0007] Obtain the corresponding model resources, special effects resources, model textures, and special effects textures for the virtual character;
[0008] Based on the device information of the terminal device used by the user to extract virtual characters, the model textures, effect textures and model resources are compressed to obtain compressed model textures, compressed effect textures and compressed model resources.
[0009] When a user sends a trigger operation targeting a series of virtual characters, the system extracts and displays special effects based on the compressed model textures, compressed effect textures, compressed model resources, and effect resources.
[0010] After identifying the target virtual character from the virtual character models corresponding to the target virtual character series, push and display the virtual character model corresponding to the target virtual character.
[0011] In one optional embodiment of this application, the method further includes:
[0012] Upon receiving a user's trigger operation targeting a specific virtual character series, the system preloads the models of each virtual character corresponding to the target virtual character series based on the compressed model textures and compressed model resources.
[0013] In one optional embodiment of this application, based on the device information of the terminal device used by the user to extract virtual characters, the model textures, effect textures, and model resources are compressed, including:
[0014] Based on the device information, obtain the corresponding display parameters and graphics processor (GPU) parameters, determine the corresponding texture size threshold based on the display parameters, and determine the corresponding model vertex number threshold based on the GPU parameters;
[0015] Compress the size of the model textures and the size of the effect textures to within the texture size threshold, and compress the number of vertices of each model in the model resources to within the number of model vertices threshold.
[0016] In one optional embodiment of this application, determining the corresponding texture size threshold based on display parameters includes:
[0017] Based on the display parameters, obtain the display height of the terminal device's display device and the proportion of the corresponding virtual character model in the height direction of the display device;
[0018] Determine the initial texture size threshold based on the display height and percentage;
[0019] The initial texture size threshold is converted into a power of 2 to obtain the corresponding texture size threshold.
[0020] In one optional embodiment of this application, the model resources include dynamic model resources and static model resources, and the method further includes:
[0021] For a given scenario, the static model resources in the compressed model resources corresponding to the given scenario are batched together to obtain batched static model resources. The model textures corresponding to the batched static model resources are then batched together to obtain batched model textures.
[0022] The effects are extracted and displayed based on the compressed model textures, compressed effect textures, compressed model resources, and effect resources, including:
[0023] For a given scene, effects are extracted and displayed based on compressed effect textures, effect resources, batched static models, and batched model textures.
[0024] In one optional embodiment of this application, the static model resources in the compressed model resources corresponding to a specified scene are batch-processed to obtain batched static model resources, and the model textures corresponding to the batched static model resources are batch-processed to obtain batched model textures, including:
[0025] Export each static model resource as a single static model to obtain the batched static model resources. Export the model textures corresponding to each static model as a single model texture to obtain the batched model textures.
[0026] In one optional embodiment of this application, the compressed model texture map includes a skeletal animation texture map, and the method further includes:
[0027] The pre-baked skeletal animation system presamples and bakes skeletal animation textures at a specified frame rate into a globally reusable skeletal animation texture collection.
[0028] The effects are extracted and displayed based on the compressed model textures, compressed effect textures, compressed model resources, and effect resources, including:
[0029] Based on the compressed model textures, compressed effect textures, compressed model resources, effect resources, and skeletal animation texture collection, special effects are extracted and displayed.
[0030] In one optional embodiment of this application, the method further includes:
[0031] The special effects resources were optimized by writing node animations to obtain optimized special effects resources;
[0032] The effects are extracted and displayed based on the compressed model textures, compressed effect textures, compressed model resources, and effect resources, including:
[0033] Based on the compressed model textures, compressed effect textures, compressed model resources, and optimized effect resources, the effect display is extracted.
[0034] In one optional embodiment of this application, a method of writing node animations is used to optimize the special effects resources, resulting in optimized special effects resources, including:
[0035] The optimized special effects resource is obtained by modifying the node coordinates of special effects elements in the special effects resource through displacement, and by changing the color and opacity of the nodes in the special effects element to achieve a gradient effect; or
[0036] The optimized special effects resource is obtained by modifying the UV parameters of the vertex shader and the color of the fragment shader corresponding to the special effects resource.
[0037] Secondly, embodiments of this application provide a special effects processing device for virtual character extraction, including:
[0038] The resource acquisition module is used to acquire the corresponding model resources, special effects resources, model textures, and special effects textures for virtual characters.
[0039] The resource optimization module is used to compress model textures, effect textures, and model resources based on the device information of the terminal device used by the user to extract virtual characters, resulting in compressed model textures, compressed effect textures, and compressed model resources.
[0040] The special effects display module is used to extract and display special effects based on compressed model textures, compressed special effects textures, compressed model resources, and special effects resources when it receives a trigger operation from the user targeting a series of virtual characters.
[0041] The virtual character display module is used to push and display the virtual character model corresponding to the target virtual character after determining the target virtual character from the virtual character models corresponding to the target virtual character series.
[0042] In one optional embodiment of this application, the device further includes a character model preloading module, used for:
[0043] Upon receiving a user's trigger operation targeting a specific virtual character series, the system preloads the models of each virtual character corresponding to the target virtual character series based on the compressed model textures and compressed model resources.
[0044] In one optional embodiment of this application, the resource optimization module is specifically used for:
[0045] Based on the device information, obtain the corresponding display parameters and graphics processor (GPU) parameters, determine the corresponding texture size threshold based on the display parameters, and determine the corresponding model vertex number threshold based on the GPU parameters;
[0046] Compress the size of the model textures and the size of the effect textures to within the texture size threshold, and compress the number of vertices of each model in the model resources to within the number of model vertices threshold.
[0047] In an optional embodiment of this application, the resource optimization module is further configured to:
[0048] Based on the display parameters, obtain the display height of the terminal device's display device and the proportion of the corresponding virtual character model in the height direction of the display device;
[0049] Determine the initial texture size threshold based on the display height and percentage;
[0050] The initial texture size threshold is converted into a power of 2 to obtain the corresponding texture size threshold.
[0051] In one optional embodiment of this application, the model resources include dynamic model resources and static model resources, and the apparatus further includes a batching module for:
[0052] For a given scenario, the static model resources in the compressed model resources corresponding to the given scenario are batched together to obtain batched static model resources. The model textures corresponding to the batched static model resources are then batched together to obtain batched model textures.
[0053] The special effects display module is specifically used for:
[0054] For a given scene, effects are extracted and displayed based on compressed effect textures, effect resources, batched static models, and batched model textures.
[0055] In one optional embodiment of this application, the batching module is specifically used for:
[0056] Export each static model resource as a single static model to obtain the batched static model resources. Export the model textures corresponding to each static model as a single model texture to obtain the batched model textures.
[0057] In one optional embodiment of this application, the compressed model texture map includes a skeletal animation texture map, and the apparatus further includes a skeletal animation texture map baking module for:
[0058] The pre-baked skeletal animation system presamples and bakes skeletal animation textures at a specified frame rate into a globally reusable skeletal animation texture collection.
[0059] The special effects display module is specifically used for:
[0060] Based on the compressed model textures, compressed effect textures, compressed model resources, effect resources, and skeletal animation texture collection, special effects are extracted and displayed.
[0061] In one optional embodiment of this application, the device further includes a special effects resource optimization module, used for:
[0062] The special effects resources were optimized by writing node animations to obtain optimized special effects resources;
[0063] The special effects display module is specifically used for:
[0064] Based on the compressed model textures, compressed effect textures, compressed model resources, and optimized effect resources, the effect display is extracted.
[0065] In one optional embodiment of this application, the special effects resource optimization module is specifically used for:
[0066] The optimized special effects resource is obtained by modifying the node coordinates of special effects elements in the special effects resource through displacement, and by changing the color and opacity of the nodes in the special effects element to achieve a gradient effect; or
[0067] The optimized special effects resource is obtained by modifying the UV parameters of the vertex shader and the color of the fragment shader corresponding to the special effects resource.
[0068] Thirdly, embodiments of this application provide a network device, including a memory and a processor;
[0069] The memory contains computer programs;
[0070] A processor for executing computer programs to implement the methods provided in the first aspect embodiment or any alternative embodiment of the first aspect.
[0071] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method provided in the first aspect embodiment or any optional embodiment of the first aspect.
[0072] The beneficial effects of the technical solution provided in this application are:
[0073] During the process of extracting virtual characters, the model resources, effect resources, and model textures obtained for generating virtual effects and virtual character models are compressed and optimized according to the device parameters of the terminal device. While ensuring the display effect, the processing speed of the terminal device for effects is improved, thereby improving the smoothness of the display of virtual effects and virtual character models. Attached Figure Description
[0074] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.
[0075] Figure 1 A flowchart illustrating a special effects processing method for virtual character extraction provided in this application embodiment;
[0076] Figure 2 This is a schematic diagram of a virtual character extraction interface in one example of an embodiment of this application;
[0077] Figure 3 This is a schematic diagram illustrating a method for optimizing special effects resources by writing node animations, as an example of an embodiment of this application.
[0078] Figure 4 This is a schematic diagram illustrating another method for optimizing special effects resources by writing node animations, as an example of an embodiment of this application.
[0079] Figure 5 This is a flowchart illustrating a special effects processing method for extracting virtual characters in an in-vehicle infotainment system, as shown in an example of an embodiment of this application.
[0080] Figure 6 This application provides a structural block diagram of a special effects processing device for virtual character extraction;
[0081] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0082] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0083] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this application means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any units and all combinations of one or more associated listed items.
[0084] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0085] Figure 1 A flowchart illustrating a special effects processing method for virtual character extraction provided in this application embodiment is shown below. Figure 1 As shown, the method may include:
[0086] Step S101: Obtain the corresponding model resources, special effects resources, model textures, and special effects textures for the virtual character.
[0087] It should be noted that the subject executing this method can be a terminal device that extracts virtual characters, such as an in-vehicle infotainment system, a mobile phone, or a tablet computer. This application uses an in-vehicle infotainment system as an example for illustration.
[0088] The model resources include virtual character models, prop models, costume models, and 3D blind box models. Different models correspond to different model textures. The textures corresponding to the special effects resources are called special effects textures.
[0089] Specifically, when a user extracts a virtual character, it's necessary to display corresponding special effects and the extracted virtual character model. Therefore, the first step is to acquire the model resources, effect resources, and corresponding textures used to generate the special effects and virtual character model. In other words, an art resource library needs to be built, including: blind boxes, 3D art resources for the virtual character, and art resources for the virtual special effects, etc.
[0090] Step S102: Based on the device information of the terminal device used by the user to extract the virtual character, the model texture, effect texture and model resources are compressed to obtain compressed model texture, compressed effect texture and compressed model resources.
[0091] The device information of the terminal device may include display parameters (such as resolution) and processing performance parameters (such as CPU (Central Processing Unit) performance parameters).
[0092] Specifically, to ensure the smooth display of virtual characters and virtual effects, the aforementioned art resources can be optimized. Specifically, based on the device information of the terminal device used by the user to extract the virtual character, model textures, effect textures, and model resources can be compressed so that the compressed model textures, effect textures, and model resources match the device parameters of the terminal device.
[0093] Step S103: Upon receiving a trigger operation from the user targeting the virtual character series, extract special effects display based on the compressed model textures, compressed special effects textures, compressed model resources, and special effects resources.
[0094] When a user draws a virtual character, the drawing page displays multiple virtual character series for the user to choose from. The user can select a specific virtual character series by clicking on it, thus designating that series as the target virtual character series. It's understood that the user's trigger action for the target virtual character series can be the aforementioned "click action," a corresponding voice control action, or a corresponding text control action. For example, such as... Figure 2As shown, a virtual character retrieval page in a car infotainment system is provided. The page contains four virtual character series: "Series One", "Series Two", "Series Three" and "Series Four". Each series corresponds to a "Magic Box". When the Magic Box is clicked for the first time, the corresponding "Ten-Pull (i.e., open ten times in a row)" and "Open" buttons will be displayed. The user can then click the "Ten-Pull" or "Open" button to trigger an operation for the target virtual character series.
[0095] Specifically, when a user issues a trigger action targeting a series of virtual characters, that is, the user determines to extract a target virtual character from the corresponding series. Subsequently, special effects need to be displayed, followed by the extraction of the target virtual character. Therefore, when the user issues the trigger action targeting the series of virtual characters, the extraction effect is displayed simultaneously. For example... Figure 2 In the example, when a user clicks the "Open" button corresponding to "Series One", "Series One" is selected as the target virtual character series. This means that the user has issued a trigger operation for "Series One", and at this time, the virtual special effect of opening the blind box corresponding to "Series One" will be displayed simultaneously.
[0096] Step S104: After determining the target virtual character from each virtual character model corresponding to the target virtual character series, push and display the virtual character model corresponding to the target virtual character.
[0097] Specifically, after determining the target virtual character from the virtual character models corresponding to the target virtual character series, the virtual character model corresponding to the target virtual character is obtained and displayed.
[0098] The solution provided in this application compresses and optimizes the model resources, effect resources, and model textures obtained for generating virtual effects and virtual character models according to the device parameters of the terminal device during the user's virtual character extraction process. While ensuring the display effect, it improves the processing speed of the terminal device for effects, thereby improving the smoothness of the display of virtual effects and virtual character models.
[0099] In one optional embodiment of this application, the method may further include:
[0100] Upon receiving a user's trigger operation targeting a specific virtual character series, the system preloads the models of each virtual character corresponding to the target virtual character series based on the compressed model textures and compressed model resources.
[0101] Specifically, after displaying the extraction effects, the target virtual character model extracted by the user needs to be further displayed. To ensure smooth display, this embodiment preloads the virtual character models of each virtual character in the target virtual character series. In other words, before determining the target virtual character from the series, the virtual character models of each virtual character are pre-obtained based on the compressed model textures and compressed model resources. The advantage of this is that after determining the target virtual character, the corresponding virtual character model can be directly obtained, saving the time of loading the model and further ensuring the smoothness of the virtual character model display.
[0102] In one optional embodiment of this application, based on the device information of the terminal device used by the user to extract virtual characters, the model textures, effect textures, and model resources are compressed, including:
[0103] Based on the device information, obtain the corresponding display parameters and graphics processing unit (GPU) parameters, determine the corresponding texture size threshold based on the display parameters, and determine the corresponding model vertex number threshold based on the GPU parameters;
[0104] Compress the size of the model textures and the size of the effect textures to within the texture size threshold, and compress the number of vertices of each model in the model resources to within the number of model vertices threshold.
[0105] Specifically, before compressing textures and model resources, the compression target must first be determined. This compression target needs to be compatible with the device parameters of the terminal device; therefore, the compression target needs to be determined based on the device parameters.
[0106] Specifically, based on the device information, the corresponding display parameters and graphics processor (GPU) parameters are obtained, and based on the display parameters, the corresponding texture size threshold is determined, and based on the GPU parameters, the corresponding model vertex count threshold is determined.
[0107] In one optional embodiment of this application, determining the corresponding texture size threshold based on display parameters includes:
[0108] Based on the display parameters, obtain the display height of the terminal device's display device and the proportion of the corresponding virtual character model in the height direction of the display device;
[0109] Determine the initial texture size threshold based on the display height and percentage;
[0110] The initial texture size threshold is converted into a power of 2 to obtain the corresponding texture size threshold.
[0111] Specifically, for in-vehicle infotainment systems, the calculation of texture compression targets is primarily determined based on the screen resolution. The in-vehicle screen parameters corresponding to the vehicle model are obtained based on the VIN. First, the screen height is set to h. Then, according to the in-vehicle system design specifications, the HMI (Human Machine Interaction) file for the in-vehicle application is output. From this file, the proportion of the character model in the screen height direction is determined as r, and the compression target is determined as h × r (i.e., the initial texture size threshold). Texture compression is performed using a high-performance power of two (PoT) algorithm, requiring values that are powers of 2. Since the result is not necessarily an integer, it is rounded up to obtain the power:
[0112] n = ceil(Log2(h×r))
[0113] Here, ceil() performs an up rounding operation on the number within the parentheses.
[0114] However, since rounding up to the power of n might result in a value much larger than h, we can round down to the power of n-1 to get as close to h as possible. Therefore, we substitute this value into the formula:
[0115] abs(pow(2,n)-h)–abs(h-pow(2,n-1))
[0116] Among them, abs() performs the absolute value operation on the number inside the parentheses, and pow(2,n-1) performs the operation of taking the n-1 power of 2.
[0117] If the value of the above formula is greater than 0, then the power of n-1 is closer to h; if the value is less than 0, then the value of n is closer to the height h. For example, considering a car infotainment system with a screen height of 756px, the character model occupies 2 / 3 of the screen's upper edge. Substituting this into the formula, we get a power of n of 9, which is closer to the height of 756×2 / 3 than a power of 8. Therefore, we use a texture size of pow(2,9) = 512 as the target texture compression size, meaning the texture size needs to be controlled within 512px×512px (i.e., the corresponding texture size threshold).
[0118] In addition, the goal of model resource compression is to control the number of vertices in the model. Generally speaking, when a GPU performs rendering operations, the more vertices there are, the more calculations are performed, and the higher the performance cost. Therefore, the main method for compressing virtual character model resources is to reduce the number of vertices in the model as much as possible.
[0119] Once the compression target is determined, texture and model resources can be compressed. Specifically, texture compression can use ASTC (Adaptive Scalable Texture Compression). ASTC can compress input images of various common formats and output the image at any bit rate selected by the user. Therefore, ASTC is used to compress texture resources to the compression target value (i.e., texture size threshold) corresponding to the resolution of the vehicle's infotainment screen.
[0120] Compression of model resources mainly involves controlling the number of vertices in the model. Currently, the main approach is to optimize the model during its creation. This involves combining practical needs with the necessary artistic effects to eliminate as many vertices as possible that will not result in faces, and reducing the number of vertices in non-detail areas. For example, the number of vertices in the model can be controlled to within tens of thousands.
[0121] In one optional embodiment of this application, the model resources include dynamic model resources and static model resources, and the method may further include:
[0122] For a given scenario, the static model resources in the compressed model resources corresponding to the given scenario are batched together to obtain batched static model resources. The model textures corresponding to the batched static model resources are then batched together to obtain batched model textures.
[0123] The effects are extracted and displayed based on the compressed model textures, compressed effect textures, compressed model resources, and effect resources, including:
[0124] For a given scene, effects are extracted and displayed based on compressed effect textures, effect resources, batched static models, and batched model textures.
[0125] Furthermore, the static model resources in the compressed model resources corresponding to the specified scene are batch-processed to obtain batched static model resources, and the model textures corresponding to the batched static model resources are batch-processed to obtain batched model textures, including:
[0126] Export each static model resource as a single static model to obtain the batched static model resources. Export the model textures corresponding to each static model as a single model texture to obtain the batched model textures.
[0127] Specifically, model batching mainly targets the batching of static model resources for a fixed scene (i.e., a specified scene). In essence, when creating model resources, all small objects (corresponding to static models) rendering that fixed scene are exported as a single model, and the textures corresponding to these static models are batched onto a single texture. This reduces rendering draw calls, thereby reducing rendering time and improving smoothness. A draw call is a drawing operation, a CPU call to the underlying graphics drawing interface, instructing the GPU to perform rendering operations.
[0128] For example, when creating a model for a specific scene, there might be model resources for multiple small objects. Rendering the scene would require rendering each small object's static model individually. Static batching of scene models, however, involves exporting all resources belonging to the scene's static models into a single model and batching all its textures. This allows for a single overall rendering of the scene, reducing draw call consumption.
[0129] Therefore, when obtaining virtual effects in a specified scene, it is only necessary to render the specified scene based on the batched static model and the batched model texture, and then extract the effects for display based on the compressed effect texture and effect resources.
[0130] In one optional embodiment of this application, the compressed model texture map includes a skeletal animation texture map, and the method may further include:
[0131] The pre-baked skeletal animation system presamples and bakes skeletal animation textures at a specified frame rate into a globally reusable skeletal animation texture collection.
[0132] The effects are extracted and displayed based on the compressed model textures, compressed effect textures, compressed model resources, and effect resources, including:
[0133] Based on the compressed model textures, compressed effect textures, compressed model resources, effect resources, and skeletal animation texture collection, special effects are extracted and displayed.
[0134] Specifically, this pre-baked skeletal animation system pre-samples and bakes all animation data (i.e. skeletal animation textures) onto a globally reused skeletal animation texture set at a specified frame rate. Compared to baking multiple single skeletal animation textures, this method consumes fewer draw calls, thereby reducing rendering time and improving smoothness.
[0135] For example, when creating facial animations for a virtual character, taking the actions of opening and closing the mouth as an example, each time the mouth opens and closes, a new skeletal animation map needs to be baked. Each loop of the animation consumes one draw call. However, by pre-sampling the skeletal animation and baking it onto a global skeletal animation map collection, the corresponding skeletal animation map in the global skeletal animation map collection can be reused every time the virtual character performs the action of opening and closing the mouth. This eliminates the need to bake the same skeletal animation map multiple times, thereby reducing the consumption of draw calls.
[0136] In one optional embodiment of this application, the method may further include:
[0137] The special effects resources were optimized by writing node animations to obtain optimized special effects resources;
[0138] The effects are extracted and displayed based on the compressed model textures, compressed effect textures, compressed model resources, and effect resources, including:
[0139] Based on the compressed model textures, compressed effect textures, compressed model resources, and optimized effect resources, the effect display is extracted.
[0140] Specifically, traditional methods of creating special effects assets typically use particle effects. However, since batching particles consumes performance, node animations can be used to achieve a similar effect to particle effects in order to display smooth effects on terminal devices. In other words, optimizing special effects assets by writing node animations yields optimized special effects assets.
[0141] In one optional embodiment of this application, a method of writing node animations is used to optimize the special effects resources, resulting in optimized special effects resources, including:
[0142] The optimized special effects resource is obtained by modifying the node coordinates of special effects elements in the special effects resource through displacement, and by changing the color and opacity of the nodes in the special effects element to achieve a gradient effect; or
[0143] The optimized special effects resource is obtained by modifying the UV parameters of the vertex shader and the color of the fragment shader corresponding to the special effects resource.
[0144] UV stands for U and V texture map coordinates, which refer to the texture map coordinates of the model. U represents the distribution on the horizontal coordinate and V represents the distribution on the vertical coordinate. Adjusting the UV parameters refers to adjusting the UV coordinate ratio.
[0145] Specifically, this application provides two methods for optimizing special effects resources:
[0146] Method (1) modifies node coordinates by displacement and achieves element gradient effects by modifying node opacity and color, for example, as shown in the image. Figure 3 As shown, when the blind box is opened, the effect of clouds dispersing is achieved by modifying the position of each cloud node and its corresponding transparency.
[0147] Method (2) achieves special effects by modifying the UV of the vertex shader and the color of the fragment shader, for example, as shown in the image. Figure 4 As shown, when creating the flame unboxing effect, the image on the left is used as the texture for the flame effect. The UV parameters of this image are adjusted using a shader to continuously move it upwards along the y-axis. The transparency of the middle image is then overlaid to cover the upper half of the texture. Covering the upper half of the texture makes it more like a flame. The left side is the global texture. After overlaying the transparency of the middle image (black areas are hidden, white areas are displayed), the flame texture on the right is formed. The fragment shader's color is adjusted. Since the left texture is black and white, it needs to be modified to red or a gradient to more closely resemble the flame effect, thus achieving the effect of the image on the right. This method is more cost-effective than particle effects.
[0148] Furthermore, node animations can be written using either method (1) or method (2). The animation method used for the special effects when opening the blind box can be bound to the virtual character in the blind box. For example, different quality virtual characters have different animation methods. For instance, low-quality virtual characters use method (1), while high-quality virtual characters use method (2), giving users a psychological surprise experience when opening the blind box and seeing the virtual character. The animation method used for the special effects when opening the blind box can also be bound to the vehicle screen parameters corresponding to the vehicle identification number. For vehicle screens with higher GPU / CPU performance, method (2) is used, and vice versa.
[0149] The following example further illustrates the solution provided in the embodiments of this application, such as... Figure 5 As shown, the method for processing special effects during the extraction of virtual characters in in-vehicle infotainment systems can include the following steps:
[0150] (1) Build an art resource library, including: 3D (three-dimensional) model resources, special effects textures, etc.;
[0151] (2) Determine the texture compression target and model compression target based on the vehicle's resolution;
[0152] (3) Compress the texture and model resources according to the texture target and model compression target respectively;
[0153] (4) Combined model resources and pre-baked skeletal animations;
[0154] (5) Optimize special effects resources through displacement, gradation, and the use of shaders;
[0155] (6) When a blind box is selected, a virtual character is preloaded, and the corresponding virtual character model is dynamically loaded after the blind box is opened.
[0156] Figure 6 This application provides a structural block diagram of a special effects processing device for virtual character extraction, as shown in the embodiments of this application. Figure 6 As shown, the device 600 may include: a resource acquisition module 601, a resource optimization module 602, a special effects display module 603, and a virtual character display module 604, wherein:
[0157] Resource acquisition module 601 is used to acquire the model resources, special effects resources, model textures and special effects textures corresponding to the virtual character;
[0158] The resource optimization module 602 is used to compress model textures, effect textures and model resources based on the device information of the terminal device used by the user to extract virtual characters, so as to obtain compressed model textures, compressed effect textures and compressed model resources.
[0159] The special effects display module 603 is used to extract special effects display based on the compressed model texture, compressed special effects texture, compressed model resources and special effects resources when it receives a trigger operation issued by the user for the target virtual character series;
[0160] The virtual character display module 604 is used to push and display the virtual character model corresponding to the target virtual character after determining the target virtual character from each virtual character model corresponding to the target virtual character series.
[0161] The solution provided in this application compresses and optimizes the model resources, effect resources, and model textures obtained for generating virtual effects and virtual character models according to the device parameters of the terminal device during the user's virtual character extraction process. While ensuring the display effect, it improves the processing speed of the terminal device for effects, thereby improving the smoothness of the display of virtual effects and virtual character models.
[0162] In one optional embodiment of this application, the device further includes a character model preloading module, used for:
[0163] Upon receiving a user's trigger operation targeting a specific virtual character series, the system preloads the models of each virtual character corresponding to the target virtual character series based on the compressed model textures and compressed model resources.
[0164] In one optional embodiment of this application, the resource optimization module is specifically used for:
[0165] Based on the device information, obtain the corresponding display parameters and graphics processor (GPU) parameters, determine the corresponding texture size threshold based on the display parameters, and determine the corresponding model vertex number threshold based on the GPU parameters;
[0166] Compress the size of the model textures and the size of the effect textures to within the texture size threshold, and compress the number of vertices of each model in the model resources to within the number of model vertices threshold.
[0167] In an optional embodiment of this application, the resource optimization module is further configured to:
[0168] Based on the display parameters, obtain the display height of the terminal device's display device and the proportion of the corresponding virtual character model in the height direction of the display device;
[0169] Determine the initial texture size threshold based on the display height and percentage;
[0170] The initial texture size threshold is converted into a power of 2 to obtain the corresponding texture size threshold.
[0171] In one optional embodiment of this application, the model resources include dynamic model resources and static model resources, and the apparatus further includes a batching module for:
[0172] For a given scenario, the static model resources in the compressed model resources corresponding to the given scenario are batched together to obtain batched static model resources. The model textures corresponding to the batched static model resources are then batched together to obtain batched model textures.
[0173] The special effects display module is specifically used for:
[0174] For a given scene, effects are extracted and displayed based on compressed effect textures, effect resources, batched static models, and batched model textures.
[0175] In one optional embodiment of this application, the batching module is specifically used for:
[0176] Export each static model resource as a single static model to obtain the batched static model resources. Export the model textures corresponding to each static model as a single model texture to obtain the batched model textures.
[0177] In one optional embodiment of this application, the compressed model texture map includes a skeletal animation texture map, and the apparatus further includes a skeletal animation texture map baking module for:
[0178] The pre-baked skeletal animation system presamples and bakes skeletal animation textures at a specified frame rate into a globally reusable skeletal animation texture collection.
[0179] The special effects display module is specifically used for:
[0180] Based on the compressed model textures, compressed effect textures, compressed model resources, effect resources, and skeletal animation texture collection, special effects are extracted and displayed.
[0181] In one optional embodiment of this application, the device further includes a special effects resource optimization module, used for:
[0182] The special effects resources were optimized by writing node animations to obtain optimized special effects resources;
[0183] The special effects display module is specifically used for:
[0184] Based on the compressed model textures, compressed effect textures, compressed model resources, and optimized effect resources, the effect display is extracted.
[0185] In one optional embodiment of this application, the special effects resource optimization module is specifically used for:
[0186] The optimized special effects resource is obtained by modifying the node coordinates of special effects elements in the special effects resource through displacement, and by changing the color and opacity of the nodes in the special effects element to achieve a gradient effect; or
[0187] The optimized special effects resource is obtained by modifying the UV parameters of the vertex shader and the color of the fragment shader corresponding to the special effects resource.
[0188] The following is for reference. Figure 7 It illustrates an electronic device suitable for implementing embodiments of this application (e.g., performing...). Figure 1 The diagram shows the structure of the terminal device or server 700 of the method shown. The electronic devices in the embodiments of this application may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (e.g., vehicle navigation terminals), wearable devices, and fixed terminals such as digital TVs and desktop computers. Figure 7 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.
[0189] The electronic device includes a memory and a processor. The memory stores a program for executing the methods described in the above-described method embodiments; the processor is configured to execute the program stored in the memory. The processor may be referred to as processing device 701 as described below, and the memory may include at least one of read-only memory (ROM) 702, random access memory (RAM) 703, and storage device 708 as described below, as follows:
[0190] like Figure 7 As shown, the electronic device 700 may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the electronic device 700. The processing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0191] Typically, the following devices can be connected to I / O interface 705: input devices 706 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 707 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 708 including, for example, magnetic tapes, hard disks, etc.; and communication devices 709. Communication device 709 allows electronic device 700 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 7 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0192] Specifically, according to embodiments of this application, the processes described above with reference to the 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 non-transitory 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 device 709, or installed from storage device 708, or installed from ROM 702. When the computer program is executed by processing device 701, it performs the functions defined in the methods of embodiments of this application.
[0193] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0194] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to:
[0195] The system acquires the corresponding model resources, effects resources, model textures, and effects textures for the virtual character extraction process. Based on the device information of the terminal device used by the user for virtual character extraction, it compresses the model textures, effects textures, and model resources to obtain compressed model textures, compressed effects textures, and compressed model resources. Upon receiving a trigger operation from the user targeting a specific virtual character series, it extracts and displays effects based on the compressed model textures, compressed effects textures, compressed model resources, and effects resources. After identifying the target virtual character from the virtual character models corresponding to the target virtual character series, it pushes and displays the virtual character model corresponding to the target virtual character.
[0196] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof. These programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0197] The above description is only a partial embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for processing special effects in virtual character extraction, characterized in that, include: Obtain the corresponding model resources, special effects resources, model textures, and special effects textures for the virtual character; Based on the device information of the terminal device used by the user to extract the virtual character, the model texture, the special effects texture, and the model resources are compressed to obtain compressed model texture, compressed special effects texture, and compressed model resources; Upon receiving a trigger operation from the user targeting a series of virtual characters, the system extracts and displays special effects based on the compressed model textures, the compressed special effects textures, the compressed model resources, and the special effects resources. After determining the target virtual character from the virtual character models corresponding to the target virtual character series, push and display the virtual character model corresponding to the target virtual character; The compression of the model textures, effect textures, and model resources based on the device information of the terminal device used by the user for virtual character extraction includes: Based on the device information, obtain the corresponding display parameters and graphics processor (GPU) parameters, determine the corresponding texture size threshold based on the display parameters, and determine the corresponding model vertex count threshold based on the GPU parameters; The size of the model texture and the size of the effect texture are compressed to within the texture size threshold, and the number of vertices of each model in the model resource is compressed to within the number of model vertices threshold.
2. The method according to claim 1, characterized in that, The method further includes: Upon receiving a trigger operation from the user targeting a specific virtual character series, the system preloads the models of each virtual character corresponding to the target virtual character series based on the compressed model textures and the compressed model resources.
3. The method according to claim 1, characterized in that, The step of determining the corresponding texture size threshold based on the display parameters includes: Based on the display parameters, the display height of the terminal device's display device and the proportion of the corresponding virtual character model in the height direction of the display device are obtained; Based on the display height and the percentage, determine the initial texture size threshold; The initial texture size threshold is converted into a power of 2 to obtain the corresponding texture size threshold.
4. The method according to claim 1, characterized in that, The model resources include dynamic model resources and static model resources, and the method further includes: For a given scenario, the static model resources in the compressed model resources corresponding to the given scenario are batched to obtain batched static model resources, and the model textures corresponding to the batched static model resources are batched to obtain batched model textures. The extraction of special effects display based on the compressed model texture, the compressed effect texture, the compressed model resources, and the effect resources includes: For the specified scene, special effects are extracted and displayed based on the compressed special effects textures, the special effects resources, the batched static model, and the batched model textures.
5. The method according to claim 4, characterized in that, The step of batch processing the static model resources in the compressed model resources corresponding to the specified scene to obtain batched static model resources, and batch processing the model textures corresponding to the batched static model resources to obtain batched model textures, includes: Each static model resource is exported as a single static model to obtain the batched static model resources. The model textures corresponding to each static model resource are then exported as a single model texture to obtain the batched model textures.
6. The method according to claim 1, characterized in that, The compressed model texture includes skeletal animation textures, and the method further includes: The skeletal animation textures are presampled and baked into a globally reused skeletal animation texture set at a specified frame rate using a pre-baked skeletal animation system. The extraction of special effects display based on the compressed model texture, the compressed effect texture, the compressed model resources, and the effect resources includes: Based on the compressed model textures, the compressed effect textures, the compressed model resources, the effect resources, and the skeletal animation texture collection, special effects are extracted and displayed.
7. The method according to claim 1, characterized in that, The method further includes: The special effects resources were optimized by writing node animations to obtain optimized special effects resources; The extraction of special effects display based on the compressed model texture, the compressed effect texture, the compressed model resources, and the effect resources includes: Based on the compressed model texture, the compressed effect texture, the compressed model resources, and the optimized effect resources, the effect display is extracted.
8. The method according to claim 7, characterized in that, The method of using node animation to optimize the special effects resources, resulting in optimized special effects resources, includes: The optimized special effects resource is obtained by modifying the node coordinates of the special effects elements in the resource through displacement, and by changing the color and transparency of the nodes in the special effects elements to achieve a gradient effect; or The optimized special effects resource is obtained by modifying the UV parameters of the vertex shader and the color of the fragment shader corresponding to the special effects resource.
9. A special effects processing device for virtual character extraction, characterized in that, include: The resource acquisition module is used to acquire the corresponding model resources, special effects resources, model textures, and special effects textures for virtual characters. The resource optimization module is used to compress the model texture, the special effects texture, and the model resources based on the device information of the terminal device used by the user to extract virtual characters, so as to obtain compressed model texture, compressed special effects texture, and compressed model resources. The special effects display module is used to extract and display special effects based on the compressed model texture, the compressed special effects texture, the compressed model resources, and the special effects resources when it receives a trigger operation from the user targeting a series of virtual characters. The virtual character display module is used to push and display the virtual character model corresponding to the target virtual character after determining the target virtual character from each virtual character model corresponding to the target virtual character series. The compression of the model textures, effect textures, and model resources based on the device information of the terminal device used by the user for virtual character extraction includes: Based on the device information, obtain the corresponding display parameters and graphics processor (GPU) parameters, determine the corresponding texture size threshold based on the display parameters, and determine the corresponding model vertex count threshold based on the GPU parameters; The size of the model texture and the size of the effect texture are compressed to within the texture size threshold, and the number of vertices of each model in the model resource is compressed to within the number of model vertices threshold.
10. An electronic device, characterized in that, Including memory and processor; The memory stores computer programs; The processor is configured to execute the computer program to implement the method of any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1 to 8.
Citation Information
Patent Citations
Lightweight end-cloud collaborative image coding transmission method and system
CN113938684A
Image processing method and device, electronic equipment and storage medium
CN114157867A