Kaynağa Gözat

Merge pull request #841 from meulta/master

Adding all procedural textures in the library + starfield
David Catuhe 9 yıl önce
ebeveyn
işleme
b45d1b4ddf
43 değiştirilmiş dosya ile 1469 ekleme ve 924 silme
  1. 49 0
      proceduralTexturesLibrary/config.json
  2. 71 0
      proceduralTexturesLibrary/dist/babylon.brickProceduralTexture.js
  3. 1 0
      proceduralTexturesLibrary/dist/babylon.brickProceduralTexture.min.js
  4. 45 0
      proceduralTexturesLibrary/dist/babylon.cloudProceduralTexture.js
  5. 1 0
      proceduralTexturesLibrary/dist/babylon.cloudProceduralTexture.min.js
  6. 17 17
      proceduralTexturesLibrary/dist/babylon.fireProceduralTexture.js
  7. 1 1
      proceduralTexturesLibrary/dist/babylon.fireProceduralTexture.min.js
  8. 54 0
      proceduralTexturesLibrary/dist/babylon.grassProceduralTexture.js
  9. 1 0
      proceduralTexturesLibrary/dist/babylon.grassProceduralTexture.min.js
  10. 73 0
      proceduralTexturesLibrary/dist/babylon.marbleProceduralTexture.js
  11. 1 0
      proceduralTexturesLibrary/dist/babylon.marbleProceduralTexture.min.js
  12. 32 0
      proceduralTexturesLibrary/dist/babylon.roadProceduralTexture.js
  13. 1 0
      proceduralTexturesLibrary/dist/babylon.roadProceduralTexture.min.js
  14. 70 0
      proceduralTexturesLibrary/dist/babylon.starfieldProceduralTexture.js
  15. 1 0
      proceduralTexturesLibrary/dist/babylon.starfieldProceduralTexture.min.js
  16. 45 0
      proceduralTexturesLibrary/dist/babylon.woodProceduralTexture.js
  17. 1 0
      proceduralTexturesLibrary/dist/babylon.woodProceduralTexture.min.js
  18. 59 0
      proceduralTexturesLibrary/proceduralTextures/brick/babylon.brickProceduralTexture.ts
  19. 69 0
      proceduralTexturesLibrary/proceduralTextures/brick/brickProceduralTexture.fragment.fx
  20. 37 0
      proceduralTexturesLibrary/proceduralTextures/cloud/babylon.cloudProceduralTexture.ts
  21. 35 0
      proceduralTexturesLibrary/proceduralTextures/cloud/cloudProceduralTexture.fragment.fx
  22. 2 2
      proceduralTexturesLibrary/proceduralTextures/fire/babylon.fireProceduralTexture.ts
  23. 49 0
      proceduralTexturesLibrary/proceduralTextures/grass/babylon.grassProceduralTexture.ts
  24. 37 0
      proceduralTexturesLibrary/proceduralTextures/grass/grassProceduralTexture.fragment.fx
  25. 61 0
      proceduralTexturesLibrary/proceduralTextures/marble/babylon.marbleProceduralTexture.ts
  26. 85 0
      proceduralTexturesLibrary/proceduralTextures/marble/marbleProceduralTexture.fragment.fx
  27. 26 0
      proceduralTexturesLibrary/proceduralTextures/road/babylon.roadProceduralTexture.ts
  28. 30 0
      proceduralTexturesLibrary/proceduralTextures/road/roadProceduralTexture.fragment.fx
  29. 58 0
      proceduralTexturesLibrary/proceduralTextures/starfield/babylon.starfieldProceduralTexture.ts
  30. 63 0
      proceduralTexturesLibrary/proceduralTextures/starfield/starfieldProceduralTexture.fragment.fx
  31. 37 0
      proceduralTexturesLibrary/proceduralTextures/wood/babylon.woodProceduralTexture.ts
  32. 33 0
      proceduralTexturesLibrary/proceduralTextures/wood/woodProceduralTexture.fragment.fx
  33. 5 0
      proceduralTexturesLibrary/test/add/addBrickPT.js
  34. 5 0
      proceduralTexturesLibrary/test/add/addCloudPT.js
  35. 1 1
      proceduralTexturesLibrary/test/add/addFirePT.js
  36. 5 0
      proceduralTexturesLibrary/test/add/addGrassPT.js
  37. 5 0
      proceduralTexturesLibrary/test/add/addMarblePT.js
  38. 5 0
      proceduralTexturesLibrary/test/add/addRoadPT.js
  39. 5 0
      proceduralTexturesLibrary/test/add/addStarfieldPT.js
  40. 5 0
      proceduralTexturesLibrary/test/add/addWoodPT.js
  41. 217 481
      proceduralTexturesLibrary/test/babylon.max.js
  42. 71 3
      proceduralTexturesLibrary/test/index.html
  43. 0 419
      src/Materials/Textures/Procedurals/babylon.standardProceduralTexture.js

+ 49 - 0
proceduralTexturesLibrary/config.json

