Jelajahi Sumber

Initial commit with postprocess lib

David Catuhe 6 tahun lalu
induk
melakukan
5f70e84a60
33 mengubah file dengan 1838 tambahan dan 2525 penghapusan
  1. 402 402
      Playground/index.html
  2. 25 24
      Tools/Gulp/config.json
  3. 2 2
      Tools/Gulp/package.json
  4. 171 0
      dist/preview release/postProcessLibrary/babylon.postProcessLibrary.module.d.ts
  5. 0 102
      dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.d.ts
  6. 0 225
      dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.js
  7. 0 1
      dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js
  8. 0 98
      dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.d.ts
  9. 0 234
      dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.js
  10. 0 1
      dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js
  11. 169 0
      dist/preview release/postProcessesLibrary/babylon.postProcesses.d.ts
  12. 2 0
      dist/preview release/postProcessesLibrary/babylon.postProcesses.js
  13. 2 0
      dist/preview release/postProcessesLibrary/babylon.postProcesses.min.js
  14. 1 0
      dist/preview release/postProcessesLibrary/babylon.postProcesses.min.js.map
  15. 351 0
      dist/preview release/postProcessesLibrary/babylon.postProcesses.module.d.ts
  16. 0 201
      dist/preview release/postProcessesLibrary/babylonjs.postProcess.d.ts
  17. 0 456
      dist/preview release/postProcessesLibrary/babylonjs.postProcess.js
  18. 0 1
      dist/preview release/postProcessesLibrary/babylonjs.postProcess.min.js
  19. 0 206
      dist/preview release/postProcessesLibrary/babylonjs.postProcess.module.d.ts
  20. 7 7
      dist/preview release/postProcessesLibrary/package.json
  21. 2 2
      gui/package.json
  22. 38 0
      postProcessLibrary/package.json
  23. 271 0
      postProcessLibrary/src/asciiArt/asciiArtPostProcess.ts
  24. 0 272
      postProcessLibrary/src/asciiArt/babylon.asciiArtPostProcess.ts
  25. 1 0
      postProcessLibrary/src/asciiArt/index.ts
  26. 0 279
      postProcessLibrary/src/digitalRain/babylon.digitalRainPostProcess.ts
  27. 277 0
      postProcessLibrary/src/digitalRain/digitalRainPostProcess.ts
  28. 1 0
      postProcessLibrary/src/digitalRain/index.ts
  29. 2 0
      postProcessLibrary/src/index.ts
  30. 16 0
      postProcessLibrary/src/legacy.ts
  31. 0 12
      postProcessLibrary/src/tsconfig.json
  32. 31 0
      postProcessLibrary/tsconfig.json
  33. 67 0
      postProcessLibrary/webpack.config.js

+ 402 - 402
Playground/index.html

@@ -1,489 +1,489 @@
 <!DOCTYPE html>
 <html>
 
-    <head>
-        <title>Babylon.js Playground</title>
-        <meta charset='utf-8' />
-        <meta name="viewport" content="width=device-width, user-scalable=no">
-        <link rel="shortcut icon" href="https://www.babylonjs.com/img/favicon/favicon.ico">
-        <link rel="apple-touch-icon" sizes="57x57" href="https://www.babylonjs.com/img/favicon/apple-icon-57x57.png">
-        <link rel="apple-touch-icon" sizes="60x60" href="https://www.babylonjs.com/img/favicon/apple-icon-60x60.png">
-        <link rel="apple-touch-icon" sizes="72x72" href="https://www.babylonjs.com/img/favicon/apple-icon-72x72.png">
-        <link rel="apple-touch-icon" sizes="76x76" href="https://www.babylonjs.com/img/favicon/apple-icon-76x76.png">
-        <link rel="apple-touch-icon" sizes="114x114" href="https://www.babylonjs.com/img/favicon/apple-icon-114x114.png">
-        <link rel="apple-touch-icon" sizes="120x120" href="https://www.babylonjs.com/img/favicon/apple-icon-120x120.png">
-        <link rel="apple-touch-icon" sizes="144x144" href="https://www.babylonjs.com/img/favicon/apple-icon-144x144.png">
-        <link rel="apple-touch-icon" sizes="152x152" href="https://www.babylonjs.com/img/favicon/apple-icon-152x152.png">
-        <link rel="apple-touch-icon" sizes="180x180" href="https://www.babylonjs.com/img/favicon/apple-icon-180x180.png">
-        <link rel="icon" type="image/png" sizes="192x192" href="https://www.babylonjs.com/img/favicon/android-icon-192x192.png">
-        <link rel="icon" type="image/png" sizes="32x32" href="https://www.babylonjs.com/img/favicon/favicon-32x32.png">
-        <link rel="icon" type="image/png" sizes="96x96" href="https://www.babylonjs.com/img/favicon/favicon-96x96.png">
-        <link rel="icon" type="image/png" sizes="16x16" href="https://www.babylonjs.com/img/favicon/favicon-16x16.png">
-        <link rel="manifest" href="https://www.babylonjs.com/img/favicon/manifest.json">
-        <meta name="msapplication-TileColor" content="#ffffff">
-        <meta name="msapplication-TileImage" content="https://www.babylonjs.com/img/favicon/ms-icon-144x144.png">
-        <meta name="msapplication-config" content="https://www.babylonjs.com/img/favicon/browserconfig.xml">
-        <meta name="theme-color" content="#ffffff">
-
-        <script src="js/libs/pep.min.js"></script>
-        <!--For canvas/code separator-->
-        <script src="js/libs/split.js"></script>
-
-        <script src="js/libs/dat.gui.min.js"></script>
-        <!-- jszip -->
-        <script src="js/libs/jszip.min.js"></script>
-        <script src="js/libs/fileSaver.js"></script>
-        <!-- Dependencies -->
-        <script src="https://preview.babylonjs.com/cannon.js"></script>
-        <script src="https://preview.babylonjs.com/Oimo.js"></script>
-        <script src="https://preview.babylonjs.com/gltf_validator.js"></script>
-        <script src="https://preview.babylonjs.com/earcut.min.js"></script>
-        <!-- Babylon.js -->
-        <script src="https://preview.babylonjs.com/babylon.js"></script>
-        <script src="https://preview.babylonjs.com/gui/babylon.gui.min.js"></script>
-        <script src="https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js"></script>
-        <script src="https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.min.js"></script>
-        <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js"></script>
-        <script src="https://preview.babylonjs.com/postProcessesLibrary/babylonjs.postProcess.min.js"></script>
-        <script src="https://preview.babylonjs.com/loaders/babylonjs.loaders.js"></script>
-        <script src="https://preview.babylonjs.com/serializers/babylonjs.serializers.min.js"></script>
-
-        <!-- Monaco -->
-        <script src="node_modules/monaco-editor/min/vs/loader.js"></script>
-
-
-        <!-- Extensions -->
-        <script src="https://rawgit.com/BabylonJS/Extensions/master/ClonerSystem/src/babylonx.cloner.js" async></script>
-        <script src="https://rawgit.com/BabylonJS/Extensions/master/CompoundShader/src/babylonx.CompoundShader.js" async></script>
-        <script src="https://www.babylontoolkit.com/playground/scripts/babylon.navmesh.js"></script>
-        <script src="https://www.babylontoolkit.com/playground/scripts/babylon.manager.js"></script>
-
-        <link href="css/index.css" rel="stylesheet" />
-    </head>
-
-    <body>
-        <div class="navbar navBar1600">
-            <div class="title">
-                Babylon.js Playground
-            </div>
-            <div class="version" id="mainTitle">
-            </div>
+<head>
+    <title>Babylon.js Playground</title>
+    <meta charset='utf-8' />
+    <meta name="viewport" content="width=device-width, user-scalable=no">
+    <link rel="shortcut icon" href="https://www.babylonjs.com/img/favicon/favicon.ico">
+    <link rel="apple-touch-icon" sizes="57x57" href="https://www.babylonjs.com/img/favicon/apple-icon-57x57.png">
+    <link rel="apple-touch-icon" sizes="60x60" href="https://www.babylonjs.com/img/favicon/apple-icon-60x60.png">
+    <link rel="apple-touch-icon" sizes="72x72" href="https://www.babylonjs.com/img/favicon/apple-icon-72x72.png">
+    <link rel="apple-touch-icon" sizes="76x76" href="https://www.babylonjs.com/img/favicon/apple-icon-76x76.png">
+    <link rel="apple-touch-icon" sizes="114x114" href="https://www.babylonjs.com/img/favicon/apple-icon-114x114.png">
+    <link rel="apple-touch-icon" sizes="120x120" href="https://www.babylonjs.com/img/favicon/apple-icon-120x120.png">
+    <link rel="apple-touch-icon" sizes="144x144" href="https://www.babylonjs.com/img/favicon/apple-icon-144x144.png">
+    <link rel="apple-touch-icon" sizes="152x152" href="https://www.babylonjs.com/img/favicon/apple-icon-152x152.png">
+    <link rel="apple-touch-icon" sizes="180x180" href="https://www.babylonjs.com/img/favicon/apple-icon-180x180.png">
+    <link rel="icon" type="image/png" sizes="192x192" href="https://www.babylonjs.com/img/favicon/android-icon-192x192.png">
+    <link rel="icon" type="image/png" sizes="32x32" href="https://www.babylonjs.com/img/favicon/favicon-32x32.png">
+    <link rel="icon" type="image/png" sizes="96x96" href="https://www.babylonjs.com/img/favicon/favicon-96x96.png">
+    <link rel="icon" type="image/png" sizes="16x16" href="https://www.babylonjs.com/img/favicon/favicon-16x16.png">
+    <link rel="manifest" href="https://www.babylonjs.com/img/favicon/manifest.json">
+    <meta name="msapplication-TileColor" content="#ffffff">
+    <meta name="msapplication-TileImage" content="https://www.babylonjs.com/img/favicon/ms-icon-144x144.png">
+    <meta name="msapplication-config" content="https://www.babylonjs.com/img/favicon/browserconfig.xml">
+    <meta name="theme-color" content="#ffffff">
+
+    <script src="js/libs/pep.min.js"></script>
+    <!--For canvas/code separator-->
+    <script src="js/libs/split.js"></script>
+
+    <script src="js/libs/dat.gui.min.js"></script>
+    <!-- jszip -->
+    <script src="js/libs/jszip.min.js"></script>
+    <script src="js/libs/fileSaver.js"></script>
+    <!-- Dependencies -->
+    <script src="https://preview.babylonjs.com/cannon.js"></script>
+    <script src="https://preview.babylonjs.com/Oimo.js"></script>
+    <script src="https://preview.babylonjs.com/gltf_validator.js"></script>
+    <script src="https://preview.babylonjs.com/earcut.min.js"></script>
+    <!-- Babylon.js -->
+    <script src="https://preview.babylonjs.com/babylon.js"></script>
+    <script src="https://preview.babylonjs.com/gui/babylon.gui.min.js"></script>
+    <script src="https://preview.babylonjs.com/inspector/babylon.inspector.bundle.js"></script>
+    <script src="https://preview.babylonjs.com/materialsLibrary/babylonjs.materials.min.js"></script>
+    <script src="https://preview.babylonjs.com/proceduralTexturesLibrary/babylonjs.proceduralTextures.min.js"></script>
+    <script src="https://preview.babylonjs.com/postProcessesLibrary/babylonjs.postProcesses.min.js"></script>
+    <script src="https://preview.babylonjs.com/loaders/babylonjs.loaders.js"></script>
+    <script src="https://preview.babylonjs.com/serializers/babylonjs.serializers.min.js"></script>
+
+    <!-- Monaco -->
+    <script src="node_modules/monaco-editor/min/vs/loader.js"></script>
+
+
+    <!-- Extensions -->
+    <script src="https://rawgit.com/BabylonJS/Extensions/master/ClonerSystem/src/babylonx.cloner.js" async></script>
+    <script src="https://rawgit.com/BabylonJS/Extensions/master/CompoundShader/src/babylonx.CompoundShader.js" async></script>
+    <script src="https://www.babylontoolkit.com/playground/scripts/babylon.navmesh.js"></script>
+    <script src="https://www.babylontoolkit.com/playground/scripts/babylon.manager.js"></script>
+
+    <link href="css/index.css" rel="stylesheet" />
+</head>
+
+<body>
+    <div class="navbar navBar1600">
+        <div class="title">
+            Babylon.js Playground
+        </div>
+        <div class="version" id="mainTitle">
+        </div>
 
-            <div class="category">
-                <div class="button run" id="runButton1600">Run
-                    <i class="fa fa-play" aria-hidden="true"></i>
-                </div>
+        <div class="category">
+            <div class="button run" id="runButton1600">Run
+                <i class="fa fa-play" aria-hidden="true"></i>
             </div>
+        </div>
 
 
-            <div class="category">
-                <div class="button" id="newButton1600">New
-                    <i class="fa fa-file" aria-hidden="true"></i>
-                </div>
-                <div class="button removeOnPhone" id="clearButton1600">Clear
-                    <i class="fa fa-trash" aria-hidden="true"></i>
-                </div>
+        <div class="category">
+            <div class="button" id="newButton1600">New
+                <i class="fa fa-file" aria-hidden="true"></i>
+            </div>
+            <div class="button removeOnPhone" id="clearButton1600">Clear
+                <i class="fa fa-trash" aria-hidden="true"></i>
             </div>
+        </div>
 
-            <div class="category">
-                <div class="button" id="saveButton1600">Save
-                    <i class="fa fa-floppy-o" aria-hidden="true"></i>
-                </div>
-                <div class="button removeOnPhone" id="zipButton1600">Zip
-                    <i class="fa fa-download" aria-hidden="true"></i>
-                </div>
+        <div class="category">
+            <div class="button" id="saveButton1600">Save
+                <i class="fa fa-floppy-o" aria-hidden="true"></i>
+            </div>
+            <div class="button removeOnPhone" id="zipButton1600">Zip
+                <i class="fa fa-download" aria-hidden="true"></i>
             </div>
+        </div>
 
-            <div class="category">
-                <div class="button select">Settings
-                    <div class="toDisplay">
-                        <div class="option subSelect">Theme
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" id="darkTheme1600">Dark</div>
-                                <div class="option" id="lightTheme1600">Light</div>
-                            </div>
+        <div class="category">
+            <div class="button select">Settings
+                <div class="toDisplay">
+                    <div class="option subSelect">Theme
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" id="darkTheme1600">Dark</div>
+                            <div class="option" id="lightTheme1600">Light</div>
                         </div>
-                        <div class="option subSelect">
-                            <span id="currentFontSize1600">Font: 14</span>
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" onclick="setFontSize(12);">12</div>
-                                <div class="option" onclick="setFontSize(14);">14</div>
-                                <div class="option" onclick="setFontSize(16);">16</div>
-                                <div class="option" onclick="setFontSize(18);">18</div>
-                                <div class="option" onclick="setFontSize(20);">20</div>
-                                <div class="option" onclick="setFontSize(22);">22</div>
-                            </div>
-                        </div>
-                        <div class="option" id="safemodeToggle1600">Safe mode
-                            <i class="far fa-square" aria-hidden="true"></i>
-                        </div>
-                        <div class="option checked" id="editorButton1600">Editor
-                            <i class="fa fa-check-square" aria-hidden="true"></i>
-                        </div>
-                        <div class="option" id="fullscreenButton1600">Fullscreen</div>
-                        <div class="option" id="editorFullscreenButton1600">Editor Fullscreen</div>
-                        <div class="option" id="formatButton1600">Format code</div>
-                        <div class="option" id="minimapToggle1600">Minimap
-                            <i class="far fa-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option subSelect">
+                        <span id="currentFontSize1600">Font: 14</span>
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" onclick="setFontSize(12);">12</div>
+                            <div class="option" onclick="setFontSize(14);">14</div>
+                            <div class="option" onclick="setFontSize(16);">16</div>
+                            <div class="option" onclick="setFontSize(18);">18</div>
+                            <div class="option" onclick="setFontSize(20);">20</div>
+                            <div class="option" onclick="setFontSize(22);">22</div>
                         </div>
                     </div>
+                    <div class="option" id="safemodeToggle1600">Safe mode
+                        <i class="far fa-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option checked" id="editorButton1600">Editor
+                        <i class="fa fa-check-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="fullscreenButton1600">Fullscreen</div>
+                    <div class="option" id="editorFullscreenButton1600">Editor Fullscreen</div>
+                    <div class="option" id="formatButton1600">Format code</div>
+                    <div class="option" id="minimapToggle1600">Minimap
+                        <i class="far fa-square" aria-hidden="true"></i>
+                    </div>
                 </div>
