UNPKG

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

64 lines (61 loc) 2.32 kB
import { S as ShaderStore } from './index-MZPybX0H.esm.js'; import { b as bonesDeclaration, a as bakedVertexAnimationDeclaration, i as instancesVertex, c as bonesVertex, d as bakedVertexAnimation } from './bakedVertexAnimation-wpiWOSwD.esm.js'; import { c as clipPlaneVertexDeclaration, a as clipPlaneVertex } from './clipPlaneVertex-DpLNqQi1.esm.js'; import { f as fogVertexDeclaration, a as fogVertex } from './fogVertex-DcP6EK01.esm.js'; import { i as instancesDeclaration } from './instancesDeclaration-BsiN991H.esm.js'; import { v as vertexColorMixing } from './vertexColorMixing-CuklZfs4.esm.js'; // Do not edit. 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 */ const colorVertexShader = { name, shader }; export { colorVertexShader }; //# sourceMappingURL=color.vertex-DjhpY8QM.esm.js.map