@@ -1,11 +1,60 @@
 {
   "proceduralTextures": [
     {
+      "file": "proceduralTextures/wood/babylon.woodProceduralTexture.ts",
+      "shaderFiles": [
+        "proceduralTextures/wood/woodProceduralTexture.fragment.fx"
+      ],
+      "output": "babylon.woodProceduralTexture.js"
+    },
+    {
       "file": "proceduralTextures/fire/babylon.fireProceduralTexture.ts",
       "shaderFiles": [
         "proceduralTextures/fire/fireProceduralTexture.fragment.fx"
       ],
       "output": "babylon.fireProceduralTexture.js"
+    },
+    {
+      "file": "proceduralTextures/cloud/babylon.cloudProceduralTexture.ts",
+      "shaderFiles": [
+        "proceduralTextures/cloud/cloudProceduralTexture.fragment.fx"
+      ],
+      "output": "babylon.cloudProceduralTexture.js"
+    },
+    {
+      "file": "proceduralTextures/grass/babylon.grassProceduralTexture.ts",
+      "shaderFiles": [
+        "proceduralTextures/grass/grassProceduralTexture.fragment.fx"
+      ],
+      "output": "babylon.grassProceduralTexture.js"
+    },
+    {
+      "file": "proceduralTextures/road/babylon.roadProceduralTexture.ts",
+      "shaderFiles": [
+        "proceduralTextures/road/roadProceduralTexture.fragment.fx"
+      ],
+      "output": "babylon.roadProceduralTexture.js"
+    },
+    {
+      "file": "proceduralTextures/brick/babylon.brickProceduralTexture.ts",
+      "shaderFiles": [
+        "proceduralTextures/brick/brickProceduralTexture.fragment.fx"
+      ],
+      "output": "babylon.brickProceduralTexture.js"
+    },
+    {
+      "file": "proceduralTextures/marble/babylon.marbleProceduralTexture.ts",
+      "shaderFiles": [
+        "proceduralTextures/marble/marbleProceduralTexture.fragment.fx"
+      ],
+      "output": "babylon.marbleProceduralTexture.js"
+    },
+    {
+      "file": "proceduralTextures/starfield/babylon.starfieldProceduralTexture.ts",
+      "shaderFiles": [
+        "proceduralTextures/starfield/starfieldProceduralTexture.fragment.fx"
+      ],
+      "output": "babylon.starfieldProceduralTexture.js"
     }
   ],
   "build": {

Dosya farkı çok büyük olduğundan ihmal edildi
+ 71 - 0
proceduralTexturesLibrary/dist/babylon.brickProceduralTexture.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
proceduralTexturesLibrary/dist/babylon.brickProceduralTexture.min.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 45 - 0
proceduralTexturesLibrary/dist/babylon.cloudProceduralTexture.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
proceduralTexturesLibrary/dist/babylon.cloudProceduralTexture.min.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 17 - 17
proceduralTexturesLibrary/dist/babylon.fireProceduralTexture.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
proceduralTexturesLibrary/dist/babylon.fireProceduralTexture.min.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 54 - 0
proceduralTexturesLibrary/dist/babylon.grassProceduralTexture.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
proceduralTexturesLibrary/dist/babylon.grassProceduralTexture.min.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 73 - 0
proceduralTexturesLibrary/dist/babylon.marbleProceduralTexture.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
proceduralTexturesLibrary/dist/babylon.marbleProceduralTexture.min.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 32 - 0
proceduralTexturesLibrary/dist/babylon.roadProceduralTexture.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
proceduralTexturesLibrary/dist/babylon.roadProceduralTexture.min.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 70 - 0
proceduralTexturesLibrary/dist/babylon.starfieldProceduralTexture.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
proceduralTexturesLibrary/dist/babylon.starfieldProceduralTexture.min.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 45 - 0
proceduralTexturesLibrary/dist/babylon.woodProceduralTexture.js


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
proceduralTexturesLibrary/dist/babylon.woodProceduralTexture.min.js


+ 59 - 0
proceduralTexturesLibrary/proceduralTextures/brick/babylon.brickProceduralTexture.ts

@@ -0,0 +1,59 @@
+ /// <reference path="../../../dist/preview release/babylon.d.ts"/>
+
+module BABYLON {
+	export class BrickProceduralTexture extends ProceduralTexture {
+        private _numberOfBricksHeight: number = 15;
+        private _numberOfBricksWidth: number = 5;
+        private _jointColor = new Color3(0.72, 0.72, 0.72);
+        private _brickColor = new Color3(0.77, 0.47, 0.40);
+
+        constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean) {
+            super(name, size, "brickProceduralTexture", scene, fallbackTexture, generateMipMaps);
+            this.updateShaderUniforms();
+            this.refreshRate = 0;
+        }
+
+        public updateShaderUniforms() {
+            this.setFloat("numberOfBricksHeight", this._numberOfBricksHeight);
+            this.setFloat("numberOfBricksWidth", this._numberOfBricksWidth);
+            this.setColor3("brickColor", this._brickColor);
+            this.setColor3("jointColor", this._jointColor);
+        }
+
+        public get numberOfBricksHeight(): number {
+            return this._numberOfBricksHeight;
+        }
+
+        public set numberOfBricksHeight(value: number) {
+            this._numberOfBricksHeight = value;
+            this.updateShaderUniforms();
+        }
+
+        public get numberOfBricksWidth(): number {
+            return this._numberOfBricksWidth;
+        }
+
+        public set numberOfBricksWidth(value: number) {
+            this._numberOfBricksWidth = value;
+            this.updateShaderUniforms();
+        }
+
+        public get jointColor(): Color3 {
+            return this._jointColor;
+        }
+
+        public set jointColor(value: Color3) {
+            this._jointColor = value;
+            this.updateShaderUniforms();
+        }
+
+        public get brickColor(): Color3 {
+            return this._brickColor;
+        }
+
+        public set brickColor(value: Color3) {
+            this._brickColor = value;
+            this.updateShaderUniforms();
+        }
+    }	
+}

+ 69 - 0
proceduralTexturesLibrary/proceduralTextures/brick/brickProceduralTexture.fragment.fx

@@ -0,0 +1,69 @@
+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);
+}
+
+float 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);
+}
+
+float 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;
+	}
+	return total;
+}
+
+float round(float number){
+	return sign(number)*floor(abs(number) + 0.5);
+}
+
+void main(void)
+{
+	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 = round(yi);
+	float xi = vUV.x / brickW;
+
+	if (mod(floor(yi), 2.0) == 0.0){
+		xi = xi - 0.5;
+	}
+
+	float nxi = round(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);
+	}
+	else if (xi < nxi + jointWPercentage && xi > nxi - jointWPercentage){
+		color = mix(jointColor, vec3(0.44, 0.44, 0.44), (xi - nxi) / jointWPercentage + 0.2);
+	}
+	else {
+		float brickColorSwitch = mod(floor(yi) + floor(xi), 3.0);
+
+		if (brickColorSwitch == 0.0)
+			color = mix(color, vec3(0.33, 0.33, 0.33), 0.3);
+		else if (brickColorSwitch == 2.0)
+			color = mix(color, vec3(0.11, 0.11, 0.11), 0.3);
+	}
+
+	gl_FragColor = vec4(color, 1.0);
+}

+ 37 - 0
proceduralTexturesLibrary/proceduralTextures/cloud/babylon.cloudProceduralTexture.ts

