An OSL shader that generates texture to make swirly micro scratch look by controlling the anisotropy and roughness.
It works well with both metal:
and dielectric:
The original idea is from Hang Li(悬挂鲤) and Ben Paschke. Here I implemented it using OSL and exposured some arts friendly parameters.
Controls the heaviness of the scratches.
More scratches takes longer to generate.
default values set the roughness of areas that isn't scrached.
min/max controls the range of roughness randomness.
Bigger roughtness makes the swirl longer along it's direction.
Similiar to roughness default/min/max, but namely controls the anisotropy.
Bigger anisotropy enlarge the swirl radius.
Rotation offset.
Tweak this parameter to achieve some intersting effect, like radiant or spiral scraches!
Width of the scratches, in UV space.
0.001 is a good value to start with.
- R: Should be connected to roughness.
- G: Should be connected to rotation of anisotropy. With arnold you should add a aiNegate and set the offset to 0.25.
- B: Should be connected to anisotropy.
Take a look at the examples under "example_scenes/". For now there are only mtoa and Clarisse scenes shipped. But anyone is welcome to contribute any DCC oriented examples.
For clarisse:
For maya:
(Of course, again, the compatibility is not limited to the DCCs listed above.)
Note that the definition of "Anisotropic Rotation" is slightly different between Clarisse and Arnold. That's the reason that in maya we need some conversion when handling the rotation attribute.