@babylonjs/procedural-textures 5.0.0-beta.9 → 5.0.0-rc.10

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.
Files changed (128) hide show
  1. package/brick/brickProceduralTexture.d.ts +35 -35
  2. package/brick/brickProceduralTexture.fragment.d.ts +5 -5
  3. package/brick/brickProceduralTexture.fragment.js +8 -6
  4. package/brick/brickProceduralTexture.fragment.js.map +1 -1
  5. package/brick/brickProceduralTexture.js +104 -104
  6. package/brick/brickProceduralTexture.js.map +1 -1
  7. package/brick/index.d.ts +1 -1
  8. package/brick/index.js +1 -1
  9. package/brick/index.js.map +1 -1
  10. package/cloud/cloudProceduralTexture.d.ts +35 -35
  11. package/cloud/cloudProceduralTexture.fragment.d.ts +5 -5
  12. package/cloud/cloudProceduralTexture.fragment.js +8 -6
  13. package/cloud/cloudProceduralTexture.fragment.js.map +1 -1
  14. package/cloud/cloudProceduralTexture.js +104 -104
  15. package/cloud/cloudProceduralTexture.js.map +1 -1
  16. package/cloud/index.d.ts +1 -1
  17. package/cloud/index.js +1 -1
  18. package/cloud/index.js.map +1 -1
  19. package/fire/fireProceduralTexture.d.ts +44 -44
  20. package/fire/fireProceduralTexture.fragment.d.ts +5 -5
  21. package/fire/fireProceduralTexture.fragment.js +8 -6
  22. package/fire/fireProceduralTexture.fragment.js.map +1 -1
  23. package/fire/fireProceduralTexture.js +166 -194
  24. package/fire/fireProceduralTexture.js.map +1 -1
  25. package/fire/index.d.ts +1 -1
  26. package/fire/index.js +1 -1
  27. package/fire/index.js.map +1 -1
  28. package/grass/grassProceduralTexture.d.ts +29 -29
  29. package/grass/grassProceduralTexture.fragment.d.ts +5 -5
  30. package/grass/grassProceduralTexture.fragment.js +8 -6
  31. package/grass/grassProceduralTexture.fragment.js.map +1 -1
  32. package/grass/grassProceduralTexture.js +80 -84
  33. package/grass/grassProceduralTexture.js.map +1 -1
  34. package/grass/index.d.ts +1 -1
  35. package/grass/index.js +1 -1
  36. package/grass/index.js.map +1 -1
  37. package/index.d.ts +10 -10
  38. package/index.js +11 -10
  39. package/index.js.map +1 -1
  40. package/legacy/legacy-brick.d.ts +1 -1
  41. package/legacy/legacy-brick.js +13 -12
  42. package/legacy/legacy-brick.js.map +1 -1
  43. package/legacy/legacy-cloud.d.ts +1 -1
  44. package/legacy/legacy-cloud.js +13 -12
  45. package/legacy/legacy-cloud.js.map +1 -1
  46. package/legacy/legacy-fire.d.ts +1 -1
  47. package/legacy/legacy-fire.js +13 -12
  48. package/legacy/legacy-fire.js.map +1 -1
  49. package/legacy/legacy-grass.d.ts +1 -1
  50. package/legacy/legacy-grass.js +13 -12
  51. package/legacy/legacy-grass.js.map +1 -1
  52. package/legacy/legacy-marble.d.ts +1 -1
  53. package/legacy/legacy-marble.js +13 -12
  54. package/legacy/legacy-marble.js.map +1 -1
  55. package/legacy/legacy-normalMap.d.ts +1 -1
  56. package/legacy/legacy-normalMap.js +13 -12
  57. package/legacy/legacy-normalMap.js.map +1 -1
  58. package/legacy/legacy-perlinNoise.d.ts +1 -1
  59. package/legacy/legacy-perlinNoise.js +13 -12
  60. package/legacy/legacy-perlinNoise.js.map +1 -1
  61. package/legacy/legacy-road.d.ts +1 -1
  62. package/legacy/legacy-road.js +13 -12
  63. package/legacy/legacy-road.js.map +1 -1
  64. package/legacy/legacy-starfield.d.ts +1 -1
  65. package/legacy/legacy-starfield.js +13 -12
  66. package/legacy/legacy-starfield.js.map +1 -1
  67. package/legacy/legacy-wood.d.ts +1 -1
  68. package/legacy/legacy-wood.js +13 -12
  69. package/legacy/legacy-wood.js.map +1 -1
  70. package/legacy/legacy.d.ts +1 -1
  71. package/legacy/legacy.js +16 -15
  72. package/legacy/legacy.js.map +1 -1
  73. package/marble/index.d.ts +1 -1
  74. package/marble/index.js +1 -1
  75. package/marble/index.js.map +1 -1
  76. package/marble/marbleProceduralTexture.d.ts +35 -35
  77. package/marble/marbleProceduralTexture.fragment.d.ts +5 -5
  78. package/marble/marbleProceduralTexture.fragment.js +8 -6
  79. package/marble/marbleProceduralTexture.fragment.js.map +1 -1
  80. package/marble/marbleProceduralTexture.js +104 -104
  81. package/marble/marbleProceduralTexture.js.map +1 -1
  82. package/normalMap/index.d.ts +1 -1
  83. package/normalMap/index.js +1 -1
  84. package/normalMap/index.js.map +1 -1
  85. package/normalMap/normalMapProceduralTexture.d.ts +28 -28
  86. package/normalMap/normalMapProceduralTexture.fragment.d.ts +5 -5
  87. package/normalMap/normalMapProceduralTexture.fragment.js +8 -6
  88. package/normalMap/normalMapProceduralTexture.fragment.js.map +1 -1
  89. package/normalMap/normalMapProceduralTexture.js +69 -69
  90. package/normalMap/normalMapProceduralTexture.js.map +1 -1
  91. package/package.json +22 -152
  92. package/perlinNoise/index.d.ts +1 -1
  93. package/perlinNoise/index.js +1 -1
  94. package/perlinNoise/index.js.map +1 -1
  95. package/perlinNoise/perlinNoiseProceduralTexture.d.ts +28 -28
  96. package/perlinNoise/perlinNoiseProceduralTexture.fragment.d.ts +5 -5
  97. package/perlinNoise/perlinNoiseProceduralTexture.fragment.js +8 -6
  98. package/perlinNoise/perlinNoiseProceduralTexture.fragment.js.map +1 -1
  99. package/perlinNoise/perlinNoiseProceduralTexture.js +69 -69
  100. package/perlinNoise/perlinNoiseProceduralTexture.js.map +1 -1
  101. package/readme.md +2 -2
  102. package/road/index.d.ts +1 -1
  103. package/road/index.js +1 -1
  104. package/road/index.js.map +1 -1
  105. package/road/roadProceduralTexture.d.ts +26 -26
  106. package/road/roadProceduralTexture.fragment.d.ts +5 -5
  107. package/road/roadProceduralTexture.fragment.js +8 -6
  108. package/road/roadProceduralTexture.fragment.js.map +1 -1
  109. package/road/roadProceduralTexture.js +56 -56
  110. package/road/roadProceduralTexture.js.map +1 -1
  111. package/starfield/index.d.ts +1 -1
  112. package/starfield/index.js +1 -1
  113. package/starfield/index.js.map +1 -1
  114. package/starfield/starfieldProceduralTexture.d.ts +55 -55
  115. package/starfield/starfieldProceduralTexture.fragment.d.ts +5 -5
  116. package/starfield/starfieldProceduralTexture.fragment.js +8 -6
  117. package/starfield/starfieldProceduralTexture.fragment.js.map +1 -1
  118. package/starfield/starfieldProceduralTexture.js +215 -215
  119. package/starfield/starfieldProceduralTexture.js.map +1 -1
  120. package/wood/index.d.ts +1 -1
  121. package/wood/index.js +1 -1
  122. package/wood/index.js.map +1 -1
  123. package/wood/woodProceduralTexture.d.ts +29 -29
  124. package/wood/woodProceduralTexture.fragment.d.ts +5 -5
  125. package/wood/woodProceduralTexture.fragment.js +8 -6
  126. package/wood/woodProceduralTexture.fragment.js.map +1 -1
  127. package/wood/woodProceduralTexture.js +72 -72
  128. package/wood/woodProceduralTexture.js.map +1 -1