@@ -0,0 +1,37 @@
+ /// <reference path="../../../dist/preview release/babylon.d.ts"/>
+
+module BABYLON {
+    export class CloudProceduralTexture extends ProceduralTexture {
+        private _skyColor = new Color4(0.15, 0.68, 1.0, 1.0);
+        private _cloudColor = new Color4(1, 1, 1, 1.0);
+    
+        constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean) {
+            super(name, size, "cloudProceduralTexture", scene, fallbackTexture, generateMipMaps);
+            this.updateShaderUniforms();
+            this.refreshRate = 0;
+        }
+    
+        public updateShaderUniforms() {
+            this.setColor4("skyColor", this._skyColor);
+            this.setColor4("cloudColor", this._cloudColor);
+        }
+    
+        public get skyColor(): Color4 {
+            return this._skyColor;
+        }
+    
+        public set skyColor(value: Color4) {
+            this._skyColor = value;
+            this.updateShaderUniforms();
+        }
+    
+        public get cloudColor(): Color4 {
+            return this._cloudColor;
+        }
+    
+        public set cloudColor(value: Color4) {
+            this._cloudColor = value;
+            this.updateShaderUniforms();
+        }
+    }
+}

+ 35 - 0
proceduralTexturesLibrary/proceduralTextures/cloud/cloudProceduralTexture.fragment.fx

@@ -0,0 +1,35 @@
+precision highp float;
+
+varying vec2 vUV;
+
+uniform vec4 skyColor;
+uniform vec4 cloudColor;
+
+float rand(vec2 n) {
+	return fract(cos(dot(n, vec2(12.9898, 4.1414))) * 43758.5453);
+}
+
+float 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);
+}
+
+float 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;
+	}
+	return total;
+}
+
+void main() {
+
+	vec2 p = vUV * 12.0;
+	vec4 c = mix(skyColor, cloudColor, fbm(p));
+	gl_FragColor = c;
+
+}
+

+ 2 - 2
proceduralTexturesLibrary/proceduralTextures/fire/babylon.fireProceduralTexture.ts

@@ -1,7 +1,7 @@
 /// <reference path="../../../dist/preview release/babylon.d.ts"/>
 
 module BABYLON {
- export class FireProceduralTexture2 extends ProceduralTexture {
+ export class FireProceduralTexture extends ProceduralTexture {
         private _time: number = 0.0;
         private _speed = new Vector2(0.5, 0.3);
         private _autoGenerateTime: boolean = true;
@@ -9,7 +9,7 @@ module BABYLON {
         private _alphaThreshold: number = 0.5;
 
         constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean) {
-            super(name, size, "firetexture", scene, fallbackTexture, generateMipMaps);
+            super(name, size, "fireProceduralTexture", scene, fallbackTexture, generateMipMaps);
             this._fireColors = FireProceduralTexture.RedFireColors;
             this.updateShaderUniforms();
             this.refreshRate = 1;

+ 49 - 0
proceduralTexturesLibrary/proceduralTextures/grass/babylon.grassProceduralTexture.ts

@@ -0,0 +1,49 @@
+ /// <reference path="../../../dist/preview release/babylon.d.ts"/>
+
+module BABYLON {
+    export class GrassProceduralTexture extends ProceduralTexture {
+        private _grassColors: Color3[];
+        private _herb1 = new Color3(0.29, 0.38, 0.02);
+        private _herb2 = new Color3(0.36, 0.49, 0.09);
+        private _herb3 = new Color3(0.51, 0.6, 0.28);
+        private _groundColor = new Color3(1, 1, 1);
+
+        constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean) {
+            super(name, size, "grassProceduralTexture", scene, fallbackTexture, generateMipMaps);
+
+            this._grassColors = [
+                new Color3(0.29, 0.38, 0.02),
+                new Color3(0.36, 0.49, 0.09),
+                new Color3(0.51, 0.6, 0.28)
+            ];
+
+            this.updateShaderUniforms();
+            this.refreshRate = 0;
+        }
+
+        public updateShaderUniforms() {
+            this.setColor3("herb1Color", this._grassColors[0]);
+            this.setColor3("herb2Color", this._grassColors[1]);
+            this.setColor3("herb3Color", this._grassColors[2]);
+            this.setColor3("groundColor", this._groundColor);
+        }
+
+        public get grassColors(): Color3[] {
+            return this._grassColors;
+        }
+
+        public set grassColors(value: Color3[]) {
+            this._grassColors = value;
+            this.updateShaderUniforms();
+        }
+
+        public get groundColor(): Color3 {
+            return this._groundColor;
+        }
+
+        public set groundColor(value: Color3) {
+            this.groundColor = value;
+            this.updateShaderUniforms();
+        }
+    }
+}

+ 37 - 0
proceduralTexturesLibrary/proceduralTextures/grass/grassProceduralTexture.fragment.fx

@@ -0,0 +1,37 @@
+precision highp float;
+
+varying vec2 vPosition;
+varying vec2 vUV;
+
+uniform vec3 herb1Color;
+uniform vec3 herb2Color;
+uniform vec3 herb3Color;
+uniform vec3 groundColor;
+
+float rand(vec2 n) {
+	return fract(cos(dot(n, vec2(12.9898, 4.1414))) * 43758.5453);
+}
+
+float 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);
+}
+
+float 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;
+	}
+	return total;
+}
+
+void main(void) {
+	vec3 color = mix(groundColor, herb1Color, rand(gl_FragCoord.xy * 4.0));
+	color = mix(color, herb2Color, rand(gl_FragCoord.xy * 8.0));
+	color = mix(color, herb3Color, rand(gl_FragCoord.xy));
+	color = mix(color, herb1Color, fbm(gl_FragCoord.xy * 16.0));
+	gl_FragColor = vec4(color, 1.0);
+}

+ 61 - 0
proceduralTexturesLibrary/proceduralTextures/marble/babylon.marbleProceduralTexture.ts

@@ -0,0 +1,61 @@
+ /// <reference path="../../../dist/preview release/babylon.d.ts"/>
+
+module BABYLON {
+    export class MarbleProceduralTexture extends ProceduralTexture {
+        private _numberOfTilesHeight: number = 3;
+        private _numberOfTilesWidth: number = 3;
+        private _amplitude: number = 9.0;
+        private _marbleColor = new Color3(0.77, 0.47, 0.40);
+        private _jointColor = new Color3(0.72, 0.72, 0.72);
+
+        constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean) {
+            super(name, size, "marbleProceduralTexture", scene, fallbackTexture, generateMipMaps);
+            this.updateShaderUniforms();
+            this.refreshRate = 0;
+        }
+
+        public updateShaderUniforms() {
+            this.setFloat("numberOfTilesHeight", this._numberOfTilesHeight);
+            this.setFloat("numberOfTilesWidth", this._numberOfTilesWidth);
+            this.setFloat("amplitude", this._amplitude);
+            this.setColor3("marbleColor", this._marbleColor);
+            this.setColor3("jointColor", this._jointColor);
+        }
+
+        public get numberOfTilesHeight(): number {
+            return this._numberOfTilesHeight;
+        }
+
+        public set numberOfTilesHeight(value: number) {
+            this._numberOfTilesHeight = value;
+            this.updateShaderUniforms();
+        }
+
+        public get numberOfTilesWidth(): number {
+            return this._numberOfTilesWidth;
+        }
+
+        public set numberOfTilesWidth(value: number) {
+            this._numberOfTilesWidth = value;
+            this.updateShaderUniforms();
+        }
+
+        public get jointColor(): Color3 {
+            return this._jointColor;
+        }
+
+        public set jointColor(value: Color3) {
+            this._jointColor = value;
+            this.updateShaderUniforms();
+        }
+
+        public get marbleColor(): Color3 {
+            return this._marbleColor;
+        }
+
+        public set marbleColor(value: Color3) {
+            this._marbleColor = value;
+            this.updateShaderUniforms();
+        }
+    }
+}

