Method and device for generating dynamic silhouette effect of three-dimensional character, and storage medium

By obtaining and applying the preset silhouette configuration parameters of the target model, the problem of not being able to achieve the dynamic silhouette effect of 3D models in the existing technology is solved, and the generation and display of dynamic silhouettes are realized, which improves the 3D model expression and player experience in the game .

CN114219888BActive Publication Date: 2025-02-21SHANGHAI PERFECT WORLD SOFTWARE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111534290.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-15
Publication Date
2025-02-21
Estimated Expiration
2041-12-15

AI Technical Summary

Technical Problem

The prior art cannot realize the dynamic silhouette effect accompanied by the movement of 3D models, especially in the performance of scenes such as character entry in two-dimensional games.

Method used

By obtaining the preset silhouette configuration parameters of the target model, including shading parameters and motion parameters, write the shading parameters into the rendering pipeline, calculate and render the silhouette diagram shading data of the target model, generate silhouette renderings, and use motion parameters to generate silhouette animations. .

Benefits of technology

The dynamic silhouette effect of the 3D model is realized, which improves the expressiveness and player experience of the 3D model in the game, and fills the gap in the existing technology that cannot express the dynamic silhouette effect of the 3D model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114219888B_ABST
    Figure CN114219888B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for generating dynamic silhouette effects of three-dimensional characters, a storage medium, and a computer device. The method comprises: obtaining preset silhouette configuration parameters of a target model, wherein the preset silhouette configuration parameters include shading parameters and motion parameters; writing the shading parameters into a rendering pipeline, calculating the silhouette image shading data of the target model through the rendering pipeline, and rendering the silhouette of the target model according to the silhouette image shading data to generate a silhouette effect image of the target model; and generating a silhouette animation of the target model according to the motion parameters and the silhouette effect image. The method fills the gap in the prior art that the dynamic silhouette effect of 3D models cannot be expressed. The dynamic silhouette effect generated by the above method helps to improve the expressiveness of 3D models in games and enhance the player experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method and device for generating a dynamic silhouette effect of a three-dimensional character, a storage medium, and a computer device. Background Art

[0002] Two-dimensional games are a relatively popular type of game at present. For current two-dimensional games, character portraits are usually used in promotion. In terms of graphic effects, a layer of projection is added to the character portraits in PS to enhance the expressiveness of the characters. This effect is relatively easy to achieve for traditional static card portrait games, but for game scenes that need to display dynamic silhouette effects accompanying the movement of 3D models, such as character entry and standby scenes, it is not yet possible to achieve the silhouette effect accompanying the movement of 3D characters through hand-painted textures. Summary of the invention

[0003] In view of this, the present application provides a method and device for generating a three-dimensional character dynamic silhouette effect, a storage medium, and a computer device, which solves the problem that the prior art cannot display the dynamic silhouette effect of a 3D model.

[0004] According to one aspect of the present application, a method for generating a dynamic silhouette effect of a three-dimensional character is provided, characterized in that it includes:

[0005] Obtaining preset silhouette configuration parameters of the target model, wherein the preset silhouette configuration parameters include shading parameters and motion parameters;

[0006] Writing the shading parameters into a rendering pipeline, calculating silhouette image shading data of the target model through the rendering pipeline, and rendering the silhouette of the target model according to the silhouette image shading data to generate a silhouette effect image of the target model;

[0007] A silhouette animation of the target model is generated according to the motion parameters and the silhouette effect diagram.

[0008] Optionally, writing the shading parameters into a rendering pipeline, calculating silhouette image shading data of the target model through the rendering pipeline, and rendering the silhouette of the target model according to the silhouette image shading data to generate a silhouette effect image of the target model specifically includes:

[0009] Writing the shading parameters into a vertex shader corresponding to the rendering pipeline, and calculating the silhouette image shading data through the vertex shader;

[0010] The silhouette image shading data is written into a pixel shader corresponding to the rendering pipeline, and the silhouette of the target model is rendered by the pixel shader to generate the silhouette effect image.

