Stylized Hair Shader Documentation

Stylized Hair Shader
Author: jonathan
Version: 1.0.0
Dated: 05 Oct 2017

1.Stylized Hair Shader #

Thank you for purchasing the Stylized Hair Shader!

Please consider rating the package through your download list or leave a review at the store page once you’re familiar with it.

Your feedback is instrumental to the future of this package!

Rate     Review

Feedback and suggestions can be made in the forum thread:

https://forum.unity.com/threads/498994/

This manual is intended to clarify the use of the package and should be consulted for troubleshooting.

Yes No Suggest edit
0 of 0 users found this section helpful

2.Getting started #

  1. Import the Unity package through the Asset Store download manager (Found under Window->Asset Store)
  2. Create a material and assign it to your hair mesh
  3. Select “Stylized Hair Shader” from the shader list on the material
  4. Use the material properties to start modifying it to your liking.
Yes No Suggest edit
0 of 0 users found this section helpful

3.Support #

The material inspector has a “Show help” toggle button which will show the parameter descriptions, where needed.

Should you run into any issues or have questions/feedback, please do not hesitate to reach out! I will do my best to respond as soon as I can.

Unity forums thread: https://forum.unity.com/threads/498994/

E-mail: contact@staggart.xyz

Twitter: @JonnyIO

Yes No Suggest edit
0 of 0 users found this section helpful

4.Parameter glossary #

Rendering

Toon shading Switch between toon- and smooth shading
Cull mode Set the shader to render double-sided, or cull the front- or back faces
Rendering mode Render as opague or cutout object. Cutout mode is disabled if there is no diffuse map supplied

Main maps

Diffuse Diffuse map, where the alpha channel is used for alpha clipping in Cutout mode
Normals Normal map used to perturb the lighting and specular effects, which will appear to follow the hair strands.

Lighting

Light mode Set the shader to only receive the Directional Light, or use both the Directional Light and point/spot lights through vertex lighting (not per-pixel)
Intensity Controls the intensity of the effect
Size Controls the size of the effect
Perturbation Bends the lighting effect along the normal map

Specular

Specular mode Choose between a realistic or simple effect. The realistic mode is modeled after the Kayija-Kay anisotropic reflection model.
Light direction bias (Only available in Simple mode) Have the specular highlight follow the light direction, or have it fixed to the top
Intensity Controls the intensity of the effect
Size Controls the size of the effect
Perturbation Bends the lighting effect along the normal map

Fresnel (Rim light)

Intensity Controls the intensity of the effect
Size Controls the size of the effect
Yes No Suggest edit
0 of 0 users found this section helpful

5.Mobile #

The shader has been optimized to perform on lower-end devices. However, depending on your project, certain features are best disabled.

For the shader to run the fastest, set these parameters to the following values:

Toon shading: Yes
Normal map: Leave empty
Culling mode: Back
Light mode: Directional
Specular mode: Simple

The minimum supported Shader Model is 3.0. Don’t worry, any device newer than an iPhone 3GS supports this.

Yes No Suggest edit
0 of 0 users found this section helpful

6.Troubleshooting #

Shader shows pixellated artifacts

The shader will typically struggle with rendering a lot of vertices, where values will not be interpolated anymore, but rather show on a per-face basis.

For example, this model on the left is 65k polygons, and shows artifacts:

The model on the right has been reduced to 10k polygons and renders accurately.

Realistic specular highlight looks completely off

The calculations are dependent on the mesh’s tangents. Some 3D authoring tools might export them differently.

To correct this, set the tangents of your model file to “Calculate Tangent Space”.

Object doesn’t appear to receive shadows

If you’re using Toon shading the shadows need to be at full strength on your Directional Light. Because with this type of shading, shadows are either completely off or on, there is no in between.

If you’d like softer shadows, use stronger ambient lighting instead.

Yes No Suggest edit
0 of 0 users found this section helpful

7.UV Layout #

When using the “Realistic” specular mode, you’ll achieve the most accurate results if the UV’s of your hair mesh are laid out vertically, from base to tip.

For example, this is the UV layout of the MCS Male hair model:

The demo model that is included unfortunately does not have the correct UVs. In this image you can see the original model on the right, and the model with corrected UVs on the left:

Yes No Suggest edit
0 of 0 users found this section helpful

8.Refunds #

Please refer to our refund policy

Yes No Suggest edit
0 of 0 users found this section helpful

9.Credits #

The included bust model was created by the user filiporekhov on Sketchfab under the Creative Commons Attribution license.

Yes No Suggest edit
0 of 0 users found this section helpful
Suggest Edit