Nothing Special   »   [go: up one dir, main page]

CN109035381B - Cartoon picture hair rendering method and storage medium based on UE4 platform - Google Patents

Cartoon picture hair rendering method and storage medium based on UE4 platform Download PDF

Info

Publication number
CN109035381B
CN109035381B CN201710427235.2A CN201710427235A CN109035381B CN 109035381 B CN109035381 B CN 109035381B CN 201710427235 A CN201710427235 A CN 201710427235A CN 109035381 B CN109035381 B CN 109035381B
Authority
CN
China
Prior art keywords
hair
texture
highlight
value
illumination
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
CN201710427235.2A
Other languages
Chinese (zh)
Other versions
CN109035381A (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.)
Fujian TQ Digital Co Ltd
Original Assignee
Fujian TQ Digital 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 Fujian TQ Digital Co Ltd filed Critical Fujian TQ Digital Co Ltd
Priority to CN201710427235.2A priority Critical patent/CN109035381B/en
Publication of CN109035381A publication Critical patent/CN109035381A/en
Application granted granted Critical
Publication of CN109035381B publication Critical patent/CN109035381B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • 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 Generation (AREA)

Abstract

The invention provides a cartoon picture hair rendering method and a storage medium based on a UE4 platform, wherein the method comprises the following steps: calculating to obtain a highlight value of the hair according to an illumination anisotropy simulation algorithm; acquiring gray values corresponding to the hair random texture images and color information corresponding to the hair noise images according to the texture information on the hair pixel points; deflecting the hair texture tangent value in the hair pixel point according to the gray value to obtain a random and disordered hair texture tangent; and performing linear interpolation calculation according to the color information and the highlight value to obtain a highlight value with random noise change. The cartoon hair rendered by the method has obvious highlight range change and obvious highlight disturbance shape to reflect the illumination anisotropy of the hair, and has good gloss expression, thereby having good cartoon rendering style.

Description