[0011] Optionally, the shading parameters include silhouette adjustment parameters and color parameters; the step of writing the shading parameters into a vertex shader corresponding to the rendering pipeline and calculating the silhouette image shading data through the vertex shader specifically includes:

[0012] The silhouette adjustment parameters and the color parameters are written into the vertex shader, the silhouette of the target model is adjusted according to the silhouette adjustment parameters by the vertex shader, and the silhouette graph vertex data of the adjusted silhouette is calculated in combination with the color parameters.

[0013] Optionally, the silhouette adjustment parameter includes at least one of screen offset data, screen scaling data, and depth offset data; and adjusting the silhouette of the target model according to the silhouette adjustment parameter by the vertex shader specifically includes:

[0014] At least one of the following steps is performed by the vertex shader according to the silhouette adjustment parameter: offsetting the silhouette of the target model in screen space, scaling the silhouette of the target model in screen space, and depth offsetting the silhouette of the target model in camera space.

[0015] Optionally, the preset silhouette configuration parameters further include a silhouette center position, the color parameters include a first color parameter and a second color parameter; and the step of calculating the adjusted silhouette graph vertex data of the target model in combination with the color parameters specifically includes:

[0016] Calculating the distance between each vertex in the adjusted silhouette and the center position of the silhouette through the vertex shader, and determining the color fusion parameter corresponding to each vertex according to the distance;

[0017] According to the color fusion parameter, the first color parameter and the second color parameter are fused to determine the vertex color parameter of each vertex in the adjusted silhouette, wherein the silhouette image vertex data includes the vertex color parameter.

[0018] Optionally, the preset silhouette configuration parameters further include a transparency parameter; after determining the vertex color parameter of each vertex in the adjusted silhouette, the method further includes:

[0019] According to the transparency parameter, transparency calculation is performed on the vertex color parameter of each vertex.

[0020] Optionally, after writing the shading parameters into the rendering pipeline, the method further includes:

[0021] Verify whether the camera mask layer is marked with a silhouette mark and whether the target model contained in the viewport is marked with the silhouette mark, wherein the silhouette mark is used to mark the object for which a silhouette effect needs to be generated;

[0022] When it is verified that the camera mask layer is marked with the silhouette identifier and the target model is marked with the silhouette identifier, the step of calculating the silhouette image shading data of the target model through the rendering pipeline is performed.

[0023] Optionally, generating a silhouette animation of the target model according to the motion parameters and the silhouette effect diagram specifically includes:

[0024] Determine a silhouette target position based on the motion parameters, and determine a plurality of silhouette displacement parameters according to a current position of the silhouette corresponding to the silhouette effect graph and the silhouette target position;

[0025] The silhouette animation including a plurality of silhouette frames is generated according to the silhouette effect diagram and the plurality of silhouette displacement parameters.

[0026] According to another aspect of the present application, a device for generating a dynamic silhouette effect of a three-dimensional character is provided, comprising:

[0027] A parameter acquisition module, used to acquire preset silhouette configuration parameters of a target model, wherein the preset silhouette configuration parameters include shading parameters and motion parameters;

[0028] An image processing module, used for writing the shading parameters into a rendering pipeline, calculating the silhouette image shading data of the target model through the rendering pipeline, and rendering the silhouette of the target model according to the silhouette image shading data to generate a silhouette effect image of the target model;

[0029] The animation generation module is used to generate a silhouette animation of the target model according to the motion parameters and the silhouette effect diagram.

[0030] Optionally, the animation generation module is specifically used to:

[0031] Determine a silhouette target position based on the motion parameters, and determine a plurality of silhouette displacement parameters according to a current position of the silhouette corresponding to the silhouette effect graph and the silhouette target position;

[0032] The silhouette animation including a plurality of silhouette frames is generated according to the silhouette effect diagram and the plurality of silhouette displacement parameters.

[0033] Optionally, the image processing module is specifically used to:

[0034] Writing the shading parameters into a vertex shader corresponding to the rendering pipeline, and calculating the silhouette image shading data through the vertex shader;

