|
|
@@ -15,34 +15,31 @@ To add a new procedural texture, you have to create your own folder in *procedur
|
|
|
|
|
|
## Integrating the procedural texture in the build process
|
|
|
|
|
|
-To build all procedural textures and generate the *dist* folder, just run:
|
|
|
+To build all procedural textures and generate the *dist* folder, just run from the tools/gulp folder:
|
|
|
|
|
|
```
|
|
|
-gulp
|
|
|
+gulp proceduralTextureLibrary
|
|
|
```
|
|
|
|
|
|
-To integrate your new procedural texture to the build process, you have to edit the config.sjon file and add an entry in the "proceduralTextures" section of the file:
|
|
|
+To integrate your new procedural texture to the build process, you have to edit the config.sjonfile in the tools/gulp folder and add an entry in the "proceduralTextureLibrary/libraries" section of the file:
|
|
|
|
|
|
```
|
|
|
-{
|
|
|
- "proceduralTextures": [
|
|
|
- {
|
|
|
- "file": "proceduralTextures/fire/babylon.fireProceduralTexture.ts",
|
|
|
- "shaderFiles": [
|
|
|
- "proceduralTextures/fire/fireProceduralTexture.fragment.fx"
|
|
|
- ],
|
|
|
- "output": "babylon.fireProceduralTexture.js"
|
|
|
- }
|
|
|
- ],
|
|
|
- "build": {
|
|
|
- "distOutputDirectory": "dist/"
|
|
|
- }
|
|
|
-}
|
|
|
+ "libraries": [
|
|
|
+ ...
|
|
|
+ {
|
|
|
+ "files": ["../../proceduralTexturesLibrary/src/wood/babylon.woodProceduralTexture.ts"],
|
|
|
+ "shaderFiles": [
|
|
|
+ "../../proceduralTexturesLibrary/src/wood/woodProceduralTexture.fragment.fx"
|
|
|
+ ],
|
|
|
+ "output": "babylon.woodProceduralTexture.js"
|
|
|
+ }
|
|
|
+ ...
|
|
|
+ ]
|
|
|
```
|
|
|
|
|
|
## Testing your procedural texture
|
|
|
|
|
|
-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:
|
|
|
+To test your procedural texture, you can use the /proceduralTextureLibrary/index.html page. References are added automatically. You only need to update the code to create an instance of your procedural texture and reference it in the UI system:
|
|
|
|
|
|
```
|
|
|
gui.add(options, 'texture', ['default', 'fire', 'wood', 'cloud', 'grass', 'road', 'brick', 'marble', '[YOURTEXTURE]', 'starfield']).onFinishChange(function () {
|
|
|
@@ -70,7 +67,7 @@ gui.add(options, 'texture', ['default', 'fire', 'wood', 'cloud', 'grass', 'road'
|
|
|
|
|
|
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.
|
|
|
|
|
|
-To serve this page, you can start:
|
|
|
+To serve this page, you can start from the tools/gulp folder the task:
|
|
|
|
|
|
```
|
|
|
gulp webserver
|