UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 952 B
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import{newLayout as r}from"../../../support/buffer/InterleavedLayout.js";import{TextureCoordinateType as t}from"../../core/shaderLibrary/attributes/TextureCoordinateAttribute.glsl.js";import{VertexAttribute as e}from"../../lib/VertexAttribute.js";import{NoParameters as o}from"../../../../webgl/NoParameters.js";class s extends o{constructor(r,t,e,o,s){super(),this.colors=r,this.textureCoordinates=t,this.hasNormals=e,this.shadeNormals=o,this.applySSAO=s}}function a({hasNormals:o,textureCoordinates:s,colors:a}){const i=r().vec3f(e.POSITION);return o&&i.vec2i16(e.NORMALCOMPRESSED,{glNormalized:!0}),s===t.Default?i.vec2f(e.UV0):s===t.Atlas&&(i.vec2f(e.UV0),i.vec4u16(e.UVREGION,{glNormalized:!0})),a&&i.vec4u8(e.COLOR,{glNormalized:!0}),i}export{s as GeometryParameters,a as createVertexBufferLayout};