-
-                <div class="button uncheck" id="debugButton1600">Inspector</div>
-                <div class="button" id="metadataButton1600">Metadata</div>
             </div>
 
+            <div class="button uncheck" id="debugButton1600">Inspector</div>
+            <div class="button" id="metadataButton1600">Metadata</div>
+        </div>
 
 
-            <div class="category right">
-                <div class="button select">
-                    <span id="currentVersion1600">Version: Latest</span>
-                    <div class="toDisplay">
-                        <div class="option" onclick="setVersion('latest');">Latest</div>
-                        <div class="option" onclick="setVersion('stable');">Stable</div>
-                    </div>
-                </div>
-                <div class="button select">
-                    <span class="examplesButton">Examples</span>
+
+        <div class="category right">
+            <div class="button select">
+                <span id="currentVersion1600">Version: Latest</span>
+                <div class="toDisplay">
+                    <div class="option" onclick="setVersion('latest');">Latest</div>
+                    <div class="option" onclick="setVersion('stable');">Stable</div>
                 </div>
             </div>
+            <div class="button select">
+                <span class="examplesButton">Examples</span>
+            </div>
         </div>
+    </div>
 
-        <div class="navbar navBar1475">
-            <div class="title">
-                Babylon.js Playground
-            </div>
-            <div class="version" id="mainTitle">
-            </div>
+    <div class="navbar navBar1475">
+        <div class="title">
+            Babylon.js Playground
+        </div>
+        <div class="version" id="mainTitle">
+        </div>
 
-            <div class="category">
-                <div class="button run" id="runButton1475">Run
-                    <i class="fa fa-play" aria-hidden="true"></i>
-                </div>
+        <div class="category">
+            <div class="button run" id="runButton1475">Run
+                <i class="fa fa-play" aria-hidden="true"></i>
             </div>
+        </div>
 
 
-            <div class="category">
-                <div class="button" id="newButton1475">New
-                    <i class="fa fa-file" aria-hidden="true"></i>
-                </div>
-                <div class="button removeOnPhone" id="clearButton1475">Clear
-                    <i class="fa fa-trash" aria-hidden="true"></i>
-                </div>
+        <div class="category">
+            <div class="button" id="newButton1475">New
+                <i class="fa fa-file" aria-hidden="true"></i>
             </div>
+            <div class="button removeOnPhone" id="clearButton1475">Clear
+                <i class="fa fa-trash" aria-hidden="true"></i>
+            </div>
+        </div>
 
-            <div class="category">
-                <div class="button" id="saveButton1475">Save
-                    <i class="fa fa-floppy-o" aria-hidden="true"></i>
-                </div>
-                <div class="button removeOnPhone" id="zipButton1475">Zip
-                    <i class="fa fa-download" aria-hidden="true"></i>
-                </div>
+        <div class="category">
+            <div class="button" id="saveButton1475">Save
+                <i class="fa fa-floppy-o" aria-hidden="true"></i>
             </div>
+            <div class="button removeOnPhone" id="zipButton1475">Zip
+                <i class="fa fa-download" aria-hidden="true"></i>
+            </div>
+        </div>
 
-            <div class="category">
-                <div class="button select">Settings
-                    <div class="toDisplay">
-                        <div class="option subSelect">Theme
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" id="darkTheme1475">Dark</div>
-                                <div class="option" id="lightTheme1475">Light</div>
-                            </div>
-                        </div>
-                        <div class="option subSelect">
-                            <span id="currentFontSize1475">Font: 14</span>
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" onclick="setFontSize(12);">12</div>
-                                <div class="option" onclick="setFontSize(14);">14</div>
-                                <div class="option" onclick="setFontSize(16);">16</div>
-                                <div class="option" onclick="setFontSize(18);">18</div>
-                                <div class="option" onclick="setFontSize(20);">20</div>
-                                <div class="option" onclick="setFontSize(22);">22</div>
-                            </div>
+        <div class="category">
+            <div class="button select">Settings
+                <div class="toDisplay">
+                    <div class="option subSelect">Theme
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" id="darkTheme1475">Dark</div>
+                            <div class="option" id="lightTheme1475">Light</div>
                         </div>
-                        <div class="option" id='safemodeToggle1475'>Safe mode
-                            <i class="far fa-square" aria-hidden="true"></i>
-                        </div>
-                        <div class="option checked" id="editorButton1475">Editor
-                            <i class="fa fa-check-square" aria-hidden="true"></i>
-                        </div>
-                        <div class="option" id="fullscreenButton1475">Fullscreen</div>
-                        <div class="option" id="editorFullscreenButton1475">Editor Fullscreen</div>
-                        <div class="option" id="formatButton1475">Format code</div>
-                        <div class="option" id="minimapToggle1475">Minimap
-                            <i class="far fa-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option subSelect">
+                        <span id="currentFontSize1475">Font: 14</span>
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" onclick="setFontSize(12);">12</div>
+                            <div class="option" onclick="setFontSize(14);">14</div>
+                            <div class="option" onclick="setFontSize(16);">16</div>
+                            <div class="option" onclick="setFontSize(18);">18</div>
+                            <div class="option" onclick="setFontSize(20);">20</div>
+                            <div class="option" onclick="setFontSize(22);">22</div>
                         </div>
-                        <div class="option" id="debugButton1475">Inspector</div>
-                        <div class="option" id="metadataButton1475">Metadata</div>
-                        <div class="option subSelect">
-                            <span id="currentVersion1475">Vers. : Latest</span>
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" onclick="setVersion('latest');">Latest</div>
-                                <div class="option" onclick="setVersion('stable');">Stable</div>
-                            </div>
+                    </div>
+                    <div class="option" id='safemodeToggle1475'>Safe mode
+                        <i class="far fa-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option checked" id="editorButton1475">Editor
+                        <i class="fa fa-check-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="fullscreenButton1475">Fullscreen</div>
+                    <div class="option" id="editorFullscreenButton1475">Editor Fullscreen</div>
+                    <div class="option" id="formatButton1475">Format code</div>
+                    <div class="option" id="minimapToggle1475">Minimap
+                        <i class="far fa-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="debugButton1475">Inspector</div>
+                    <div class="option" id="metadataButton1475">Metadata</div>
+                    <div class="option subSelect">
+                        <span id="currentVersion1475">Vers. : Latest</span>
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" onclick="setVersion('latest');">Latest</div>
+                            <div class="option" onclick="setVersion('stable');">Stable</div>
                         </div>
                     </div>
                 </div>
             </div>
+        </div>
 
-            <div class="category right">
-                <div class="button select">
-                    <span class="examplesButton">Examples</span>
-                </div>
+        <div class="category right">
+            <div class="button select">
+                <span class="examplesButton">Examples</span>
             </div>
         </div>
+    </div>
 
-        <div class="navbar navBar1030">
-            <div class="category">
-                <div class="button run" id="runButton1030">Run
-                    <i class="fa fa-play" aria-hidden="true"></i>
-                </div>
+    <div class="navbar navBar1030">
+        <div class="category">
+            <div class="button run" id="runButton1030">Run
+                <i class="fa fa-play" aria-hidden="true"></i>
             </div>
+        </div>
 
 
-            <div class="category">
-                <div class="button" id="newButton1030">New
-                    <i class="fa fa-file" aria-hidden="true"></i>
-                </div>
-                <div class="button removeOnPhone" id="clearButton1030">Clear
-                    <i class="fa fa-trash" aria-hidden="true"></i>
-                </div>
+        <div class="category">
+            <div class="button" id="newButton1030">New
+                <i class="fa fa-file" aria-hidden="true"></i>
+            </div>
+            <div class="button removeOnPhone" id="clearButton1030">Clear
+                <i class="fa fa-trash" aria-hidden="true"></i>
             </div>
+        </div>
 
-            <div class="category">
-                <div class="button" id="saveButton1030">Save
-                    <i class="fa fa-floppy-o" aria-hidden="true"></i>
-                </div>
-                <div class="button removeOnPhone" id="zipButton1030">Zip
-                    <i class="fa fa-download" aria-hidden="true"></i>
-                </div>
+        <div class="category">
+            <div class="button" id="saveButton1030">Save
+                <i class="fa fa-floppy-o" aria-hidden="true"></i>
+            </div>
+            <div class="button removeOnPhone" id="zipButton1030">Zip
+                <i class="fa fa-download" aria-hidden="true"></i>
             </div>
+        </div>
 
-            <div class="category">
-                <div class="button select">Settings
-                    <div class="toDisplay">
-                        <div class="option subSelect">Theme
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" id="darkTheme1030">Dark</div>
-                                <div class="option" id="lightTheme1030">Light</div>
-                            </div>
-                        </div>
-                        <div class="option subSelect">
-                            <span id="currentFontSize1030">Font: 14</span>
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" onclick="setFontSize(12);">12</div>
-                                <div class="option" onclick="setFontSize(14);">14</div>
-                                <div class="option" onclick="setFontSize(16);">16</div>
-                                <div class="option" onclick="setFontSize(18);">18</div>
-                                <div class="option" onclick="setFontSize(20);">20</div>
-                                <div class="option" onclick="setFontSize(22);">22</div>
-                            </div>
-                        </div>
-                        <div class="option" id="safemodeToggle1030">Safe mode
-                            <i class="far fa-square" aria-hidden="true"></i>
+        <div class="category">
+            <div class="button select">Settings
+                <div class="toDisplay">
+                    <div class="option subSelect">Theme
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" id="darkTheme1030">Dark</div>
+                            <div class="option" id="lightTheme1030">Light</div>
                         </div>
-                        <div class="option checked" id="editorButton1030">Editor
-                            <i class="fa fa-check-square" aria-hidden="true"></i>
-                        </div>
-                        <div class="option" id="fullscreenButton1030">Fullscreen</div>
-                        <div class="option" id="editorFullscreenButton1030">Editor Fullscreen</div>
-                        <div class="option" id="formatButton1030">Format code</div>
-                        <div class="option" id="minimapToggle1030">Minimap
-                            <i class="far fa-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option subSelect">
+                        <span id="currentFontSize1030">Font: 14</span>
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" onclick="setFontSize(12);">12</div>
+                            <div class="option" onclick="setFontSize(14);">14</div>
+                            <div class="option" onclick="setFontSize(16);">16</div>
+                            <div class="option" onclick="setFontSize(18);">18</div>
+                            <div class="option" onclick="setFontSize(20);">20</div>
+                            <div class="option" onclick="setFontSize(22);">22</div>
                         </div>
-                        <div class="option" id="debugButton1030">Inspector</div>
-                        <div class="option" id="metadataButton1030">Metadata</div>
-                        <div class="option subSelect">
-                            <span id="currentVersion1030">Vers. : Latest</span>
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" onclick="setVersion('latest');">Latest</div>
-                                <div class="option" onclick="setVersion('stable');">Stable</div>
-                            </div>
+                    </div>
+                    <div class="option" id="safemodeToggle1030">Safe mode
+                        <i class="far fa-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option checked" id="editorButton1030">Editor
+                        <i class="fa fa-check-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="fullscreenButton1030">Fullscreen</div>
+                    <div class="option" id="editorFullscreenButton1030">Editor Fullscreen</div>
+                    <div class="option" id="formatButton1030">Format code</div>
+                    <div class="option" id="minimapToggle1030">Minimap
+                        <i class="far fa-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="debugButton1030">Inspector</div>
+                    <div class="option" id="metadataButton1030">Metadata</div>
+                    <div class="option subSelect">
+                        <span id="currentVersion1030">Vers. : Latest</span>
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" onclick="setVersion('latest');">Latest</div>
+                            <div class="option" onclick="setVersion('stable');">Stable</div>
                         </div>
                     </div>
                 </div>
             </div>
+        </div>
 
-            <div class="category right">
-                <div class="button select">
-                    <span class="examplesButton">Examples</span>
-                </div>
+        <div class="category right">
+            <div class="button select">
+                <span class="examplesButton">Examples</span>
             </div>
         </div>
-
-        <div class="navbar navBar750">
-            <div class="category">
-                <div class="button select">File
-                    <div class="toDisplay">
-                        <div class="option" id="runButton750">Run
-                            <i class="fa fa-play" aria-hidden="true"></i>
-                        </div>
-                        <div class="option" id="newButton750">New
-                            <i class="fa fa-file" aria-hidden="true"></i>
-                        </div>
-                        <div class="option" id="clearButton750">Clear
-                            <i class="fa fa-trash" aria-hidden="true"></i>
-                        </div>
-                        <div class="option" id="saveButton750">Save
-                            <i class="fa fa-floppy-o" aria-hidden="true"></i>
-                        </div>
-                        <div class="option" id="zipButton750">Zip
-                            <i class="fa fa-download" aria-hidden="true"></i>
-                        </div>
+    </div>
+
+    <div class="navbar navBar750">
+        <div class="category">
+            <div class="button select">File
+                <div class="toDisplay">
+                    <div class="option" id="runButton750">Run
+                        <i class="fa fa-play" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="newButton750">New
+                        <i class="fa fa-file" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="clearButton750">Clear
+                        <i class="fa fa-trash" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="saveButton750">Save
+                        <i class="fa fa-floppy-o" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="zipButton750">Zip
+                        <i class="fa fa-download" aria-hidden="true"></i>
                     </div>
                 </div>
             </div>
+        </div>
 
-            <div class="category">
-                <div class="button select">Settings
-                    <div class="toDisplay">
-                        <div class="option subSelect">Theme
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" id="darkTheme750">Dark</div>
-                                <div class="option" id="lightTheme750">Light</div>
-                            </div>
-                        </div>
-                        <div class="option subSelect">
-                            <span id="currentFontSize750">Font: 14</span>
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" onclick="setFontSize(12);">12</div>
-                                <div class="option" onclick="setFontSize(14);">14</div>
-                                <div class="option" onclick="setFontSize(16);">16</div>
-                                <div class="option" onclick="setFontSize(18);">18</div>
-                                <div class="option" onclick="setFontSize(20);">20</div>
-                                <div class="option" onclick="setFontSize(22);">22</div>
-                            </div>
-                        </div>
-                        <div class="option" id="safemodeToggle750">Safe mode
-                            <i class="far fa-square" aria-hidden="true"></i>
+        <div class="category">
+            <div class="button select">Settings
+                <div class="toDisplay">
+                    <div class="option subSelect">Theme
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" id="darkTheme750">Dark</div>
+                            <div class="option" id="lightTheme750">Light</div>
                         </div>
-                        <div style="display:none;" class="option checked" id="editorButton750">Editor
-                            <i class="fa fa-check-square" aria-hidden="true"></i>
-                        </div>
-                        <div class="option" id="fullscreenButton750">Fullscreen</div>
-                        <div class="option" id="editorFullscreenButton750">Editor Fullscreen</div>
-                        <div class="option" id="formatButton750">Format code</div>
-                        <div class="option" id="minimapToggle750">Minimap
-                            <i class="far fa-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option subSelect">
+                        <span id="currentFontSize750">Font: 14</span>
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" onclick="setFontSize(12);">12</div>
+                            <div class="option" onclick="setFontSize(14);">14</div>
+                            <div class="option" onclick="setFontSize(16);">16</div>
+                            <div class="option" onclick="setFontSize(18);">18</div>
+                            <div class="option" onclick="setFontSize(20);">20</div>
+                            <div class="option" onclick="setFontSize(22);">22</div>
                         </div>
-                        <div class="option" id="debugButton750">Inspector</div>
-                        <div class="option" id="metadataButton750">Metadata</div>
-                        <div class="option subSelect">
-                            <span id="currentVersion750">Vers. : Latest</span>
-                            <i class="fa fa-chevron-right" aria-hidden="true"></i>
-                            <div class="toDisplaySub">
-                                <div class="option" onclick="setVersion('latest');">Latest</div>
-                                <div class="option" onclick="setVersion('stable');">Stable</div>
-                            </div>
+                    </div>
+                    <div class="option" id="safemodeToggle750">Safe mode
+                        <i class="far fa-square" aria-hidden="true"></i>
+                    </div>
+                    <div style="display:none;" class="option checked" id="editorButton750">Editor
+                        <i class="fa fa-check-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="fullscreenButton750">Fullscreen</div>
+                    <div class="option" id="editorFullscreenButton750">Editor Fullscreen</div>
+                    <div class="option" id="formatButton750">Format code</div>
+                    <div class="option" id="minimapToggle750">Minimap
+                        <i class="far fa-square" aria-hidden="true"></i>
+                    </div>
+                    <div class="option" id="debugButton750">Inspector</div>
+                    <div class="option" id="metadataButton750">Metadata</div>
+                    <div class="option subSelect">
+                        <span id="currentVersion750">Vers. : Latest</span>
+                        <i class="fa fa-chevron-right" aria-hidden="true"></i>
+                        <div class="toDisplaySub">
+                            <div class="option" onclick="setVersion('latest');">Latest</div>
+                            <div class="option" onclick="setVersion('stable');">Stable</div>
                         </div>
                     </div>
                 </div>
             </div>
