Imperial Fur - PBR Fur Shaders!

Asset Store Page

Hi everyone. I am very pleased to announce Imperial Fur, my latest asset. I needed a fur shader, and the one I was looking at in the asset store apparently doesn’t work with Unity 5. That created a perfect opportunity for me to create a set of shaders that takes full advantage of everything Unity 5 has to offer.

The screen above shows the included demo scene with several furred spheres. Imperial Fur has a few features that I think really set it apart from the competition. The first being the option to use PBR surface shaders as can be seen in the shot above, and most noticeable in the metal bristles.

Here you can see the furred objects reacting realistically to the physics in the game. Not only can they react to RigidBody velocities, but the included script can also be set to calculate the velocities on its own for those cases where you may not have a rigid body attached to your object. A simple wind effect is also included in the script. Although, full disclosure, the wind doesn’t seem to work all that well on the grass shown below.

The alpha channel of the fur texture doubles as a height map so you can create some interesting effects. Shown here is grass on a dirt plane, but it could also be useful for creating a nicer fade in areas where there is no fur, such as a face.

You’ll also notice that it has an optional extra texture for the skin. The grass demo does a good job of showing how great that can be, as the dirt shows through the grass in areas where other fur shaders wouldn’t allow without creating a separate object.

If you choose to add a skin texture, you can use the alpha channel of that map to further control the opacity of the fur. Here is a pretty extreme example turning leopard spots into a peach fuzzy sort of look. But even at less extreme settings, a fair amount of opacity really helps the underlying skin to show through the gaps as the fur moves back and forth.

There is an option to add rim lighting for that halo effect that fur and hair can have. It can be set to use a custom color for a more prominent effect, or the ambient lighting color for something more subtle.

Like the Unity Standard Shader, it doesn’t use any texture slots that you don’t assign to, so having the metallic/specular maps and normal map slots have no effect on performance. You can choose between the standard metal style PBR, the specular style PBR, or a simple Blinn shader.

Also included is a set of simplified shaders that will improve performance if the PBR or surface based shaders are not needed. Those shaders still use standard surface shaders for the skin, but the expensive task of drawing the multiple shells on top are done with simplified vertex/fragment shaders. The simplified shaders also allow you to choose between metal, specular, and Blinn style shaders for the skin. There is also a no skin option for those. That option still uses a Blinn surface shader for the skin, but will do it with the material assigned to the fur. Because the skin and shells are rendered differently in the simplified shader, I needed to separate out the options.

The simple shaders have an option to add a cube map reflection so you can help them to fit in a little better with the rest of your scene. The cube map can be set to HDR or LDR so it works fine with whatever reflection probe you may be using.

The standard shaders come with 10 and 20 shell variants, with 40 shell variants zipped up in the package. Import and compile times are pretty resource intensive on the standard shader and my old iMac didn’t like the 40 shell versions too much. So I wanted people to have the option of whether to import those or not. The simple shaders have 10, 20, and 40 shell versions available right out of the package. The demo uses the 20 shell variant for both shader examples.

There are also two different methods for intra-fur shadowing that you can pick from. One will just make the fur shells at lower levels darker. The other shifts the UV texture over a pixel, grabs that color and converts it to grayscale based on the depth to get a shadow value. For some textures, the second method can look a little better. But I’ve found that a lot of time it isn’t worth whatever minimal performance impact it may have so I provide the option. You can adjust the strength of the shadowing to your liking in both methods.

I’ve submitted it to the Asset Store, so hopefully it will be available there soon. I’ll update the thread when it is. Until then, you can purchase it or check out the web player demo on my website:

Web Player Demo
This is the demo of Version 2.0, which has not yet been approved on the Asset Store.

2 Likes

That looks like a very nice system. I tried the demo though and I am not seeing any fur, tried both shader types, just getting textured balls, is there a key press or something to turn it on?

no fur here either

Hmm. That’s strange. I was thinking maybe something went wrong with the upload, but I just checked it on the website and it works fine on my end. Is anyone else having that problem? Are you using Unity 5? I don’t know if Unity upgrades the web player when you upgrade the program itself, or it that would make a difference at all. But there should definitely be fur on the balls without having to do anything.

Well crap, that answers the question about whether it is happening to anyone else. Are you guys using Windows? I wonder if maybe it is a problem with DirectX vs OpenGL. I’m not sure what that problem would be, but at least it’d be some place for me to start looking for a solution.

I’m using latest firefox web browser on windows 7 64 with latest version of unity web browser.

Same here, I was thinking the same that we are using an old version of the webplayer. I guess.

Well there goes the high I got from finally finishing and releasing it. It works for me on Firefox as well. I guess maybe it is a Windows problem? Can someone with a Mac confirm whether it works or not? I just can’t imagine any other reason why it would work on my end, but not for other people. But I’m not using any GLSL code, so I don’t know why it would be OpenGL specific.