[0035] The silhouette image shading data is written into a pixel shader corresponding to the rendering pipeline, and the silhouette of the target model is rendered by the pixel shader to generate the silhouette effect image.

[0036] Optionally, the coloring parameters include silhouette adjustment parameters and color parameters; and the image processing module is further used to:

[0037] The silhouette adjustment parameters and the color parameters are written into the vertex shader, the silhouette of the target model is adjusted according to the silhouette adjustment parameters by the vertex shader, and the silhouette graph vertex data of the adjusted silhouette is calculated in combination with the color parameters.

[0038] Optionally, the silhouette adjustment parameter includes at least one of screen offset data, screen zoom data and depth offset data; and the image processing module is further used to:

[0039] At least one of the following steps is performed by the vertex shader according to the silhouette adjustment parameter: offsetting the silhouette of the target model in screen space, scaling the silhouette of the target model in screen space, and depth offsetting the silhouette of the target model in camera space.

[0040] Optionally, the preset silhouette configuration parameters further include a silhouette center position, and the color parameters include a first color parameter and a second color parameter; and the image processing module is further configured to:

[0041] Calculating the distance between each vertex in the adjusted silhouette and the center position of the silhouette through the vertex shader, and determining the color fusion parameter corresponding to each vertex according to the distance;

[0042] According to the color fusion parameter, the first color parameter and the second color parameter are fused to determine the vertex color parameter of each vertex in the adjusted silhouette, wherein the silhouette image vertex data includes the vertex color parameter.

[0043] Optionally, the preset silhouette configuration parameters further include a transparency parameter; and the image processing module is further configured to:

[0044] After determining the vertex color parameter of each vertex in the adjusted silhouette, the transparency of the vertex color parameter of each vertex is calculated according to the transparency parameter.

[0045] Optionally, the device further comprises:

[0046] A verification module is used to verify whether the camera mask layer is marked with a silhouette marker and whether the target model contained in the viewport is marked with the silhouette marker, wherein the silhouette marker is used to mark the object for which a silhouette effect needs to be generated; when it is verified that the camera mask layer is marked with the silhouette marker and the target model is marked with the silhouette marker, the acquisition module executes the calculation of the silhouette image shading data of the target model through the rendering pipeline.

[0047] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned method for generating a dynamic silhouette effect of a three-dimensional character is implemented.

[0048] According to another aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned method for generating a dynamic silhouette effect of a three-dimensional character when executing the program.

[0049] By means of the above technical scheme, the present application provides a method and device for generating a dynamic silhouette effect of a three-dimensional character, a storage medium, and a computer device. For a target model for which a projection effect is to be generated, the shading parameters of the pre-configured target model silhouette are written into the rendering pipeline, and the silhouette image shading data is calculated through the rendering pipeline and the silhouette of the target model is rendered to obtain a silhouette effect image of the target model. Furthermore, the motion parameters of the pre-configured silhouette model are used to control the displacement of the silhouette in the silhouette effect image, generate a silhouette animation of the target model, and express the dynamic silhouette effect of the target model. The embodiments of the present application fill the gap in the prior art that the dynamic silhouette effect of a 3D model cannot be expressed. The dynamic silhouette effect generated in the above manner helps to improve the expressiveness of the 3D model in the game and enhance the player experience.

[0050] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0052] Figure 1 A schematic diagram of a process for generating a three-dimensional character dynamic silhouette effect provided by an embodiment of the present application is shown;

[0053] Figure 2A schematic diagram showing a flow chart of another method for generating a dynamic silhouette effect of a three-dimensional character provided in an embodiment of the present application;

[0054] Figure 3 A schematic diagram of a target model and a silhouette provided in an embodiment of the present application is shown;

[0055] Figure 4 A schematic diagram of a silhouette effect provided by an embodiment of the present application is shown;

[0056] Figure 5 A schematic structural diagram of a device for generating a dynamic silhouette effect of a three-dimensional character provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0057] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.

[0058] In this embodiment, a method for generating a dynamic silhouette effect of a three-dimensional character is provided. Figure 1 As shown, the method includes:

[0059] Step 101, obtaining preset silhouette configuration parameters of a target model, wherein the preset silhouette configuration parameters include shading parameters and motion parameters;

[0060] Step 102, writing the shading parameters into a rendering pipeline, calculating silhouette image shading data of the target model through the rendering pipeline, and rendering the silhouette of the target model according to the silhouette image shading data to generate a silhouette effect image of the target model;

[0061] Step 103: Generate a silhouette animation of the target model according to the motion parameters and the silhouette effect diagram.

[0062] The embodiment of the present application can be used to create a flat silhouette effect of a 3D model. In scenes such as game entry and standby, when the 3D model is displayed, the effect of the silhouette dynamically changing with the 3D model is displayed in the interface.

[0063] First, obtain the preset silhouette configuration parameters, which are used to configure the silhouette of the target model to produce the silhouette effect of the target model. Secondly, write the shading parameters and the primitive information of the model into the rendering pipeline of the pre-configured silhouette image, execute the rendering process through the rendering pipeline, and obtain the silhouette effect image. The shading parameters can specifically include data for indicating the silhouette color and the silhouette position. For example, a rendering process pass for drawing the silhouette can be added to the rendering pipeline. The rendering pass using GPU rasterization includes at least one vertex shader VertexShader processing and a pixel shader FragmentShader (or called a fragment shader, fragment shader) processing. The calculation of the silhouette image shading data is realized by executing the pass defined in the rendering pipeline, and the silhouette effect image is drawn according to the calculated silhouette image shading data to obtain a flattened silhouette effect. Finally, according to the motion parameters in the preset silhouette configuration parameters, the silhouette motion speed, motion direction and other information are determined, so as to use a silhouette effect image to generate multiple silhouette effect images that meet the silhouette motion speed, motion direction and other information, and produce the silhouette animation of the target model in the order of multiple silhouette effect images to show the displacement effect of the silhouette. In addition, silhouette motion parameters that match the target model motion parameters may be set to present a flattened silhouette effect that follows the motion of the 3D character, thus filling the gap in the prior art that the silhouette effect accompanying the motion of the 3D character cannot be achieved.

[0064] By applying the technical solution of this embodiment, for the target model to generate the projection effect, the shading parameters of the pre-configured target model silhouette are written into the rendering pipeline, the silhouette image shading data is calculated through the rendering pipeline and the silhouette of the target model is rendered to obtain the silhouette effect image of the target model, and further, the motion parameters of the pre-configured silhouette model are used to control the displacement of the silhouette in the silhouette effect image, generate the silhouette animation of the target model, and express the dynamic silhouette effect of the target model. The embodiment of the present application fills the gap in the prior art that the dynamic silhouette effect of the 3D model cannot be expressed. The dynamic silhouette effect generated by the above method helps to improve the expressiveness of the 3D model in the game and enhance the player experience.

[0065] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another method for generating a dynamic silhouette effect of a three-dimensional character is provided, such as Figure 2 As shown, the method includes:

[0066] Step 201: Obtain preset silhouette configuration parameters of a target model, wherein the preset silhouette configuration parameters include shading parameters and motion parameters.

[0067] Step 202, write the shading parameters into the vertex shader corresponding to the rendering pipeline, verify whether the camera mask layer is marked with a silhouette mark and whether the target model contained in the viewport is marked with the silhouette mark, wherein the silhouette mark is used to mark the object for which a silhouette effect needs to be generated.

