/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{glsl as e}from"../../shaderModules/glsl.js";function r(r,c){c.spherical?r.vertex.code.add(e`vec3 getLocalUp(in vec3 pos, in vec3 origin) {
return normalize(pos + origin);
}`):r.vertex.code.add(e`vec3 getLocalUp(in vec3 pos, in vec3 origin) {
return vec3(0.0, 0.0, 1.0);
}`),c.spherical?r.vertex.code.add(e`mat3 getTBNMatrix(in vec3 n) {
vec3 t = normalize(cross(vec3(0.0, 0.0, 1.0), n));
vec3 b = normalize(cross(n, t));
return mat3(t, b, n);
}`):r.vertex.code.add(e`mat3 getTBNMatrix(in vec3 n) {
vec3 t = vec3(1.0, 0.0, 0.0);
vec3 b = normalize(cross(n, t));
return mat3(t, b, n);
}`)}export{r as NormalUtils};