Cartoon picture hair rendering method and storage medium based on UE4 platform
Technical Field
The invention relates to the field of image rendering, in particular to a cartoon picture hair rendering method and a cartoon picture hair rendering storage medium based on a UE4 platform.
Background
In the real world, due to the geometric nature and the lamination of hair, the hair shows different lighting effects in different directions, also called as the lighting anisotropy (anistropic) of hair. The illumination anisotropy for realistic Hair Rendering is originally proposed in the Hair Rendering and Shading literature in GDC 2004, and the illumination value is calculated by replacing the normal data of the model with the tangent data of the model, and the method can well simulate the anisotropy of the Hair illumination.
The existing hair rendering solution of the UE4 (illusion 4 engine) mostly adopts a realistic hair rendering solution, and the main problem to be solved is to simulate the complex gloss representation of real hair under different lighting systems as truly as possible based on physical laws in a virtual world. The adopted coloring algorithm needs to perform complex depth detection, illumination calculation and edge blurring to ensure the normal drawing of the hair.
Compared with realistic hair rendering, cartoon hair rendering is an artistic expression effect which simulates the hair in a cartoon as much as possible, and in the cartoon, the hair is often subjected to artistic abstraction and summarization of artists. The geometric complexity and the gloss expression of the hair are greatly different from those of realistic hair, so that the realistic hair rendering algorithm is not suitable for solving the cartoon style hair rendering problem, and unnecessary rendering calculation overhead is generated. The performance optimization has an adverse effect on the picture performance of the game.
In the Japanese cartoon, a multi-level highlight and shadow light supplement (the effect is shown as an arc ring at the lower right of the picture 1) is often adopted to express the texture and the transparency of the hair, and the effect is shown as the picture 1. In the Japanese cartoon, the character hair usually has two highlight forms, namely a first-level highlight (see the arc circle at the left of fig. 1) and a second-level highlight (see the arc circle at the upper right of fig. 1): the first-level highlight has the characteristics of high brightness and small range, and is mainly used for expressing the texture of hair; the secondary highlight has the characteristics of low brightness and wide range, and is mainly used for enhancing the volume feeling of hair. No matter the primary high light or the secondary high light, the Phong illumination model which is mainly adopted in the game engine industry at present cannot simulate the gloss effect. The highlight calculated by the Phong illumination model can generate a single-thin texture of a paper-like feeling to the hair of a person, and has a reduction effect on the appearance of the picture, and the effect is shown in figure 2. Therefore, the hair gloss representation in the day-based cartoon style rendering at the present stage is mostly represented by adopting a high-gloss hand-drawing mode of an art creator. The highlight drawn in this way is not only dull, but also the hair gloss cannot interact with the virtual scene, i.e. the gloss cannot be adjusted according to the illumination angle of the virtual scene, and there is no illumination anisotropy.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: a cartoon picture hair rendering method and a storage medium based on a UE4 platform are provided, and the obtained hair has not only illumination anisotropy but also good luster effect.
In order to solve the technical problems, the invention adopts the technical scheme that:
a cartoon picture hair rendering method based on a UE4 platform comprises the following steps:
calculating to obtain a highlight value of the hair according to an illumination anisotropy simulation algorithm;
acquiring gray values corresponding to the hair random texture images and color information corresponding to the hair noise images according to the texture information on the hair pixel points;
deflecting the hair texture tangent value in the hair pixel point according to the gray value to obtain a random and disordered hair texture tangent;
and performing linear interpolation calculation according to the color information and the highlight value to obtain a highlight value with random noise change.
The invention provides another technical scheme as follows:
a computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
calculating to obtain a highlight value of the hair according to an illumination anisotropy simulation algorithm;
acquiring gray values corresponding to the hair random texture images and color information corresponding to the hair noise images according to the texture information on the hair pixel points;
deflecting the hair texture tangent value in the hair pixel point according to the gray value to obtain a random and disordered hair texture tangent;
and performing linear interpolation calculation according to the color information and the highlight value to obtain a highlight value with random noise change.
The invention has the beneficial effects that: the highlight expression of cartoon hair is drawn according to the illumination anisotropy simulation algorithm, so that the hair has the anisotropy of hair illumination, namely, the luster can be adjusted according to the illumination angle of the virtual scene; meanwhile, the hair with the anisotropy of illumination is subjected to the treatment of overlapping hair textures and noise textures, the random influence between the hair is simulated, and the luster expression of the hair is enriched. The cartoon hair rendered by the method has obvious highlight range change and obvious highlight disturbance shape to reflect the illumination anisotropy of the hair, and has good gloss expression, thereby having good cartoon rendering style.
Drawings
FIG. 1 is a diagram of the effect of hair with multi-level highlight and shadow light supplement methods of the conventional Japanese cartoon;
FIG. 2 is a diagram of a hair effect rendered by a Phong lighting model;
FIG. 3 is a schematic flow chart of a cartoon picture hair rendering method based on a UE4 platform according to the present invention;
FIG. 4 is a diagram of hair effects rendered by a default rendering mode of a conventional UE4 engine;
fig. 5 is a hair effect diagram drawn by the rendering method according to the third embodiment of the present invention.
Detailed Description
In order to explain technical contents, achieved objects, and effects of the present invention in detail, the following description is made with reference to the accompanying drawings in combination with the embodiments.
The most key concept of the invention is as follows: the hair has the anisotropy of hair illumination through an illumination anisotropy simulation algorithm, and then the hair texture and the noise texture are superposed to enrich the gloss expression of the hair.
The technical terms related to the invention are explained as follows:
Figure GDA0003211452700000031
Figure GDA0003211452700000041
referring to fig. 3, the present invention provides a cartoon picture hair rendering method based on a UE4 platform, including:
calculating to obtain a highlight value of the hair according to an illumination anisotropy simulation algorithm;
acquiring gray values corresponding to the hair random texture images and color information corresponding to the hair noise images according to the texture information on the hair pixel points;
deflecting the hair texture tangent value in the hair pixel point according to the gray value to obtain a random and disordered hair texture tangent;
and performing linear interpolation calculation according to the color information and the highlight value to obtain a highlight value with random noise change.
From the above description, the beneficial effects of the present invention are: the method enriches the expression of high light in the cartoon picture hair by using the illumination anisotropy simulation algorithm adopted in the realistic hair rendering, and simultaneously simulates the random influence between the hair by adopting a method of superposing hair textures and noise textures, so that the cut line values of the textures which are uniformly distributed originally are randomly flocculated, the shape of the high light of the hair is influenced, the random noise change is generated by the original uniform hair brightness, and the gloss expression of the hair is enriched. The hair effect rendered by the method has obvious range change of primary highlight and secondary highlight, and the obvious highlight disturbance shape reflects the illumination anisotropy of the hair, so that the hair has good cartoon artistic expression.
Further, the calculating according to the illumination anisotropy simulation algorithm to obtain the highlight value of the hair specifically comprises:
acquiring a light source vector of a scene where hair is located;
obtaining a hair texture tangent line through a fluid diagram;
and calculating by adopting an illumination anisotropy simulation algorithm according to the light source vector and the hair texture tangent to obtain a high light value of the hair.
Further, according to the light source vector and the hair texture tangent line, a high light value of the hair is calculated by adopting an illumination anisotropy simulation algorithm, and the method specifically comprises the following steps:
substituting the light source vector and the hair texture tangent line into a formula:
Figure GDA0003211452700000051
calculating to obtain a highlight value OutLight of the hair;
the method comprises the following steps of detecting a light source by using a light source detection vector, detecting a highlight vector by using a light source detection vector, detecting a ViewVector by using a ViewVector, controlling a highlight visual range by using a dirAtten, controlling a highlight visual range by using a Smoothstep as a default interpolation value function, controlling Power as a highlight change rate, controlling Pixel index as a hair texture Tangent line, and controlling strength as highlight intensity.
As can be seen from the above description, the hair texture tangent line is obtained through the fluid diagram, so that the curling degree different from that of the hair can be accurately represented, and the hair styling is enriched; meanwhile, the highlight value of the hair is calculated by combining with the light source of the scene where the hair is located, so that the hair can show different glossiness along with the illumination angle of the scene; furthermore, the calculation process of the illumination anisotropy simulation algorithm in the realistic hair rendering is simplified, and the rendering speed is improved while the rich hair highlight expression is realized.
Further, the method also comprises the following steps:
according to the formula
Figure GDA0003211452700000052
Calculating to obtain the hair shadow color ShadowColor;
wherein, the shadowRange is the hair scope of being shaded, the light vector is the light source vector, Pixel Tangnt is hair texture Tangent line, ColorRange is the shadow pile-up Color scope, ShadowColorRange is the shadow Color scope, Color is the shadow pile-up Color, ColorPower is shadow Color intensity.
According to the description, the color superposition range is calculated by adopting a self-shadow color superposition mode and combining the position of the camera, the color superposition range is controlled, and the hair shadow color is enriched.
Further, the calculation of the illumination anisotropy simulation algorithm to obtain the highlight value of the hair specifically includes:
according to the formula
Figure GDA0003211452700000061
Calculating to obtain a highlight value OutLight of the hair;
the H is a light source detection vector, the LightVector is a light source vector, the ViewVector is a visual vector, the dirAtten is an attenuation coefficient for controlling a highlight visual range, the Smoothstep is a default interpolation function, the Power is a highlight change rate, the Pixel index is a hair texture Tangent, and the strengthh is highlight intensity; the SpecRange is the specification range and the ShadowColor is the hair shade color.
According to the description, after the hair shadow is subjected to color complementing, the hair highlight value is obtained through calculation by combining the hair shadow color, the hair highlight and the shadow are naturally fused, and the cartoon hair not only has illumination anisotropy, but also has richer gloss change.
Further, the method also comprises the following steps:
the top of the marked hair texture is the tip of the hair, and the bottom of the texture is the root of the hair;
and calculating the hair texture to obtain a hair texture tangent value.
From the above description, it can be seen that obtaining the hair texture tangent value by uniform texture direction calculation has the advantage of high efficiency for some simple hair treatments.
The invention provides another technical scheme as follows:
a computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
calculating to obtain a highlight value of the hair according to an illumination anisotropy simulation algorithm;
acquiring gray values corresponding to the hair random texture images and color information corresponding to the hair noise images according to the texture information on the hair pixel points;
deflecting the hair texture tangent value in the hair pixel point according to the gray value to obtain a random and disordered hair texture tangent;
and performing linear interpolation calculation according to the color information and the highlight value to obtain a highlight value with random noise change.
Further, when the program implements the step of calculating the highlight value of the hair according to the illumination anisotropy simulation algorithm, the method specifically includes:
acquiring a light source vector of a scene where hair is located;
obtaining a hair texture tangent line through a fluid diagram;
and calculating by adopting an illumination anisotropy simulation algorithm according to the light source vector and the hair texture tangent to obtain a high light value of the hair.
Further, when the program implements the step of calculating the highlight value of the hair by using the illumination anisotropy simulation algorithm according to the light source vector and the hair texture tangent line, the method specifically includes:
substituting the light source vector and the hair texture tangent line into a formula:
Figure GDA0003211452700000071
calculating to obtain a highlight value OutLight of the hair;
the method comprises the following steps of detecting a light source by using a light source detection vector, detecting a highlight vector by using a light source detection vector, detecting a ViewVector by using a ViewVector, controlling a highlight visual range by using a dirAtten, controlling a highlight visual range by using a Smoothstep as a default interpolation value function, controlling Power as a highlight change rate, controlling Pixel index as a hair texture Tangent line, and controlling strength as highlight intensity.
Further, the program realizes the steps of:
according to the formula
Figure GDA0003211452700000072
Calculating to obtain the hair shadow color ShadowColor;
wherein, the shadowRange is the hair scope of being shaded, the light vector is the light source vector, Pixel Tangnt is hair texture Tangent line, ColorRange is the shadow pile-up Color scope, ShadowColorRange is the shadow Color scope, Color is the shadow pile-up Color, ColorPower is shadow Color intensity.
Example one
The embodiment provides a cartoon hair rendering method based on a UE4 platform, which is used for rendering the hair of a character (such as a game character) in a virtual reality world for simulating the complex gloss representation of the real hair under different illumination systems as truly as possible so as to realize the anisotropic illumination and rich gloss change of the cartoon hair,
the present embodiment may include the following steps:
s1: calculating to obtain a highlight value of the hair according to an illumination anisotropy simulation algorithm;
specifically, the following substeps may be included:
s11: acquiring a Light source Vector Light Vector of a scene where hair is located; preferably, the light source vector is obtained through material parameter collection, and the light source vector is transmitted into the material through the material parameter collection.
Since the UE4 encapsulates the programmable rendering pipeline accordingly, the Light source Vector Light Vector parameter cannot be obtained in default lit mode in material, and therefore, the algorithm obtains the Light source information in the current scene by creating a Light manager operator (Light source management class).
S12: acquiring a hair texture tangent line pixel sequence through a fluid map maps or a uniform texture direction;
in order to realize highlight anisotropy, data information of a hair texture normal line pixel normal needs to be converted into data information of a hair texture tangent line pixel tangent, and according to the currently mainstream computer graphics technology, pixel tangent data is a model UV (texture) data set, so that to obtain good hair art expression, UV (texture) information of a hair model needs to be processed to obtain the hair texture tangent line.
For some simple hair systems, the hair texture tangent line can be quickly and efficiently obtained by adopting a method of unifying the texture direction, and the specific method comprises the following steps: the top of the specified hair texture is the tip of the hair, and the bottom of the texture is the root of the hair; the texture tangential direction value of the hair is calculated by unifying the texture directions, and the distribution of the set texture tangential values of the hair is simulated approximately.
For some high-demand complex hair systems, more accurate hair texture tangent lines can be obtained through the fluid flow maps, so that different curliness degrees of the hair can be better represented, and the hair styling is enriched.
S13: calculating according to formula 1 to obtain a hair highlight value OutLight;
Figure GDA0003211452700000081
the method comprises the following steps of detecting a light source by using a light source detection vector, detecting a highlight vector by using a light source detection vector, detecting a ViewVector by using a ViewVector, controlling a highlight visual range by using a dirAtten, controlling a highlight visual range by using a Smoothstep as a default interpolation value function, controlling Power as a highlight change rate, controlling Pixel index as a hair texture Tangent line, and controlling strength as highlight intensity.
Specifically, in order to display the head highlight in the field of view, the algorithm redefines the light source detection vector H to make the highlight appear in the field of view, so that the highlight detection vector H is a half-angle vector of the light source vector LightVector and the visual vector ViewVector (which needs to be unitized in the program calculation); dirAtten attenuation coefficient for controlling the visual range of highlight; the power parameter is used for controlling the highlight change rate, and the higher the value is, the larger the change rate is, and the more obvious the highlight change is; the strength parameter is used to control high light intensity.
S2: the superposition of the random texture map and the noise map is performed to enrich the hair shine variation. Specifically, the following substeps may be included:
s21: in order to simulate the random influence between hairs, acquiring corresponding gray values in a random texture map according to texture (UV) information on hair pixel points; deflecting the hair texture tangent values in the hair pixel points through the gray value, so that the hair texture tangent values which are uniformly distributed originally are randomly flocculated, thereby influencing the shape of highlight hair;
s22: for some dry hair models, corresponding color information in the noise map is collected according to texture (UV) information on hair pixel points, and linear interpolation is carried out on the color value and the hair highlight value obtained through calculation in the step S13, so that random noise change is generated on original uniform hair highlight brightness, and the hair gloss expression is enriched.
In the embodiment, the illumination anisotropy simulation algorithm adopted in the realistic hair rendering is used for reference, but the specific calculation steps are simplified, the rendering efficiency is improved, and the rendering effect is ensured.
The hair effect obtained by the steps has obvious range change of the primary highlight and the secondary highlight, and the obvious highlight disturbance shape reflects the anisotropy of hair illumination.
Example two
Further expanding on the basis of the first embodiment, processing the shadow part of the hair, and enriching the colors of the cartoon hair shadow through shadow superposition.
Specifically, before S13, the method further includes:
SS 1: calculating according to a formula 2 to obtain a hair shadow color;
Figure GDA0003211452700000101
wherein, the shadowRange is the hair scope of being shaded, the light vector is the light source vector, Pixel Tangnt is hair texture Tangent line, ColorRange is the shadow pile-up Color scope, ShadowColorRange is the shadow Color scope, Color is the shadow pile-up Color, ColorPower is shadow Color intensity.
EXAMPLE III
On the basis of the second embodiment, in the present embodiment, the influence of the shadow superimposition is added in the highlight value calculation process in step S1, so that the highlight and the self-shadow blend naturally.
Specifically, referring to fig. 3, in this embodiment, steps S11 and S12 are executed first, and then SS1 is executed to calculate the hair shadow color ShadowColor; then, step S13 is executed, formula 1 in step S13 is modified to formula 3, the calculation parameter of the hair shadow color ShadowColor is added, and the contents of other steps are not changed; the hair highlight value OutLight is calculated by formula 3.
Figure GDA0003211452700000102
Wherein SpecRange is a specification range and the ShadowColor is a hair shade color.
And continuing to execute the step S2, and after obtaining and applying the hair highlight value and the hair shadow color value, executing S21 and S22 to obtain the final hair effect.
The hair effect obtained by the rendering of the embodiment is obviously different from the default rendering mode of the existing UE4 engine. Referring specifically to fig. 4, the highlight effect of the hair drawn by the default rendering mode of the existing UE4 engine is shown; fig. 5 is a hair effect diagram obtained by drawing with the method of this embodiment, and the human hair can form a corresponding highlight effect according to the illumination direction of the scene. Therefore, the hair effect obtained by the rendering of the embodiment has rich sheen, high anisotropy and better cartoon effect.
Example four
The present embodiments provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
calculating to obtain a highlight value of the hair according to an illumination anisotropy simulation algorithm; preferably, the step specifically comprises the following sub-steps: acquiring a light source vector of a scene where hair is located; acquiring a hair texture tangent line by a fluid diagram or a method for unifying the texture direction; and calculating by adopting an illumination anisotropy simulation algorithm according to the light source vector and the hair texture tangent to obtain a high light value of the hair.
In a specific implementation manner, when the step of calculating the highlight value of the hair by using the illumination anisotropy simulation algorithm according to the light source vector and the hair texture tangent line is specifically:
substituting the light source vector and the hair texture tangent line into a formula:
Figure GDA0003211452700000111
calculating to obtain a highlight value OutLight of the hair;
the method comprises the following steps of detecting a light source by using a light source detection vector, detecting a highlight vector by using a light source detection vector, detecting a ViewVector by using a ViewVector, controlling a highlight visual range by using a dirAtten, controlling a highlight visual range by using a Smoothstep as a default interpolation value function, controlling Power as a highlight change rate, controlling Pixel index as a hair texture Tangent line, and controlling strength as highlight intensity.
And continuing the steps of:
acquiring gray values corresponding to the hair random texture images and color information corresponding to the hair noise images according to the texture information on the hair pixel points;
deflecting the hair texture tangent value in the hair pixel point according to the gray value to obtain a random and disordered hair texture tangent;
and performing linear interpolation calculation according to the color information and the highlight value to obtain a highlight value with random noise change.
In a specific implementation, the program may further implement the steps of:
according to the formula
Figure GDA0003211452700000121
Calculating to obtain the hair shadow color ShadowColor;
wherein, the shadowRange is the hair scope of being shaded, the light vector is the light source vector, Pixel Tangnt is hair texture Tangent line, ColorRange is the shadow pile-up Color scope, ShadowColorRange is the shadow Color scope, Color is the shadow pile-up Color, ColorPower is shadow Color intensity.
On the premise of the above specific implementation, another specific implementation is provided:
the method for calculating the high light value of the hair by adopting the illumination anisotropy simulation algorithm specifically comprises the following steps:
according to the formula
Figure GDA0003211452700000122
Calculating to obtain a highlight value OutLight of the hair;
the H is a light source detection vector, the LightVector is a light source vector, the ViewVector is a visual vector, the dirAtten is an attenuation coefficient for controlling a highlight visual range, the Smoothstep is a default interpolation function, the Power is a highlight change rate, the Pixel index is a hair texture Tangent, and the strengthh is highlight intensity; the SpecRange is the specification range and the ShadowColor is the hair shade color.
In summary, the cartoon hair rendering method based on the UE4 platform and the computer-readable storage medium provided by the present invention can enrich the highlight expression in the cartoon hair rendering, and adjust the gloss according to the illumination angle of the virtual scene; and the hair gloss effect in the rendering of the Japanese cartoon style painting is achieved, and furthermore, the hair shadow color can be enriched, so that the method has a good cartoon style rendering and good artistic expression.
The above description is only an embodiment of the present invention, and not intended to limit the scope of the present invention, and all equivalent changes made by using the contents of the present specification and the drawings, or applied directly or indirectly to the related technical fields, are included in the scope of the present invention.

