UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

6 lines (5 loc) 1.03 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{neverReached as e}from"../../../../core/compilerUtils.js";import{TextureWrapMode as o,TextureSamplingMode as r}from"../../../webgl/enums.js";const t={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1},a={pbrMetallicRoughness:t,emissiveFactor:[0,0,0],alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1},l={ESRI_externalColorMixMode:"tint",ESRI_receiveShadows:!0,ESRI_receiveAmbientOcclusion:!0},i=(e={})=>{const o={...t,...e.pbrMetallicRoughness},r=s({...l,...e.extras});return{...a,...e,pbrMetallicRoughness:o,extras:r}};function s(o){switch(o.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:e(o.ESRI_externalColorMixMode),o.ESRI_externalColorMixMode="tint"}return o}const c={magFilter:r.LINEAR,minFilter:r.LINEAR_MIPMAP_LINEAR,wrapS:o.REPEAT,wrapT:o.REPEAT},n=e=>({...c,...e});export{i as material,n as textureSampler};