so I am writing a PBR shader to experiment with the latest techniques, and I find the metalness, roughness and how they relate the the blurry reflections a bit confusing. I understand that the rougher the surface, the more blurry the cubemap will be. For my tests, I have a cubemap generated using CubemapGen, which I sample like this to get the blurred texel:
half current = roughness * 6; half f0 = floor(current); half f1 = ceil(current); half f = saturate(current - f0) / (f1-f0); half3 reflectDir = reflect(V, N_WS); half4 reflection1 = texCUBElod (_IndirectLightTex, float4(reflectDir, f0)); half4 reflection2 = texCUBElod (_IndirectLightTex, float4(reflectDir, f1)); half4 reflection = lerp(reflection1, reflection2, f);
Where does metalness come in though? As I understand from the articles that I've been reading, the more metallic a surface, the more reflection it has (and less albedo). Is it as simple as this?
half3 totalReflection = metalness * reflection;
As a clarification, my roughness comes from the alpha channel of the main texture, and the metalness comes from the vertex color.