Claims (7)

1. A cartoon picture hair rendering method based on a UE4 platform is characterized by comprising the following steps:
calculating to obtain a highlight value of the hair according to an illumination anisotropy simulation algorithm;
acquiring gray values corresponding to the hair random texture images and color information corresponding to the hair noise images according to the texture information on the hair pixel points;
deflecting the hair texture tangent value in the hair pixel point according to the gray value to obtain a random and disordered hair texture tangent;
performing linear interpolation calculation according to the color information and the highlight value to obtain a highlight value with random noise variation;
according to the formula
Figure FDA0003244557890000011
Calculating to obtain the hair shadow color ShadowColor;
wherein the shadowRange is a hair backlight range, the light vector is a light source vector, the PixelNormal is a hair texture normal, the ColorRange is a shadow pile-up range, the ShadowColorRange is a shadow Color range, the Color is a shadow pile-up Color, and the ColorPower is a shadow Color intensity;
the calculation according to the illumination anisotropy simulation algorithm to obtain the high light value of the hair specifically comprises the following steps:
according to the formula
Figure FDA0003244557890000012
Calculating to obtain a highlight value OutLight of the hair;
wherein, the H is a light source detection vector, the Viewvector is a visual vector, the dirAtten is an attenuation coefficient for controlling a highlight visual range, the Smoothstep is a default interpolation function, the Power is a highlight change rate, the PixelTangent is a hair texture tangent line, and the Strength is a highlight intensity; SpecRange is the specification range.
2. The method for rendering the cartoon hair based on the UE4 platform of claim 1, wherein the calculating the highlight value of the hair according to the illumination anisotropy simulation algorithm specifically includes:
acquiring a light source vector of a scene where hair is located;
obtaining a hair texture tangent line through a fluid diagram;
and calculating by adopting an illumination anisotropy simulation algorithm according to the light source vector and the hair texture tangent to obtain a high light value of the hair.
3. The cartoon picture hair rendering method based on the UE4 platform of claim 2, wherein the highlight value of the hair is calculated by using an illumination anisotropy simulation algorithm according to the light source vector and the hair texture tangent line, and specifically comprises:
substituting the light source vector and the hair texture tangent line into a formula:
Figure FDA0003244557890000021
the calculation was performed to obtain the highlight value of hair OutLight.
4. The method for rendering the cartoon hair based on the UE4 platform of claim 1, further comprising:
the top of the marked hair texture is the tip of the hair, and the bottom of the texture is the root of the hair;
and calculating the hair texture to obtain a hair texture tangent value.
5. A computer-readable storage medium, on which a computer program is stored, which program, when executed by a processor, carries out the steps of:
calculating to obtain a highlight value of the hair according to an illumination anisotropy simulation algorithm;
acquiring gray values corresponding to the hair random texture images and color information corresponding to the hair noise images according to the texture information on the hair pixel points;
deflecting the hair texture tangent value in the hair pixel point according to the gray value to obtain a random and disordered hair texture tangent;
performing linear interpolation calculation according to the color information and the highlight value to obtain a highlight value with random noise variation;
according to the formula
Figure FDA0003244557890000022
Calculating to obtain the hair shadow color ShadowColor;
wherein the shadowRange is a hair backlight range, the light vector is a light source vector, the PixelNormal is a hair texture normal, the ColorRange is a shadow pile-up range, the ShadowColorRange is a shadow Color range, the Color is a shadow pile-up Color, and the ColorPower is a shadow Color intensity;
the calculation according to the illumination anisotropy simulation algorithm to obtain the high light value of the hair specifically comprises the following steps:
according to the formula
Figure FDA0003244557890000031
Calculating to obtain a highlight value OutLight of the hair;
wherein, the H is a light source detection vector, the Viewvector is a visual vector, the dirAtten is an attenuation coefficient for controlling a highlight visual range, the Smoothstep is a default interpolation function, the Power is a highlight change rate, the PixelTangent is a hair texture tangent line, and the Strength is a highlight intensity; SpecRange is the specification range.
6. The computer-readable storage medium according to claim 5, wherein the program, when executing the step of calculating the highlight value of the hair according to the illumination anisotropy simulation algorithm, specifically comprises:
acquiring a light source vector of a scene where hair is located;
obtaining a hair texture tangent line through a fluid diagram;
and calculating by adopting an illumination anisotropy simulation algorithm according to the light source vector and the hair texture tangent to obtain a high light value of the hair.
7. The computer-readable storage medium according to claim 6, wherein the program when implementing the step of calculating the highlight value of the hair by using the illumination anisotropy simulation algorithm according to the light source vector and the hair texture tangent line specifically comprises:
substituting the light source vector and the hair texture tangent line into a formula:
Figure FDA0003244557890000032
the calculation was performed to obtain the highlight value of hair OutLight.
CN201710427235.2A 2017-06-08 2017-06-08 Cartoon picture hair rendering method and storage medium based on UE4 platform Active CN109035381B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710427235.2A CN109035381B (en) 2017-06-08 2017-06-08 Cartoon picture hair rendering method and storage medium based on UE4 platform

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710427235.2A CN109035381B (en) 2017-06-08 2017-06-08 Cartoon picture hair rendering method and storage medium based on UE4 platform