[0068] In an embodiment of the present application, the camera mask layer of the rendering camera can be marked in advance in the creation environment of the game scene where the silhouette effect needs to be displayed, so that the camera mask layer in the game scene creation environment where the silhouette effect needs to be produced is marked with a silhouette mark. In addition, the target model for which the silhouette effect is to be produced can also be marked in advance so that the target model for which the silhouette effect is to be produced is marked with a silhouette mark. In a specific application scenario, before producing the silhouette effect, it should be verified whether the camera mask layer is marked with a silhouette mark and whether the current viewport contains a target model with a silhouette mark. Only when the camera mask layer is marked with a silhouette mark and the viewport contains a model with a silhouette mark, the silhouette effect will be produced to avoid drawing silhouettes in scenes that do not require this effect. For example, the character silhouette pass of the target model is named "UICharPass" in the rendering pipeline and a shader for drawing the silhouette effect is added to the rendering pipeline, which can specifically be a character silhouette shader with Tags{"LightMode"="UIChar"}. Therefore, in the rendering pipeline, this pass will only be started when the camera mask layer CameraCullingMask contains "UICharacter" and the character model contains the "UICharacter" Layer in the viewport, and finally the silhouette will be drawn according to the "CharacterUIRef" script parameters hung on the character.

[0069] Step 203, when it is verified that the camera mask layer is marked with the silhouette identifier and the target model is marked with the silhouette identifier, the shading parameters are written into the vertex shader corresponding to the rendering pipeline, and the silhouette image shading data is calculated by the vertex shader.

[0070] Optionally, step 203 may specifically be: writing the silhouette adjustment parameters and the color parameters into the vertex shader, adjusting the silhouette of the target model according to the silhouette adjustment parameters through the vertex shader, and calculating the silhouette graph vertex data of the adjusted silhouette in combination with the color parameters.

[0071] In this embodiment, the position, size and other parameters of the silhouette of the target model can be adjusted to obtain the silhouette effect required by the game production personnel. Further, according to the adjusted silhouette, the vertex data of the silhouette image is calculated in combination with the color parameters.

[0072] In a specific application scenario, the silhouette adjustment parameters include at least one of screen offset data, screen scaling data, and depth offset data. The above-mentioned "adjusting the silhouette of the target model according to the silhouette adjustment parameters through the vertex shader" may specifically include: through the vertex shader, according to the silhouette adjustment parameters, performing at least one of the following steps: offsetting the silhouette of the target model in the screen space, scaling the silhouette of the target model in the screen space, and performing depth offset on the silhouette of the target model in the camera space.

[0073] In this embodiment, game producers can offset and scale the silhouette in screen space to adjust the position and size of the silhouette in screen space to obtain an effect that better matches actual needs. They can also perform depth offset on the silhouette in camera space to avoid interlacing of the model and the silhouette, thereby improving the expressiveness of the silhouette.

[0074] Further, in an embodiment of the present application, optionally, the preset silhouette configuration parameters also include a silhouette center position, and the color parameters include a first color parameter and a second color parameter; the combining the color parameters to calculate the silhouette graph vertex data of the adjusted target model specifically includes: calculating, through the vertex shader, the distance between each vertex in the adjusted silhouette and the silhouette center position, and determining, based on the distance, a color fusion parameter corresponding to each vertex; according to the color fusion parameter, fusing the first color parameter and the second color parameter to determine the vertex color parameter of each vertex in the adjusted silhouette, wherein the silhouette graph vertex data includes the vertex color parameter.

[0075] In this embodiment, the first color parameter and the second color parameter can be preset, and the gradient color center point, that is, the silhouette center position, can be set. Taking a character model as an example, the silhouette center position can be the pelvic node position of the character model. Further, as Figure 3As shown, the distance between each vertex and the center position of the silhouette in the silhouette model corresponding to the target model is calculated, and the color fusion parameter is determined according to the distance, the first color and the second color are fused, and the vertex color parameter of each vertex is determined. When the silhouette is subsequently rendered, different colors are rendered at different positions of the silhouette to show the effect of color transition from the center position of the silhouette to other positions. In a specific embodiment, a vertex is selected on the character model as the center position of the silhouette, and after the silhouette of the character model is created, the center position of the silhouette selected on the character model is mapped to the silhouette to determine the center point of the gradient color on the silhouette of the character model, and the coordinate difference S1 of each vertex on the silhouette with the point in the vertical direction and the coordinate difference S2 of each vertex with the point in the horizontal direction are calculated, and the coordinate difference S1 of each vertex is normalized to obtain S1', and the coordinate difference S2 of each vertex is normalized to obtain S2', and 1 / 2(S1'+S2') is used as the fusion parameter of each vertex, and finally the first color+second color*fusion parameter is calculated to obtain the final vertex color of each vertex.

