123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- const materials = [
- {
- name: 'MeshBasicMaterial',
- shortName: 'Basic',
- properties: [
- 'alphaMap',
- 'aoMap',
- 'aoMapIntensity',
- 'color',
- 'combine',
- 'envMap',
- 'lightMap',
- 'lightMapIntensity',
- 'map',
- 'reflectivity',
- 'refractionRatio',
- 'specularMap',
- 'wireframe',
- ],
- },
- {
- name: 'MeshLambertMaterial',
- shortName: 'Lambert',
- properties: [
- 'alphaMap',
- 'aoMap',
- 'aoMapIntensity',
- 'bumpMap',
- 'bumpScale',
- 'color',
- 'combine',
- 'displacementMap',
- 'displacementScale',
- 'displacementBias',
- 'emissive',
- 'emissiveMap',
- 'emissiveIntensity',
- 'envMap',
- 'lightMap',
- 'lightMapIntensity',
- 'map',
- 'normalMap',
- 'normalMapType',
- 'normalScale',
- 'reflectivity',
- 'refractionRatio',
- 'specularMap',
- 'wireframe',
- ],
- },
- {
- name: 'MeshPhongMaterial',
- shortName: 'Phong',
- properties: [
- 'alphaMap',
- 'aoMap',
- 'aoMapIntensity',
- 'bumpMap',
- 'bumpScale',
- 'color',
- 'combine',
- 'displacementMap',
- 'displacementScale',
- 'displacementBias',
- 'emissive',
- 'emissiveMap',
- 'emissiveIntensity',
- 'envMap',
- 'lightMap',
- 'lightMapIntensity',
- 'map',
- 'normalMap',
- 'normalMapType',
- 'normalScale',
- 'reflectivity',
- 'refractionRatio',
- 'shininess',
- 'specular',
- 'specularMap',
- 'wireframe',
- ],
- },
- {
- name: 'MeshStandardMaterial',
- shortName: 'Standard',
- properties: [
- 'alphaMap',
- 'aoMap',
- 'aoMapIntensity',
- 'bumpMap',
- 'bumpScale',
- 'color',
- 'displacementMap',
- 'displacementScale',
- 'displacementBias',
- 'emissive',
- 'emissiveMap',
- 'emissiveIntensity',
- 'envMap',
- 'envMapIntensity',
- 'lightMap',
- 'lightMapIntensity',
- 'map',
- 'metalness',
- 'metalnessMap',
- 'normalMap',
- 'normalMapType',
- 'normalScale',
- 'refractionRatio',
- 'roughness',
- 'roughnessMap',
- 'wireframe',
- ],
- },
- {
- name: 'MeshPhysicalMaterial',
- shortName: 'Physical',
- properties: [
- 'alphaMap',
- 'aoMap',
- 'aoMapIntensity',
- 'bumpMap',
- 'bumpScale',
- 'clearcoat',
- 'clearcoatMap',
- 'clearcoatRoughness',
- 'clearcoatRoughnessMap',
- 'clearcoatNormalScale',
- 'clearcoatNormalMap',
- 'color',
- 'displacementMap',
- 'displacementScale',
- 'displacementBias',
- 'emissive',
- 'emissiveMap',
- 'emissiveIntensity',
- 'envMap',
- 'envMapIntensity',
- 'iridescence',
- 'iridescenceMap',
- 'iridescenceIOR',
- 'iridescenceThicknessRange',
- 'iridescenceThicknessMap',
- 'lightMap',
- 'lightMapIntensity',
- 'ior',
- 'map',
- 'metalness',
- 'metalnessMap',
- 'normalMap',
- 'normalMapType',
- 'normalScale',
- 'refractionRatio',
- 'roughness',
- 'roughnessMap',
- 'sheen',
- 'sheenColor',
- 'sheenColorMap',
- 'sheenRoughness',
- 'sheenRoughnessMap',
- 'thickness',
- 'thicknessMap',
- 'transmission',
- 'transmissionMap',
- 'attenuationDistance',
- 'attenuationColor',
- 'anisotropy',
- 'anisotropyRotation',
- 'anisotropyMap',
- 'specularIntensity',
- 'specularIntensityMap',
- 'specularColor',
- 'specularColorMap',
- 'wireframe',
- 'reflectivity',
- ],
- },
- ];
- const allProperties = {};
- materials.forEach( ( material ) => {
- material.properties.forEach( ( property ) => {
- allProperties[ property ] = true;
- } );
- } );
- function addElem( type, parent, content ) {
- const elem = document.createElement( type );
- if ( content ) {
- elem.textContent = content;
- }
- if ( parent ) {
- parent.appendChild( elem );
- }
- return elem;
- }
- const table = document.createElement( 'table' );
- const thead = addElem( 'thead', table );
- {
- addElem( 'td', thead );
- materials.forEach( ( material ) => {
- const td = addElem( 'td', thead );
- const a = addElem( 'a', td, material.shortName );
- a.href = `https://threejs.org/docs/#api/materials/${material.name}`;
- } );
- }
- Object.keys( allProperties ).sort().forEach( ( property ) => {
- const tr = addElem( 'tr', table );
- addElem( 'td', tr, property );
- materials.forEach( ( material ) => {
- const hasProperty = material.properties.indexOf( property ) >= 0;
- const td = addElem( 'td', tr );
- const a = addElem( 'a', td, hasProperty ? '•' : '' );
- a.href = `https://threejs.org/docs/#api/materials/${material.name}.${property}`;
- } );
- } );
- document.querySelector( '#material-table' ).appendChild( table );
|