/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{translate as r}from"../../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as i}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{h as e}from"../../../../../../chunks/vec32.js";import{ZEROS as o,create as a}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{Float3BindUniform as n}from"../../shaderModules/Float3BindUniform.js";import{Float3DrawUniform as s}from"../../shaderModules/Float3DrawUniform.js";import{FloatBindUniform as t}from"../../shaderModules/FloatBindUniform.js";import{Matrix4BindUniform as m}from"../../shaderModules/Matrix4BindUniform.js";import{Matrix4DrawUniform as c}from"../../shaderModules/Matrix4DrawUniform.js";function d(r,i){i.instancedDoublePrecision?r.constants.add("cameraPosition","vec3",o):r.uniforms.add(new s("cameraPosition",(r,i)=>e(v,i.camera.viewInverseTransposeMatrix[3]-r.origin[0],i.camera.viewInverseTransposeMatrix[7]-r.origin[1],i.camera.viewInverseTransposeMatrix[11]-r.origin[2])))}function f(i,o){if(!o.instancedDoublePrecision)return void i.uniforms.add(new m("proj",r=>r.camera.projectionMatrix),new c("view",(i,e)=>r(l,e.camera.viewMatrix,i.origin)),new s("localOrigin",r=>r.origin));const a=({camera:r})=>e(v,r.viewInverseTransposeMatrix[3],r.viewInverseTransposeMatrix[7],r.viewInverseTransposeMatrix[11]);i.uniforms.add(new m("proj",r=>r.camera.projectionMatrix),new m("view",i=>r(l,i.camera.viewMatrix,a(i))),new n("localOrigin",r=>a(r)))}const l=i(),v=a();function p(r){r.uniforms.add(new m("viewNormal",r=>r.camera.viewInverseTransposeMatrix))}function w(r){r.uniforms.add(new t("pixelRatio",r=>r.camera.pixelRatio/r.overlayStretch))}export{d as addCameraPosition,w as addPixelRatio,f as addProjViewLocalOrigin,p as addViewNormal};