Publications (2)

Publication Number Publication Date
CN109035381A CN109035381A (en) 2018-12-18
CN109035381B true CN109035381B (en) 2021-11-09

Family

ID=64629459

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710427235.2A Active CN109035381B (en) 2017-06-08 2017-06-08 Cartoon picture hair rendering method and storage medium based on UE4 platform

Country Status (1)

Country Link
CN (1) CN109035381B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109685876B (en) 2018-12-21 2020-11-03 北京达佳互联信息技术有限公司 Hair rendering method and device, electronic equipment and storage medium
CN110944230B (en) * 2019-11-21 2021-09-10 北京达佳互联信息技术有限公司 Video special effect adding method and device, electronic equipment and storage medium
CN113763526B (en) * 2020-06-01 2023-10-03 上海米哈游天命科技有限公司 Hair highlight rendering method, device, equipment and storage medium
CN113379885B (en) * 2021-06-22 2023-08-22 网易(杭州)网络有限公司 Virtual hair processing method and device, readable storage medium and electronic equipment
CN113421248B (en) * 2021-06-30 2024-02-09 上海申瑞继保电气有限公司 Substation equipment rotating image numerical value processing method
CN113888398B (en) * 2021-10-21 2022-06-07 北京百度网讯科技有限公司 Hair rendering method and device and electronic equipment
CN113989439A (en) * 2021-11-08 2022-01-28 成都四方伟业软件股份有限公司 Visual domain analysis method and device based on UE4
CN116206006A (en) * 2023-03-02 2023-06-02 达瓦未来(北京)影像科技有限公司 Card style direct illumination effect rendering method based on UE rendering engine
CN116883567B (en) * 2023-07-07 2024-08-16 上海散爆信息技术有限公司 Fluff rendering method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104063890A (en) * 2013-03-22 2014-09-24 中国移动通信集团福建有限公司 Method for cartooning human face and system thereof
EP2852934A1 (en) * 2012-05-23 2015-04-01 Glasses.Com Inc. Systems and methods for rendering virtual try-on products

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2852934A1 (en) * 2012-05-23 2015-04-01 Glasses.Com Inc. Systems and methods for rendering virtual try-on products
CN104063890A (en) * 2013-03-22 2014-09-24 中国移动通信集团福建有限公司 Method for cartooning human face and system thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
hair rendering and shading;Thorsten Scheuermann;《豆丁网》;20120629;正文第7-11页 *

