UNPKG

@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.

66 lines 2.59 kB
// Do not edit. import { ShaderStore } from "../Engines/shaderStore.js"; import { bonesDeclaration } from "./ShadersInclude/bonesDeclaration.js"; import { bakedVertexAnimationDeclaration } from "./ShadersInclude/bakedVertexAnimationDeclaration.js"; import { clipPlaneVertexDeclaration } from "./ShadersInclude/clipPlaneVertexDeclaration.js"; import { fogVertexDeclaration } from "./ShadersInclude/fogVertexDeclaration.js"; import { instancesDeclaration } from "./ShadersInclude/instancesDeclaration.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 { fogVertex } from "./ShadersInclude/fogVertex.js"; import { vertexColorMixing } from "./ShadersInclude/vertexColorMixing.js"; const name = "colorVertexShader"; const shader = `attribute vec3 position; #ifdef VERTEXCOLOR attribute vec4 color; #endif #include<bonesDeclaration> #include<bakedVertexAnimationDeclaration> #include<clipPlaneVertexDeclaration> #include<fogVertexDeclaration> #ifdef FOG uniform mat4 view; #endif #include<instancesDeclaration> uniform mat4 viewProjection; #ifdef MULTIVIEW uniform mat4 viewProjectionR; #endif #if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES) varying vec4 vColor; #endif #define CUSTOM_VERTEX_DEFINITIONS void main(void) { #define CUSTOM_VERTEX_MAIN_BEGIN #ifdef VERTEXCOLOR vec4 colorUpdated=color; #endif #include<instancesVertex> #include<bonesVertex> #include<bakedVertexAnimation> vec4 worldPos=finalWorld*vec4(position,1.0); #ifdef MULTIVIEW if (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;} #else gl_Position=viewProjection*worldPos; #endif #include<clipPlaneVertex> #include<fogVertex> #include<vertexColorMixing> #define CUSTOM_VERTEX_MAIN_END }`; // Sideeffect if (!ShaderStore.ShadersStore[name]) { ShaderStore.ShadersStore[name] = shader; } const includes = [bonesDeclaration, bakedVertexAnimationDeclaration, clipPlaneVertexDeclaration, fogVertexDeclaration, instancesDeclaration, instancesVertex, bonesVertex, bakedVertexAnimation, clipPlaneVertex, fogVertex, vertexColorMixing]; for (const inc of includes) { if (!ShaderStore.IncludesShadersStore[inc.name]) { ShaderStore.IncludesShadersStore[inc.name] = inc.shader; } } /** @internal */ export const colorVertexShader = { name, shader }; //# sourceMappingURL=color.vertex.js.map