CN113763525B - Hair highlight rendering method, device, equipment and storage medium - Google Patents

Hair highlight rendering method, device, equipment and storage medium Download PDF

Info

Publication number
CN113763525B
CN113763525B CN202010485280.5A CN202010485280A CN113763525B CN 113763525 B CN113763525 B CN 113763525B CN 202010485280 A CN202010485280 A CN 202010485280A CN 113763525 B CN113763525 B CN 113763525B
Authority
CN
China
Prior art keywords
highlight
adjusted
hair
target
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010485280.5A
Other languages
Chinese (zh)
Other versions
CN113763525A (en
Inventor
冯乐乐
贺甲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Mihoyo Tianming Technology Co Ltd
Original Assignee
Shanghai Mihoyo Tianming Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Mihoyo Tianming Technology Co Ltd filed Critical Shanghai Mihoyo Tianming Technology Co Ltd
Priority to CN202010485280.5A priority Critical patent/CN113763525B/en
Publication of CN113763525A publication Critical patent/CN113763525A/en
Application granted granted Critical
Publication of CN113763525B publication Critical patent/CN113763525B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/50Lighting effects
    • G06T15/506Illumination models

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the invention discloses a method, a device, equipment and a storage medium for hair highlight rendering. The method comprises the following steps: obtaining a hair type, a position to be adjusted and a highlight parameter to be adjusted of a target hair, and screening a target mapping map from curve mapping maps generated in advance according to the hair type; obtaining an adjustment value corresponding to the position to be adjusted according to the target mapping, carrying out value adjustment on the highlight parameter to be adjusted according to the adjustment value, and taking the highlight parameter to be adjusted after the value adjustment as an adjusted highlight parameter; and performing high-light rendering on the target luminous sheet according to the high-light control parameters, wherein the high-light control parameters comprise a half-vector direction and adjusted high-light parameters. According to the technical scheme, the degree of freedom of highlight rendering of each hair piece is improved based on the target mapping map, so that each hair piece is more similar to the stylized artistic effect of art original painting drawing, and the effect of stylized control on the highlight rendering of hair is achieved.

Description

Hair highlight rendering method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computer application, in particular to a method, a device, equipment and a storage medium for hair highlight rendering.
Background
The light source reflects into the human eye after striking the object, and the brightest portion of the object is called the highlight. For a long time, hair highlight rendering is a major issue in three-rendering two-card rendering, and stylized rendering has stronger art controllability in highlight brightness and highlight shape than photo-level realistic rendering.
However, since there is a difference in hairstyles of each cartoon character, the existing stylized rendering scheme has to be improved in the control effect of the hair highlighting.
Disclosure of Invention
The embodiment of the invention provides a hair highlight rendering method, device, equipment and storage medium, which are used for realizing the effect of stylized control on hair highlight rendering.
In a first aspect, an embodiment of the present invention provides a hair highlight rendering method, which may include:
obtaining a hair type, a position to be adjusted and a highlight parameter to be adjusted of a target hair, and screening a target mapping map from curve mapping maps generated in advance according to the hair type; obtaining an adjustment value corresponding to the position to be adjusted according to the target mapping, carrying out value adjustment on the highlight parameter to be adjusted according to the adjustment value, and taking the highlight parameter to be adjusted after the value adjustment as an adjusted highlight parameter; and performing high-light rendering on the target luminous sheet according to the high-light control parameters, wherein the high-light control parameters comprise a half-vector direction and adjusted high-light parameters.
Optionally, the highlight control parameters include a highlight position control parameter and a highlight shape control parameter, the highlight position control parameter includes a half vector direction, and the adjusted highlight parameter includes an adjusted highlight smoothness;
the performing highlight rendering on the target lighting fixture according to the highlight control parameter may include:
controlling the highlight position of the target hair piece according to the highlight position control parameter, wherein the highlight position control parameter also comprises the preset direction of the hair model and the highlight range of the hair piece; controlling the highlight shape of the target lighting fixture according to the highlight shape control parameters, wherein the highlight shape control parameters comprise a highlight position, a lighting fixture highlight width and a lighting fixture texture coordinate; and carrying out smoothing treatment on the highlight shape according to the adjusted highlight smoothness, updating the highlight shape according to a smoothing treatment result, generating anisotropic highlight according to the highlight shape, and carrying out highlight rendering on the target luminous sheet based on the anisotropic highlight.
Optionally, the highlight control parameter further includes a tangential direction of the target lighting segment, and the adjusted highlight parameter includes an adjusted highlight smoothness; the performing highlight rendering on the target lighting fixture according to the highlight control parameter may include:
and generating anisotropic highlights according to the tangential direction, the half vector direction and the adjusted highlight smoothness, and performing highlight rendering on the target hair piece based on the anisotropic highlights.
Optionally, the highlight control parameter further includes a highlight offset and a normal direction of the target lighting segment; generating anisotropic highlights from tangential direction, semi-vector direction, and adjusted highlights smoothness may include:
sampling a preset noise map, obtaining a jitter value according to a sampling result, performing jitter processing on the high light offset according to the jitter value, and updating the high light offset according to a jitter processing result; and interpolating the tangential direction to the normal direction based on the specular deviation, and generating anisotropic specular according to the interpolation result, the half vector direction and the adjusted specular smoothness.
Optionally, after generating the anisotropic highlight, the method further comprises: and carrying out remapping treatment on the anisotropic highlight based on a preset remapping curve, and updating the anisotropic highlight according to a remapping treatment result.
Optionally, the number of anisotropic highlights is at least two, the adjusted highlight parameter further comprises an adjusted highlight color, the number of adjusted highlight colors being the same as the number of anisotropic highlights; performing highlight rendering on the target hair piece based on anisotropic highlighting can comprise: and (3) performing superposition processing on each anisotropic highlight and each adjusted highlight color, and performing highlight rendering on the target hair according to the superposition processing result.
Optionally, the texture coordinates of the hair piece are determined according to a predetermined texture map or three-dimensional points in the hair model, and/or the tangential direction is determined according to three-dimensional points or predetermined tangential maps.
In a second aspect, an embodiment of the present invention further provides a hair highlight rendering device, which may include:
the data acquisition module is used for acquiring the hair type, the position to be adjusted and the highlight parameter to be adjusted of the target hair, and screening the target mapping map from the curve mapping maps generated in advance according to the hair type;
the numerical value adjusting module is used for obtaining an adjusting numerical value corresponding to the position to be adjusted according to the target mapping map, carrying out numerical value adjustment on the highlight parameter to be adjusted according to the adjusting numerical value, and taking the highlight parameter to be adjusted after the numerical value adjustment as an adjusted highlight parameter;
and the hair highlight rendering module is used for performing highlight rendering on the target luminous sheet according to the highlight control parameters, wherein the highlight control parameters comprise a half vector direction and adjusted highlight parameters.
In a third aspect, an embodiment of the present invention further provides an apparatus, which may include:
one or more processors;
a memory for storing one or more programs;
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the hair highlighting method provided by any of the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention further provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the hair highlight rendering method provided by any of the embodiments of the present invention.
According to the technical scheme, the target mapping map corresponding to the hair type is screened out from the curve mapping maps generated in advance according to the hair type by acquiring the hair type, the position to be adjusted and the highlight parameter to be adjusted of the target hair; furthermore, an adjustment value corresponding to the position to be adjusted is obtained from the target mapping map, the value of the highlight parameter to be adjusted on the position to be adjusted is adjusted according to the adjustment value, and the highlight parameter to be adjusted after the value adjustment is used as the adjusted highlight parameter; thus, the target hair piece is subjected to highlight rendering according to the half vector direction and the adjusted highlight parameters. According to the technical scheme, the degree of freedom of highlight rendering of each hair piece is improved based on the target mapping map, so that each hair piece is more similar to the stylized artistic effect of art original painting drawing, and the effect of stylized control on the highlight rendering of hair is achieved.
Drawings
FIG. 1 is a flow chart of a hair highlighting method according to a first embodiment of the present invention;
FIG. 2a is a first schematic diagram of a predetermined remapping curve according to a first embodiment of the present invention;
FIG. 2b is a second diagram of a predetermined remapping curve according to a first embodiment of the present invention;
FIG. 3 is a flow chart of a hair highlighting method according to a second embodiment of the present invention;
FIG. 4 is a schematic diagram of a hair structure in a second embodiment of the invention;
FIG. 5 is a schematic diagram of a predetermined noise map in a second embodiment of the present invention;
FIG. 6 is a flow chart of a hair highlighting method according to a third embodiment of the present invention;
FIG. 7a is a schematic diagram of a mapping curve of high smoothness in a third embodiment of the present invention;
FIG. 7b is a diagram of a mapping curve of high optical offset in a third embodiment of the present invention;
FIG. 7c is a diagram of a mapping curve of highlight color in a third embodiment of the present invention;
FIG. 8a is a first application effect diagram after highlighting hair in a third embodiment of the present invention;
FIG. 8b is a second application effect diagram after the hair highlight rendering in the third embodiment of the present invention;
FIG. 8c is a third application effect diagram after the hair highlight rendering in the third embodiment of the present invention;
FIG. 8d is a fourth application effect diagram after the hair highlight rendering in the third embodiment of the present invention;
FIG. 8e is a fifth application effect diagram after the hair highlight rendering in the third embodiment of the present invention;
FIG. 8f is a sixth application effect diagram after highlighting hair in a third embodiment of the present invention;
fig. 9 is a block diagram showing a structure of a hair highlight rendering device according to a fourth embodiment of the present invention;
fig. 10 is a schematic structural diagram of an apparatus in a fifth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Before describing the embodiment of the present invention, an application scenario of the embodiment of the present invention is described in an exemplary manner: three-rendering two-card rendering is to render a 3D model into a two-dimensional (2D) image, which has high manufacturing efficiency and allows some difficult 2D images to be quickly formed. To simulate the real situation, the three-dimensional (three dimensional, 3D) model has a bulge with a recess, a region facing the light source and a region facing away from the light source, and the light source can show different bright and dark effects when irradiated on different regions of the 3D model. It should be noted that, after the 3D model is rendered into the 2D image, the light-shadow characteristic of the 3D model needs to be preserved in the 2D image. However, if the 3D model is directly rendered onto the 2D image, the highlight shadows of the 3D model projected on the 2D image after the 3D model is irradiated by the shadows are very finely divided, which is particularly apparent in the aspect of hair highlight rendering, and poor controllability of the shadow characteristics causes poor aesthetic properties of the 2D image.
To solve this problem, a stylized rendering scheme has been developed, via which a 2D image generated by rendering can maintain an aesthetic sense while conforming to a shadow characteristic. Specifically, the 2D image generated based on the stylized rendering only needs to conform to the light and shadow characteristics, and does not need to be exactly the same as the light and shade effects exhibited by the light and shadow characteristics of the real world. For example, on a 2D image, the bright area is still bright, the dark area is still dark, but how bright is, how dark the bright area is, what the highlight is, what the shadow is, which are all controllable, not necessarily exactly the same highlight shadow in the real world.
Example 1
Fig. 1 is a flowchart of a hair highlighting method according to a first embodiment of the present invention. The embodiment is applicable to the situation of rendering the hair highlights, and is particularly applicable to the situation of stylized rendering of the hair highlights. The method can be performed by the hair highlight rendering device provided by the embodiment of the invention, the device can be realized by software and/or hardware, and the device can be integrated on various user terminals or servers. Referring to fig. 1, the method of the embodiment of the present invention specifically includes the following steps:
S110, obtaining the hair type, the position to be adjusted and the highlight parameter to be adjusted of the target hair, and screening the target mapping map from the curve mapping maps generated in advance according to the hair type.
The hair comprises at least one hair piece, and the target hair piece is a hair piece which needs to be subjected to numerical adjustment on the highlight parameter to be adjusted in each hair piece. The hair types of the hair pieces may be the same or different, each hair piece type has a target mapping map corresponding to the hair piece type, and a curve mapping map can be generated based on the target mapping maps corresponding to the hair piece types respectively, for example, a set of the target mapping maps is used as the curve mapping map; then, generating curve mapping maps after combining the target mapping maps, wherein each target mapping map is a row or a column in the curve mapping map; etc., and are not particularly limited herein. Thus, after the hair type of the target hair is obtained, the target mapping map can be screened from the curve mapping maps generated in advance according to the hair type. The positions to be adjusted are positions on the target hair pieces, which need to be adjusted in numerical value, and the number of the positions to be adjusted on each target hair piece can be one, two or more. The highlight parameter to be adjusted is a highlight parameter on the target light emitting sheet, such as at least one of highlight smoothness, highlight color and highlight offset, and further such as highlight jitter degree, etc., which needs to be adjusted in numerical value.
And S120, obtaining an adjustment value corresponding to the position to be adjusted according to the target mapping map, carrying out value adjustment on the highlight parameter to be adjusted according to the adjustment value, and taking the highlight parameter to be adjusted after the value adjustment as the adjusted highlight parameter.
The target mapping map stores a mapping curve capable of remapping the highlight parameter to be adjusted, a first axial direction of the mapping curve can be a position to be adjusted, and a second axial direction of the mapping curve can be an adjustment value, so that a corresponding adjustment value can be obtained from the target mapping map according to the position to be adjusted, and the highlight parameter to be adjusted on the position to be adjusted can be adjusted according to the adjustment value. Optionally, if the number of positions to be adjusted is at least two, an adjustment value corresponding to each position to be adjusted can be obtained from the target mapping map. Alternatively, if the number of the highlight parameters to be adjusted at a certain position to be adjusted is at least two, the adjustment values corresponding to the highlight parameters to be adjusted respectively can be obtained from the target mapping map. It should be understood by those skilled in the art that the adjustment values of the respective highlight parameters to be adjusted at each position to be adjusted may be the same or different; accordingly, the adjustment values of the same highlight parameter to be adjusted in each position to be adjusted may be the same or different, and are not specifically limited herein. After the adjustment value corresponding to the position to be adjusted is obtained, the value of the highlight parameter to be adjusted on the position to be adjusted can be adjusted according to the adjustment value, and the highlight parameter to be adjusted after the value adjustment is used as the adjusted highlight parameter.
On the basis, optionally, when the value of the highlight parameter to be adjusted is adjusted according to the adjustment value, the reference value of the highlight parameter to be adjusted can be obtained first, and then the reference value is adjusted according to the adjustment value. For example, taking the scaling factor as the adjustment value and the highlight parameter to be adjusted as the highlight smoothness as an example, the scaling factors corresponding to 1000,3 positions to be adjusted as the reference value of the highlight smoothness are respectively 1.2, 0.8 and 0.6, and the highlight smoothness after adjustment by the scaling factors are respectively 1200, 800 and 600, the widths of the highlight lines at different positions to be adjusted on the same target hair piece are not the same, some highlight lines are wider, and some highlight lines are narrower, thereby improving the degree of freedom of highlight rendering of the target hair piece.
S130, performing highlight rendering on the target luminous sheet according to the highlight control parameters, wherein the highlight control parameters comprise a half vector direction and adjusted highlight parameters.
In the video picture, the light source direction and the viewing angle direction are changed continuously along with the time, the light source direction can be regarded as the direction of light irradiation, and the viewing angle direction can be regarded as the observation direction of a camera, so that the head highlight can be controlled in real time according to the light source direction and the viewing angle direction. On this basis, the half vector direction is determined according to the light source direction and the viewing angle direction at the current time, for example, it may be determined by normalizing the light source direction and the viewing angle direction at the current time. In this way, anisotropic highlighting may be generated according to a highlighting parameter, which may include a half vector direction and an adjusted highlighting parameter, and the target lighting tile may be further highlighting based on the anisotropic highlighting. In addition, in the positive spherical hair model, the isotropic highlighting is dot-shaped, while the anisotropic highlighting is ring-shaped, for example, the anisotropic highlighting can present a line on the hair Liu Haishang, which is more attractive.
On the other hand, because the same adjusted highlight parameter at different positions on the target hair piece is no longer a single fixed constant value, after the target hair piece is subjected to highlight rendering according to the adjusted highlight parameter and the half vector direction, the highlight rendering of the target hair piece can be obtained with more stylized hair, such as narrow in the middle and wide at two sides, further such as wide in the middle and narrow at two sides, further such as sharp change, further such as gentle change, and the like, and the degree of freedom of highlight rendering of the target hair piece is improved. On the other hand, when the hair is formed by at least two hair pieces, the highlight parameters to be adjusted can be modified piece by piece, at this time, because the hair piece types of different hair pieces may have differences, this means that there may be differences in the target mapping maps corresponding to different hair pieces, and further there may be differences in the same adjusted highlight parameters of different hair pieces, thereby improving the degree of freedom of highlight rendering of each hair piece, and each hair piece has a highlight rendering effect with a stronger style.
According to the technical scheme, the target mapping map corresponding to the hair type is screened out from the curve mapping maps generated in advance according to the hair type by acquiring the hair type, the position to be adjusted and the highlight parameter to be adjusted of the target hair; furthermore, an adjustment value corresponding to the position to be adjusted is obtained from the target mapping map, the value of the highlight parameter to be adjusted on the position to be adjusted is adjusted according to the adjustment value, and the highlight parameter to be adjusted after the value adjustment is used as the adjusted highlight parameter; thus, the target hair piece is subjected to highlight rendering according to the half vector direction and the adjusted highlight parameters. According to the technical scheme, the degree of freedom of highlight rendering of each hair piece is improved based on the target mapping map, so that each hair piece is more similar to the stylized artistic effect of art original painting drawing, and the effect of stylized control on the highlight rendering of hair is achieved.
An optional technical scheme is that a target mapping map can be generated by acquiring a mapping curve corresponding to the highlight parameters to be adjusted and the hair type and encoding the mapping curve. The different highlight parameters to be adjusted of the same hair type may correspond to different mapping curves, and the same highlight parameter to be adjusted of different hair types may also correspond to different mapping curves, so the mapping curves are curves corresponding to the highlight parameters to be adjusted and the hair types at the same time, alternatively, a first axial direction of the mapping curves may be a position to be adjusted, a second axial direction may be an adjustment value, the first axial direction may be a horizontal axis, the second axial direction may be a vertical axis, and vice versa, which is not particularly limited herein.
After the mapping curve is obtained, the mapping curve can be encoded to generate a target mapping map, and the target mapping map has a corresponding relation with the type of the hair, and may have a corresponding relation with the highlight parameter to be adjusted. For example, considering that the number of the highlight parameters to be adjusted on a certain hair type may be at least two, after encoding the mapping curves corresponding to the highlight parameters to be adjusted respectively, a target mapping map may be generated based on the encoding result of each mapping curve, where there is a corresponding relationship between the target mapping map and the hair type and the highlight parameters to be adjusted; the coding result of each mapping curve can be stored in different channels of the target mapping map, and the target mapping map is generated according to the storage result, if the number of the highlight parameters to be adjusted is M, the M mapping curves are respectively stored in the M channels of the target mapping map, and M is a positive integer, at this time, the target mapping map only has a corresponding relation with the type of the hair.
In practical application, the mapping curve may be generated in advance according to the actual rendering requirement, if the trend of the variation of the highlight width of the hair on a certain hair piece type is expected to be a wavy line, the wavy line may be used as the mapping curve, and the degree of the highlight width of the hair is considered to be brought by the highlight smoothness, so after the target mapping map is generated based on the mapping curve, the value of the highlight smoothness can be adjusted based on the target mapping map, so that the trend of the variation of the highlight smoothness after the value adjustment is converted from a straight line form to a wavy line form with wave crests and wave troughs, and the stylized rendering effect of the highlight of the hair is realized.
An optional technical solution, after generating the anisotropic highlight according to the highlight control parameter, the hair highlight rendering method may further include: and carrying out remapping treatment on the anisotropic highlight based on a preset remapping curve, and updating the anisotropic highlight according to a remapping treatment result. The preset remapping curve is a preset curve for realizing high light remapping, and can be stored in a preset remapping map. The preset remapping curve may be a one-dimensional curve with a relatively slow gradient change, as shown in fig. 2a, and the anisotropy highlight after remapping processing based on the SpecularLow is relatively gentle, and the input and output are basically consistent; or a one-dimensional curve with relatively rapid gradient change, such as the one-dimensional curve shown in fig. 2b, wherein the anisotropic highlight after remapping treatment based on the one-dimensional curve is relatively sharp, and the contrast of input and output is gradually and obviously enhanced; etc., and are not particularly limited herein. The abscissa of the preset remapping curve may be the anisotropic highlight before remapping, and the ordinate may be the anisotropic highlight after remapping; of course, vice versa may be possible without specific limitation herein.
According to an optional technical scheme, the number of the anisotropic highlights is at least two, the adjusted highlight parameters further comprise adjusted highlight colors, and the number of the adjusted highlight colors is the same as the number of the anisotropic highlights, so that after the anisotropic highlights are generated according to the highlight control parameters, corresponding superposition processing can be further carried out on each anisotropic highlight and each adjusted highlight color, and highlight rendering is carried out on a target luminous sheet according to a superposition processing result, so that stylized control of the anisotropic highlights is further realized, and the adjusted highlight colors can be pure highlight colors or product results of the highlight colors and the highlight brightness.
Example two
Fig. 3 is a flowchart of a hair highlight rendering method according to a second embodiment of the present invention, where the present embodiment is optimized based on the above technical solutions. In this embodiment, optionally, the highlight control parameters include a highlight position control parameter and a highlight shape control parameter, the highlight position control parameter includes a half vector direction, and the adjusted highlight parameter includes an adjusted highlight smoothness; the highlight rendering of the target lighting fixture according to the highlight control parameter may specifically include: controlling the highlight position of the target hair piece according to the highlight position control parameter, wherein the highlight position control parameter also comprises the preset direction of the hair model and the highlight range of the hair piece; controlling the highlight shape of the target lighting fixture according to the highlight shape control parameters, wherein the highlight shape control parameters comprise a highlight position, a lighting fixture highlight width and a lighting fixture texture coordinate; and carrying out smoothing treatment on the highlight shape according to the adjusted highlight smoothness, updating the highlight shape according to a smoothing treatment result, generating anisotropic highlight according to the highlight shape, and carrying out highlight rendering on the target luminous sheet based on the anisotropic highlight. Wherein, the explanation of the same or corresponding terms as the above embodiments is not repeated herein.
Referring to fig. 3, the method of this embodiment may specifically include the following steps:
s210, obtaining the hair type, the position to be adjusted and the highlight parameter to be adjusted of the target hair, and screening the target mapping map from the curve mapping maps generated in advance according to the hair type.
S220, obtaining an adjustment value corresponding to the position to be adjusted according to the target mapping map, carrying out value adjustment on the highlight parameter to be adjusted according to the adjustment value, and taking the highlight parameter to be adjusted after the value adjustment as an adjusted highlight parameter, wherein the adjusted highlight parameter comprises adjusted highlight smoothness.
S230, controlling the highlight position of the target hair piece according to the highlight position control parameters, wherein the highlight position control parameters comprise a half vector direction, a preset direction of the hair model and a highlight range of the hair piece.
The preset direction of the hair model may be a direction directly above the hair model, and in the hair model, what direction is up and what direction is down, which are all preset. The highlight range of the target is a range in which the highlight can appear on the target, and the range can be determined based on a starting position and an ending position of the highlight on the target, for example, the highlight can appear in a range of 0.2-0.8, and 0.2 and 0.8 can be coordinate values of a certain axial direction on the 2D image. Thus, the highlight position of the target hair piece can be determined according to the half vector direction, the preset direction of the hair model and the highlight range of the hair piece, wherein the highlight position is the position of the highlight in the highlight range of the hair piece under the current visual angle (namely, the visual angle direction of the current moment).
For example, the position offset may be performed according to the half vector direction and the preset direction, taking HalfDir as an example where the half vector direction is HalfDir and the preset direction is HairUpDir, and the view shift may be-dot (HalfDir, hairUpDir) according to the position offset result after the HalfDir and HairUpDir are performed; and controlling the highlight position of the target hair piece according to the position deviation result and the highlight range of the hair piece. It should be noted that, after knowing the highlight width of the light emitting sheet, it can be determined at which position the highlight exists according to the result of the position shift, for example, taking the highlight width of the light emitting sheet as 0.1 and the highlight range of the light emitting sheet as 0.2-0.8 as an example, which means that there are a plurality of highlight lines with the width of 0.1 in 0.2-0.8, and the result of the position shift determines at which position the highlight line is, for example, at 0.25-0.35, at 0.4-0.5, and so on.
S240, controlling the highlight shape of the target highlight according to the highlight shape control parameters, wherein the highlight shape control parameters comprise the highlight position, the highlight width of the target highlight and the texture coordinates of the target highlight.
The highlight width of the light emitting sheet is the width of each highlight line on the light emitting sheet, for example, the highlight width of the light emitting sheet is 0.1, 0.2 and the like. The texture coordinates (UV coordinates) of the hair are coordinates of the hair under a UV coordinate system, U is in the horizontal direction, V is in the vertical direction under the UV coordinate system, and pixel points at any positions on the 2D image can be positioned according to the UV coordinates. The texture coordinates of the hair piece can be obtained from three-dimensional points in the hair model, and each three-dimensional point has a lot of attribute information, such as texture coordinates, tangential directions, normal directions and the like; the method can also be obtained from a preset texture map, wherein the preset texture map is a map which is preset and used for extracting the texture coordinates of the starting sheet from the preset texture map, the setting of the preset texture map improves the degree of freedom of stylized control of the highlight shape, and the highlight shape which accords with the expectations can be obtained; etc., and are not particularly limited herein.
Illustratively, in controlling the highlight shape speculum of the target hair piece according to the highlight position speclarrange, the hair piece highlight width specularity, and the hair piece texture coordinates hair uv, specularity may be smoothstep (specularity-SpecularWidth, specularRange, hairUV.y) ×1-smoothstep (SpecularRange, specularRange + SpecularWidth, hairUV.y)) in the program language.
S250, performing smoothing treatment on the highlight shape according to the adjusted highlight smoothness, updating the highlight shape according to a smoothing treatment result, generating anisotropic highlight according to the highlight shape, and performing highlight rendering on the target luminous piece based on the anisotropic highlight.
The highlight shape is smoothed according to the adjusted highlight smoothness, and the change of the width degree of the highlight shape is realized by changing the adjusted highlight smoothness at different positions to be adjusted on the target hair piece, so that the highlight shape has more controllable stylized control.
According to the technical scheme, the highlight position of the hair is controlled according to the half vector direction, the preset direction of the hair model and the highlight range of the hair piece, and then the highlight shape of the hair is controlled according to the highlight position, the highlight width of the hair piece and the texture coordinates of the hair piece; further, the highlight shape is smoothed according to the adjusted highlight smoothness, and the highlight shape is updated according to the smoothing result so as to generate anisotropic highlights according to the highlight shape, and then the target highlight rendering is performed on the basis of the anisotropic highlights. According to the technical scheme, the stylized rendering effect of the highlight of the hair is achieved based on the texture coordinates of the hair and the adjusted highlight smoothness.
It should be noted that, the structure of hair on some hair pieces is relatively simple, and the structure of hair on some hair pieces is relatively complex, because the anisotropic highlight that above-mentioned technical scheme produced is the relatively regular highlight that the controllability is stronger, it can be applicable to the condition of rendering the highlight on the hair of any structure, especially is suitable for the condition of rendering the highlight on the hair of relatively complex structure, has solved the problem that the highlight that appears on the hair of relatively complex structure relatively disordered relatively from this, has realized the effect of the stylized control of hair highlight rendering. Wherein, the hair with a relatively simple structure can be considered as the hair covered on the part with a spherical or nearly spherical shape, if the shape of the head is a relatively regular shape similar to the spherical shape, the hair covered on the head is the hair with a relatively simple structure, and the hair on the upper part shown in fig. 4 is the hair with a relatively simple structure; accordingly, hair of a relatively complex structure may be considered to be hair covered on a portion of a relatively flat shape, such as the lower portion of the hair shown in fig. 4, which is relatively flat, similar to a straight piece with gentle variation, and is hair of a relatively complex structure, such as the hair at the junction of two semi-arcs in an S-shaped ponytail.
After the highlight position of the target hair is obtained, the highlight position can be subjected to offset processing according to a preset highlight offset, and the highlight position is updated according to an offset processing result, so that stylized control with stronger controllability of the highlight position is realized. Further, optionally, before the highlight position is offset according to the highlight offset, a preset noise map may be sampled, where the preset noise map is a preset map for storing noise, and as illustrated in fig. 5, an example is shown; and obtaining a jitter value according to the sampling result, wherein the jitter value is used for carrying out jitter processing on the high-light offset, and updating the high-light offset according to the jitter processing result, so that the high-light offset with stronger stylization is obtained, the hairline texture of the hair in the hair piece is further improved, and a more natural high-light effect can be rendered.
An optional technical solution, after generating the anisotropic highlight according to the hair highlight rendering method described in the second embodiment of the present invention, may perform remapping processing on the anisotropic highlight based on a preset remapping curve, and update the anisotropic highlight according to the remapping processing result; and/or, each anisotropic highlight and each adjusted highlight color can be subjected to superposition processing, and the target hair piece is subjected to highlight rendering according to the superposition processing result, and the specific content is similar to that of the embodiment of the present invention and will not be described herein.
Example III
Fig. 6 is a flowchart of a hair highlighting method according to a third embodiment of the present invention. The present embodiment is optimized based on the above technical solutions. In this embodiment, optionally, the highlight control parameter further includes a tangential direction of the target lighting segment, and the adjusted highlight parameter includes an adjusted highlight smoothness; the highlight rendering of the target lighting fixture according to the highlight control parameter may specifically include: and generating anisotropic highlights according to the tangential direction, the half vector direction and the adjusted highlight smoothness, and performing highlight rendering on the target hair piece based on the anisotropic highlights. Wherein, the explanation of the same or corresponding terms as the above embodiments is not repeated herein.
Referring to fig. 6, the method of this embodiment may specifically include the following steps:
s310, obtaining the hair type, the position to be adjusted and the highlight parameter to be adjusted of the target hair, and screening the target mapping map from the curve mapping maps generated in advance according to the hair type.
S320, obtaining an adjustment value corresponding to the position to be adjusted according to the target mapping map, performing value adjustment on the highlight parameter to be adjusted according to the adjustment value, and taking the highlight parameter to be adjusted after the value adjustment as an adjusted highlight parameter, wherein the adjusted highlight parameter comprises adjusted highlight smoothness.
And S330, generating anisotropic highlight according to the tangential direction, the half vector direction and the adjusted highlight smoothness of the target hair, and performing highlight rendering on the target hair based on the anisotropic highlight.
Wherein, the tangential direction can be obtained from each three-dimensional point in the hair model, and each three-dimensional point has a lot of attribute information such as texture coordinates, tangential direction, normal direction and the like; the anisotropic highlight can also be obtained from a preset tangent map (flow map), wherein the preset tangent map is a preset RGB map for extracting the tangent direction from the preset tangent map, and the RGB map corresponds to three directions of XYZ in the tangent direction respectively, and the setting of the preset tangent map improves the degree of freedom of stylized control of the anisotropic highlight, so that the anisotropic highlight which is more in line with expectations can be obtained; etc., and are not particularly limited herein. Illustratively, taking tangent direction TangentDir, half vector direction HalfDir and adjusted high gloss smoothness as examples, in the programming language, the generation process of anisotropic high gloss dirAtten is as follows: dotth=dot (TangentDir, halfDir); sinth=sqrt (max (1.0-dotTH, 0.0)); diratten=smoothstep (-1.0, 0.0, dotth); diratten=diratten×pow (max (sinTH, 1 e-3), shininess).
On this basis, optionally, the highlight control parameter may further include a highlight offset and a normal direction of the target lighting segment, and then the generating anisotropic highlight according to the tangential direction, the half vector direction and the adjusted highlight smoothness may specifically include: sampling a preset noise map, obtaining a jitter value according to a sampling result, performing jitter processing on the high light offset according to the jitter value, and updating the high light offset according to a jitter processing result; based on the specular deviation, interpolating the tangential direction to the normal direction, and generating anisotropic specular according to the interpolation result, the half vector direction and the adjusted specular smoothness, so that the anisotropic specular has a hairline texture instead of a neat specular line.
According to the technical scheme, the anisotropic highlight is generated through the tangential direction, the half vector direction and the adjusted highlight smoothness, is highlight conforming to the light and shadow characteristics of the real world, is more natural due to relative disorder, and achieves the stylized rendering effect of the highlight of the hair.
An optional technical solution, after generating the anisotropic highlight according to the hair highlight rendering method described in the third embodiment of the present invention, may perform remapping processing on the anisotropic highlight based on a preset remapping curve, and update the anisotropic highlight according to the remapping processing result; and/or, each anisotropic highlight and each adjusted highlight color can be subjected to superposition processing, and the target hair piece is subjected to highlight rendering according to the superposition processing result, and the specific content is similar to that of the embodiment of the present invention and will not be described herein.
In order to better understand the specific implementation process of the above steps, an exemplary description will be given below of the hair highlight rendering method according to each embodiment in conjunction with specific examples. For example, the whole hair is divided into a plurality of hair types, a mapping curve shown in fig. 7a-7c is set by taking a certain hair type as an example, and the mapping curves are a high-light smoothness mapping curve, a high-light offset mapping curve and a high-light color mapping curve respectively, wherein the range of the horizontal axis and the range of the vertical axis of each mapping curve are 0-1, the horizontal axis represents the transverse coordinates of the hair, the position to be adjusted can be determined according to the transverse coordinates, and the vertical axis represents the scaling factor of the high-light parameter to be adjusted. The change trend of the adjusted highlight parameters after being adjusted by the three mapping curves is consistent with the change trend of the mapping curves, so that the hair highlight on the hair piece has an expected change trend. Further, three mapping curves are encoded onto the RGB three channels of the target mapping map, respectively, with the horizontal axis of each mapping curve corresponding to the lateral coordinates of the target mapping map and the vertical axis of the mapping curve corresponding to the pixel values of the target mapping map at the lateral coordinates. Still further, the target mapping maps respectively corresponding to the hair types are merged into a larger curve mapping map, each target mapping map being a row in the curve mapping map.
Therefore, in practical application, judging which line in the curve mapping map needs to be sampled based on the hair type of the hair, and sampling the pixel value of the line according to the transverse coordinate of the hair; and respectively carrying out numerical adjustment on the to-be-adjusted highlight smoothness, the to-be-adjusted highlight offset and the to-be-adjusted highlight color according to the sampled RGB pixel values to obtain the adjusted highlight smoothness, the adjusted highlight offset and the adjusted highlight color. On the basis, the preset noise map can be sampled, a jitter value is obtained according to a sampling result, the adjusted highlight offset is subjected to jitter processing according to the jitter value, the adjusted highlight offset is updated according to a jitter processing result, the adjusted highlight offset can be used for generating anisotropic highlights, and the anisotropic highlights have stronger hairline texture instead of regular highlight lines.
Specifically, for the hair with a relatively simple structure, the tangential direction can be interpolated toward the normal direction based on the adjusted specular deviation, and the anisotropic specular (tangential scheme) can be generated according to the interpolation result, the half vector direction and the adjusted specular smoothness. For the hair with a complex structure, the highlight position can be determined according to the half vector direction, the direction right above the hair model and the highlight range of the hair piece, the highlight position is subjected to offset processing according to the adjusted highlight offset, and the highlight position is updated according to the offset processing result, so that stylized control with stronger controllability of the highlight position is realized; and then determining a highlight shape according to the highlight position, the highlight width of the hair piece and the texture coordinates of the hair piece, carrying out smoothing treatment on the highlight shape according to the adjusted highlight smoothness, and updating the highlight shape according to the smoothing treatment result so as to generate anisotropic highlight (texture coordinate scheme) according to the highlight shape. Of course, the simplicity and complexity of the hair structure are relatively high, and it can be determined according to the actual requirements, which scheme is adopted to generate the anisotropic highlight, and the method is not particularly limited herein. In particular, after the anisotropic highlighting is generated, it may also be subjected to a remapping process based on a preset remapping curve.
On this basis, in order to highlight the highlight region to show more abundant highlight rendering details, multiple layers of anisotropic highlights can be calculated respectively by using multiple sets of highlight parameters, and then the multiple layers of anisotropic highlights are subjected to superposition processing. Specifically, taking two sets of highlight parameters as an example, for the tangential direction scheme, generating a first anisotropic highlight according to the interpolation result, the half vector direction and the first adjusted highlight smoothness, generating a second anisotropic highlight according to the interpolation result, the half vector direction and the second adjusted highlight smoothness, and further performing superposition processing on two layers of anisotropic highlights based on two sets of adjusted highlight colors, such as a first anisotropic highlight color, a first adjusted highlight color and a second anisotropic layer highlight color, to obtain a final anisotropic highlight, and performing highlight rendering based on the final anisotropic Gao Guangjin.
For a texture coordinate scheme, firstly, determining a highlight basic position in a highlight range of a lighting sheet under a current view angle according to a half vector direction, a direct upward direction and the highlight range of the lighting sheet, and then respectively calculating two layers of anisotropic highlights according to two sets of highlight parameters, wherein a calculation process of a first anisotropic highlight is taken as an example for explanation: adding the first adjusted highlight offset and the highlight basic position to calculate a first highlight position; calculating a first highlight basic shape according to the first highlight position, the highlight width of the hair piece and the texture coordinates of the hair piece; smoothing the first highlight basic shape according to the first adjusted highlight smoothness, calculating a first highlight shape, and generating first anisotropic highlight based on the first highlight shape, so that the width degree and the hardness degree of the first anisotropic highlight are further controlled; the second anisotropic highlight is generated in a similar process, and then the two layers of anisotropic highlights are subjected to superposition processing based on the two sets of adjusted highlight colors to complete highlight rendering.
To demonstrate the effectiveness of the above method, an example will now be described with reference to FIGS. 8a-8 f: FIG. 8a is a schematic view without the highlight rendering, FIG. 8b is a schematic view with one layer of highlight added, and FIG. 8c is a schematic view with two layers of highlight added, the highlight details of FIG. 8c being more abundant than that of FIG. 8 b; FIG. 8d is a schematic diagram of stylized design based on a pre-set noise map, wherein the hairline texture is better and more obvious, and the highlight rendering effect is more natural; FIG. 8e is a schematic diagram of a stylized target map (Pattern map) with more pronounced peaks and valleys in the highlight shape, and more controllable fluctuation; it is to be noted that, fig. 8e generates anisotropic highlights based on a tangential direction scheme, fig. 8f generates anisotropic highlights based on a texture coordinate scheme, and it is known by comparison that the highlights in fig. 8e are relatively disordered for the hair with a relatively complex lower structure, whereas the highlights in fig. 8f are relatively regular, and the visual appearance is better.
Example IV
Fig. 9 is a block diagram of a hair highlight rendering device according to a fourth embodiment of the present invention, where the device is configured to perform the hair highlight rendering method according to any of the above embodiments. The device belongs to the same inventive concept as the hair highlighting method of the above embodiments, and for details which are not described in detail in the embodiments of the hair highlighting device, reference may be made to the embodiments of the hair highlighting method described above. Referring to fig. 9, the apparatus includes: a data acquisition module 410, a numerical adjustment module 420, and a hair highlight rendering module 430. The data obtaining module 410 is configured to obtain a hair type, a position to be adjusted, and a highlight parameter to be adjusted of a target hair, and screen a target mapping map from curve mapping maps generated in advance according to the hair type; the value adjustment module 420 is configured to obtain an adjustment value corresponding to the position to be adjusted according to the target mapping map, perform value adjustment on the highlight parameter to be adjusted according to the adjustment value, and use the highlight parameter to be adjusted after the value adjustment as an adjusted highlight parameter; and a hair highlight rendering module 430, configured to highlight the target light emitting sheet according to a highlight control parameter, where the highlight control parameter includes a half vector direction and an adjusted highlight parameter.
Optionally, the highlight control parameters include a highlight position control parameter and a highlight shape control parameter, the highlight position control parameter includes a half vector direction, and the adjusted highlight parameter includes an adjusted highlight smoothness;
the hair highlight rendering module 430 may specifically be used to: controlling the highlight position of the target hair piece according to the highlight position control parameter, wherein the highlight position control parameter also comprises the preset direction of the hair model and the highlight range of the hair piece; controlling the highlight shape of the target lighting fixture according to the highlight shape control parameters, wherein the highlight shape control parameters comprise a highlight position, a lighting fixture highlight width and a lighting fixture texture coordinate; and carrying out smoothing treatment on the highlight shape according to the adjusted highlight smoothness, updating the highlight shape according to a smoothing treatment result, generating anisotropic highlight according to the highlight shape, and carrying out highlight rendering on the target luminous sheet based on the anisotropic highlight.
Optionally, the highlight control parameter further includes a tangential direction of the target lighting segment, and the adjusted highlight parameter includes an adjusted highlight smoothness; the hair highlight rendering module 430 may specifically include:
and the hair highlight rendering unit is used for generating anisotropic highlights according to the tangential direction, the half vector direction and the adjusted highlight smoothness and performing highlight rendering on the target hair piece based on the anisotropic highlights.
Optionally, the highlight control parameter further includes a highlight offset and a normal direction of the target lighting segment;
the hair highlight rendering unit may be specifically configured to: sampling a preset noise map, obtaining a jitter value according to a sampling result, performing jitter processing on the high light offset according to the jitter value, and updating the high light offset according to a jitter processing result; and interpolating the tangential direction to the normal direction based on the specular deviation, and generating anisotropic specular according to the interpolation result, the half vector direction and the adjusted specular smoothness.
Optionally, on the basis of the above device, the device may further include:
and the remapping module is used for carrying out remapping treatment on the anisotropic highlight based on a preset remapping curve and updating the anisotropic highlight according to the remapping treatment result.
Optionally, the number of anisotropic highlights is at least two, the adjusted highlight parameter further comprises an adjusted highlight color, the number of adjusted highlight colors being the same as the number of anisotropic highlights;
the hair highlight rendering module 430 may specifically include:
and the superposition processing unit is used for carrying out superposition processing on each anisotropic highlight and each adjusted highlight color, and carrying out highlight rendering on the target luminous piece according to the superposition processing result.
Optionally, the texture coordinates of the hair piece are determined according to a predetermined texture map or three-dimensional points in the hair model, and/or the tangential direction is determined according to three-dimensional points or predetermined tangential maps.
According to the hair highlight rendering device provided by the fourth embodiment of the invention, the hair piece type, the position to be adjusted and the highlight parameter to be adjusted of the target hair piece are obtained through the data obtaining module, so that the target mapping map corresponding to the hair piece type is screened out from the curve mapping maps generated in advance according to the hair piece type; the numerical value adjusting module obtains an adjusting numerical value corresponding to the position to be adjusted from the target mapping map, carries out numerical value adjustment on the highlight parameter to be adjusted on the position to be adjusted according to the adjusting numerical value, and takes the highlight parameter to be adjusted after the numerical value adjustment as an adjusted highlight parameter; therefore, the hair highlight rendering module performs highlight rendering on the target hair piece according to the half vector direction and the adjusted highlight parameters. According to the device, the degree of freedom of highlight rendering of each hair piece is improved based on the target mapping map, so that each hair piece is more similar to the stylized artistic effect drawn by the original art picture, and the effect of stylized control on the highlight rendering of hair is achieved.
The hair highlight rendering device provided by the embodiment of the invention can execute the hair highlight rendering method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executing method.
It should be noted that, in the embodiment of the hair highlight rendering device, each unit and module included are only divided according to the functional logic, but not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
Example five
Fig. 10 is a schematic structural diagram of an apparatus according to a fifth embodiment of the present invention, and as shown in fig. 10, the apparatus includes a memory 510, a processor 520, an input device 530, and an output device 540. The number of processors 520 in the device may be one or more, one processor 520 being taken as an example in fig. 10; the memory 510, processor 520, input means 530 and output means 540 in the device may be connected by a bus or other means, in fig. 10 by way of example by a bus 550.
The memory 510 is a computer readable storage medium, and may be used to store software programs, computer executable programs, and modules, such as program instructions/modules corresponding to the hair highlight rendering method in the embodiment of the present invention (e.g., the data acquisition module 410, the numerical adjustment module 420, and the hair highlight rendering module 430 in the hair highlight rendering device). The processor 520 performs various functional applications of the device and data processing, i.e., implements the hair highlight rendering method described above, by running software programs, instructions, and modules stored in the memory 510.
The memory 510 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, at least one application program required for functions; the storage data area may store data created according to the use of the device, etc. In addition, memory 510 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, memory 510 may further include memory located remotely from processor 520, which may be connected to the device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 530 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the device. The output 540 may include a display device such as a display screen.
Example six
A sixth embodiment of the present invention provides a storage medium containing computer-executable instructions, which when executed by a computer processor, are for performing a hair highlight rendering method, comprising:
Obtaining a hair type, a position to be adjusted and a highlight parameter to be adjusted of a target hair, and screening a target mapping map from curve mapping maps generated in advance according to the hair type; obtaining an adjustment value corresponding to the position to be adjusted according to the target mapping, carrying out value adjustment on the highlight parameter to be adjusted according to the adjustment value, and taking the highlight parameter to be adjusted after the value adjustment as an adjusted highlight parameter; and performing high-light rendering on the target luminous sheet according to the high-light control parameters, wherein the high-light control parameters comprise a half-vector direction and adjusted high-light parameters.
Of course, the storage medium containing the computer executable instructions provided in the embodiments of the present invention is not limited to the method operations described above, and may also perform the related operations in the hair highlight rendering method provided in any embodiment of the present invention.
From the above description of embodiments, it will be clear to a person skilled in the art that the present invention may be implemented by means of software and necessary general purpose hardware, but of course also by means of hardware, although in many cases the former is a preferred embodiment. In light of such understanding, the technical solution of the present invention may be embodied essentially or in part in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), FLASH Memory (FLASH), hard disk, optical disk, etc., of a computer, which may be a personal computer, a server, a network device, etc., and which includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the methods described in the embodiments of the present invention.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (10)