Also Published As

Publication number Publication date
CN109035381A (en) 2018-12-18

Similar Documents

Publication Publication Date Title
CN109035381B (en) Cartoon picture hair rendering method and storage medium based on UE4 platform
Treavett et al. Pen-and-ink rendering in volume visualisation
CN106815883B (en) Method and system for processing hair of game role
CN102663766B (en) Non-photorealistic based art illustration effect drawing method
CN104063888B (en) A kind of wave spectrum artistic style method for drafting based on feeling of unreality
Huang et al. Painterly rendering with content-dependent natural paint strokes
Bruckner et al. Hybrid visibility compositing and masking for illustrative rendering
WO2023109486A1 (en) Hair model generation method and apparatus, electronic device, and storage medium
Cui et al. Image‐based embroidery modeling and rendering
CN109308380B (en) Embroidery artistic style simulation method based on non-photorealistic sense
Xing et al. SVGDreamer: Text guided SVG generation with diffusion model
Gooch Interactive non-photorealistic technical illustration
Mattausch et al. Freeform shadow boundary editing
Hsu et al. Depicting time evolving flow with illustrative visualization techniques
CN113763526A (en) Hair highlight rendering method, device, equipment and storage medium
Li et al. Image stylization with enhanced structure on GPU
Seo et al. Interactive painterly rendering with artistic error correction
Gao et al. PencilArt: a chromatic penciling style generation framework
Barile et al. Animated drawings rendered by genetic programming
Li et al. ARF-Plus: Controlling Perceptual Factors in Artistic Radiance Fields for 3D Scene Stylization
CN116883580B (en) Silk stocking object rendering method and device
Mesquita et al. Synthesis and Validation of Virtual Woodcuts Generated with Reaction-Diffusion
Rezaei et al. Hybrid filter blending to maintain facial expressions in rendered human portraits
Lü et al. Image watercolorization based on visual weight-map
Shin et al. A stylized cartoon hair renderer

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