+        </div>
 
-            <div class="category right">
-                <div class="button select">
-                    <span id="currentScript750">Examples</span>
-                </div>
+        <div class="category right">
+            <div class="button select">
+                <span id="currentScript750">Examples</span>
             </div>
         </div>
+    </div>
 
-        <div class="wrapper">
-            <div id="jsEditor"></div>
-            <div id="canvasZone">
-                <canvas touch-action="none" id="renderCanvas"></canvas>
-            </div>
+    <div class="wrapper">
+        <div id="jsEditor"></div>
+        <div id="canvasZone">
+            <canvas touch-action="none" id="renderCanvas"></canvas>
         </div>
-        <div id="exampleList" class="javascript">
-            <div id="exampleBanner">
-                <h1>Examples</h1>
-            </div>
-            <div class="horizontalSeparator"></div>
-            <input id="filterBar" type="text" placeholder="Filter examples...">
-            <img id="filterBarClear" src="https://d33wubrfki0l68.cloudfront.net/17ca450bae302631f4857cd8c3992234ec5dd9a7/057f9/img/ui/clear_button.png">
+    </div>
+    <div id="exampleList" class="javascript">
+        <div id="exampleBanner">
+            <h1>Examples</h1>
         </div>
+        <div class="horizontalSeparator"></div>
+        <input id="filterBar" type="text" placeholder="Filter examples...">
+        <img id="filterBarClear" src="https://d33wubrfki0l68.cloudfront.net/17ca450bae302631f4857cd8c3992234ec5dd9a7/057f9/img/ui/clear_button.png">
+    </div>
 
-        <span class="label" id="fpsLabel">FPS</span>
+    <span class="label" id="fpsLabel">FPS</span>
 
-        <div id="errorZone">
-        </div>
+    <div id="errorZone">
+    </div>
 
-        <div class="navbarBottom">
-            <div id="statusBar"></div>
-            <div class="links">
-                <div class='link'>
-                    <a target='_new' href="https://www.netlify.com/">Deployed by Netlify</a>
-                </div>
-                <div class='link'>
-                    <a target='_new' href="http://www.html5gamedevs.com/forum/16-babylonjs/">Forum</a>
-                </div>
-                <div class='link'>
-                    <a target='_new' href="https://www.babylonjs.com/sandbox">Sandbox</a>
-                </div>
-                <div class='link'>
-                    <a target='_new' href="https://doc.babylonjs.com">Documentation</a>
-                </div>
-                <div class='link'>
-                    <a target='_new' href="https://doc.babylonjs.com/playground">Search</a>
-                </div>
+    <div class="navbarBottom">
+        <div id="statusBar"></div>
+        <div class="links">
+            <div class='link'>
+                <a target='_new' href="https://www.netlify.com/">Deployed by Netlify</a>
+            </div>
+            <div class='link'>
+                <a target='_new' href="http://www.html5gamedevs.com/forum/16-babylonjs/">Forum</a>
+            </div>
+            <div class='link'>
+                <a target='_new' href="https://www.babylonjs.com/sandbox">Sandbox</a>
+            </div>
+            <div class='link'>
+                <a target='_new' href="https://doc.babylonjs.com">Documentation</a>
+            </div>
+            <div class='link'>
+                <a target='_new' href="https://doc.babylonjs.com/playground">Search</a>
             </div>
         </div>
+    </div>
 
-        <div id="saveLayer" class="save-layer">
-            <div class="save-form">
-                <label for="saveFormTitle">TITLE</label>
-                <div class="separator"></div>
-                <input type="text" maxlength="120" id="saveFormTitle" class="save-form-title">
+    <div id="saveLayer" class="save-layer">
+        <div class="save-form">
+            <label for="saveFormTitle">TITLE</label>
+            <div class="separator"></div>
+            <input type="text" maxlength="120" id="saveFormTitle" class="save-form-title">
 
-                <label for="saveFormDescription">DESCRIPTION</label>
-                <div class="separator"></div>
-                <textarea id="saveFormDescription" rows="4" cols="10"></textarea>
+            <label for="saveFormDescription">DESCRIPTION</label>
+            <div class="separator"></div>
+            <textarea id="saveFormDescription" rows="4" cols="10"></textarea>
 
-                <label for="saveFormTags">TAGS (separated by comma)</label>
-                <div class="separator"></div>
-                <textarea id="saveFormTags" rows="4" cols="10"></textarea>
+            <label for="saveFormTags">TAGS (separated by comma)</label>
+            <div class="separator"></div>
+            <textarea id="saveFormTags" rows="4" cols="10"></textarea>
 
-                <div class="save-form-buttons" id="saveFormButtons">
+            <div class="save-form-buttons" id="saveFormButtons">
 
-                    <div id="saveFormButtonOk" class="button">OK</div>
-                    <div id="saveFormButtonCancel" class="button">Cancel</div>
-                </div>
+                <div id="saveFormButtonOk" class="button">OK</div>
+                <div id="saveFormButtonCancel" class="button">Cancel</div>
             </div>
         </div>
-
-        <div id="waitDiv">
-            <span id="waitTitle">Babylon.js Playground
-                <BR>
-                <BR>
-                <BR>
-            </span>
-            <img src="waitlogo.png" id="waitLogo" />
-        </div>
-
-        <script src="js/libs/jquery.min.js"></script>
-
-        <script src="js/actions.js"></script>
-        <script src="js/pbt.js"></script>
-        <script src="js/index.js"></script>
-
-        <!-- Global site tag (gtag.js) - Google Analytics -->
-        <script async src="https://www.googletagmanager.com/gtag/js?id=UA-41767310-2"></script>
-        <script>
-            window.dataLayer = window.dataLayer || [];
-            function gtag() { dataLayer.push(arguments); }
-            gtag('js', new Date());
-
-            gtag('config', 'UA-41767310-2');
-        </script>
-    </body>
+    </div>
+
+    <div id="waitDiv">
+        <span id="waitTitle">Babylon.js Playground
+            <BR>
+            <BR>
+            <BR>
+        </span>
+        <img src="waitlogo.png" id="waitLogo" />
+    </div>
+
+    <script src="js/libs/jquery.min.js"></script>
+
+    <script src="js/actions.js"></script>
+    <script src="js/pbt.js"></script>
+    <script src="js/index.js"></script>
+
+    <!-- Global site tag (gtag.js) - Google Analytics -->
+    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-41767310-2"></script>
+    <script>
+        window.dataLayer = window.dataLayer || [];
+        function gtag() { dataLayer.push(arguments); }
+        gtag('js', new Date());
+
+        gtag('config', 'UA-41767310-2');
+    </script>
+</body>
 
 </html>

+ 25 - 24
Tools/Gulp/config.json

@@ -1635,35 +1635,36 @@
     "postProcessesLibrary": {
         "libraries": [
             {
-                "files": [
-                    "../../postProcessLibrary/src/asciiArt/babylon.asciiArtPostProcess.ts"
-                ],
-                "shaderFiles": [
-                    "../../postProcessLibrary/src/asciiArt/asciiart.fragment.fx"
-                ],
-                "output": "babylon.asciiArtPostProcess.js"
-            },
-            {
-                "files": [
-                    "../../postProcessLibrary/src/digitalRain/babylon.digitalRainPostProcess.ts"
-                ],
-                "shaderFiles": [
-                    "../../postProcessLibrary/src/digitalRain/digitalrain.fragment.fx"
-                ],
-                "output": "babylon.digitalRainPostProcess.js"
+                "files": [],
+                "noBundleInName": true,
+                "output": "babylon.postProcesses.min.js",
+                "webpack": "../../postProcessLibrary/webpack.config.js",
+                "bundle": "true",
+                "babylonIncluded": false,
+                "useOutputForDebugging": true
             }
         ],
         "build": {
-            "srcOutputDirectory": "../../postProcessLibrary/",
+            "srcOutputDirectory": "../../postProcessLibrary/src/",
             "distOutputDirectory": "/postProcessesLibrary/",
-            "buildAsModule": true,
-            "moduleName": "babylonjs-post-process",
-            "outputFilename": "babylonjs.postProcess",
-            "moduleDeclaration": {
-                "name": "PostProcesses",
-                "module": "babylonjs-post-process"
+            "dtsBundle": {
+                "name": "babylonjs-postProcessLibrary",
+                "main": "../../dist/preview release/postProcessesLibrary/build/index.d.ts",
+                "out": "../babylon.postProcesses.module.d.ts",
+                "baseDir": "../../dist/preview release/postProcessesLibrary/build/",
+                "headerText": "BabylonJS Postprocess library"
             },
-            "extendsRoot": true
+            "processDeclaration": {
+                "filename": "babylon.postProcesses.module.d.ts",
+                "packageName": "babylonjs-postProcessLibrary",
+                "moduleName": "BABYLON",
+                "importsToRemove": [],
+                "classMap": {
+                    "babylonjs": "BABYLON",
+                    "babylonjs-loaders": "BABYLON",
+                    "babylonjs-serializers": "BABYLON"
+                }
+            }
         }
     },
     "proceduralTexturesLibrary": {

+ 2 - 2
Tools/Gulp/package.json

@@ -50,10 +50,10 @@
         "webpack-stream": "5.0.0"
     },
     "scripts": {
-        "install": "cd ../../gui && npm install && cd ../Tools/Gulp/ &&  cd ../../inspector && npm install && cd ../Tools/Gulp/ && npm --prefix ../../Playground/ install ../../Playground/ && npm --prefix ../../tests/unit/ install ../../tests/unit/ && npm --prefix ../../Viewer/tests/ install ../../Viewer/tests/ && cd ../../Viewer && npm install && cd ../Tools/Gulp/ && gulp deployLocalDev"
+        "install": "cd ../../postProcessLibrary && npm install && cd ../../gui && npm install && cd ../Tools/Gulp/ &&  cd ../../inspector && npm install && cd ../Tools/Gulp/ && npm --prefix ../../Playground/ install ../../Playground/ && npm --prefix ../../tests/unit/ install ../../tests/unit/ && npm --prefix ../../Viewer/tests/ install ../../Viewer/tests/ && cd ../../Viewer && npm install && cd ../Tools/Gulp/ && gulp deployLocalDev"
     },
     "dependencies": {
         "dts-bundle": "^0.7.3",
         "gulp-clean": "^0.4.0"
     }
-}
+}

+ 171 - 0
dist/preview release/postProcessLibrary/babylon.postProcessLibrary.module.d.ts

@@ -0,0 +1,171 @@
+/*BabylonJS Postprocess library*/
+// Dependencies for this module:
+//   ../../../../tools/gulp/babylonjs
+
+export * from "babylonjs-postProcessLibrary/--/--/postProcessesLibrary/build/asciiArt";
+export * from "babylonjs-postProcessLibrary/--/--/postProcessesLibrary/build/digitalRain";
+
+export * from "babylonjs-postProcessLibrary/--/--/postProcessesLibrary/build/asciiArt/asciiArtPostProcess";
+
+export * from "babylonjs-postProcessLibrary/--/--/postProcessesLibrary/build/digitalRain/digitalRainPostProcess";
+
+import { BaseTexture, Nullable, Scene, PostProcess, Camera } from "babylonjs";
+/**
+    * AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
+    *
+    * It basically takes care rendering the font front the given font size to a texture.
+    * This is used later on in the postprocess.
+    */
+export declare class AsciiArtFontTexture extends BaseTexture {
+        /**
+            * Gets the size of one char in the texture (each char fits in size * size space in the texture).
+            */
+        readonly charSize: number;
+        /**
+            * Create a new instance of the Ascii Art FontTexture class
+            * @param name the name of the texture
+            * @param font the font to use, use the W3C CSS notation
+            * @param text the caracter set to use in the rendering.
+            * @param scene the scene that owns the texture
+            */
+        constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
+        /**
+            * Clones the current AsciiArtTexture.
+            * @return the clone of the texture.
+            */
+        clone(): AsciiArtFontTexture;
+        /**
+            * Parses a json object representing the texture and returns an instance of it.
+            * @param source the source JSON representation
+            * @param scene the scene to create the texture for
+            * @return the parsed texture
+            */
+        static Parse(source: any, scene: Scene): AsciiArtFontTexture;
+}
+/**
+    * Option available in the Ascii Art Post Process.
+    */
+export interface IAsciiArtPostProcessOptions {
+        /**
+            * The font to use following the w3c font definition.
+            */
+        font?: string;
+        /**
+            * The character set to use in the postprocess.
+            */
+        characterSet?: string;
+        /**
+            * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
+            * This number is defined between 0 and 1;
+            */
+        mixToTile?: number;
+        /**
+            * This defines the amount you want to mix the normal rendering pass in the ascii art.
+            * This number is defined between 0 and 1;
+            */
+        mixToNormal?: number;
+}
+/**
+    * AsciiArtPostProcess helps rendering everithing in Ascii Art.
+    *
+    * Simmply add it to your scene and let the nerd that lives in you have fun.
+    * Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
+    */
+export declare class AsciiArtPostProcess extends PostProcess {
+        /**
+            * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
+            * This number is defined between 0 and 1;
+            */
+        mixToTile: number;
+        /**
+            * This defines the amount you want to mix the normal rendering pass in the ascii art.
+            * This number is defined between 0 and 1;
+            */
+        mixToNormal: number;
+        /**
+            * Instantiates a new Ascii Art Post Process.
+            * @param name the name to give to the postprocess
+            * @camera the camera to apply the post process to.
+            * @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
+            */
+        constructor(name: string, camera: Camera, options?: string | IAsciiArtPostProcessOptions);
+}
+
+import { BaseTexture, Nullable, Scene, PostProcess, Camera } from "babylonjs";
+/**
+    * DigitalRainFontTexture is the helper class used to easily create your digital rain font texture.
+    *
+    * It basically takes care rendering the font front the given font size to a texture.
+    * This is used later on in the postprocess.
+    */
+export declare class DigitalRainFontTexture extends BaseTexture {
+        /**
+            * Gets the size of one char in the texture (each char fits in size * size space in the texture).
+            */
+        readonly charSize: number;
+        /**
+            * Create a new instance of the Digital Rain FontTexture class
+            * @param name the name of the texture
+            * @param font the font to use, use the W3C CSS notation
+            * @param text the caracter set to use in the rendering.
+            * @param scene the scene that owns the texture
+            */
+        constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
+        /**
+            * Clones the current DigitalRainFontTexture.
+            * @return the clone of the texture.
+            */
+        clone(): DigitalRainFontTexture;
+        /**
+            * Parses a json object representing the texture and returns an instance of it.
+            * @param source the source JSON representation
+            * @param scene the scene to create the texture for
+            * @return the parsed texture
+            */
+        static Parse(source: any, scene: Scene): DigitalRainFontTexture;
+}
+/**
+    * Option available in the Digital Rain Post Process.
+    */
+export interface IDigitalRainPostProcessOptions {
+        /**
+            * The font to use following the w3c font definition.
+            */
+        font?: string;
+        /**
+            * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
+            * This number is defined between 0 and 1;
+            */
+        mixToTile?: number;
+        /**
+            * This defines the amount you want to mix the normal rendering pass in the digital rain.
+            * This number is defined between 0 and 1;
+            */
+        mixToNormal?: number;
+}
+/**
+    * DigitalRainPostProcess helps rendering everithing in digital rain.
+    *
+    * Simmply add it to your scene and let the nerd that lives in you have fun.
+    * Example usage: var pp = new DigitalRainPostProcess("digitalRain", "20px Monospace", camera);
+    */
+export declare class DigitalRainPostProcess extends PostProcess {
+        /**
+            * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
+            * This number is defined between 0 and 1;
+            */
+        mixToTile: number;
+        /**
+            * This defines the amount you want to mix the normal rendering pass in the digital rain.
+            * This number is defined between 0 and 1;
+            */
+        mixToNormal: number;
+        /**
+            * Instantiates a new Digital Rain Post Process.
+            * @param name the name to give to the postprocess
+            * @camera the camera to apply the post process to.
+            * @param options can either be the font name or an option object following the IDigitalRainPostProcessOptions format
+            */
+        constructor(name: string, camera: Camera, options?: string | IDigitalRainPostProcessOptions);
+}
+