Unity usually throws a warning when something isn’t DirectX compatible. To double check I rewrote one of the shaders so that everything was inlined instead of calling a cginc, in case cginc files for some reason don’t generate the warnings, but I still got nothing indicating that anything would prevent it from working with DirectX (assuming DirectX is the problem)

I’ve asked in the Shaders forum about anything else I might have to look out for, so hopefully I’ll have a fix soon.

I was able to fix it by building a Windows standalone build so the errors and warnings would spit out. Luckily, it runs in Crossover so I was able to confirm both the problem and the fix. Can someone check the web player to make sure everything is updated and fixed properly, just so I can be double sure before re-uploading the package? And thanks for letting me know about the problem. I would have hated to have had the asset rejected after a week of waiting!

It’s working on my side :slight_smile: (Windows 7 64bits)

1 Like

Awesome. Thank you. I’ve sent the fresh build to the asset store team.

1 Like

yep fuzzy goodness all around…

2 Likes

Very nice, works well for me on OS X. Will it work on mobile? How about VR?

I haven’t checked it on mobile. I’ll give it a go when I get caught up on some work that I fell behind on while getting the shader written so my client doesn’t kill me. I should have an answer for you before it is approved by the asset store team. I tried to push it to my old Droid Razr but apparently I need to update my JDK before Unity 5 can do that. I’d suspect that the simple shaders with the blinn skin should do alright on mobile though.

Everything in the demo is done with the 20 shell versions of the shaders. They also come in 10 shell versions for better performance, so I’ll give it a go with those as well. On the tiny screens of mobile there might not be a big difference in the appearance.

The simple shaders have a 40 shell version that didn’t seem to hurt performance too much. The standard shaders also have a 40 shell version, but I’ve zipped those in the unity package because my poor 5 year old iMac chokes on trying to compile them so I wanted people to have the option of whether or not to try.

I just realized that I didn’t mention any of this in the description so I’m going to go ahead and update that as well.

I have no way of testing VR at the moment, sorry.

Edit: I also didn’t mention the options for intra-fur shadowing, so I’ve added that to the first post for anyone interested.

@timmerish , sorry for the long delay in testing it on mobile. Unfortunately, I still can’t provide my info. My old Droid Razr apparently doesn’t like Unity 5 at all. Even the default scene with just a 6 polygon Cornell Box and two menu buttons is hovering around 13fps (and looking horrible in the process. I think I need to change something in the lighting for it to work on mobile).

I’ve uploaded the APK here: http://www.imperialpenguin.com/fur/DemoAndroid.apk for anyone who has an Android device to have a go with it. I’ll go ahead and give the other numbers just for some sort of comparison. With the standard (PBR) fur shaders, it dropped to around 3fps and stayed there. It didn’t seem to make any difference how many of them were in the scene. The simple shaders did better, jumping as high as 11fps when only one or two of them are in the scene.

Those numbers are with the 20 shell shaders. I guess it would perform better with the 10 shell versions, but with a 13fps max, my device just isn’t suitable for testing that.

The asset was rejected yesterday because I had a link to an external sales site on my demo page. I’ve fixed it to link to the asset store page (which doesn’t exist yet) and emailed the asset store team to see if I need to resubmit the asset. So, depending on how long it takes them to respond and what they say, it could be a few days away or another week or two.

It’s all sorted out and approved for the asset store now. You can find it here: Unity Asset Store - The Best Assets for Game Making

Tried the mobile demo on a Nexus 5 with 5.1, getting 15-20 fps on standard shaders, and 25-35 with simple shaders. Fur looks good on both variants, but that baked-in light on the background sure is horrible :slight_smile:

Any chance of getting a trial of the shader? Our current fur shader doesn’t play well with Unity 5 and it’s a pain setting up all the variants so it looks good in various light setups, which a PBR version would solve, but we’d need to play around with it a bit to do a direct comparison before putting down 30€ (tight budget :slight_smile: )

Thanks for testing it on the Nexus. With less than 6 objects and the 10 shell simple shaders, I suppose it would do okay on higher end mobile devices. With a 13fps max on a near empty scene, my old Razr is clearly outside of the scope of Unity’s system requirements. It’s a pretty old phone though, well out of the contract expiration range where people usually upgrade. I’m moving away from mobile development so I haven’t kept current on devices.

Regarding your question about a demo, I’ll PM you.

Hi HemiMG,

We’ve just purchased your asset as it’s the only compatible fur shader for Unity 5; currently the shader multiplies the Skin Texture by _StrandThickness; I suppose this is not the intended behaviour as it will also tile the skin texture.

Also it would be nice if the skin texture was used to color the fur and for the skin alpha to influence the fur length instead of just the opacity.

Otherwise the shader seems to be working nicely :slight_smile:

Cheers,
Alex