@babylonjs/viewer 7.22.5 → 7.23.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/babylon-viewer.esm.js +2 -0
- package/dist/babylon-viewer.esm.js.map +1 -0
- package/dist/babylon-viewer.esm.min.js +2 -0
- package/dist/babylon-viewer.esm.min.js.map +1 -0
- package/dist/chunks/basisTextureLoader-BnIeLUi5.esm.min.js +2 -0
- package/dist/chunks/basisTextureLoader-BnIeLUi5.esm.min.js.map +1 -0
- package/dist/chunks/basisTextureLoader-D5DAa_qR.esm.js +600 -0
- package/dist/chunks/basisTextureLoader-D5DAa_qR.esm.js.map +1 -0
- package/dist/chunks/ddsTextureLoader-D9xNsYAT.esm.min.js +2 -0
- package/dist/chunks/ddsTextureLoader-D9xNsYAT.esm.min.js.map +1 -0
- package/dist/chunks/ddsTextureLoader-DCv39Yn8.esm.js +87 -0
- package/dist/chunks/ddsTextureLoader-DCv39Yn8.esm.js.map +1 -0
- package/dist/chunks/envTextureLoader-Cmuugxf1.esm.min.js +2 -0
- package/dist/chunks/envTextureLoader-Cmuugxf1.esm.min.js.map +1 -0
- package/dist/chunks/envTextureLoader-Dl0xiO1G.esm.js +62 -0
- package/dist/chunks/envTextureLoader-Dl0xiO1G.esm.js.map +1 -0
- package/dist/chunks/exrTextureLoader-C0UEUMfH.esm.js +1682 -0
- package/dist/chunks/exrTextureLoader-C0UEUMfH.esm.js.map +1 -0
- package/dist/chunks/exrTextureLoader-DVZGHvAz.esm.min.js +2 -0
- package/dist/chunks/exrTextureLoader-DVZGHvAz.esm.min.js.map +1 -0
- package/dist/chunks/hdrTextureLoader-BM271mLj.esm.min.js +2 -0
- package/dist/chunks/hdrTextureLoader-BM271mLj.esm.min.js.map +1 -0
- package/dist/chunks/hdrTextureLoader-CrHh5vTV.esm.js +252 -0
- package/dist/chunks/hdrTextureLoader-CrHh5vTV.esm.js.map +1 -0
- package/dist/chunks/helperFunctions-BQ8X1piK.esm.min.js +2 -0
- package/dist/chunks/helperFunctions-BQ8X1piK.esm.min.js.map +1 -0
- package/dist/chunks/helperFunctions-CUX6uz_w.esm.js +108 -0
- package/dist/chunks/helperFunctions-CUX6uz_w.esm.js.map +1 -0
- package/dist/chunks/helperFunctions-ChWwJuKv.esm.min.js +2 -0
- package/dist/chunks/helperFunctions-ChWwJuKv.esm.min.js.map +1 -0
- package/dist/chunks/helperFunctions-DpMCqZKL.esm.js +80 -0
- package/dist/chunks/helperFunctions-DpMCqZKL.esm.js.map +1 -0
- package/dist/chunks/index-DHuuBhpP.esm.js +102146 -0
- package/dist/chunks/index-DHuuBhpP.esm.js.map +1 -0
- package/dist/chunks/index-EA8kJjBu.esm.min.js +56 -0
- package/dist/chunks/index-EA8kJjBu.esm.min.js.map +1 -0
- package/dist/chunks/ktxTextureLoader-BRR5FQro.esm.min.js +2 -0
- package/dist/chunks/ktxTextureLoader-BRR5FQro.esm.min.js.map +1 -0
- package/dist/chunks/ktxTextureLoader-gZQU7w7m.esm.js +813 -0
- package/dist/chunks/ktxTextureLoader-gZQU7w7m.esm.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-B1MaqbwG.esm.min.js +2 -0
- package/dist/chunks/logDepthDeclaration-B1MaqbwG.esm.min.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-B2UkQWK5.esm.min.js +2 -0
- package/dist/chunks/logDepthDeclaration-B2UkQWK5.esm.min.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-COhUDa1N.esm.js +73 -0
- package/dist/chunks/logDepthDeclaration-COhUDa1N.esm.js.map +1 -0
- package/dist/chunks/logDepthDeclaration-CojhsbFY.esm.js +76 -0
- package/dist/chunks/logDepthDeclaration-CojhsbFY.esm.js.map +1 -0
- package/dist/chunks/pass.fragment-BNKAdmAy.esm.min.js +2 -0
- package/dist/chunks/pass.fragment-BNKAdmAy.esm.min.js.map +1 -0
- package/dist/chunks/pass.fragment-CDiei_Sn.esm.js +15 -0
- package/dist/chunks/pass.fragment-CDiei_Sn.esm.js.map +1 -0
- package/dist/chunks/pbr.fragment-BN71FgFx.esm.min.js +2 -0
- package/dist/chunks/pbr.fragment-BN71FgFx.esm.min.js.map +1 -0
- package/dist/chunks/pbr.fragment-BvCEmvwh.esm.js +4530 -0
- package/dist/chunks/pbr.fragment-BvCEmvwh.esm.js.map +1 -0
- package/dist/chunks/pbr.fragment-DU4hy3T_.esm.min.js +2 -0
- package/dist/chunks/pbr.fragment-DU4hy3T_.esm.min.js.map +1 -0
- package/dist/chunks/pbr.fragment-QxF1RFoh.esm.js +4323 -0
- package/dist/chunks/pbr.fragment-QxF1RFoh.esm.js.map +1 -0
- package/dist/chunks/pbr.vertex-62J9fbA6.esm.js +932 -0
- package/dist/chunks/pbr.vertex-62J9fbA6.esm.js.map +1 -0
- package/dist/chunks/pbr.vertex-C8vOdMd6.esm.min.js +2 -0
- package/dist/chunks/pbr.vertex-C8vOdMd6.esm.min.js.map +1 -0
- package/dist/chunks/pbr.vertex-Cp4yABqq.esm.js +809 -0
- package/dist/chunks/pbr.vertex-Cp4yABqq.esm.js.map +1 -0
- package/dist/chunks/pbr.vertex-DPPPQSbX.esm.min.js +2 -0
- package/dist/chunks/pbr.vertex-DPPPQSbX.esm.min.js.map +1 -0
- package/dist/chunks/postprocess.vertex-5WWqPw1s.esm.js +20 -0
- package/dist/chunks/postprocess.vertex-5WWqPw1s.esm.js.map +1 -0
- package/dist/chunks/postprocess.vertex-DzqXlss5.esm.min.js +2 -0
- package/dist/chunks/postprocess.vertex-DzqXlss5.esm.min.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-BdggM8VZ.esm.min.js +2 -0
- package/dist/chunks/rgbdDecode.fragment-BdggM8VZ.esm.min.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-Bpslxg4R.esm.js +17 -0
- package/dist/chunks/rgbdDecode.fragment-Bpslxg4R.esm.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-By7Rc7Xz.esm.js +17 -0
- package/dist/chunks/rgbdDecode.fragment-By7Rc7Xz.esm.js.map +1 -0
- package/dist/chunks/rgbdDecode.fragment-CnUoEV03.esm.min.js +2 -0
- package/dist/chunks/rgbdDecode.fragment-CnUoEV03.esm.min.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-BBl79-3e.esm.js +17 -0
- package/dist/chunks/rgbdEncode.fragment-BBl79-3e.esm.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-BGkuZmHn.esm.min.js +2 -0
- package/dist/chunks/rgbdEncode.fragment-BGkuZmHn.esm.min.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-LUPpF87m.esm.min.js +2 -0
- package/dist/chunks/rgbdEncode.fragment-LUPpF87m.esm.min.js.map +1 -0
- package/dist/chunks/rgbdEncode.fragment-PJDNuVns.esm.js +17 -0
- package/dist/chunks/rgbdEncode.fragment-PJDNuVns.esm.js.map +1 -0
- package/dist/chunks/tgaTextureLoader-CccJYauf.esm.min.js +2 -0
- package/dist/chunks/tgaTextureLoader-CccJYauf.esm.min.js.map +1 -0
- package/dist/chunks/tgaTextureLoader-DdDpL5u3.esm.js +349 -0
- package/dist/chunks/tgaTextureLoader-DdDpL5u3.esm.js.map +1 -0
- package/lib/index.d.ts +237 -0
- package/lib/index.js +869 -0
- package/lib/index.js.map +1 -0
- package/package.json +17 -27
- package/readme.md +35 -21
- package/configuration/configuration.d.ts +0 -107
- package/configuration/configuration.js +0 -16
- package/configuration/configuration.js.map +0 -1
- package/configuration/configurationCompatibility.d.ts +0 -8
- package/configuration/configurationCompatibility.js +0 -66
- package/configuration/configurationCompatibility.js.map +0 -1
- package/configuration/configurationContainer.d.ts +0 -10
- package/configuration/configurationContainer.js +0 -10
- package/configuration/configurationContainer.js.map +0 -1
- package/configuration/globals.d.ts +0 -6
- package/configuration/globals.js +0 -18
- package/configuration/globals.js.map +0 -1
- package/configuration/index.d.ts +0 -2
- package/configuration/index.js +0 -4
- package/configuration/index.js.map +0 -1
- package/configuration/interfaces/cameraConfiguration.d.ts +0 -31
- package/configuration/interfaces/cameraConfiguration.js +0 -2
- package/configuration/interfaces/cameraConfiguration.js.map +0 -1
- package/configuration/interfaces/colorGradingConfiguration.d.ts +0 -81
- package/configuration/interfaces/colorGradingConfiguration.js +0 -2
- package/configuration/interfaces/colorGradingConfiguration.js.map +0 -1
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +0 -20
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +0 -2
- package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +0 -1
- package/configuration/interfaces/environmentMapConfiguration.d.ts +0 -22
- package/configuration/interfaces/environmentMapConfiguration.js +0 -2
- package/configuration/interfaces/environmentMapConfiguration.js.map +0 -1
- package/configuration/interfaces/groundConfiguration.d.ts +0 -24
- package/configuration/interfaces/groundConfiguration.js +0 -2
- package/configuration/interfaces/groundConfiguration.js.map +0 -1
- package/configuration/interfaces/imageProcessingConfiguration.d.ts +0 -45
- package/configuration/interfaces/imageProcessingConfiguration.js +0 -2
- package/configuration/interfaces/imageProcessingConfiguration.js.map +0 -1
- package/configuration/interfaces/index.d.ts +0 -15
- package/configuration/interfaces/index.js +0 -16
- package/configuration/interfaces/index.js.map +0 -1
- package/configuration/interfaces/lightConfiguration.d.ts +0 -60
- package/configuration/interfaces/lightConfiguration.js +0 -2
- package/configuration/interfaces/lightConfiguration.js.map +0 -1
- package/configuration/interfaces/modelAnimationConfiguration.d.ts +0 -26
- package/configuration/interfaces/modelAnimationConfiguration.js +0 -2
- package/configuration/interfaces/modelAnimationConfiguration.js.map +0 -1
- package/configuration/interfaces/modelConfiguration.d.ts +0 -65
- package/configuration/interfaces/modelConfiguration.js +0 -2
- package/configuration/interfaces/modelConfiguration.js.map +0 -1
- package/configuration/interfaces/observersConfiguration.d.ts +0 -5
- package/configuration/interfaces/observersConfiguration.js +0 -2
- package/configuration/interfaces/observersConfiguration.js.map +0 -1
- package/configuration/interfaces/sceneConfiguration.d.ts +0 -48
- package/configuration/interfaces/sceneConfiguration.js +0 -2
- package/configuration/interfaces/sceneConfiguration.js.map +0 -1
- package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +0 -23
- package/configuration/interfaces/sceneOptimizerConfiguration.js +0 -2
- package/configuration/interfaces/sceneOptimizerConfiguration.js.map +0 -1
- package/configuration/interfaces/skyboxConfiguration.d.ts +0 -21
- package/configuration/interfaces/skyboxConfiguration.js +0 -2
- package/configuration/interfaces/skyboxConfiguration.js.map +0 -1
- package/configuration/interfaces/templateConfiguration.d.ts +0 -67
- package/configuration/interfaces/templateConfiguration.js +0 -2
- package/configuration/interfaces/templateConfiguration.js.map +0 -1
- package/configuration/interfaces/vrConfiguration.d.ts +0 -16
- package/configuration/interfaces/vrConfiguration.js +0 -2
- package/configuration/interfaces/vrConfiguration.js.map +0 -1
- package/configuration/loader.d.ts +0 -4
- package/configuration/loader.js +0 -17
- package/configuration/loader.js.map +0 -1
- package/configuration/mappers.d.ts +0 -43
- package/configuration/mappers.js +0 -192
- package/configuration/mappers.js.map +0 -1
- package/configuration/renderOnlyLoader.d.ts +0 -33
- package/configuration/renderOnlyLoader.js +0 -162
- package/configuration/renderOnlyLoader.js.map +0 -1
- package/configuration/types/default.d.ts +0 -6
- package/configuration/types/default.js +0 -121
- package/configuration/types/default.js.map +0 -1
- package/configuration/types/environmentMap.d.ts +0 -5
- package/configuration/types/environmentMap.js +0 -14
- package/configuration/types/environmentMap.js.map +0 -1
- package/configuration/types/extended.d.ts +0 -6
- package/configuration/types/extended.js +0 -317
- package/configuration/types/extended.js.map +0 -1
- package/configuration/types/index.d.ts +0 -14
- package/configuration/types/index.js +0 -51
- package/configuration/types/index.js.map +0 -1
- package/configuration/types/minimal.d.ts +0 -6
- package/configuration/types/minimal.js +0 -43
- package/configuration/types/minimal.js.map +0 -1
- package/configuration/types/renderOnlyDefault.d.ts +0 -30
- package/configuration/types/renderOnlyDefault.js +0 -31
- package/configuration/types/renderOnlyDefault.js.map +0 -1
- package/configuration/types/shadowLight.d.ts +0 -9
- package/configuration/types/shadowLight.js +0 -64
- package/configuration/types/shadowLight.js.map +0 -1
- package/helper/index.d.ts +0 -29
- package/helper/index.js +0 -66
- package/helper/index.js.map +0 -1
- package/index.d.ts +0 -30
- package/index.js +0 -46
- package/index.js.map +0 -1
- package/initializer.d.ts +0 -11
- package/initializer.js +0 -35
- package/initializer.js.map +0 -1
- package/interfaces.d.ts +0 -5
- package/interfaces.js +0 -7
- package/interfaces.js.map +0 -1
- package/labs/environmentSerializer.d.ts +0 -126
- package/labs/environmentSerializer.js +0 -191
- package/labs/environmentSerializer.js.map +0 -1
- package/labs/texture.d.ts +0 -183
- package/labs/texture.js +0 -351
- package/labs/texture.js.map +0 -1
- package/labs/viewerLabs.d.ts +0 -51
- package/labs/viewerLabs.js +0 -134
- package/labs/viewerLabs.js.map +0 -1
- package/loader/modelLoader.d.ts +0 -56
- package/loader/modelLoader.js +0 -199
- package/loader/modelLoader.js.map +0 -1
- package/loader/plugins/applyMaterialConfig.d.ts +0 -12
- package/loader/plugins/applyMaterialConfig.js +0 -16
- package/loader/plugins/applyMaterialConfig.js.map +0 -1
- package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +0 -9
- package/loader/plugins/extendedMaterialLoaderPlugin.js +0 -16
- package/loader/plugins/extendedMaterialLoaderPlugin.js.map +0 -1
- package/loader/plugins/index.d.ts +0 -19
- package/loader/plugins/index.js +0 -44
- package/loader/plugins/index.js.map +0 -1
- package/loader/plugins/loaderPlugin.d.ts +0 -24
- package/loader/plugins/loaderPlugin.js +0 -2
- package/loader/plugins/loaderPlugin.js.map +0 -1
- package/loader/plugins/msftLodLoaderPlugin.d.ts +0 -12
- package/loader/plugins/msftLodLoaderPlugin.js +0 -21
- package/loader/plugins/msftLodLoaderPlugin.js.map +0 -1
- package/loader/plugins/telemetryLoaderPlugin.d.ts +0 -12
- package/loader/plugins/telemetryLoaderPlugin.js +0 -36
- package/loader/plugins/telemetryLoaderPlugin.js.map +0 -1
- package/managers/observablesManager.d.ts +0 -66
- package/managers/observablesManager.js +0 -35
- package/managers/observablesManager.js.map +0 -1
- package/managers/sceneManager.d.ts +0 -245
- package/managers/sceneManager.js +0 -1375
- package/managers/sceneManager.js.map +0 -1
- package/managers/telemetryManager.d.ts +0 -78
- package/managers/telemetryManager.js +0 -117
- package/managers/telemetryManager.js.map +0 -1
- package/model/modelAnimation.d.ts +0 -215
- package/model/modelAnimation.js +0 -237
- package/model/modelAnimation.js.map +0 -1
- package/model/viewerModel.d.ts +0 -233
- package/model/viewerModel.js +0 -673
- package/model/viewerModel.js.map +0 -1
- package/optimizer/custom/extended.d.ts +0 -13
- package/optimizer/custom/extended.js +0 -101
- package/optimizer/custom/extended.js.map +0 -1
- package/optimizer/custom/index.d.ts +0 -9
- package/optimizer/custom/index.js +0 -26
- package/optimizer/custom/index.js.map +0 -1
- package/renderOnlyIndex.d.ts +0 -11
- package/renderOnlyIndex.js +0 -18
- package/renderOnlyIndex.js.map +0 -1
- package/templating/eventManager.d.ts +0 -35
- package/templating/eventManager.js +0 -66
- package/templating/eventManager.js.map +0 -1
- package/templating/plugins/hdButtonPlugin.d.ts +0 -9
- package/templating/plugins/hdButtonPlugin.js +0 -21
- package/templating/plugins/hdButtonPlugin.js.map +0 -1
- package/templating/plugins/printButton.d.ts +0 -9
- package/templating/plugins/printButton.js +0 -40
- package/templating/plugins/printButton.js.map +0 -1
- package/templating/templateManager.d.ts +0 -197
- package/templating/templateManager.js +0 -561
- package/templating/templateManager.js.map +0 -1
- package/templating/viewerTemplatePlugin.d.ts +0 -21
- package/templating/viewerTemplatePlugin.js +0 -69
- package/templating/viewerTemplatePlugin.js.map +0 -1
- package/viewer/defaultViewer.d.ts +0 -130
- package/viewer/defaultViewer.js +0 -675
- package/viewer/defaultViewer.js.map +0 -1
- package/viewer/renderOnlyViewer.d.ts +0 -9
- package/viewer/renderOnlyViewer.js +0 -46
- package/viewer/renderOnlyViewer.js.map +0 -1
- package/viewer/viewer.d.ts +0 -258
- package/viewer/viewer.js +0 -783
- package/viewer/viewer.js.map +0 -1
- package/viewer/viewerManager.d.ts +0 -58
- package/viewer/viewerManager.js +0 -91
- package/viewer/viewerManager.js.map +0 -1
- package/viewer/viewerWithTemplate.d.ts +0 -9
- package/viewer/viewerWithTemplate.js +0 -20
- package/viewer/viewerWithTemplate.js.map +0 -1
|
@@ -0,0 +1,809 @@
|
|
|
1
|
+
import { S as ShaderStore } from './index-DHuuBhpP.esm.js';
|
|
2
|
+
import './logDepthDeclaration-COhUDa1N.esm.js';
|
|
3
|
+
import './helperFunctions-DpMCqZKL.esm.js';
|
|
4
|
+
|
|
5
|
+
// Do not edit.
|
|
6
|
+
const name$q = "uvAttributeDeclaration";
|
|
7
|
+
const shader$q = `#ifdef UV{X}
|
|
8
|
+
attribute uv{X}: vec2f;
|
|
9
|
+
#endif
|
|
10
|
+
`;
|
|
11
|
+
// Sideeffect
|
|
12
|
+
ShaderStore.IncludesShadersStoreWGSL[name$q] = shader$q;
|
|
13
|
+
|
|
14
|
+
// Do not edit.
|
|
15
|
+
const name$p = "bonesDeclaration";
|
|
16
|
+
const shader$p = `#if NUM_BONE_INFLUENCERS>0
|
|
17
|
+
attribute matricesIndices : vec4<f32>;attribute matricesWeights : vec4<f32>;
|
|
18
|
+
#if NUM_BONE_INFLUENCERS>4
|
|
19
|
+
attribute matricesIndicesExtra : vec4<f32>;attribute matricesWeightsExtra : vec4<f32>;
|
|
20
|
+
#endif
|
|
21
|
+
#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
|
|
22
|
+
#ifdef BONETEXTURE
|
|
23
|
+
var boneSampler : texture_2d<f32>;uniform boneTextureWidth : f32;
|
|
24
|
+
#else
|
|
25
|
+
uniform mBones : array<mat4x4,BonesPerMesh>;
|
|
26
|
+
#ifdef BONES_VELOCITY_ENABLED
|
|
27
|
+
uniform mPreviousBones : array<mat4x4,BonesPerMesh>;
|
|
28
|
+
#endif
|
|
29
|
+
#endif
|
|
30
|
+
#ifdef BONETEXTURE
|
|
31
|
+
fn readMatrixFromRawSampler(smp : texture_2d<f32>,index : f32)->mat4x4<f32>
|
|
32
|
+
{let offset=i32(index) *4;
|
|
33
|
+
let m0=textureLoad(smp,vec2<i32>(offset+0,0),0);let m1=textureLoad(smp,vec2<i32>(offset+1,0),0);let m2=textureLoad(smp,vec2<i32>(offset+2,0),0);let m3=textureLoad(smp,vec2<i32>(offset+3,0),0);return mat4x4<f32>(m0,m1,m2,m3);}
|
|
34
|
+
#endif
|
|
35
|
+
#endif
|
|
36
|
+
#endif
|
|
37
|
+
`;
|
|
38
|
+
// Sideeffect
|
|
39
|
+
ShaderStore.IncludesShadersStoreWGSL[name$p] = shader$p;
|
|
40
|
+
|
|
41
|
+
// Do not edit.
|
|
42
|
+
const name$o = "bakedVertexAnimationDeclaration";
|
|
43
|
+
const shader$o = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
|
|
44
|
+
uniform bakedVertexAnimationTime: f32;uniform bakedVertexAnimationTextureSizeInverted: vec2<f32>;uniform bakedVertexAnimationSettings: vec4<f32>;var bakedVertexAnimationTexture : texture_2d<f32>;
|
|
45
|
+
#ifdef INSTANCES
|
|
46
|
+
attribute bakedVertexAnimationSettingsInstanced : vec4<f32>;
|
|
47
|
+
#endif
|
|
48
|
+
fn readMatrixFromRawSamplerVAT(smp : texture_2d<f32>,index : f32,frame : f32)->mat4x4<f32>
|
|
49
|
+
{let offset=i32(index)*4;let frameUV=i32(frame);let m0=textureLoad(smp,vec2<i32>(offset+0,frameUV),0);let m1=textureLoad(smp,vec2<i32>(offset+1,frameUV),0);let m2=textureLoad(smp,vec2<i32>(offset+2,frameUV),0);let m3=textureLoad(smp,vec2<i32>(offset+3,frameUV),0);return mat4x4<f32>(m0,m1,m2,m3);}
|
|
50
|
+
#endif
|
|
51
|
+
`;
|
|
52
|
+
// Sideeffect
|
|
53
|
+
ShaderStore.IncludesShadersStoreWGSL[name$o] = shader$o;
|
|
54
|
+
|
|
55
|
+
// Do not edit.
|
|
56
|
+
const name$n = "instancesDeclaration";
|
|
57
|
+
const shader$n = `#ifdef INSTANCES
|
|
58
|
+
attribute world0 : vec4<f32>;attribute world1 : vec4<f32>;attribute world2 : vec4<f32>;attribute world3 : vec4<f32>;
|
|
59
|
+
#ifdef INSTANCESCOLOR
|
|
60
|
+
attribute instanceColor : vec4<f32>;
|
|
61
|
+
#endif
|
|
62
|
+
#if defined(THIN_INSTANCES) && !defined(WORLD_UBO)
|
|
63
|
+
uniform world : mat4x4<f32>;
|
|
64
|
+
#endif
|
|
65
|
+
#if defined(VELOCITY) || defined(PREPASS_VELOCITY) || \
|
|
66
|
+
defined(PREPASS_VELOCITY_LINEAR)
|
|
67
|
+
attribute previousWorld0 : vec4<f32>;attribute previousWorld1 : vec4<f32>;attribute previousWorld2 : vec4<f32>;attribute previousWorld3 : vec4<f32>;
|
|
68
|
+
#ifdef THIN_INSTANCES
|
|
69
|
+
uniform previousWorld : mat4x4<f32>;
|
|
70
|
+
#endif
|
|
71
|
+
#endif
|
|
72
|
+
#else
|
|
73
|
+
#if !defined(WORLD_UBO)
|
|
74
|
+
uniform world : mat4x4<f32>;
|
|
75
|
+
#endif
|
|
76
|
+
#if defined(VELOCITY) || defined(PREPASS_VELOCITY) || \
|
|
77
|
+
defined(PREPASS_VELOCITY_LINEAR)
|
|
78
|
+
uniform previousWorld : mat4x4<f32>;
|
|
79
|
+
#endif
|
|
80
|
+
#endif
|
|
81
|
+
`;
|
|
82
|
+
// Sideeffect
|
|
83
|
+
ShaderStore.IncludesShadersStoreWGSL[name$n] = shader$n;
|
|
84
|
+
|
|
85
|
+
// Do not edit.
|
|
86
|
+
const name$m = "prePassVertexDeclaration";
|
|
87
|
+
const shader$m = `#ifdef PREPASS
|
|
88
|
+
#ifdef PREPASS_LOCAL_POSITION
|
|
89
|
+
varying vPosition : vec3f;
|
|
90
|
+
#endif
|
|
91
|
+
#ifdef PREPASS_DEPTH
|
|
92
|
+
varying vViewPos: vec3f;
|
|
93
|
+
#endif
|
|
94
|
+
#if defined(PREPASS_VELOCITY) || defined(PREPASS_VELOCITY_LINEAR)
|
|
95
|
+
uniform previousViewProjection: mat4x4f;varying vCurrentPosition: vec4f;varying vPreviousPosition: vec4f;
|
|
96
|
+
#endif
|
|
97
|
+
#endif
|
|
98
|
+
`;
|
|
99
|
+
// Sideeffect
|
|
100
|
+
ShaderStore.IncludesShadersStoreWGSL[name$m] = shader$m;
|
|
101
|
+
|
|
102
|
+
// Do not edit.
|
|
103
|
+
const name$l = "samplerVertexDeclaration";
|
|
104
|
+
const shader$l = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0
|
|
105
|
+
varying v_VARYINGNAME_UV: vec2f;
|
|
106
|
+
#endif
|
|
107
|
+
`;
|
|
108
|
+
// Sideeffect
|
|
109
|
+
ShaderStore.IncludesShadersStoreWGSL[name$l] = shader$l;
|
|
110
|
+
|
|
111
|
+
// Do not edit.
|
|
112
|
+
const name$k = "bumpVertexDeclaration";
|
|
113
|
+
const shader$k = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
|
|
114
|
+
#if defined(TANGENT) && defined(NORMAL)
|
|
115
|
+
varying vTBN0: vec3f;varying vTBN1: vec3f;varying vTBN2: vec3f;
|
|
116
|
+
#endif
|
|
117
|
+
#endif
|
|
118
|
+
`;
|
|
119
|
+
// Sideeffect
|
|
120
|
+
ShaderStore.IncludesShadersStoreWGSL[name$k] = shader$k;
|
|
121
|
+
|
|
122
|
+
// Do not edit.
|
|
123
|
+
const name$j = "clipPlaneVertexDeclaration";
|
|
124
|
+
const shader$j = `#ifdef CLIPPLANE
|
|
125
|
+
uniform vClipPlane: vec4<f32>;varying fClipDistance: f32;
|
|
126
|
+
#endif
|
|
127
|
+
#ifdef CLIPPLANE2
|
|
128
|
+
uniform vClipPlane2: vec4<f32>;varying fClipDistance2: f32;
|
|
129
|
+
#endif
|
|
130
|
+
#ifdef CLIPPLANE3
|
|
131
|
+
uniform vClipPlane3: vec4<f32>;varying fClipDistance3: f32;
|
|
132
|
+
#endif
|
|
133
|
+
#ifdef CLIPPLANE4
|
|
134
|
+
uniform vClipPlane4: vec4<f32>;varying fClipDistance4: f32;
|
|
135
|
+
#endif
|
|
136
|
+
#ifdef CLIPPLANE5
|
|
137
|
+
uniform vClipPlane5: vec4<f32>;varying fClipDistance5: f32;
|
|
138
|
+
#endif
|
|
139
|
+
#ifdef CLIPPLANE6
|
|
140
|
+
uniform vClipPlane6: vec4<f32>;varying fClipDistance6: f32;
|
|
141
|
+
#endif
|
|
142
|
+
`;
|
|
143
|
+
// Sideeffect
|
|
144
|
+
ShaderStore.IncludesShadersStoreWGSL[name$j] = shader$j;
|
|
145
|
+
|
|
146
|
+
// Do not edit.
|
|
147
|
+
const name$i = "fogVertexDeclaration";
|
|
148
|
+
const shader$i = `#ifdef FOG
|
|
149
|
+
varying vFogDistance: vec3f;
|
|
150
|
+
#endif
|
|
151
|
+
`;
|
|
152
|
+
// Sideeffect
|
|
153
|
+
ShaderStore.IncludesShadersStoreWGSL[name$i] = shader$i;
|
|
154
|
+
|
|
155
|
+
// Do not edit.
|
|
156
|
+
const name$h = "lightVxUboDeclaration";
|
|
157
|
+
const shader$h = `#ifdef LIGHT{X}
|
|
158
|
+
struct Light{X}
|
|
159
|
+
{vLightData: vec4f,
|
|
160
|
+
vLightDiffuse: vec4f,
|
|
161
|
+
vLightSpecular: vec4f,
|
|
162
|
+
#ifdef SPOTLIGHT{X}
|
|
163
|
+
vLightDirection: vec4f,
|
|
164
|
+
vLightFalloff: vec4f,
|
|
165
|
+
#elif defined(POINTLIGHT{X})
|
|
166
|
+
vLightFalloff: vec4f,
|
|
167
|
+
#elif defined(HEMILIGHT{X})
|
|
168
|
+
vLightGround: vec3f,
|
|
169
|
+
#endif
|
|
170
|
+
shadowsInfo: vec4f,
|
|
171
|
+
depthValues: vec2f} ;var<uniform> light{X} : Light{X};
|
|
172
|
+
#ifdef SHADOW{X}
|
|
173
|
+
#ifdef SHADOWCSM{X}
|
|
174
|
+
uniform lightMatrix{X}: array<mat4x4f,SHADOWCSMNUM_CASCADES{X}>;varying vPositionFromLight{X}_0: vec4f;varying vDepthMetric{X}_0: f32;varying vPositionFromLight{X}_1: vec4f;varying vDepthMetric{X}_1: f32;varying vPositionFromLight{X}_2: vec4f;varying vDepthMetric{X}_2: f32;varying vPositionFromLight{X}_3: vec4f;varying vDepthMetric{X}_3: f32;varying vPositionFromCamera{X}: vec4f;
|
|
175
|
+
#elif defined(SHADOWCUBE{X})
|
|
176
|
+
#else
|
|
177
|
+
varying vPositionFromLight{X}: vec4f;varying vDepthMetric{X}: f32;uniform lightMatrix{X}: mat4x4f;
|
|
178
|
+
#endif
|
|
179
|
+
#endif
|
|
180
|
+
#endif
|
|
181
|
+
`;
|
|
182
|
+
// Sideeffect
|
|
183
|
+
ShaderStore.IncludesShadersStoreWGSL[name$h] = shader$h;
|
|
184
|
+
|
|
185
|
+
// Do not edit.
|
|
186
|
+
const name$g = "morphTargetsVertexGlobalDeclaration";
|
|
187
|
+
const shader$g = `#ifdef MORPHTARGETS
|
|
188
|
+
uniform morphTargetInfluences : array<f32,NUM_MORPH_INFLUENCERS>;
|
|
189
|
+
#ifdef MORPHTARGETS_TEXTURE
|
|
190
|
+
uniform morphTargetTextureIndices : array<f32,NUM_MORPH_INFLUENCERS>;uniform morphTargetTextureInfo : vec3<f32>;var morphTargets : texture_2d_array<f32>;var morphTargetsSampler : sampler;fn readVector3FromRawSampler(targetIndex : i32,vertexIndex : f32)->vec3<f32>
|
|
191
|
+
{
|
|
192
|
+
let y=floor(vertexIndex/uniforms.morphTargetTextureInfo.y);let x=vertexIndex-y*uniforms.morphTargetTextureInfo.y;let textureUV=vec2<f32>((x+0.5)/uniforms.morphTargetTextureInfo.y,(y+0.5)/uniforms.morphTargetTextureInfo.z);return textureSampleLevel(morphTargets,morphTargetsSampler,textureUV,i32(uniforms.morphTargetTextureIndices[targetIndex]),0.0).xyz;}
|
|
193
|
+
#endif
|
|
194
|
+
#endif
|
|
195
|
+
`;
|
|
196
|
+
// Sideeffect
|
|
197
|
+
ShaderStore.IncludesShadersStoreWGSL[name$g] = shader$g;
|
|
198
|
+
|
|
199
|
+
// Do not edit.
|
|
200
|
+
const name$f = "morphTargetsVertexDeclaration";
|
|
201
|
+
const shader$f = `#ifdef MORPHTARGETS
|
|
202
|
+
#ifndef MORPHTARGETS_TEXTURE
|
|
203
|
+
attribute position{X} : vec3<f32>;
|
|
204
|
+
#ifdef MORPHTARGETS_NORMAL
|
|
205
|
+
attribute normal{X} : vec3<f32>;
|
|
206
|
+
#endif
|
|
207
|
+
#ifdef MORPHTARGETS_TANGENT
|
|
208
|
+
attribute tangent{X} : vec3<f32>;
|
|
209
|
+
#endif
|
|
210
|
+
#ifdef MORPHTARGETS_UV
|
|
211
|
+
attribute uv_{X} : vec2<f32>;
|
|
212
|
+
#endif
|
|
213
|
+
#elif {X}==0
|
|
214
|
+
uniform morphTargetCount: i32;
|
|
215
|
+
#endif
|
|
216
|
+
#endif
|
|
217
|
+
`;
|
|
218
|
+
// Sideeffect
|
|
219
|
+
ShaderStore.IncludesShadersStoreWGSL[name$f] = shader$f;
|
|
220
|
+
|
|
221
|
+
// Do not edit.
|
|
222
|
+
const name$e = "morphTargetsVertexGlobal";
|
|
223
|
+
const shader$e = `#ifdef MORPHTARGETS
|
|
224
|
+
#ifdef MORPHTARGETS_TEXTURE
|
|
225
|
+
var vertexID : f32;
|
|
226
|
+
#endif
|
|
227
|
+
#endif
|
|
228
|
+
`;
|
|
229
|
+
// Sideeffect
|
|
230
|
+
ShaderStore.IncludesShadersStoreWGSL[name$e] = shader$e;
|
|
231
|
+
|
|
232
|
+
// Do not edit.
|
|
233
|
+
const name$d = "morphTargetsVertex";
|
|
234
|
+
const shader$d = `#ifdef MORPHTARGETS
|
|
235
|
+
#ifdef MORPHTARGETS_TEXTURE
|
|
236
|
+
#if {X}==0
|
|
237
|
+
for (var i=0; i<NUM_MORPH_INFLUENCERS; i=i+1) {if (i>=uniforms.morphTargetCount) {break;}
|
|
238
|
+
vertexID=f32(vertexInputs.vertexIndex)*uniforms.morphTargetTextureInfo.x;positionUpdated=positionUpdated+(readVector3FromRawSampler(i,vertexID)-vertexInputs.position)*uniforms.morphTargetInfluences[i];vertexID=vertexID+1.0;
|
|
239
|
+
#ifdef MORPHTARGETS_NORMAL
|
|
240
|
+
normalUpdated=normalUpdated+(readVector3FromRawSampler(i,vertexID) -vertexInputs.normal)*uniforms.morphTargetInfluences[i];vertexID=vertexID+1.0;
|
|
241
|
+
#endif
|
|
242
|
+
#ifdef MORPHTARGETS_UV
|
|
243
|
+
uvUpdated=uvUpdated+(readVector3FromRawSampler(i,vertexID).xy-vertexInputs.uv)*uniforms.morphTargetInfluences[i];vertexID=vertexID+1.0;
|
|
244
|
+
#endif
|
|
245
|
+
#ifdef MORPHTARGETS_TANGENT
|
|
246
|
+
tangentUpdated=vec4f(tangentUpdated.xyz+(readVector3FromRawSampler(i,vertexID) -vertexInputs.tangent.xyz)*uniforms.morphTargetInfluences[i],tangentUpdated.a);
|
|
247
|
+
#endif
|
|
248
|
+
}
|
|
249
|
+
#endif
|
|
250
|
+
#else
|
|
251
|
+
positionUpdated=positionUpdated+(vertexInputs.position{X}-vertexInputs.position)*uniforms.morphTargetInfluences[{X}];
|
|
252
|
+
#ifdef MORPHTARGETS_NORMAL
|
|
253
|
+
normalUpdated+=(vertexInputs.normal{X}-vertexInputs.normal)*uniforms.morphTargetInfluences[{X}];
|
|
254
|
+
#endif
|
|
255
|
+
#ifdef MORPHTARGETS_TANGENT
|
|
256
|
+
tangentUpdated=vec4f(tangentUpdated.xyz+(vertexInputs.tangent{X}-vertexInputs.tangent.xyz)*uniforms.morphTargetInfluences[{X}],tangentUpdated.a);
|
|
257
|
+
#endif
|
|
258
|
+
#ifdef MORPHTARGETS_UV
|
|
259
|
+
uvUpdated=uvUpdated+(vertexInputs.uv_{X}-vertexInputs.uv)*uniforms.morphTargetInfluences[{X}];
|
|
260
|
+
#endif
|
|
261
|
+
#endif
|
|
262
|
+
#endif
|
|
263
|
+
`;
|
|
264
|
+
// Sideeffect
|
|
265
|
+
ShaderStore.IncludesShadersStoreWGSL[name$d] = shader$d;
|
|
266
|
+
|
|
267
|
+
// Do not edit.
|
|
268
|
+
const name$c = "instancesVertex";
|
|
269
|
+
const shader$c = `#ifdef INSTANCES
|
|
270
|
+
var finalWorld=mat4x4<f32>(vertexInputs.world0,vertexInputs.world1,vertexInputs.world2,vertexInputs.world3);
|
|
271
|
+
#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || \
|
|
272
|
+
defined(PREPASS_VELOCITY_LINEAR)
|
|
273
|
+
var finalPreviousWorld=mat4x4<f32>(
|
|
274
|
+
vertexInputs.previousWorld0,vertexInputs.previousWorld1,
|
|
275
|
+
vertexInputs.previousWorld2,vertexInputs.previousWorld3);
|
|
276
|
+
#endif
|
|
277
|
+
#ifdef THIN_INSTANCES
|
|
278
|
+
#if !defined(WORLD_UBO)
|
|
279
|
+
finalWorld=uniforms.world*finalWorld;
|
|
280
|
+
#else
|
|
281
|
+
finalWorld=mesh.world*finalWorld;
|
|
282
|
+
#endif
|
|
283
|
+
#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || \
|
|
284
|
+
defined(PREPASS_VELOCITY_LINEAR)
|
|
285
|
+
finalPreviousWorld=uniforms.previousWorld*finalPreviousWorld;
|
|
286
|
+
#endif
|
|
287
|
+
#endif
|
|
288
|
+
#else
|
|
289
|
+
#if !defined(WORLD_UBO)
|
|
290
|
+
var finalWorld=uniforms.world;
|
|
291
|
+
#else
|
|
292
|
+
var finalWorld=mesh.world;
|
|
293
|
+
#endif
|
|
294
|
+
#if defined(PREPASS_VELOCITY) || defined(VELOCITY) || \
|
|
295
|
+
defined(PREPASS_VELOCITY_LINEAR)
|
|
296
|
+
var finalPreviousWorld=uniforms.previousWorld;
|
|
297
|
+
#endif
|
|
298
|
+
#endif
|
|
299
|
+
`;
|
|
300
|
+
// Sideeffect
|
|
301
|
+
ShaderStore.IncludesShadersStoreWGSL[name$c] = shader$c;
|
|
302
|
+
|
|
303
|
+
// Do not edit.
|
|
304
|
+
const name$b = "bonesVertex";
|
|
305
|
+
const shader$b = `#ifndef BAKED_VERTEX_ANIMATION_TEXTURE
|
|
306
|
+
#if NUM_BONE_INFLUENCERS>0
|
|
307
|
+
var influence : mat4x4<f32>;
|
|
308
|
+
#ifdef BONETEXTURE
|
|
309
|
+
influence=readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[0])*vertexInputs.matricesWeights[0];
|
|
310
|
+
#if NUM_BONE_INFLUENCERS>1
|
|
311
|
+
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[1])*vertexInputs.matricesWeights[1];
|
|
312
|
+
#endif
|
|
313
|
+
#if NUM_BONE_INFLUENCERS>2
|
|
314
|
+
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[2])*vertexInputs.matricesWeights[2];
|
|
315
|
+
#endif
|
|
316
|
+
#if NUM_BONE_INFLUENCERS>3
|
|
317
|
+
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndices[3])*vertexInputs.matricesWeights[3];
|
|
318
|
+
#endif
|
|
319
|
+
#if NUM_BONE_INFLUENCERS>4
|
|
320
|
+
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[0])*vertexInputs.matricesWeightsExtra[0];
|
|
321
|
+
#endif
|
|
322
|
+
#if NUM_BONE_INFLUENCERS>5
|
|
323
|
+
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[1])*vertexInputs.matricesWeightsExtra[1];
|
|
324
|
+
#endif
|
|
325
|
+
#if NUM_BONE_INFLUENCERS>6
|
|
326
|
+
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[2])*vertexInputs.matricesWeightsExtra[2];
|
|
327
|
+
#endif
|
|
328
|
+
#if NUM_BONE_INFLUENCERS>7
|
|
329
|
+
influence=influence+readMatrixFromRawSampler(boneSampler,vertexInputs.matricesIndicesExtra[3])*vertexInputs.matricesWeightsExtra[3];
|
|
330
|
+
#endif
|
|
331
|
+
#else
|
|
332
|
+
influence=uniforms.mBones[int(vertexInputs.matricesIndices[0])]*vertexInputs.matricesWeights[0];
|
|
333
|
+
#if NUM_BONE_INFLUENCERS>1
|
|
334
|
+
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[1])]*vertexInputs.matricesWeights[1];
|
|
335
|
+
#endif
|
|
336
|
+
#if NUM_BONE_INFLUENCERS>2
|
|
337
|
+
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[2])]*vertexInputs.matricesWeights[2];
|
|
338
|
+
#endif
|
|
339
|
+
#if NUM_BONE_INFLUENCERS>3
|
|
340
|
+
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndices[3])]*vertexInputs.matricesWeights[3];
|
|
341
|
+
#endif
|
|
342
|
+
#if NUM_BONE_INFLUENCERS>4
|
|
343
|
+
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[0])]*vertexInputs.matricesWeightsExtra[0];
|
|
344
|
+
#endif
|
|
345
|
+
#if NUM_BONE_INFLUENCERS>5
|
|
346
|
+
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[1])]*vertexInputs.matricesWeightsExtra[1];
|
|
347
|
+
#endif
|
|
348
|
+
#if NUM_BONE_INFLUENCERS>6
|
|
349
|
+
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[2])]*vertexInputs.matricesWeightsExtra[2];
|
|
350
|
+
#endif
|
|
351
|
+
#if NUM_BONE_INFLUENCERS>7
|
|
352
|
+
influence=influence+uniforms.mBones[int(vertexInputs.matricesIndicesExtra[3])]*vertexInputs.matricesWeightsExtra[3];
|
|
353
|
+
#endif
|
|
354
|
+
#endif
|
|
355
|
+
finalWorld=finalWorld*influence;
|
|
356
|
+
#endif
|
|
357
|
+
#endif
|
|
358
|
+
`;
|
|
359
|
+
// Sideeffect
|
|
360
|
+
ShaderStore.IncludesShadersStoreWGSL[name$b] = shader$b;
|
|
361
|
+
|
|
362
|
+
// Do not edit.
|
|
363
|
+
const name$a = "bakedVertexAnimation";
|
|
364
|
+
const shader$a = `#ifdef BAKED_VERTEX_ANIMATION_TEXTURE
|
|
365
|
+
{
|
|
366
|
+
#ifdef INSTANCES
|
|
367
|
+
let VATStartFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.x;let VATEndFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.y;let VATOffsetFrame: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.z;let VATSpeed: f32=vertexInputs.bakedVertexAnimationSettingsInstanced.w;
|
|
368
|
+
#else
|
|
369
|
+
let VATStartFrame: f32=uniforms.bakedVertexAnimationSettings.x;let VATEndFrame: f32=uniforms.bakedVertexAnimationSettings.y;let VATOffsetFrame: f32=uniforms.bakedVertexAnimationSettings.z;let VATSpeed: f32=uniforms.bakedVertexAnimationSettings.w;
|
|
370
|
+
#endif
|
|
371
|
+
let totalFrames: f32=VATEndFrame-VATStartFrame+1.0;let time: f32=uniforms.bakedVertexAnimationTime*VATSpeed/totalFrames;let frameCorrection: f32=select(1.0,0.0,time<1.0);let numOfFrames: f32=totalFrames-frameCorrection;var VATFrameNum: f32=fract(time)*numOfFrames;VATFrameNum=(VATFrameNum+VATOffsetFrame) % numOfFrames;VATFrameNum=floor(VATFrameNum);VATFrameNum=VATFrameNum+VATStartFrame+frameCorrection;var VATInfluence : mat4x4<f32>;VATInfluence=readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[0],VATFrameNum)*vertexInputs.matricesWeights[0];
|
|
372
|
+
#if NUM_BONE_INFLUENCERS>1
|
|
373
|
+
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[1],VATFrameNum)*vertexInputs.matricesWeights[1];
|
|
374
|
+
#endif
|
|
375
|
+
#if NUM_BONE_INFLUENCERS>2
|
|
376
|
+
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[2],VATFrameNum)*vertexInputs.matricesWeights[2];
|
|
377
|
+
#endif
|
|
378
|
+
#if NUM_BONE_INFLUENCERS>3
|
|
379
|
+
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndices[3],VATFrameNum)*vertexInputs.matricesWeights[3];
|
|
380
|
+
#endif
|
|
381
|
+
#if NUM_BONE_INFLUENCERS>4
|
|
382
|
+
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[0],VATFrameNum)*vertexInputs.matricesWeightsExtra[0];
|
|
383
|
+
#endif
|
|
384
|
+
#if NUM_BONE_INFLUENCERS>5
|
|
385
|
+
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[1],VATFrameNum)*vertexInputs.matricesWeightsExtra[1];
|
|
386
|
+
#endif
|
|
387
|
+
#if NUM_BONE_INFLUENCERS>6
|
|
388
|
+
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[2],VATFrameNum)*vertexInputs.matricesWeightsExtra[2];
|
|
389
|
+
#endif
|
|
390
|
+
#if NUM_BONE_INFLUENCERS>7
|
|
391
|
+
VATInfluence=VATInfluence+readMatrixFromRawSamplerVAT(bakedVertexAnimationTexture,vertexInputs.matricesIndicesExtra[3],VATFrameNum)*vertexInputs.matricesWeightsExtra[3];
|
|
392
|
+
#endif
|
|
393
|
+
finalWorld=finalWorld*VATInfluence;}
|
|
394
|
+
#endif
|
|
395
|
+
`;
|
|
396
|
+
// Sideeffect
|
|
397
|
+
ShaderStore.IncludesShadersStoreWGSL[name$a] = shader$a;
|
|
398
|
+
|
|
399
|
+
// Do not edit.
|
|
400
|
+
const name$9 = "prePassVertex";
|
|
401
|
+
const shader$9 = `#ifdef PREPASS_DEPTH
|
|
402
|
+
vertexOutputs.vViewPos=(scene.view*worldPos).rgb;
|
|
403
|
+
#endif
|
|
404
|
+
#ifdef PREPASS_LOCAL_POSITION
|
|
405
|
+
vertexOutputs.vPosition=positionUpdated.xyz;
|
|
406
|
+
#endif
|
|
407
|
+
#if defined(PREPASS_VELOCITY) && defined(BONES_VELOCITY_ENABLED) || \
|
|
408
|
+
defined(PREPASS_VELOCITY_LINEAR)
|
|
409
|
+
vertexOutputs.vCurrentPosition=scene.viewProjection*worldPos;
|
|
410
|
+
#if NUM_BONE_INFLUENCERS>0
|
|
411
|
+
var previousInfluence: mat4x4f;previousInfluence=mPreviousBones[ i32(matricesIndices[0])]*matricesWeights[0];
|
|
412
|
+
#if NUM_BONE_INFLUENCERS>1
|
|
413
|
+
previousInfluence+=mPreviousBones[ i32(matricesIndices[1])]*matricesWeights[1];
|
|
414
|
+
#endif
|
|
415
|
+
#if NUM_BONE_INFLUENCERS>2
|
|
416
|
+
previousInfluence+=mPreviousBones[ i32(matricesIndices[2])]*matricesWeights[2];
|
|
417
|
+
#endif
|
|
418
|
+
#if NUM_BONE_INFLUENCERS>3
|
|
419
|
+
previousInfluence+=mPreviousBones[ i32(matricesIndices[3])]*matricesWeights[3];
|
|
420
|
+
#endif
|
|
421
|
+
#if NUM_BONE_INFLUENCERS>4
|
|
422
|
+
previousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[0])]*matricesWeightsExtra[0];
|
|
423
|
+
#endif
|
|
424
|
+
#if NUM_BONE_INFLUENCERS>5
|
|
425
|
+
previousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[1])]*matricesWeightsExtra[1];
|
|
426
|
+
#endif
|
|
427
|
+
#if NUM_BONE_INFLUENCERS>6
|
|
428
|
+
previousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[2])]*matricesWeightsExtra[2];
|
|
429
|
+
#endif
|
|
430
|
+
#if NUM_BONE_INFLUENCERS>7
|
|
431
|
+
previousInfluence+=mPreviousBones[ i32(matricesIndicesExtra[3])]*matricesWeightsExtra[3];
|
|
432
|
+
#endif
|
|
433
|
+
vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld*previousInfluence* vec4f(positionUpdated,1.0);
|
|
434
|
+
#else
|
|
435
|
+
vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);
|
|
436
|
+
#endif
|
|
437
|
+
#endif
|
|
438
|
+
`;
|
|
439
|
+
// Sideeffect
|
|
440
|
+
ShaderStore.IncludesShadersStoreWGSL[name$9] = shader$9;
|
|
441
|
+
|
|
442
|
+
// Do not edit.
|
|
443
|
+
const name$8 = "uvVariableDeclaration";
|
|
444
|
+
const shader$8 = `#ifdef MAINUV{X}
|
|
445
|
+
#if !defined(UV{X})
|
|
446
|
+
var uv{X}: vec2f=vec2f(0.,0.);
|
|
447
|
+
#else
|
|
448
|
+
var uv{X}: vec2f=vertexInputs.uv{X};
|
|
449
|
+
#endif
|
|
450
|
+
vertexOutputs.vMainUV{X}=uv{X};
|
|
451
|
+
#endif
|
|
452
|
+
`;
|
|
453
|
+
// Sideeffect
|
|
454
|
+
ShaderStore.IncludesShadersStoreWGSL[name$8] = shader$8;
|
|
455
|
+
|
|
456
|
+
// Do not edit.
|
|
457
|
+
const name$7 = "samplerVertexImplementation";
|
|
458
|
+
const shader$7 = `#if defined(_DEFINENAME_) && _DEFINENAME_DIRECTUV==0
|
|
459
|
+
if (uniforms.v_INFONAME_==0.)
|
|
460
|
+
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(uvUpdated,1.0,0.0)).xy;}
|
|
461
|
+
#ifdef UV2
|
|
462
|
+
else if (uniforms.v_INFONAME_==1.)
|
|
463
|
+
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv2,1.0,0.0)).xy;}
|
|
464
|
+
#endif
|
|
465
|
+
#ifdef UV3
|
|
466
|
+
else if (uniforms.v_INFONAME_==2.)
|
|
467
|
+
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv3,1.0,0.0)).xy;}
|
|
468
|
+
#endif
|
|
469
|
+
#ifdef UV4
|
|
470
|
+
else if (uniforms.v_INFONAME_==3.)
|
|
471
|
+
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv4,1.0,0.0)).xy;}
|
|
472
|
+
#endif
|
|
473
|
+
#ifdef UV5
|
|
474
|
+
else if (uniforms.v_INFONAME_==4.)
|
|
475
|
+
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv5,1.0,0.0)).xy;}
|
|
476
|
+
#endif
|
|
477
|
+
#ifdef UV6
|
|
478
|
+
else if (uniforms.v_INFONAME_==5.)
|
|
479
|
+
{vertexOutputs.v_VARYINGNAME_UV= (uniforms._MATRIXNAME_Matrix* vec4f(vertexInputs.uv6,1.0,0.0)).xy;}
|
|
480
|
+
#endif
|
|
481
|
+
#endif
|
|
482
|
+
`;
|
|
483
|
+
// Sideeffect
|
|
484
|
+
ShaderStore.IncludesShadersStoreWGSL[name$7] = shader$7;
|
|
485
|
+
|
|
486
|
+
// Do not edit.
|
|
487
|
+
const name$6 = "bumpVertex";
|
|
488
|
+
const shader$6 = `#if defined(BUMP) || defined(PARALLAX) || defined(CLEARCOAT_BUMP) || defined(ANISOTROPIC)
|
|
489
|
+
#if defined(TANGENT) && defined(NORMAL)
|
|
490
|
+
var tbnNormal: vec3f=normalize(normalUpdated);var tbnTangent: vec3f=normalize(tangentUpdated.xyz);var tbnBitangent: vec3f=cross(tbnNormal,tbnTangent)*tangentUpdated.w;var matTemp= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz)* mat3x3f(tbnTangent,tbnBitangent,tbnNormal);vertexOutputs.vTBN0=matTemp[0];vertexOutputs.vTBN1=matTemp[1];vertexOutputs.vTBN2=matTemp[2];
|
|
491
|
+
#endif
|
|
492
|
+
#endif
|
|
493
|
+
`;
|
|
494
|
+
// Sideeffect
|
|
495
|
+
ShaderStore.IncludesShadersStoreWGSL[name$6] = shader$6;
|
|
496
|
+
|
|
497
|
+
// Do not edit.
|
|
498
|
+
const name$5 = "clipPlaneVertex";
|
|
499
|
+
const shader$5 = `#ifdef CLIPPLANE
|
|
500
|
+
vertexOutputs.fClipDistance=dot(worldPos,uniforms.vClipPlane);
|
|
501
|
+
#endif
|
|
502
|
+
#ifdef CLIPPLANE2
|
|
503
|
+
vertexOutputs.fClipDistance2=dot(worldPos,uniforms.vClipPlane2);
|
|
504
|
+
#endif
|
|
505
|
+
#ifdef CLIPPLANE3
|
|
506
|
+
vertexOutputs.fClipDistance3=dot(worldPos,uniforms.vClipPlane3);
|
|
507
|
+
#endif
|
|
508
|
+
#ifdef CLIPPLANE4
|
|
509
|
+
vertexOutputs.fClipDistance4=dot(worldPos,uniforms.vClipPlane4);
|
|
510
|
+
#endif
|
|
511
|
+
#ifdef CLIPPLANE5
|
|
512
|
+
vertexOutputs.fClipDistance5=dot(worldPos,uniforms.vClipPlane5);
|
|
513
|
+
#endif
|
|
514
|
+
#ifdef CLIPPLANE6
|
|
515
|
+
vertexOutputs.fClipDistance6=dot(worldPos,uniforms.vClipPlane6);
|
|
516
|
+
#endif
|
|
517
|
+
`;
|
|
518
|
+
// Sideeffect
|
|
519
|
+
ShaderStore.IncludesShadersStoreWGSL[name$5] = shader$5;
|
|
520
|
+
|
|
521
|
+
// Do not edit.
|
|
522
|
+
const name$4 = "fogVertex";
|
|
523
|
+
const shader$4 = `#ifdef FOG
|
|
524
|
+
vertexOutputs.vFogDistance=(scene.view*worldPos).xyz;
|
|
525
|
+
#endif
|
|
526
|
+
`;
|
|
527
|
+
// Sideeffect
|
|
528
|
+
ShaderStore.IncludesShadersStoreWGSL[name$4] = shader$4;
|
|
529
|
+
|
|
530
|
+
// Do not edit.
|
|
531
|
+
const name$3 = "shadowsVertex";
|
|
532
|
+
const shader$3 = `#ifdef SHADOWS
|
|
533
|
+
#if defined(SHADOWCSM{X})
|
|
534
|
+
vertexOutputs.vPositionFromCamera{X}=scene.view*worldPos;
|
|
535
|
+
#if SHADOWCSMNUM_CASCADES{X}>0
|
|
536
|
+
vertexOutputs.vPositionFromLight{X}_0=uniforms.lightMatrix{X}[0]*worldPos;
|
|
537
|
+
#ifdef USE_REVERSE_DEPTHBUFFER
|
|
538
|
+
vertexOutputs.vDepthMetric{X}_0=(-vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;
|
|
539
|
+
#else
|
|
540
|
+
vertexOutputs.vDepthMetric{X}_0= (vertexOutputs.vPositionFromLight{X}_0.z+light{X}.depthValues.x)/light{X}.depthValues.y;
|
|
541
|
+
#endif
|
|
542
|
+
#endif
|
|
543
|
+
#if SHADOWCSMNUM_CASCADES{X}>1
|
|
544
|
+
vertexOutputs.vPositionFromLight{X}_1=uniforms.lightMatrix{X}[1]*worldPos;
|
|
545
|
+
#ifdef USE_REVERSE_DEPTHBUFFER
|
|
546
|
+
vertexOutputs.vDepthMetric{X}_1=(-vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;
|
|
547
|
+
#else
|
|
548
|
+
vertexOutputs.vDepthMetric{X}_1= (vertexOutputs.vPositionFromLight{X}_1.z+light{X}.depthValues.x)/light{X}.depthValues.y;
|
|
549
|
+
#endif
|
|
550
|
+
#endif
|
|
551
|
+
#if SHADOWCSMNUM_CASCADES{X}>2
|
|
552
|
+
vertexOutputs.vPositionFromLight{X}_2=uniforms.lightMatrix{X}[2]*worldPos;
|
|
553
|
+
#ifdef USE_REVERSE_DEPTHBUFFER
|
|
554
|
+
vertexOutputs.vDepthMetric{X}_2=(-vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;
|
|
555
|
+
#else
|
|
556
|
+
vertexOutputs.vDepthMetric{X}_2= (vertexOutputs.vPositionFromLight{X}_2.z+light{X}.depthValues.x)/light{X}.depthValues.y;
|
|
557
|
+
#endif
|
|
558
|
+
#endif
|
|
559
|
+
#if SHADOWCSMNUM_CASCADES{X}>3
|
|
560
|
+
vertexOutputs.vPositionFromLight{X}_3=uniforms.lightMatrix{X}[3]*worldPos;
|
|
561
|
+
#ifdef USE_REVERSE_DEPTHBUFFER
|
|
562
|
+
vertexOutputs.vDepthMetric{X}_3=(-vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;
|
|
563
|
+
#else
|
|
564
|
+
vertexOutputs.vDepthMetric{X}_3= (vertexOutputs.vPositionFromLight{X}_3.z+light{X}.depthValues.x)/light{X}.depthValues.y;
|
|
565
|
+
#endif
|
|
566
|
+
#endif
|
|
567
|
+
#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})
|
|
568
|
+
vertexOutputs.vPositionFromLight{X}=uniforms.lightMatrix{X}*worldPos;
|
|
569
|
+
#ifdef USE_REVERSE_DEPTHBUFFER
|
|
570
|
+
vertexOutputs.vDepthMetric{X}=(-vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
|
|
571
|
+
#else
|
|
572
|
+
vertexOutputs.vDepthMetric{X}=(vertexOutputs.vPositionFromLight{X}.z+light{X}.depthValues.x)/light{X}.depthValues.y;
|
|
573
|
+
#endif
|
|
574
|
+
#endif
|
|
575
|
+
#endif
|
|
576
|
+
`;
|
|
577
|
+
// Sideeffect
|
|
578
|
+
ShaderStore.IncludesShadersStoreWGSL[name$3] = shader$3;
|
|
579
|
+
|
|
580
|
+
// Do not edit.
|
|
581
|
+
const name$2 = "vertexColorMixing";
|
|
582
|
+
const shader$2 = `#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
|
|
583
|
+
vertexOutputs.vColor=vec4f(1.0);
|
|
584
|
+
#ifdef VERTEXCOLOR
|
|
585
|
+
#ifdef VERTEXALPHA
|
|
586
|
+
vertexOutputs.vColor*=vertexInputs.color;
|
|
587
|
+
#else
|
|
588
|
+
vertexOutputs.vColor=vec4f(vertexOutputs.vColor.rgb*vertexInputs.color.rgb,vertexOutputs.vColor.a);
|
|
589
|
+
#endif
|
|
590
|
+
#endif
|
|
591
|
+
#ifdef INSTANCESCOLOR
|
|
592
|
+
vertexOutputs.vColor*=vertexInputs.instanceColor;
|
|
593
|
+
#endif
|
|
594
|
+
#endif
|
|
595
|
+
`;
|
|
596
|
+
// Sideeffect
|
|
597
|
+
ShaderStore.IncludesShadersStoreWGSL[name$2] = shader$2;
|
|
598
|
+
|
|
599
|
+
// Do not edit.
|
|
600
|
+
const name$1 = "logDepthVertex";
|
|
601
|
+
const shader$1 = `#ifdef LOGARITHMICDEPTH
|
|
602
|
+
vertexOutputs.vFragmentDepth=1.0+vertexOutputs.position.w;vertexOutputs.position.z=log2(max(0.000001,vertexOutputs.vFragmentDepth))*uniforms.logarithmicDepthConstant;
|
|
603
|
+
#endif
|
|
604
|
+
`;
|
|
605
|
+
// Sideeffect
|
|
606
|
+
ShaderStore.IncludesShadersStoreWGSL[name$1] = shader$1;
|
|
607
|
+
|
|
608
|
+
// Do not edit.
|
|
609
|
+
const name = "pbrVertexShader";
|
|
610
|
+
const shader = `#include<pbrUboDeclaration>
|
|
611
|
+
#define CUSTOM_VERTEX_BEGIN
|
|
612
|
+
attribute position: vec3f;
|
|
613
|
+
#ifdef NORMAL
|
|
614
|
+
attribute normal: vec3f;
|
|
615
|
+
#endif
|
|
616
|
+
#ifdef TANGENT
|
|
617
|
+
attribute tangent: vec4f;
|
|
618
|
+
#endif
|
|
619
|
+
#ifdef UV1
|
|
620
|
+
attribute uv: vec2f;
|
|
621
|
+
#endif
|
|
622
|
+
#include<uvAttributeDeclaration>[2..7]
|
|
623
|
+
#include<mainUVVaryingDeclaration>[1..7]
|
|
624
|
+
#ifdef VERTEXCOLOR
|
|
625
|
+
attribute color: vec4f;
|
|
626
|
+
#endif
|
|
627
|
+
#include<helperFunctions>
|
|
628
|
+
#include<bonesDeclaration>
|
|
629
|
+
#include<bakedVertexAnimationDeclaration>
|
|
630
|
+
#include<instancesDeclaration>
|
|
631
|
+
#include<prePassVertexDeclaration>
|
|
632
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo)
|
|
633
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail)
|
|
634
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient)
|
|
635
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity)
|
|
636
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive)
|
|
637
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap)
|
|
638
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity)
|
|
639
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler)
|
|
640
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance)
|
|
641
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance)
|
|
642
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump)
|
|
643
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal)
|
|
644
|
+
#ifdef CLEARCOAT
|
|
645
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat)
|
|
646
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness)
|
|
647
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump)
|
|
648
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint)
|
|
649
|
+
#endif
|
|
650
|
+
#ifdef IRIDESCENCE
|
|
651
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence)
|
|
652
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness)
|
|
653
|
+
#endif
|
|
654
|
+
#ifdef SHEEN
|
|
655
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen)
|
|
656
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness)
|
|
657
|
+
#endif
|
|
658
|
+
#ifdef ANISOTROPIC
|
|
659
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy)
|
|
660
|
+
#endif
|
|
661
|
+
#ifdef SUBSURFACE
|
|
662
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness)
|
|
663
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity)
|
|
664
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity)
|
|
665
|
+
#include<samplerVertexDeclaration>(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor)
|
|
666
|
+
#endif
|
|
667
|
+
varying vPositionW: vec3f;
|
|
668
|
+
#if DEBUGMODE>0
|
|
669
|
+
varying vClipSpacePosition: vec4f;
|
|
670
|
+
#endif
|
|
671
|
+
#ifdef NORMAL
|
|
672
|
+
varying vNormalW: vec3f;
|
|
673
|
+
#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
|
|
674
|
+
varying vEnvironmentIrradiance: vec3f;
|
|
675
|
+
#include<harmonicsFunctions>
|
|
676
|
+
#endif
|
|
677
|
+
#endif
|
|
678
|
+
#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)
|
|
679
|
+
varying vColor: vec4f;
|
|
680
|
+
#endif
|
|
681
|
+
#include<bumpVertexDeclaration>
|
|
682
|
+
#include<clipPlaneVertexDeclaration>
|
|
683
|
+
#include<fogVertexDeclaration>
|
|
684
|
+
#include<lightVxUboDeclaration>[0..maxSimultaneousLights]
|
|
685
|
+
#include<morphTargetsVertexGlobalDeclaration>
|
|
686
|
+
#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
|
|
687
|
+
#ifdef REFLECTIONMAP_SKYBOX
|
|
688
|
+
varying vPositionUVW: vec3f;
|
|
689
|
+
#endif
|
|
690
|
+
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
|
|
691
|
+
varying vDirectionW: vec3f;
|
|
692
|
+
#endif
|
|
693
|
+
#include<logDepthDeclaration>
|
|
694
|
+
#define CUSTOM_VERTEX_DEFINITIONS
|
|
695
|
+
@vertex
|
|
696
|
+
fn main(input : VertexInputs)->FragmentInputs {
|
|
697
|
+
#define CUSTOM_VERTEX_MAIN_BEGIN
|
|
698
|
+
var positionUpdated: vec3f=vertexInputs.position;
|
|
699
|
+
#ifdef NORMAL
|
|
700
|
+
var normalUpdated: vec3f=vertexInputs.normal;
|
|
701
|
+
#endif
|
|
702
|
+
#ifdef TANGENT
|
|
703
|
+
var tangentUpdated: vec4f=vertexInputs.tangent;
|
|
704
|
+
#endif
|
|
705
|
+
#ifdef UV1
|
|
706
|
+
var uvUpdated: vec2f=vertexInputs.uv;
|
|
707
|
+
#endif
|
|
708
|
+
#include<morphTargetsVertexGlobal>
|
|
709
|
+
#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
|
|
710
|
+
#ifdef REFLECTIONMAP_SKYBOX
|
|
711
|
+
vertexOutputs.vPositionUVW=positionUpdated;
|
|
712
|
+
#endif
|
|
713
|
+
#define CUSTOM_VERTEX_UPDATE_POSITION
|
|
714
|
+
#define CUSTOM_VERTEX_UPDATE_NORMAL
|
|
715
|
+
#include<instancesVertex>
|
|
716
|
+
#if defined(PREPASS) && (defined(PREPASS_VELOCITY) && !defined(BONES_VELOCITY_ENABLED) || defined(PREPASS_VELOCITY_LINEAR))
|
|
717
|
+
vertexOutputs.vCurrentPosition=scene.viewProjection*finalWorld* vec4f(positionUpdated,1.0);vertexOutputs.vPreviousPosition=uniforms.previousViewProjection*finalPreviousWorld* vec4f(positionUpdated,1.0);
|
|
718
|
+
#endif
|
|
719
|
+
#include<bonesVertex>
|
|
720
|
+
#include<bakedVertexAnimation>
|
|
721
|
+
var worldPos: vec4f=finalWorld* vec4f(positionUpdated,1.0);vertexOutputs.vPositionW= worldPos.xyz;
|
|
722
|
+
#include<prePassVertex>
|
|
723
|
+
#ifdef NORMAL
|
|
724
|
+
var normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);
|
|
725
|
+
#if defined(INSTANCES) && defined(THIN_INSTANCES)
|
|
726
|
+
vertexOutputs.vNormalW=normalUpdated/ vec3f(dot(normalWorld[0],normalWorld[0]),dot(normalWorld[1],normalWorld[1]),dot(normalWorld[2],normalWorld[2]));vertexOutputs.vNormalW=normalize(normalWorld*vertexOutputs.vNormalW);
|
|
727
|
+
#else
|
|
728
|
+
#ifdef NONUNIFORMSCALING
|
|
729
|
+
normalWorld=transposeMat3(inverseMat3(normalWorld));
|
|
730
|
+
#endif
|
|
731
|
+
vertexOutputs.vNormalW=normalize(normalWorld*normalUpdated);
|
|
732
|
+
#endif
|
|
733
|
+
#if defined(USESPHERICALFROMREFLECTIONMAP) && defined(USESPHERICALINVERTEX)
|
|
734
|
+
var reflectionVector: vec3f= (uniforms.reflectionMatrix* vec4f(vertexOutputs.vNormalW,0)).xyz;
|
|
735
|
+
#ifdef REFLECTIONMAP_OPPOSITEZ
|
|
736
|
+
reflectionVector.z*=-1.0;
|
|
737
|
+
#endif
|
|
738
|
+
vertexOutputs.vEnvironmentIrradiance=computeEnvironmentIrradiance(reflectionVector);
|
|
739
|
+
#endif
|
|
740
|
+
#endif
|
|
741
|
+
#define CUSTOM_VERTEX_UPDATE_WORLDPOS
|
|
742
|
+
#ifdef MULTIVIEW
|
|
743
|
+
if (gl_ViewID_OVR==0u) {vertexOutputs.position=scene.viewProjection*worldPos;} else {vertexOutputs.position=scene.viewProjectionR*worldPos;}
|
|
744
|
+
#else
|
|
745
|
+
vertexOutputs.position=scene.viewProjection*worldPos;
|
|
746
|
+
#endif
|
|
747
|
+
#if DEBUGMODE>0
|
|
748
|
+
vertexOutputs.vClipSpacePosition=vertexOutputs.position;
|
|
749
|
+
#endif
|
|
750
|
+
#if defined(REFLECTIONMAP_EQUIRECTANGULAR_FIXED) || defined(REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED)
|
|
751
|
+
vertexOutputs.vDirectionW=normalize((finalWorld*vec4f(positionUpdated,0.0)).xyz);
|
|
752
|
+
#endif
|
|
753
|
+
#ifndef UV1
|
|
754
|
+
var uvUpdated: vec2f= vec2f(0.,0.);
|
|
755
|
+
#endif
|
|
756
|
+
#ifdef MAINUV1
|
|
757
|
+
vertexOutputs.vMainUV1=uvUpdated;
|
|
758
|
+
#endif
|
|
759
|
+
#include<uvVariableDeclaration>[2..7]
|
|
760
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,ALBEDO,_VARYINGNAME_,Albedo,_MATRIXNAME_,albedo,_INFONAME_,AlbedoInfos.x)
|
|
761
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,DETAIL,_VARYINGNAME_,Detail,_MATRIXNAME_,detail,_INFONAME_,DetailInfos.x)
|
|
762
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,AMBIENT,_VARYINGNAME_,Ambient,_MATRIXNAME_,ambient,_INFONAME_,AmbientInfos.x)
|
|
763
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,OPACITY,_VARYINGNAME_,Opacity,_MATRIXNAME_,opacity,_INFONAME_,OpacityInfos.x)
|
|
764
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,EMISSIVE,_VARYINGNAME_,Emissive,_MATRIXNAME_,emissive,_INFONAME_,EmissiveInfos.x)
|
|
765
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,LIGHTMAP,_VARYINGNAME_,Lightmap,_MATRIXNAME_,lightmap,_INFONAME_,LightmapInfos.x)
|
|
766
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,REFLECTIVITY,_VARYINGNAME_,Reflectivity,_MATRIXNAME_,reflectivity,_INFONAME_,ReflectivityInfos.x)
|
|
767
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,MICROSURFACEMAP,_VARYINGNAME_,MicroSurfaceSampler,_MATRIXNAME_,microSurfaceSampler,_INFONAME_,MicroSurfaceSamplerInfos.x)
|
|
768
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,METALLIC_REFLECTANCE,_VARYINGNAME_,MetallicReflectance,_MATRIXNAME_,metallicReflectance,_INFONAME_,MetallicReflectanceInfos.x)
|
|
769
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,REFLECTANCE,_VARYINGNAME_,Reflectance,_MATRIXNAME_,reflectance,_INFONAME_,ReflectanceInfos.x)
|
|
770
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,BUMP,_VARYINGNAME_,Bump,_MATRIXNAME_,bump,_INFONAME_,BumpInfos.x)
|
|
771
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,DECAL,_VARYINGNAME_,Decal,_MATRIXNAME_,decal,_INFONAME_,DecalInfos.x)
|
|
772
|
+
#ifdef CLEARCOAT
|
|
773
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TEXTURE,_VARYINGNAME_,ClearCoat,_MATRIXNAME_,clearCoat,_INFONAME_,ClearCoatInfos.x)
|
|
774
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TEXTURE_ROUGHNESS,_VARYINGNAME_,ClearCoatRoughness,_MATRIXNAME_,clearCoatRoughness,_INFONAME_,ClearCoatInfos.z)
|
|
775
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_BUMP,_VARYINGNAME_,ClearCoatBump,_MATRIXNAME_,clearCoatBump,_INFONAME_,ClearCoatBumpInfos.x)
|
|
776
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,CLEARCOAT_TINT_TEXTURE,_VARYINGNAME_,ClearCoatTint,_MATRIXNAME_,clearCoatTint,_INFONAME_,ClearCoatTintInfos.x)
|
|
777
|
+
#endif
|
|
778
|
+
#ifdef IRIDESCENCE
|
|
779
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,IRIDESCENCE_TEXTURE,_VARYINGNAME_,Iridescence,_MATRIXNAME_,iridescence,_INFONAME_,IridescenceInfos.x)
|
|
780
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,IRIDESCENCE_THICKNESS_TEXTURE,_VARYINGNAME_,IridescenceThickness,_MATRIXNAME_,iridescenceThickness,_INFONAME_,IridescenceInfos.z)
|
|
781
|
+
#endif
|
|
782
|
+
#ifdef SHEEN
|
|
783
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,SHEEN_TEXTURE,_VARYINGNAME_,Sheen,_MATRIXNAME_,sheen,_INFONAME_,SheenInfos.x)
|
|
784
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,SHEEN_TEXTURE_ROUGHNESS,_VARYINGNAME_,SheenRoughness,_MATRIXNAME_,sheenRoughness,_INFONAME_,SheenInfos.z)
|
|
785
|
+
#endif
|
|
786
|
+
#ifdef ANISOTROPIC
|
|
787
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,ANISOTROPIC_TEXTURE,_VARYINGNAME_,Anisotropy,_MATRIXNAME_,anisotropy,_INFONAME_,AnisotropyInfos.x)
|
|
788
|
+
#endif
|
|
789
|
+
#ifdef SUBSURFACE
|
|
790
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,SS_THICKNESSANDMASK_TEXTURE,_VARYINGNAME_,Thickness,_MATRIXNAME_,thickness,_INFONAME_,ThicknessInfos.x)
|
|
791
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,SS_REFRACTIONINTENSITY_TEXTURE,_VARYINGNAME_,RefractionIntensity,_MATRIXNAME_,refractionIntensity,_INFONAME_,RefractionIntensityInfos.x)
|
|
792
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,SS_TRANSLUCENCYINTENSITY_TEXTURE,_VARYINGNAME_,TranslucencyIntensity,_MATRIXNAME_,translucencyIntensity,_INFONAME_,TranslucencyIntensityInfos.x)
|
|
793
|
+
#include<samplerVertexImplementation>(_DEFINENAME_,SS_TRANSLUCENCYCOLOR_TEXTURE,_VARYINGNAME_,TranslucencyColor,_MATRIXNAME_,translucencyColor,_INFONAME_,TranslucencyColorInfos.x)
|
|
794
|
+
#endif
|
|
795
|
+
#include<bumpVertex>
|
|
796
|
+
#include<clipPlaneVertex>
|
|
797
|
+
#include<fogVertex>
|
|
798
|
+
#include<shadowsVertex>[0..maxSimultaneousLights]
|
|
799
|
+
#include<vertexColorMixing>
|
|
800
|
+
#include<logDepthVertex>
|
|
801
|
+
#define CUSTOM_VERTEX_MAIN_END
|
|
802
|
+
}`;
|
|
803
|
+
// Sideeffect
|
|
804
|
+
ShaderStore.ShadersStoreWGSL[name] = shader;
|
|
805
|
+
/** @internal */
|
|
806
|
+
const pbrVertexShaderWGSL = { name, shader };
|
|
807
|
+
|
|
808
|
+
export { pbrVertexShaderWGSL };
|
|
809
|
+
//# sourceMappingURL=pbr.vertex-Cp4yABqq.esm.js.map
|