UNPKG

@google/model-viewer

Version:

Easily display interactive 3D models on the web and in AR!

6 lines (5 loc) 1.13 kB
/** * @license MIT * @see https://github.com/mrdoob/three.js/blob/dev/LICENSE */ export declare const lightsChunk = "\nPhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\n\n// (elalish) This block has been updated to add anti-aliasing.\nmaterial.specularRoughness = max(roughnessFactor, 0.0525);// 0.0525 corresponds to the base mip of a 256 cubemap.\nvec3 dxy = max(abs(dFdx(geometryNormal)), abs(dFdy(geometryNormal)));\nmaterial.specularRoughness += max(max(dxy.x, dxy.y), dxy.z);\nmaterial.specularRoughness = min(material.specularRoughness, 1.0);\n\n#ifdef REFLECTIVITY\n\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\n#else\n\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n\n#endif\n\n#ifdef CLEARCOAT\n\n\tmaterial.clearcoat = saturate( clearcoat ); // Burley clearcoat model\n\tmaterial.clearcoatRoughness = clamp( clearcoatRoughness, 0.04, 1.0 );\n\n#endif\n#ifdef USE_SHEEN\n\n\tmaterial.sheenColor = sheen;\n\n#endif\n";