• Hi Guest!

    We are extremely excited to announce the release of our first Beta1.1 and the first release of our Public AddonKit!
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. For access to the Public AddonKit you must be a Creator tier member. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.
  • Hi Guest!

    VaM2 Resource Categories have now been added to the Hub! For information on posting VaM2 resources and details about VaM2 related changes to our Community Forums, please see our official announcement here.
Custom Shader - CUA Hair

Assets + Accessories Custom Shader - CUA Hair

Download [1.95 MB]
MSAA variant update

  • Added the missing json file for MSAA variant
  • Removed transparent passes as with AlphaToMask it is not really needed anymore
  • Added two new properties to better control alpha
    • Alpha Transition High / Low
      • Default to 0.95 / 0.05, most of the time you don't need to adjust these, but sometimes the alpha channel of the main texture may not have very good distribution, in such cases you'll see transparent edges on the hair being too wide / too narrow. Adjusting these two will correct it.
  • Alpha cutoff default changed to 0.1. In general with MSAA variant you want this to be fairly low, as a matter of fact many times you can set it to 0.

Starting from this release I'll treat the MSAA variant as the main recommended version to use, since it just looks better most of the time. In my testing at 2x MSAA the performance is still fairly good. If performance is a concern you can always switch to the non-MSAA variant.
Well I finally figured out why light atten was not working for me and it was because my dumbass couldn't tell the difference of one underscore and two :(

Update:

  • Now has proper scatter effect from strong light source, and correct shadow attenuation calculation. The lighting should be much more accurate under setup with large dark/bright contrast. (i.e. no more bright hair in shadows)
OLD:
1756693632.jpg
1756694096.jpg


NEW:
1756693503.jpg
1756694087.jpg



Added two new property controls and renamed one:
  • Scatter intensity - how much light scatter and can be seen from back side of the hair being lit
  • Scatter power - How 'sharp' the scatter lit area transition into shadowed area
  • Scatter Overall - previously "Subsurface Scattering", controls overall brightness (including lit area) caused by scattering.

Please note:
  • The scatter effect of the hair is dependent on the shadow attenuation. Therefore shadow quality and shadow strength of the scene lights will affect the look. If it looks weird under certain light setup and adjusting shader property doesn't help, try adjusting shadow quality/shadow strength of the light

  • Added stencil buffer writes to discard already rendered pixels from cutout passes, should give a decent performance boost
  • Optimized away a lot of branches for additional performance

Known Issue:

Some times you will see part of the UI show up on the hair when it shouldn't.
So apparently, VaM uses stencil buffer to do UI visibility crops. I'd imagine the UI render will clear the stencil buffer beforehand but it looks like it doesn't. So the hair shader's stencil write will mess up UI's visibility.

I don't think this is a real functional issue other than it just being annoying, but I'll see if I can get around it. Or of the performance boost brought by the stencil mask is not that great maybe I'll remove it.
Updates to sync this release to the version used in my Chunli look:
  • Tweaked the fake SSS code. Now at low SSS value the hair won't get darkened
  • Removed specular highlight from transparent passes to boost some performance
  • Added a variant: RegguiseUnityHairShader_MSAA - where MSAA will be applied using VaM's MSAA setting.
    • It can eat some FPS for close ups and higher res meshes. But will give better look. Use at your own discretion.
Now you can pick root and tip color tint for the hair

  • Removed _Color property
  • Added Root Color, Tip Color, Original Diffuse Color offset, Use Original Color, Color Gradient Rotation, Color Roll off

The new properties:
  • Use Original Color
Unchecking this will make the hair use color purely from Root Color and Tip Color, the original texture's color value is discarded.
  • Original Diffuse Color Offset
When "Use Original Color" is checked. This offsets the original texture's color value. When "Use Original Color" is unchecked, this property has no effect.
  • Root Color / Tip Color
Works similar to VaM's native hair properties. Except depending on the texture UV, some hair strands may not have same gradient as the others. This is due to some hair texture have multiple rows of hair strands along same axis. It is impossible to determine where the root starts and where the tip ends without providing an additional texture map with that info. I am looking into a solution.
  • Color Roll off
Works similar to VaM's native hair property
  • Color Gradient Rotation
This determines which direction the shader treats as root/tip. default is 0. values:
0.00/1.00 = +y (up)
0.25 = +x (right)
0.50 = -y (down)
0.75 = -x (left)

If you see the root/tip colors are inversed and/or not going in the right direction, try changing to one of the values above to flip the direction.
Added double side mode for back faces

Now both ShowBackFace and DoubleSided default to ON.

1747438370040.png


DoubleSided will only active when ShowBackFace is also ON

Now it should look best with them both ON in most cases I can think of. But do still try toggle them to see what looks better.

Thanks to @BooMoon for testing.
Back
Top Bottom