/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{BaseRasterProcessorTechnique as e}from"./BaseRasterProcessorTechnique.js";import{computeZFactor as s}from"../../shaders/raster/surface.js";import{ShadedReliefShader as r}from"../../shaders/raster/processor/ShadedReliefShader.js";class t extends e{constructor(){super(...arguments),this.name="RasterShadedReliefProcessor",this.type=20,this.shaders={shadedRelief:new r}}_process(e,r,t){const o=e.rasterFunction.parameters,a={isMultidirectional:o.hillshadeType>0},i=r.getRasterCellSize(),n=s(o,i),d={...o,factor:n},h={colormapOffset:o.offset,colormapMaxIndex:o.indexedColormap.length/4-1},l={colormapTexture:{texture:t,unit:1}},{config:f,textures:c}=this._getCommonConfig(e,r),u={shader:this.shaders.shadedRelief,uniforms:{config:f,hillshadeConfig:d,colormapConfig:h},textures:{...c,colormapTextures:l},defines:a,optionalAttributes:null,useComputeBuffer:!1},{painter:m,context:p}=e;m.submitDrawMesh(p,u,m.quadMesh)}}export{t as ShadedReliefTechnique};