[0076] Optionally, the preset silhouette configuration parameters also include a transparency parameter; after determining the vertex color parameters of each vertex in the adjusted silhouette, the method further includes: performing transparency calculation on the vertex color parameters of each vertex according to the transparency parameter.

[0077] In this embodiment, the silhouette can also be made to have a certain transparency effect. After calculating the vertex color parameters, the transparency of the vertex color parameters is calculated in combination with the preset transparency parameters, and the vertex color parameters are updated.

[0078] Step 204, writing the silhouette image shading data into the pixel shader corresponding to the rendering pipeline, rendering the silhouette of the target model through the pixel shader, and generating the silhouette effect image.

[0079] In the above embodiment, after the vertex shader performs calculations to obtain the silhouette image shading data, the data is written into the pixel shader, and the silhouette rendering is performed using the pixel shader to obtain the silhouette effect, such as Figure 4 shown.

[0080] Step 205, determining a silhouette target position based on the motion parameters, and determining a plurality of silhouette displacement parameters according to a silhouette current position corresponding to the silhouette effect graph and the silhouette target position.

[0081] Step 206: Generate the silhouette animation including a plurality of silhouette frames according to the silhouette effect diagram and the plurality of silhouette displacement parameters.

[0082] The embodiments of the present application can adjust the silhouette displacement in the form of a slow-motion animation to form a silhouette animation. Specifically, the silhouette target position to which the silhouette is to move can be determined based on the configured motion parameters, such as motion speed and direction. The position of the silhouette in each frame of the image can be further determined by controlling the silhouette slow-motion. Multiple silhouette frames are produced in which the silhouette gradually moves from the current position of the silhouette to the silhouette target position. The silhouette animation is formed by multiple silhouette frames.

[0083] Further, as Figure 1 The specific implementation of the method, the embodiment of the present application provides a device for generating a dynamic silhouette effect of a three-dimensional character, such as Figure 5 As shown, the device comprises:

[0084] A parameter acquisition module, used to acquire preset silhouette configuration parameters of a target model, wherein the preset silhouette configuration parameters include shading parameters and motion parameters;

[0085] An image processing module, used for writing the shading parameters into a rendering pipeline, calculating the silhouette image shading data of the target model through the rendering pipeline, and rendering the silhouette of the target model according to the silhouette image shading data to generate a silhouette effect image of the target model;

[0086] The animation generation module is used to generate a silhouette animation of the target model according to the motion parameters and the silhouette effect diagram.

[0087] Optionally, the animation generation module is specifically used to:

[0088] Determine a silhouette target position based on the motion parameters, and determine a plurality of silhouette displacement parameters according to a current position of the silhouette corresponding to the silhouette effect graph and the silhouette target position;

[0089] The silhouette animation including a plurality of silhouette frames is generated according to the silhouette effect diagram and the plurality of silhouette displacement parameters.

[0090] Optionally, the image processing module is specifically used to:

[0091] Writing the shading parameters into a vertex shader corresponding to the rendering pipeline, and calculating the silhouette image shading data through the vertex shader;

[0092] The silhouette image shading data is written into a pixel shader corresponding to the rendering pipeline, and the silhouette of the target model is rendered by the pixel shader to generate the silhouette effect image.

[0093] Optionally, the coloring parameters include silhouette adjustment parameters and color parameters; and the image processing module is further used to:

[0094] The silhouette adjustment parameters and the color parameters are written into the vertex shader, the silhouette of the target model is adjusted according to the silhouette adjustment parameters by the vertex shader, and the silhouette graph vertex data of the adjusted silhouette is calculated in combination with the color parameters.

[0095] Optionally, the silhouette adjustment parameter includes at least one of screen offset data, screen zoom data and depth offset data; and the image processing module is further used to:

[0096] At least one of the following steps is performed by the vertex shader according to the silhouette adjustment parameter: offsetting the silhouette of the target model in screen space, scaling the silhouette of the target model in screen space, and depth offsetting the silhouette of the target model in camera space.