1. A hair highlighting method, comprising:
obtaining a hair type, a position to be adjusted and a highlight parameter to be adjusted of a target hair, and screening a target mapping map from curve mapping maps generated in advance according to the hair type;
the curve mapping map is generated by combining a set of target mapping maps or a target mapping map, and each target mapping map is a row or a column in the curve mapping map; the target mapping map stores a mapping curve for remapping the highlight parameter to be adjusted, wherein the first axial direction of the mapping curve is the position to be adjusted, and the second axial direction of the mapping curve is an adjustment value;
Obtaining an adjustment value corresponding to the position to be adjusted according to the target mapping map, carrying out value adjustment on the highlight parameter to be adjusted according to the adjustment value, and taking the highlight parameter to be adjusted after the value adjustment as an adjusted highlight parameter;
and performing high-light rendering on the target luminous sheet according to high-light control parameters, wherein the high-light control parameters comprise a half-vector direction and the adjusted high-light parameters.
2. The method of claim 1, wherein the highlighting control parameters include a highlighting position control parameter and a highlighting shape control parameter, the highlighting position control parameter including the half vector direction, the adjusted highlighting parameter including an adjusted highlighting smoothness;
the performing highlight rendering on the target lighting sheet according to the highlight control parameter includes:
controlling the highlight position of the target hair piece according to the highlight position control parameter, wherein the highlight position control parameter also comprises a preset direction of a hair model and a highlight range of the hair piece;
controlling the highlight shape of the target lighting fixture according to highlight shape control parameters, wherein the highlight shape control parameters comprise the highlight position, the lighting fixture highlight width and the lighting fixture texture coordinates;
And carrying out smoothing treatment on the highlight shape according to the adjusted highlight smoothness, updating the highlight shape according to a smoothing treatment result, generating anisotropic highlight according to the highlight shape, and carrying out highlight rendering on the target luminous piece based on the anisotropic highlight.
3. The method of claim 1, wherein the highlighting parameter further comprises a tangential direction of the target lighting segment, the adjusted highlighting parameter comprising an adjusted highlighting smoothness;
the performing highlight rendering on the target lighting sheet according to the highlight control parameter includes:
and generating anisotropic highlights according to the tangential direction, the half vector direction and the adjusted highlight smoothness, and performing highlight rendering on the target hair piece based on the anisotropic highlights.
4. A method according to claim 3, wherein the high light control parameters further comprise a high light offset and a normal direction of the target light emitting tile;
the generating anisotropic highlights according to the tangential direction, the half vector direction, and the adjusted highlight smoothness includes:
sampling a preset noise map, obtaining a jitter value according to a sampling result, performing jitter processing on the high light offset according to the jitter value, and updating the high light offset according to a jitter processing result;
And interpolating the tangential direction to the normal direction based on the specular deviation, and generating anisotropic specular reflection according to an interpolation result, the half vector direction and the adjusted specular reflection smoothness.
5. A method according to claim 2 or 3, further comprising, after said generating anisotropic highlights:
and carrying out remapping treatment on the anisotropic highlight based on a preset remapping curve, and updating the anisotropic highlight according to a remapping treatment result.
6. A method according to claim 2 or 3, wherein the number of anisotropic highlights is at least two, the adjusted highlights parameters further comprising an adjusted highlight colour, the number of adjusted highlights colour being the same as the number of anisotropic highlights;
the performing highlight rendering on the target hair piece based on the anisotropic highlight comprises the following steps:
and performing superposition processing on each anisotropic highlight and each adjusted highlight color, and performing highlight rendering on the target hair piece according to a superposition processing result.
7. A method according to claim 2 or 3, wherein the hair piece texture coordinates are determined from three-dimensional points in a predetermined texture map or hair model and/or the tangential direction is determined from the three-dimensional points or predetermined tangential map.
8. A hair highlighting device, comprising:
the data acquisition module is used for acquiring the hair type, the position to be adjusted and the highlight parameter to be adjusted of the target hair, and screening out the target mapping map from the curve mapping maps generated in advance according to the hair type; the curve mapping map is generated by combining a set of target mapping maps or a target mapping map, and each target mapping map is a row or a column in the curve mapping map; the target mapping map stores a mapping curve for remapping the highlight parameter to be adjusted, wherein the first axial direction of the mapping curve is the position to be adjusted, and the second axial direction of the mapping curve is an adjustment value;
the numerical value adjusting module is used for obtaining an adjusting numerical value corresponding to the position to be adjusted according to the target mapping map, carrying out numerical value adjustment on the highlight parameter to be adjusted according to the adjusting numerical value, and taking the highlight parameter to be adjusted after the numerical value adjustment as an adjusted highlight parameter;
and the hair highlight rendering module is used for performing highlight rendering on the target luminous sheet according to highlight control parameters, wherein the highlight control parameters comprise a half vector direction and the adjusted highlight parameters.
9. An apparatus, comprising:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, causes the one or more processors to implement the hair highlighting method as recited in any of claims 1-7.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements a hair highlight rendering method according to any one of claims 1-7.
CN202010485280.5A 2020-06-01 2020-06-01 Hair highlight rendering method, device, equipment and storage medium Active CN113763525B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010485280.5A CN113763525B (en) 2020-06-01 2020-06-01 Hair highlight rendering method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010485280.5A CN113763525B (en) 2020-06-01 2020-06-01 Hair highlight rendering method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113763525A CN113763525A (en) 2021-12-07
CN113763525B true CN113763525B (en) 2024-03-12

