@babylonjs/materials 9.7.0 → 9.8.0
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/cell/cell.fragment.d.ts +0 -14
- package/cell/cell.fragment.js +20 -14
- package/cell/cell.fragment.js.map +1 -1
- package/cell/cell.vertex.d.ts +0 -16
- package/cell/cell.vertex.js +22 -16
- package/cell/cell.vertex.js.map +1 -1
- package/cell/wgsl/cell.fragment.d.ts +0 -13
- package/cell/wgsl/cell.fragment.js +19 -13
- package/cell/wgsl/cell.fragment.js.map +1 -1
- package/cell/wgsl/cell.vertex.d.ts +0 -16
- package/cell/wgsl/cell.vertex.js +22 -16
- package/cell/wgsl/cell.vertex.js.map +1 -1
- package/fire/fire.fragment.d.ts +0 -8
- package/fire/fire.fragment.js +14 -8
- package/fire/fire.fragment.js.map +1 -1
- package/fire/fire.vertex.d.ts +0 -13
- package/fire/fire.vertex.js +19 -13
- package/fire/fire.vertex.js.map +1 -1
- package/fire/wgsl/fire.fragment.d.ts +0 -8
- package/fire/wgsl/fire.fragment.js +14 -8
- package/fire/wgsl/fire.fragment.js.map +1 -1
- package/fire/wgsl/fire.vertex.d.ts +0 -13
- package/fire/wgsl/fire.vertex.js +19 -13
- package/fire/wgsl/fire.vertex.js.map +1 -1
- package/fur/fur.fragment.d.ts +0 -14
- package/fur/fur.fragment.js +20 -14
- package/fur/fur.fragment.js.map +1 -1
- package/fur/fur.vertex.d.ts +0 -16
- package/fur/fur.vertex.js +22 -16
- package/fur/fur.vertex.js.map +1 -1
- package/fur/wgsl/fur.fragment.d.ts +0 -13
- package/fur/wgsl/fur.fragment.js +19 -13
- package/fur/wgsl/fur.fragment.js.map +1 -1
- package/fur/wgsl/fur.vertex.d.ts +0 -16
- package/fur/wgsl/fur.vertex.js +22 -16
- package/fur/wgsl/fur.vertex.js.map +1 -1
- package/gradient/gradient.fragment.d.ts +0 -14
- package/gradient/gradient.fragment.js +20 -14
- package/gradient/gradient.fragment.js.map +1 -1
- package/gradient/gradient.vertex.d.ts +0 -16
- package/gradient/gradient.vertex.js +22 -16
- package/gradient/gradient.vertex.js.map +1 -1
- package/gradient/wgsl/gradient.fragment.d.ts +0 -13
- package/gradient/wgsl/gradient.fragment.js +19 -13
- package/gradient/wgsl/gradient.fragment.js.map +1 -1
- package/gradient/wgsl/gradient.vertex.d.ts +0 -16
- package/gradient/wgsl/gradient.vertex.js +22 -16
- package/gradient/wgsl/gradient.vertex.js.map +1 -1
- package/grid/grid.fragment.d.ts +0 -7
- package/grid/grid.fragment.js +13 -7
- package/grid/grid.fragment.js.map +1 -1
- package/grid/grid.vertex.d.ts +0 -10
- package/grid/grid.vertex.js +16 -10
- package/grid/grid.vertex.js.map +1 -1
- package/grid/wgsl/grid.fragment.d.ts +0 -7
- package/grid/wgsl/grid.fragment.js +13 -7
- package/grid/wgsl/grid.fragment.js.map +1 -1
- package/grid/wgsl/grid.vertex.d.ts +0 -9
- package/grid/wgsl/grid.vertex.js +15 -9
- package/grid/wgsl/grid.vertex.js.map +1 -1
- package/lava/lava.fragment.d.ts +0 -14
- package/lava/lava.fragment.js +20 -14
- package/lava/lava.fragment.js.map +1 -1
- package/lava/lava.vertex.d.ts +0 -16
- package/lava/lava.vertex.js +22 -16
- package/lava/lava.vertex.js.map +1 -1
- package/lava/wgsl/lava.fragment.d.ts +0 -13
- package/lava/wgsl/lava.fragment.js +19 -13
- package/lava/wgsl/lava.fragment.js.map +1 -1
- package/lava/wgsl/lava.vertex.d.ts +0 -16
- package/lava/wgsl/lava.vertex.js +22 -16
- package/lava/wgsl/lava.vertex.js.map +1 -1
- package/mix/mix.fragment.d.ts +0 -14
- package/mix/mix.fragment.js +20 -14
- package/mix/mix.fragment.js.map +1 -1
- package/mix/mix.vertex.d.ts +0 -16
- package/mix/mix.vertex.js +22 -16
- package/mix/mix.vertex.js.map +1 -1
- package/mix/wgsl/mix.fragment.d.ts +0 -13
- package/mix/wgsl/mix.fragment.js +19 -13
- package/mix/wgsl/mix.fragment.js.map +1 -1
- package/mix/wgsl/mix.vertex.d.ts +0 -16
- package/mix/wgsl/mix.vertex.js +22 -16
- package/mix/wgsl/mix.vertex.js.map +1 -1
- package/normal/normal.fragment.d.ts +0 -14
- package/normal/normal.fragment.js +20 -14
- package/normal/normal.fragment.js.map +1 -1
- package/normal/normal.vertex.d.ts +0 -15
- package/normal/normal.vertex.js +21 -15
- package/normal/normal.vertex.js.map +1 -1
- package/normal/wgsl/normal.fragment.d.ts +0 -13
- package/normal/wgsl/normal.fragment.js +19 -13
- package/normal/wgsl/normal.fragment.js.map +1 -1
- package/normal/wgsl/normal.vertex.d.ts +0 -15
- package/normal/wgsl/normal.vertex.js +21 -15
- package/normal/wgsl/normal.vertex.js.map +1 -1
- package/package.json +2 -2
- package/shadowOnly/shadowOnly.fragment.d.ts +0 -15
- package/shadowOnly/shadowOnly.fragment.js +21 -15
- package/shadowOnly/shadowOnly.fragment.js.map +1 -1
- package/shadowOnly/shadowOnly.vertex.d.ts +0 -17
- package/shadowOnly/shadowOnly.vertex.js +23 -17
- package/shadowOnly/shadowOnly.vertex.js.map +1 -1
- package/shadowOnly/wgsl/shadowOnly.fragment.d.ts +0 -12
- package/shadowOnly/wgsl/shadowOnly.fragment.js +18 -12
- package/shadowOnly/wgsl/shadowOnly.fragment.js.map +1 -1
- package/shadowOnly/wgsl/shadowOnly.vertex.d.ts +0 -16
- package/shadowOnly/wgsl/shadowOnly.vertex.js +22 -16
- package/shadowOnly/wgsl/shadowOnly.vertex.js.map +1 -1
- package/simple/simple.fragment.d.ts +0 -14
- package/simple/simple.fragment.js +20 -14
- package/simple/simple.fragment.js.map +1 -1
- package/simple/simple.vertex.d.ts +0 -16
- package/simple/simple.vertex.js +22 -16
- package/simple/simple.vertex.js.map +1 -1
- package/simple/wgsl/simple.fragment.d.ts +0 -13
- package/simple/wgsl/simple.fragment.js +19 -13
- package/simple/wgsl/simple.fragment.js.map +1 -1
- package/simple/wgsl/simple.vertex.d.ts +0 -16
- package/simple/wgsl/simple.vertex.js +22 -16
- package/simple/wgsl/simple.vertex.js.map +1 -1
- package/sky/sky.fragment.d.ts +0 -8
- package/sky/sky.fragment.js +14 -8
- package/sky/sky.fragment.js.map +1 -1
- package/sky/sky.vertex.d.ts +0 -6
- package/sky/sky.vertex.js +12 -6
- package/sky/sky.vertex.js.map +1 -1
- package/sky/wgsl/sky.fragment.d.ts +0 -8
- package/sky/wgsl/sky.fragment.js +14 -8
- package/sky/wgsl/sky.fragment.js.map +1 -1
- package/sky/wgsl/sky.vertex.d.ts +0 -6
- package/sky/wgsl/sky.vertex.js +12 -6
- package/sky/wgsl/sky.vertex.js.map +1 -1
- package/terrain/terrain.fragment.d.ts +0 -14
- package/terrain/terrain.fragment.js +20 -14
- package/terrain/terrain.fragment.js.map +1 -1
- package/terrain/terrain.vertex.d.ts +0 -16
- package/terrain/terrain.vertex.js +22 -16
- package/terrain/terrain.vertex.js.map +1 -1
- package/terrain/wgsl/terrain.fragment.d.ts +0 -13
- package/terrain/wgsl/terrain.fragment.js +19 -13
- package/terrain/wgsl/terrain.fragment.js.map +1 -1
- package/terrain/wgsl/terrain.vertex.d.ts +0 -16
- package/terrain/wgsl/terrain.vertex.js +22 -16
- package/terrain/wgsl/terrain.vertex.js.map +1 -1
- package/triPlanar/triplanar.fragment.d.ts +0 -14
- package/triPlanar/triplanar.fragment.js +20 -14
- package/triPlanar/triplanar.fragment.js.map +1 -1
- package/triPlanar/triplanar.vertex.d.ts +0 -17
- package/triPlanar/triplanar.vertex.js +23 -17
- package/triPlanar/triplanar.vertex.js.map +1 -1
- package/triPlanar/wgsl/triplanar.fragment.d.ts +0 -13
- package/triPlanar/wgsl/triplanar.fragment.js +19 -13
- package/triPlanar/wgsl/triplanar.fragment.js.map +1 -1
- package/triPlanar/wgsl/triplanar.vertex.d.ts +0 -17
- package/triPlanar/wgsl/triplanar.vertex.js +23 -17
- package/triPlanar/wgsl/triplanar.vertex.js.map +1 -1
- package/water/water.fragment.d.ts +0 -14
- package/water/water.fragment.js +20 -14
- package/water/water.fragment.js.map +1 -1
- package/water/water.vertex.d.ts +0 -16
- package/water/water.vertex.js +22 -16
- package/water/water.vertex.js.map +1 -1
- package/water/wgsl/water.fragment.d.ts +0 -13
- package/water/wgsl/water.fragment.js +19 -13
- package/water/wgsl/water.fragment.js.map +1 -1
- package/water/wgsl/water.vertex.d.ts +0 -16
- package/water/wgsl/water.vertex.js +22 -16
- package/water/wgsl/water.vertex.js.map +1 -1
package/sky/sky.vertex.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Do not edit.
|
|
2
2
|
import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
|
|
3
|
-
import "@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js";
|
|
4
|
-
import "@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js";
|
|
5
|
-
import "@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js";
|
|
6
|
-
import "@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js";
|
|
7
|
-
import "@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js";
|
|
8
|
-
import "@babylonjs/core/Shaders/ShadersInclude/fogVertex.js";
|
|
3
|
+
import { logDepthDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js";
|
|
4
|
+
import { clipPlaneVertexDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js";
|
|
5
|
+
import { fogVertexDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js";
|
|
6
|
+
import { clipPlaneVertex } from "@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js";
|
|
7
|
+
import { logDepthVertex } from "@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js";
|
|
8
|
+
import { fogVertex } from "@babylonjs/core/Shaders/ShadersInclude/fogVertex.js";
|
|
9
9
|
const name = "skyVertexShader";
|
|
10
10
|
const shader = `precision highp float;attribute vec3 position;
|
|
11
11
|
#ifdef VERTEXCOLOR
|
|
@@ -42,6 +42,12 @@ gl_PointSize=pointSize;
|
|
|
42
42
|
if (!ShaderStore.ShadersStore[name]) {
|
|
43
43
|
ShaderStore.ShadersStore[name] = shader;
|
|
44
44
|
}
|
|
45
|
+
const includes = [logDepthDeclaration, clipPlaneVertexDeclaration, fogVertexDeclaration, clipPlaneVertex, logDepthVertex, fogVertex];
|
|
46
|
+
for (const inc of includes) {
|
|
47
|
+
if (!ShaderStore.IncludesShadersStore[inc.name]) {
|
|
48
|
+
ShaderStore.IncludesShadersStore[inc.name] = inc.shader;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
45
51
|
/** @internal */
|
|
46
52
|
export const skyVertexShader = { name, shader };
|
|
47
53
|
//# sourceMappingURL=sky.vertex.js.map
|
package/sky/sky.vertex.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sky.vertex.js","sourceRoot":"","sources":["../../../../dev/materials/src/sky/sky.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"sky.vertex.js","sourceRoot":"","sources":["../../../../dev/materials/src/sky/sky.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAElE,MAAM,IAAI,GAAG,iBAAiB,CAAC;AAC/B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Bd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;IAClC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC5C,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,mBAAmB,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,CAAC,CAAC;AACrI,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9C,WAAW,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAC5D,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\nimport { logDepthDeclaration } from \"core/Shaders/ShadersInclude/logDepthDeclaration\";\nimport { clipPlaneVertexDeclaration } from \"core/Shaders/ShadersInclude/clipPlaneVertexDeclaration\";\nimport { fogVertexDeclaration } from \"core/Shaders/ShadersInclude/fogVertexDeclaration\";\nimport { clipPlaneVertex } from \"core/Shaders/ShadersInclude/clipPlaneVertex\";\nimport { logDepthVertex } from \"core/Shaders/ShadersInclude/logDepthVertex\";\nimport { fogVertex } from \"core/Shaders/ShadersInclude/fogVertex\";\n\nconst name = \"skyVertexShader\";\nconst shader = `precision highp float;attribute vec3 position;\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\nuniform mat4 world;uniform mat4 view;uniform mat4 viewProjection;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef VERTEXCOLOR\nvarying vec4 vColor;\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\ngl_Position=viewProjection*world*vec4(position,1.0);vec4 worldPos=world*vec4(position,1.0);vPositionW=vec3(worldPos);\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#ifdef VERTEXCOLOR\nvColor=color;\n#endif\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStore[name]) {\n ShaderStore.ShadersStore[name] = shader;\n}\nconst includes = [logDepthDeclaration, clipPlaneVertexDeclaration, fogVertexDeclaration, clipPlaneVertex, logDepthVertex, fogVertex];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStore[inc.name]) {\n ShaderStore.IncludesShadersStore[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const skyVertexShader = { name, shader };\n"]}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.js";
|
|
2
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
3
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.js";
|
|
4
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/helperFunctions.js";
|
|
5
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragment.js";
|
|
6
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthFragment.js";
|
|
7
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragment.js";
|
|
8
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/imageProcessingCompatibility.js";
|
|
9
1
|
/** @internal */
|
|
10
2
|
export declare const skyPixelShaderWGSL: {
|
|
11
3
|
name: string;
|
package/sky/wgsl/sky.fragment.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Do not edit.
|
|
2
2
|
import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
|
|
3
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.js";
|
|
4
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
5
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.js";
|
|
6
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/helperFunctions.js";
|
|
7
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragment.js";
|
|
8
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthFragment.js";
|
|
9
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragment.js";
|
|
10
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/imageProcessingCompatibility.js";
|
|
3
|
+
import { clipPlaneFragmentDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.js";
|
|
4
|
+
import { logDepthDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
5
|
+
import { fogFragmentDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.js";
|
|
6
|
+
import { helperFunctionsWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/helperFunctions.js";
|
|
7
|
+
import { clipPlaneFragmentWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragment.js";
|
|
8
|
+
import { logDepthFragmentWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthFragment.js";
|
|
9
|
+
import { fogFragmentWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragment.js";
|
|
10
|
+
import { imageProcessingCompatibilityWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/imageProcessingCompatibility.js";
|
|
11
11
|
const name = "skyPixelShader";
|
|
12
12
|
const shader = `varying vPositionW: vec3f;
|
|
13
13
|
#ifdef VERTEXCOLOR
|
|
@@ -64,6 +64,12 @@ fragmentOutputs.color=color;
|
|
|
64
64
|
if (!ShaderStore.ShadersStoreWGSL[name]) {
|
|
65
65
|
ShaderStore.ShadersStoreWGSL[name] = shader;
|
|
66
66
|
}
|
|
67
|
+
const includes = [clipPlaneFragmentDeclarationWGSL, logDepthDeclarationWGSL, fogFragmentDeclarationWGSL, helperFunctionsWGSL, clipPlaneFragmentWGSL, logDepthFragmentWGSL, fogFragmentWGSL, imageProcessingCompatibilityWGSL];
|
|
68
|
+
for (const inc of includes) {
|
|
69
|
+
if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
|
|
70
|
+
ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
67
73
|
/** @internal */
|
|
68
74
|
export const skyPixelShaderWGSL = { name, shader };
|
|
69
75
|
//# sourceMappingURL=sky.fragment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sky.fragment.js","sourceRoot":"","sources":["../../../../../dev/materials/src/sky/wgsl/sky.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,8DAA8D,CAAC;
|
|
1
|
+
{"version":3,"file":"sky.fragment.js","sourceRoot":"","sources":["../../../../../dev/materials/src/sky/wgsl/sky.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,gCAAgC,EAAE,MAAM,8DAA8D,CAAC;AAChH,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAC9F,OAAO,EAAE,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,gCAAgC,EAAE,MAAM,8DAA8D,CAAC;AAEhH,MAAM,IAAI,GAAG,gBAAgB,CAAC;AAC9B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,gCAAgC,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,eAAe,EAAE,gCAAgC,CAAC,CAAC;AAC9N,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAChE,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\nimport { clipPlaneFragmentDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration\";\nimport { logDepthDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/logDepthDeclaration\";\nimport { fogFragmentDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/fogFragmentDeclaration\";\nimport { helperFunctionsWGSL } from \"core/ShadersWGSL/ShadersInclude/helperFunctions\";\nimport { clipPlaneFragmentWGSL } from \"core/ShadersWGSL/ShadersInclude/clipPlaneFragment\";\nimport { logDepthFragmentWGSL } from \"core/ShadersWGSL/ShadersInclude/logDepthFragment\";\nimport { fogFragmentWGSL } from \"core/ShadersWGSL/ShadersInclude/fogFragment\";\nimport { imageProcessingCompatibilityWGSL } from \"core/ShadersWGSL/ShadersInclude/imageProcessingCompatibility\";\n\nconst name = \"skyPixelShader\";\nconst shader = `varying vPositionW: vec3f;\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneFragmentDeclaration>\nuniform cameraPosition: vec3f;uniform cameraOffset: vec3f;uniform up: vec3f;uniform luminance: f32;uniform turbidity: f32;uniform rayleigh: f32;uniform mieCoefficient: f32;uniform mieDirectionalG: f32;uniform sunPosition: vec3f;\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\nconst ce: f32=2.71828182845904523536028747135266249775724709369995957;const pi: f32=3.141592653589793238462643383279502884197169;const cn: f32=1.0003;const cN: f32=2.545E25;const pn: f32=0.035;const lambda: vec3f= vec3f(680E-9,550E-9,450E-9);const cK: vec3f= vec3f(0.686,0.678,0.666);const cv: f32=4.0;const rayleighZenithLength: f32=8.4E3;const mieZenithLength: f32=1.25E3;const EE: f32=1000.0;const sunAngularDiameterCos: f32=0.999956676946448443553574619906976478926848692873900859324;const cutoffAngle: f32=pi/1.95;const steepness: f32=1.5;fn totalRayleigh(lambdaIn: vec3f)->vec3f\n{return (8.0*pow(pi,3.0)*pow(pow(cn,2.0)-1.0,2.0)*(6.0+3.0*pn))/(3.0*cN*pow(lambdaIn, vec3f(4.0))*(6.0-7.0*pn));}\nfn simplifiedRayleigh()->vec3f\n{return vec3f(0.0005)/ vec3f(94,40,18);}\nfn rayleighPhase(cosTheta: f32)->f32\n{return (3.0/(16.0*pi))*(1.0+pow(cosTheta,2.0));}\nfn totalMie(lambdaIn: vec3f,KIn: vec3f,T: f32)->vec3f\n{var c: f32=(0.2*T)*10E-18;return 0.434*c*pi*pow((2.0*pi)/lambdaIn, vec3f(cv-2.0))*KIn;}\nfn hgPhase(cosTheta: f32,g: f32)->f32\n{return (1.0/(4.0*pi))*((1.0-pow(g,2.0))/pow(1.0-2.0*g*cosTheta+pow(g,2.0),1.5));}\nfn sunIntensity(zenithAngleCos: f32)->f32\n{return EE*max(0.0,1.0-exp((-(cutoffAngle-acos(zenithAngleCos))/steepness)));}\nconst A: f32=0.15;const B: f32=0.50;const C: f32=0.10;const D: f32=0.20;const EEE: f32=0.02;const F: f32=0.30;const W: f32=1000.0;fn Uncharted2Tonemap(x: vec3f)->vec3f\n{return ((x*(A*x+C*B)+D*EEE)/(x*(A*x+B)+D*F))-EEE/F;}\n#if DITHER\n#include<helperFunctions>\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\n/**\n* Sky Color\n*/\nvar sunfade: f32=1.0-clamp(1.0-exp((uniforms.sunPosition.y/450000.0)),0.0,1.0);var rayleighCoefficient: f32=uniforms.rayleigh-(1.0*(1.0-sunfade));var sunDirection: vec3f=normalize(uniforms.sunPosition);var sunE: f32=sunIntensity(dot(sunDirection,uniforms.up));var betaR: vec3f=simplifiedRayleigh()*rayleighCoefficient;var betaM: vec3f=totalMie(lambda,cK,uniforms.turbidity)*uniforms.mieCoefficient;var zenithAngle: f32=acos(max(0.0,dot(uniforms.up,normalize(fragmentInputs.vPositionW-uniforms.cameraPosition+uniforms.cameraOffset))));var sR: f32=rayleighZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));var sM: f32=mieZenithLength/(cos(zenithAngle)+0.15*pow(93.885-((zenithAngle*180.0)/pi),-1.253));var Fex: vec3f=exp(-(betaR*sR+betaM*sM));var cosTheta: f32=dot(normalize(fragmentInputs.vPositionW-uniforms.cameraPosition),sunDirection);var rPhase: f32=rayleighPhase(cosTheta*0.5+0.5);var betaRTheta: vec3f=betaR*rPhase;var mPhase: f32=hgPhase(cosTheta,uniforms.mieDirectionalG);var betaMTheta: vec3f=betaM*mPhase;var Lin: vec3f=pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*(1.0-Fex), vec3f(1.5));Lin=Lin*mix( vec3f(1.0),pow(sunE*((betaRTheta+betaMTheta)/(betaR+betaM))*Fex, vec3f(1.0/2.0)), vec3f(clamp(pow(1.0-dot(uniforms.up,sunDirection),5.0),0.0,1.0)));var direction: vec3f=normalize(fragmentInputs.vPositionW-uniforms.cameraPosition);var theta: f32=acos(direction.y);var phi: f32=atan2(direction.z,direction.x);var uv: vec2f= vec2f(phi,theta)/ vec2f(2.0*pi,pi)+ vec2f(0.5,0.0);var L0: vec3f= vec3f(0.1)*Fex;var sundisk: f32=smoothstep(sunAngularDiameterCos,sunAngularDiameterCos+0.00002,cosTheta);L0=L0+(sunE*19000.0*Fex)*sundisk;var whiteScale: vec3f=1.0/Uncharted2Tonemap( vec3f(W));var texColor: vec3f=(Lin+L0);texColor=texColor*0.04;texColor=texColor+ vec3f(0.0,0.001,0.0025)*0.3;var g_fMaxLuminance: f32=1.0;var fLumScaled: f32=0.1/uniforms.luminance;var fLumCompressed: f32=(fLumScaled*(1.0+(fLumScaled/(g_fMaxLuminance*g_fMaxLuminance))))/(1.0+fLumScaled);var ExposureBias: f32=fLumCompressed;var curr: vec3f=Uncharted2Tonemap((log2(2.0/pow(uniforms.luminance,4.0)))*texColor);var retColor: vec3f=curr*whiteScale;var alpha: f32=1.0;\n#ifdef VERTEXCOLOR\nretColor=retColor.rgb*fragmentInputs.vColor.rgb;\n#endif\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#if DITHER\nretColor=retColor.rgb+dither(fragmentInputs.position.xy,0.5);\n#endif\nvar color: vec4f=clamp( vec4f(retColor.rgb,alpha), vec4f(0.0), vec4f(1.0));\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [clipPlaneFragmentDeclarationWGSL, logDepthDeclarationWGSL, fogFragmentDeclarationWGSL, helperFunctionsWGSL, clipPlaneFragmentWGSL, logDepthFragmentWGSL, fogFragmentWGSL, imageProcessingCompatibilityWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const skyPixelShaderWGSL = { name, shader };\n"]}
|
package/sky/wgsl/sky.vertex.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
2
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.js";
|
|
3
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertexDeclaration.js";
|
|
4
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertex.js";
|
|
5
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthVertex.js";
|
|
6
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertex.js";
|
|
7
1
|
/** @internal */
|
|
8
2
|
export declare const skyVertexShaderWGSL: {
|
|
9
3
|
name: string;
|
package/sky/wgsl/sky.vertex.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Do not edit.
|
|
2
2
|
import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
|
|
3
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
4
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.js";
|
|
5
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertexDeclaration.js";
|
|
6
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertex.js";
|
|
7
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthVertex.js";
|
|
8
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertex.js";
|
|
3
|
+
import { logDepthDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
4
|
+
import { clipPlaneVertexDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.js";
|
|
5
|
+
import { fogVertexDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertexDeclaration.js";
|
|
6
|
+
import { clipPlaneVertexWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertex.js";
|
|
7
|
+
import { logDepthVertexWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthVertex.js";
|
|
8
|
+
import { fogVertexWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertex.js";
|
|
9
9
|
const name = "skyVertexShader";
|
|
10
10
|
const shader = `attribute position: vec3f;
|
|
11
11
|
#ifdef VERTEXCOLOR
|
|
@@ -40,6 +40,12 @@ vertexOutputs.vColor=vertexInputs.color;
|
|
|
40
40
|
if (!ShaderStore.ShadersStoreWGSL[name]) {
|
|
41
41
|
ShaderStore.ShadersStoreWGSL[name] = shader;
|
|
42
42
|
}
|
|
43
|
+
const includes = [logDepthDeclarationWGSL, clipPlaneVertexDeclarationWGSL, fogVertexDeclarationWGSL, clipPlaneVertexWGSL, logDepthVertexWGSL, fogVertexWGSL];
|
|
44
|
+
for (const inc of includes) {
|
|
45
|
+
if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
|
|
46
|
+
ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
43
49
|
/** @internal */
|
|
44
50
|
export const skyVertexShaderWGSL = { name, shader };
|
|
45
51
|
//# sourceMappingURL=sky.vertex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sky.vertex.js","sourceRoot":"","sources":["../../../../../dev/materials/src/sky/wgsl/sky.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,qDAAqD,CAAC;
|
|
1
|
+
{"version":3,"file":"sky.vertex.js","sourceRoot":"","sources":["../../../../../dev/materials/src/sky/wgsl/sky.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAC9F,OAAO,EAAE,8BAA8B,EAAE,MAAM,4DAA4D,CAAC;AAC5G,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE1E,MAAM,IAAI,GAAG,iBAAiB,CAAC;AAC/B,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Bd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,uBAAuB,EAAE,8BAA8B,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,aAAa,CAAC,CAAC;AAC7J,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAChE,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\nimport { logDepthDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/logDepthDeclaration\";\nimport { clipPlaneVertexDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration\";\nimport { fogVertexDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/fogVertexDeclaration\";\nimport { clipPlaneVertexWGSL } from \"core/ShadersWGSL/ShadersInclude/clipPlaneVertex\";\nimport { logDepthVertexWGSL } from \"core/ShadersWGSL/ShadersInclude/logDepthVertex\";\nimport { fogVertexWGSL } from \"core/ShadersWGSL/ShadersInclude/fogVertex\";\n\nconst name = \"skyVertexShader\";\nconst shader = `attribute position: vec3f;\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\nuniform world: mat4x4f;uniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef VERTEXCOLOR\nvarying vColor: vec4f;\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs {\n#define CUSTOM_VERTEX_MAIN_BEGIN\nvertexOutputs.position=uniforms.viewProjection*uniforms.world* vec4f(vertexInputs.position,1.0);var worldPos: vec4f=uniforms.world* vec4f(vertexInputs.position,1.0);vertexOutputs.vPositionW= worldPos.xyz;\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#ifdef VERTEXCOLOR\nvertexOutputs.vColor=vertexInputs.color;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [logDepthDeclarationWGSL, clipPlaneVertexDeclarationWGSL, fogVertexDeclarationWGSL, clipPlaneVertexWGSL, logDepthVertexWGSL, fogVertexWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const skyVertexShaderWGSL = { name, shader };\n"]}
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
import "@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js";
|
|
2
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js";
|
|
3
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js";
|
|
4
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightsFragmentFunctions.js";
|
|
5
|
-
import "@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js";
|
|
6
|
-
import "@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js";
|
|
7
|
-
import "@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js";
|
|
8
|
-
import "@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js";
|
|
9
|
-
import "@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js";
|
|
10
|
-
import "@babylonjs/core/Shaders/ShadersInclude/depthPrePass.js";
|
|
11
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightFragment.js";
|
|
12
|
-
import "@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js";
|
|
13
|
-
import "@babylonjs/core/Shaders/ShadersInclude/fogFragment.js";
|
|
14
|
-
import "@babylonjs/core/Shaders/ShadersInclude/imageProcessingCompatibility.js";
|
|
15
1
|
/** @internal */
|
|
16
2
|
export declare const terrainPixelShader: {
|
|
17
3
|
name: string;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
// Do not edit.
|
|
2
2
|
import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
|
|
3
|
-
import "@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js";
|
|
4
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js";
|
|
5
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js";
|
|
6
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightsFragmentFunctions.js";
|
|
7
|
-
import "@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js";
|
|
8
|
-
import "@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js";
|
|
9
|
-
import "@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js";
|
|
10
|
-
import "@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js";
|
|
11
|
-
import "@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js";
|
|
12
|
-
import "@babylonjs/core/Shaders/ShadersInclude/depthPrePass.js";
|
|
13
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightFragment.js";
|
|
14
|
-
import "@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js";
|
|
15
|
-
import "@babylonjs/core/Shaders/ShadersInclude/fogFragment.js";
|
|
16
|
-
import "@babylonjs/core/Shaders/ShadersInclude/imageProcessingCompatibility.js";
|
|
3
|
+
import { helperFunctions } from "@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js";
|
|
4
|
+
import { lightFragmentDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js";
|
|
5
|
+
import { lightUboDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js";
|
|
6
|
+
import { lightsFragmentFunctions } from "@babylonjs/core/Shaders/ShadersInclude/lightsFragmentFunctions.js";
|
|
7
|
+
import { shadowsFragmentFunctions } from "@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js";
|
|
8
|
+
import { clipPlaneFragmentDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js";
|
|
9
|
+
import { logDepthDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js";
|
|
10
|
+
import { fogFragmentDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js";
|
|
11
|
+
import { clipPlaneFragment } from "@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js";
|
|
12
|
+
import { depthPrePass } from "@babylonjs/core/Shaders/ShadersInclude/depthPrePass.js";
|
|
13
|
+
import { lightFragment } from "@babylonjs/core/Shaders/ShadersInclude/lightFragment.js";
|
|
14
|
+
import { logDepthFragment } from "@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js";
|
|
15
|
+
import { fogFragment } from "@babylonjs/core/Shaders/ShadersInclude/fogFragment.js";
|
|
16
|
+
import { imageProcessingCompatibility } from "@babylonjs/core/Shaders/ShadersInclude/imageProcessingCompatibility.js";
|
|
17
17
|
const name = "terrainPixelShader";
|
|
18
18
|
const shader = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;
|
|
19
19
|
#ifdef SPECULARTERM
|
|
@@ -108,6 +108,12 @@ gl_FragColor=color;
|
|
|
108
108
|
if (!ShaderStore.ShadersStore[name]) {
|
|
109
109
|
ShaderStore.ShadersStore[name] = shader;
|
|
110
110
|
}
|
|
111
|
+
const includes = [helperFunctions, lightFragmentDeclaration, lightUboDeclaration, lightsFragmentFunctions, shadowsFragmentFunctions, clipPlaneFragmentDeclaration, logDepthDeclaration, fogFragmentDeclaration, clipPlaneFragment, depthPrePass, lightFragment, logDepthFragment, fogFragment, imageProcessingCompatibility];
|
|
112
|
+
for (const inc of includes) {
|
|
113
|
+
if (!ShaderStore.IncludesShadersStore[inc.name]) {
|
|
114
|
+
ShaderStore.IncludesShadersStore[inc.name] = inc.shader;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
111
117
|
/** @internal */
|
|
112
118
|
export const terrainPixelShader = { name, shader };
|
|
113
119
|
//# sourceMappingURL=terrain.fragment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terrain.fragment.js","sourceRoot":"","sources":["../../../../dev/materials/src/terrain/terrain.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"terrain.fragment.js","sourceRoot":"","sources":["../../../../dev/materials/src/terrain/terrain.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAC9F,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAChG,OAAO,EAAE,4BAA4B,EAAE,MAAM,0DAA0D,CAAC;AACxG,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AAC5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,4BAA4B,EAAE,MAAM,0DAA0D,CAAC;AAExG,MAAM,IAAI,GAAG,oBAAoB,CAAC;AAClC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwFd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;IAClC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC5C,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,eAAe,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,WAAW,EAAE,4BAA4B,CAAC,CAAC;AAC7T,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9C,WAAW,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAC5D,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\nimport { helperFunctions } from \"core/Shaders/ShadersInclude/helperFunctions\";\nimport { lightFragmentDeclaration } from \"core/Shaders/ShadersInclude/lightFragmentDeclaration\";\nimport { lightUboDeclaration } from \"core/Shaders/ShadersInclude/lightUboDeclaration\";\nimport { lightsFragmentFunctions } from \"core/Shaders/ShadersInclude/lightsFragmentFunctions\";\nimport { shadowsFragmentFunctions } from \"core/Shaders/ShadersInclude/shadowsFragmentFunctions\";\nimport { clipPlaneFragmentDeclaration } from \"core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration\";\nimport { logDepthDeclaration } from \"core/Shaders/ShadersInclude/logDepthDeclaration\";\nimport { fogFragmentDeclaration } from \"core/Shaders/ShadersInclude/fogFragmentDeclaration\";\nimport { clipPlaneFragment } from \"core/Shaders/ShadersInclude/clipPlaneFragment\";\nimport { depthPrePass } from \"core/Shaders/ShadersInclude/depthPrePass\";\nimport { lightFragment } from \"core/Shaders/ShadersInclude/lightFragment\";\nimport { logDepthFragment } from \"core/Shaders/ShadersInclude/logDepthFragment\";\nimport { fogFragment } from \"core/Shaders/ShadersInclude/fogFragment\";\nimport { imageProcessingCompatibility } from \"core/Shaders/ShadersInclude/imageProcessingCompatibility\";\n\nconst name = \"terrainPixelShader\";\nconst shader = `precision highp float;uniform vec4 vEyePosition;uniform vec4 vDiffuseColor;\n#ifdef SPECULARTERM\nuniform vec4 vSpecularColor;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<helperFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;uniform sampler2D textureSampler;uniform vec2 vTextureInfos;uniform sampler2D diffuse1Sampler;uniform sampler2D diffuse2Sampler;uniform sampler2D diffuse3Sampler;uniform vec2 diffuse1Infos;uniform vec2 diffuse2Infos;uniform vec2 diffuse3Infos;\n#endif\n#ifdef BUMP\nuniform sampler2D bump1Sampler;uniform sampler2D bump2Sampler;uniform sampler2D bump3Sampler;\n#endif\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#ifdef BUMP\n#extension GL_OES_standard_derivatives : enable\nmat3 cotangent_frame(vec3 normal,vec3 p,vec2 uv)\n{vec3 dp1=dFdx(p);vec3 dp2=dFdy(p);vec2 duv1=dFdx(uv);vec2 duv2=dFdy(uv);vec3 dp2perp=cross(dp2,normal);vec3 dp1perp=cross(normal,dp1);vec3 tangent=dp2perp*duv1.x+dp1perp*duv2.x;vec3 binormal=dp2perp*duv1.y+dp1perp*duv2.y;float invmax=inversesqrt(max(dot(tangent,tangent),dot(binormal,binormal)));return mat3(tangent*invmax,binormal*invmax,normal);}\nvec3 perturbNormal(vec3 viewDir,vec3 mixColor)\n{vec3 bump1Color=texture2D(bump1Sampler,vTextureUV*diffuse1Infos).xyz;vec3 bump2Color=texture2D(bump2Sampler,vTextureUV*diffuse2Infos).xyz;vec3 bump3Color=texture2D(bump3Sampler,vTextureUV*diffuse3Infos).xyz;bump1Color.rgb*=mixColor.r;bump2Color.rgb=mix(bump1Color.rgb,bump2Color.rgb,mixColor.g);vec3 map=mix(bump2Color.rgb,bump3Color.rgb,mixColor.b);map=map*255./127.-128./127.;mat3 TBN=cotangent_frame(vNormalW*vTextureInfos.y,-viewDir,vTextureUV);return normalize(TBN*map);}\n#endif\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvec3 viewDirectionW=normalize(vEyePosition.xyz-vPositionW);vec4 baseColor=vec4(1.,1.,1.,1.);vec3 diffuseColor=vDiffuseColor.rgb;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\nfloat alpha=vDiffuseColor.a;\n#ifdef NORMAL\nvec3 normalW=normalize(vNormalW);\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);\n#endif\n#ifdef DIFFUSE\nbaseColor=texture2D(textureSampler,vTextureUV);\n#if defined(BUMP) && defined(DIFFUSE)\nnormalW=perturbNormal(viewDirectionW,baseColor.rgb);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\n#include<depthPrePass>\nbaseColor.rgb*=vTextureInfos.y;vec4 diffuse1Color=texture2D(diffuse1Sampler,vTextureUV*diffuse1Infos);vec4 diffuse2Color=texture2D(diffuse2Sampler,vTextureUV*diffuse2Infos);vec4 diffuse3Color=texture2D(diffuse3Sampler,vTextureUV*diffuse3Infos);diffuse1Color.rgb*=baseColor.r;diffuse2Color.rgb=mix(diffuse1Color.rgb,diffuse2Color.rgb,baseColor.g);baseColor.rgb=mix(diffuse2Color.rgb,diffuse3Color.rgb,baseColor.b);\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nvec3 specularBase=vec3(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=vColor.a;\n#endif\n#ifdef SPECULARTERM\nvec3 finalSpecular=specularBase*specularColor;\n#else\nvec3 finalSpecular=vec3(0.0);\n#endif\nvec3 finalDiffuse=clamp(diffuseBase*diffuseColor*baseColor.rgb,0.0,1.0);vec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\ngl_FragColor=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStore[name]) {\n ShaderStore.ShadersStore[name] = shader;\n}\nconst includes = [helperFunctions, lightFragmentDeclaration, lightUboDeclaration, lightsFragmentFunctions, shadowsFragmentFunctions, clipPlaneFragmentDeclaration, logDepthDeclaration, fogFragmentDeclaration, clipPlaneFragment, depthPrePass, lightFragment, logDepthFragment, fogFragment, imageProcessingCompatibility];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStore[inc.name]) {\n ShaderStore.IncludesShadersStore[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const terrainPixelShader = { name, shader };\n"]}
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
import "@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js";
|
|
2
|
-
import "@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js";
|
|
3
|
-
import "@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js";
|
|
4
|
-
import "@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js";
|
|
5
|
-
import "@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js";
|
|
6
|
-
import "@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js";
|
|
7
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js";
|
|
8
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js";
|
|
9
|
-
import "@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js";
|
|
10
|
-
import "@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js";
|
|
11
|
-
import "@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js";
|
|
12
|
-
import "@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js";
|
|
13
|
-
import "@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js";
|
|
14
|
-
import "@babylonjs/core/Shaders/ShadersInclude/fogVertex.js";
|
|
15
|
-
import "@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js";
|
|
16
|
-
import "@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.js";
|
|
17
1
|
/** @internal */
|
|
18
2
|
export declare const terrainVertexShader: {
|
|
19
3
|
name: string;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
// Do not edit.
|
|
2
2
|
import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
|
|
3
|
-
import "@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js";
|
|
4
|
-
import "@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js";
|
|
5
|
-
import "@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js";
|
|
6
|
-
import "@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js";
|
|
7
|
-
import "@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js";
|
|
8
|
-
import "@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js";
|
|
9
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js";
|
|
10
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js";
|
|
11
|
-
import "@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js";
|
|
12
|
-
import "@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js";
|
|
13
|
-
import "@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js";
|
|
14
|
-
import "@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js";
|
|
15
|
-
import "@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js";
|
|
16
|
-
import "@babylonjs/core/Shaders/ShadersInclude/fogVertex.js";
|
|
17
|
-
import "@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js";
|
|
18
|
-
import "@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.js";
|
|
3
|
+
import { bonesDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/bonesDeclaration.js";
|
|
4
|
+
import { bakedVertexAnimationDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration.js";
|
|
5
|
+
import { instancesDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/instancesDeclaration.js";
|
|
6
|
+
import { logDepthDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js";
|
|
7
|
+
import { clipPlaneVertexDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js";
|
|
8
|
+
import { fogVertexDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js";
|
|
9
|
+
import { lightFragmentDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js";
|
|
10
|
+
import { lightUboDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js";
|
|
11
|
+
import { instancesVertex } from "@babylonjs/core/Shaders/ShadersInclude/instancesVertex.js";
|
|
12
|
+
import { bonesVertex } from "@babylonjs/core/Shaders/ShadersInclude/bonesVertex.js";
|
|
13
|
+
import { bakedVertexAnimation } from "@babylonjs/core/Shaders/ShadersInclude/bakedVertexAnimation.js";
|
|
14
|
+
import { clipPlaneVertex } from "@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertex.js";
|
|
15
|
+
import { logDepthVertex } from "@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js";
|
|
16
|
+
import { fogVertex } from "@babylonjs/core/Shaders/ShadersInclude/fogVertex.js";
|
|
17
|
+
import { shadowsVertex } from "@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js";
|
|
18
|
+
import { vertexColorMixing } from "@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.js";
|
|
19
19
|
const name = "terrainVertexShader";
|
|
20
20
|
const shader = `precision highp float;attribute vec3 position;
|
|
21
21
|
#ifdef NORMAL
|
|
@@ -94,6 +94,12 @@ gl_PointSize=pointSize;
|
|
|
94
94
|
if (!ShaderStore.ShadersStore[name]) {
|
|
95
95
|
ShaderStore.ShadersStore[name] = shader;
|
|
96
96
|
}
|
|
97
|
+
const includes = [bonesDeclaration, bakedVertexAnimationDeclaration, instancesDeclaration, logDepthDeclaration, clipPlaneVertexDeclaration, fogVertexDeclaration, lightFragmentDeclaration, lightUboDeclaration, instancesVertex, bonesVertex, bakedVertexAnimation, clipPlaneVertex, logDepthVertex, fogVertex, shadowsVertex, vertexColorMixing];
|
|
98
|
+
for (const inc of includes) {
|
|
99
|
+
if (!ShaderStore.IncludesShadersStore[inc.name]) {
|
|
100
|
+
ShaderStore.IncludesShadersStore[inc.name] = inc.shader;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
97
103
|
/** @internal */
|
|
98
104
|
export const terrainVertexShader = { name, shader };
|
|
99
105
|
//# sourceMappingURL=terrain.vertex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terrain.vertex.js","sourceRoot":"","sources":["../../../../dev/materials/src/terrain/terrain.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"terrain.vertex.js","sourceRoot":"","sources":["../../../../dev/materials/src/terrain/terrain.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,+BAA+B,EAAE,MAAM,6DAA6D,CAAC;AAC9G,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,MAAM,IAAI,GAAG,qBAAqB,CAAC;AACnC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwEd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;IAClC,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC5C,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,gBAAgB,EAAE,+BAA+B,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,EAAE,oBAAoB,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;AACnV,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9C,WAAW,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAC5D,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\nimport { bonesDeclaration } from \"core/Shaders/ShadersInclude/bonesDeclaration\";\nimport { bakedVertexAnimationDeclaration } from \"core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration\";\nimport { instancesDeclaration } from \"core/Shaders/ShadersInclude/instancesDeclaration\";\nimport { logDepthDeclaration } from \"core/Shaders/ShadersInclude/logDepthDeclaration\";\nimport { clipPlaneVertexDeclaration } from \"core/Shaders/ShadersInclude/clipPlaneVertexDeclaration\";\nimport { fogVertexDeclaration } from \"core/Shaders/ShadersInclude/fogVertexDeclaration\";\nimport { lightFragmentDeclaration } from \"core/Shaders/ShadersInclude/lightFragmentDeclaration\";\nimport { lightUboDeclaration } from \"core/Shaders/ShadersInclude/lightUboDeclaration\";\nimport { instancesVertex } from \"core/Shaders/ShadersInclude/instancesVertex\";\nimport { bonesVertex } from \"core/Shaders/ShadersInclude/bonesVertex\";\nimport { bakedVertexAnimation } from \"core/Shaders/ShadersInclude/bakedVertexAnimation\";\nimport { clipPlaneVertex } from \"core/Shaders/ShadersInclude/clipPlaneVertex\";\nimport { logDepthVertex } from \"core/Shaders/ShadersInclude/logDepthVertex\";\nimport { fogVertex } from \"core/Shaders/ShadersInclude/fogVertex\";\nimport { shadowsVertex } from \"core/Shaders/ShadersInclude/shadowsVertex\";\nimport { vertexColorMixing } from \"core/Shaders/ShadersInclude/vertexColorMixing\";\n\nconst name = \"terrainVertexShader\";\nconst shader = `precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef UV1\nattribute vec2 uv;\n#endif\n#ifdef UV2\nattribute vec2 uv2;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSE\nvarying vec2 vTextureUV;uniform mat4 textureMatrix;uniform vec2 vTextureInfos;\n#endif\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying vec3 vNormalW;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<logDepthDeclaration>\n#include<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying float vViewDepth;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\nvoid main(void) {\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvec4 colorUpdated=color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvec4 worldPos=finalWorld*vec4(position,1.0);gl_Position=viewProjection*worldPos;vPositionW=vec3(worldPos);\n#ifdef NORMAL\nvNormalW=normalize(vec3(finalWorld*vec4(normal,0.0)));\n#endif\n#ifndef UV1\nvec2 uv=vec2(0.,0.);\n#endif\n#ifndef UV2\nvec2 uv2=vec2(0.,0.);\n#endif\n#ifdef DIFFUSE\nif (vTextureInfos.x==0.)\n{vTextureUV=vec2(textureMatrix*vec4(uv,1.0,0.0));}\nelse\n{vTextureUV=vec2(textureMatrix*vec4(uv2,1.0,0.0));}\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\n#define CUSTOM_VERTEX_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStore[name]) {\n ShaderStore.ShadersStore[name] = shader;\n}\nconst includes = [bonesDeclaration, bakedVertexAnimationDeclaration, instancesDeclaration, logDepthDeclaration, clipPlaneVertexDeclaration, fogVertexDeclaration, lightFragmentDeclaration, lightUboDeclaration, instancesVertex, bonesVertex, bakedVertexAnimation, clipPlaneVertex, logDepthVertex, fogVertex, shadowsVertex, vertexColorMixing];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStore[inc.name]) {\n ShaderStore.IncludesShadersStore[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const terrainVertexShader = { name, shader };\n"]}
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/helperFunctions.js";
|
|
2
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightUboDeclaration.js";
|
|
3
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js";
|
|
4
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js";
|
|
5
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.js";
|
|
6
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
7
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.js";
|
|
8
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragment.js";
|
|
9
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/depthPrePass.js";
|
|
10
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightFragment.js";
|
|
11
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthFragment.js";
|
|
12
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragment.js";
|
|
13
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/imageProcessingCompatibility.js";
|
|
14
1
|
/** @internal */
|
|
15
2
|
export declare const terrainPixelShaderWGSL: {
|
|
16
3
|
name: string;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// Do not edit.
|
|
2
2
|
import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
|
|
3
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/helperFunctions.js";
|
|
4
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightUboDeclaration.js";
|
|
5
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js";
|
|
6
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js";
|
|
7
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.js";
|
|
8
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
9
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.js";
|
|
10
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragment.js";
|
|
11
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/depthPrePass.js";
|
|
12
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightFragment.js";
|
|
13
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthFragment.js";
|
|
14
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragment.js";
|
|
15
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/imageProcessingCompatibility.js";
|
|
3
|
+
import { helperFunctionsWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/helperFunctions.js";
|
|
4
|
+
import { lightUboDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/lightUboDeclaration.js";
|
|
5
|
+
import { lightsFragmentFunctionsWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js";
|
|
6
|
+
import { shadowsFragmentFunctionsWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js";
|
|
7
|
+
import { clipPlaneFragmentDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.js";
|
|
8
|
+
import { logDepthDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
9
|
+
import { fogFragmentDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.js";
|
|
10
|
+
import { clipPlaneFragmentWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragment.js";
|
|
11
|
+
import { depthPrePassWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/depthPrePass.js";
|
|
12
|
+
import { lightFragmentWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/lightFragment.js";
|
|
13
|
+
import { logDepthFragmentWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthFragment.js";
|
|
14
|
+
import { fogFragmentWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragment.js";
|
|
15
|
+
import { imageProcessingCompatibilityWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/imageProcessingCompatibility.js";
|
|
16
16
|
const name = "terrainPixelShader";
|
|
17
17
|
const shader = `uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;
|
|
18
18
|
#ifdef SPECULARTERM
|
|
@@ -103,6 +103,12 @@ fragmentOutputs.color=color;
|
|
|
103
103
|
if (!ShaderStore.ShadersStoreWGSL[name]) {
|
|
104
104
|
ShaderStore.ShadersStoreWGSL[name] = shader;
|
|
105
105
|
}
|
|
106
|
+
const includes = [helperFunctionsWGSL, lightUboDeclarationWGSL, lightsFragmentFunctionsWGSL, shadowsFragmentFunctionsWGSL, clipPlaneFragmentDeclarationWGSL, logDepthDeclarationWGSL, fogFragmentDeclarationWGSL, clipPlaneFragmentWGSL, depthPrePassWGSL, lightFragmentWGSL, logDepthFragmentWGSL, fogFragmentWGSL, imageProcessingCompatibilityWGSL];
|
|
107
|
+
for (const inc of includes) {
|
|
108
|
+
if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
|
|
109
|
+
ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
106
112
|
/** @internal */
|
|
107
113
|
export const terrainPixelShaderWGSL = { name, shader };
|
|
108
114
|
//# sourceMappingURL=terrain.fragment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terrain.fragment.js","sourceRoot":"","sources":["../../../../../dev/materials/src/terrain/wgsl/terrain.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"terrain.fragment.js","sourceRoot":"","sources":["../../../../../dev/materials/src/terrain/wgsl/terrain.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAC9F,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AACtG,OAAO,EAAE,4BAA4B,EAAE,MAAM,0DAA0D,CAAC;AACxG,OAAO,EAAE,gCAAgC,EAAE,MAAM,8DAA8D,CAAC;AAChH,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAC9F,OAAO,EAAE,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,gCAAgC,EAAE,MAAM,8DAA8D,CAAC;AAEhH,MAAM,IAAI,GAAG,oBAAoB,CAAC;AAClC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoFd,CAAC;AACF,aAAa;AACb,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;IACtC,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAChD,CAAC;AACD,MAAM,QAAQ,GAAG,CAAC,mBAAmB,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,gCAAgC,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,eAAe,EAAE,gCAAgC,CAAC,CAAC;AACvV,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,WAAW,CAAC,wBAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;IAChE,CAAC;AACL,CAAC;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\nimport { helperFunctionsWGSL } from \"core/ShadersWGSL/ShadersInclude/helperFunctions\";\nimport { lightUboDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/lightUboDeclaration\";\nimport { lightsFragmentFunctionsWGSL } from \"core/ShadersWGSL/ShadersInclude/lightsFragmentFunctions\";\nimport { shadowsFragmentFunctionsWGSL } from \"core/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions\";\nimport { clipPlaneFragmentDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration\";\nimport { logDepthDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/logDepthDeclaration\";\nimport { fogFragmentDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/fogFragmentDeclaration\";\nimport { clipPlaneFragmentWGSL } from \"core/ShadersWGSL/ShadersInclude/clipPlaneFragment\";\nimport { depthPrePassWGSL } from \"core/ShadersWGSL/ShadersInclude/depthPrePass\";\nimport { lightFragmentWGSL } from \"core/ShadersWGSL/ShadersInclude/lightFragment\";\nimport { logDepthFragmentWGSL } from \"core/ShadersWGSL/ShadersInclude/logDepthFragment\";\nimport { fogFragmentWGSL } from \"core/ShadersWGSL/ShadersInclude/fogFragment\";\nimport { imageProcessingCompatibilityWGSL } from \"core/ShadersWGSL/ShadersInclude/imageProcessingCompatibility\";\n\nconst name = \"terrainPixelShader\";\nconst shader = `uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;\n#ifdef SPECULARTERM\nuniform vSpecularColor: vec4f;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying vNormalW: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#ifdef DIFFUSE\nvarying vTextureUV: vec2f;var textureSamplerSampler: sampler;var textureSampler: texture_2d<f32>;uniform vTextureInfos: vec2f;var diffuse1SamplerSampler: sampler;var diffuse1Sampler: texture_2d<f32>;var diffuse2SamplerSampler: sampler;var diffuse2Sampler: texture_2d<f32>;var diffuse3SamplerSampler: sampler;var diffuse3Sampler: texture_2d<f32>;uniform diffuse1Infos: vec2f;uniform diffuse2Infos: vec2f;uniform diffuse3Infos: vec2f;\n#endif\n#ifdef BUMP\nvar bump1SamplerSampler: sampler;var bump1Sampler: texture_2d<f32>;var bump2SamplerSampler: sampler;var bump2Sampler: texture_2d<f32>;var bump3SamplerSampler: sampler;var bump3Sampler: texture_2d<f32>;\n#endif\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\n#ifdef BUMP\nfn cotangent_frame(normal: vec3f,p: vec3f,uv: vec2f)->mat3x3f\n{var dp1: vec3f=dpdx(p);var dp2: vec3f=dpdy(p);var duv1: vec2f=dpdx(uv);var duv2: vec2f=dpdy(uv);var dp2perp: vec3f=cross(dp2,normal);var dp1perp: vec3f=cross(normal,dp1);var tangent: vec3f=dp2perp*duv1.x+dp1perp*duv2.x;var binormal: vec3f=dp2perp*duv1.y+dp1perp*duv2.y;var invmax: f32=inverseSqrt(max(dot(tangent,tangent),dot(binormal,binormal)));return mat3x3f(tangent*invmax,binormal*invmax,normal);}\nfn perturbNormal(viewDir: vec3f,mixColor: vec3f)->vec3f\n{var bump1Color: vec3f=textureSample(bump1Sampler,bump1SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse1Infos).xyz;var bump2Color: vec3f=textureSample(bump2Sampler,bump2SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse2Infos).xyz;var bump3Color: vec3f=textureSample(bump3Sampler,bump3SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse3Infos).xyz;bump1Color=bump1Color.rgb*mixColor.r;bump2Color=mix(bump1Color.rgb,bump2Color.rgb,vec3f(mixColor.g));var map: vec3f=mix(bump2Color.rgb,bump3Color.rgb,vec3f(mixColor.b));map=map*255./127.-128./127.;var TBN: mat3x3f=cotangent_frame(fragmentInputs.vNormalW*uniforms.vTextureInfos.y,-viewDir,fragmentInputs.vTextureUV);return normalize(TBN*map);}\n#endif\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_FRAGMENT_DEFINITIONS\n@fragment\nfn main(input: FragmentInputs)->FragmentOutputs {\n#define CUSTOM_FRAGMENT_MAIN_BEGIN\n#include<clipPlaneFragment>\nvar viewDirectionW: vec3f=normalize(uniforms.vEyePosition.xyz-fragmentInputs.vPositionW);var baseColor: vec4f= vec4f(1.,1.,1.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;\n#ifdef SPECULARTERM\nvar glossiness: f32=uniforms.vSpecularColor.a;var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#else\nvar glossiness: f32=0.;\n#endif\nvar alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef NORMAL\nvar normalW: vec3f=normalize(fragmentInputs.vNormalW);\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\n#ifdef DIFFUSE\nbaseColor=textureSample(textureSampler,textureSamplerSampler,fragmentInputs.vTextureUV);\n#if defined(BUMP) && defined(DIFFUSE)\nnormalW=perturbNormal(viewDirectionW,baseColor.rgb);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#include<depthPrePass>\nbaseColor=vec4f(baseColor.rgb*uniforms.vTextureInfos.y,baseColor.a);var diffuse1Color: vec4f=textureSample(diffuse1Sampler,diffuse1SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse1Infos);var diffuse2Color: vec4f=textureSample(diffuse2Sampler,diffuse2SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse2Infos);var diffuse3Color: vec4f=textureSample(diffuse3Sampler,diffuse3SamplerSampler,fragmentInputs.vTextureUV*uniforms.diffuse3Infos);diffuse1Color=vec4f(diffuse1Color.rgb*baseColor.r,diffuse1Color.a);diffuse2Color=vec4f(mix(diffuse1Color.rgb,diffuse2Color.rgb,vec3f(baseColor.g)),diffuse2Color.a);baseColor=vec4f(mix(diffuse2Color.rgb,diffuse3Color.rgb,vec3f(baseColor.b)),baseColor.a);\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor=vec4f(baseColor.rgb*fragmentInputs.vColor.rgb,baseColor.a);\n#endif\nvar diffuseBase: vec3f= vec3f(0.,0.,0.);var info: lightingInfo;var shadow: f32=1.;var aggShadow: f32=0.;var numLights: f32=0.;\n#ifdef SPECULARTERM\nvar specularBase: vec3f= vec3f(0.,0.,0.);\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\n#if defined(VERTEXALPHA) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nalpha*=fragmentInputs.vColor.a;\n#endif\n#ifdef SPECULARTERM\nvar finalSpecular: vec3f=specularBase*specularColor;\n#else\nvar finalSpecular: vec3f= vec3f(0.0);\n#endif\nvar finalDiffuse: vec3f=clamp(diffuseBase*diffuseColor*baseColor.rgb,vec3f(0.0),vec3f(1.0));var color: vec4f= vec4f(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\nfragmentOutputs.color=color;\n#include<imageProcessingCompatibility>\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [helperFunctionsWGSL, lightUboDeclarationWGSL, lightsFragmentFunctionsWGSL, shadowsFragmentFunctionsWGSL, clipPlaneFragmentDeclarationWGSL, logDepthDeclarationWGSL, fogFragmentDeclarationWGSL, clipPlaneFragmentWGSL, depthPrePassWGSL, lightFragmentWGSL, logDepthFragmentWGSL, fogFragmentWGSL, imageProcessingCompatibilityWGSL];\nfor (const inc of includes) {\n if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {\n ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;\n }\n}\n\n/** @internal */\nexport const terrainPixelShaderWGSL = { name, shader };\n"]}
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/bonesDeclaration.js";
|
|
2
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.js";
|
|
3
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/instancesDeclaration.js";
|
|
4
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
5
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.js";
|
|
6
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertexDeclaration.js";
|
|
7
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightVxFragmentDeclaration.js";
|
|
8
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js";
|
|
9
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/instancesVertex.js";
|
|
10
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/bonesVertex.js";
|
|
11
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimation.js";
|
|
12
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertex.js";
|
|
13
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthVertex.js";
|
|
14
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertex.js";
|
|
15
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsVertex.js";
|
|
16
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/vertexColorMixing.js";
|
|
17
1
|
/** @internal */
|
|
18
2
|
export declare const terrainVertexShaderWGSL: {
|
|
19
3
|
name: string;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
// Do not edit.
|
|
2
2
|
import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
|
|
3
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/bonesDeclaration.js";
|
|
4
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.js";
|
|
5
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/instancesDeclaration.js";
|
|
6
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
7
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.js";
|
|
8
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertexDeclaration.js";
|
|
9
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightVxFragmentDeclaration.js";
|
|
10
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js";
|
|
11
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/instancesVertex.js";
|
|
12
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/bonesVertex.js";
|
|
13
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimation.js";
|
|
14
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertex.js";
|
|
15
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthVertex.js";
|
|
16
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertex.js";
|
|
17
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsVertex.js";
|
|
18
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/vertexColorMixing.js";
|
|
3
|
+
import { bonesDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/bonesDeclaration.js";
|
|
4
|
+
import { bakedVertexAnimationDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.js";
|
|
5
|
+
import { instancesDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/instancesDeclaration.js";
|
|
6
|
+
import { logDepthDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
7
|
+
import { clipPlaneVertexDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.js";
|
|
8
|
+
import { fogVertexDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertexDeclaration.js";
|
|
9
|
+
import { lightVxFragmentDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/lightVxFragmentDeclaration.js";
|
|
10
|
+
import { lightVxUboDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js";
|
|
11
|
+
import { instancesVertexWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/instancesVertex.js";
|
|
12
|
+
import { bonesVertexWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/bonesVertex.js";
|
|
13
|
+
import { bakedVertexAnimationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimation.js";
|
|
14
|
+
import { clipPlaneVertexWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertex.js";
|
|
15
|
+
import { logDepthVertexWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthVertex.js";
|
|
16
|
+
import { fogVertexWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertex.js";
|
|
17
|
+
import { shadowsVertexWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsVertex.js";
|
|
18
|
+
import { vertexColorMixingWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/vertexColorMixing.js";
|
|
19
19
|
const name = "terrainVertexShader";
|
|
20
20
|
const shader = `attribute position: vec3f;
|
|
21
21
|
#ifdef NORMAL
|
|
@@ -96,6 +96,12 @@ else
|
|
|
96
96
|
if (!ShaderStore.ShadersStoreWGSL[name]) {
|
|
97
97
|
ShaderStore.ShadersStoreWGSL[name] = shader;
|
|
98
98
|
}
|
|
99
|
+
const includes = [bonesDeclarationWGSL, bakedVertexAnimationDeclarationWGSL, instancesDeclarationWGSL, logDepthDeclarationWGSL, clipPlaneVertexDeclarationWGSL, fogVertexDeclarationWGSL, lightVxFragmentDeclarationWGSL, lightVxUboDeclarationWGSL, instancesVertexWGSL, bonesVertexWGSL, bakedVertexAnimationWGSL, clipPlaneVertexWGSL, logDepthVertexWGSL, fogVertexWGSL, shadowsVertexWGSL, vertexColorMixingWGSL];
|
|
100
|
+
for (const inc of includes) {
|
|
101
|
+
if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
|
|
102
|
+
ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
99
105
|
/** @internal */
|
|
100
106
|
export const terrainVertexShaderWGSL = { name, shader };
|
|
101
107
|
//# sourceMappingURL=terrain.vertex.js.map
|