Cloth Shader

This shader will represent key lighting behaviours of fabric. You can get a wide range of clothing effects such as carpet, silk or velvet. It’s been developed with Shaderforge, so you can tweak it to fit your needs. It supports dynamic lighting and beast lightmaps as well as probe lighting.





Documentation | Web player (chair) | Web player (towel) | Asset Store

1 Like

Wow! Very nice… how hard would it be to port this over to a PBR like Jove2?

Easy, I guess :slight_smile: Anyhow, If everything is correct, this one is also energy conserving.

That looks fantastic, one of the nicest shaders I have seen for a while, totally convincing. Does it run on mobile as well?

Humm, if that mobile supports SM 3.0, it should.

If it runs on mobile full-stop, is reasonably easy to do, i think, check compiling to opengl es 2.0 (ideally) in shader forge

These are indeed beautiful and are somewhat what ive been trying to do myself for ages - supplying as shader forge graphs is exemplary. I’ll be in for it when finances are better.

Would it be possible to update the shader so shader forge doesn’t break it on compiling with the latest SF release? It’s dropping the reference to the light attenuation in the later passes and i cant figure out how to fix it

1 Like

Yeah, it needs an upgrade badly :confused:
I think it would be better to write it by hand instead using shader forge. Depending on others software doesn’t help :wink:

Id probably find hand written code easier to understand and adapt in this particular shader’s case, looking at the generated script its gibberish, so had to rely on SF but i guess some things have changed with it

On seconds thoughts yeah id really like the node graph still hah, theres a bunch of modificatons id love to make in shaderforge with this shader being so nice

I have seen that shader forge still doesn’t support lightmaps for custom lighting shaders, so I have no choice, I have to write it as a surface shader.

Would you be willing to take suggestions for features? I’m after a very specific look (entertainingly based on my partners crochet at she learns) and the lack of options is quite disappointing, a shader that could provide the general functionality of the standard shader with parallax and triplanar and introducing a proper bdrf option for cloth such as yours would be a bit of a godsend (think creating islands from craft materials) but i dont imagine you have much time for it, which is why i hoped for a working node graph, although maybe i can get something from it as-is

Yeah, well, every project/developer needs their own shaders at some point. The philosophy behind the surface shader layout helps to solve the problem, although not everyone can write the shader they want, it’s not easy.
Lots of suffering is awaiting me when I convert this to a surface shader :stuck_out_tongue:

Well, the Cloth shader will be available for Unity 5 very soon. I have written it again without Shader forge graph this time. I really needed to proceed like this to make it better. It supports real time GI, reflection probes, sky ambient and reflections and… all the fancy stuff in Unity 5 :slight_smile:
Its using shader keywords now to disable code snippets, so it won’t compute unneeded code, as it did before with the shader forge graph. Anisotropy is easier to adjust and I think it works together with gloss better than before. I have also added some stuff I miss in the Standard Shader, like pulling spec down to my taste or having 2 normal maps with adjustable intensities.

The new gui currently looks like this:

The old parameters are still there, so you won’t loose your old configs from Unity 4, although you will have to tweak it again.
Here are some samples:

Super huge version of the image above

3 Likes

Looks good! There’s some code available on the SF wiki which might help with the triplanar stuff so maybe i can hack together something with that and this afterall. The added u5 goodness is getting somewhat essential id say so i like this

1 Like

Hello buyers.
During December I worked on an update of this package. I knew I had to update it to Unity 5 and all the new stuff. After some days of work several ideas came to my head. “What if it is suitable for metals?”, “What if I make a metals demo?” "What if I try to shade a cymbal? “What if supports transparency?”, “What if… carbon fiber!!”, “What if, what if…” So it started to grow until I realized it was too big/flexible to deliver it as a simple update. Instead of that, I have released it as an upgrade for previous buyers of the old cloth shader.
The new version aims to model any kind of scratched surfaces / striped microstructures, not just fabrics.

**
**- Forum thread
-

I want to say THANKS to all the people who bought it. That’s what make developers to stay alive and motivated to bring to you more and better products. Happy new year and best wishes!

2 Likes