+ 85 - 0
proceduralTexturesLibrary/proceduralTextures/marble/marbleProceduralTexture.fragment.fx

@@ -0,0 +1,85 @@
+precision highp float;
+
+varying vec2 vPosition;
+varying vec2 vUV;
+
+uniform float numberOfTilesHeight;
+uniform float numberOfTilesWidth;
+uniform float amplitude;
+uniform vec3 brickColor;
+uniform vec3 jointColor;
+
+const vec3 tileSize = vec3(1.1, 1.0, 1.1);
+const vec3 tilePct = vec3(0.98, 1.0, 0.98);
+
+float rand(vec2 n) {
+	return fract(cos(dot(n, vec2(12.9898, 4.1414))) * 43758.5453);
+}
+
+float 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);
+}
+
+float turbulence(vec2 P)
+{
+	float val = 0.0;
+	float freq = 1.0;
+	for (int i = 0; i < 4; i++)
+	{
+		val += abs(noise(P*freq) / freq);
+		freq *= 2.07;
+	}
+	return val;
+}
+
+float round(float number){
+	return sign(number)*floor(abs(number) + 0.5);
+}
+
+vec3 marble_color(float x)
+{
+	vec3 col;
+	x = 0.5*(x + 1.);
+	x = sqrt(x);             
+	x = sqrt(x);
+	x = sqrt(x);
+	col = vec3(.2 + .75*x);  
+	col.b *= 0.95;           
+	return col;
+}
+
+void main()
+{
+	float brickW = 1.0 / numberOfTilesWidth;
+	float brickH = 1.0 / numberOfTilesHeight;
+	float jointWPercentage = 0.01;
+	float jointHPercentage = 0.01;
+	vec3 color = brickColor;
+	float yi = vUV.y / brickH;
+	float nyi = round(yi);
+	float xi = vUV.x / brickW;
+
+	if (mod(floor(yi), 2.0) == 0.0){
+		xi = xi - 0.5;
+	}
+
+	float nxi = round(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);
+	}
+	else if (xi < nxi + jointWPercentage && xi > nxi - jointWPercentage){
+		color = mix(jointColor, vec3(0.44, 0.44, 0.44), (xi - nxi) / jointWPercentage + 0.2);
+	}
+	else {
+		float t = 6.28 * brickvUV.x / (tileSize.x + noise(vec2(vUV)*6.0));
+		t += amplitude * turbulence(brickvUV.xy);
+		t = sin(t);
+		color = marble_color(t);
+	}
+
+	gl_FragColor = vec4(color, 0.0);
+}

+ 26 - 0
proceduralTexturesLibrary/proceduralTextures/road/babylon.roadProceduralTexture.ts

@@ -0,0 +1,26 @@
+ /// <reference path="../../../dist/preview release/babylon.d.ts"/>
+
+module BABYLON {
+    export class RoadProceduralTexture extends ProceduralTexture {
+        private _roadColor = new Color3(0.53, 0.53, 0.53);
+
+        constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean) {
+            super(name, size, "roadProceduralTexture", scene, fallbackTexture, generateMipMaps);
+            this.updateShaderUniforms();
+            this.refreshRate = 0;
+        }
+
+        public updateShaderUniforms() {
+            this.setColor3("roadColor", this._roadColor);
+        }
+
+        public get roadColor(): Color3 {
+            return this._roadColor;
+        }
+
+        public set roadColor(value: Color3) {
+            this._roadColor = value;
+            this.updateShaderUniforms();
+        }
+    }
+}

+ 30 - 0
proceduralTexturesLibrary/proceduralTextures/road/roadProceduralTexture.fragment.fx

@@ -0,0 +1,30 @@
+precision highp float;
+
+varying vec2 vUV;                    
+uniform vec3 roadColor;
+
+float rand(vec2 n) {
+	return fract(cos(dot(n, vec2(12.9898, 4.1414))) * 43758.5453);
+}
+
+float 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);
+}
+
+float 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;
+	}
+	return total;
+}
+
+void main(void) {
+	float ratioy = mod(gl_FragCoord.y * 100.0 , fbm(vUV * 2.0));
+	vec3 color = roadColor * ratioy;
+	gl_FragColor = vec4(color, 1.0);
+}

+ 58 - 0
proceduralTexturesLibrary/proceduralTextures/starfield/babylon.starfieldProceduralTexture.ts

@@ -0,0 +1,58 @@
+  /// <reference path="../../../dist/preview release/babylon.d.ts"/>
+
+module BABYLON {
+ export class StarfieldProceduralTexture extends ProceduralTexture {
+        private _time = 1;
+        private _alpha = 0.5;
+        private _beta = 0.8;
+        private _zoom = 0.8;
+
+        constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean) {
+            super(name, size, "starfieldProceduralTexture", scene, fallbackTexture, generateMipMaps);
+            this.updateShaderUniforms();
+        }
+
+        public updateShaderUniforms() {
+            this.setFloat("time", this._time);      
+            this.setFloat("alpha", this._alpha);  
+            this.setFloat("beta", this._beta);  
+            this.setFloat("zoom", this._zoom); 
+        }
+
+        public get time(): number {
+            return this._time;
+        }
+
+        public set time(value: number) {
+            this._time = value;
+            this.updateShaderUniforms();
+        }      
+        
+        public get alpha(): number {
+            return this._alpha;
+        }
+
+        public set alpha(value: number) {
+            this._alpha = value;
+            this.updateShaderUniforms();
+        }    
+
+        public get beta(): number {
+            return this._beta;
+        }
+
+        public set beta(value: number) {
+            this._beta = value;
+            this.updateShaderUniforms();
+        } 
+
+        public get zoom(): number {
+            return this._zoom;
+        }
+
+        public set zoom(value: number) {
+            this._zoom = value;
+            this.updateShaderUniforms();
+        } 
+    }
+}

