Everything has been progressing nicely with the fur shader and the upcoming patron release, up until a couple of days ago. All of the sudden we hit a quite substantial roadblock. As it turns out, Unity cannot pass shadows onto transparent objects, and our fur shader makes heavy use of transparency (for the individual strands). In our development of the shader, we always tested it outdoors with the default skybox, so we hadn't noticed this. But as soon as we put Wolf into a level using the shader, we noticed he was shining like lamp (because he wasn't receiving any shadows in an otherwise shaded environment).
This was quite frustrating. At first we thought we had to abandon the shader, which would suck extremely hard considering the amount of time we've put into it. Reading the forums didn't help much or give any hope either. As a matter of fact, none of the fur shaders available in the Unity asset store support receiving shadows. And these guys have been trying to get it to work for far longer than we have. So if they hadn't managed to solve it by now, how could we do it?
At this point, we seriously thought we were fucked. Obviously we cannot use a shader that doesn't support receiving shadows. Any character using such a shader would look completely out of place when indoors, or when another character is casting a [non-visible] shadow onto him/her. However, having invested so much time into this, we refused to let ourselves be defeated by such an unexpected issue. It seems so trivial, yet apparently it is quite a complex problem getting true transparency and shadows to work (in any engine, not just Unity).
After much blood, sweat and tears, we're happy being able to show this result:
http://i.imgur.com/xthPG9k.png
It may not seem so impressive, but I don't think you realize the amount of trouble we had to go through to get it work. And apparently, no other fur-shader maker has managed to do so! So it feels almost unreal that we managed to achieve this when they haven't.
I won't go into details what magic we are using to accomplish this, but I can give you some other information. Right now, the highest quality fur shader we've got is actually 977 lines of uncompiled (!) source code. If you're uninitiated to how shaders work, you may not realize how much that is for a shader. It is HUGE.
What's more - because we required more control of how Unity renders the shaders, we had to go away from using Unity's simple way of creating shaders ("surface shaders") to writing our completely own fragment and vertex shaders (in essence circumventing Unity almost entirely). While being harder to work with, they are also faster than surface shaders. So by bumping into this problem, we manged to get a speed improvement as well! (In addition to supporting shadows.)
I understand that this post might come off as a bit of a brag or something. But never having written a line of fragment shaders previously, it just feels amazing to actually having overcome such a huge issue that apparently other fur-shader makers haven't solved! And we're so happy right now that we can keep the fur shader.
It would seem that, where there's a will, there's a way. :)
Unfortunately, this unexpected issue also means we're a bit behind schedule. We might still be able to release on Sunday, but there's a risk there will be a delay.
- odes
FJKMAN
2016-01-23 15:11:07 +0000 UTCFurryVNE Team
2016-01-21 14:46:13 +0000 UTCEzyk Jaraad
2016-01-21 14:05:56 +0000 UTCHarmae
2016-01-21 01:26:53 +0000 UTCWorselTheV
2016-01-20 22:45:54 +0000 UTCFurryVNE Team
2016-01-20 22:00:52 +0000 UTCDave
2016-01-20 21:59:25 +0000 UTCDark Sunrise
2016-01-20 21:53:57 +0000 UTCBaphomet
2016-01-20 21:43:36 +0000 UTC