/*
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,invertOrIdentity as e}from"../../../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as o}from"../../../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{zeros as i}from"../../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{CameraSpace as t}from"./CameraSpace.glsl.js";import{glsl as a}from"../../shaderModules/glsl.js";import{Matrix4PassUniform as s}from"../../shaderModules/Matrix4PassUniform.js";import{NoParameters as c}from"../../../../../webgl/NoParameters.js";class m extends c{constructor(){super(...arguments),this.localOrigin=i()}}function l(i){i.include(t),i.fragment.uniforms.add(new s("inverseViewMatrix",(i,t)=>{const a=r(o(),t.camera.viewMatrix,i.localOrigin);return e(a,a)})).code.add(a`vec4 reconstructLocalPosition(vec2 coord, float linearDepth) {
vec4 cameraSpace = vec4(reconstructPosition(coord, linearDepth), 1.0);
return inverseViewMatrix * cameraSpace;
}`)}export{m as LocalFromScreenSpacePassParameters,l as localFromScreenSpace};