[0097] Optionally, the preset silhouette configuration parameters further include a silhouette center position, and the color parameters include a first color parameter and a second color parameter; and the image processing module is further configured to:

[0098] Calculating the distance between each vertex in the adjusted silhouette and the center position of the silhouette through the vertex shader, and determining the color fusion parameter corresponding to each vertex according to the distance;

[0099] According to the color fusion parameter, the first color parameter and the second color parameter are fused to determine the vertex color parameter of each vertex in the adjusted silhouette, wherein the silhouette image vertex data includes the vertex color parameter.

[0100] Optionally, the preset silhouette configuration parameters further include a transparency parameter; and the image processing module is further configured to:

[0101] After determining the vertex color parameter of each vertex in the adjusted silhouette, the transparency of the vertex color parameter of each vertex is calculated according to the transparency parameter.

[0102] Optionally, the device further comprises:

[0103] A verification module is used to verify whether the camera mask layer is marked with a silhouette marker and whether the target model contained in the viewport is marked with the silhouette marker, wherein the silhouette marker is used to mark the object for which a silhouette effect needs to be generated; when it is verified that the camera mask layer is marked with the silhouette marker and the target model is marked with the silhouette marker, the acquisition module executes the calculation of the silhouette image shading data of the target model through the rendering pipeline.

[0104] It should be noted that for other corresponding descriptions of the functional units involved in the device for generating a three-dimensional character dynamic silhouette effect provided in the embodiment of the present application, reference can be made to Figure 1 to Figure 2 The corresponding description in the method will not be repeated here.

[0105] Based on the above Figure 1 to Figure 2 The method shown in the embodiment of the present application is accordingly provided with a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned Figure 1 to Figure 2 The method for generating dynamic silhouette effect of a three-dimensional character is shown.

[0106] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.

[0107] Based on the above Figure 1 to Figure 2 The method shown, and Figure 5 In order to achieve the above-mentioned purpose, the embodiment of the present application further provides a computer device, which can be a personal computer, a server, a network device, etc. The computer device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 to Figure 2 The method for generating dynamic silhouette effect of a three-dimensional character is shown.

[0108] Optionally, the computer device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a Bluetooth interface, a WI-FI interface), etc.

[0109] Those skilled in the art will appreciate that the computer device structure provided in this embodiment does not limit the computer device, and may include more or fewer components, or a combination of certain components, or different component arrangements.

[0110] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages and saves the hardware and software resources of the computer device, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to realize communication between the components inside the storage medium, and communication with other hardware and software in the physical device.

[0111] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, or can be implemented by hardware. For the target model to generate a projection effect, the shading parameters of the pre-configured target model silhouette are written into the rendering pipeline, and the silhouette image shading data is calculated through the rendering pipeline and the silhouette of the target model is rendered to obtain a silhouette effect image of the target model. Furthermore, the motion parameters of the pre-configured silhouette model are used to control the displacement of the silhouette in the silhouette effect image, generate a silhouette animation of the target model, and express the dynamic silhouette effect of the target model. The embodiment of the present application fills the gap in the prior art that the dynamic silhouette effect of the 3D model cannot be expressed. The dynamic silhouette effect generated by the above method helps to improve the expressiveness of the 3D model in the game and enhance the player experience.

[0112] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.

[0113] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.

Claims

1. A method for generating a dynamic silhouette effect of a three-dimensional character, characterized in that: include: Obtaining preset silhouette configuration parameters of the target model, wherein the preset silhouette configuration parameters include shading parameters and motion parameters; Writing the primitive information and the shading parameters of the target model into a rendering pipeline, calculating the silhouette image shading data of the target model through the rendering pipeline, and rendering the silhouette of the target model according to the silhouette image shading data to generate a silhouette effect image of the target model; A silhouette animation of the target model is generated according to the motion parameters and the silhouette effect diagram.

