I'm curious how the metallic parameter as in the Disney and UE 4 material model could be used.
Following these course notes I implemented the UE 4 style GGX specular model and use metallic like this:
vec3 specular_color = lerp(vec3(1.f, 1.f, 1.f), diffuse_color, metallic); float f0 = lerp(0.04f, 1.f, metallic); vec3 specular = specular_color * specular_f(v_dot_h, f0) * specular_d(n_dot_h, a2) * specular_g(n_dot_l, n_dot_v, a2); vec3 diffuse = (1.f - metallic) * diffuse_color; return n_dot_l * (diffuse + specular);
From the notes it didn't become quite clear to me what I should do with metallic. It feels strange that non-metallic materials have a specular color of 1, but due to the small f0 it doesn't seem to be a big problem.
Any ideas how this could be improved upon?