Request to improve this Fabric shader

Request to improve this Fabric shader
You can download the blendfile on:

Below an explanation why I made this shader this way.

I always had a problem rendering fabrics. After playing with the velvet shader I noticed that it is a diffuse shader and makes the material at facing angle darker.

When looking at fabrics pictures on the internet I couldn’t find such an effect. Until yesterday I went to the shop and saw a soft toy with long fur. And finally noticed the black spot there. It is caused by the shadows of the hair which you see only at facing angle. So I suppose this velvet shader is “usefull” to simulate fabrics with a bit longer hair/fur.

When looking at fabrics on the internet and looking at a soft toy with short fur, I noticed that at grazing angle the material is less saturated than at facing angle. ( I am not talking about the reflection of light). My theory is that grazig angle we see the parts of the hair that is thin, and contain less color whereas at facing angle we also see the thicker parts of the hair in where we see more color. ?
So I implemented this in the fabric shader:

  • Velvet shader makes darker at facing angle
  • My implementation makes grazing angle less saturated.

Another thing. Fabrics consists out of hair, right? And in Blender we have our hair shader, but we can’t use that. I noticed that the hair shader is in fact a glossy shader. One part rough, and the other sharper glossy. The gloss is colored. Whereas the velvet shader is just a diffuse shader.
Some fabrics look a little bit metalic; The gloss is colored. But is has also that colorless gloss. It’s like on carpainting. I see two kinds of gloss. 1 rough colored, 1 sharper gloss colorless. So I implemented two gloss layers. I didn’t give the rough gloss ( I called it metalicness) a fresnel thing. Because, well, it function’s like a diffuse and diffuse doesn’t have fresnel ? I don’t know. I gave only the sharp gloss our PBR fresnel.

I implemented Ace Dragon’s modbump and Cynicat pro’s PBR reflection. Did an attempt to implement glossfix as well, but found it a bit dark.

Some problems:

  • Thanks to Ace Dragon, I don’t see dark artifacts now when using gloss with bump. ( modbump), but still at grazing angle, sometimes I see darker areas. Modbump cannot help here I suppose since it is real geometrie.
  • Not sure if I have to use overlay or multiply when coloring textures with patterns.
  • Not sure if I have to mix the metalicness (rough colored gloss with a map via color ramp) Maybe I have to leave the map out); it makes it dark.
  • I am not sure if I implemented that metalicness idea well. I believe all fabrics have it more or less. ( like hair has).

Anyway, have fun with the fabric shader and I hope some blender geniuses would love to improve this shader and share it.


interesting and would like to test it!

but where do you download it ?
tried to click at top left and in middle but does not work

happy cl

@RickyBlender; After clicking the link, click then “No thanks, continue to…” and then on the top right you see Download > direct download.

got it thanks

this is using UV images !

now do you mean that we need to find a high res image for each type of cloth shown in first post ?

can you briefly explain the different parameters
some are not that obvious!

nice work in any case

happy bl

@RickyBlender Indeed this shader use one texture. It is quite easy to find fabric textures. For example poliigon, sketchuptextureclub, notextures, mb3d. etc.

Explanation of how the shader works:

The maps:

  • Bumpmap; With this color ramp you define the bump. Luckily mostly the darker colors are deeper and the lighter colors give the bump. There is a lot you can do with a colorramp, and in a rare case you might need a Seperate HSV node. Often I start with constant instead of easy mode to find the right position of a color stop.

  • Roughness map; is where you want the material to have rougher gloss and where sharper.

  • Reflection map: is where you want the material to have more reflections and where less. I always try to give the deeper parts ( the darker parts ) no reflections ; It is a bit strange when at grazing angles the darker parts have reflections. That makes it look fake.

  • Metalicness map: Same as above. I am not so sure about this part.

#Controls on the shader:

  • Maptest input. Plug in a map here and then plug in the Maptest output into the material output temporaly. It is simply an emission shader and renders fast. It is for adjusting the color ramps.
  • Color is the diffuse color we are used to.
  • Gamma, Brightness, Contrast, Hue, Saturation and Value simply adjust the diffuse color of the texture. Mostly I desaturate a little bit, give a tinny bit more contrast so that black is blak and not grey.
  • Overlay amount colors your fabric. Not sure if you better use multiply or overlay( inside the nodegroup).
  • EdgeSaturation: makes the material at grazing angle less saturation when using a value between 0 and 1. and more saturated when using a value between 1 and 2.
  • Edge value the same, but makes is darker or lighter.
  • Edge hue, 0.5 does nothing, other values give grazing angles another color.
  • Edge Thickness: ( layer weight) how thick the edge is. A good value is around 0.2 till 0.4.
  • Reflection IOR is what we usually use to adjust our reflections with fresnel. 1.450 is default setting.
  • Bumpstrength: how strong the bump is. Good value is around 0.4 untill 0.6, depending on the texture and colorramp setting.
  • Mix metalicness: Mixes in a rough glossy instead of a diffuse to make the fabric look a bit more metallic.
  • Metalicness Roughness: the roughness of the above glossy shader. I suppose a good value is around 0.3 until 0.6
  • Mix Velvet: mixes in the velvet shader: it makes the material darker at facing angle. Good value for me is 0.1 until 0.4.
  • Mix Translucent: mixes in the translucent shader. Good value for me is 0.1 untill 0.3

Mixing the last shaders is not done properly; For example if you put Velvet to 1, the mix metalicness has no effect. I should add values and then devide them to do it properly, but I forgot how to do that properly.