Search Unity

Question Fur shader using LWRP and Shader Graph

Discussion in 'Shader Graph' started by WendelinReich, Apr 24, 2019.

  1. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    228
    Hi everyone, I've used SG quite a bit in recent weeks and come to appreciate it. As someone who doesn't have a background in hand-coded shaders, I also wonder about it's limitations. Specifially, would it be possible to build a (simple) fur shader using only SG and targeting the LWRP?

    Any ideas would be appreciated.

    Here's a nice example of what I'd like to achieve (example taken from a game called Fluffy Fall):
     
  2. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    have been giving this a lot of thought my self. Currently my research points to using a parallax effect, kind of like the ice cracks technique but inverted.

    Another idea is to use the grass technique and apply some world position based noise, so when the object moves around, the fur is pushed around
     
    WendelinReich likes this.
  3. WendelinReich

    WendelinReich

    Joined:
    Dec 22, 2011
    Posts:
    228
    Cool, if you manage to prototype any of that, make sure to post it here :D
     
  4. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    I had a look at the Fluffy Fall video.

    It's implementing fur with the "shell" technique, and there's plenty on the store.

    It's basically taking the base mesh, replicating it with some delta position, and "inflating" it in the direction of the vertex/pixel normal. Just iterate on this, possibly applying an erosion shader to the same texture, to give the feeling of extrusion. Or, use a noise function fading from 1 to 0 alpha gradually on every shell.

    The "brute" way to do it would if you're really in a hurry is faking it by actually duplicating the same mesh with different scale values and overlapping them.

    Of course, it's not as performant, but gets the job done in a minute. Make sure to use an appropriate texture to simulate shadows (baked)

    You can as well simulate the wobbly effect by displacing/rotating the array of shells in the direction of the motion. You can do it both in the shader version or in the quick and dirty way :)

    Detail of the shell shader:
     
    WendelinReich likes this.
  5. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    @WendelinReich this is using shader graph LWRP on a single sphere, inspired by the ice crack tutorial
    fur shader graph2.gif shader graph fur.png
     
    Last edited: Apr 27, 2019
  6. starfoxy

    starfoxy

    Joined:
    Apr 24, 2016
    Posts:
    184
    Really interested if this has progressed any further. No pun intended. ;) But seriously, I'd love to know if this might be possible with shader graph.
     
    johnhurliman and WendelinReich like this.
  7. enhawk

    enhawk

    Joined:
    Aug 22, 2013
    Posts:
    833
    the above was done in shader graph
     
    NeatWolf likes this.
  8. gputhread

    gputhread

    Joined:
    Dec 7, 2018
    Posts:
    36
    NeatWolf likes this.
  9. WangJingLin

    WangJingLin

    Joined:
    Dec 3, 2019
    Posts:
    1
  10. el_rolas

    el_rolas

    Joined:
    Aug 6, 2012
    Posts:
    15
    can you share it?
     
  11. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    But this does not really give you a furry :) outline.
    You would still need to place haircards on the character mesh to give it some volume and outline.