+ 0 - 102
dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.d.ts

@@ -1,102 +0,0 @@
-
-declare module BABYLON {
-    /**
-     * AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
-     *
-     * It basically takes care rendering the font front the given font size to a texture.
-     * This is used later on in the postprocess.
-     */
-    class AsciiArtFontTexture extends BaseTexture {
-        private _font;
-        private _text;
-        private _charSize;
-        /**
-         * Gets the size of one char in the texture (each char fits in size * size space in the texture).
-         */
-        readonly charSize: number;
-        /**
-         * Create a new instance of the Ascii Art FontTexture class
-         * @param name the name of the texture
-         * @param font the font to use, use the W3C CSS notation
-         * @param text the caracter set to use in the rendering.
-         * @param scene the scene that owns the texture
-         */
-        constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
-        /**
-         * Gets the max char width of a font.
-         * @param font the font to use, use the W3C CSS notation
-         * @return the max char width
-         */
-        private getFontWidth;
-        /**
-         * Gets the max char height of a font.
-         * @param font the font to use, use the W3C CSS notation
-         * @return the max char height
-         */
-        private getFontHeight;
-        /**
-         * Clones the current AsciiArtTexture.
-         * @return the clone of the texture.
-         */
-        clone(): AsciiArtFontTexture;
-        /**
-         * Parses a json object representing the texture and returns an instance of it.
-         * @param source the source JSON representation
-         * @param scene the scene to create the texture for
-         * @return the parsed texture
-         */
-        static Parse(source: any, scene: Scene): AsciiArtFontTexture;
-    }
-    /**
-     * Option available in the Ascii Art Post Process.
-     */
-    interface IAsciiArtPostProcessOptions {
-        /**
-         * The font to use following the w3c font definition.
-         */
-        font?: string;
-        /**
-         * The character set to use in the postprocess.
-         */
-        characterSet?: string;
-        /**
-         * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
-         * This number is defined between 0 and 1;
-         */
-        mixToTile?: number;
-        /**
-         * This defines the amount you want to mix the normal rendering pass in the ascii art.
-         * This number is defined between 0 and 1;
-         */
-        mixToNormal?: number;
-    }
-    /**
-     * AsciiArtPostProcess helps rendering everithing in Ascii Art.
-     *
-     * Simmply add it to your scene and let the nerd that lives in you have fun.
-     * Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
-     */
-    class AsciiArtPostProcess extends PostProcess {
-        /**
-         * The font texture used to render the char in the post process.
-         */
-        private _asciiArtFontTexture;
-        /**
-         * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
-         * This number is defined between 0 and 1;
-         */
-        mixToTile: number;
-        /**
-         * This defines the amount you want to mix the normal rendering pass in the ascii art.
-         * This number is defined between 0 and 1;
-         */
-        mixToNormal: number;
-        /**
-         * Instantiates a new Ascii Art Post Process.
-         * @param name the name to give to the postprocess
-         * @camera the camera to apply the post process to.
-         * @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
-         */
-        constructor(name: string, camera: Camera, options?: string | IAsciiArtPostProcessOptions);
-    }
-}

File diff ditekan karena terlalu besar
+ 0 - 225
dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.js


File diff ditekan karena terlalu besar
+ 0 - 1
dist/preview release/postProcessesLibrary/babylon.asciiArtPostProcess.min.js


+ 0 - 98
dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.d.ts

@@ -1,98 +0,0 @@
-
-declare module BABYLON {
-    /**
-     * DigitalRainFontTexture is the helper class used to easily create your digital rain font texture.
-     *
-     * It basically takes care rendering the font front the given font size to a texture.
-     * This is used later on in the postprocess.
-     */
-    class DigitalRainFontTexture extends BaseTexture {
-        private _font;
-        private _text;
-        private _charSize;
-        /**
-         * Gets the size of one char in the texture (each char fits in size * size space in the texture).
-         */
-        readonly charSize: number;
-        /**
-         * Create a new instance of the Digital Rain FontTexture class
-         * @param name the name of the texture
-         * @param font the font to use, use the W3C CSS notation
-         * @param text the caracter set to use in the rendering.
-         * @param scene the scene that owns the texture
-         */
-        constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
-        /**
-         * Gets the max char width of a font.
-         * @param font the font to use, use the W3C CSS notation
-         * @return the max char width
-         */
-        private getFontWidth;
-        /**
-         * Gets the max char height of a font.
-         * @param font the font to use, use the W3C CSS notation
-         * @return the max char height
-         */
-        private getFontHeight;
-        /**
-         * Clones the current DigitalRainFontTexture.
-         * @return the clone of the texture.
-         */
-        clone(): DigitalRainFontTexture;
-        /**
-         * Parses a json object representing the texture and returns an instance of it.
-         * @param source the source JSON representation
-         * @param scene the scene to create the texture for
-         * @return the parsed texture
-         */
-        static Parse(source: any, scene: Scene): DigitalRainFontTexture;
-    }
-    /**
-     * Option available in the Digital Rain Post Process.
-     */
-    interface IDigitalRainPostProcessOptions {
-        /**
-         * The font to use following the w3c font definition.
-         */
-        font?: string;
-        /**
-         * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
-         * This number is defined between 0 and 1;
-         */
-        mixToTile?: number;
-        /**
-         * This defines the amount you want to mix the normal rendering pass in the digital rain.
-         * This number is defined between 0 and 1;
-         */
-        mixToNormal?: number;
-    }
-    /**
-     * DigitalRainPostProcess helps rendering everithing in digital rain.
-     *
-     * Simmply add it to your scene and let the nerd that lives in you have fun.
-     * Example usage: var pp = new DigitalRainPostProcess("digitalRain", "20px Monospace", camera);
-     */
-    class DigitalRainPostProcess extends PostProcess {
-        /**
-         * The font texture used to render the char in the post process.
-         */
-        private _digitalRainFontTexture;
-        /**
-         * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
-         * This number is defined between 0 and 1;
-         */
-        mixToTile: number;
-        /**
-         * This defines the amount you want to mix the normal rendering pass in the digital rain.
-         * This number is defined between 0 and 1;
-         */
-        mixToNormal: number;
-        /**
-         * Instantiates a new Digital Rain Post Process.
-         * @param name the name to give to the postprocess
-         * @camera the camera to apply the post process to.
-         * @param options can either be the font name or an option object following the IDigitalRainPostProcessOptions format
-         */
-        constructor(name: string, camera: Camera, options?: string | IDigitalRainPostProcessOptions);
-    }
-}

File diff ditekan karena terlalu besar
+ 0 - 234
dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.js


File diff ditekan karena terlalu besar
+ 0 - 1
dist/preview release/postProcessesLibrary/babylon.digitalRainPostProcess.min.js


+ 169 - 0
dist/preview release/postProcessesLibrary/babylon.postProcesses.d.ts

@@ -0,0 +1,169 @@
+/*BabylonJS Postprocess library*/
+// Dependencies for this module:
+//   ../../../../tools/gulp/babylonjs
+declare module BABYLON {
+}
+declare module BABYLON {
+}
+declare module BABYLON {
+}
+declare module BABYLON {
+    /**
+        * AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
+        *
+        * It basically takes care rendering the font front the given font size to a texture.
+        * This is used later on in the postprocess.
+        */
+    export class AsciiArtFontTexture extends BABYLON.BaseTexture {
+            /**
+                * Gets the size of one char in the texture (each char fits in size * size space in the texture).
+                */
+            readonly charSize: number;
+            /**
+                * Create a new instance of the Ascii Art FontTexture class
+                * @param name the name of the texture
+                * @param font the font to use, use the W3C CSS notation
+                * @param text the caracter set to use in the rendering.
+                * @param scene the scene that owns the texture
+                */
+            constructor(name: string, font: string, text: string, scene?: BABYLON.Nullable<BABYLON.Scene>);
+            /**
+                * Clones the current AsciiArtTexture.
+                * @return the clone of the texture.
+                */
+            clone(): AsciiArtFontTexture;
+            /**
+                * Parses a json object representing the texture and returns an instance of it.
+                * @param source the source JSON representation
+                * @param scene the scene to create the texture for
+                * @return the parsed texture
+                */
+            static Parse(source: any, scene: BABYLON.Scene): AsciiArtFontTexture;
+    }
+    /**
+        * Option available in the Ascii Art Post Process.
+        */
+    export interface IAsciiArtPostProcessOptions {
+            /**
+                * The font to use following the w3c font definition.
+                */
+            font?: string;
+            /**
+                * The character set to use in the postprocess.
+                */
+            characterSet?: string;
+            /**
+                * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
+                * This number is defined between 0 and 1;
+                */
+            mixToTile?: number;
+            /**
+                * This defines the amount you want to mix the normal rendering pass in the ascii art.
+                * This number is defined between 0 and 1;
+                */
+            mixToNormal?: number;
+    }
+    /**
+        * AsciiArtPostProcess helps rendering everithing in Ascii Art.
+        *
+        * Simmply add it to your scene and let the nerd that lives in you have fun.
+        * Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
+        */
+    export class AsciiArtPostProcess extends BABYLON.PostProcess {
+            /**
+                * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
+                * This number is defined between 0 and 1;
+                */
+            mixToTile: number;
+            /**
+                * This defines the amount you want to mix the normal rendering pass in the ascii art.
+                * This number is defined between 0 and 1;
+                */
+            mixToNormal: number;
+            /**
+                * Instantiates a new Ascii Art Post Process.
+                * @param name the name to give to the postprocess
+                * @camera the camera to apply the post process to.
+                * @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
+                */
+            constructor(name: string, camera: BABYLON.Camera, options?: string | IAsciiArtPostProcessOptions);
+    }
+}
+declare module BABYLON {
+    /**
+        * DigitalRainFontTexture is the helper class used to easily create your digital rain font texture.
+        *
+        * It basically takes care rendering the font front the given font size to a texture.
+        * This is used later on in the postprocess.
+        */
+    export class DigitalRainFontTexture extends BABYLON.BaseTexture {
+            /**
+                * Gets the size of one char in the texture (each char fits in size * size space in the texture).
+                */
+            readonly charSize: number;
+            /**
+                * Create a new instance of the Digital Rain FontTexture class
+                * @param name the name of the texture
+                * @param font the font to use, use the W3C CSS notation
+                * @param text the caracter set to use in the rendering.
+                * @param scene the scene that owns the texture
+                */
+            constructor(name: string, font: string, text: string, scene?: BABYLON.Nullable<BABYLON.Scene>);
+            /**
+                * Clones the current DigitalRainFontTexture.
+                * @return the clone of the texture.
+                */
+            clone(): DigitalRainFontTexture;
+            /**
+                * Parses a json object representing the texture and returns an instance of it.
+                * @param source the source JSON representation
+                * @param scene the scene to create the texture for
+                * @return the parsed texture
+                */
+            static Parse(source: any, scene: BABYLON.Scene): DigitalRainFontTexture;
+    }
+    /**
+        * Option available in the Digital Rain Post Process.
+        */
+    export interface IDigitalRainPostProcessOptions {
+            /**
+                * The font to use following the w3c font definition.
+                */
+            font?: string;
+            /**
+                * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
+                * This number is defined between 0 and 1;
+                */
+            mixToTile?: number;
+            /**
+                * This defines the amount you want to mix the normal rendering pass in the digital rain.
+                * This number is defined between 0 and 1;
+                */
+            mixToNormal?: number;
+    }
+    /**
+        * DigitalRainPostProcess helps rendering everithing in digital rain.
+        *
+        * Simmply add it to your scene and let the nerd that lives in you have fun.
+        * Example usage: var pp = new DigitalRainPostProcess("digitalRain", "20px Monospace", camera);
+        */
+    export class DigitalRainPostProcess extends BABYLON.PostProcess {
+            /**
+                * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
+                * This number is defined between 0 and 1;
+                */
+            mixToTile: number;
+            /**
+                * This defines the amount you want to mix the normal rendering pass in the digital rain.
+                * This number is defined between 0 and 1;
+                */
+            mixToNormal: number;
+            /**
+                * Instantiates a new Digital Rain Post Process.
+                * @param name the name to give to the postprocess
+                * @camera the camera to apply the post process to.
+                * @param options can either be the font name or an option object following the IDigitalRainPostProcessOptions format
+                */
+            constructor(name: string, camera: BABYLON.Camera, options?: string | IDigitalRainPostProcessOptions);
+    }
+}

File diff ditekan karena terlalu besar
+ 2 - 0
dist/preview release/postProcessesLibrary/babylon.postProcesses.js


File diff ditekan karena terlalu besar
+ 2 - 0
dist/preview release/postProcessesLibrary/babylon.postProcesses.min.js


File diff ditekan karena terlalu besar
+ 1 - 0
dist/preview release/postProcessesLibrary/babylon.postProcesses.min.js.map


+ 351 - 0
dist/preview release/postProcessesLibrary/babylon.postProcesses.module.d.ts