Family

ID=78782609

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010485280.5A Active CN113763525B (en) 2020-06-01 2020-06-01 Hair highlight rendering method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113763525B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114693859A (en) * 2022-04-08 2022-07-01 北京字跳网络技术有限公司 Highlight rendering method, highlight rendering device, highlight rendering medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102800129A (en) * 2012-06-20 2012-11-28 浙江大学 Hair modeling and portrait editing method based on single image
CN106652007A (en) * 2016-12-23 2017-05-10 网易(杭州)网络有限公司 Virtual sea surface rendering method and system
CN108961373A (en) * 2018-05-23 2018-12-07 福建天晴在线互动科技有限公司 A kind of method and terminal of fur rendering
CN109685876A (en) * 2018-12-21 2019-04-26 北京达佳互联信息技术有限公司 Fur rendering method, apparatus, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
NZ530738A (en) * 2004-01-21 2006-11-30 Stellure Ltd Methods and systems for compositing images

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102800129A (en) * 2012-06-20 2012-11-28 浙江大学 Hair modeling and portrait editing method based on single image
CN106652007A (en) * 2016-12-23 2017-05-10 网易(杭州)网络有限公司 Virtual sea surface rendering method and system
CN108961373A (en) * 2018-05-23 2018-12-07 福建天晴在线互动科技有限公司 A kind of method and terminal of fur rendering
CN109685876A (en) * 2018-12-21 2019-04-26 北京达佳互联信息技术有限公司 Fur rendering method, apparatus, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于语义信息提取的卡通非真实感渲染;张诚;《现代计算机》;第82-86页 *

