Discovering shaders
Shaders were defined as two things at the beginning of this chapter: a piece of code and a user manual. Have you felt like you’ve been writing code so far? Most likely, no.
Nevertheless, behind that Material user interface, there is a code layer, which is the shader. For example, the default shader you’ve been using so far has hundreds of lines of code. The following is only a portion of the code that makes that shader:
metallic = saturate(metallic); transmission = saturate(transmission); float diffuse_weight = (1.0 - transmission) * (1.0 - metallic); transmission *= (1.0 - metallic); float specular_weight = (1.0 - transmission); clearcoat = max(clearcoat, 0.0); transmission_roughness = 1.0 - (1.0 - roughness) * (1.0 - transmission_roughness); specular = max(0.0, specular);
Luckily for you, you don’t have to write a single line of code. More importantly, Blender interprets the shader code so that it can offer...