@@ -1,35 +1,35 @@
1
- import { Color3 } from "@babylonjs/core/Maths/math.color";
2
- import { Texture } from "@babylonjs/core/Materials/Textures/texture";
3
- import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture";
4
- import { Scene } from "@babylonjs/core/scene";
5
- import { Nullable } from "@babylonjs/core/types";
6
- import "./brickProceduralTexture.fragment";
7
- export declare class BrickProceduralTexture extends ProceduralTexture {
8
- private _numberOfBricksHeight;
9
- private _numberOfBricksWidth;
10
- private _jointColor;
11
- private _brickColor;
12
- constructor(name: string, size: number, scene?: Nullable<Scene>, fallbackTexture?: Texture, generateMipMaps?: boolean);
13
- updateShaderUniforms(): void;
14
- get numberOfBricksHeight(): number;
15
- set numberOfBricksHeight(value: number);
16
- get numberOfBricksWidth(): number;
17
- set numberOfBricksWidth(value: number);
18
- get jointColor(): Color3;
19
- set jointColor(value: Color3);
20
- get brickColor(): Color3;
21
- set brickColor(value: Color3);
22
- /**
23
- * Serializes this brick procedural texture
24
- * @returns a serialized brick procedural texture object
25
- */
26
- serialize(): any;
27
- /**
28
- * Creates a Brick Procedural Texture from parsed brick procedural texture data
29
- * @param parsedTexture defines parsed texture data
30
- * @param scene defines the current scene
31
- * @param rootUrl defines the root URL containing brick procedural texture information
32
- * @returns a parsed Brick Procedural Texture
33
- */
34
- static Parse(parsedTexture: any, scene: Scene, rootUrl: string): BrickProceduralTexture;
35
- }
1
+ import { Color3 } from "@babylonjs/core/Maths/math.color.js";
2
+ import type { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
3
+ import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
4
+ import type { Scene } from "@babylonjs/core/scene.js";
5
+ import type { Nullable } from "@babylonjs/core/types.js";
6
+ import "./brickProceduralTexture.fragment";
7
+ export declare class BrickProceduralTexture extends ProceduralTexture {
8
+ private _numberOfBricksHeight;
9
+ private _numberOfBricksWidth;
10
+ private _jointColor;
11
+ private _brickColor;
12
+ constructor(name: string, size: number, scene?: Nullable<Scene>, fallbackTexture?: Texture, generateMipMaps?: boolean);
13
+ updateShaderUniforms(): void;
14
+ get numberOfBricksHeight(): number;
15
+ set numberOfBricksHeight(value: number);
16
+ get numberOfBricksWidth(): number;
17
+ set numberOfBricksWidth(value: number);
18
+ get jointColor(): Color3;
19
+ set jointColor(value: Color3);
20
+ get brickColor(): Color3;
21
+ set brickColor(value: Color3);
22
+ /**
23
+ * Serializes this brick procedural texture
24
+ * @returns a serialized brick procedural texture object
25
+ */
26
+ serialize(): any;
27
+ /**
28
+ * Creates a Brick Procedural Texture from parsed brick procedural texture data
29
+ * @param parsedTexture defines parsed texture data
30
+ * @param scene defines the current scene
31
+ * @param rootUrl defines the root URL containing brick procedural texture information
32
+ * @returns a parsed Brick Procedural Texture
33
+ */
34
+ static Parse(parsedTexture: any, scene: Scene, rootUrl: string): BrickProceduralTexture;
35
+ }
@@ -1,5 +1,5 @@
1
- /** @hidden */
2
- export declare var brickProceduralTexturePixelShader: {
3
- name: string;
4
- shader: string;
5
- };
1
+ /** @hidden */
2
+ export declare const brickProceduralTexturePixelShader: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -1,7 +1,9 @@
1
- import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
2
- var name = 'brickProceduralTexturePixelShader';
3
- var shader = "precision highp float;\nvarying vec2 vPosition;\nvarying vec2 vUV;\nuniform float numberOfBricksHeight;\nuniform float numberOfBricksWidth;\nuniform vec3 brickColor;\nuniform vec3 jointColor;\nfloat rand(vec2 n) {\nreturn fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);\n}\nfloat noise(vec2 n) {\nconst vec2 d=vec2(0.0,1.0);\nvec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));\nreturn mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);\n}\nfloat fbm(vec2 n) {\nfloat total=0.0,amplitude=1.0;\nfor (int i=0; i<4; i++) {\ntotal+=noise(n)*amplitude;\nn+=n;\namplitude*=0.5;\n}\nreturn total;\n}\nfloat roundF(float number){\nreturn sign(number)*floor(abs(number)+0.5);\n}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{\nfloat brickW=1.0/numberOfBricksWidth;\nfloat brickH=1.0/numberOfBricksHeight;\nfloat jointWPercentage=0.01;\nfloat jointHPercentage=0.05;\nvec3 color=brickColor;\nfloat yi=vUV.y/brickH;\nfloat nyi=roundF(yi);\nfloat xi=vUV.x/brickW;\nif (mod(floor(yi),2.0) == 0.0){\nxi=xi-0.5;\n}\nfloat nxi=roundF(xi);\nvec2 brickvUV=vec2((xi-floor(xi))/brickH,(yi-floor(yi))/brickW);\nif (yi<nyi+jointHPercentage && yi>nyi-jointHPercentage){\ncolor=mix(jointColor,vec3(0.37,0.25,0.25),(yi-nyi)/jointHPercentage+0.2);\n}\nelse if (xi<nxi+jointWPercentage && xi>nxi-jointWPercentage){\ncolor=mix(jointColor,vec3(0.44,0.44,0.44),(xi-nxi)/jointWPercentage+0.2);\n}\nelse {\nfloat brickColorSwitch=mod(floor(yi)+floor(xi),3.0);\nif (brickColorSwitch == 0.0)\ncolor=mix(color,vec3(0.33,0.33,0.33),0.3);\nelse if (brickColorSwitch == 2.0)\ncolor=mix(color,vec3(0.11,0.11,0.11),0.3);\n}\ngl_FragColor=vec4(color,1.0);\n}";
4
- ShaderStore.ShadersStore[name] = shader;
5
- /** @hidden */
6
- export var brickProceduralTexturePixelShader = { name: name, shader: shader };
1
+ // Do not edit.
2
+ import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
3
+ var name = "brickProceduralTexturePixelShader";
4
+ var shader = "precision highp float;varying vec2 vPosition;varying vec2 vUV;uniform float numberOfBricksHeight;uniform float numberOfBricksWidth;uniform vec3 brickColor;uniform vec3 jointColor;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}\nfloat noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}\nfloat fbm(vec2 n) {float total=0.0,amplitude=1.0;for (int i=0; i<4; i++) {total+=noise(n)*amplitude;n+=n;amplitude*=0.5;}\nreturn total;}\nfloat roundF(float number){return sign(number)*floor(abs(number)+0.5);}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{float brickW=1.0/numberOfBricksWidth;float brickH=1.0/numberOfBricksHeight;float jointWPercentage=0.01;float jointHPercentage=0.05;vec3 color=brickColor;float yi=vUV.y/brickH;float nyi=roundF(yi);float xi=vUV.x/brickW;if (mod(floor(yi),2.0)==0.0){xi=xi-0.5;}\nfloat nxi=roundF(xi);vec2 brickvUV=vec2((xi-floor(xi))/brickH,(yi-floor(yi))/ brickW);if (yi<nyi+jointHPercentage && yi>nyi-jointHPercentage){color=mix(jointColor,vec3(0.37,0.25,0.25),(yi-nyi)/jointHPercentage+0.2);}\nelse if (xi<nxi+jointWPercentage && xi>nxi-jointWPercentage){color=mix(jointColor,vec3(0.44,0.44,0.44),(xi-nxi)/jointWPercentage+0.2);}\nelse {float brickColorSwitch=mod(floor(yi)+floor(xi),3.0);if (brickColorSwitch==0.0)\ncolor=mix(color,vec3(0.33,0.33,0.33),0.3);else if (brickColorSwitch==2.0)\ncolor=mix(color,vec3(0.11,0.11,0.11),0.3);}\ngl_FragColor=vec4(color,1.0);}";
5
+ // Sideeffect
6
+ ShaderStore.ShadersStore[name] = shader;
7
+ /** @hidden */
8
+ export var brickProceduralTexturePixelShader = { name: name, shader: shader };
7
9
  //# sourceMappingURL=brickProceduralTexture.fragment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"brickProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/brick/brickProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAElE,IAAI,IAAI,GAAG,mCAAmC,CAAC;AAC/C,IAAI,MAAM,GAAG,goDAyDX,CAAC;AAEH,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,cAAc;AACd,MAAM,CAAC,IAAI,iCAAiC,GAAG,EAAE,IAAI,MAAA,EAAE,MAAM,QAAA,EAAE,CAAC","sourcesContent":["import { ShaderStore } from \"@babylonjs/core/Engines/shaderStore\";\n\nlet name = 'brickProceduralTexturePixelShader';\nlet shader = `precision highp float;\nvarying vec2 vPosition;\nvarying vec2 vUV;\nuniform float numberOfBricksHeight;\nuniform float numberOfBricksWidth;\nuniform vec3 brickColor;\nuniform vec3 jointColor;\nfloat rand(vec2 n) {\nreturn fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);\n}\nfloat noise(vec2 n) {\nconst vec2 d=vec2(0.0,1.0);\nvec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));\nreturn mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);\n}\nfloat fbm(vec2 n) {\nfloat total=0.0,amplitude=1.0;\nfor (int i=0; i<4; i++) {\ntotal+=noise(n)*amplitude;\nn+=n;\namplitude*=0.5;\n}\nreturn total;\n}\nfloat roundF(float number){\nreturn sign(number)*floor(abs(number)+0.5);\n}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{\nfloat brickW=1.0/numberOfBricksWidth;\nfloat brickH=1.0/numberOfBricksHeight;\nfloat jointWPercentage=0.01;\nfloat jointHPercentage=0.05;\nvec3 color=brickColor;\nfloat yi=vUV.y/brickH;\nfloat nyi=roundF(yi);\nfloat xi=vUV.x/brickW;\nif (mod(floor(yi),2.0) == 0.0){\nxi=xi-0.5;\n}\nfloat nxi=roundF(xi);\nvec2 brickvUV=vec2((xi-floor(xi))/brickH,(yi-floor(yi))/brickW);\nif (yi<nyi+jointHPercentage && yi>nyi-jointHPercentage){\ncolor=mix(jointColor,vec3(0.37,0.25,0.25),(yi-nyi)/jointHPercentage+0.2);\n}\nelse if (xi<nxi+jointWPercentage && xi>nxi-jointWPercentage){\ncolor=mix(jointColor,vec3(0.44,0.44,0.44),(xi-nxi)/jointWPercentage+0.2);\n}\nelse {\nfloat brickColorSwitch=mod(floor(yi)+floor(xi),3.0);\nif (brickColorSwitch == 0.0)\ncolor=mix(color,vec3(0.33,0.33,0.33),0.3);\nelse if (brickColorSwitch == 2.0)\ncolor=mix(color,vec3(0.11,0.11,0.11),0.3);\n}\ngl_FragColor=vec4(color,1.0);\n}`;\n\nShaderStore.ShadersStore[name] = shader;\n/** @hidden */\nexport var brickProceduralTexturePixelShader = { name, shader };\n"]}
1
+ {"version":3,"file":"brickProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/brick/brickProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAEvD,IAAM,IAAI,GAAG,mCAAmC,CAAC;AACjD,IAAM,MAAM,GAAG,miDAagB,CAAC;AAChC,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,cAAc;AACd,MAAM,CAAC,IAAM,iCAAiC,GAAG,EAAE,IAAI,MAAA,EAAE,MAAM,QAAA,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\n\nconst name = \"brickProceduralTexturePixelShader\";\nconst shader = `precision highp float;varying vec2 vPosition;varying vec2 vUV;uniform float numberOfBricksHeight;uniform float numberOfBricksWidth;uniform vec3 brickColor;uniform vec3 jointColor;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}\nfloat noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}\nfloat fbm(vec2 n) {float total=0.0,amplitude=1.0;for (int i=0; i<4; i++) {total+=noise(n)*amplitude;n+=n;amplitude*=0.5;}\nreturn total;}\nfloat roundF(float number){return sign(number)*floor(abs(number)+0.5);}\n#define CUSTOM_FRAGMENT_DEFINITIONS\nvoid main(void)\n{float brickW=1.0/numberOfBricksWidth;float brickH=1.0/numberOfBricksHeight;float jointWPercentage=0.01;float jointHPercentage=0.05;vec3 color=brickColor;float yi=vUV.y/brickH;float nyi=roundF(yi);float xi=vUV.x/brickW;if (mod(floor(yi),2.0)==0.0){xi=xi-0.5;}\nfloat nxi=roundF(xi);vec2 brickvUV=vec2((xi-floor(xi))/brickH,(yi-floor(yi))/ brickW);if (yi<nyi+jointHPercentage && yi>nyi-jointHPercentage){color=mix(jointColor,vec3(0.37,0.25,0.25),(yi-nyi)/jointHPercentage+0.2);}\nelse if (xi<nxi+jointWPercentage && xi>nxi-jointWPercentage){color=mix(jointColor,vec3(0.44,0.44,0.44),(xi-nxi)/jointWPercentage+0.2);}\nelse {float brickColorSwitch=mod(floor(yi)+floor(xi),3.0);if (brickColorSwitch==0.0)\ncolor=mix(color,vec3(0.33,0.33,0.33),0.3);else if (brickColorSwitch==2.0)\ncolor=mix(color,vec3(0.11,0.11,0.11),0.3);}\ngl_FragColor=vec4(color,1.0);}`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @hidden */\nexport const brickProceduralTexturePixelShader = { name, shader };\n"]}
@@ -1,105 +1,105 @@
1
- import { __decorate, __extends } from "tslib";
2
- import { serialize, serializeAsColor3, SerializationHelper } from "@babylonjs/core/Misc/decorators.js";
3
- import { Color3 } from "@babylonjs/core/Maths/math.color.js";
4
- import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
5
- import { RegisterClass } from '@babylonjs/core/Misc/typeStore.js';
6
- import "./brickProceduralTexture.fragment.js";
7
- var BrickProceduralTexture = /** @class */ (function (_super) {
8
- __extends(BrickProceduralTexture, _super);
9
- function BrickProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
10
- if (scene === void 0) { scene = null; }
11
- var _this = _super.call(this, name, size, "brickProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
12
- _this._numberOfBricksHeight = 15;
13
- _this._numberOfBricksWidth = 5;
14
- _this._jointColor = new Color3(0.72, 0.72, 0.72);
15
- _this._brickColor = new Color3(0.77, 0.47, 0.40);
16
- _this.updateShaderUniforms();
17
- return _this;
18
- }
19
- BrickProceduralTexture.prototype.updateShaderUniforms = function () {
20
- this.setFloat("numberOfBricksHeight", this._numberOfBricksHeight);
21
- this.setFloat("numberOfBricksWidth", this._numberOfBricksWidth);
22
- this.setColor3("brickColor", this._brickColor);
23
- this.setColor3("jointColor", this._jointColor);
24
- };
25
- Object.defineProperty(BrickProceduralTexture.prototype, "numberOfBricksHeight", {
26
- get: function () {
27
- return this._numberOfBricksHeight;
28
- },
29
- set: function (value) {
30
- this._numberOfBricksHeight = value;
31
- this.updateShaderUniforms();
32
- },
33
- enumerable: false,
34
- configurable: true
35
- });
36
- Object.defineProperty(BrickProceduralTexture.prototype, "numberOfBricksWidth", {
37
- get: function () {
38
- return this._numberOfBricksWidth;
39
- },
40
- set: function (value) {
41
- this._numberOfBricksWidth = value;
42
- this.updateShaderUniforms();
43
- },
44
- enumerable: false,
45
- configurable: true
46
- });
47
- Object.defineProperty(BrickProceduralTexture.prototype, "jointColor", {
48
- get: function () {
49
- return this._jointColor;
50
- },
51
- set: function (value) {
52
- this._jointColor = value;
53
- this.updateShaderUniforms();
54
- },
55
- enumerable: false,
56
- configurable: true
57
- });
58
- Object.defineProperty(BrickProceduralTexture.prototype, "brickColor", {
59
- get: function () {
60
- return this._brickColor;
61
- },
62
- set: function (value) {
63
- this._brickColor = value;
64
- this.updateShaderUniforms();
65
- },
66
- enumerable: false,
67
- configurable: true
68
- });
69
- /**
70
- * Serializes this brick procedural texture
71
- * @returns a serialized brick procedural texture object
72
- */
73
- BrickProceduralTexture.prototype.serialize = function () {
74
- var serializationObject = SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
75
- serializationObject.customType = "BABYLON.BrickProceduralTexture";
76
- return serializationObject;
77
- };
78
- /**
79
- * Creates a Brick Procedural Texture from parsed brick procedural texture data
80
- * @param parsedTexture defines parsed texture data
81
- * @param scene defines the current scene
82
- * @param rootUrl defines the root URL containing brick procedural texture information
83
- * @returns a parsed Brick Procedural Texture
84
- */
85
- BrickProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
86
- var texture = SerializationHelper.Parse(function () { return new BrickProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
87
- return texture;
88
- };
89
- __decorate([
90
- serialize()
91
- ], BrickProceduralTexture.prototype, "numberOfBricksHeight", null);
92
- __decorate([
93
- serialize()
94
- ], BrickProceduralTexture.prototype, "numberOfBricksWidth", null);
95
- __decorate([
96
- serializeAsColor3()
97
- ], BrickProceduralTexture.prototype, "jointColor", null);
98
- __decorate([
99
- serializeAsColor3()
100
- ], BrickProceduralTexture.prototype, "brickColor", null);
101
- return BrickProceduralTexture;
102
- }(ProceduralTexture));
103
- export { BrickProceduralTexture };
104
- RegisterClass("BABYLON.BrickProceduralTexture", BrickProceduralTexture);
1
+ import { __decorate, __extends } from "tslib";
2
+ import { serialize, serializeAsColor3, SerializationHelper } from "@babylonjs/core/Misc/decorators.js";
3
+ import { Color3 } from "@babylonjs/core/Maths/math.color.js";
4
+ import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
5
+ import { RegisterClass } from "@babylonjs/core/Misc/typeStore.js";
6
+ import "./brickProceduralTexture.fragment";
7
+ var BrickProceduralTexture = /** @class */ (function (_super) {
8
+ __extends(BrickProceduralTexture, _super);
9
+ function BrickProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
10
+ if (scene === void 0) { scene = null; }
11
+ var _this = _super.call(this, name, size, "brickProceduralTexture", scene, fallbackTexture, generateMipMaps) || this;
12
+ _this._numberOfBricksHeight = 15;
13
+ _this._numberOfBricksWidth = 5;
14
+ _this._jointColor = new Color3(0.72, 0.72, 0.72);
15
+ _this._brickColor = new Color3(0.77, 0.47, 0.4);
16
+ _this.updateShaderUniforms();
17
+ return _this;
18
+ }
19
+ BrickProceduralTexture.prototype.updateShaderUniforms = function () {
20
+ this.setFloat("numberOfBricksHeight", this._numberOfBricksHeight);
21
+ this.setFloat("numberOfBricksWidth", this._numberOfBricksWidth);
22
+ this.setColor3("brickColor", this._brickColor);
23
+ this.setColor3("jointColor", this._jointColor);
24
+ };
25
+ Object.defineProperty(BrickProceduralTexture.prototype, "numberOfBricksHeight", {
26
+ get: function () {
27
+ return this._numberOfBricksHeight;
28
+ },
29
+ set: function (value) {
30
+ this._numberOfBricksHeight = value;
31
+ this.updateShaderUniforms();
32
+ },
33
+ enumerable: false,
34
+ configurable: true
35
+ });
36
+ Object.defineProperty(BrickProceduralTexture.prototype, "numberOfBricksWidth", {
37
+ get: function () {
38
+ return this._numberOfBricksWidth;
39
+ },
40
+ set: function (value) {
41
+ this._numberOfBricksWidth = value;
42
+ this.updateShaderUniforms();
43
+ },
44
+ enumerable: false,
45
+ configurable: true
46
+ });
47
+ Object.defineProperty(BrickProceduralTexture.prototype, "jointColor", {
48
+ get: function () {
49
+ return this._jointColor;
50
+ },
51
+ set: function (value) {
52
+ this._jointColor = value;
53
+ this.updateShaderUniforms();
54
+ },
55
+ enumerable: false,
56
+ configurable: true
57
+ });
58
+ Object.defineProperty(BrickProceduralTexture.prototype, "brickColor", {
59
+ get: function () {
60
+ return this._brickColor;
61
+ },
62
+ set: function (value) {
63
+ this._brickColor = value;
64
+ this.updateShaderUniforms();
65
+ },
66
+ enumerable: false,
67
+ configurable: true
68
+ });
69
+ /**
70
+ * Serializes this brick procedural texture
71
+ * @returns a serialized brick procedural texture object
72
+ */
73
+ BrickProceduralTexture.prototype.serialize = function () {
74
+ var serializationObject = SerializationHelper.Serialize(this, _super.prototype.serialize.call(this));
75
+ serializationObject.customType = "BABYLON.BrickProceduralTexture";
76
+ return serializationObject;
77
+ };
78
+ /**
79
+ * Creates a Brick Procedural Texture from parsed brick procedural texture data
80
+ * @param parsedTexture defines parsed texture data
81
+ * @param scene defines the current scene
82
+ * @param rootUrl defines the root URL containing brick procedural texture information
83
+ * @returns a parsed Brick Procedural Texture
84
+ */
85
+ BrickProceduralTexture.Parse = function (parsedTexture, scene, rootUrl) {
86
+ var texture = SerializationHelper.Parse(function () { return new BrickProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps); }, parsedTexture, scene, rootUrl);
87
+ return texture;
88
+ };
89
+ __decorate([
90
+ serialize()
91
+ ], BrickProceduralTexture.prototype, "numberOfBricksHeight", null);
92
+ __decorate([
93
+ serialize()
94
+ ], BrickProceduralTexture.prototype, "numberOfBricksWidth", null);
95
+ __decorate([
96
+ serializeAsColor3()
97
+ ], BrickProceduralTexture.prototype, "jointColor", null);
98
+ __decorate([
99
+ serializeAsColor3()
100
+ ], BrickProceduralTexture.prototype, "brickColor", null);
101
+ return BrickProceduralTexture;
102
+ }(ProceduralTexture));
103
+ export { BrickProceduralTexture };
104
+ RegisterClass("BABYLON.BrickProceduralTexture", BrickProceduralTexture);
105
105
  //# sourceMappingURL=brickProceduralTexture.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"brickProceduralTexture.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/brick/brickProceduralTexture.ts"],"names":[],"mappings":"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","sourcesContent":["import { serialize, serializeAsColor3, SerializationHelper } from \"@babylonjs/core/Misc/decorators\";\r\nimport { Color3 } from \"@babylonjs/core/Maths/math.color\";\r\nimport { Texture } from \"@babylonjs/core/Materials/Textures/texture\";\r\nimport { ProceduralTexture } from \"@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport { Scene } from \"@babylonjs/core/scene\";\r\nimport { RegisterClass } from '@babylonjs/core/Misc/typeStore';\r\nimport { Nullable } from \"@babylonjs/core/types\";\r\n\r\nimport \"./brickProceduralTexture.fragment\";\r\n\r\nexport class BrickProceduralTexture extends ProceduralTexture {\r\n private _numberOfBricksHeight: number = 15;\r\n private _numberOfBricksWidth: number = 5;\r\n private _jointColor = new Color3(0.72, 0.72, 0.72);\r\n private _brickColor = new Color3(0.77, 0.47, 0.40);\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"brickProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setFloat(\"numberOfBricksHeight\", this._numberOfBricksHeight);\r\n this.setFloat(\"numberOfBricksWidth\", this._numberOfBricksWidth);\r\n this.setColor3(\"brickColor\", this._brickColor);\r\n this.setColor3(\"jointColor\", this._jointColor);\r\n }\r\n\r\n @serialize()\r\n public get numberOfBricksHeight(): number {\r\n return this._numberOfBricksHeight;\r\n }\r\n\r\n public set numberOfBricksHeight(value: number) {\r\n this._numberOfBricksHeight = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get numberOfBricksWidth(): number {\r\n return this._numberOfBricksWidth;\r\n }\r\n\r\n public set numberOfBricksWidth(value: number) {\r\n this._numberOfBricksWidth = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serializeAsColor3()\r\n public get jointColor(): Color3 {\r\n return this._jointColor;\r\n }\r\n\r\n public set jointColor(value: Color3) {\r\n this._jointColor = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serializeAsColor3()\r\n public get brickColor(): Color3 {\r\n return this._brickColor;\r\n }\r\n\r\n public set brickColor(value: Color3) {\r\n this._brickColor = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this brick procedural texture\r\n * @returns a serialized brick procedural texture object\r\n */\r\n public serialize(): any {\r\n var serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.BrickProceduralTexture\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Brick Procedural Texture from parsed brick procedural texture data\r\n * @param parsedTexture defines parsed texture data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing brick procedural texture information\r\n * @returns a parsed Brick Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): BrickProceduralTexture {\r\n var texture = SerializationHelper.Parse(() => new BrickProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps), parsedTexture, scene, rootUrl);\r\n\r\n return texture;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.BrickProceduralTexture\", BrickProceduralTexture);"]}
