@babylonjs/viewer
Version:
The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.
76 lines (73 loc) • 2.38 kB
JavaScript
import { S as ShaderStore } from './index-FzOfPXLV.esm.js';
import './bonesVertex-lAGOY5tc.esm.js';
import './bakedVertexAnimation-B-j7AgLw.esm.js';
import './morphTargetsVertex-C_o673bp.esm.js';
import './clipPlaneVertex-D_rrr4Jo.esm.js';
import './instancesDeclaration-CGcPa0tb.esm.js';
// Do not edit.
const name = "depthVertexShader";
const shader = `attribute position: vec3f;
uniform viewProjection: mat4x4f;uniform depthValues: vec2f;
varying vUV: vec2f;uniform diffuseMatrix: mat4x4f;
attribute uv: vec2f;
attribute uv2: vec2f;
uniform view: mat4x4f;varying vViewPos: vec4f;
varying vDepthMetric: f32;
@vertex
fn main(input : VertexInputs)->FragmentInputs {var positionUpdated: vec3f=input.position;
var uvUpdated: vec2f=input.uv;
var uv2Updated: vec2f=input.uv2;
var worldPos: vec4f=finalWorld* vec4f(positionUpdated,1.0);
vertexOutputs.position=uniforms.viewProjection*worldPos;
vertexOutputs.vViewPos=uniforms.view*worldPos;
vertexOutputs.vDepthMetric=((-vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));
vertexOutputs.vDepthMetric=((vertexOutputs.position.z+uniforms.depthValues.x)/(uniforms.depthValues.y));
vertexOutputs.vUV= (uniforms.diffuseMatrix* vec4f(uvUpdated,1.0,0.0)).xy;
vertexOutputs.vUV= (uniforms.diffuseMatrix* vec4f(uv2Updated,1.0,0.0)).xy;
}
`;
// Sideeffect
if (!ShaderStore.ShadersStoreWGSL[name]) {
ShaderStore.ShadersStoreWGSL[name] = shader;
}
/** @internal */
const depthVertexShaderWGSL = { name, shader };
export { depthVertexShaderWGSL };
//# sourceMappingURL=depth.vertex-DuShK4Gs.esm.js.map