fireball/lib/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl

11 lines
569 B
Plaintext
Raw Normal View History

2018-12-25 13:59:22 +00:00
PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
material.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );
#ifdef STANDARD
material.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );
#else
material.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );
material.clearCoat = saturate( clearCoat ); // Burley clearcoat model
material.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );
#endif