@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.
93 lines • 3.07 kB
JavaScript
// Do not edit.
import { ShaderStore } from "../Engines/shaderStore.js";
import "./ShadersInclude/bonesDeclaration.js";
import "./ShadersInclude/bakedVertexAnimationDeclaration.js";
import "./ShadersInclude/morphTargetsVertexGlobalDeclaration.js";
import "./ShadersInclude/morphTargetsVertexDeclaration.js";
import "./ShadersInclude/helperFunctions.js";
import "./ShadersInclude/shadowMapVertexDeclaration.js";
import "./ShadersInclude/shadowMapUboDeclaration.js";
import "./ShadersInclude/shadowMapVertexExtraDeclaration.js";
import "./ShadersInclude/clipPlaneVertexDeclaration.js";
import "./ShadersInclude/morphTargetsVertexGlobal.js";
import "./ShadersInclude/morphTargetsVertex.js";
import "./ShadersInclude/instancesVertex.js";
import "./ShadersInclude/bonesVertex.js";
import "./ShadersInclude/bakedVertexAnimation.js";
import "./ShadersInclude/shadowMapVertexNormalBias.js";
import "./ShadersInclude/shadowMapVertexMetric.js";
import "./ShadersInclude/clipPlaneVertex.js";
const name = "shadowMapVertexShader";
const shader = `attribute vec3 position;
attribute vec3 normal;
attribute vec4 world0;attribute vec4 world1;attribute vec4 world2;attribute vec4 world3;
varying vec2 vUV;uniform mat4 diffuseMatrix;
attribute vec2 uv;
attribute vec2 uv2;
void main(void)
{vec3 positionUpdated=position;
vec2 uvUpdated=uv;
vec2 uv2Updated=uv2;
vec3 normalUpdated=normal;
vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);
mat3 normWorldSM=mat3(finalWorld);
vec3 vNormalW=normalUpdated/vec3(dot(normWorldSM[0],normWorldSM[0]),dot(normWorldSM[1],normWorldSM[1]),dot(normWorldSM[2],normWorldSM[2]));vNormalW=normalize(normWorldSM*vNormalW);
normWorldSM=transposeMat3(inverseMat3(normWorldSM));
vec3 vNormalW=normalize(normWorldSM*normalUpdated);
gl_Position=viewProjection*worldPos;
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;
}
/** @internal */
export const shadowMapVertexShader = { name, shader };
//# sourceMappingURL=shadowMap.vertex.js.map