@@ -0,0 +1,351 @@
+/*BabylonJS Postprocess library*/
+// Dependencies for this module:
+//   ../../../../tools/gulp/babylonjs
+
+declare module 'babylonjs-postProcessLibrary' {
+    export * from "babylonjs-postProcessLibrary/asciiArt";
+    export * from "babylonjs-postProcessLibrary/digitalRain";
+}
+
+declare module 'babylonjs-postProcessLibrary/asciiArt' {
+    export * from "babylonjs-postProcessLibrary/asciiArt/asciiArtPostProcess";
+}
+
+declare module 'babylonjs-postProcessLibrary/digitalRain' {
+    export * from "babylonjs-postProcessLibrary/digitalRain/digitalRainPostProcess";
+}
+
+declare module 'babylonjs-postProcessLibrary/asciiArt/asciiArtPostProcess' {
+    import { BaseTexture, Nullable, Scene, PostProcess, Camera } from "babylonjs";
+    /**
+        * AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
+        *
+        * It basically takes care rendering the font front the given font size to a texture.
+        * This is used later on in the postprocess.
+        */
+    export class AsciiArtFontTexture extends BaseTexture {
+            /**
+                * Gets the size of one char in the texture (each char fits in size * size space in the texture).
+                */
+            readonly charSize: number;
+            /**
+                * Create a new instance of the Ascii Art FontTexture class
+                * @param name the name of the texture
+                * @param font the font to use, use the W3C CSS notation
+                * @param text the caracter set to use in the rendering.
+                * @param scene the scene that owns the texture
+                */
+            constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
+            /**
+                * Clones the current AsciiArtTexture.
+                * @return the clone of the texture.
+                */
+            clone(): AsciiArtFontTexture;
+            /**
+                * Parses a json object representing the texture and returns an instance of it.
+                * @param source the source JSON representation
+                * @param scene the scene to create the texture for
+                * @return the parsed texture
+                */
+            static Parse(source: any, scene: Scene): AsciiArtFontTexture;
+    }
+    /**
+        * Option available in the Ascii Art Post Process.
+        */
+    export interface IAsciiArtPostProcessOptions {
+            /**
+                * The font to use following the w3c font definition.
+                */
+            font?: string;
+            /**
+                * The character set to use in the postprocess.
+                */
+            characterSet?: string;
+            /**
+                * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
+                * This number is defined between 0 and 1;
+                */
+            mixToTile?: number;
+            /**
+                * This defines the amount you want to mix the normal rendering pass in the ascii art.
+                * This number is defined between 0 and 1;
+                */
+            mixToNormal?: number;
+    }
+    /**
+        * AsciiArtPostProcess helps rendering everithing in Ascii Art.
+        *
+        * Simmply add it to your scene and let the nerd that lives in you have fun.
+        * Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
+        */
+    export class AsciiArtPostProcess extends PostProcess {
+            /**
+                * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
+                * This number is defined between 0 and 1;
+                */
+            mixToTile: number;
+            /**
+                * This defines the amount you want to mix the normal rendering pass in the ascii art.
+                * This number is defined between 0 and 1;
+                */
+            mixToNormal: number;
+            /**
+                * Instantiates a new Ascii Art Post Process.
+                * @param name the name to give to the postprocess
+                * @camera the camera to apply the post process to.
+                * @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
+                */
+            constructor(name: string, camera: Camera, options?: string | IAsciiArtPostProcessOptions);
+    }
+}
+
+declare module 'babylonjs-postProcessLibrary/digitalRain/digitalRainPostProcess' {
+    import { BaseTexture, Nullable, Scene, PostProcess, Camera } from "babylonjs";
+    /**
+        * DigitalRainFontTexture is the helper class used to easily create your digital rain font texture.
+        *
+        * It basically takes care rendering the font front the given font size to a texture.
+        * This is used later on in the postprocess.
+        */
+    export class DigitalRainFontTexture extends BaseTexture {
+            /**
+                * Gets the size of one char in the texture (each char fits in size * size space in the texture).
+                */
+            readonly charSize: number;
+            /**
+                * Create a new instance of the Digital Rain FontTexture class
+                * @param name the name of the texture
+                * @param font the font to use, use the W3C CSS notation
+                * @param text the caracter set to use in the rendering.
+                * @param scene the scene that owns the texture
+                */
+            constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
+            /**
+                * Clones the current DigitalRainFontTexture.
+                * @return the clone of the texture.
+                */
+            clone(): DigitalRainFontTexture;
+            /**
+                * Parses a json object representing the texture and returns an instance of it.
+                * @param source the source JSON representation
+                * @param scene the scene to create the texture for
+                * @return the parsed texture
+                */
+            static Parse(source: any, scene: Scene): DigitalRainFontTexture;
+    }
+    /**
+        * Option available in the Digital Rain Post Process.
+        */
+    export interface IDigitalRainPostProcessOptions {
+            /**
+                * The font to use following the w3c font definition.
+                */
+            font?: string;
+            /**
+                * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
+                * This number is defined between 0 and 1;
+                */
+            mixToTile?: number;
+            /**
+                * This defines the amount you want to mix the normal rendering pass in the digital rain.
+                * This number is defined between 0 and 1;
+                */
+            mixToNormal?: number;
+    }
+    /**
+        * DigitalRainPostProcess helps rendering everithing in digital rain.
+        *
+        * Simmply add it to your scene and let the nerd that lives in you have fun.
+        * Example usage: var pp = new DigitalRainPostProcess("digitalRain", "20px Monospace", camera);
+        */
+    export class DigitalRainPostProcess extends PostProcess {
+            /**
+                * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
+                * This number is defined between 0 and 1;
+                */
+            mixToTile: number;
+            /**
+                * This defines the amount you want to mix the normal rendering pass in the digital rain.
+                * This number is defined between 0 and 1;
+                */
+            mixToNormal: number;
+            /**
+                * Instantiates a new Digital Rain Post Process.
+                * @param name the name to give to the postprocess
+                * @camera the camera to apply the post process to.
+                * @param options can either be the font name or an option object following the IDigitalRainPostProcessOptions format
+                */
+            constructor(name: string, camera: Camera, options?: string | IDigitalRainPostProcessOptions);
+    }
+}
+
+
+/*BabylonJS Postprocess library*/
+// Dependencies for this module:
+//   ../../../../tools/gulp/babylonjs
+declare module BABYLON {
+}
+declare module BABYLON {
+}
+declare module BABYLON {
+}
+declare module BABYLON {
+    /**
+        * AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
+        *
+        * It basically takes care rendering the font front the given font size to a texture.
+        * This is used later on in the postprocess.
+        */
+    export class AsciiArtFontTexture extends BABYLON.BaseTexture {
+            /**
+                * Gets the size of one char in the texture (each char fits in size * size space in the texture).
+                */
+            readonly charSize: number;
+            /**
+                * Create a new instance of the Ascii Art FontTexture class
+                * @param name the name of the texture
+                * @param font the font to use, use the W3C CSS notation
+                * @param text the caracter set to use in the rendering.
+                * @param scene the scene that owns the texture
+                */
+            constructor(name: string, font: string, text: string, scene?: BABYLON.Nullable<BABYLON.Scene>);
+            /**
+                * Clones the current AsciiArtTexture.
+                * @return the clone of the texture.
+                */
+            clone(): AsciiArtFontTexture;
+            /**
+                * Parses a json object representing the texture and returns an instance of it.
+                * @param source the source JSON representation
+                * @param scene the scene to create the texture for
+                * @return the parsed texture
+                */
+            static Parse(source: any, scene: BABYLON.Scene): AsciiArtFontTexture;
+    }
+    /**
+        * Option available in the Ascii Art Post Process.
+        */
+    export interface IAsciiArtPostProcessOptions {
+            /**
+                * The font to use following the w3c font definition.
+                */
+            font?: string;
+            /**
+                * The character set to use in the postprocess.
+                */
+            characterSet?: string;
+            /**
+                * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
+                * This number is defined between 0 and 1;
+                */
+            mixToTile?: number;
+            /**
+                * This defines the amount you want to mix the normal rendering pass in the ascii art.
+                * This number is defined between 0 and 1;
+                */
+            mixToNormal?: number;
+    }
+    /**
+        * AsciiArtPostProcess helps rendering everithing in Ascii Art.
+        *
+        * Simmply add it to your scene and let the nerd that lives in you have fun.
+        * Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
+        */
+    export class AsciiArtPostProcess extends BABYLON.PostProcess {
+            /**
+                * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
+                * This number is defined between 0 and 1;
+                */
+            mixToTile: number;
+            /**
+                * This defines the amount you want to mix the normal rendering pass in the ascii art.
+                * This number is defined between 0 and 1;
+                */
+            mixToNormal: number;
+            /**
+                * Instantiates a new Ascii Art Post Process.
+                * @param name the name to give to the postprocess
+                * @camera the camera to apply the post process to.
+                * @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
+                */
+            constructor(name: string, camera: BABYLON.Camera, options?: string | IAsciiArtPostProcessOptions);
+    }
+}
+declare module BABYLON {
+    /**
+        * DigitalRainFontTexture is the helper class used to easily create your digital rain font texture.
+        *
+        * It basically takes care rendering the font front the given font size to a texture.
+        * This is used later on in the postprocess.
+        */
+    export class DigitalRainFontTexture extends BABYLON.BaseTexture {
+            /**
+                * Gets the size of one char in the texture (each char fits in size * size space in the texture).
+                */
+            readonly charSize: number;
+            /**
+                * Create a new instance of the Digital Rain FontTexture class
+                * @param name the name of the texture
+                * @param font the font to use, use the W3C CSS notation
+                * @param text the caracter set to use in the rendering.
+                * @param scene the scene that owns the texture
+                */
+            constructor(name: string, font: string, text: string, scene?: BABYLON.Nullable<BABYLON.Scene>);
+            /**
+                * Clones the current DigitalRainFontTexture.
+                * @return the clone of the texture.
+                */
+            clone(): DigitalRainFontTexture;
+            /**
+                * Parses a json object representing the texture and returns an instance of it.
+                * @param source the source JSON representation
+                * @param scene the scene to create the texture for
+                * @return the parsed texture
+                */
+            static Parse(source: any, scene: BABYLON.Scene): DigitalRainFontTexture;
+    }
+    /**
+        * Option available in the Digital Rain Post Process.
+        */
+    export interface IDigitalRainPostProcessOptions {
+            /**
+                * The font to use following the w3c font definition.
+                */
+            font?: string;
+            /**
+                * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
+                * This number is defined between 0 and 1;
+                */
+            mixToTile?: number;
+            /**
+                * This defines the amount you want to mix the normal rendering pass in the digital rain.
+                * This number is defined between 0 and 1;
+                */
+            mixToNormal?: number;
+    }
+    /**
+        * DigitalRainPostProcess helps rendering everithing in digital rain.
+        *
+        * Simmply add it to your scene and let the nerd that lives in you have fun.
+        * Example usage: var pp = new DigitalRainPostProcess("digitalRain", "20px Monospace", camera);
+        */
+    export class DigitalRainPostProcess extends BABYLON.PostProcess {
+            /**
+                * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
+                * This number is defined between 0 and 1;
+                */
+            mixToTile: number;
+            /**
+                * This defines the amount you want to mix the normal rendering pass in the digital rain.
+                * This number is defined between 0 and 1;
+                */
+            mixToNormal: number;
+            /**
+                * Instantiates a new Digital Rain Post Process.
+                * @param name the name to give to the postprocess
+                * @camera the camera to apply the post process to.
+                * @param options can either be the font name or an option object following the IDigitalRainPostProcessOptions format
+                */
+            constructor(name: string, camera: BABYLON.Camera, options?: string | IDigitalRainPostProcessOptions);
+    }
+}

+ 0 - 201
dist/preview release/postProcessesLibrary/babylonjs.postProcess.d.ts

@@ -1,201 +0,0 @@
-
-declare module BABYLON {
-    /**
-     * AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
-     *
-     * It basically takes care rendering the font front the given font size to a texture.
-     * This is used later on in the postprocess.
-     */
-    class AsciiArtFontTexture extends BaseTexture {
-        private _font;
-        private _text;
-        private _charSize;
-        /**
-         * Gets the size of one char in the texture (each char fits in size * size space in the texture).
-         */
-        readonly charSize: number;
-        /**
-         * Create a new instance of the Ascii Art FontTexture class
-         * @param name the name of the texture
-         * @param font the font to use, use the W3C CSS notation
-         * @param text the caracter set to use in the rendering.
-         * @param scene the scene that owns the texture
-         */
-        constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
-        /**
-         * Gets the max char width of a font.
-         * @param font the font to use, use the W3C CSS notation
-         * @return the max char width
-         */
-        private getFontWidth;
-        /**
-         * Gets the max char height of a font.
-         * @param font the font to use, use the W3C CSS notation
-         * @return the max char height
-         */
-        private getFontHeight;
-        /**
-         * Clones the current AsciiArtTexture.
-         * @return the clone of the texture.
-         */
-        clone(): AsciiArtFontTexture;
-        /**
-         * Parses a json object representing the texture and returns an instance of it.
-         * @param source the source JSON representation
-         * @param scene the scene to create the texture for
-         * @return the parsed texture
-         */
-        static Parse(source: any, scene: Scene): AsciiArtFontTexture;
-    }
-    /**
-     * Option available in the Ascii Art Post Process.
-     */
-    interface IAsciiArtPostProcessOptions {
-        /**
-         * The font to use following the w3c font definition.
-         */
-        font?: string;
-        /**
-         * The character set to use in the postprocess.
-         */
-        characterSet?: string;
-        /**
-         * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
-         * This number is defined between 0 and 1;
-         */
-        mixToTile?: number;
-        /**
-         * This defines the amount you want to mix the normal rendering pass in the ascii art.
-         * This number is defined between 0 and 1;
-         */
-        mixToNormal?: number;
-    }
-    /**
-     * AsciiArtPostProcess helps rendering everithing in Ascii Art.
-     *
-     * Simmply add it to your scene and let the nerd that lives in you have fun.
-     * Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
-     */
-    class AsciiArtPostProcess extends PostProcess {
-        /**
-         * The font texture used to render the char in the post process.
-         */
-        private _asciiArtFontTexture;
-        /**
-         * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
-         * This number is defined between 0 and 1;
-         */
-        mixToTile: number;
-        /**
-         * This defines the amount you want to mix the normal rendering pass in the ascii art.
-         * This number is defined between 0 and 1;
-         */
-        mixToNormal: number;
-        /**
-         * Instantiates a new Ascii Art Post Process.
-         * @param name the name to give to the postprocess
-         * @camera the camera to apply the post process to.
-         * @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
-         */
-        constructor(name: string, camera: Camera, options?: string | IAsciiArtPostProcessOptions);
-    }
-}
-
-
-declare module BABYLON {
-    /**
-     * DigitalRainFontTexture is the helper class used to easily create your digital rain font texture.
-     *
-     * It basically takes care rendering the font front the given font size to a texture.
-     * This is used later on in the postprocess.
-     */
-    class DigitalRainFontTexture extends BaseTexture {
-        private _font;
-        private _text;
-        private _charSize;
-        /**
-         * Gets the size of one char in the texture (each char fits in size * size space in the texture).
-         */
-        readonly charSize: number;
-        /**
-         * Create a new instance of the Digital Rain FontTexture class
-         * @param name the name of the texture
-         * @param font the font to use, use the W3C CSS notation
-         * @param text the caracter set to use in the rendering.
-         * @param scene the scene that owns the texture
-         */
-        constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
-        /**
-         * Gets the max char width of a font.
-         * @param font the font to use, use the W3C CSS notation
-         * @return the max char width
-         */
-        private getFontWidth;
-        /**
-         * Gets the max char height of a font.
-         * @param font the font to use, use the W3C CSS notation
-         * @return the max char height
-         */
-        private getFontHeight;
-        /**
-         * Clones the current DigitalRainFontTexture.
-         * @return the clone of the texture.
-         */
-        clone(): DigitalRainFontTexture;
-        /**
-         * Parses a json object representing the texture and returns an instance of it.
-         * @param source the source JSON representation
-         * @param scene the scene to create the texture for
-         * @return the parsed texture
-         */
-        static Parse(source: any, scene: Scene): DigitalRainFontTexture;
-    }
-    /**
-     * Option available in the Digital Rain Post Process.
-     */
-    interface IDigitalRainPostProcessOptions {
-        /**
-         * The font to use following the w3c font definition.
-         */
-        font?: string;
-        /**
-         * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
-         * This number is defined between 0 and 1;
-         */
-        mixToTile?: number;
-        /**
-         * This defines the amount you want to mix the normal rendering pass in the digital rain.
-         * This number is defined between 0 and 1;
-         */
-        mixToNormal?: number;
-    }
-    /**
-     * DigitalRainPostProcess helps rendering everithing in digital rain.
-     *
-     * Simmply add it to your scene and let the nerd that lives in you have fun.
-     * Example usage: var pp = new DigitalRainPostProcess("digitalRain", "20px Monospace", camera);
-     */
-    class DigitalRainPostProcess extends PostProcess {
-        /**
-         * The font texture used to render the char in the post process.
-         */
-        private _digitalRainFontTexture;
-        /**
-         * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
-         * This number is defined between 0 and 1;
-         */
-        mixToTile: number;
-        /**
-         * This defines the amount you want to mix the normal rendering pass in the digital rain.
-         * This number is defined between 0 and 1;
-         */
-        mixToNormal: number;
-        /**
-         * Instantiates a new Digital Rain Post Process.
-         * @param name the name to give to the postprocess
-         * @camera the camera to apply the post process to.
-         * @param options can either be the font name or an option object following the IDigitalRainPostProcessOptions format
-         */
-        constructor(name: string, camera: Camera, options?: string | IDigitalRainPostProcessOptions);
-    }
-}

File diff ditekan karena terlalu besar
+ 0 - 456
dist/preview release/postProcessesLibrary/babylonjs.postProcess.js


File diff ditekan karena terlalu besar
+ 0 - 1
dist/preview release/postProcessesLibrary/babylonjs.postProcess.min.js


+ 0 - 206
dist/preview release/postProcessesLibrary/babylonjs.postProcess.module.d.ts