+ 63 - 0
proceduralTexturesLibrary/proceduralTextures/starfield/starfieldProceduralTexture.fragment.fx

@@ -0,0 +1,63 @@
+precision highp float;
+
+#define iterations 15
+#define formuparam 0.53
+
+#define volsteps 20
+#define stepsize 0.1
+
+#define tile 0.850
+
+#define brightness 0.0015
+#define darkmatter 0.400
+#define distfading 0.730
+#define saturation 0.850
+
+varying vec2 vPosition;
+varying vec2 vUV;
+
+uniform float time;
+uniform float alpha;
+uniform float beta;
+uniform float zoom;
+
+void main()
+{
+	vec3 dir = vec3(vUV * zoom, 1.);
+
+	float localTime = time * 0.0001;
+
+	// Rotation
+	mat2 rot1 = mat2(cos(alpha), sin(alpha), -sin(alpha), cos(alpha));
+	mat2 rot2 = mat2(cos(beta), sin(beta), -sin(beta), cos(beta));
+	dir.xz *= rot1;
+	dir.xy *= rot2;
+	vec3 from = vec3(1., .5, 0.5);
+	from += vec3(localTime*2., localTime, -2.);
+	from.xz *= rot1;
+	from.xy *= rot2;
+
+	//volumetric rendering
+	float s = 0.1, fade = 1.;
+	vec3 v = vec3(0.);
+	for (int r = 0; r < volsteps; r++) {
+		vec3 p = from + s*dir*.5;
+		p = abs(vec3(tile) - mod(p, vec3(tile*2.))); // tiling fold
+		float pa, a = pa = 0.;
+		for (int i = 0; i < iterations; i++) {
+			p = abs(p) / dot(p, p) - formuparam; // the magic formula
+			a += abs(length(p) - pa); // absolute sum of average change
+			pa = length(p);
+		}
+		float dm = max(0., darkmatter - a*a*.001); //dark matter
+		a *= a*a; // add contrast
+		if (r > 6) fade *= 1. - dm; // dark matter, don't render near
+								  //v+=vec3(dm,dm*.5,0.);
+		v += fade;
+		v += vec3(s, s*s, s*s*s*s)*a*brightness*fade; // coloring based on distance
+		fade *= distfading; // distance fading
+		s += stepsize;
+	}
+	v = mix(vec3(length(v)), v, saturation); //color adjust
+	gl_FragColor = vec4(v*.01, 1.);
+}

+ 37 - 0
proceduralTexturesLibrary/proceduralTextures/wood/babylon.woodProceduralTexture.ts

@@ -0,0 +1,37 @@
+/// <reference path="../../../dist/preview release/babylon.d.ts"/>
+
+module BABYLON {
+	export class WoodProceduralTexture extends ProceduralTexture {
+        private _ampScale: number = 100.0;
+        private _woodColor: Color3 = new Color3(0.32, 0.17, 0.09);
+
+        constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean) {
+            super(name, size, "woodProceduralTexture", scene, fallbackTexture, generateMipMaps);
+            this.updateShaderUniforms();
+            this.refreshRate = 0;
+        }
+
+        public updateShaderUniforms() {
+            this.setFloat("ampScale", this._ampScale);
+            this.setColor3("woodColor", this._woodColor);
+        }
+
+        public get ampScale(): number {
+            return this._ampScale;
+        }
+
+        public set ampScale(value: number) {
+            this._ampScale = value;
+            this.updateShaderUniforms();
+        }
+
+        public get woodColor(): Color3 {
+            return this._woodColor;
+        }
+
+        public set woodColor(value: Color3) {
+            this._woodColor = value;
+            this.updateShaderUniforms();
+        }
+    }
+}

+ 33 - 0
proceduralTexturesLibrary/proceduralTextures/wood/woodProceduralTexture.fragment.fx

@@ -0,0 +1,33 @@
+precision highp float;
+
+varying vec2 vPosition;
+varying vec2 vUV;
+
+uniform float ampScale;
+uniform vec3 woodColor;
+
+float rand(vec2 n) {
+	return fract(cos(dot(n, vec2(12.9898, 4.1414))) * 43758.5453);
+}
+
+float 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);
+}
+
+float 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;
+	}
+	return total;
+}
+
+void main(void) {
+	float ratioy = mod(vUV.x * ampScale, 2.0 + fbm(vUV * 0.8));
+	vec3 wood = woodColor * ratioy;
+	gl_FragColor = vec4(wood, 1.0);
+}

+ 5 - 0
proceduralTexturesLibrary/test/add/addBrickPT.js

@@ -0,0 +1,5 @@
+window.addBrickPT = function() {
+    var brick = new BABYLON.BrickProceduralTexture("brickPT", 256, scene);
+
+    return brick;
+};

+ 5 - 0
proceduralTexturesLibrary/test/add/addCloudPT.js

@@ -0,0 +1,5 @@
+window.addCloudPT = function() {
+    var cloud = new BABYLON.CloudProceduralTexture("cloudPT", 256, scene);
+
+    return cloud;
+};

+ 1 - 1
proceduralTexturesLibrary/test/add/addFirePT.js

@@ -1,5 +1,5 @@
 window.addFirePT = function() {
-    var fire = new BABYLON.FireProceduralTexture2("firePT", 256, scene);
+    var fire = new BABYLON.FireProceduralTexture("firePT", 256, scene);
 
     return fire;
 };

+ 5 - 0
proceduralTexturesLibrary/test/add/addGrassPT.js

@@ -0,0 +1,5 @@
+window.addGrassPT = function() {
+    var grass = new BABYLON.GrassProceduralTexture("grassPT", 512, scene);
+
+    return grass;
+};

+ 5 - 0
proceduralTexturesLibrary/test/add/addMarblePT.js

@@ -0,0 +1,5 @@
+window.addMarblePT = function() {
+    var marble = new BABYLON.MarbleProceduralTexture("marblePT", 1024, scene);
+
+    return marble;
+};

+ 5 - 0
proceduralTexturesLibrary/test/add/addRoadPT.js

