Search Unity

Imperial Fur - PBR Fur Shaders!

Discussion in 'Assets and Asset Store' started by HemiMG, Mar 15, 2015.

  1. KaTsuoo1

    KaTsuoo1

    Joined:
    Jun 29, 2013
    Posts:
    8
    That is certainly understandable. If you do another major update that breaks things, then I think changes like that could be appropriate. Thankfully it isn't too difficult to invert channels. At least not in Photoshop.

    To try it out, I made a black and white, gradient image, where the top is white, and the bottom black. Just inverting the blue channel, gave a bad result. But using the Levels window and pulling the black output levels handle, to around 180, it gives a decent result. Might not be accurate enough for long fur, but for shorter fur, it works pretty well.

    Furry Sphere.gif

    I was able to change line 18 in IFCommonVert.cginc, from:

    v.vertex.xyz -= v.normal * skinLength;
    to:
    v.vertex.xyz -= v.normal * (skinLength * 0.3);

    Which means I just have to invert blue channel, and it gives that result. So if anyone else would need it to work like that, then this is one way to do it.

    The screenshot that I linked, used the default settings for the physics script, so any kind of gravity from the script pulls the fur in the wrong direction. However, It works just like expect on a sphere. So perhaps it's a problem with the model I'm using.

    Window.png

    That's what I see on my 16:9 Monitor, with 1920x1080 resolution. So I can't move it at all. Yeah, it would be odd if they didn't mention it, if they noticed the problem.
     
  2. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    Yeah, when I was doing the bias map for the cat I noticed that the values you may expect to work didn't. The bias doesn't seem to like pure black. Mostly because edge fade, some noise maps, and other things can make the fur not exactly as long as you put in the fur length parameter. But that parameter is all the the bias map looks at.

    The physics thing does sound like a model problem, but I'm not sure what that problem would be. It worked find on my cat model, a torus model I had, the cylinder, and of course the spheres. Could the normals be inverted on the model? I suppose it wouldn't show up at all due to backface culling if that were the case. That's really odd. The physics script uses Unity to convert the physics from world space to object space and the the shader uses that value. I'm not exactly sure where in that process things would get messed up.

    Wow. That TCM window is horrible. I'm really sorry about that. It doesn't appear anywhere near that high on my computer. Now I'm curious what monitors Unity are using. Maybe they just didn't notice. But the standalone asset was approved twice and the it was also included in the fur shader. Either way, I'll try to make time for a fix for that this weekend. That is an unacceptable bug.
     
  3. jldevoy

    jldevoy

    Joined:
    May 2, 2014
    Posts:
    33
    This looks very interesting, any chance of an example showing fur on an animated skinned mesh? (spider, teddy bear etc)
     
  4. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    Sorry for the late reply, I've been busy dealing with an issue with a client. I originally wanted to do an animated character demo for the 2.0 update, but I got way behind schedule on other projects as the scope of the simple fixes that I wanted to make grew and I lost 3 or 4 days trying, and failing, to get shadows working correctly on the fur. I'll eventually get an animated demo up, but I have to play catchup on a few projects that I've gotten behind the deadline on first.
     
  5. rebit

    rebit

    Joined:
    Nov 13, 2014
    Posts:
    133
    Wow ! HemiMG, the community is making Unity 5 more powerfull day by day !! Congrats and thank you for doing this.
     
    HemiMG likes this.
  6. Stormbreaker

    Stormbreaker

    Joined:
    Aug 15, 2012
    Posts:
    161
    @Hemi Great asset. Do you have any tips to get the fur working correctly with post processing i.e. DoF?

    Thanks
     
  7. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    I have an object that uses version 1 (actually, pre-version 1) in a scene that uses DoF and didn't notice anything off. Although it is just setting there not moving because I've been too swamped with work to get back to the game. Does the shader not behave properly with DoF? If not, I'll have to do some tests to see what is going on. But it might take a while. I'm essentially working two full time jobs right now so even finding time to eat and sleep is difficult. Of course, I don't want a horribly broken asset that people are paying for on the store either, so I guess how quickly I can get to it depends on how bad it is.

    Just turning on DoF takes my Geforce 9400M down to around 2.5fps, so hopefully whatever the issue is doesn't require smooth framerates to notice. :(
     
  8. Stormbreaker

    Stormbreaker

    Joined:
    Aug 15, 2012
    Posts:
    161
    Here's a screenshot. You can see the 'real' deer is blurred but the fur isn't (there's a sharp divide between the fur and model). The shader also doesn't play nice with the Sunshine asset, resulting in a ghosting effect. I'm no shader expert, is there a way to overcome this?

    Thanks for the quick response!
     

    Attached Files:

  9. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
  10. Stormbreaker

    Stormbreaker

    Joined:
    Aug 15, 2012
    Posts:
    161
    Okay, great to hear! I'm already in deferred mode. The shader looks awesome, and it's really easy to tweak.
     
  11. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    Hmm. It may be a while before I can get that issue fixed. I'm in a rush to get a first draft of this project to a client by Monday, so I'm working overtime. I did pop in and try to take a look at the issue, but depth of field seems to work fine on my end, see the attached screenshot.

    Are you using Windows by any chance? I wonder if there's a difference between the way DirectX handle things and the way OpenGL handles things? I'm definitely going to try to find a solution, so please don't think I'm blowing off the problem. It's just a bit harder for me to debug the Windows version than I have time for with the work load on my plate right now.

    I did realize that I forgot to address the issue with Texture Channel Manager mentioned above, and I'm really sorry to anyone who is still experiencing that. There is no excuse for that delay, so I won't try to make one. That is something that I should be able to take care of today. I also noticed that one of the test scenes I had when I was trying to get shadows in made it into the update. That should have been deleted and it really bothers me that it is setting there in the file list potentially misrepresenting what the product is capable of. So hopefully the update is approved sooner rather than later.

    DOFTest.jpg
     
    Stormbreaker likes this.
  12. Stormbreaker

    Stormbreaker

    Joined:
    Aug 15, 2012
    Posts:
    161
    Yep I'm using Windows. If you need me to test any fixes drop me a PM :)
     
  13. rebit

    rebit

    Joined:
    Nov 13, 2014
    Posts:
    133
    Im running windows too, if you need more than one fix tester PM me !
     
  14. andre-ivankio

    andre-ivankio

    Joined:
    Mar 29, 2010
    Posts:
    53
    I too want a good grass shader for archviz and you say it would be lighter than the fur shader. I'll sure want to know. A template like that one from GTA would translate in some sales for sure. But on that image, it seems each height has a slightly different texture do simulate bent blades of grass and get a richer depth shadow.

    Meanwhile, if I understood it correctly, your fur shader does already receive shadow, on Unity5, how does the surface behave with realtime GI?
     
  15. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    No, the shader doesn't receive shadows yet. I haven't been able to find a technique that works with Unity 5. Things that would have worked in 4 break in 5. I haven't noticed any issues with real time gi. Any grass shader will be a long way off. Life keeps getting in the way of even finding time to work on existing projects. But paid work keeps the lights on, so I guess I shouldn't complain. I just don't like having a todo list that never gets any shorter.
     
    andre-ivankio likes this.
  16. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    86
    I have found someone who could make me a fur shader that can receive shadows after I posted those pictures earlier. Here is the result:

     
    Last edited: May 14, 2016
    inum76 likes this.
  17. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    Do those shadows work with all light sources? Any chance this person will share with me how they did it? I have no idea when I would find time to get it into my shader, but I'm sure my customers would appreciate it whenever the time comes.
     
  18. Goldenvale

    Goldenvale

    Joined:
    Feb 26, 2015
    Posts:
    86
    The shadows work with all light sources, it uses the standard shader so even global illumination works. I've bought the rights to this shader which wasn't cheap and I would be willing to share it with you if you were going to use it personally, but unfortunately since you are going to sell it I can't.
     
  19. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    I totally understand. It was worth a shot though. Imperial Fur uses the standard shader as well. It's just that multiple passes don't play nice with the shadow receivers.
     
  20. Stormbreaker

    Stormbreaker

    Joined:
    Aug 15, 2012
    Posts:
    161
    Hey Hemi, after doing a bit more playing around I can see that my furry object isn't being put into the depth buffer (adding the Depth of Field (Lens Blur, Scatter, DX11) effect and selecting the Visualise option causes the furry object to completely disappear). Is there any ETA on when this could be fixed?

    Thanks
     
  21. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    I don't have an exact ETA because work for clients is bogging me down. It's obviously as high of a priority as I can make it though, because sales of my own products are what reduce my need for clients in the first place. Tonight, I hope to place an order for a new ASUS ROG gaming laptop. So I'll have a native Windows machine to test and develop on without having to rely on virtual machines. My current machine only has 4GB of ram, so running Windows in a virtual machine is a bit of a pain. That should help greatly in my ability to multitask because I'll be able to work on Imperial Fur without closing down everything I'm working on for clients (and every other program running) and start a virtual machine.

    The furry object completely disappears? That's puzzling because I would think at least the base model would show up. That may be a clue. Hopefully it's just something really simple that I've overlooked. Maybe a setting that OpenGL ignores but DirectX uses or vice-versa, a setting that DirectX needs that OpenGL doesn't.
     
  22. DCrosby

    DCrosby

    Joined:
    Jan 13, 2013
    Posts:
    86
    I saw the question was asked but not answered due to Old Hardware, which didn't support Unity5.
    But I'd like someone who has used it with a recent build of iOS or Android, to verify that 1 or 2 animals on screen don't tank the frame-rate.Maybe then HemiMG can also update the Store Description on weather or not Mobile is supported. I know it's probably a function of how many shells etc.. but having a 1 Shader does both mobile and desktop would be a welcome change to the current, $40 for Desktop; $40 for Mobile implementation that's up in the asset store.
     
  23. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    I'm really sorry for taking so long to update you guys on the problems, life has been chewing me up and spiting me out so I haven't had much time to look into things. I can't replicate the DOF problems on my Windows laptop. DOF works fine. I can replicate the problem by turning on screen space fog and jacking it way up though.

    Unfortunately at this point I haven't found a way to make the shaders work as they are. They rely on transparency and I haven't been able to get them to write to the depth buffer. A possible solution is to write a new set of shaders that use alpha cutouts. Those will write to the depth buffer and work just fine with screen space effects. I've tested it enough to confirm that. But simply telling it to render with alpha cutout makes the fur look more like glitter than fur. So the shaders will have to be updated in order to look decent. It's not a perfect solution, and won't replace the main shaders for people who don't need image effects because without alpha blending the fur won't look as smooth. But hopefully I can come up with something that looks decent.

    This gig that is consuming all of my time should be over in a few weeks, but I may not be able to get to it until then, because it's pretty much a ground up rewrite for a different workflow. From what I can tell, at the very least the noise textures are going to have to change and so many of the other features rely on the alpha channel that it could be quite a task to replicate it all using cutouts.

    Now that I have a Windows machine, I am able to replicate the issue with Texture Channel Manager appearing way up in the corner without the ability to move or close the window. That is horribly, horribly annoying. But I'm using the position that Unity gives me to place the window. I could offset the position that Unity gives, but that would cause the window to shift by that amount every time it is opened or resized by changing the channel count. I could also just set it to a default position, but then it would jump to that position every time it is resized by channel count and ignore the user's placement when it is reopened. If Unity is giving me bad values, it definitely seems like a Unity bug, so when I get a chance to make a simple test scene, I'm going to report it.
     
  24. NightmarexGR

    NightmarexGR

    Joined:
    Jun 7, 2012
    Posts:
    217
    Hello , before buying i would like to know if it is going to work with animated skinned meshes.
    Will it follow their movement ?
    I have this model and i want to add fur to its back: image
     
  25. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    @NightmarexGR I'll PM you in a few minutes with more info so wait for that before buying. The short answer is that I haven't tried it, but it should work. I still haven't found time to get the shadows in, so I don't know if that's a deal breaker for you. I only just finished up a gig for a difficult client and I'm trying to get caught up on a half a dozen different things while fighting off burnout. I suspect it's going to take a full rewrite with alpha cutouts and finding a way to make those look decent, so I need to reduce my workload before getting into something that might cause me to slip further behind.
     
  26. ninjaboyjohn

    ninjaboyjohn

    Joined:
    Mar 30, 2014
    Posts:
    23
    Just wanted to chime in - I'm using Imperial Fur on animated (legacy) skinned mesh characters in my project and it works fine as they animate.

    Here's an animating character from my project using Imperial fur with the _ControlTex keeping fur from appearing on his eyes / mouth, etc.

     
    HemiMG and hopeful like this.
  27. NightmarexGR

    NightmarexGR

    Joined:
    Jun 7, 2012
    Posts:
    217
    Wow looks promising, I will for sure post a reply with my results once i can. I am busy with another project atm
     
  28. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    976
    Is it or will it be possible to define direction of the fur, so something like this can be achieved?

     
    inum76 likes this.
  29. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    @ninjaboyjohn Wow! Thanks for sharing that!

    @SunnySunshine Right now it is not possible to define the direction of the fur. Unfortunately, I don't think that is a feature that will be coming soon. Control over the direction of the fur is done at the vertex level so controlling the direction of the fur in that way could get tricky fast. I wouldn't want vertexes overlapping each other or things of that nature. As I learned when making bias maps, things can get pretty hairy (pardon the pun) if you aren't careful with the settings. Because it's only in one direction, it's fairly easy for an artist to make sure that a bias map doesn't cause vertex geometry problems. Basically you just don't set it to shrink in at a greater value than the depth of the model. With multiple directions, either the artist's life would be more difficult, or mine would. It would probably also require a special tool to author such textures.
     
  30. NightmarexGR

    NightmarexGR

    Joined:
    Jun 7, 2012
    Posts:
    217
    The fur works fine on animated objects problem is , i can't make the shadows work.. Thats a big dissadvantage , can it be fixed ?
     
  31. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    @NightmarexGR I apologize for the delay in getting back to you. I went away over the holidays. Unfortunately shadows do not work as of it. The problem with shadows on fur is that fur uses alpha blended textures, and Unity does not support adding shadows to alpha blended textures. I want to eventually solve the problem, but as near as I can tell it will require switching over an alpha cutout texture and so far I haven't been able to make those look as nice as I'd like them too.

    @kinklade I responded to your PM, but maybe someone here has had a similar problem and can shed some light on it. It certainly sounds like there's something off on the model file itself.
     
  32. al3d

    al3d

    Joined:
    Feb 7, 2013
    Posts:
    51
    is there any way to make it work with ssao ? i've tried with "ssao pro" but nothing happen :/
     
  33. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    There is a problem with some of the depth effects that, much like shadows, I haven't been able to find a workaround for. I'm hoping that getting a set of shaders that uses alpha cutouts will resolve both issues, but I'm neither optimistic nor pessimistic about that solving the depth issue. I'm hoping to get caught up on my workload and get started trying to figure out how to make everything look nice with alpha cutouts soon. I'm not sure how to define "soon" though, as here lately everything seems to be taking longer than I would like.
     
  34. ninjaboyjohn

    ninjaboyjohn

    Joined:
    Mar 30, 2014
    Posts:
    23
    Fyi - here's a video of the project I'm working on using Imperial Fur!

     
    punk likes this.
  35. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    Hi @HemiMG,
    Nice package, but I would like to know if those shaders are working on WebGL.

    Thank you !
     
  36. PhosphorUnity

    PhosphorUnity

    Joined:
    Jan 22, 2014
    Posts:
    39
  37. TWaanders

    TWaanders

    Joined:
    Mar 27, 2013
    Posts:
    46
    Same question here, does the latest version run well on mobile?
     
  38. bigboybifdick

    bigboybifdick

    Joined:
    Feb 8, 2014
    Posts:
    60
    Hey,

    What about WebGL export ?
     
  39. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    Hey guys. I'm really sorry for the long absence. I had some things I needed to deal with.

    @ninjaboyjohn That looks really awesome! It's a really creative use of the shader.

    @MaT. and @bigboybifdick WebGL seems to work fine as far as the shader is concerned. WebGL itself for me still seems to not look as good as a standalone build though. Something about the walls in the cornell box just don't seem as well lit or shaded as a standalone build.

    @stickleZ and @TWaanders I've had customers tell me that it works fine on newer Android and IPhone models. I'm not sure it would work well for a feathered look though.
     
  40. bome99

    bome99

    Joined:
    Sep 14, 2009
    Posts:
    119
    Hi, I'm having some trobble getting the shader to work with Global Fog camera effect i deferred rendering.
    Do you have any idea why it doesn't work?

    Cheers
    Bo
     
  41. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    Transparent shaders, like the one used in the fur, don't write properly to the depth buffer so that is probably the cause of the issue. I'm dealing with health and financial issues right now, but as soon as I get a chance I want to have a go at creating a version of the shaders that uses an alpha cutout to see if that won't give fix your issue as well as let the fur receive shadows.
     
    bome99 likes this.
  42. unitynoob24

    unitynoob24

    Joined:
    Dec 27, 2014
    Posts:
    398
    Hey guys!

    Sorry to necro this thread!

    But I am looking for some help with doing some pretty straight forward stuff! Photoshop is not something I use to often and I believe what I would like to do can be achieved, I am just having a terrible time getting it to work.

    I am using Imperial Fur, and have used it in the past on solid objects. I am currently doing some creature work, and would like to do something where I cover the creature in fur, except for certain areas like horns, mouths etc etc.

    So for the fur texture it can be anything that gives me the patter I want. Then from what I gathered reading around, I can have the Skin texture be my creatures skin/color etc. And the Alpha channel on the Skin texture will disregard Fur from the Fur texture?

    For some reason that is not the case. If I have an RGB Fur texture, it covers the entire creature and disregards the Alpha channel on the Skin texture.

    The reverse seems to work fine, if I use some of the included examples those seem to work. Where I put a Fur texture on that has an Alpha channel, denoting the heightmap.

    I just want to have fur covering my model except for his horns and mouth area.

    Any help or suggestions would be greatly appreciated! Once I get that working, it would be sweet to have some fur areas longer than others.. (if that is doable)

    Thanks guys!
     
  43. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    @unitynoob24 I responded to your message before I saw this post, so I didn't realize that you had already tried doing it in photoshop. The workflow changed a bit when 2.0 was released. Now the alpha channel of the fur texture should stop the fur from rendering. Just put black in the alpha channel where you don't want to have fur.
     
  44. TimeSniper

    TimeSniper

    Joined:
    Nov 26, 2012
    Posts:
    18
    Hi?

    I just purchased this few days ago. I am interested in your Heightmap demo which is showing different grass height according to the material. After testing it, I found the grass is on the mesh not terrain. Can you let me know how I can use this shader on the terrain?

    Thanks in advance.
     
  45. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    Looks nice.
     
  46. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    There is some yellow warning on Unity 5.5 b3 can you please check this out? I really love this fur it's the best fur I ever seen please don't leave this asset.
     
  47. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    Hi, I am really sorry for how long it took me to see this. I'm not leaving the asset behind, I'm just in some pretty serious financial trouble right now and have a backlog of work. Does the warning seem to break anything?
     
    Crossway likes this.
  48. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    Thanks, the shader still working charming.
     
  49. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    Hi again, is there any chance for a deferred version of this cool fur shader?
     
  50. HemiMG

    HemiMG

    Joined:
    Jan 17, 2014
    Posts:
    911
    There a quite a few updates that I'd like to make to the shader. I'm just not sure when I'll find time because I'm in pretty serious financial trouble right now. It really bothers me that the asset is setting there with improvements that could be made, so hopefully it won't be too long before I can find some time to breath and get to work on it. I really don't want to give an estimate though.
     
    Crossway likes this.