Method, device and equipment for rendering virtual object and storage medium
Patent Information
- Application Number
- CN202211204095.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2042-09-29
AI Technical Summary
现有技术中,试穿的服装无法与人物运动很好的贴合,且缺少真实服装的动感及质感,试穿效果较差
[0019] This disclosure provides a rendering method, apparatus, device, and storage medium for virtual objects. The method involves acquiring the skeletal point position information of a target object in a current image and the initial position information of the virtual object's vertices. The virtual object vertices are the vertices of the corresponding 3D model. The initial position information is transformed based on the skeletal point position information to obtain intermediate position information. The intermediate position information of at least some vertices of the virtual object is updated based on set material information to obtain target position information. The virtual object is then rendered based on the target position information to obtain a target image. The target object in the target image is wearing the virtual object. This rendering method transforms the initial position information based on the skeletal point position information of the target object and updates the intermediate position information of at least some vertices of the virtual object based on set material information. This allows the virtual object to closely match the movement of the target object, giving the virtual object the dynamism and texture of a real object, thus improving the rendering effect.
Smart Images

Figure CN115861503B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of augmented reality technology, and more particularly to a method, apparatus, device, and storage medium for rendering virtual objects. Background Technology
[0002] With the continuous development of Augmented Reality (AR) technology, the generation of virtual objects in real-world scenes using AR technology has been widely applied. One such application is allowing users to try on clothing. However, current technologies often fail to provide a good fit for the user's movements and lack the dynamism and texture of real clothing, resulting in a poor fitting experience. Summary of the Invention
[0003] This disclosure provides a rendering method, apparatus, device, and storage medium for virtual objects, enabling the virtual object to closely match the movement of the target object and giving the virtual object the dynamism and texture of a real object, thereby improving the rendering effect.
[0004] In a first aspect, embodiments of this disclosure provide a method for rendering virtual objects, including:
[0005] Obtain the skeletal point position information of the target object in the current image and the initial position information of the virtual object vertices; wherein, the virtual object vertices are the vertices of the 3D model corresponding to the virtual object;
[0006] The initial position information is transformed based on the skeletal point position information to obtain intermediate position information;
[0007] Based on the set material information, the intermediate position information of at least some vertices of the virtual object is updated to obtain the target position information;
[0008] The virtual object is rendered based on the target location information to obtain a target image; wherein the target object in the target image is wearing the virtual object.
[0009] Secondly, embodiments of this disclosure also provide a rendering apparatus for virtual objects, comprising:
[0010] The acquisition module is used to acquire the skeletal point position information of the target object in the current image and the initial position information of the vertices of the virtual object; wherein, the vertices of the virtual object are the vertices of the 3D model corresponding to the virtual object;
[0011] The position information transformation module is used to transform the initial position information based on the skeletal point position information to obtain intermediate position information;
[0012] The target position information acquisition module is used to update the intermediate position information of at least some vertices of the virtual object based on the set material information to obtain the target position information;
[0013] A rendering module is used to render the virtual object based on the target location information to obtain a target image; wherein the target object in the target image is wearing the virtual object.
[0014] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:
[0015] One or more processors;
[0016] Storage device for storing one or more programs.
[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the virtual object rendering method as described in the embodiments of this disclosure.
[0018] Fourthly, embodiments of this disclosure also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the rendering method for virtual objects as described in embodiments of this disclosure.
[0019] This disclosure provides a rendering method, apparatus, device, and storage medium for virtual objects. The method involves acquiring the skeletal point position information of a target object in a current image and the initial position information of the virtual object's vertices. The virtual object vertices are the vertices of the corresponding 3D model. The initial position information is transformed based on the skeletal point position information to obtain intermediate position information. The intermediate position information of at least some vertices of the virtual object is updated based on set material information to obtain target position information. The virtual object is then rendered based on the target position information to obtain a target image. The target object in the target image is wearing the virtual object. This rendering method transforms the initial position information based on the skeletal point position information of the target object and updates the intermediate position information of at least some vertices of the virtual object based on set material information. This allows the virtual object to closely match the movement of the target object, giving the virtual object the dynamism and texture of a real object, thus improving the rendering effect. Attached Figure Description
[0020] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0021] Figure 1 This is a flowchart illustrating a method for rendering virtual objects provided in an embodiment of this disclosure;
[0022] Figure 2 This is a schematic diagram of a rendered virtual object provided in an embodiment of this disclosure;
[0023] Figure 3 This is an example diagram of a color noise map provided in an embodiment of this disclosure;
[0024] Figure 4a This is an example diagram of a target object sampling diagram provided in an embodiment of this disclosure;
[0025] Figure 4b This is an example diagram of a first mask pattern provided in an embodiment of this disclosure;
[0026] Figure 4c This is an example diagram of a virtual object provided in an embodiment of this disclosure;
[0027] Figure 4d This is an example image of a target image provided in an embodiment of this disclosure;
[0028] Figure 5a This is an example diagram of displaying a virtual object provided in an embodiment of this disclosure;
[0029] Figure 5b This is an example diagram of displaying a virtual object provided in an embodiment of this disclosure;
[0030] Figure 6 This is a schematic diagram of the structure of a virtual object rendering device provided in an embodiment of this disclosure;
[0031] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0032] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0033] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0034] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0035] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0036] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0037] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0038] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0039] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0040] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0041] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0042] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0043] Figure 1 This is a flowchart illustrating a method for rendering virtual objects according to an embodiment of the present disclosure. This embodiment is applicable to the rendering of virtual objects. The method can be executed by a virtual object rendering device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, such as a mobile terminal, a PC, or a server.
[0044] like Figure 1 As shown, the method includes:
[0045] S110, obtain the skeletal point position information of the target object in the current image and the initial position information of the virtual object vertices.
[0046] The current image can be a still image, a real-time captured image, or a frame from a video. The target object can be a person or an animal; in this application scenario, the target object is a person. The virtual object can be a pre-constructed 3D virtual object, such as virtual clothing or virtual accessories. The vertices of the virtual object can be the vertices of the corresponding 3D model of the virtual object. The initial position information of the virtual object's vertices can be understood as the three-dimensional coordinates of the virtual object's vertices in the world coordinate system.
[0047] The skeletal point location information can be the three-dimensional coordinates of skeletal keypoints in the world coordinate system. In this embodiment, the method for obtaining the skeletal point location information of the target object in the current image can be: performing skeletal keypoint detection or pose detection on the target object in the current image to obtain the location information of multiple skeletal keypoints. Any existing pose detection algorithm or skeletal keypoint detection algorithm can be used to obtain the skeletal point location information; no limitation is made here.
[0048] S120: Transform the initial position information based on the skeletal point position information to obtain intermediate position information.
[0049] In this embodiment, the virtual object moves along with the target object, that is, the position information of the virtual object's vertices changes as the position information of the skeletal points changes.
[0050] Specifically, the method for transforming the initial position information based on the bone point position information can be as follows: obtain multiple bone points associated with the virtual object vertex and the position influence weights of the multiple bone points on the virtual object vertex; determine the vertex transformation information based on the position information and position influence weights of the multiple bone points; transform the initial position information based on the vertex transformation information to obtain intermediate position information.
[0051] The positional influence weight can be understood as the degree to which the position of a skeletal point affects the position of a virtual object's vertex. The positional influence weight is related to the distance between the skeletal point and the virtual object's vertex. The closer the skeletal point is to the virtual object's vertex, the greater the influence weight of the skeletal point on the vertex's position; conversely, the farther the skeletal point is from the vertex, the smaller the influence weight, thus creating the effect of the virtual object moving with the human body. For example, a virtual object vertex near the knee skeletal point is significantly affected by the knee skeletal point. When the human body bends the knee, the virtual object vertex near the knee skeletal point will undergo a significant positional change. In this embodiment, the process of obtaining multiple skeletal points associated with a virtual object vertex and the positional influence weights of these skeletal points on the virtual object vertex can be as follows: First, bind the virtual object to the target object's skeletal points. Based on the binding result, determine the multiple skeletal points associated with each virtual object vertex and the positional influence weights of these skeletal points on the virtual object vertex. In this application scenario, each virtual object vertex is associated with four skeletal points. One way to determine vertex transformation information based on the position influence weights and position information of multiple bone points is to perform a weighted summation of the position information of multiple bone points based on the position influence weights to obtain vertex transformation information.
[0052] The vertex transformation information can be represented by a matrix. The initial position information can be transformed based on the vertex transformation information by multiplying the vector corresponding to the initial position information by the matrix corresponding to the vertex transformation information, thereby obtaining the vector corresponding to the intermediate position information. In this embodiment, the initial position information is transformed based on the vertex transformation information, causing the virtual object to move with the target object, thus improving the realism of the virtual object being worn on the target object.
[0053] S130, based on the set material information, update the middle position information of at least some vertices of the virtual object to obtain the target position information.
[0054] The material information can be defined based on material parameters, with different parameters corresponding to different materials. In this embodiment, the material can be cloth. Specifically, the virtual object vertices are first divided into at least two parts based on their texture coordinates. Then, vertices from one or more of these parts are selected to update the intermediate position information of the selected vertices based on the defined material information.
[0055] Specifically, the method for updating the intermediate position information of at least some vertices of the virtual object based on the set material information can be: obtaining the set material information and the motion state of the virtual object vertices; calculating the set material for at least some vertices of the virtual object based on the intermediate position information, the set material information and the motion state to obtain the target position information.
[0056] The material information can be parameters characterizing material properties, such as air resistance, tensile strength, compressibility, and bending strength. This material information can be set according to actual needs. The motion state can be information such as the speed and direction of motion of the virtual object's vertices in the current image relative to the previous image. In this embodiment, a pre-developed material calculation plugin can be called to perform material calculation. Specifically, the material calculation plugin calculates the material parameters, the intermediate position information of at least some vertices, and the motion state to set the material, and outputs the target position information. In this embodiment, by calculating the material of at least some vertices of the virtual object based on the intermediate position information, the material information, and the motion state, the virtual object can possess the dynamism and texture of the set material.
[0057] Optionally, the method for calculating the material of at least some vertices of the virtual object based on the intermediate position information, material setting information, and motion state can be as follows: if there is a virtual object support in the current scene; obtain support information based on the virtual object support; calculate the material of at least some vertices of the virtual object based on the intermediate position information, material parameters, motion state, and support information.
[0058] In this embodiment, the virtual object support can be set according to the collision principle, that is, it can be a collider, and the support information can be understood as collision information. In this embodiment, in the area where the virtual object support is set, the virtual object will collide with the virtual object support, that is, the virtual object cannot pass through the virtual object support, which can make the virtual object take on a certain shape. In this embodiment, the virtual object support can be set by a material calculation plugin, and the material calculation plugin obtains the support information based on the set virtual object support. Specifically, the material calculation plugin can calculate the material parameters, support information, at least some of the vertices' intermediate position information, and motion state to obtain the calculated target position information. In this embodiment, setting a virtual object support collider in the current scene can make the virtual object take on a certain shape, thereby meeting the user's personalized needs. For example, Figure 2 This is a schematic diagram of the virtual object rendered in this embodiment, such as... Figure 2As shown, the virtual object is a skirt. Because the material of the vertices below the waist of the skirt has been set, the lower part of the skirt has the movement and texture of gauze. In addition, there is a virtual object support under the skirt hem, so the hem of the skirt presents a puffy effect.
[0059] S140: Render the virtual object based on the target location information to obtain the target image.
[0060] In this context, the target object in the target image wears a virtual object.
[0061] In this embodiment, the virtual object's vertices are rendered to their corresponding positions on the screen based on the target location information, thereby obtaining the target object.
[0062] Specifically, the method for rendering a virtual object based on the target position information to obtain the target image can be as follows: sampling preset color information from a color noise image based on the texture coordinates of the virtual object's vertices; offsetting the preset color information according to the time information of the current image; adjusting the initial color of the virtual object's vertices according to the offset preset color information and the target position information to obtain the target color; and rendering the virtual object based on the target position information and the target color to obtain the target image.
[0063] The texture coordinates can be the coordinates of each vertex in the surface texture of the virtual object. The color noise map can be a randomly generated noise map, for example... Figure 3 This is an example diagram of a color noise map in this embodiment. Figure 3 The image shown is a grayscale noise image, while the original image is a color image. In this embodiment, the color noise image and the surface texture of the virtual object have the same size, meaning that the pixels in the two images correspond one-to-one. This allows preset color information to be sampled from the color noise image based on the texture coordinates.
[0064] The time information of the current image can be understood as the timestamp information of the current image in the video. Color information can be represented by three color channels (RGB) values. Specifically, the process of offsetting the preset color information based on the time information of the current image can be as follows: First, perform a linear transformation on the time information to obtain the offset; then, convert the RGB information of the preset color information to the HSV (Hue, Saturation, Value) color space; then, based on the offset, offset the three components of the HSV information respectively to obtain the offset HSV information; finally, convert the HSV information back to RGB information. The linear transformation of the time information can be done by multiplying the time information by a set value to obtain the offset. The formula for offsetting the three components of the HSV information based on the offset can be expressed as: H1 = H0, S1 = S0 + t / 360, V1 = V0 + t / 360 * 0.1, where S0 is the S component before offset, S1 is the S component after offset, V0 is the V component before offset, and V1 is the V component after offset.
[0065] In this embodiment, the initial color of the virtual object vertex is adjusted according to the preset color information after offset processing and the target position information. The target color can be obtained by: determining the normal direction and view direction of the virtual object vertex according to the target position information; determining the color transformation information according to the preset color information after offset processing; determining the color adjustment amount according to the color transformation information, normal direction and view direction; and accumulating the color adjustment amount with the initial color of the virtual object vertex to obtain the target color.
[0066] The normal direction can be the normal direction of the tangent plane containing the vertex of the virtual object, and the view direction can be the direction from the camera's optical center to the vertex of the virtual object. Color transformation information can be represented by a color transformation matrix. The process of determining color transformation information based on the preset color information after offset processing can be as follows: convert the three channel color values of the preset color information after offset processing into angle information, then calculate the sine and cosine of the three angles, and finally construct a color transformation matrix representation based on the sine and cosine of the three angles. For example, the formula for converting the three channel color values into angle information can be expressed as: Angle information = (RGB - a) * b * π, where a and b are set values, for example, a can be 0.5 and b can be 2. Assuming X = (Ra)*b*π, Y = (Ga)*b*π, Z = (Ba)*b*π, then the color transformation matrix can be represented as: [sinY*cosZ, cosY*sinZ*sinX-sinY*cosX, cosY*sinZ*sinX+sinY*cosX, sinY*cosZ, sinY*cosX+sinY*sinZ*sinX, conY*sinZ*sinX-sinX*conZ, -sinZ, cosZ*sinX, sinZ*cosX].
[0067] The color adjustment amount can be a brightness value. In this embodiment, the process of determining the color adjustment amount based on color transformation information, normal direction, and view direction can be as follows: The color transformation matrix corresponding to the color transformation information is sequentially multiplied by the vector corresponding to the normal direction and the vector corresponding to the view direction to obtain the color adjustment amount. Finally, the color adjustment amount is accumulated with the initial color of the virtual object's vertex to obtain the target color. In this embodiment, adjusting the color of the virtual object's vertex based on preset color information processed by time information offset, normal direction, and view direction can generate a flashing effect where the virtual object dynamically changes with the movement of the target object. For example, such as... Figure 2 As shown, the "skirt" has a shimmering effect.
[0068] In this embodiment, the method of rendering a virtual object based on the target location information to obtain a target image can be as follows: sampling the current image according to the virtual 3D target object model and the virtual object model to obtain a target object sampling image; converting the target object sampling image into a first mask image; fusing the current image and the virtual object image based on the first mask image to obtain a target image; and rendering the target image onto the current screen.
[0069] The virtual 3D target object model can be a virtual 3D model that binds a standard target object model to the pose of the target object in the current image. The virtual object model can be understood as the 3D model corresponding to the virtual object. The process of sampling the current image based on the virtual 3D target object model and the virtual object model can be as follows: First, determine the occlusion relationship between the target object and the virtual object based on the virtual 3D target object model and the virtual object model. Based on this occlusion relationship, sample the pixels of the unoccluded target object from the current image to obtain the target object sampling map. For example, Figure 4a This is an example diagram of the target object sampling map in this embodiment, such as... Figure 4a As shown in the figure, the non-black areas represent the pixels of the target object that are not obscured.
[0070] Specifically, the method for converting the target object sampling image into a first mask image can be: identifying the target object in the target object sampling image to obtain the first mask image. For example, Figure 4b Here is an example image of the first mask image, such as... Figure 4b As shown in the figure, the white area represents the target object area.
[0071] Here, a virtual object graph can be understood as a 2D graph obtained by projecting a virtual object onto a screen based on the target's location information. For example, Figure 4c This is an example diagram of a virtual object in this embodiment, such as... Figure 4c As shown, the denim jacket in the image is a virtual object. Specifically, the method for fusing the current image and the virtual object image based on the first mask image can be as follows: determine the weighting weight based on the pixel values of the pixels in the first mask image, and then fuse the current image and the virtual object image based on this weighting weight. For example, assuming the pixel value of a pixel in the first mask image is 'a', then 'a' is used as the weighting weight of the current image, and 1-a is used as the weighting weight of the virtual object image. The fusion formula can then be expressed as: a * current image + (1-a) * virtual object image. For example, Figure 4d This is an example image of the target image in this embodiment. In this embodiment, the current image and the virtual object image are fused based on the first mask image corresponding to the target object sampling image, which can accurately fit the virtual object into the target object.
[0072] Optionally, the method for fusing the current image and the virtual object based on the first mask to obtain the target image can be: blurring the first mask; and fusing the current image and the virtual object based on the blurred first mask to obtain the target image.
[0073] The blurring process can employ any existing blurring algorithm, and is not limited here. The method for fusing the current image and the virtual object based on the blurred first mask image can be as follows: determine the weighting weights based on the pixel values of the pixels in the blurred first mask image, and then fuse the current image and the virtual object image based on these weighting weights. For example, assuming the pixel value of a pixel in the blurred first mask image is b, then b is used as the weighting weight of the current image, and 1-b is used as the weighting weight of the virtual object image. The fusion formula can then be expressed as: b * current image + (1-b) * virtual object image. In this embodiment, fusing the current image and the virtual object based on the blurred first mask image allows for a smooth transition between the target object and the virtual object.
[0074] Specifically, the method of fusing the current image and the virtual object to obtain the target image can be as follows: obtaining the virtual 3D target object model corresponding to the target object in the current image; determining the second mask map based on the normal direction and view direction of the virtual 3D target object model; and fusing the current image and the virtual object image based on the second mask map to obtain the target image.
[0075] In this embodiment, a standard target object model is bound to the pose of the target object in the current image to obtain a virtual 3D target object model. The normal direction of the virtual 3D target object model can be understood as the normal direction of the cross-section of the 3D point in the virtual 3D target object model, and the view direction of the virtual 3D target object model can be the direction from the camera optical center to the 3D point in the virtual 3D target object model. The method for determining the second mask based on the normal direction and view direction of the virtual 3D target object model can be: performing a dot product between the normal direction and the view direction, and using the result as the pixel value of the pixel in the second mask. The method for fusing the current image and the virtual object image based on the second mask can be: determining a weighting weight based on the pixel value of the pixel in the second mask, and fusing the current image and the virtual object image based on this weighting weight. For example, assuming the pixel value of the pixel in the second mask is c, then c is used as the weighting weight of the current image, and 1-c is used as the weighting weight of the virtual object image. The fusion formula can be expressed as: c*current image + (1-c)*virtual object image. In this embodiment, the current image and the virtual object image are fused based on the second mask image determined by the normal direction and the view direction of the virtual 3D target object model, which can improve the fusion efficiency.
[0076] Optionally, before obtaining the skeletal point position information of the target object in the current image, the following steps are also included: rendering and displaying the virtual object gradually in a set order within a set time period based on the initial position information of the virtual object's vertices and / or texture coordinates.
[0077] The order can be set from top to bottom, bottom to top, left to right, or right to left. The duration can be any value between 1 and 2 seconds. Gradual rendering can be achieved through iterative rendering or gradual rendering by region. In this application scenario, when a user enters the clothing try-on tool and a person is detected, the clothing to be tried on begins to be displayed in a gradual manner.
[0078] In this embodiment, the method of iteratively rendering and displaying virtual objects in a set order within a set time period based on the initial position information and / or texture coordinates of the virtual object vertices can be as follows: Determine the virtual object vertices to be displayed at each moment within the set time period based on the initial position information and / or texture coordinates, and display the virtual object vertices to be displayed in the corresponding frames at each moment, thereby obtaining a video of the virtual object gradually being displayed. For example, Figures 5a-5b To display an example image of a virtual object, such as Figure 5a As shown, this moment displays a portion of the clothing, such as... Figure 5b As shown, the clothing is fully displayed. In this embodiment, iterative display of virtual objects can improve the display effect.
[0079] Specifically, the method of iteratively rendering and displaying virtual objects in a set order within a set time period based on the initial position information and / or texture coordinates of the virtual object vertices can be as follows: for the current moment within the set time period, determine the control parameters based on the current moment; determine the target reference value based on the initial position information and / or texture coordinates of the virtual object vertices; determine the virtual object vertices to be displayed at the current moment based on the target reference value and control parameters; and render the virtual object vertices to be displayed at the current moment.
[0080] One way to determine control parameters based on the current time is to obtain the progress within a set duration at the current time and determine the control parameters based on the progress. For example, assuming the set duration is T and the duration between the current time and the start time is t, then the progress is t / T, and the progress can be used as the control parameter.
[0081] The target reference value is used to determine whether the corresponding virtual object vertex should be rendered. Specifically, the target reference value can be determined based on the initial position information and / or texture coordinates of the virtual object vertex as follows: determine a first reference value based on the initial position information of the virtual object vertex; sample grayscale values from a set noise map based on the texture coordinates of the virtual object vertex, and determine the sampled grayscale values as a second reference value; determine the target reference value based on the first reference value and / or the second reference value.
[0082] The initial position information of the virtual object's vertices can be understood as the initial three-dimensional coordinates of the vertices constituting the virtual object in the world coordinate system, i.e., the initial position information includes three coordinate components: x, y, and z. The process of determining the first reference value based on the initial position information of the virtual object's vertices can be as follows: First, calculate the distance between the virtual object's vertex projected onto the xz plane and the origin; then, perform a linear transformation on this distance; next, perform an exponential calculation on the y component; finally, sum the linear transformation result and the exponential transformation result to obtain the first reference value. The distance between the virtual object's vertex projected onto the xz plane and the origin can be represented as length(xz), and the exponential calculation of the y component can be represented as pow(y, a), meaning to calculate y raised to the power of a. Therefore, the formula for calculating the first reference value can be: First reference value = (1 - b * length(xz)) * c + pow(y * d, a) * e, where a, b, c, d, and e are set values. Optionally, after obtaining the first reference value, the value range of the first reference value can be restricted to a set range, and then an exponential calculation can be performed on the first reference value after the value range is restricted. The set range can be 0-1.5.
[0083] Here, texture coordinates can be understood as the coordinates of the surface texture corresponding to the virtual object. The surface texture and the set noise map have the same size, meaning that each pixel corresponds to a pixel. Therefore, the grayscale value corresponding to each pixel in the set noise map can be sampled based on the texture coordinates, and finally, the grayscale value is used as the second reference value. Optionally, the second reference value can also be multiplied by a set influence factor to obtain the final second reference value.
[0084] Specifically, determining the target reference value based on the first reference value and / or the second reference value can be understood as: using the first reference value as the target reference value, or using the second reference value as the target reference value, or using the weighted sum of the first and second reference values as the target reference value. In this embodiment, determining the target reference value based on the initial position information and / or texture coordinates can improve calculation accuracy.
[0085] Specifically, the method for determining the virtual object vertex to be displayed at the current moment based on the target reference value and control parameters can be as follows: if the target reference value is less than the control parameters, then the virtual object vertex is the virtual object vertex to be displayed; if the target reference value is greater than or equal to the control parameters, then the virtual object vertex is the virtual object vertex to be displayed.
[0086] Correspondingly, the way to render the virtual object vertices to be displayed at the current moment can be: determine the special effect color of the virtual object vertices according to the target reference value and control parameters; and render the virtual object vertices to be displayed at the current moment according to the special effect color.
[0087] In this embodiment, if the target reference value is less than the control parameter, it indicates that the corresponding virtual object vertex does not need to be rendered at the current moment, and therefore the virtual object vertex is ignored. If the target reference value is greater than or equal to the control parameter, it indicates that the corresponding virtual object vertex needs to be rendered at the current moment. In this case, it is necessary to determine the special effect color corresponding to the virtual object vertex, and then render the virtual object at the current moment according to the special effect color. In this embodiment, the object vertex to be rendered at the current moment is determined by comparing the target reference value and the control parameter, so that the virtual object presents a gradual display effect.
[0088] Specifically, the method for determining the special effect color of virtual object vertices based on the target reference value and control parameters can be as follows: obtain the special effect control range; perform smooth transition processing on the target reference value based on the special effect control range and control parameters to obtain the special effect adjustment amount; adjust the set color based on the special effect adjustment amount to obtain the special effect color.
[0089] This includes upper and lower limits for special effects control. The range of special effects control is user-configurable and not limited here. The smooth transition processing can be performed using a defined smooth transition processing function, such as the `smoothstep` function. In this embodiment, the process of smoothing the target reference quantity based on the special effects control range and control parameters can be as follows: First, perform a first smooth transition processing on the target reference quantity based on the control parameters and the upper limit of special effects control to obtain a first sub-special effects adjustment amount; then, perform a second smooth transition processing on the target reference quantity based on the control parameters, the upper limit of special effects control, and the lower limit of special effects control to obtain a second sub-special effects adjustment amount; finally, sum the first and second sub-special effects adjustment amounts to obtain the final special effects adjustment amount. For example, the first smooth transition process can be represented as: smoothstep(U, U+a*D1, A), and the second smooth transition process can be represented as: smoothstep(Ua*D2, U+a*D1, A), where U represents the control parameter, D1 represents the upper limit value of the effect control, D2 represents the lower limit value of the effect control, A represents the target reference value, and a is a set value, for example, a is 0.1.
[0090] In this embodiment, adjusting the set color based on the effect adjustment amount can be achieved by multiplying the effect adjustment amount by the set color to obtain the effect color. In this embodiment, smoothing the transition of the target reference amount based on the effect control range and control parameters can generate an edge-glowing effect.
[0091] The technical solution of this disclosure includes: acquiring the skeletal point position information of a target object in the current image and the initial position information of the vertices of a virtual object; transforming the initial position information based on the skeletal point position information to obtain intermediate position information; updating the intermediate position information of at least some vertices of the virtual object based on set material information to obtain target position information; and rendering the virtual object based on the target position information to obtain a target image; wherein the target object in the target image wears the virtual object. The virtual object rendering method provided by this disclosure transforms the initial position information based on the skeletal point position information of the target object and updates the intermediate position information of at least some vertices of the virtual object based on set material information, enabling the virtual object to closely match the movement of the target object and giving the virtual object the dynamism and texture of a real object, thus improving the rendering effect.
[0092] Figure 6 This is a schematic diagram of the structure of a virtual object rendering apparatus provided in an embodiment of the present disclosure, as shown below. Figure 6 As shown, the device includes:
[0093] The acquisition module 610 is used to acquire the skeletal point position information of the target object in the current image and the initial position information of the virtual object vertices; wherein, the virtual object vertices are the vertices of the 3D model corresponding to the virtual object;
[0094] The position information transformation module 620 is used to transform the initial position information based on the skeletal point position information to obtain intermediate position information;
[0095] The target position information acquisition module 630 is used to update the middle position information of at least some vertices of the virtual object based on the set material information to obtain the target position information;
[0096] The rendering module 640 is used to render the virtual object based on the target location information to obtain a target image; wherein the target object in the target image is wearing the virtual object.
[0097] Optionally, the location information transformation module 620 is also used for:
[0098] Obtain multiple skeletal points associated with the vertices of the virtual object and the weights of the influence of the multiple skeletal points on the position of the vertices of the virtual object;
[0099] Vertex transformation information is determined based on the position information of the multiple skeletal points and the position influence weights.
[0100] The initial position information is transformed based on the vertex transformation information to obtain the intermediate position information.
[0101] Optionally, the target location information acquisition module 630 is also used for:
[0102] Obtain the set material information and the motion state of the virtual object's vertices;
[0103] Based on the intermediate position information, the set material information, and the motion state, the set material is calculated for at least some vertices of the virtual object to obtain the target position information.
[0104] Optionally, the target location information acquisition module 630 is also used for:
[0105] If a virtual object support is set in the current scene;
[0106] Obtain support information based on the virtual object support;
[0107] Based on the intermediate position information, the material parameters, the motion state, and the support information, the material of at least some vertices of the virtual object is calculated.
[0108] Optionally, the rendering module 640 is also used for:
[0109] Based on the texture coordinates of the virtual object's vertices, preset color information is sampled from the color noise map;
[0110] The preset color information is offset based on the time information of the current image;
[0111] The initial color of the virtual object's vertices is adjusted based on the preset color information after offset processing and the target position information to obtain the target color;
[0112] The virtual object is rendered based on the target location information and the target color to obtain a target image.
[0113] Optionally, the rendering module 640 is also used for:
[0114] The normal direction and view direction of the virtual object's vertex are determined based on the target location information;
[0115] The color transformation information is determined based on the preset color information after offset processing;
[0116] The color adjustment amount is determined based on the color transformation information, the normal direction, and the viewing direction.
[0117] The target color is obtained by adding the color adjustment amount to the initial color of the virtual object's vertex.
[0118] Optionally, the rendering module 640 is also used for:
[0119] The current image is sampled based on the virtual 3D target object model and the virtual object model to obtain a target object sampling image;
[0120] Convert the target object sampling image into a first mask image;
[0121] The target image is obtained by fusing the current image and the virtual object image based on the first mask image;
[0122] Render the target image onto the current screen.
[0123] Optionally, the rendering module 640 is also used for:
[0124] The first mask image is blurred.
[0125] The target image is obtained by fusing the current image and the virtual object based on the first mask image after blurring.
[0126] Optionally, the rendering module 640 is also used for:
[0127] Obtain the virtual 3D target object model corresponding to the target object in the current image;
[0128] The second mask is determined based on the normal direction and view direction of the virtual 3D target object model;
[0129] The target image is obtained by fusing the current image and the virtual object image based on the second mask image.
[0130] Optionally, it also includes: a virtual object display module, used for,
[0131] The virtual object is rendered and displayed gradually in a set order within a set time period based on the initial position information of the virtual object's vertices and / or texture coordinates.
[0132] Optionally, the virtual object display module is also used for:
[0133] For the current moment within the set time period, the control parameters are determined based on the current moment;
[0134] The target reference value is determined based on the initial position information of the virtual object's vertices and / or texture coordinates;
[0135] The vertices of the virtual object to be displayed at the current moment are determined based on the target reference value and control parameters;
[0136] Render the vertices of the virtual object to be displayed at the current moment.
[0137] The virtual object rendering apparatus provided in this disclosure can execute the virtual object rendering method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of executing the method.
[0138] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.
[0139] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Refer to the following... Figure 7 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 7 The diagram below shows the structure of the terminal device or server 500. The terminal device in this embodiment may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and vehicle terminals (e.g., vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 7 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0140] like Figure 7 As shown, electronic device 500 may include a processing unit (e.g., central processing unit, graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from storage device 508 into random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. An edit / output (I / O) interface 505 is also connected to bus 504.
[0141] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 7An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0142] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure 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 a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, it performs the functions defined in the methods of embodiments of this disclosure.
[0143] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0144] The electronic device provided in this embodiment and the virtual object rendering method provided in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0145] This disclosure provides a computer storage medium storing a computer program that, when executed by a processor, implements the virtual object rendering method provided in the above embodiments.
[0146] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0147] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0148] 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.
[0149] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to:
[0150] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: acquire skeletal point position information of a target object in a current image and initial position information of vertices of a virtual object; transform the initial position information based on the skeletal point position information to obtain intermediate position information; update the intermediate position information of at least some vertices of the virtual object based on set material information to obtain target position information; and render the virtual object based on the target position information to obtain a target image; wherein the target object in the target image wears the virtual object.
[0151] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but 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).
[0152] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0153] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0154] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0155] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0156] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0157] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0158] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for rendering virtual objects, characterized in that, include: The system acquires the skeletal point position information of the target object in the current image and the initial position information of the virtual object vertices; wherein, the virtual object vertices are the vertices of the 3D model corresponding to the virtual object, the target object is a person object in one frame of an image or video captured in real time, the skeletal point position information is the three-dimensional coordinates of the skeletal key points in the world coordinate system, and the initial position information is the three-dimensional coordinates of the virtual object vertices in the world coordinate system. The initial position information is transformed based on the skeletal point position information to obtain intermediate position information, wherein the position information of the virtual object vertices changes with the change of the skeletal point position information of the target object; The target position information is obtained by updating the intermediate position information of at least some vertices of the virtual object based on the set material information. The set material information is a parameter used to characterize the material properties, including at least one of air resistance, tensile coefficient, compressive coefficient and bending coefficient. The virtual object is rendered based on the target location information to obtain a target image; wherein, the target object in the target image is wearing the virtual object; Rendering the virtual object based on the target location information to obtain a target image includes: Based on the texture coordinates of the virtual object's vertices, preset color information is sampled from the color noise map, wherein the color noise map and the surface texture of the virtual object have the same size, and the pixels of the color noise map and the surface texture of the virtual object correspond one-to-one. The preset color information is offset based on the time information of the current image, wherein the time information of the current image is the timestamp information of the current image in the video; The initial color of the virtual object's vertices is adjusted based on the preset color information after offset processing and the target position information to obtain the target color; The virtual object is rendered based on the target location information and the target color to obtain a target image; The initial colors of the virtual object vertices are adjusted based on the preset color information after offset processing and the target position information to obtain the target color, including: The normal direction and view direction of the virtual object's vertex are determined based on the target location information; The color transformation information is determined based on the preset color information after offset processing; The color adjustment amount is determined based on the color transformation information, the normal direction, and the viewing direction. The target color is obtained by adding the color adjustment amount to the initial color of the virtual object's vertex.
2. The method according to claim 1, characterized in that, Transforming the initial position information based on the skeletal point position information includes: Obtain multiple skeletal points associated with the vertices of the virtual object and the weights of the influence of the multiple skeletal points on the position of the vertices of the virtual object; Vertex transformation information is determined based on the position information of the multiple skeletal points and the position influence weights. The initial position information is transformed based on the vertex transformation information to obtain the intermediate position information.
3. The method according to claim 1, characterized in that, Based on the set material information, the intermediate position information of at least some vertices of the virtual object is updated to obtain the target position information, including: Obtain the set material information and the motion state of the virtual object vertices; Based on the intermediate position information, the set material information, and the motion state, the set material is calculated for at least some vertices of the virtual object to obtain the target position information.
4. The method according to claim 3, characterized in that, Based on the intermediate position information, the set material information, and the motion state, the set material is calculated for at least some vertices of the virtual object, including: If a virtual object support is set in the current scene; Obtain support information based on the virtual object support; Based on the intermediate position information, the set material information, the motion state, and the support information, the set material is calculated for at least some vertices of the virtual object.
5. The method according to claim 1, characterized in that, The virtual object model is a 3D model corresponding to the virtual object. The virtual object is rendered based on the target location information to obtain a target image, including: The current image is sampled based on the virtual 3D target object model and the virtual object model to obtain a target object sampling image; Convert the target object sampling image into a first mask image; The target image is obtained by fusing the current image and the virtual object image based on the first mask image, wherein the virtual object image is a 2D image obtained by projecting a virtual object onto the screen according to the target position information; Render the target image onto the current screen.
6. The method according to claim 5, characterized in that, The target image is obtained by fusing the current image and the virtual object image based on the first mask image, including: The first mask image is blurred. The target image is obtained by fusing the current image and the virtual object image based on the first mask image after blurring.
7. The method according to claim 1, characterized in that, Rendering the virtual object based on the target location information to obtain a target image includes: Obtain the virtual 3D target object model corresponding to the target object in the current image; The second mask is determined based on the normal direction and view direction of the virtual 3D target object model; The target image is obtained by fusing the current image and the virtual object image based on the second mask image, wherein the virtual object image is a 2D image obtained by projecting the virtual object onto the screen according to the target position information; Render the target image onto the current screen.
8. The method according to claim 1, characterized in that, Before obtaining the skeletal point location information of the target object in the current image, the following steps are also included: The virtual object is rendered and displayed gradually in a set order within a set time period based on the initial position information of the virtual object's vertices and / or texture coordinates.
9. The method according to claim 8, characterized in that, Based on the initial position information of the virtual object's vertices and / or texture coordinates, the virtual object is gradually rendered and displayed in a set order over a set time period, including: For the current moment within the set time period, the control parameters are determined based on the current moment; The target reference value is determined based on the initial position information of the virtual object's vertices and / or texture coordinates; The vertices of the virtual object to be displayed at the current moment are determined based on the target reference value and the control parameters; Render the vertices of the virtual object to be displayed at the current moment.
10. A rendering device for virtual objects, characterized in that, include: The acquisition module is used to acquire the skeletal point position information of the target object in the current image and the initial position information of the virtual object vertices; wherein, the virtual object vertices are the vertices of the 3D model corresponding to the virtual object, the target object is a person object in one frame of an image or video captured in real time, the skeletal point position information is the three-dimensional coordinates of the skeletal key points in the world coordinate system, and the initial position information is the three-dimensional coordinates of the virtual object vertices in the world coordinate system. The position information transformation module is used to transform the initial position information based on the skeletal point position information to obtain intermediate position information, wherein the position information of the virtual object vertex changes with the change of the skeletal point position information of the target object; The target position information acquisition module is used to update the intermediate position information of at least some vertices of the virtual object based on the set material information to obtain the target position information. The set material information is used to characterize the material properties, including at least one of air resistance, tensile coefficient, compressive coefficient and bending coefficient. A rendering module is used to render the virtual object based on the target location information to obtain a target image; wherein, the target object in the target image wears the virtual object; The rendering module is also used for: Based on the texture coordinates of the virtual object's vertices, preset color information is sampled from the color noise map, wherein the color noise map and the surface texture of the virtual object have the same size, and the pixels of the color noise map and the surface texture of the virtual object correspond one-to-one. The preset color information is offset based on the time information of the current image, wherein the time information of the current image is the timestamp information of the current image in the video; The initial color of the virtual object's vertices is adjusted based on the preset color information after offset processing and the target position information to obtain the target color; The virtual object is rendered based on the target location information and the target color to obtain a target image; The rendering module is also used for: The normal direction and view direction of the virtual object's vertex are determined based on the target location information; The color transformation information is determined based on the preset color information after offset processing; The color adjustment amount is determined based on the color transformation information, the normal direction, and the viewing direction. The target color is obtained by adding the color adjustment amount to the initial color of the virtual object's vertex.
11. An electronic device, characterized in that, The electronic device includes: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the rendering method for virtual objects as described in any one of claims 1-9.
12. A storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a rendering method for a virtual object as described in any one of claims 1-9.
Citation Information
Patent Citations
Image processing method and device
CN112258611A
Image processing method and device, computer equipment and storage medium
CN112933597A
Virtual hair dyeing method and device, electronic equipment and storage medium
CN113450431A
Starry sky simulation method, star sky simulation device, computer equipment and medium
CN114470756A
Virtual character simulation and live broadcast method and device, equipment and storage medium
CN114565705A