yum/3ner
A toon shader for Unity's BIRP.
git clone https://git.yummers.dev/yum/3ner
50e4514
master
1#ifndef __PBR_UTILS_INC 2#define __PBR_UTILS_INC 3 4float perceptualRoughnessToRoughness(float perceptualRoughness) { 5 return perceptualRoughness * perceptualRoughness; 6} 7 8float roughnessToPerceptualRoughness(float roughness) { 9 return sqrt(roughness); 10} 11 12float smoothnessToPerceptualRoughness(float smoothness) { 13 return 1.0f - smoothness; 14} 15 16float smoothnessToRoughness(float smoothness) { 17 return perceptualRoughnessToRoughness(smoothnessToPerceptualRoughness(smoothness)); 18} 19 20#endif // __PBR_UTILS_INC