123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- // Do not edit.
- import { ShaderStore } from "../Engines/shaderStore.js";
- import "./ShadersInclude/defaultVertexDeclaration.js";
- import "./ShadersInclude/defaultUboDeclaration.js";
- import "./ShadersInclude/uvAttributeDeclaration.js";
- import "./ShadersInclude/helperFunctions.js";
- import "./ShadersInclude/bonesDeclaration.js";
- import "./ShadersInclude/bakedVertexAnimationDeclaration.js";
- import "./ShadersInclude/instancesDeclaration.js";
- import "./ShadersInclude/prePassVertexDeclaration.js";
- import "./ShadersInclude/mainUVVaryingDeclaration.js";
- import "./ShadersInclude/samplerVertexDeclaration.js";
- import "./ShadersInclude/bumpVertexDeclaration.js";
- import "./ShadersInclude/clipPlaneVertexDeclaration.js";
- import "./ShadersInclude/fogVertexDeclaration.js";
- import "./ShadersInclude/lightVxFragmentDeclaration.js";
- import "./ShadersInclude/lightVxUboDeclaration.js";
- import "./ShadersInclude/morphTargetsVertexGlobalDeclaration.js";
- import "./ShadersInclude/morphTargetsVertexDeclaration.js";
- import "./ShadersInclude/logDepthDeclaration.js";
- import "./ShadersInclude/morphTargetsVertexGlobal.js";
- import "./ShadersInclude/morphTargetsVertex.js";
- import "./ShadersInclude/instancesVertex.js";
- import "./ShadersInclude/bonesVertex.js";
- import "./ShadersInclude/bakedVertexAnimation.js";
- import "./ShadersInclude/prePassVertex.js";
- import "./ShadersInclude/uvVariableDeclaration.js";
- import "./ShadersInclude/samplerVertexImplementation.js";
- import "./ShadersInclude/bumpVertex.js";
- import "./ShadersInclude/clipPlaneVertex.js";
- import "./ShadersInclude/fogVertex.js";
- import "./ShadersInclude/shadowsVertex.js";
- import "./ShadersInclude/vertexColorMixing.js";
- import "./ShadersInclude/pointCloudVertex.js";
- import "./ShadersInclude/logDepthVertex.js";
- const name = "defaultVertexShader";
- const shader = `#include<__decl__defaultVertex>
- #define CUSTOM_VERTEX_BEGIN
- attribute vec3 position;
- #ifdef NORMAL
- attribute vec3 normal;
- #endif
- #ifdef TANGENT
- attribute vec4 tangent;
- #endif
- #ifdef UV1
- attribute vec2 uv;
- #endif
- #include<uvAttributeDeclaration>[2..7]
- #ifdef VERTEXCOLOR
- attribute vec4 color;
- #endif
- #include<helperFunctions>
- #include<bonesDeclaration>
- #include<bakedVertexAnimationDeclaration>
- #include<instancesDeclaration>
- #include<prePassVertexDeclaration>
- #include<mainUVVaryingDeclaration>[1..7]
- #include<samplerVertexDeclaration>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse)
- #include<samplerVertexDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail)
- #include<samplerVertexDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient)
- #include<samplerVertexDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity)
- #include<samplerVertexDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive)
- #include<samplerVertexDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap)
- #if defined(SPECULARTERM)
- #include<samplerVertexDeclaration>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular)
- #endif
- #include<samplerVertexDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump)
- #include<samplerVertexDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal)
- varying vec3 vPositionW;
- #ifdef NORMAL
- varying vec3 vNormalW;
- #endif
- #if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
- varying vec4 vColor;
- #endif
- #include<bumpVertexDeclaration>
- #include<clipPlaneVertexDeclaration>
- #include<fogVertexDeclaration>
- #include<__decl__lightVxFragment>[0..maxSimultaneousLights]
- #include<morphTargetsVertexGlobalDeclaration>
- #include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
- #ifdef REFLECTIONMAP_SKYBOX
- varying vec3 vPositionUVW;
- #endif
- #if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
- varying vec3 vDirectionW;
- #endif
- #include<logDepthDeclaration>
- #define CUSTOM_VERTEX_DEFINITIONS
- void main(void) {
- #define CUSTOM_VERTEX_MAIN_BEGIN
- vec3 positionUpdated=position;
- #ifdef NORMAL
- vec3 normalUpdated=normal;
- #endif
- #ifdef TANGENT
- vec4 tangentUpdated=tangent;
- #endif
- #ifdef UV1
- vec2 uvUpdated=uv;
- #endif
- #include<morphTargetsVertexGlobal>
- #include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
- #ifdef REFLECTIONMAP_SKYBOX
- vPositionUVW=positionUpdated;
- #endif
- #define CUSTOM_VERTEX_UPDATE_POSITION
- #define CUSTOM_VERTEX_UPDATE_NORMAL
- #include<instancesVertex>
- #if defined(PREPASS) && defined(PREPASS_VELOCITY) && !defined(BONES_VELOCITY_ENABLED)
- vCurrentPosition=viewProjection*finalWorld*vec4(positionUpdated,1.0);vPreviousPosition=previousViewProjection*finalPreviousWorld*vec4(positionUpdated,1.0);
- #endif
- #include<bonesVertex>
- #include<bakedVertexAnimation>
- vec4 worldPos=finalWorld*vec4(positionUpdated,1.0);
- #ifdef NORMAL
- mat3 normalWorld=mat3(finalWorld);
- #if defined(INSTANCES) && defined(THIN_INSTANCES)
- vNormalW=normalUpdated/vec3(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vNormalW=normalize(normalWorld*vNormalW);
- #else
- #ifdef NONUNIFORMSCALING
- normalWorld=transposeMat3(inverseMat3(normalWorld));
- #endif
- vNormalW=normalize(normalWorld*normalUpdated);
- #endif
- #endif
- #define CUSTOM_VERTEX_UPDATE_WORLDPOS
- #ifdef MULTIVIEW
- if (gl_ViewID_OVR==0u) {gl_Position=viewProjection*worldPos;} else {gl_Position=viewProjectionR*worldPos;}
- #else
- gl_Position=viewProjection*worldPos;
- #endif
- vPositionW=vec3(worldPos);
- #include<prePassVertex>
- #if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
- vDirectionW=normalize(vec3(finalWorld*vec4(positionUpdated,0.0)));
- #endif
- #ifndef UV1
- vec2 uvUpdated=vec2(0.,0.);
- #endif
- #ifdef MAINUV1
- vMainUV1=uvUpdated;
- #endif
- #include<uvVariableDeclaration>[2..7]
- #include<samplerVertexImplementation>(_DEFINENAME_,DIFFUSE,_VARYINGNAME_,Diffuse,_MATRIXNAME_,diffuse,_INFONAME_,DiffuseInfos.x)
- #include<samplerVertexImplementation>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x)
- #include<samplerVertexImplementation>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x)
- #include<samplerVertexImplementation>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x)
- #include<samplerVertexImplementation>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x)
- #include<samplerVertexImplementation>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x)
- #if defined(SPECULARTERM)
- #include<samplerVertexImplementation>(_DEFINENAME_,SPECULAR,_VARYINGNAME_,Specular,_MATRIXNAME_,specular,_INFONAME_,SpecularInfos.x)
- #endif
- #include<samplerVertexImplementation>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x)
- #include<samplerVertexImplementation>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x)
- #include<bumpVertex>
- #include<clipPlaneVertex>
- #include<fogVertex>
- #include<shadowsVertex>[0..maxSimultaneousLights]
- #include<vertexColorMixing>
- #include<pointCloudVertex>
- #include<logDepthVertex>
- #define CUSTOM_VERTEX_MAIN_END
- }
- `;
- // Sideeffect
- ShaderStore.ShadersStore[name] = shader;
- /** @internal */
- export const defaultVertexShader = { name, shader };
- //# sourceMappingURL=default.vertex.js.map
|