Browse Source

Getting all parameters out for starfield PT

Etienne Margraff 9 năm trước cách đây
mục cha
commit
8711a02c9a
19 tập tin đã thay đổi với 2320 bổ sung1959 xóa
  1. 1 1
      proceduralTexturesLibrary/dist/babylon.brickProceduralTexture.js
  2. 1 1
      proceduralTexturesLibrary/dist/babylon.brickProceduralTexture.min.js
  3. 1 1
      proceduralTexturesLibrary/dist/babylon.cloudProceduralTexture.js
  4. 1 1
      proceduralTexturesLibrary/dist/babylon.cloudProceduralTexture.min.js
  5. 1 1
      proceduralTexturesLibrary/dist/babylon.fireProceduralTexture.js
  6. 1 1
      proceduralTexturesLibrary/dist/babylon.fireProceduralTexture.min.js
  7. 1 1
      proceduralTexturesLibrary/dist/babylon.grassProceduralTexture.js
  8. 1 1
      proceduralTexturesLibrary/dist/babylon.grassProceduralTexture.min.js
  9. 1 1
      proceduralTexturesLibrary/dist/babylon.marbleProceduralTexture.js
  10. 1 1
      proceduralTexturesLibrary/dist/babylon.marbleProceduralTexture.min.js
  11. 1 1
      proceduralTexturesLibrary/dist/babylon.roadProceduralTexture.js
  12. 1 1
      proceduralTexturesLibrary/dist/babylon.roadProceduralTexture.min.js
  13. 84 4
      proceduralTexturesLibrary/dist/babylon.starfieldProceduralTexture.js
  14. 1 1
      proceduralTexturesLibrary/dist/babylon.starfieldProceduralTexture.min.js
  15. 1 1
      proceduralTexturesLibrary/dist/babylon.woodProceduralTexture.js
  16. 1 1
      proceduralTexturesLibrary/dist/babylon.woodProceduralTexture.min.js
  17. 73 5
      proceduralTexturesLibrary/proceduralTextures/starfield/babylon.starfieldProceduralTexture.ts
  18. 9 11
      proceduralTexturesLibrary/proceduralTextures/starfield/starfieldProceduralTexture.fragment.fx
  19. 2139 1924
      proceduralTexturesLibrary/test/babylon.max.js

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
proceduralTexturesLibrary/dist/babylon.brickProceduralTexture.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
proceduralTexturesLibrary/dist/babylon.brickProceduralTexture.min.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
proceduralTexturesLibrary/dist/babylon.cloudProceduralTexture.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
proceduralTexturesLibrary/dist/babylon.cloudProceduralTexture.min.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
proceduralTexturesLibrary/dist/babylon.fireProceduralTexture.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
proceduralTexturesLibrary/dist/babylon.fireProceduralTexture.min.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
proceduralTexturesLibrary/dist/babylon.grassProceduralTexture.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
proceduralTexturesLibrary/dist/babylon.grassProceduralTexture.min.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
proceduralTexturesLibrary/dist/babylon.marbleProceduralTexture.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
proceduralTexturesLibrary/dist/babylon.marbleProceduralTexture.min.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
proceduralTexturesLibrary/dist/babylon.roadProceduralTexture.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
proceduralTexturesLibrary/dist/babylon.roadProceduralTexture.min.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 84 - 4
proceduralTexturesLibrary/dist/babylon.starfieldProceduralTexture.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
proceduralTexturesLibrary/dist/babylon.starfieldProceduralTexture.min.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
proceduralTexturesLibrary/dist/babylon.woodProceduralTexture.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 1
proceduralTexturesLibrary/dist/babylon.woodProceduralTexture.min.js


+ 73 - 5
proceduralTexturesLibrary/proceduralTextures/starfield/babylon.starfieldProceduralTexture.ts

@@ -6,6 +6,13 @@ module BABYLON {
         private _alpha = 0.5;
         private _beta = 0.8;
         private _zoom = 0.8;
+        private _formuparam = 0.53;
+        private _stepsize = 0.1;
+        private _tile = 0.850;
+        private _brightness = 0.0015;
+        private _darkmatter = 0.400;
+        private _distfading = 0.730;
+        private _saturation = 0.850;
 
         constructor(name: string, size: number, scene: Scene, fallbackTexture?: Texture, generateMipMaps?: boolean) {
             super(name, size, "starfieldProceduralTexture", scene, fallbackTexture, generateMipMaps);
@@ -17,6 +24,13 @@ module BABYLON {
             this.setFloat("alpha", this._alpha);  
             this.setFloat("beta", this._beta);  
             this.setFloat("zoom", this._zoom); 
+            this.setFloat("formuparam", this._formuparam); 
+            this.setFloat("stepsize", this._stepsize); 
+            this.setFloat("tile", this._tile); 
+            this.setFloat("brightness", this._brightness); 
+            this.setFloat("darkmatter", this._darkmatter); 
+            this.setFloat("distfading", this._distfading); 
+            this.setFloat("saturation", this._saturation); 
         }
 
         public get time(): number {
@@ -46,13 +60,67 @@ module BABYLON {
             this.updateShaderUniforms();
         } 
 
-        public get zoom(): number {
-            return this._zoom;
+        public get formuparam(): number {
+            return this._formuparam;
         }
 
-        public set zoom(value: number) {
-            this._zoom = value;
+        public set formuparam(value: number) {
+            this._formuparam = value;
             this.updateShaderUniforms();
-        } 
+        }
+        
+        public get stepsize(): number {
+            return this._stepsize;
+        }
+
+        public set stepsize(value: number) {
+            this._stepsize = value;
+            this.updateShaderUniforms();
+        }
+        
+        public get tile(): number {
+            return this._tile;
+        }
+
+        public set tile(value: number) {
+            this._tile = value;
+            this.updateShaderUniforms();
+        }
+        
+        public get brightness(): number {
+            return this._brightness;
+        }
+
+        public set brightness(value: number) {
+            this._brightness = value;
+            this.updateShaderUniforms();
+        }
+        
+        public get darkmatter(): number {
+            return this._darkmatter;
+        }
+
+        public set darkmatter(value: number) {
+            this._darkmatter = value;
+            this.updateShaderUniforms();
+        }
+        
+        public get distfading(): number {
+            return this._distfading;
+        }
+
+        public set distfading(value: number) {
+            this._distfading = value;
+            this.updateShaderUniforms();
+        }
+        
+        public get saturation(): number {
+            return this._saturation;
+        }
+
+        public set saturation(value: number) {
+            this._saturation = value;
+            this.updateShaderUniforms();
+        }
     }
 }

+ 9 - 11
proceduralTexturesLibrary/proceduralTextures/starfield/starfieldProceduralTexture.fragment.fx

@@ -1,17 +1,8 @@
 precision highp float;
 
-#define iterations 15
-#define formuparam 0.53
-
+//defined as const as fragment shaders does not support uniforms in loops
 #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
+#define iterations 15
 
 varying vec2 vPosition;
 varying vec2 vUV;
@@ -20,6 +11,13 @@ uniform float time;
 uniform float alpha;
 uniform float beta;
 uniform float zoom;
+uniform float formuparam;
+uniform float stepsize;
+uniform float tile;
+uniform float brightness;
+uniform float darkmatter;
+uniform float distfading;
+uniform float saturation;
 
 void main()
 {

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 2139 - 1924
proceduralTexturesLibrary/test/babylon.max.js