@@ -1,206 +0,0 @@
-
-
-declare module 'babylonjs-post-process' { 
-    export = BABYLON; 
-}
-
-declare module BABYLON {
-    /**
-     * AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
-     *
-     * It basically takes care rendering the font front the given font size to a texture.
-     * This is used later on in the postprocess.
-     */
-    class AsciiArtFontTexture extends BaseTexture {
-        private _font;
-        private _text;
-        private _charSize;
-        /**
-         * Gets the size of one char in the texture (each char fits in size * size space in the texture).
-         */
-        readonly charSize: number;
-        /**
-         * Create a new instance of the Ascii Art FontTexture class
-         * @param name the name of the texture
-         * @param font the font to use, use the W3C CSS notation
-         * @param text the caracter set to use in the rendering.
-         * @param scene the scene that owns the texture
-         */
-        constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
-        /**
-         * Gets the max char width of a font.
-         * @param font the font to use, use the W3C CSS notation
-         * @return the max char width
-         */
-        private getFontWidth;
-        /**
-         * Gets the max char height of a font.
-         * @param font the font to use, use the W3C CSS notation
-         * @return the max char height
-         */
-        private getFontHeight;
-        /**
-         * Clones the current AsciiArtTexture.
-         * @return the clone of the texture.
-         */
-        clone(): AsciiArtFontTexture;
-        /**
-         * Parses a json object representing the texture and returns an instance of it.
-         * @param source the source JSON representation
-         * @param scene the scene to create the texture for
-         * @return the parsed texture
-         */
-        static Parse(source: any, scene: Scene): AsciiArtFontTexture;
-    }
-    /**
-     * Option available in the Ascii Art Post Process.
-     */
-    interface IAsciiArtPostProcessOptions {
-        /**
-         * The font to use following the w3c font definition.
-         */
-        font?: string;
-        /**
-         * The character set to use in the postprocess.
-         */
-        characterSet?: string;
-        /**
-         * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
-         * This number is defined between 0 and 1;
-         */
-        mixToTile?: number;
-        /**
-         * This defines the amount you want to mix the normal rendering pass in the ascii art.
-         * This number is defined between 0 and 1;
-         */
-        mixToNormal?: number;
-    }
-    /**
-     * AsciiArtPostProcess helps rendering everithing in Ascii Art.
-     *
-     * Simmply add it to your scene and let the nerd that lives in you have fun.
-     * Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
-     */
-    class AsciiArtPostProcess extends PostProcess {
-        /**
-         * The font texture used to render the char in the post process.
-         */
-        private _asciiArtFontTexture;
-        /**
-         * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
-         * This number is defined between 0 and 1;
-         */
-        mixToTile: number;
-        /**
-         * This defines the amount you want to mix the normal rendering pass in the ascii art.
-         * This number is defined between 0 and 1;
-         */
-        mixToNormal: number;
-        /**
-         * Instantiates a new Ascii Art Post Process.
-         * @param name the name to give to the postprocess
-         * @camera the camera to apply the post process to.
-         * @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
-         */
-        constructor(name: string, camera: Camera, options?: string | IAsciiArtPostProcessOptions);
-    }
-}
-
-
-declare module BABYLON {
-    /**
-     * DigitalRainFontTexture is the helper class used to easily create your digital rain font texture.
-     *
-     * It basically takes care rendering the font front the given font size to a texture.
-     * This is used later on in the postprocess.
-     */
-    class DigitalRainFontTexture extends BaseTexture {
-        private _font;
-        private _text;
-        private _charSize;
-        /**
-         * Gets the size of one char in the texture (each char fits in size * size space in the texture).
-         */
-        readonly charSize: number;
-        /**
-         * Create a new instance of the Digital Rain FontTexture class
-         * @param name the name of the texture
-         * @param font the font to use, use the W3C CSS notation
-         * @param text the caracter set to use in the rendering.
-         * @param scene the scene that owns the texture
-         */
-        constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
-        /**
-         * Gets the max char width of a font.
-         * @param font the font to use, use the W3C CSS notation
-         * @return the max char width
-         */
-        private getFontWidth;
-        /**
-         * Gets the max char height of a font.
-         * @param font the font to use, use the W3C CSS notation
-         * @return the max char height
-         */
-        private getFontHeight;
-        /**
-         * Clones the current DigitalRainFontTexture.
-         * @return the clone of the texture.
-         */
-        clone(): DigitalRainFontTexture;
-        /**
-         * Parses a json object representing the texture and returns an instance of it.
-         * @param source the source JSON representation
-         * @param scene the scene to create the texture for
-         * @return the parsed texture
-         */
-        static Parse(source: any, scene: Scene): DigitalRainFontTexture;
-    }
-    /**
-     * Option available in the Digital Rain Post Process.
-     */
-    interface IDigitalRainPostProcessOptions {
-        /**
-         * The font to use following the w3c font definition.
-         */
-        font?: string;
-        /**
-         * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
-         * This number is defined between 0 and 1;
-         */
-        mixToTile?: number;
-        /**
-         * This defines the amount you want to mix the normal rendering pass in the digital rain.
-         * This number is defined between 0 and 1;
-         */
-        mixToNormal?: number;
-    }
-    /**
-     * DigitalRainPostProcess helps rendering everithing in digital rain.
-     *
-     * Simmply add it to your scene and let the nerd that lives in you have fun.
-     * Example usage: var pp = new DigitalRainPostProcess("digitalRain", "20px Monospace", camera);
-     */
-    class DigitalRainPostProcess extends PostProcess {
-        /**
-         * The font texture used to render the char in the post process.
-         */
-        private _digitalRainFontTexture;
-        /**
-         * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
-         * This number is defined between 0 and 1;
-         */
-        mixToTile: number;
-        /**
-         * This defines the amount you want to mix the normal rendering pass in the digital rain.
-         * This number is defined between 0 and 1;
-         */
-        mixToNormal: number;
-        /**
-         * Instantiates a new Digital Rain Post Process.
-         * @param name the name to give to the postprocess
-         * @camera the camera to apply the post process to.
-         * @param options can either be the font name or an option object following the IDigitalRainPostProcessOptions format
-         */
-        constructor(name: string, camera: Camera, options?: string | IDigitalRainPostProcessOptions);
-    }
-}

+ 7 - 7
dist/preview release/postProcessesLibrary/package.json

@@ -2,22 +2,22 @@
     "author": {
         "name": "David CATUHE"
     },
-    "name": "babylonjs-post-process",
-    "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
+    "name": "babylonjs-post-processes",
+    "description": "The Babylon.js post process library is a collection of advanced post process to be used in a Babylon.js scene.",
     "version": "3.3.0-rc.5",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
     },
-    "main": "babylonjs.postProcess.min.js",
+    "main": "babylonjs.postProcesses.min.js",
     "files": [
-        "babylonjs.postProcess.js",
-        "babylonjs.postProcess.min.js",
-        "babylonjs.postProcess.module.d.ts",
+        "babylonjs.postProcesses.js",
+        "babylonjs.postProcesses.min.js",
+        "babylonjs.postProcesses.module.d.ts",
         "readme.md",
         "package.json"
     ],
