Temechon пре 9 година
родитељ
комит
b24e58a0c0

+ 8 - 0
materialsLibrary/config.json

@@ -9,6 +9,14 @@
       "output": "babylon.normalMaterial.js"
       "output": "babylon.normalMaterial.js"
     },
     },
     {
     {
+      "file": "materials/lava/babylon.lavaMaterial.ts",
+      "shaderFiles": [
+        "materials/lava/lava.vertex.fx",
+        "materials/lava/lava.fragment.fx"
+      ],
+      "output": "babylon.lavaMaterial.js"
+    },
+    {
       "file": "materials/simple/babylon.simpleMaterial.ts",
       "file": "materials/simple/babylon.simpleMaterial.ts",
       "shaderFiles": [
       "shaderFiles": [
         "materials/simple/simple.vertex.fx",
         "materials/simple/simple.vertex.fx",

+ 1 - 1
materialsLibrary/materials/lava/readme.md

@@ -21,7 +21,7 @@ The diffuse texture will be the color of your lava, the noise texture will repre
 Notice that this material will update each vertex position of your object. If there are not enough vertices, 
 Notice that this material will update each vertex position of your object. If there are not enough vertices, 
 some artefacts may appears.
 some artefacts may appears.
 
 
-## Customize the water material
+## Customize the lava material
 
 
 You can customize two properties of the material:
 You can customize two properties of the material:
 
 

Разлика између датотеке није приказан због своје велике величине
+ 702 - 200
materialsLibrary/test/babylon.max.js


+ 14 - 1
materialsLibrary/test/index.html

@@ -8,6 +8,7 @@
 	<script src="../dist/babylon.normalMaterial.js"></script>
 	<script src="../dist/babylon.normalMaterial.js"></script>
 	<script src="../dist/babylon.waterMaterial.js"></script>
 	<script src="../dist/babylon.waterMaterial.js"></script>
 	<script src="../dist/babylon.fireMaterial.js"></script>
 	<script src="../dist/babylon.fireMaterial.js"></script>
+    <script src="../dist/babylon.lavaMaterial.js"></script>
 
 
 	<style>
 	<style>
 		html, body {
 		html, body {
@@ -151,6 +152,15 @@
 				std.diffuseTexture.uScale = 5;
 				std.diffuseTexture.uScale = 5;
 				std.diffuseTexture.vScale = 5;
 				std.diffuseTexture.vScale = 5;
 
 
+                // Lava
+                var lava = new BABYLON.LavaMaterial("lava", scene);
+                lava.diffuseTexture = new BABYLON.Texture("textures/lava/lavatile.jpg", scene);
+                lava.diffuseTexture.uScale = 0.5;
+                lava.diffuseTexture.vScale = 0.5;
+				lava.noiseTexture = new BABYLON.Texture("textures/lava/cloud.png", scene);
+				lava.fogColor = BABYLON.Color3.Black();
+				lava.speed = 2.5;
+
 				var simple = new BABYLON.SimpleMaterial("simple", scene);
 				var simple = new BABYLON.SimpleMaterial("simple", scene);
 				simple.diffuseTexture = new BABYLON.Texture("textures/amiga.jpg", scene);
 				simple.diffuseTexture = new BABYLON.Texture("textures/amiga.jpg", scene);
 				simple.diffuseTexture.uScale = 5;
 				simple.diffuseTexture.uScale = 5;
@@ -194,7 +204,7 @@
 					skybox: false
 					skybox: false
 				}
 				}
 
 
-				gui.add(options, 'material', ['standard', 'simple', 'water', 'fire', 'normal']).onFinishChange(function () {
+				gui.add(options, 'material', ['standard', 'simple', 'water', 'fire', 'lava', 'normal']).onFinishChange(function () {
 					water.enableRenderTargets(false);
 					water.enableRenderTargets(false);
 					
 					
 					switch (options.material) {
 					switch (options.material) {
@@ -209,6 +219,9 @@
                         case "fire":
                         case "fire":
                             currentMaterial = fire;
                             currentMaterial = fire;
                             break;
                             break;
+						case "lava":
+							currentMaterial = lava;
+							break;
 						case "normal":
 						case "normal":
 							currentMaterial = normal;
 							currentMaterial = normal;
 							break;
 							break;