@@ -0,0 +1,5 @@
+window.addRoadPT = function() {
+    var road = new BABYLON.RoadProceduralTexture("roadPT", 256, scene);
+
+    return road;
+};

+ 5 - 0
proceduralTexturesLibrary/test/add/addStarfieldPT.js

@@ -0,0 +1,5 @@
+window.addStarfieldPT = function() {
+    var starfield = new BABYLON.StarfieldProceduralTexture("starfieldPT", 256, scene);
+
+    return starfield;
+};

+ 5 - 0
proceduralTexturesLibrary/test/add/addWoodPT.js

@@ -0,0 +1,5 @@
+window.addWoodPT = function() {
+    var wood = new BABYLON.WoodProceduralTexture("woodPT", 2048, scene);
+
+    return wood;
+};

Dosya farkı çok büyük olduğundan ihmal edildi
+ 217 - 481
proceduralTexturesLibrary/test/babylon.max.js


+ 71 - 3
proceduralTexturesLibrary/test/index.html

@@ -5,6 +5,13 @@
 	<script src="refs/dat.gui.min.js"></script>
 	<script src="refs/babylon.max.js"></script>
 	<script src="../dist/babylon.fireProceduralTexture.js"></script>
+	<script src="../dist/babylon.woodProceduralTexture.js"></script>
+	<script src="../dist/babylon.cloudProceduralTexture.js"></script>
+	<script src="../dist/babylon.grassProceduralTexture.js"></script>
+	<script src="../dist/babylon.roadProceduralTexture.js"></script>
+	<script src="../dist/babylon.brickProceduralTexture.js"></script>
+	<script src="../dist/babylon.marbleProceduralTexture.js"></script>
+	<script src="../dist/babylon.starfieldProceduralTexture.js"></script>
 
 	<style>
 		html, body {
@@ -39,7 +46,14 @@
 	<canvas id="renderCanvas"></canvas>
 
 	<script src="index.js"></script>
+    <script src="add/addCloudPT.js"></script>
     <script src="add/addFirePT.js"></script>
+    <script src="add/addWoodPT.js"></script>
+    <script src="add/addGrassPT.js"></script>
+    <script src="add/addRoadPT.js"></script>
+    <script src="add/addBrickPT.js"></script>
+    <script src="add/addMarblePT.js"></script>
+    <script src="add/addStarfieldPT.js"></script>
 	<script>
 		if (BABYLON.Engine.isSupported()) {
 			var canvas = document.getElementById("renderCanvas");
@@ -154,17 +168,73 @@
                 var firePT = addFirePT();
 				var fireMaterial =  new BABYLON.StandardMaterial("fire", scene);
 				fireMaterial.diffuseTexture = firePT;
+				
+				// Wood Procedural Texture
+                var woodPT = addWoodPT();
+				var woodMaterial =  new BABYLON.StandardMaterial("wood", scene);
+				woodMaterial.diffuseTexture = woodPT;
+				
+				// Cloud Procedural Texture
+                var cloudPT = addCloudPT();
+				var cloudMaterial =  new BABYLON.StandardMaterial("cloud", scene);
+				cloudMaterial.diffuseTexture = cloudPT;
+				
+				// Grass Procedural Texture
+                var grassPT = addGrassPT();
+				var grassMaterial =  new BABYLON.StandardMaterial("grass", scene);
+				grassMaterial.diffuseTexture = grassPT;
+				
+				// Road Procedural Texture
+                var roadPT = addRoadPT();
+				var roadMaterial =  new BABYLON.StandardMaterial("road", scene);
+				roadMaterial.diffuseTexture = roadPT;
+				
+				// Brick Procedural Texture
+                var brickPT = addBrickPT();
+				var brickMaterial =  new BABYLON.StandardMaterial("brick", scene);
+				brickMaterial.diffuseTexture = brickPT;
+				
+				// Marble Procedural Texture
+                var marblePT = addMarblePT();
+				var marbleMaterial =  new BABYLON.StandardMaterial("marble", scene);
+				marbleMaterial.diffuseTexture = marblePT;
+				
+				// Starfield Procedural Texture
+                var starfieldPT = addStarfieldPT();
+				var starfieldMaterial =  new BABYLON.StandardMaterial("starfield", scene);
+			 	starfieldMaterial.diffuseTexture = starfieldPT;
 								
 				// Default to std
 				var currentMaterial = std;
 				sphere.material = std;				
 				sphere.receiveShadows = true;
 
-				gui.add(options, 'material', ['none','fire']).onFinishChange(function () {
+				gui.add(options, 'material', ['none', 'fire', 'wood', 'cloud', 'grass', 'road', 'brick', 'marble', 'starfield']).onFinishChange(function () {
 					switch (options.material) {
 						case "fire":
 							currentMaterial = fireMaterial;
 							break;
+						case "wood":
+							currentMaterial = woodMaterial;
+							break;
+						case "cloud":
+							currentMaterial = cloudMaterial;
+							break;
+						case "grass":
+							currentMaterial = grassMaterial;
+							break;
+						case "road":
+							currentMaterial = roadMaterial;
+							break;
+						case "brick":
+							currentMaterial = brickMaterial;
+							break;
+						case "marble":
+							currentMaterial = marbleMaterial;
+							break;
+						case "starfield":
+							currentMaterial = starfieldMaterial;
+							break;
 						case "none":
 						default:
 							currentMaterial = std;
@@ -197,8 +267,6 @@
 					currentMesh.setEnabled(true);
 					currentMesh.receiveShadows = true;
 					currentMesh.material = currentMaterial;
-					
-					water.mesh = currentMesh;
 				});
 
 				var f1 = gui.addFolder('lights');

+ 0 - 419
src/Materials/Textures/Procedurals/babylon.standardProceduralTexture.js

@@ -1,419 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var BABYLON;
-(function (BABYLON) {
-    var WoodProceduralTexture = (function (_super) {
-        __extends(WoodProceduralTexture, _super);
-        function WoodProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
-            _super.call(this, name, size, "woodtexture", scene, fallbackTexture, generateMipMaps);
-            this._ampScale = 100.0;
-            this._woodColor = new BABYLON.Color3(0.32, 0.17, 0.09);
-            this.updateShaderUniforms();
-            this.refreshRate = 0;
-        }
-        WoodProceduralTexture.prototype.updateShaderUniforms = function () {
-            this.setFloat("ampScale", this._ampScale);
-            this.setColor3("woodColor", this._woodColor);
-        };
-        Object.defineProperty(WoodProceduralTexture.prototype, "ampScale", {
-            get: function () {
-                return this._ampScale;
-            },
-            set: function (value) {
-                this._ampScale = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(WoodProceduralTexture.prototype, "woodColor", {
-            get: function () {
-                return this._woodColor;
-            },
-            set: function (value) {
-                this._woodColor = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        return WoodProceduralTexture;
-    })(BABYLON.ProceduralTexture);
-    BABYLON.WoodProceduralTexture = WoodProceduralTexture;
-    var FireProceduralTexture = (function (_super) {
-        __extends(FireProceduralTexture, _super);
-        function FireProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
-            _super.call(this, name, size, "firetexture", scene, fallbackTexture, generateMipMaps);
-            this._time = 0.0;
-            this._speed = new BABYLON.Vector2(0.5, 0.3);
-            this._autoGenerateTime = true;
-            this._alphaThreshold = 0.5;
-            this._fireColors = FireProceduralTexture.RedFireColors;
-            this.updateShaderUniforms();
-            this.refreshRate = 1;
-        }
-        FireProceduralTexture.prototype.updateShaderUniforms = function () {
-            this.setFloat("time", this._time);
-            this.setVector2("speed", this._speed);
-            this.setColor3("c1", this._fireColors[0]);
-            this.setColor3("c2", this._fireColors[1]);
-            this.setColor3("c3", this._fireColors[2]);
-            this.setColor3("c4", this._fireColors[3]);
-            this.setColor3("c5", this._fireColors[4]);
-            this.setColor3("c6", this._fireColors[5]);
-            this.setFloat("alphaThreshold", this._alphaThreshold);
-        };
-        FireProceduralTexture.prototype.render = function (useCameraPostProcess) {
-            if (this._autoGenerateTime) {
-                this._time += this.getScene().getAnimationRatio() * 0.03;
-                this.updateShaderUniforms();
-            }
-            _super.prototype.render.call(this, useCameraPostProcess);
-        };
-        Object.defineProperty(FireProceduralTexture, "PurpleFireColors", {
-            get: function () {
-                return [
-                    new BABYLON.Color3(0.5, 0.0, 1.0),
-                    new BABYLON.Color3(0.9, 0.0, 1.0),
-                    new BABYLON.Color3(0.2, 0.0, 1.0),
-                    new BABYLON.Color3(1.0, 0.9, 1.0),
-                    new BABYLON.Color3(0.1, 0.1, 1.0),
-                    new BABYLON.Color3(0.9, 0.9, 1.0)
-                ];
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(FireProceduralTexture, "GreenFireColors", {
-            get: function () {
-                return [
-                    new BABYLON.Color3(0.5, 1.0, 0.0),
-                    new BABYLON.Color3(0.5, 1.0, 0.0),
-                    new BABYLON.Color3(0.3, 0.4, 0.0),
-                    new BABYLON.Color3(0.5, 1.0, 0.0),
-                    new BABYLON.Color3(0.2, 0.0, 0.0),
-                    new BABYLON.Color3(0.5, 1.0, 0.0)
-                ];
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(FireProceduralTexture, "RedFireColors", {
-            get: function () {
-                return [
-                    new BABYLON.Color3(0.5, 0.0, 0.1),
-                    new BABYLON.Color3(0.9, 0.0, 0.0),
-                    new BABYLON.Color3(0.2, 0.0, 0.0),
-                    new BABYLON.Color3(1.0, 0.9, 0.0),
-                    new BABYLON.Color3(0.1, 0.1, 0.1),
-                    new BABYLON.Color3(0.9, 0.9, 0.9)
-                ];
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(FireProceduralTexture, "BlueFireColors", {
-            get: function () {
-                return [
-                    new BABYLON.Color3(0.1, 0.0, 0.5),
-                    new BABYLON.Color3(0.0, 0.0, 0.5),
-                    new BABYLON.Color3(0.1, 0.0, 0.2),
-                    new BABYLON.Color3(0.0, 0.0, 1.0),
-                    new BABYLON.Color3(0.1, 0.2, 0.3),
-                    new BABYLON.Color3(0.0, 0.2, 0.9)
-                ];
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(FireProceduralTexture.prototype, "fireColors", {
-            get: function () {
-                return this._fireColors;
-            },
-            set: function (value) {
-                this._fireColors = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(FireProceduralTexture.prototype, "time", {
-            get: function () {
-                return this._time;
-            },
-            set: function (value) {
-                this._time = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(FireProceduralTexture.prototype, "speed", {
-            get: function () {
-                return this._speed;
-            },
-            set: function (value) {
-                this._speed = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(FireProceduralTexture.prototype, "alphaThreshold", {
-            get: function () {
-                return this._alphaThreshold;
-            },
-            set: function (value) {
-                this._alphaThreshold = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        return FireProceduralTexture;
-    })(BABYLON.ProceduralTexture);
-    BABYLON.FireProceduralTexture = FireProceduralTexture;
-    var CloudProceduralTexture = (function (_super) {
-        __extends(CloudProceduralTexture, _super);
-        function CloudProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
-            _super.call(this, name, size, "cloudtexture", scene, fallbackTexture, generateMipMaps);
-            this._skyColor = new BABYLON.Color4(0.15, 0.68, 1.0, 1.0);
-            this._cloudColor = new BABYLON.Color4(1, 1, 1, 1.0);
-            this.updateShaderUniforms();
-            this.refreshRate = 0;
-        }
-        CloudProceduralTexture.prototype.updateShaderUniforms = function () {
-            this.setColor4("skyColor", this._skyColor);
-            this.setColor4("cloudColor", this._cloudColor);
-        };
-        Object.defineProperty(CloudProceduralTexture.prototype, "skyColor", {
-            get: function () {
-                return this._skyColor;
-            },
-            set: function (value) {
-                this._skyColor = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(CloudProceduralTexture.prototype, "cloudColor", {
-            get: function () {
-                return this._cloudColor;
-            },
-            set: function (value) {
-                this._cloudColor = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        return CloudProceduralTexture;
-    })(BABYLON.ProceduralTexture);
-    BABYLON.CloudProceduralTexture = CloudProceduralTexture;
-    var GrassProceduralTexture = (function (_super) {
-        __extends(GrassProceduralTexture, _super);
-        function GrassProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
-            _super.call(this, name, size, "grasstexture", scene, fallbackTexture, generateMipMaps);
-            this._herb1 = new BABYLON.Color3(0.29, 0.38, 0.02);
-            this._herb2 = new BABYLON.Color3(0.36, 0.49, 0.09);
-            this._herb3 = new BABYLON.Color3(0.51, 0.6, 0.28);
-            this._groundColor = new BABYLON.Color3(1, 1, 1);
-            this._grassColors = [
-                new BABYLON.Color3(0.29, 0.38, 0.02),
-                new BABYLON.Color3(0.36, 0.49, 0.09),
-                new BABYLON.Color3(0.51, 0.6, 0.28)
-            ];
-            this.updateShaderUniforms();
-            this.refreshRate = 0;
-        }
-        GrassProceduralTexture.prototype.updateShaderUniforms = function () {
-            this.setColor3("herb1Color", this._grassColors[0]);
-            this.setColor3("herb2Color", this._grassColors[1]);
-            this.setColor3("herb3Color", this._grassColors[2]);
-            this.setColor3("groundColor", this._groundColor);
-        };
-        Object.defineProperty(GrassProceduralTexture.prototype, "grassColors", {
-            get: function () {
-                return this._grassColors;
-            },
-            set: function (value) {
-                this._grassColors = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(GrassProceduralTexture.prototype, "groundColor", {
-            get: function () {
-                return this._groundColor;
-            },
-            set: function (value) {
-                this.groundColor = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        return GrassProceduralTexture;
-    })(BABYLON.ProceduralTexture);
-    BABYLON.GrassProceduralTexture = GrassProceduralTexture;
-    var RoadProceduralTexture = (function (_super) {
-        __extends(RoadProceduralTexture, _super);
-        function RoadProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
-            _super.call(this, name, size, "roadtexture", scene, fallbackTexture, generateMipMaps);
-            this._roadColor = new BABYLON.Color3(0.53, 0.53, 0.53);
-            this.updateShaderUniforms();
-            this.refreshRate = 0;
-        }
-        RoadProceduralTexture.prototype.updateShaderUniforms = function () {
-            this.setColor3("roadColor", this._roadColor);
-        };
-        Object.defineProperty(RoadProceduralTexture.prototype, "roadColor", {
-            get: function () {
-                return this._roadColor;
-            },
-            set: function (value) {
-                this._roadColor = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        return RoadProceduralTexture;
-    })(BABYLON.ProceduralTexture);
-    BABYLON.RoadProceduralTexture = RoadProceduralTexture;
-    var BrickProceduralTexture = (function (_super) {
-        __extends(BrickProceduralTexture, _super);
-        function BrickProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
-            _super.call(this, name, size, "bricktexture", scene, fallbackTexture, generateMipMaps);
-            this._numberOfBricksHeight = 15;
-            this._numberOfBricksWidth = 5;
-            this._jointColor = new BABYLON.Color3(0.72, 0.72, 0.72);
-            this._brickColor = new BABYLON.Color3(0.77, 0.47, 0.40);
-            this.updateShaderUniforms();
-            this.refreshRate = 0;
-        }
-        BrickProceduralTexture.prototype.updateShaderUniforms = function () {
-            this.setFloat("numberOfBricksHeight", this._numberOfBricksHeight);
-            this.setFloat("numberOfBricksWidth", this._numberOfBricksWidth);
-            this.setColor3("brickColor", this._brickColor);
-            this.setColor3("jointColor", this._jointColor);
-        };
-        Object.defineProperty(BrickProceduralTexture.prototype, "numberOfBricksHeight", {
-            get: function () {
-                return this._numberOfBricksHeight;
-            },
-            set: function (value) {
-                this._numberOfBricksHeight = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(BrickProceduralTexture.prototype, "numberOfBricksWidth", {
-            get: function () {
-                return this._numberOfBricksWidth;
-            },
-            set: function (value) {
-                this._numberOfBricksWidth = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(BrickProceduralTexture.prototype, "jointColor", {
-            get: function () {
-                return this._jointColor;
-            },
-            set: function (value) {
-                this._jointColor = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(BrickProceduralTexture.prototype, "brickColor", {
-            get: function () {
-                return this._brickColor;
-            },
-            set: function (value) {
-                this._brickColor = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        return BrickProceduralTexture;
-    })(BABYLON.ProceduralTexture);
-    BABYLON.BrickProceduralTexture = BrickProceduralTexture;
-    var MarbleProceduralTexture = (function (_super) {
-        __extends(MarbleProceduralTexture, _super);
-        function MarbleProceduralTexture(name, size, scene, fallbackTexture, generateMipMaps) {
-            _super.call(this, name, size, "marbletexture", scene, fallbackTexture, generateMipMaps);
-            this._numberOfTilesHeight = 3;
-            this._numberOfTilesWidth = 3;
-            this._amplitude = 9.0;
-            this._marbleColor = new BABYLON.Color3(0.77, 0.47, 0.40);
-            this._jointColor = new BABYLON.Color3(0.72, 0.72, 0.72);
-            this.updateShaderUniforms();
-            this.refreshRate = 0;
-        }
-        MarbleProceduralTexture.prototype.updateShaderUniforms = function () {
-            this.setFloat("numberOfTilesHeight", this._numberOfTilesHeight);
-            this.setFloat("numberOfTilesWidth", this._numberOfTilesWidth);
-            this.setFloat("amplitude", this._amplitude);
-            this.setColor3("marbleColor", this._marbleColor);
-            this.setColor3("jointColor", this._jointColor);
-        };
-        Object.defineProperty(MarbleProceduralTexture.prototype, "numberOfTilesHeight", {
-            get: function () {
-                return this._numberOfTilesHeight;
-            },
-            set: function (value) {
-                this._numberOfTilesHeight = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(MarbleProceduralTexture.prototype, "numberOfTilesWidth", {
-            get: function () {
-                return this._numberOfTilesWidth;
-            },
-            set: function (value) {
-                this._numberOfTilesWidth = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(MarbleProceduralTexture.prototype, "jointColor", {
-            get: function () {
-                return this._jointColor;
-            },
-            set: function (value) {
-                this._jointColor = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(MarbleProceduralTexture.prototype, "marbleColor", {
-            get: function () {
-                return this._marbleColor;
-            },
-            set: function (value) {
-                this._marbleColor = value;
-                this.updateShaderUniforms();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        return MarbleProceduralTexture;
-    })(BABYLON.ProceduralTexture);
-    BABYLON.MarbleProceduralTexture = MarbleProceduralTexture;
-})(BABYLON || (BABYLON = {}));