2. The method according to claim 1, characterized in that Generating the silhouette animation of the target model according to the motion parameters and the silhouette effect diagram specifically includes: Determine a silhouette target position based on the motion parameters, and determine a plurality of silhouette displacement parameters according to a current position of the silhouette corresponding to the silhouette effect graph and the silhouette target position; The silhouette animation including a plurality of silhouette frames is generated according to the silhouette effect diagram and the plurality of silhouette displacement parameters.

3. The method according to claim 1, characterized in that The step of writing the primitive information and the shading parameters of the target model into a rendering pipeline, calculating the silhouette image shading data of the target model through the rendering pipeline, and rendering the silhouette of the target model according to the silhouette image shading data to generate a silhouette effect image of the target model specifically includes: Writing the primitive information of the target model and the shading parameters into the vertex shader corresponding to the rendering pipeline, and calculating the silhouette image shading data through the vertex shader; The silhouette image shading data is written into a pixel shader corresponding to the rendering pipeline, and the silhouette of the target model is rendered by the pixel shader to generate the silhouette effect image.

4. The method according to claim 3, characterized in that The shading parameters include silhouette adjustment parameters and color parameters; the primitive information of the target model and the shading parameters are written into a vertex shader corresponding to the rendering pipeline, and the silhouette image shading data is calculated by the vertex shader, specifically including: The primitive information of the target model, the silhouette adjustment parameters and the color parameters are written into the vertex shader, the silhouette of the target model is adjusted according to the silhouette adjustment parameters by the vertex shader, and the silhouette graph vertex data of the adjusted silhouette is calculated in combination with the color parameters.

5. The method according to claim 4, characterized in that The silhouette adjustment parameter includes at least one of screen offset data, screen scaling data, and depth offset data; and adjusting the silhouette of the target model according to the silhouette adjustment parameter by the vertex shader specifically includes: At least one of the following steps is performed by the vertex shader according to the silhouette adjustment parameter: offsetting the silhouette of the target model in screen space, scaling the silhouette of the target model in screen space, and depth offsetting the silhouette of the target model in camera space.

6. The method according to claim 4, characterized in that The preset silhouette configuration parameters also include the silhouette center position, and the color parameters include a first color parameter and a second color parameter; and the step of calculating the adjusted silhouette vertex data of the target model in combination with the color parameters specifically includes: Calculating the distance between each vertex in the adjusted silhouette and the center position of the silhouette through the vertex shader, and determining the color fusion parameter corresponding to each vertex according to the distance; According to the color fusion parameter, the first color parameter and the second color parameter are fused to determine the vertex color parameter of each vertex in the adjusted silhouette, wherein the silhouette image vertex data includes the vertex color parameter.

7. The method according to claim 6, characterized in that The preset silhouette configuration parameters also include a transparency parameter; after determining the vertex color parameter of each vertex in the adjusted silhouette, the method further includes: According to the transparency parameter, transparency calculation is performed on the vertex color parameter of each vertex.

8. The method according to any one of claims 1 to 7, characterized in that After writing the shading parameters into the rendering pipeline, the method further includes: Verify whether the camera mask layer is marked with a silhouette mark and whether the target model contained in the viewport is marked with the silhouette mark, wherein the silhouette mark is used to mark the object for which a silhouette effect needs to be generated; When it is verified that the camera mask layer is marked with the silhouette identifier and the target model is marked with the silhouette identifier, the step of calculating the silhouette image shading data of the target model through the rendering pipeline is performed.

9. A device for generating a dynamic silhouette effect of a three-dimensional character, characterized in that: include: A parameter acquisition module, used to acquire preset silhouette configuration parameters of the target model, wherein the preset silhouette configuration parameters include shading parameters and motion parameters; An image processing module, used for writing the primitive information of the target model and the shading parameters into a rendering pipeline, calculating the silhouette image shading data of the target model through the rendering pipeline, and rendering the silhouette of the target model according to the silhouette image shading data to generate a silhouette effect image of the target model; The animation generation module is used to generate a silhouette animation of the target model according to the motion parameters and the silhouette effect diagram.

10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

11. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Skeletal animation rendering method and system based on Unity 3D

    CN112489183A