@babylonjs/materials 9.6.2 → 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/custom/pbrCustomMaterial.d.ts +6 -0
- package/custom/pbrCustomMaterial.js +10 -0
- package/custom/pbrCustomMaterial.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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triplanar.vertex.js","sourceRoot":"","sources":["../../../../dev/materials/src/triPlanar/triplanar.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"triplanar.vertex.js","sourceRoot":"","sources":["../../../../dev/materials/src/triPlanar/triplanar.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC9E,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,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,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,uBAAuB,CAAC;AACrC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Ed,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,gBAAgB,EAAE,+BAA+B,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,EAAE,oBAAoB,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC;AACpW,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,qBAAqB,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 { bonesDeclaration } from \"core/Shaders/ShadersInclude/bonesDeclaration\";\nimport { bakedVertexAnimationDeclaration } from \"core/Shaders/ShadersInclude/bakedVertexAnimationDeclaration\";\nimport { instancesDeclaration } from \"core/Shaders/ShadersInclude/instancesDeclaration\";\nimport { clipPlaneVertexDeclaration } from \"core/Shaders/ShadersInclude/clipPlaneVertexDeclaration\";\nimport { logDepthDeclaration } from \"core/Shaders/ShadersInclude/logDepthDeclaration\";\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 = \"triplanarVertexShader\";\nconst shader = `precision highp float;attribute vec3 position;\n#ifdef NORMAL\nattribute vec3 normal;\n#endif\n#ifdef VERTEXCOLOR\nattribute vec4 color;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform mat4 view;uniform mat4 viewProjection;\n#ifdef DIFFUSEX\nvarying vec2 vTextureUVX;\n#endif\n#ifdef DIFFUSEY\nvarying vec2 vTextureUVY;\n#endif\n#ifdef DIFFUSEZ\nvarying vec2 vTextureUVZ;\n#endif\nuniform float tileSize;\n#ifdef POINTSIZE\nuniform float pointSize;\n#endif\nvarying vec3 vPositionW;\n#ifdef NORMAL\nvarying mat3 tangentSpace;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vec4 vColor;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\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{\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 DIFFUSEX\nvTextureUVX=worldPos.zy/tileSize;\n#endif\n#ifdef DIFFUSEY\nvTextureUVY=worldPos.xz/tileSize;\n#endif\n#ifdef DIFFUSEZ\nvTextureUVZ=worldPos.xy/tileSize;\n#endif\n#ifdef NORMAL\nvec3 xtan=vec3(0,0,1);vec3 xbin=vec3(0,1,0);vec3 ytan=vec3(1,0,0);vec3 ybin=vec3(0,0,1);vec3 ztan=vec3(1,0,0);vec3 zbin=vec3(0,1,0);vec3 normalizedNormal=normalize(normal);normalizedNormal*=normalizedNormal;vec3 worldBinormal=normalize(xbin*normalizedNormal.x+ybin*normalizedNormal.y+zbin*normalizedNormal.z);vec3 worldTangent=normalize(xtan*normalizedNormal.x+ytan*normalizedNormal.y+ztan*normalizedNormal.z);mat3 normalWorld=mat3(finalWorld);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nworldTangent=normalize((normalWorld*worldTangent).xyz);worldBinormal=normalize((normalWorld*worldBinormal).xyz);vec3 worldNormal=normalize((normalWorld*normalize(normal)).xyz);tangentSpace[0]=worldTangent;tangentSpace[1]=worldBinormal;tangentSpace[2]=worldNormal;\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 = [helperFunctions, bonesDeclaration, bakedVertexAnimationDeclaration, instancesDeclaration, clipPlaneVertexDeclaration, logDepthDeclaration, 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 triplanarVertexShader = { 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/logDepthDeclaration.js";
|
|
4
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js";
|
|
5
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js";
|
|
6
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.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 triplanarPixelShaderWGSL: {
|
|
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/logDepthDeclaration.js";
|
|
6
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js";
|
|
7
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js";
|
|
8
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.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 { logDepthDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
6
|
+
import { lightsFragmentFunctionsWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js";
|
|
7
|
+
import { shadowsFragmentFunctionsWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js";
|
|
8
|
+
import { clipPlaneFragmentDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.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 = "triplanarPixelShader";
|
|
17
17
|
const shader = `uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;
|
|
18
18
|
#ifdef SPECULARTERM
|
|
@@ -120,6 +120,12 @@ fragmentOutputs.color=color;
|
|
|
120
120
|
if (!ShaderStore.ShadersStoreWGSL[name]) {
|
|
121
121
|
ShaderStore.ShadersStoreWGSL[name] = shader;
|
|
122
122
|
}
|
|
123
|
+
const includes = [helperFunctionsWGSL, lightUboDeclarationWGSL, logDepthDeclarationWGSL, lightsFragmentFunctionsWGSL, shadowsFragmentFunctionsWGSL, clipPlaneFragmentDeclarationWGSL, fogFragmentDeclarationWGSL, clipPlaneFragmentWGSL, depthPrePassWGSL, lightFragmentWGSL, logDepthFragmentWGSL, fogFragmentWGSL, imageProcessingCompatibilityWGSL];
|
|
124
|
+
for (const inc of includes) {
|
|
125
|
+
if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
|
|
126
|
+
ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
123
129
|
/** @internal */
|
|
124
130
|
export const triplanarPixelShaderWGSL = { name, shader };
|
|
125
131
|
//# sourceMappingURL=triplanar.fragment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triplanar.fragment.js","sourceRoot":"","sources":["../../../../../dev/materials/src/triPlanar/wgsl/triplanar.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"triplanar.fragment.js","sourceRoot":"","sources":["../../../../../dev/materials/src/triPlanar/wgsl/triplanar.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,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,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,sBAAsB,CAAC;AACpC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqGd,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,uBAAuB,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,gCAAgC,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,wBAAwB,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 { logDepthDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/logDepthDeclaration\";\nimport { lightsFragmentFunctionsWGSL } from \"core/ShadersWGSL/ShadersInclude/lightsFragmentFunctions\";\nimport { shadowsFragmentFunctionsWGSL } from \"core/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions\";\nimport { clipPlaneFragmentDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration\";\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 = \"triplanarPixelShader\";\nconst shader = `uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;\n#ifdef SPECULARTERM\nuniform vSpecularColor: vec4f;\n#endif\nvarying vPositionW: vec3f;\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<helperFunctions>\n#include<lightUboDeclaration>[0..maxSimultaneousLights]\n#ifdef DIFFUSEX\nvarying vTextureUVX: vec2f;var diffuseSamplerXSampler: sampler;var diffuseSamplerX: texture_2d<f32>;\n#ifdef BUMPX\nvar normalSamplerXSampler: sampler;var normalSamplerX: texture_2d<f32>;\n#endif\n#endif\n#ifdef DIFFUSEY\nvarying vTextureUVY: vec2f;var diffuseSamplerYSampler: sampler;var diffuseSamplerY: texture_2d<f32>;\n#ifdef BUMPY\nvar normalSamplerYSampler: sampler;var normalSamplerY: texture_2d<f32>;\n#endif\n#endif\n#ifdef DIFFUSEZ\nvarying vTextureUVZ: vec2f;var diffuseSamplerZSampler: sampler;var diffuseSamplerZ: texture_2d<f32>;\n#ifdef BUMPZ\nvar normalSamplerZSampler: sampler;var normalSamplerZ: texture_2d<f32>;\n#endif\n#endif\n#ifdef NORMAL\nvarying tangentSpace0: vec3f;varying tangentSpace1: vec3f;varying tangentSpace2: vec3f;\n#endif\n#include<logDepthDeclaration>\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#include<clipPlaneFragmentDeclaration>\n#include<fogFragmentDeclaration>\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(0.,0.,0.,1.);var diffuseColor: vec3f=uniforms.vDiffuseColor.rgb;var alpha: f32=uniforms.vDiffuseColor.a;\n#ifdef NORMAL\nvar normalW: vec3f=fragmentInputs.tangentSpace2;\n#else\nvar normalW: vec3f= vec3f(1.0,1.0,1.0);\n#endif\nvar baseNormal: vec4f= vec4f(0.0,0.0,0.0,1.0);normalW=normalW*normalW;\n#ifdef DIFFUSEX\nbaseColor=baseColor+textureSample(diffuseSamplerX,diffuseSamplerXSampler,fragmentInputs.vTextureUVX)*normalW.x;\n#ifdef BUMPX\nbaseNormal=baseNormal+textureSample(normalSamplerX,normalSamplerXSampler,fragmentInputs.vTextureUVX)*normalW.x;\n#endif\n#endif\n#ifdef DIFFUSEY\nbaseColor=baseColor+textureSample(diffuseSamplerY,diffuseSamplerYSampler,fragmentInputs.vTextureUVY)*normalW.y;\n#ifdef BUMPY\nbaseNormal=baseNormal+textureSample(normalSamplerY,normalSamplerYSampler,fragmentInputs.vTextureUVY)*normalW.y;\n#endif\n#endif\n#ifdef DIFFUSEZ\nbaseColor=baseColor+textureSample(diffuseSamplerZ,diffuseSamplerZSampler,fragmentInputs.vTextureUVZ)*normalW.z;\n#ifdef BUMPZ\nbaseNormal=baseNormal+textureSample(normalSamplerZ,normalSamplerZSampler,fragmentInputs.vTextureUVZ)*normalW.z;\n#endif\n#endif\n#ifdef NORMAL\nvar tangentSpace: mat3x3f=mat3x3f(fragmentInputs.tangentSpace0,fragmentInputs.tangentSpace1,fragmentInputs.tangentSpace2);normalW=normalize((2.0*baseNormal.xyz-1.0)*tangentSpace);\n#endif\n#ifdef ALPHATEST\nif (baseColor.a<0.4) {discard;}\n#endif\n#include<depthPrePass>\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 glossiness: f32=uniforms.vSpecularColor.a;var specularBase: vec3f= vec3f(0.,0.,0.);var specularColor: vec3f=uniforms.vSpecularColor.rgb;\n#else\nvar glossiness: f32=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,vec3f(0.0),vec3f(1.0))*baseColor.rgb;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, logDepthDeclarationWGSL, lightsFragmentFunctionsWGSL, shadowsFragmentFunctionsWGSL, clipPlaneFragmentDeclarationWGSL, 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 triplanarPixelShaderWGSL = { name, shader };\n"]}
|
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/helperFunctions.js";
|
|
2
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/bonesDeclaration.js";
|
|
3
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.js";
|
|
4
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/instancesDeclaration.js";
|
|
5
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.js";
|
|
6
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
7
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertexDeclaration.js";
|
|
8
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightVxFragmentDeclaration.js";
|
|
9
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js";
|
|
10
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/instancesVertex.js";
|
|
11
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/bonesVertex.js";
|
|
12
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimation.js";
|
|
13
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertex.js";
|
|
14
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthVertex.js";
|
|
15
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertex.js";
|
|
16
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsVertex.js";
|
|
17
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/vertexColorMixing.js";
|
|
18
1
|
/** @internal */
|
|
19
2
|
export declare const triplanarVertexShaderWGSL: {
|
|
20
3
|
name: string;
|
|
@@ -1,22 +1,22 @@
|
|
|
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/bonesDeclaration.js";
|
|
5
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.js";
|
|
6
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/instancesDeclaration.js";
|
|
7
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.js";
|
|
8
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
9
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertexDeclaration.js";
|
|
10
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightVxFragmentDeclaration.js";
|
|
11
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js";
|
|
12
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/instancesVertex.js";
|
|
13
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/bonesVertex.js";
|
|
14
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimation.js";
|
|
15
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertex.js";
|
|
16
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthVertex.js";
|
|
17
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertex.js";
|
|
18
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsVertex.js";
|
|
19
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/vertexColorMixing.js";
|
|
3
|
+
import { helperFunctionsWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/helperFunctions.js";
|
|
4
|
+
import { bonesDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/bonesDeclaration.js";
|
|
5
|
+
import { bakedVertexAnimationDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration.js";
|
|
6
|
+
import { instancesDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/instancesDeclaration.js";
|
|
7
|
+
import { clipPlaneVertexDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration.js";
|
|
8
|
+
import { logDepthDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
9
|
+
import { fogVertexDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertexDeclaration.js";
|
|
10
|
+
import { lightVxFragmentDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/lightVxFragmentDeclaration.js";
|
|
11
|
+
import { lightVxUboDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/lightVxUboDeclaration.js";
|
|
12
|
+
import { instancesVertexWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/instancesVertex.js";
|
|
13
|
+
import { bonesVertexWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/bonesVertex.js";
|
|
14
|
+
import { bakedVertexAnimationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/bakedVertexAnimation.js";
|
|
15
|
+
import { clipPlaneVertexWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneVertex.js";
|
|
16
|
+
import { logDepthVertexWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthVertex.js";
|
|
17
|
+
import { fogVertexWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/fogVertex.js";
|
|
18
|
+
import { shadowsVertexWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsVertex.js";
|
|
19
|
+
import { vertexColorMixingWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/vertexColorMixing.js";
|
|
20
20
|
const name = "triplanarVertexShader";
|
|
21
21
|
const shader = `attribute position: vec3f;
|
|
22
22
|
#ifdef NORMAL
|
|
@@ -97,6 +97,12 @@ worldTangent=normalize((normalWorld*worldTangent).xyz);worldBinormal=normalize((
|
|
|
97
97
|
if (!ShaderStore.ShadersStoreWGSL[name]) {
|
|
98
98
|
ShaderStore.ShadersStoreWGSL[name] = shader;
|
|
99
99
|
}
|
|
100
|
+
const includes = [helperFunctionsWGSL, bonesDeclarationWGSL, bakedVertexAnimationDeclarationWGSL, instancesDeclarationWGSL, clipPlaneVertexDeclarationWGSL, logDepthDeclarationWGSL, fogVertexDeclarationWGSL, lightVxFragmentDeclarationWGSL, lightVxUboDeclarationWGSL, instancesVertexWGSL, bonesVertexWGSL, bakedVertexAnimationWGSL, clipPlaneVertexWGSL, logDepthVertexWGSL, fogVertexWGSL, shadowsVertexWGSL, vertexColorMixingWGSL];
|
|
101
|
+
for (const inc of includes) {
|
|
102
|
+
if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
|
|
103
|
+
ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
100
106
|
/** @internal */
|
|
101
107
|
export const triplanarVertexShaderWGSL = { name, shader };
|
|
102
108
|
//# sourceMappingURL=triplanar.vertex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triplanar.vertex.js","sourceRoot":"","sources":["../../../../../dev/materials/src/triPlanar/wgsl/triplanar.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"triplanar.vertex.js","sourceRoot":"","sources":["../../../../../dev/materials/src/triPlanar/wgsl/triplanar.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,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,mCAAmC,EAAE,MAAM,iEAAiE,CAAC;AACtH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAChG,OAAO,EAAE,8BAA8B,EAAE,MAAM,4DAA4D,CAAC;AAC5G,OAAO,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AAC9F,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAChG,OAAO,EAAE,8BAA8B,EAAE,MAAM,4DAA4D,CAAC;AAC5G,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AACtF,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,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAE1F,MAAM,IAAI,GAAG,uBAAuB,CAAC;AACrC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Ed,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,oBAAoB,EAAE,mCAAmC,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,eAAe,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,aAAa,EAAE,iBAAiB,EAAE,qBAAqB,CAAC,CAAC;AAC5a,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,yBAAyB,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 { bonesDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/bonesDeclaration\";\nimport { bakedVertexAnimationDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/bakedVertexAnimationDeclaration\";\nimport { instancesDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/instancesDeclaration\";\nimport { clipPlaneVertexDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/clipPlaneVertexDeclaration\";\nimport { logDepthDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/logDepthDeclaration\";\nimport { fogVertexDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/fogVertexDeclaration\";\nimport { lightVxFragmentDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/lightVxFragmentDeclaration\";\nimport { lightVxUboDeclarationWGSL } from \"core/ShadersWGSL/ShadersInclude/lightVxUboDeclaration\";\nimport { instancesVertexWGSL } from \"core/ShadersWGSL/ShadersInclude/instancesVertex\";\nimport { bonesVertexWGSL } from \"core/ShadersWGSL/ShadersInclude/bonesVertex\";\nimport { bakedVertexAnimationWGSL } from \"core/ShadersWGSL/ShadersInclude/bakedVertexAnimation\";\nimport { clipPlaneVertexWGSL } from \"core/ShadersWGSL/ShadersInclude/clipPlaneVertex\";\nimport { logDepthVertexWGSL } from \"core/ShadersWGSL/ShadersInclude/logDepthVertex\";\nimport { fogVertexWGSL } from \"core/ShadersWGSL/ShadersInclude/fogVertex\";\nimport { shadowsVertexWGSL } from \"core/ShadersWGSL/ShadersInclude/shadowsVertex\";\nimport { vertexColorMixingWGSL } from \"core/ShadersWGSL/ShadersInclude/vertexColorMixing\";\n\nconst name = \"triplanarVertexShader\";\nconst shader = `attribute position: vec3f;\n#ifdef NORMAL\nattribute normal: vec3f;\n#endif\n#ifdef VERTEXCOLOR\nattribute color: vec4f;\n#endif\n#include<helperFunctions>\n#include<bonesDeclaration>\n#include<bakedVertexAnimationDeclaration>\n#include<instancesDeclaration>\nuniform view: mat4x4f;uniform viewProjection: mat4x4f;\n#ifdef DIFFUSEX\nvarying vTextureUVX: vec2f;\n#endif\n#ifdef DIFFUSEY\nvarying vTextureUVY: vec2f;\n#endif\n#ifdef DIFFUSEZ\nvarying vTextureUVZ: vec2f;\n#endif\nuniform tileSize: f32;\n#ifdef POINTSIZE\nuniform pointSize: f32;\n#endif\nvarying vPositionW: vec3f;\n#ifdef NORMAL\nvarying tangentSpace0: vec3f;varying tangentSpace1: vec3f;varying tangentSpace2: vec3f;\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nvarying vColor: vec4f;\n#endif\n#include<clipPlaneVertexDeclaration>\n#include<logDepthDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightVxFragment>[0..maxSimultaneousLights]\n#if defined(CLUSTLIGHT_BATCH) && CLUSTLIGHT_BATCH>0\nvarying vViewDepth: f32;\n#endif\n#define CUSTOM_VERTEX_DEFINITIONS\n@vertex\nfn main(input : VertexInputs)->FragmentInputs\n{\n#define CUSTOM_VERTEX_MAIN_BEGIN\n#ifdef VERTEXCOLOR\nvar colorUpdated: vec4f=vertexInputs.color;\n#endif\n#include<instancesVertex>\n#include<bonesVertex>\n#include<bakedVertexAnimation>\nvar worldPos: vec4f=finalWorld* vec4f(vertexInputs.position,1.0);vertexOutputs.position=uniforms.viewProjection*worldPos;vertexOutputs.vPositionW= worldPos.xyz;\n#ifdef DIFFUSEX\nvertexOutputs.vTextureUVX=worldPos.zy/uniforms.tileSize;\n#endif\n#ifdef DIFFUSEY\nvertexOutputs.vTextureUVY=worldPos.xz/uniforms.tileSize;\n#endif\n#ifdef DIFFUSEZ\nvertexOutputs.vTextureUVZ=worldPos.xy/uniforms.tileSize;\n#endif\n#ifdef NORMAL\nvar xtan: vec3f= vec3f(0,0,1);var xbin: vec3f= vec3f(0,1,0);var ytan: vec3f= vec3f(1,0,0);var ybin: vec3f= vec3f(0,0,1);var ztan: vec3f= vec3f(1,0,0);var zbin: vec3f= vec3f(0,1,0);var normalizedNormal: vec3f=normalize(vertexInputs.normal);normalizedNormal=normalizedNormal*normalizedNormal;var worldBinormal: vec3f=normalize(xbin*normalizedNormal.x+ybin*normalizedNormal.y+zbin*normalizedNormal.z);var worldTangent: vec3f=normalize(xtan*normalizedNormal.x+ytan*normalizedNormal.y+ztan*normalizedNormal.z);var normalWorld: mat3x3f= mat3x3f(finalWorld[0].xyz,finalWorld[1].xyz,finalWorld[2].xyz);\n#ifdef NONUNIFORMSCALING\nnormalWorld=transposeMat3(inverseMat3(normalWorld));\n#endif\nworldTangent=normalize((normalWorld*worldTangent).xyz);worldBinormal=normalize((normalWorld*worldBinormal).xyz);var worldNormal: vec3f=normalize((normalWorld*normalize(vertexInputs.normal)).xyz);vertexOutputs.tangentSpace0=worldTangent;vertexOutputs.tangentSpace1=worldBinormal;vertexOutputs.tangentSpace2=worldNormal;\n#endif\n#include<clipPlaneVertex>\n#include<logDepthVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#define CUSTOM_VERTEX_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStoreWGSL[name]) {\n ShaderStore.ShadersStoreWGSL[name] = shader;\n}\nconst includes = [helperFunctionsWGSL, bonesDeclarationWGSL, bakedVertexAnimationDeclarationWGSL, instancesDeclarationWGSL, clipPlaneVertexDeclarationWGSL, logDepthDeclarationWGSL, fogVertexDeclarationWGSL, lightVxFragmentDeclarationWGSL, lightVxUboDeclarationWGSL, instancesVertexWGSL, bonesVertexWGSL, bakedVertexAnimationWGSL, clipPlaneVertexWGSL, logDepthVertexWGSL, fogVertexWGSL, shadowsVertexWGSL, vertexColorMixingWGSL];\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 triplanarVertexShaderWGSL = { name, shader };\n"]}
|
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
import "@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js";
|
|
2
|
-
import "@babylonjs/core/Shaders/ShadersInclude/imageProcessingDeclaration.js";
|
|
3
|
-
import "@babylonjs/core/Shaders/ShadersInclude/imageProcessingFunctions.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/lightFragment.js";
|
|
13
|
-
import "@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js";
|
|
14
|
-
import "@babylonjs/core/Shaders/ShadersInclude/fogFragment.js";
|
|
15
1
|
/** @internal */
|
|
16
2
|
export declare const waterPixelShader: {
|
|
17
3
|
name: string;
|
package/water/water.fragment.js
CHANGED
|
@@ -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/imageProcessingDeclaration.js";
|
|
5
|
-
import "@babylonjs/core/Shaders/ShadersInclude/imageProcessingFunctions.js";
|
|
6
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js";
|
|
7
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js";
|
|
8
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightsFragmentFunctions.js";
|
|
9
|
-
import "@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js";
|
|
10
|
-
import "@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js";
|
|
11
|
-
import "@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js";
|
|
12
|
-
import "@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js";
|
|
13
|
-
import "@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js";
|
|
14
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightFragment.js";
|
|
15
|
-
import "@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js";
|
|
16
|
-
import "@babylonjs/core/Shaders/ShadersInclude/fogFragment.js";
|
|
3
|
+
import { helperFunctions } from "@babylonjs/core/Shaders/ShadersInclude/helperFunctions.js";
|
|
4
|
+
import { imageProcessingDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/imageProcessingDeclaration.js";
|
|
5
|
+
import { imageProcessingFunctions } from "@babylonjs/core/Shaders/ShadersInclude/imageProcessingFunctions.js";
|
|
6
|
+
import { lightFragmentDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js";
|
|
7
|
+
import { lightUboDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js";
|
|
8
|
+
import { lightsFragmentFunctions } from "@babylonjs/core/Shaders/ShadersInclude/lightsFragmentFunctions.js";
|
|
9
|
+
import { shadowsFragmentFunctions } from "@babylonjs/core/Shaders/ShadersInclude/shadowsFragmentFunctions.js";
|
|
10
|
+
import { clipPlaneFragmentDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragmentDeclaration.js";
|
|
11
|
+
import { logDepthDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.js";
|
|
12
|
+
import { fogFragmentDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/fogFragmentDeclaration.js";
|
|
13
|
+
import { clipPlaneFragment } from "@babylonjs/core/Shaders/ShadersInclude/clipPlaneFragment.js";
|
|
14
|
+
import { lightFragment } from "@babylonjs/core/Shaders/ShadersInclude/lightFragment.js";
|
|
15
|
+
import { logDepthFragment } from "@babylonjs/core/Shaders/ShadersInclude/logDepthFragment.js";
|
|
16
|
+
import { fogFragment } from "@babylonjs/core/Shaders/ShadersInclude/fogFragment.js";
|
|
17
17
|
const name = "waterPixelShader";
|
|
18
18
|
const shader = `#ifdef LOGARITHMICDEPTH
|
|
19
19
|
#extension GL_EXT_frag_depth : enable
|
|
@@ -158,6 +158,12 @@ gl_FragColor=color;
|
|
|
158
158
|
if (!ShaderStore.ShadersStore[name]) {
|
|
159
159
|
ShaderStore.ShadersStore[name] = shader;
|
|
160
160
|
}
|
|
161
|
+
const includes = [helperFunctions, imageProcessingDeclaration, imageProcessingFunctions, lightFragmentDeclaration, lightUboDeclaration, lightsFragmentFunctions, shadowsFragmentFunctions, clipPlaneFragmentDeclaration, logDepthDeclaration, fogFragmentDeclaration, clipPlaneFragment, lightFragment, logDepthFragment, fogFragment];
|
|
162
|
+
for (const inc of includes) {
|
|
163
|
+
if (!ShaderStore.IncludesShadersStore[inc.name]) {
|
|
164
|
+
ShaderStore.IncludesShadersStore[inc.name] = inc.shader;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
161
167
|
/** @internal */
|
|
162
168
|
export const waterPixelShader = { name, shader };
|
|
163
169
|
//# sourceMappingURL=water.fragment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"water.fragment.js","sourceRoot":"","sources":["../../../../dev/materials/src/water/water.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"water.fragment.js","sourceRoot":"","sources":["../../../../dev/materials/src/water/water.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,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,EAAE,wBAAwB,EAAE,MAAM,sDAAsD,CAAC;AAChG,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,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAEtE,MAAM,IAAI,GAAG,kBAAkB,CAAC;AAChC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Id,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,0BAA0B,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,aAAa,EAAE,gBAAgB,EAAE,WAAW,CAAC,CAAC;AACvU,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,gBAAgB,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 { imageProcessingDeclaration } from \"core/Shaders/ShadersInclude/imageProcessingDeclaration\";\nimport { imageProcessingFunctions } from \"core/Shaders/ShadersInclude/imageProcessingFunctions\";\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 { lightFragment } from \"core/Shaders/ShadersInclude/lightFragment\";\nimport { logDepthFragment } from \"core/Shaders/ShadersInclude/logDepthFragment\";\nimport { fogFragment } from \"core/Shaders/ShadersInclude/fogFragment\";\n\nconst name = \"waterPixelShader\";\nconst shader = `#ifdef LOGARITHMICDEPTH\n#extension GL_EXT_frag_depth : enable\n#endif\nprecision 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<imageProcessingDeclaration>\n#include<imageProcessingFunctions>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<lightsFragmentFunctions>\n#include<shadowsFragmentFunctions>\n#ifdef BUMP\nvarying vec2 vNormalUV;\n#ifdef BUMPSUPERIMPOSE\nvarying vec2 vNormalUV2;\n#endif\nuniform sampler2D normalSampler;uniform vec2 vNormalInfos;\n#endif\nuniform sampler2D refractionSampler;uniform sampler2D reflectionSampler;const float LOG2=1.442695;uniform vec3 cameraPosition;uniform vec4 waterColor;uniform float colorBlendFactor;uniform vec4 waterColor2;uniform float colorBlendFactor2;uniform float bumpHeight;uniform float time;varying vec3 vRefractionMapTexCoord;varying vec3 vReflectionMapTexCoord;\n#include<clipPlaneFragmentDeclaration>\n#include<logDepthDeclaration>\n#include<fogFragmentDeclaration>\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;float alpha=vDiffuseColor.a;\n#ifdef BUMP\n#ifdef BUMPSUPERIMPOSE\nbaseColor=0.6*texture2D(normalSampler,vNormalUV)+0.4*texture2D(normalSampler,vec2(vNormalUV2.x,vNormalUV2.y));\n#else\nbaseColor=texture2D(normalSampler,vNormalUV);\n#endif\nvec3 bumpColor=baseColor.rgb;\n#ifdef ALPHATEST\nif (baseColor.a<0.4)\ndiscard;\n#endif\nbaseColor.rgb*=vNormalInfos.y;\n#else\nvec3 bumpColor=vec3(1.0);\n#endif\n#if defined(VERTEXCOLOR) || defined(INSTANCESCOLOR) && defined(INSTANCES)\nbaseColor.rgb*=vColor.rgb;\n#endif\n#ifdef NORMAL\nvec2 perturbation=bumpHeight*(baseColor.rg-0.5);\n#ifdef BUMPAFFECTSREFLECTION\nvec3 normalW=normalize(vNormalW+vec3(perturbation.x*8.0,0.0,perturbation.y*8.0));if (normalW.y<0.0) {normalW.y=-normalW.y;}\n#else\nvec3 normalW=normalize(vNormalW);\n#endif\n#else\nvec3 normalW=vec3(1.0,1.0,1.0);vec2 perturbation=bumpHeight*(vec2(1.0,1.0)-0.5);\n#endif\n#ifdef FRESNELSEPARATE\n#ifdef REFLECTION\nvec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation*0.5,0.0,1.0);vec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor.rgb=toGammaSpace(refractiveColor.rgb);\n#endif\nvec2 projectedReflectionTexCoords=vec2(\nvReflectionMapTexCoord.x/vReflectionMapTexCoord.z+perturbation.x*0.3,\nvReflectionMapTexCoord.y/vReflectionMapTexCoord.z+perturbation.y\n);vec4 reflectiveColor=texture2D(reflectionSampler,projectedReflectionTexCoords);\n#ifdef IS_REFLECTION_LINEAR\nreflectiveColor.rgb=toGammaSpace(reflectiveColor.rgb);\n#endif\nvec3 upVector=vec3(0.0,1.0,0.0);float fresnelTerm=clamp(abs(pow(dot(viewDirectionW,upVector),3.0)),0.05,0.65);float IfresnelTerm=1.0-fresnelTerm;refractiveColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*refractiveColor;reflectiveColor=IfresnelTerm*colorBlendFactor2*waterColor+(1.0-colorBlendFactor2*IfresnelTerm)*reflectiveColor;vec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*IfresnelTerm;baseColor=combinedColor;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\nvec3 finalDiffuse=clamp(baseColor.rgb,0.0,1.0);\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\n#else \n#ifdef REFLECTION\nvec2 projectedRefractionTexCoords=clamp(vRefractionMapTexCoord.xy/vRefractionMapTexCoord.z+perturbation,0.0,1.0);vec4 refractiveColor=texture2D(refractionSampler,projectedRefractionTexCoords);\n#ifdef IS_REFRACTION_LINEAR\nrefractiveColor.rgb=toGammaSpace(refractiveColor.rgb);\n#endif\nvec2 projectedReflectionTexCoords=vReflectionMapTexCoord.xy/vReflectionMapTexCoord.z+perturbation;vec4 reflectiveColor=texture2D(reflectionSampler,projectedReflectionTexCoords);\n#ifdef IS_REFLECTION_LINEAR\nreflectiveColor.rgb=toGammaSpace(reflectiveColor.rgb);\n#endif\nvec3 upVector=vec3(0.0,1.0,0.0);float fresnelTerm=max(dot(viewDirectionW,upVector),0.0);vec4 combinedColor=refractiveColor*fresnelTerm+reflectiveColor*(1.0-fresnelTerm);baseColor=colorBlendFactor*waterColor+(1.0-colorBlendFactor)*combinedColor;\n#endif\nvec3 diffuseBase=vec3(0.,0.,0.);lightingInfo info;float shadow=1.;float aggShadow=0.;float numLights=0.;\n#ifdef SPECULARTERM\nfloat glossiness=vSpecularColor.a;vec3 specularBase=vec3(0.,0.,0.);vec3 specularColor=vSpecularColor.rgb;\n#else\nfloat glossiness=0.;\n#endif\n#include<lightFragment>[0..maxSimultaneousLights]\nvec3 finalDiffuse=clamp(baseColor.rgb,0.0,1.0);\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\n#endif\nvec4 color=vec4(finalDiffuse+finalSpecular,alpha);\n#include<logDepthFragment>\n#include<fogFragment>\n#ifdef IMAGEPROCESSINGPOSTPROCESS\ncolor.rgb=toLinearSpace(color.rgb);\n#elif defined(IMAGEPROCESSING)\ncolor.rgb=toLinearSpace(color.rgb);color=applyImageProcessing(color);\n#endif\ngl_FragColor=color;\n#define CUSTOM_FRAGMENT_MAIN_END\n}\n`;\n// Sideeffect\nif (!ShaderStore.ShadersStore[name]) {\n ShaderStore.ShadersStore[name] = shader;\n}\nconst includes = [helperFunctions, imageProcessingDeclaration, imageProcessingFunctions, lightFragmentDeclaration, lightUboDeclaration, lightsFragmentFunctions, shadowsFragmentFunctions, clipPlaneFragmentDeclaration, logDepthDeclaration, fogFragmentDeclaration, clipPlaneFragment, lightFragment, logDepthFragment, fogFragment];\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 waterPixelShader = { name, shader };\n"]}
|
package/water/water.vertex.d.ts
CHANGED
|
@@ -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/clipPlaneVertexDeclaration.js";
|
|
5
|
-
import "@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js";
|
|
6
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js";
|
|
7
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js";
|
|
8
|
-
import "@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.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/fogVertex.js";
|
|
14
|
-
import "@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js";
|
|
15
|
-
import "@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.js";
|
|
16
|
-
import "@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js";
|
|
17
1
|
/** @internal */
|
|
18
2
|
export declare const waterVertexShader: {
|
|
19
3
|
name: string;
|
package/water/water.vertex.js
CHANGED
|
@@ -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/clipPlaneVertexDeclaration.js";
|
|
7
|
-
import "@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js";
|
|
8
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js";
|
|
9
|
-
import "@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js";
|
|
10
|
-
import "@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.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/fogVertex.js";
|
|
16
|
-
import "@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js";
|
|
17
|
-
import "@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.js";
|
|
18
|
-
import "@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.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 { clipPlaneVertexDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/clipPlaneVertexDeclaration.js";
|
|
7
|
+
import { fogVertexDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/fogVertexDeclaration.js";
|
|
8
|
+
import { lightFragmentDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/lightFragmentDeclaration.js";
|
|
9
|
+
import { lightUboDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/lightUboDeclaration.js";
|
|
10
|
+
import { logDepthDeclaration } from "@babylonjs/core/Shaders/ShadersInclude/logDepthDeclaration.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 { fogVertex } from "@babylonjs/core/Shaders/ShadersInclude/fogVertex.js";
|
|
16
|
+
import { shadowsVertex } from "@babylonjs/core/Shaders/ShadersInclude/shadowsVertex.js";
|
|
17
|
+
import { vertexColorMixing } from "@babylonjs/core/Shaders/ShadersInclude/vertexColorMixing.js";
|
|
18
|
+
import { logDepthVertex } from "@babylonjs/core/Shaders/ShadersInclude/logDepthVertex.js";
|
|
19
19
|
const name = "waterVertexShader";
|
|
20
20
|
const shader = `precision highp float;attribute vec3 position;
|
|
21
21
|
#ifdef NORMAL
|
|
@@ -123,6 +123,12 @@ vRefractionMapTexCoord.x=0.5*(gl_Position.w+gl_Position.x);vRefractionMapTexCoor
|
|
|
123
123
|
if (!ShaderStore.ShadersStore[name]) {
|
|
124
124
|
ShaderStore.ShadersStore[name] = shader;
|
|
125
125
|
}
|
|
126
|
+
const includes = [bonesDeclaration, bakedVertexAnimationDeclaration, instancesDeclaration, clipPlaneVertexDeclaration, fogVertexDeclaration, lightFragmentDeclaration, lightUboDeclaration, logDepthDeclaration, instancesVertex, bonesVertex, bakedVertexAnimation, clipPlaneVertex, fogVertex, shadowsVertex, vertexColorMixing, logDepthVertex];
|
|
127
|
+
for (const inc of includes) {
|
|
128
|
+
if (!ShaderStore.IncludesShadersStore[inc.name]) {
|
|
129
|
+
ShaderStore.IncludesShadersStore[inc.name] = inc.shader;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
126
132
|
/** @internal */
|
|
127
133
|
export const waterVertexShader = { name, shader };
|
|
128
134
|
//# sourceMappingURL=water.vertex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"water.vertex.js","sourceRoot":"","sources":["../../../../dev/materials/src/water/water.vertex.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"water.vertex.js","sourceRoot":"","sources":["../../../../dev/materials/src/water/water.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,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,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,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAE5E,MAAM,IAAI,GAAG,mBAAmB,CAAC;AACjC,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqGd,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,0BAA0B,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,eAAe,EAAE,WAAW,EAAE,oBAAoB,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,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,iBAAiB,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 { 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 { logDepthDeclaration } from \"core/Shaders/ShadersInclude/logDepthDeclaration\";\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 { fogVertex } from \"core/Shaders/ShadersInclude/fogVertex\";\nimport { shadowsVertex } from \"core/Shaders/ShadersInclude/shadowsVertex\";\nimport { vertexColorMixing } from \"core/Shaders/ShadersInclude/vertexColorMixing\";\nimport { logDepthVertex } from \"core/Shaders/ShadersInclude/logDepthVertex\";\n\nconst name = \"waterVertexShader\";\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 BUMP\nvarying vec2 vNormalUV;\n#ifdef BUMPSUPERIMPOSE\nvarying vec2 vNormalUV2;\n#endif\nuniform mat4 normalMatrix;uniform vec2 vNormalInfos;\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<clipPlaneVertexDeclaration>\n#include<fogVertexDeclaration>\n#include<__decl__lightFragment>[0..maxSimultaneousLights]\n#include<logDepthDeclaration>\nuniform mat4 reflectionViewProjection;uniform vec2 windDirection;uniform float waveLength;uniform float time;uniform float windForce;uniform float waveHeight;uniform float waveSpeed;uniform float waveCount;varying vec3 vRefractionMapTexCoord;varying vec3 vReflectionMapTexCoord;\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);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 BUMP\nif (vNormalInfos.x==0.)\n{vNormalUV=vec2(normalMatrix*vec4((uv*1.0)/waveLength+time*windForce*windDirection,1.0,0.0));\n#ifdef BUMPSUPERIMPOSE\nvNormalUV2=vec2(normalMatrix*vec4((uv*0.721)/waveLength+time*1.2*windForce*windDirection,1.0,0.0));\n#endif\n}\nelse\n{vNormalUV=vec2(normalMatrix*vec4((uv2*1.0)/waveLength+time*windForce*windDirection ,1.0,0.0));\n#ifdef BUMPSUPERIMPOSE\nvNormalUV2=vec2(normalMatrix*vec4((uv2*0.721)/waveLength+time*1.2*windForce*windDirection ,1.0,0.0));\n#endif\n}\n#endif\n#include<clipPlaneVertex>\n#include<fogVertex>\n#include<shadowsVertex>[0..maxSimultaneousLights]\n#include<vertexColorMixing>\n#if defined(POINTSIZE) && !defined(WEBGPU)\ngl_PointSize=pointSize;\n#endif\nfloat finalWaveCount=1.0/(waveCount*0.5);\n#ifdef USE_WORLD_COORDINATES\nvec3 p=worldPos.xyz;\n#else\nvec3 p=position;\n#endif\nfloat newY=(sin(((p.x/finalWaveCount)+time*waveSpeed))*waveHeight*windDirection.x*5.0)\n+ (cos(((p.z/finalWaveCount)+ time*waveSpeed))*waveHeight*windDirection.y*5.0);p.y+=abs(newY);\n#ifdef USE_WORLD_COORDINATES\ngl_Position=viewProjection*vec4(p,1.0);\n#else\ngl_Position=viewProjection*finalWorld*vec4(p,1.0);\n#endif\n#ifdef REFLECTION\nvRefractionMapTexCoord.x=0.5*(gl_Position.w+gl_Position.x);vRefractionMapTexCoord.y=0.5*(gl_Position.w+gl_Position.y);vRefractionMapTexCoord.z=gl_Position.w;worldPos=reflectionViewProjection*finalWorld*vec4(position,1.0);vReflectionMapTexCoord.x=0.5*(worldPos.w+worldPos.x);vReflectionMapTexCoord.y=0.5*(worldPos.w+worldPos.y);vReflectionMapTexCoord.z=worldPos.w;\n#endif\n#include<logDepthVertex>\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, clipPlaneVertexDeclaration, fogVertexDeclaration, lightFragmentDeclaration, lightUboDeclaration, logDepthDeclaration, instancesVertex, bonesVertex, bakedVertexAnimation, clipPlaneVertex, fogVertex, shadowsVertex, vertexColorMixing, logDepthVertex];\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 waterVertexShader = { name, shader };\n"]}
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/helperFunctions.js";
|
|
2
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.js";
|
|
3
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/imageProcessingFunctions.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/lightFragment.js";
|
|
12
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthFragment.js";
|
|
13
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragment.js";
|
|
14
1
|
/** @internal */
|
|
15
2
|
export declare const waterPixelShaderWGSL: {
|
|
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/imageProcessingDeclaration.js";
|
|
5
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js";
|
|
6
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightUboDeclaration.js";
|
|
7
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js";
|
|
8
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js";
|
|
9
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.js";
|
|
10
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
11
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.js";
|
|
12
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragment.js";
|
|
13
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/lightFragment.js";
|
|
14
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthFragment.js";
|
|
15
|
-
import "@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragment.js";
|
|
3
|
+
import { helperFunctionsWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/helperFunctions.js";
|
|
4
|
+
import { imageProcessingDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/imageProcessingDeclaration.js";
|
|
5
|
+
import { imageProcessingFunctionsWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/imageProcessingFunctions.js";
|
|
6
|
+
import { lightUboDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/lightUboDeclaration.js";
|
|
7
|
+
import { lightsFragmentFunctionsWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js";
|
|
8
|
+
import { shadowsFragmentFunctionsWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/shadowsFragmentFunctions.js";
|
|
9
|
+
import { clipPlaneFragmentDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragmentDeclaration.js";
|
|
10
|
+
import { logDepthDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthDeclaration.js";
|
|
11
|
+
import { fogFragmentDeclarationWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragmentDeclaration.js";
|
|
12
|
+
import { clipPlaneFragmentWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/clipPlaneFragment.js";
|
|
13
|
+
import { lightFragmentWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/lightFragment.js";
|
|
14
|
+
import { logDepthFragmentWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/logDepthFragment.js";
|
|
15
|
+
import { fogFragmentWGSL } from "@babylonjs/core/ShadersWGSL/ShadersInclude/fogFragment.js";
|
|
16
16
|
const name = "waterPixelShader";
|
|
17
17
|
const shader = `uniform vEyePosition: vec4f;uniform vDiffuseColor: vec4f;
|
|
18
18
|
#ifdef SPECULARTERM
|
|
@@ -154,6 +154,12 @@ fragmentOutputs.color=color;
|
|
|
154
154
|
if (!ShaderStore.ShadersStoreWGSL[name]) {
|
|
155
155
|
ShaderStore.ShadersStoreWGSL[name] = shader;
|
|
156
156
|
}
|
|
157
|
+
const includes = [helperFunctionsWGSL, imageProcessingDeclarationWGSL, imageProcessingFunctionsWGSL, lightUboDeclarationWGSL, lightsFragmentFunctionsWGSL, shadowsFragmentFunctionsWGSL, clipPlaneFragmentDeclarationWGSL, logDepthDeclarationWGSL, fogFragmentDeclarationWGSL, clipPlaneFragmentWGSL, lightFragmentWGSL, logDepthFragmentWGSL, fogFragmentWGSL];
|
|
158
|
+
for (const inc of includes) {
|
|
159
|
+
if (!ShaderStore.IncludesShadersStoreWGSL[inc.name]) {
|
|
160
|
+
ShaderStore.IncludesShadersStoreWGSL[inc.name] = inc.shader;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
157
163
|
/** @internal */
|
|
158
164
|
export const waterPixelShaderWGSL = { name, shader };
|
|
159
165
|
//# sourceMappingURL=water.fragment.js.map
|