-    "typings": "babylonjs.postProcess.module.d.ts",
+    "typings": "babylonjs.postProcesses.module.d.ts",
     "keywords": [
         "3D",
         "javascript",

+ 2 - 2
gui/package.json

@@ -1,7 +1,7 @@
 {
     "name": "babylonjs-gui",
     "version": "1.0.0",
-    "description": "The js GUI library is an extension you can use to generate interactive user interface.\r It is build on top of the DynamicTexture.",
+    "description": "The GUI library is an extension you can use to generate interactive user interface.\r It is build on top of the DynamicTexture.",
     "scripts": {
         "start:server": "webpack-dev-server",
         "start:watch": "webpack -w",
@@ -35,4 +35,4 @@
     "dependencies": {
         "dts-bundle-webpack": "^1.0.0"
     }
-}
+}

+ 38 - 0
postProcessLibrary/package.json

@@ -0,0 +1,38 @@
+{
+    "name": "babylonjs-postprocesslibrary",
+    "version": "3.3.0",
+    "description": "The Babylon.js post process library is a collection of advanced post process to be used in a Babylon.js scene.",
+    "scripts": {
+        "start:server": "webpack-dev-server",
+        "start:watch": "webpack -w",
+        "build:dev": "webpack",
+        "build:prod": "webpack --mode=production",
+        "test": "echo \"Error: no test specified\" && exit 1"
+    },
+    "repository": {
+        "type": "git",
+        "url": "git+https://github.com/BabylonJS/Babylon.js.git"
+    },
+    "keywords": [
+        "3d",
+        "webgl",
+        "viewer"
+    ],
+    "license": "Apache2",
+    "bugs": {
+        "url": "https://github.com/BabylonJS/Babylon.js/issues"
+    },
+    "homepage": "https://github.com/BabylonJS/Babylon.js#readme",
+    "devDependencies": {
+        "@types/node": "^10.5.2",
+        "clean-webpack-plugin": "^0.1.19",
+        "ts-loader": "^4.0.0",
+        "typescript": "~3.0.1",
+        "webpack": "^4.16.0",
+        "webpack-cli": "^3.0.8",
+        "webpack-dev-server": "^3.1.4"
+    },
+    "dependencies": {
+        "dts-bundle-webpack": "^1.0.0"
+    }
+}

+ 271 - 0
postProcessLibrary/src/asciiArt/asciiArtPostProcess.ts

@@ -0,0 +1,271 @@
+import { BaseTexture, serialize, Nullable, Scene, Texture, SerializationHelper, PostProcess, Camera, Effect } from "babylonjs";
+
+Effect.ShadersStore["asciiartPixelShader"] = require("./asciiart.fragment.fx");
+
+/**
+ * AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
+ *
+ * It basically takes care rendering the font front the given font size to a texture.
+ * This is used later on in the postprocess.
+ */
+export class AsciiArtFontTexture extends BaseTexture {
+
+    @serialize("font")
+    private _font: string;
+
+    @serialize("text")
+    private _text: string;
+
+    private _charSize: number;
+
+    /**
+     * Gets the size of one char in the texture (each char fits in size * size space in the texture).
+     */
+    public get charSize(): number {
+        return this._charSize;
+    }
+
+    /**
+     * Create a new instance of the Ascii Art FontTexture class
+     * @param name the name of the texture
+     * @param font the font to use, use the W3C CSS notation
+     * @param text the caracter set to use in the rendering.
+     * @param scene the scene that owns the texture
+     */
+    constructor(name: string, font: string, text: string, scene: Nullable<Scene> = null) {
+        super(scene);
+
+        scene = this.getScene();
+
+        if (!scene) {
+            return;
+        }
+
+        this.name = name;
+        this._text == text;
+        this._font == font;
+
+        this.wrapU = Texture.CLAMP_ADDRESSMODE;
+        this.wrapV = Texture.CLAMP_ADDRESSMODE;
+        //this.anisotropicFilteringLevel = 1;
+
+        // Get the font specific info.
+        var maxCharHeight = this.getFontHeight(font);
+        var maxCharWidth = this.getFontWidth(font);
+
+        this._charSize = Math.max(maxCharHeight.height, maxCharWidth);
+
+        // This is an approximate size, but should always be able to fit at least the maxCharCount.
+        var textureWidth = Math.ceil(this._charSize * text.length);
+        var textureHeight = this._charSize;
+
+        // Create the texture that will store the font characters.
+        this._texture = scene.getEngine().createDynamicTexture(textureWidth, textureHeight, false, Texture.NEAREST_SAMPLINGMODE);
+        //scene.getEngine().setclamp
+        var textureSize = this.getSize();
+
+        // Create a canvas with the final size: the one matching the texture.
+        var canvas = document.createElement("canvas");
+        canvas.width = textureSize.width;
+        canvas.height = textureSize.height;
+        var context = <CanvasRenderingContext2D>canvas.getContext("2d");
+        context.textBaseline = "top";
+        context.font = font;
+        context.fillStyle = "white";
+        context.imageSmoothingEnabled = false;
+
+        // Sets the text in the texture.
+        for (var i = 0; i < text.length; i++) {
+            context.fillText(text[i], i * this._charSize, -maxCharHeight.offset);
+        }
+
+        // Flush the text in the dynamic texture.
+
+        scene.getEngine().updateDynamicTexture(this._texture, canvas, false, true);
+    }
+
+    /**
+     * Gets the max char width of a font.
+     * @param font the font to use, use the W3C CSS notation
+     * @return the max char width
+     */
+    private getFontWidth(font: string): number {
+        var fontDraw = document.createElement("canvas");
+        var ctx = <CanvasRenderingContext2D>fontDraw.getContext('2d');
+        ctx.fillStyle = 'white';
+        ctx.font = font;
+
+        return ctx.measureText("W").width;
+    }
+
+    // More info here: https://videlais.com/2014/03/16/the-many-and-varied-problems-with-measuring-font-height-for-html5-canvas/
+    /**
+     * Gets the max char height of a font.
+     * @param font the font to use, use the W3C CSS notation
+     * @return the max char height
+     */
+    private getFontHeight(font: string): { height: number, offset: number } {
+        var fontDraw = document.createElement("canvas");
+        var ctx = <CanvasRenderingContext2D>fontDraw.getContext('2d');
+        ctx.fillRect(0, 0, fontDraw.width, fontDraw.height);
+        ctx.textBaseline = 'top';
+        ctx.fillStyle = 'white';
+        ctx.font = font;
+        ctx.fillText('jH|', 0, 0);
+        var pixels = ctx.getImageData(0, 0, fontDraw.width, fontDraw.height).data;
+        var start = -1;
+        var end = -1;
+        for (var row = 0; row < fontDraw.height; row++) {
+            for (var column = 0; column < fontDraw.width; column++) {
+                var index = (row * fontDraw.width + column) * 4;
+                if (pixels[index] === 0) {
+                    if (column === fontDraw.width - 1 && start !== -1) {
+                        end = row;
+                        row = fontDraw.height;
+                        break;
+                    }
+                    continue;
+                }
+                else {
+                    if (start === -1) {
+                        start = row;
+                    }
+                    break;
+                }
+            }
+        }
+        return { height: (end - start) + 1, offset: start - 1 };
+    }
+
+    /**
+     * Clones the current AsciiArtTexture.
+     * @return the clone of the texture.
+     */
+    public clone(): AsciiArtFontTexture {
+        return new AsciiArtFontTexture(this.name, this._font, this._text, this.getScene());
+    }
+
+    /**
+     * Parses a json object representing the texture and returns an instance of it.
+     * @param source the source JSON representation
+     * @param scene the scene to create the texture for
+     * @return the parsed texture
+     */
+    public static Parse(source: any, scene: Scene): AsciiArtFontTexture {
+        var texture = SerializationHelper.Parse(() => new AsciiArtFontTexture(source.name, source.font, source.text, scene),
+            source, scene, null);
+
+        return texture;
+    }
+}
+
+/**
+ * Option available in the Ascii Art Post Process.
+ */
+export interface IAsciiArtPostProcessOptions {
+
+    /**
+     * The font to use following the w3c font definition.
+     */
+    font?: string;
+
+    /**
+     * The character set to use in the postprocess.
+     */
+    characterSet?: string;
+
+    /**
+     * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
+     * This number is defined between 0 and 1;
+     */
+    mixToTile?: number;
+
+    /**
+     * This defines the amount you want to mix the normal rendering pass in the ascii art.
+     * This number is defined between 0 and 1;
+     */
+    mixToNormal?: number;
+}
+
+/**
+ * AsciiArtPostProcess helps rendering everithing in Ascii Art.
+ *
+ * Simmply add it to your scene and let the nerd that lives in you have fun.
+ * Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
+ */
+export class AsciiArtPostProcess extends PostProcess {
+
+    /**
+     * The font texture used to render the char in the post process.
+     */
+    private _asciiArtFontTexture: AsciiArtFontTexture;
+
+    /**
+     * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
+     * This number is defined between 0 and 1;
+     */
+    public mixToTile: number = 0;
+
+    /**
+     * This defines the amount you want to mix the normal rendering pass in the ascii art.
+     * This number is defined between 0 and 1;
+     */
+    public mixToNormal: number = 0;
+
+    /**
+     * Instantiates a new Ascii Art Post Process.
+     * @param name the name to give to the postprocess
+     * @camera the camera to apply the post process to.
+     * @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
+     */
+    constructor(name: string, camera: Camera, options?: string | IAsciiArtPostProcessOptions) {
+        super(name,
+            'asciiart',
+            ['asciiArtFontInfos', 'asciiArtOptions'],
+            ['asciiArtFont'],
+            {
+                width: camera.getEngine().getRenderWidth(),
+                height: camera.getEngine().getRenderHeight()
+            },
+            camera,
+            Texture.TRILINEAR_SAMPLINGMODE,
+            camera.getEngine(),
+            true);
+
+        // Default values.
+        var font = "40px Monospace";
+        var characterSet = " `-.'_:,\"=^;<+!*?/cL\\zrs7TivJtC{3F)Il(xZfY5S2eajo14[nuyE]P6V9kXpKwGhqAUbOd8#HRDB0$mgMW&Q%N@";
+
+        // Use options.
+        if (options) {
+            if (typeof (options) === "string") {
+                font = <string>options;
+            }
+            else {
+                font = (<IAsciiArtPostProcessOptions>options).font || font;
+                characterSet = (<IAsciiArtPostProcessOptions>options).characterSet || characterSet;
+                this.mixToTile = (<IAsciiArtPostProcessOptions>options).mixToTile || this.mixToTile;
+                this.mixToNormal = (<IAsciiArtPostProcessOptions>options).mixToNormal || this.mixToNormal;
+            }
+        }
+
+        this._asciiArtFontTexture = new AsciiArtFontTexture(name, font, characterSet, camera.getScene());
+        var textureSize = this._asciiArtFontTexture.getSize();
+
+        this.onApply = (effect: Effect) => {
+            effect.setTexture("asciiArtFont", this._asciiArtFontTexture);
+
+            effect.setFloat4("asciiArtFontInfos",
+                this._asciiArtFontTexture.charSize,
+                characterSet.length,
+                textureSize.width,
+                textureSize.height);
+
+            effect.setFloat4("asciiArtOptions",
+                this.width,
+                this.height,
+                this.mixToNormal,
+                this.mixToTile);
+        };
+    }
+}

+ 0 - 272
postProcessLibrary/src/asciiArt/babylon.asciiArtPostProcess.ts

@@ -1,272 +0,0 @@
-/// <reference path="../../../dist/preview release/babylon.d.ts"/>
-
-module BABYLON {
-
-    /**
-     * AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
-     *
-     * It basically takes care rendering the font front the given font size to a texture.
-     * This is used later on in the postprocess.
-     */
-    export class AsciiArtFontTexture extends BaseTexture {
-
-        @serialize("font")
-        private _font: string;
-
-        @serialize("text")
-        private _text: string;
-
-        private _charSize: number;
-
-        /**
-         * Gets the size of one char in the texture (each char fits in size * size space in the texture).
-         */
-        public get charSize(): number {
-            return this._charSize;
-        }
-
-        /**
-         * Create a new instance of the Ascii Art FontTexture class
-         * @param name the name of the texture
-         * @param font the font to use, use the W3C CSS notation
-         * @param text the caracter set to use in the rendering.
-         * @param scene the scene that owns the texture
-         */
-        constructor(name: string, font: string, text: string, scene: Nullable<Scene> = null) {
-            super(scene);
-
-            scene = this.getScene();
-
-            if (!scene) {
-                return;
-            }
-
-            this.name = name;
-            this._text == text;
-            this._font == font;
-
-            this.wrapU = Texture.CLAMP_ADDRESSMODE;
-            this.wrapV = Texture.CLAMP_ADDRESSMODE;
-            //this.anisotropicFilteringLevel = 1;
-
-            // Get the font specific info.
-            var maxCharHeight = this.getFontHeight(font);
-            var maxCharWidth = this.getFontWidth(font);
-
-            this._charSize = Math.max(maxCharHeight.height, maxCharWidth);
-
-            // This is an approximate size, but should always be able to fit at least the maxCharCount.
-            var textureWidth = Math.ceil(this._charSize * text.length);
-            var textureHeight = this._charSize;
-
-            // Create the texture that will store the font characters.
-            this._texture = scene.getEngine().createDynamicTexture(textureWidth, textureHeight, false, Texture.NEAREST_SAMPLINGMODE);
-            //scene.getEngine().setclamp
-            var textureSize = this.getSize();
-
-            // Create a canvas with the final size: the one matching the texture.
-            var canvas = document.createElement("canvas");
-            canvas.width = textureSize.width;
-            canvas.height = textureSize.height;
-            var context = <CanvasRenderingContext2D>canvas.getContext("2d");
-            context.textBaseline = "top";
-            context.font = font;
-            context.fillStyle = "white";
-            context.imageSmoothingEnabled = false;
-
-            // Sets the text in the texture.
-            for (var i = 0; i < text.length; i++) {
-                context.fillText(text[i], i * this._charSize, -maxCharHeight.offset);
-            }
-
-            // Flush the text in the dynamic texture.
-
-            scene.getEngine().updateDynamicTexture(this._texture, canvas, false, true);
-        }
-
-        /**
-         * Gets the max char width of a font.
-         * @param font the font to use, use the W3C CSS notation
-         * @return the max char width
-         */
-        private getFontWidth(font: string): number {
-            var fontDraw = document.createElement("canvas");
-            var ctx = <CanvasRenderingContext2D>fontDraw.getContext('2d');
-            ctx.fillStyle = 'white';
-            ctx.font = font;
-
-            return ctx.measureText("W").width;
-        }
-
-        // More info here: https://videlais.com/2014/03/16/the-many-and-varied-problems-with-measuring-font-height-for-html5-canvas/
-        /**
-         * Gets the max char height of a font.
-         * @param font the font to use, use the W3C CSS notation
-         * @return the max char height
-         */
-        private getFontHeight(font: string): {height: number, offset: number} {
-            var fontDraw = document.createElement("canvas");
-            var ctx = <CanvasRenderingContext2D>fontDraw.getContext('2d');
-            ctx.fillRect(0, 0, fontDraw.width, fontDraw.height);
-            ctx.textBaseline = 'top';
-            ctx.fillStyle = 'white';
-            ctx.font = font;
-            ctx.fillText('jH|', 0, 0);
-            var pixels = ctx.getImageData(0, 0, fontDraw.width, fontDraw.height).data;
-            var start = -1;
-            var end = -1;
-            for (var row = 0; row < fontDraw.height; row++) {
-                for (var column = 0; column < fontDraw.width; column++) {
-                    var index = (row * fontDraw.width + column) * 4;
-                    if (pixels[index] === 0) {
-                        if (column === fontDraw.width - 1 && start !== -1) {
-                            end = row;
-                            row = fontDraw.height;
-                            break;
-                        }
-                        continue;
-                    }
-                    else {
-                        if (start === -1) {
-                            start = row;
-                        }
-                        break;
-                    }
-                }
-            }
-            return { height: (end - start) + 1, offset: start - 1};
-        }
-
-        /**
-         * Clones the current AsciiArtTexture.
-         * @return the clone of the texture.
-         */
-        public clone(): AsciiArtFontTexture {
-            return new AsciiArtFontTexture(this.name, this._font, this._text, this.getScene());
-        }
-
-        /**
-         * Parses a json object representing the texture and returns an instance of it.
-         * @param source the source JSON representation
-         * @param scene the scene to create the texture for
-         * @return the parsed texture
-         */
-        public static Parse(source: any, scene: Scene): AsciiArtFontTexture {
-            var texture = SerializationHelper.Parse(() => new AsciiArtFontTexture(source.name, source.font, source.text, scene),
-                source, scene, null);
-
-            return texture;
-        }
-    }
-
-    /**
-     * Option available in the Ascii Art Post Process.
-     */
-    export interface IAsciiArtPostProcessOptions {
-
-        /**
-         * The font to use following the w3c font definition.
-         */
-        font?: string;
-
-        /**
-         * The character set to use in the postprocess.
-         */
-        characterSet?: string;
-
-        /**
-         * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
-         * This number is defined between 0 and 1;
-         */
-        mixToTile?: number;
-
-        /**
-         * This defines the amount you want to mix the normal rendering pass in the ascii art.
-         * This number is defined between 0 and 1;
-         */
-        mixToNormal?: number;
-    }
-
-    /**
-     * AsciiArtPostProcess helps rendering everithing in Ascii Art.
-     *
-     * Simmply add it to your scene and let the nerd that lives in you have fun.
-     * Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
-     */
-    export class AsciiArtPostProcess extends PostProcess {
-
-        /**
-         * The font texture used to render the char in the post process.
-         */
-        private _asciiArtFontTexture: AsciiArtFontTexture;
-
-        /**
-         * This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
-         * This number is defined between 0 and 1;
-         */
-        public mixToTile: number = 0;
-
-        /**
-         * This defines the amount you want to mix the normal rendering pass in the ascii art.
-         * This number is defined between 0 and 1;
-         */
-        public mixToNormal: number = 0;
-
-        /**
-         * Instantiates a new Ascii Art Post Process.
-         * @param name the name to give to the postprocess
-         * @camera the camera to apply the post process to.
-         * @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
-         */
-        constructor(name: string, camera: Camera, options?: string | IAsciiArtPostProcessOptions) {
-            super(name,
-                'asciiart',
-                ['asciiArtFontInfos', 'asciiArtOptions'],
-                ['asciiArtFont'],
-                {
-                    width: camera.getEngine().getRenderWidth(),
-                    height: camera.getEngine().getRenderHeight()
-                },
-                camera,
-                Texture.TRILINEAR_SAMPLINGMODE,
-                camera.getEngine(),
-                true);
-
-            // Default values.
-            var font = "40px Monospace";
-            var characterSet =  " `-.'_:,\"=^;<+!*?/cL\\zrs7TivJtC{3F)Il(xZfY5S2eajo14[nuyE]P6V9kXpKwGhqAUbOd8#HRDB0$mgMW&Q%N@";
-
-            // Use options.
-            if (options) {
-                if (typeof(options) === "string") {
-                    font = <string>options;
-                }
-                else {
-                    font = (<IAsciiArtPostProcessOptions>options).font || font;
-                    characterSet = (<IAsciiArtPostProcessOptions>options).characterSet || characterSet;
-                    this.mixToTile = (<IAsciiArtPostProcessOptions>options).mixToTile || this.mixToTile;
-                    this.mixToNormal = (<IAsciiArtPostProcessOptions>options).mixToNormal || this.mixToNormal;
-                }
-            }
-
-            this._asciiArtFontTexture = new AsciiArtFontTexture(name, font, characterSet, camera.getScene());
-            var textureSize = this._asciiArtFontTexture.getSize();
-
-            this.onApply = (effect: Effect) => {
-                effect.setTexture("asciiArtFont", this._asciiArtFontTexture);
-
-                effect.setFloat4("asciiArtFontInfos",
-                    this._asciiArtFontTexture.charSize,
-                    characterSet.length,
-                    textureSize.width,
-                    textureSize.height);
-
-                effect.setFloat4("asciiArtOptions",
-                    this.width,
-                    this.height,
-                    this.mixToNormal,
-                    this.mixToTile);
-            };
-        }
-    }
-}

+ 1 - 0
postProcessLibrary/src/asciiArt/index.ts

@@ -0,0 +1 @@
+export * from "./asciiArtPostProcess";

+ 0 - 279
postProcessLibrary/src/digitalRain/babylon.digitalRainPostProcess.ts

@@ -1,279 +0,0 @@
-/// <reference path="../../../dist/preview release/babylon.d.ts"/>
-
-module BABYLON {
-
-    /**
-     * DigitalRainFontTexture is the helper class used to easily create your digital rain font texture.
-     *
-     * It basically takes care rendering the font front the given font size to a texture.
-     * This is used later on in the postprocess.
-     */
-    export class DigitalRainFontTexture extends BaseTexture {
-
-        @serialize("font")
-        private _font: string;
-
-        @serialize("text")
-        private _text: string;
-
-        private _charSize: number;
-
-        /**
-         * Gets the size of one char in the texture (each char fits in size * size space in the texture).
-         */
-        public get charSize(): number {
-            return this._charSize;
-        }
-
-        /**
-         * Create a new instance of the Digital Rain FontTexture class
-         * @param name the name of the texture
-         * @param font the font to use, use the W3C CSS notation
-         * @param text the caracter set to use in the rendering.
-         * @param scene the scene that owns the texture
-         */
-        constructor(name: string, font: string, text: string, scene: Nullable<Scene> = null) {
-            super(scene);
-
-            scene = this.getScene();
-
-            if (!scene) {
-                return;
-            }
-
-            this.name = name;
-            this._text == text;
-            this._font == font;
-
-            this.wrapU = Texture.CLAMP_ADDRESSMODE;
-            this.wrapV = Texture.CLAMP_ADDRESSMODE;
-            //this.anisotropicFilteringLevel = 1;
-
-            // Get the font specific info.
-            var maxCharHeight = this.getFontHeight(font);
-            var maxCharWidth = this.getFontWidth(font);
-
-            this._charSize = Math.max(maxCharHeight.height, maxCharWidth);
-
-            // This is an approximate size, but should always be able to fit at least the maxCharCount.
-            var textureWidth = this._charSize;
-            var textureHeight = Math.ceil(this._charSize * text.length);
-
-            // Create the texture that will store the font characters.
-            this._texture = scene.getEngine().createDynamicTexture(textureWidth, textureHeight, false, Texture.NEAREST_SAMPLINGMODE);
-            //scene.getEngine().setclamp
-            var textureSize = this.getSize();
-
-            // Create a canvas with the final size: the one matching the texture.
-            var canvas = document.createElement("canvas");
-            canvas.width = textureSize.width;
-            canvas.height = textureSize.height;
-            var context = <CanvasRenderingContext2D>canvas.getContext("2d");
-            context.textBaseline = "top";
-            context.font = font;
-            context.fillStyle = "white";
-            context.imageSmoothingEnabled = false;
-
-            // Sets the text in the texture.
-            for (var i = 0; i < text.length; i++) {
-                context.fillText(text[i], 0, i * this._charSize - maxCharHeight.offset);
-            }
-
-            // Flush the text in the dynamic texture.
-            scene.getEngine().updateDynamicTexture(this._texture, canvas, false, true);
-        }
-
-        /**
-         * Gets the max char width of a font.
-         * @param font the font to use, use the W3C CSS notation
-         * @return the max char width
-         */
-        private getFontWidth(font: string): number {
-            var fontDraw = document.createElement("canvas");
-            var ctx = <CanvasRenderingContext2D>fontDraw.getContext('2d');
-            ctx.fillStyle = 'white';
-            ctx.font = font;
-
-            return ctx.measureText("W").width;
-        }
-
-        // More info here: https://videlais.com/2014/03/16/the-many-and-varied-problems-with-measuring-font-height-for-html5-canvas/
-        /**
-         * Gets the max char height of a font.
-         * @param font the font to use, use the W3C CSS notation
-         * @return the max char height
-         */
-        private getFontHeight(font: string): {height: number, offset: number} {
-            var fontDraw = document.createElement("canvas");
-            var ctx = <CanvasRenderingContext2D>fontDraw.getContext('2d');
-            ctx.fillRect(0, 0, fontDraw.width, fontDraw.height);
-            ctx.textBaseline = 'top';
-            ctx.fillStyle = 'white';
-            ctx.font = font;
-            ctx.fillText('jH|', 0, 0);
-            var pixels = ctx.getImageData(0, 0, fontDraw.width, fontDraw.height).data;
-            var start = -1;
-            var end = -1;
-            for (var row = 0; row < fontDraw.height; row++) {
-                for (var column = 0; column < fontDraw.width; column++) {
-                    var index = (row * fontDraw.width + column) * 4;
-                    if (pixels[index] === 0) {
-                        if (column === fontDraw.width - 1 && start !== -1) {
-                            end = row;
-                            row = fontDraw.height;
-                            break;
-                        }
-                        continue;
-                    }
-                    else {
-                        if (start === -1) {
-                            start = row;
-                        }
-                        break;
-                    }
-                }
-            }
-            return { height: (end - start) + 1, offset: start - 1};
-        }
-
-        /**
-         * Clones the current DigitalRainFontTexture.
-         * @return the clone of the texture.
-         */
-        public clone(): DigitalRainFontTexture {
-            return new DigitalRainFontTexture(this.name, this._font, this._text, this.getScene());
-        }
-
-        /**
-         * Parses a json object representing the texture and returns an instance of it.
-         * @param source the source JSON representation
-         * @param scene the scene to create the texture for
-         * @return the parsed texture
-         */
-        public static Parse(source: any, scene: Scene): DigitalRainFontTexture {
-            var texture = SerializationHelper.Parse(() => new DigitalRainFontTexture(source.name, source.font, source.text, scene),
-                source, scene, null);
-
-            return texture;
-        }
-    }
-
-    /**
-     * Option available in the Digital Rain Post Process.
-     */
-    export interface IDigitalRainPostProcessOptions {
-
-        /**
-         * The font to use following the w3c font definition.
-         */
-        font?: string;
-
-        /**
-         * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
-         * This number is defined between 0 and 1;
-         */
-        mixToTile?: number;
-
-        /**
-         * This defines the amount you want to mix the normal rendering pass in the digital rain.
-         * This number is defined between 0 and 1;
-         */
-        mixToNormal?: number;
-    }
-
-    /**
-     * DigitalRainPostProcess helps rendering everithing in digital rain.
-     *
-     * Simmply add it to your scene and let the nerd that lives in you have fun.
-     * Example usage: var pp = new DigitalRainPostProcess("digitalRain", "20px Monospace", camera);
-     */
-    export class DigitalRainPostProcess extends PostProcess {
-
-        /**
-         * The font texture used to render the char in the post process.
-         */
-        private _digitalRainFontTexture: DigitalRainFontTexture;
-
-        /**
-         * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
-         * This number is defined between 0 and 1;
-         */
-        public mixToTile: number = 0;
-
-        /**
-         * This defines the amount you want to mix the normal rendering pass in the digital rain.
-         * This number is defined between 0 and 1;
-         */
-        public mixToNormal: number = 0;
-
-        /**
-         * Instantiates a new Digital Rain Post Process.
-         * @param name the name to give to the postprocess
-         * @camera the camera to apply the post process to.
-         * @param options can either be the font name or an option object following the IDigitalRainPostProcessOptions format
-         */
-        constructor(name: string, camera: Camera, options?: string | IDigitalRainPostProcessOptions) {
-            super(name,
-                'digitalrain',
-                ['digitalRainFontInfos', 'digitalRainOptions', 'cosTimeZeroOne', 'matrixSpeed'],
-                ['digitalRainFont'],
-                {
-                    width: camera.getEngine().getRenderWidth(),
-                    height: camera.getEngine().getRenderHeight()
-                },
-                camera,
-                Texture.TRILINEAR_SAMPLINGMODE,
-                camera.getEngine(),
-                true);
-
-            // Default values.
-            var font = "15px Monospace";
-            var characterSet =  "古池や蛙飛び込む水の音ふるいけやかわずとびこむみずのおと初しぐれ猿も小蓑をほしげ也はつしぐれさるもこみのをほしげなり江戸の雨何石呑んだ時鳥えどのあめなんごくのんだほととぎす";
-
-            // Use options.
-            if (options) {
-                if (typeof(options) === "string") {
-                    font = <string>options;
-                }
-                else {
-                    font = (<IDigitalRainPostProcessOptions>options).font || font;
-                    this.mixToTile = (<IDigitalRainPostProcessOptions>options).mixToTile || this.mixToTile;
-                    this.mixToNormal = (<IDigitalRainPostProcessOptions>options).mixToNormal || this.mixToNormal;
-                }
-            }
-
-            this._digitalRainFontTexture = new DigitalRainFontTexture(name, font, characterSet, camera.getScene());
-            var textureSize = this._digitalRainFontTexture.getSize();
-
-            var alpha = 0.0;
-            var cosTimeZeroOne = 0.0;
-            var matrix = new Matrix();
-            for (let i = 0; i < 16; i++) {
-                matrix.m[i] = Math.random();
-            }
-
-            this.onApply = (effect: Effect) => {
-                effect.setTexture("digitalRainFont", this._digitalRainFontTexture);
-
-                effect.setFloat4("digitalRainFontInfos",
-                    this._digitalRainFontTexture.charSize,
-                    characterSet.length,
-                    textureSize.width,
-                    textureSize.height);
-
-                effect.setFloat4("digitalRainOptions",
-                    this.width,
-                    this.height,
-                    this.mixToNormal,
-                    this.mixToTile);
-
-                effect.setMatrix("matrixSpeed",
-                    matrix);
-
-                alpha += 0.003;
-                cosTimeZeroOne = alpha;
-                effect.setFloat('cosTimeZeroOne', cosTimeZeroOne);
-            };
-        }
-    }
-}

+ 277 - 0
postProcessLibrary/src/digitalRain/digitalRainPostProcess.ts

@@ -0,0 +1,277 @@
+import { BaseTexture, serialize, Nullable, Scene, Texture, SerializationHelper, PostProcess, Camera, Matrix, Effect } from "babylonjs";
+
+Effect.ShadersStore["digitalrainPixelShader"] = require("./digitalrain.fragment.fx");
+
+/**
+ * DigitalRainFontTexture is the helper class used to easily create your digital rain font texture.
+ *
+ * It basically takes care rendering the font front the given font size to a texture.
+ * This is used later on in the postprocess.
+ */
+export class DigitalRainFontTexture extends BaseTexture {
+
+    @serialize("font")
+    private _font: string;
+
+    @serialize("text")
+    private _text: string;
+
+    private _charSize: number;
+
+    /**
+     * Gets the size of one char in the texture (each char fits in size * size space in the texture).
+     */
+    public get charSize(): number {
+        return this._charSize;
+    }
+
+    /**
+     * Create a new instance of the Digital Rain FontTexture class
+     * @param name the name of the texture
+     * @param font the font to use, use the W3C CSS notation
+     * @param text the caracter set to use in the rendering.
+     * @param scene the scene that owns the texture
+     */
+    constructor(name: string, font: string, text: string, scene: Nullable<Scene> = null) {
+        super(scene);
+
+        scene = this.getScene();
+
+        if (!scene) {
+            return;
+        }
+
+        this.name = name;
+        this._text == text;
+        this._font == font;
+
+        this.wrapU = Texture.CLAMP_ADDRESSMODE;
+        this.wrapV = Texture.CLAMP_ADDRESSMODE;
+
+        // Get the font specific info.
+        var maxCharHeight = this.getFontHeight(font);
+        var maxCharWidth = this.getFontWidth(font);
+
+        this._charSize = Math.max(maxCharHeight.height, maxCharWidth);
+
+        // This is an approximate size, but should always be able to fit at least the maxCharCount.
+        var textureWidth = this._charSize;
+        var textureHeight = Math.ceil(this._charSize * text.length);
+
+        // Create the texture that will store the font characters.
+        this._texture = scene.getEngine().createDynamicTexture(textureWidth, textureHeight, false, Texture.NEAREST_SAMPLINGMODE);
+        //scene.getEngine().setclamp
+        var textureSize = this.getSize();
+
+        // Create a canvas with the final size: the one matching the texture.
+        var canvas = document.createElement("canvas");
+        canvas.width = textureSize.width;
+        canvas.height = textureSize.height;
+        var context = <CanvasRenderingContext2D>canvas.getContext("2d");
+        context.textBaseline = "top";
+        context.font = font;
+        context.fillStyle = "white";
+        context.imageSmoothingEnabled = false;
+
+        // Sets the text in the texture.
+        for (var i = 0; i < text.length; i++) {
+            context.fillText(text[i], 0, i * this._charSize - maxCharHeight.offset);
+        }
+
+        // Flush the text in the dynamic texture.
+        scene.getEngine().updateDynamicTexture(this._texture, canvas, false, true);
+    }
+
+    /**
+     * Gets the max char width of a font.
+     * @param font the font to use, use the W3C CSS notation
+     * @return the max char width
+     */
+    private getFontWidth(font: string): number {
+        var fontDraw = document.createElement("canvas");
+        var ctx = <CanvasRenderingContext2D>fontDraw.getContext('2d');
+        ctx.fillStyle = 'white';
+        ctx.font = font;
+
+        return ctx.measureText("W").width;
+    }
+
+    // More info here: https://videlais.com/2014/03/16/the-many-and-varied-problems-with-measuring-font-height-for-html5-canvas/
+    /**
+     * Gets the max char height of a font.
+     * @param font the font to use, use the W3C CSS notation
+     * @return the max char height
+     */
+    private getFontHeight(font: string): { height: number, offset: number } {
+        var fontDraw = document.createElement("canvas");
+        var ctx = <CanvasRenderingContext2D>fontDraw.getContext('2d');
+        ctx.fillRect(0, 0, fontDraw.width, fontDraw.height);
+        ctx.textBaseline = 'top';
+        ctx.fillStyle = 'white';
+        ctx.font = font;
+        ctx.fillText('jH|', 0, 0);
+        var pixels = ctx.getImageData(0, 0, fontDraw.width, fontDraw.height).data;
+        var start = -1;
+        var end = -1;
+        for (var row = 0; row < fontDraw.height; row++) {
+            for (var column = 0; column < fontDraw.width; column++) {
+                var index = (row * fontDraw.width + column) * 4;
+                if (pixels[index] === 0) {
+                    if (column === fontDraw.width - 1 && start !== -1) {
+                        end = row;
+                        row = fontDraw.height;
+                        break;
+                    }
+                    continue;
+                }
+                else {
+                    if (start === -1) {
+                        start = row;
+                    }
+                    break;
+                }
+            }
+        }
+        return { height: (end - start) + 1, offset: start - 1 };
+    }
+
+    /**
+     * Clones the current DigitalRainFontTexture.
+     * @return the clone of the texture.
+     */
+    public clone(): DigitalRainFontTexture {
+        return new DigitalRainFontTexture(this.name, this._font, this._text, this.getScene());
+    }
+
+    /**
+     * Parses a json object representing the texture and returns an instance of it.
+     * @param source the source JSON representation
+     * @param scene the scene to create the texture for
+     * @return the parsed texture
+     */
+    public static Parse(source: any, scene: Scene): DigitalRainFontTexture {
+        var texture = SerializationHelper.Parse(() => new DigitalRainFontTexture(source.name, source.font, source.text, scene),
+            source, scene, null);
+
+        return texture;
+    }
+}
+
+/**
+ * Option available in the Digital Rain Post Process.
+ */
+export interface IDigitalRainPostProcessOptions {
+
+    /**
+     * The font to use following the w3c font definition.
+     */
+    font?: string;
+
+    /**
+     * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
+     * This number is defined between 0 and 1;
+     */
+    mixToTile?: number;
+
+    /**
+     * This defines the amount you want to mix the normal rendering pass in the digital rain.
+     * This number is defined between 0 and 1;
+     */
+    mixToNormal?: number;
+}
+
+/**
+ * DigitalRainPostProcess helps rendering everithing in digital rain.
+ *
+ * Simmply add it to your scene and let the nerd that lives in you have fun.
+ * Example usage: var pp = new DigitalRainPostProcess("digitalRain", "20px Monospace", camera);
+ */
+export class DigitalRainPostProcess extends PostProcess {
+
+    /**
+     * The font texture used to render the char in the post process.
+     */
+    private _digitalRainFontTexture: DigitalRainFontTexture;
+
+    /**
+     * This defines the amount you want to mix the "tile" or caracter space colored in the digital rain.
+     * This number is defined between 0 and 1;
+     */
+    public mixToTile: number = 0;
+
+    /**
+     * This defines the amount you want to mix the normal rendering pass in the digital rain.
+     * This number is defined between 0 and 1;
+     */
+    public mixToNormal: number = 0;
+
+    /**
+     * Instantiates a new Digital Rain Post Process.
+     * @param name the name to give to the postprocess
+     * @camera the camera to apply the post process to.
+     * @param options can either be the font name or an option object following the IDigitalRainPostProcessOptions format
+     */
+    constructor(name: string, camera: Camera, options?: string | IDigitalRainPostProcessOptions) {
+        super(name,
+            'digitalrain',
+            ['digitalRainFontInfos', 'digitalRainOptions', 'cosTimeZeroOne', 'matrixSpeed'],
+            ['digitalRainFont'],
+            {
+                width: camera.getEngine().getRenderWidth(),
+                height: camera.getEngine().getRenderHeight()
+            },
+            camera,
+            Texture.TRILINEAR_SAMPLINGMODE,
+            camera.getEngine(),
+            true);
+
+        // Default values.
+        var font = "15px Monospace";
+        var characterSet = "古池や蛙飛び込む水の音ふるいけやかわずとびこむみずのおと初しぐれ猿も小蓑をほしげ也はつしぐれさるもこみのをほしげなり江戸の雨何石呑んだ時鳥えどのあめなんごくのんだほととぎす";
+
+        // Use options.
+        if (options) {
+            if (typeof (options) === "string") {
+                font = <string>options;
+            }
+            else {
+                font = (<IDigitalRainPostProcessOptions>options).font || font;
+                this.mixToTile = (<IDigitalRainPostProcessOptions>options).mixToTile || this.mixToTile;
+                this.mixToNormal = (<IDigitalRainPostProcessOptions>options).mixToNormal || this.mixToNormal;
+            }
+        }
+
+        this._digitalRainFontTexture = new DigitalRainFontTexture(name, font, characterSet, camera.getScene());
+        var textureSize = this._digitalRainFontTexture.getSize();
+
+        var alpha = 0.0;
+        var cosTimeZeroOne = 0.0;
+        var matrix = new Matrix();
+        for (let i = 0; i < 16; i++) {
+            matrix.m[i] = Math.random();
+        }
+
+        this.onApply = (effect: Effect) => {
+            effect.setTexture("digitalRainFont", this._digitalRainFontTexture);
+
+            effect.setFloat4("digitalRainFontInfos",
+                this._digitalRainFontTexture.charSize,
+                characterSet.length,
+                textureSize.width,
+                textureSize.height);
+
+            effect.setFloat4("digitalRainOptions",
+                this.width,
+                this.height,
+                this.mixToNormal,
+                this.mixToTile);
+
+            effect.setMatrix("matrixSpeed",
+                matrix);
+
+            alpha += 0.003;
+            cosTimeZeroOne = alpha;
+            effect.setFloat('cosTimeZeroOne', cosTimeZeroOne);
+        };
+    }
+}

+ 1 - 0
postProcessLibrary/src/digitalRain/index.ts

@@ -0,0 +1 @@
+export * from "./digitalRainPostProcess";

+ 2 - 0
postProcessLibrary/src/index.ts

@@ -0,0 +1,2 @@
+export * from "./asciiArt";
+export * from "./digitalRain";

+ 16 - 0
postProcessLibrary/src/legacy.ts

@@ -0,0 +1,16 @@
+import * as postProcessLibrary from "./index";
+
+/**
+ * Legacy support, defining window.BABYLON.GUI (global variable).
+ *
+ * This is the entry point for the UMD module.
+ * The entry point for a future ESM package should be index.ts
+ */
+var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : undefined);
+if (typeof globalObject !== "undefined") {
+    for (var key in postProcessLibrary) {
+        (<any>globalObject).BABYLON[key] = (<any>postProcessLibrary)[key];
+    }
+}
+
+export * from "./index";