Also Published As

Publication number Publication date
CN113763525A (en) 2021-12-07

Similar Documents

Publication Publication Date Title
CN107749077B (en) Card ventilation grid shadow rendering method, device, equipment and medium
JP6612266B2 (en) 3D model rendering method and apparatus, and terminal device
CN109675315B (en) Game role model generation method and device, processor and terminal
CN109035381B (en) Cartoon picture hair rendering method and storage medium based on UE4 platform
KR102386642B1 (en) Image processing method and apparatus, electronic device and storage medium
CN112316420A (en) Model rendering method, device, equipment and storage medium
CN113240783B (en) Stylized rendering method and device, readable storage medium and electronic equipment
CN113822981B (en) Image rendering method and device, electronic equipment and storage medium
CN113763526B (en) Hair highlight rendering method, device, equipment and storage medium
CN105956995A (en) Face appearance editing method based on real-time video proper decomposition
US20230326174A1 (en) Image processing method and apparatus, computer device and computer program product
CN113763525B (en) Hair highlight rendering method, device, equipment and storage medium
CN116363288A (en) Rendering method and device of target object, storage medium and computer equipment
CN110910308B (en) Image processing method, device, equipment and medium
CN109224448A (en) A kind of method and apparatus of streamer rendering
US20040119723A1 (en) Apparatus manipulating two-dimensional image in a three-dimensional space
KR101098830B1 (en) Surface texture mapping apparatus and its method
CN113763527B (en) Hair highlight rendering method, device, equipment and storage medium
CN115311395A (en) Three-dimensional scene rendering method, device and equipment
CN114255230A (en) Face feature point-based portrait mandible line repairing method, device and equipment
CN114187398A (en) Processing method and device for human body illumination rendering based on normal map
KR100665371B1 (en) A method for generating multiple virtual hairstyles using semi-automatic field morphing
KR100914844B1 (en) System for providing surface texture mapping with sample texture synthesis
Chiew et al. Real-Time Art-Directed Charcoal Cyber Arts
Seo et al. Artistic image generation for emerging multimedia services by impressionist manner

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant