소스 검색

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.