+ 0 - 12
postProcessLibrary/src/tsconfig.json

@@ -1,12 +0,0 @@
-{
-  "compilerOptions": {
-    "experimentalDecorators": true,
-    "module": "commonjs",
-    "target": "es5",
-    "noImplicitAny": true,
-    "noImplicitReturns": true,
-    "noImplicitThis": true,
-    "noUnusedLocals": true,    
-    "strictNullChecks": true
-  }
-}

+ 31 - 0
postProcessLibrary/tsconfig.json

@@ -0,0 +1,31 @@
+{
+  "compilerOptions": {
+    "experimentalDecorators": true,
+    "module": "commonjs",
+    "target": "es5",
+    "noImplicitAny": true,
+    "noImplicitReturns": true,
+    "noImplicitThis": true,
+    "noUnusedLocals": true,
+    "strictNullChecks": true,
+    "declaration": true,
+    "sourceMap": true,
+    "lib": [
+      "es5",
+      "dom",
+      "es2015.promise",
+      "es2015.collection",
+      "es2015.iterable"
+    ],
+    "skipDefaultLibCheck": true,
+    "skipLibCheck": true,
+    "baseUrl": "./src/",
+    "rootDir": "./src/",
+    "paths": {
+      "babylonjs": [
+        "../../dist/preview release/babylon.d.ts"
+      ]
+    },
+    "outDir": "./build"
+  }
+}

+ 67 - 0
postProcessLibrary/webpack.config.js

@@ -0,0 +1,67 @@
+const path = require('path');
+const webpack = require('webpack');
+const DtsBundleWebpack = require('dts-bundle-webpack');
+const CleanWebpackPlugin = require('clean-webpack-plugin');
+
+module.exports = {
+    context: __dirname,
+    entry: {
+        'babylonjs-postProcessesLibrary': path.resolve(__dirname, './src/legacy.ts'),
+    },
+    output: {
+        path: path.resolve(__dirname, '../dist/preview release/postProcessesLibrary'),
+        filename: 'babylon.postProcesses.min.js',
+        libraryTarget: 'umd',
+        library: {
+            root: ["POSTPROCESSLIBRARY"],
+            amd: "babylonjs-postProcessesLibrary",
+            commonjs: "babylonjs-postProcessesLibrary"
+        },
+        umdNamedDefine: true
+    },
+    resolve: {
+        extensions: [".js", '.ts']
+    },
+    externals: {
+        babylonjs: {
+            root: "BABYLON",
+            commonjs: "babylonjs",
+            commonjs2: "babylonjs",
+            amd: "babylonjs"
+        }
+    },
+    devtool: "source-map",
+    module: {
+        rules: [{
+            test: /\.tsx?$/,
+            loader: "ts-loader",
+            exclude: /node_modules/
+        },
+        {
+            test: /\.fx$/,
+            use: [{
+                loader: path.resolve(__dirname, '../Tools/WebpackShaderLoader/index.js')
+            }]
+        }]
+    },
+    mode: "production",
+    devServer: {
+        contentBase: path.join(__dirname, "dist"),
+        compress: false,
+        //open: true,
+        port: 9000
+    },
+    plugins: [
+        new CleanWebpackPlugin([
+            path.resolve(__dirname, './src/**/*.js'),
+            path.resolve(__dirname, './src/**/*.map')
+        ]),
+        new webpack.WatchIgnorePlugin([
+            /\.js$/,
+            /\.d\.ts$/
+        ])
+    ],
+    watchOptions: {
+        ignored: [path.resolve(__dirname, './dist/**/*.*'), 'node_modules']
+    }
+}