浏览代码

Fix readme for pt

Etienne Margraff 8 年之前
父节点
当前提交
236ce3513c
共有 1 个文件被更改,包括 21 次插入14 次删除
  1. 21 14
      proceduralTexturesLibrary/readme.md

+ 21 - 14
proceduralTexturesLibrary/readme.md

@@ -45,20 +45,27 @@ To integrate your new procedural texture to the build process, you have to edit
 To test your procedural texture, you can use the /test/index.html file by adding a reference to your .js file. Then you will need to update the code to create an instance of your procedural texture and reference it in the UI system:
 
 ```
-gui.add(options, 'material', ['none','fire']).onFinishChange(function () {
-  switch (options.material) {
-    case "fire":
-      currentMaterial = fireMaterial;
-      break;
-    case "none":
-    default:
-      currentMaterial = std;
-      break;
-  }
-
-  currentMesh.material = currentMaterial;
-  window.enableMaterial(options.material);
-});
+gui.add(options, 'texture', ['default', 'fire', 'wood', 'cloud', 'grass', 'road', 'brick', 'marble', '[YOURTEXTURE]', 'starfield']).onFinishChange(function () {
+					resetPTOptions();
+					switch (options.texture) {
+						case "fire":
+							currentTexture = firePT;
+							addPToptions(firePT, ['time', 'alphaThreshold', 'speed', ]);
+							break;
+						
+            //.......................
+
+            //YOURTEXTURE
+
+						case "none":
+						default:
+							currentTexture = diffuseTexture;
+							break;
+					}
+
+					std.diffuseTexture = currentTexture;
+					window.enableTexture(options.texture);
+				});
 ```
 
 This page allows you to test your code with animated meshes, shadows, various kinds of lights and fog. Just use the UI on the right to turn features on and off.