@babylonjs/core
Version:
Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.
89 lines • 3.57 kB
JavaScript
// Do not edit.
import { ShaderStore } from "../Engines/shaderStore.js";
import { bonesDeclaration } from "./ShadersInclude/bonesDeclaration.js";
import { bakedVertexAnimationDeclaration } from "./ShadersInclude/bakedVertexAnimationDeclaration.js";
import { morphTargetsVertexGlobalDeclaration } from "./ShadersInclude/morphTargetsVertexGlobalDeclaration.js";
import { morphTargetsVertexDeclaration } from "./ShadersInclude/morphTargetsVertexDeclaration.js";
import { clipPlaneVertexDeclaration } from "./ShadersInclude/clipPlaneVertexDeclaration.js";
import { instancesDeclaration } from "./ShadersInclude/instancesDeclaration.js";
import { pointCloudVertexDeclaration } from "./ShadersInclude/pointCloudVertexDeclaration.js";
import { morphTargetsVertexGlobal } from "./ShadersInclude/morphTargetsVertexGlobal.js";
import { morphTargetsVertex } from "./ShadersInclude/morphTargetsVertex.js";
import { instancesVertex } from "./ShadersInclude/instancesVertex.js";
import { bonesVertex } from "./ShadersInclude/bonesVertex.js";
import { bakedVertexAnimation } from "./ShadersInclude/bakedVertexAnimation.js";
import { clipPlaneVertex } from "./ShadersInclude/clipPlaneVertex.js";
import { pointCloudVertex } from "./ShadersInclude/pointCloudVertex.js";
const name = "depthVertexShader";
const shader = `attribute vec3 position;
uniform mat4 viewProjection;uniform vec2 depthValues;
varying vec2 vUV;uniform mat4 diffuseMatrix;
attribute vec2 uv;
attribute vec2 uv2;
uniform mat4 view;varying vec4 vViewPos;
varying float vDepthMetric;
void main(void)
{vec3 positionUpdated=position;
vec2 uvUpdated=uv;
vec2 uv2Updated=uv2;
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);
gl_Position=viewProjection*worldPos;
vViewPos=view*worldPos;
vDepthMetric=((-gl_Position.z+depthValues.x)/(depthValues.y));
vDepthMetric=((gl_Position.z+depthValues.x)/(depthValues.y));
vUV=vec2(diffuseMatrix*vec4(uvUpdated,1.0,0.0));
vUV=vec2(diffuseMatrix*vec4(uv2Updated,1.0,0.0));
}
`;
// Sideeffect
if (!ShaderStore.ShadersStore[name]) {
ShaderStore.ShadersStore[name] = shader;
}
const includes = [bonesDeclaration, bakedVertexAnimationDeclaration, morphTargetsVertexGlobalDeclaration, morphTargetsVertexDeclaration, clipPlaneVertexDeclaration, instancesDeclaration, pointCloudVertexDeclaration, morphTargetsVertexGlobal, morphTargetsVertex, instancesVertex, bonesVertex, bakedVertexAnimation, clipPlaneVertex, pointCloudVertex];
for (const inc of includes) {
if (!ShaderStore.IncludesShadersStore[inc.name]) {
ShaderStore.IncludesShadersStore[inc.name] = inc.shader;
}
}
/** @internal */
export const depthVertexShader = { name, shader };
//# sourceMappingURL=depth.vertex.js.map