1
+ {"version":3,"file":"brickProceduralTexture.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/brick/brickProceduralTexture.ts"],"names":[],"mappings":"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","sourcesContent":["import { serialize, serializeAsColor3, SerializationHelper } from \"core/Misc/decorators\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport type { Texture } from \"core/Materials/Textures/texture\";\r\nimport { ProceduralTexture } from \"core/Materials/Textures/Procedurals/proceduralTexture\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { Nullable } from \"core/types\";\r\n\r\nimport \"./brickProceduralTexture.fragment\";\r\n\r\nexport class BrickProceduralTexture extends ProceduralTexture {\r\n private _numberOfBricksHeight: number = 15;\r\n private _numberOfBricksWidth: number = 5;\r\n private _jointColor = new Color3(0.72, 0.72, 0.72);\r\n private _brickColor = new Color3(0.77, 0.47, 0.4);\r\n\r\n constructor(name: string, size: number, scene: Nullable<Scene> = null, fallbackTexture?: Texture, generateMipMaps?: boolean) {\r\n super(name, size, \"brickProceduralTexture\", scene, fallbackTexture, generateMipMaps);\r\n this.updateShaderUniforms();\r\n }\r\n\r\n public updateShaderUniforms() {\r\n this.setFloat(\"numberOfBricksHeight\", this._numberOfBricksHeight);\r\n this.setFloat(\"numberOfBricksWidth\", this._numberOfBricksWidth);\r\n this.setColor3(\"brickColor\", this._brickColor);\r\n this.setColor3(\"jointColor\", this._jointColor);\r\n }\r\n\r\n @serialize()\r\n public get numberOfBricksHeight(): number {\r\n return this._numberOfBricksHeight;\r\n }\r\n\r\n public set numberOfBricksHeight(value: number) {\r\n this._numberOfBricksHeight = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serialize()\r\n public get numberOfBricksWidth(): number {\r\n return this._numberOfBricksWidth;\r\n }\r\n\r\n public set numberOfBricksWidth(value: number) {\r\n this._numberOfBricksWidth = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serializeAsColor3()\r\n public get jointColor(): Color3 {\r\n return this._jointColor;\r\n }\r\n\r\n public set jointColor(value: Color3) {\r\n this._jointColor = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n @serializeAsColor3()\r\n public get brickColor(): Color3 {\r\n return this._brickColor;\r\n }\r\n\r\n public set brickColor(value: Color3) {\r\n this._brickColor = value;\r\n this.updateShaderUniforms();\r\n }\r\n\r\n /**\r\n * Serializes this brick procedural texture\r\n * @returns a serialized brick procedural texture object\r\n */\r\n public serialize(): any {\r\n const serializationObject = SerializationHelper.Serialize(this, super.serialize());\r\n serializationObject.customType = \"BABYLON.BrickProceduralTexture\";\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Creates a Brick Procedural Texture from parsed brick procedural texture data\r\n * @param parsedTexture defines parsed texture data\r\n * @param scene defines the current scene\r\n * @param rootUrl defines the root URL containing brick procedural texture information\r\n * @returns a parsed Brick Procedural Texture\r\n */\r\n public static Parse(parsedTexture: any, scene: Scene, rootUrl: string): BrickProceduralTexture {\r\n const texture = SerializationHelper.Parse(\r\n () => new BrickProceduralTexture(parsedTexture.name, parsedTexture._size, scene, undefined, parsedTexture._generateMipMaps),\r\n parsedTexture,\r\n scene,\r\n rootUrl\r\n );\r\n\r\n return texture;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.BrickProceduralTexture\", BrickProceduralTexture);\r\n"]}
package/brick/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./brickProceduralTexture";
1
+ export * from "./brickProceduralTexture";
package/brick/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./brickProceduralTexture.js";
1
+ export * from "./brickProceduralTexture";
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/brick/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC","sourcesContent":["export * from \"./brickProceduralTexture\";"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/brick/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC","sourcesContent":["export * from \"./brickProceduralTexture\";\r\n"]}
@@ -1,35 +1,35 @@
1
- import { Color4 } from "@babylonjs/core/Maths/math.color";
2
- import { Texture } from "@babylonjs/core/Materials/Textures/texture";
3
- import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture";
4
- import { Scene } from "@babylonjs/core/scene";
5
- import { Nullable } from "@babylonjs/core/types";
6
- import "./cloudProceduralTexture.fragment";
7
- export declare class CloudProceduralTexture extends ProceduralTexture {
8
- private _skyColor;
9
- private _cloudColor;
10
- private _amplitude;
11
- private _numOctaves;
12
- constructor(name: string, size: number, scene?: Nullable<Scene>, fallbackTexture?: Texture, generateMipMaps?: boolean);
13
- updateShaderUniforms(): void;
14
- get skyColor(): Color4;
15
- set skyColor(value: Color4);
16
- get cloudColor(): Color4;
17
- set cloudColor(value: Color4);
18
- get amplitude(): number;
19
- set amplitude(value: number);
20
- get numOctaves(): number;
21
- set numOctaves(value: number);
22
- /**
23
- * Serializes this cloud procedural texture
24
- * @returns a serialized cloud procedural texture object
25
- */
26
- serialize(): any;
27
- /**
28
- * Creates a Cloud Procedural Texture from parsed cloud procedural texture data
29
- * @param parsedTexture defines parsed texture data
30
- * @param scene defines the current scene
31
- * @param rootUrl defines the root URL containing cloud procedural texture information
32
- * @returns a parsed Cloud Procedural Texture
33
- */
34
- static Parse(parsedTexture: any, scene: Scene, rootUrl: string): CloudProceduralTexture;
35
- }
1
+ import { Color4 } from "@babylonjs/core/Maths/math.color.js";
2
+ import type { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
3
+ import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture.js";
4
+ import type { Scene } from "@babylonjs/core/scene.js";
5
+ import type { Nullable } from "@babylonjs/core/types.js";
6
+ import "./cloudProceduralTexture.fragment";
7
+ export declare class CloudProceduralTexture extends ProceduralTexture {
8
+ private _skyColor;
9
+ private _cloudColor;
10
+ private _amplitude;
11
+ private _numOctaves;
12
+ constructor(name: string, size: number, scene?: Nullable<Scene>, fallbackTexture?: Texture, generateMipMaps?: boolean);
13
+ updateShaderUniforms(): void;
14
+ get skyColor(): Color4;
15
+ set skyColor(value: Color4);
16
+ get cloudColor(): Color4;
17
+ set cloudColor(value: Color4);
18
+ get amplitude(): number;
19
+ set amplitude(value: number);
20
+ get numOctaves(): number;
21
+ set numOctaves(value: number);
22
+ /**
23
+ * Serializes this cloud procedural texture
24
+ * @returns a serialized cloud procedural texture object
25
+ */
26
+ serialize(): any;
27
+ /**
28
+ * Creates a Cloud Procedural Texture from parsed cloud procedural texture data
29
+ * @param parsedTexture defines parsed texture data
30
+ * @param scene defines the current scene
31
+ * @param rootUrl defines the root URL containing cloud procedural texture information
32
+ * @returns a parsed Cloud Procedural Texture
33
+ */
34
+ static Parse(parsedTexture: any, scene: Scene, rootUrl: string): CloudProceduralTexture;
35
+ }
@@ -1,5 +1,5 @@
1
- /** @hidden */
2
- export declare var cloudProceduralTexturePixelShader: {
3
- name: string;
4
- shader: string;
5
- };
1
+ /** @hidden */
2
+ export declare const cloudProceduralTexturePixelShader: {
3
+ name: string;
4
+ shader: string;
5
+ };
@@ -1,7 +1,9 @@
1
- import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
2
- var name = 'cloudProceduralTexturePixelShader';
3
- var shader = "precision highp float;\nvarying vec2 vUV;\nuniform vec4 skyColor;\nuniform vec4 cloudColor;\nuniform float amplitude;\nuniform int numOctaves;\nfloat rand(vec2 n) {\nreturn fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);\n}\nfloat noise(vec2 n) {\nconst vec2 d=vec2(0.0,1.0);\nvec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));\nreturn mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);\n}\nfloat fbm(vec2 n) {\nfloat total=0.0,ampl=amplitude;\n#ifdef WEBGL2\nfor (int i=0; i<numOctaves; i++) {\n#else\nfor (int i=0; i<4; i++) {\n#endif\ntotal+=noise(n)*ampl;\nn+=n;\nampl*=0.5;\n}\nreturn total;\n}\nvoid main() {\nvec2 p=vUV*12.0;\nvec4 c=mix(skyColor,cloudColor,fbm(p));\ngl_FragColor=c;\n}\n";
4
- ShaderStore.ShadersStore[name] = shader;
5
- /** @hidden */
6
- export var cloudProceduralTexturePixelShader = { name: name, shader: shader };
1
+ // Do not edit.
2
+ import { ShaderStore } from "@babylonjs/core/Engines/shaderStore.js";
3
+ var name = "cloudProceduralTexturePixelShader";
4
+ var shader = "precision highp float;varying vec2 vUV;uniform vec4 skyColor;uniform vec4 cloudColor;uniform float amplitude;uniform int numOctaves;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}\nfloat noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}\nfloat fbm(vec2 n) {float total=0.0,ampl=amplitude;\n#ifdef WEBGL2\nfor (int i=0; i<numOctaves; i++) {\n#else\nfor (int i=0; i<4; i++) {\n#endif\ntotal+=noise(n)*ampl;n+=n;ampl*=0.5;}\nreturn total;}\nvoid main() {vec2 p=vUV*12.0;vec4 c=mix(skyColor,cloudColor,fbm(p));gl_FragColor=c;}\n";
5
+ // Sideeffect
6
+ ShaderStore.ShadersStore[name] = shader;
7
+ /** @hidden */
8
+ export var cloudProceduralTexturePixelShader = { name: name, shader: shader };
7
9
  //# sourceMappingURL=cloudProceduralTexture.fragment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cloudProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../sourceES6/proceduralTexturesLibrary/src/cloud/cloudProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAElE,IAAI,IAAI,GAAG,mCAAmC,CAAC;AAC/C,IAAI,MAAM,GAAG,8tBAgCZ,CAAC;AAEF,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,cAAc;AACd,MAAM,CAAC,IAAI,iCAAiC,GAAG,EAAE,IAAI,MAAA,EAAE,MAAM,QAAA,EAAE,CAAC","sourcesContent":["import { ShaderStore } from \"@babylonjs/core/Engines/shaderStore\";\n\nlet name = 'cloudProceduralTexturePixelShader';\nlet shader = `precision highp float;\nvarying vec2 vUV;\nuniform vec4 skyColor;\nuniform vec4 cloudColor;\nuniform float amplitude;\nuniform int numOctaves;\nfloat rand(vec2 n) {\nreturn fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);\n}\nfloat noise(vec2 n) {\nconst vec2 d=vec2(0.0,1.0);\nvec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));\nreturn mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);\n}\nfloat fbm(vec2 n) {\nfloat total=0.0,ampl=amplitude;\n#ifdef WEBGL2\nfor (int i=0; i<numOctaves; i++) {\n#else\nfor (int i=0; i<4; i++) {\n#endif\ntotal+=noise(n)*ampl;\nn+=n;\nampl*=0.5;\n}\nreturn total;\n}\nvoid main() {\nvec2 p=vUV*12.0;\nvec4 c=mix(skyColor,cloudColor,fbm(p));\ngl_FragColor=c;\n}\n`;\n\nShaderStore.ShadersStore[name] = shader;\n/** @hidden */\nexport var cloudProceduralTexturePixelShader = { name, shader };\n"]}
1
+ {"version":3,"file":"cloudProceduralTexture.fragment.js","sourceRoot":"","sources":["../../../../../lts/proceduralTextures/generated/cloud/cloudProceduralTexture.fragment.ts"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,WAAW,EAAE,+CAAiC;AAEvD,IAAM,IAAI,GAAG,mCAAmC,CAAC;AACjD,IAAM,MAAM,GAAG,orBAWd,CAAC;AACF,aAAa;AACb,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AACxC,cAAc;AACd,MAAM,CAAC,IAAM,iCAAiC,GAAG,EAAE,IAAI,MAAA,EAAE,MAAM,QAAA,EAAE,CAAC","sourcesContent":["// Do not edit.\nimport { ShaderStore } from \"core/Engines/shaderStore\";\n\nconst name = \"cloudProceduralTexturePixelShader\";\nconst shader = `precision highp float;varying vec2 vUV;uniform vec4 skyColor;uniform vec4 cloudColor;uniform float amplitude;uniform int numOctaves;float rand(vec2 n) {return fract(cos(dot(n,vec2(12.9898,4.1414)))*43758.5453);}\nfloat noise(vec2 n) {const vec2 d=vec2(0.0,1.0);vec2 b=floor(n),f=smoothstep(vec2(0.0),vec2(1.0),fract(n));return mix(mix(rand(b),rand(b+d.yx),f.x),mix(rand(b+d.xy),rand(b+d.yy),f.x),f.y);}\nfloat fbm(vec2 n) {float total=0.0,ampl=amplitude;\n#ifdef WEBGL2\nfor (int i=0; i<numOctaves; i++) {\n#else\nfor (int i=0; i<4; i++) {\n#endif\ntotal+=noise(n)*ampl;n+=n;ampl*=0.5;}\nreturn total;}\nvoid main() {vec2 p=vUV*12.0;vec4 c=mix(skyColor,cloudColor,fbm(p));gl_FragColor=c;}\n`;\n// Sideeffect\nShaderStore.ShadersStore[name] = shader;\n/** @hidden */\nexport const cloudProceduralTexturePixelShader = { name, shader };\n"]}