@babylonjs/post-processes 5.0.0-beta.9 → 5.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/asciiArt/asciiArtPostProcess.d.ts +107 -105
- package/asciiArt/asciiArtPostProcess.js +206 -204
- package/asciiArt/asciiArtPostProcess.js.map +1 -1
- package/asciiArt/asciiart.fragment.d.ts +5 -5
- package/asciiArt/asciiart.fragment.js +8 -6
- package/asciiArt/asciiart.fragment.js.map +1 -1
- package/asciiArt/index.d.ts +1 -1
- package/asciiArt/index.js +1 -1
- package/asciiArt/index.js.map +1 -1
- package/digitalRain/digitalRainPostProcess.d.ts +107 -105
- package/digitalRain/digitalRainPostProcess.js +216 -214
- package/digitalRain/digitalRainPostProcess.js.map +1 -1
- package/digitalRain/digitalrain.fragment.d.ts +5 -5
- package/digitalRain/digitalrain.fragment.js +8 -6
- package/digitalRain/digitalrain.fragment.js.map +1 -1
- package/digitalRain/index.d.ts +1 -1
- package/digitalRain/index.js +1 -1
- package/digitalRain/index.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.js +3 -2
- package/index.js.map +1 -1
- package/legacy/legacy-asciiArt.d.ts +1 -1
- package/legacy/legacy-asciiArt.js +13 -12
- package/legacy/legacy-asciiArt.js.map +1 -1
- package/legacy/legacy-digitalRain.d.ts +1 -1
- package/legacy/legacy-digitalRain.js +13 -12
- package/legacy/legacy-digitalRain.js.map +1 -1
- package/legacy/legacy.d.ts +1 -1
- package/legacy/legacy.js +14 -13
- package/legacy/legacy.js.map +1 -1
- package/package.json +21 -55
- package/readme.md +2 -2
@@ -1,105 +1,107 @@
|
|
1
|
-
import { Nullable } from "@babylonjs/core/types";
|
2
|
-
import { Camera } from "@babylonjs/core/Cameras/camera";
|
3
|
-
import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture";
|
4
|
-
import { PostProcess } from "@babylonjs/core/PostProcesses/postProcess";
|
5
|
-
import { Scene } from "@babylonjs/core/scene";
|
6
|
-
import "
|
7
|
-
|
8
|
-
|
9
|
-
*
|
10
|
-
*
|
11
|
-
*
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
private
|
16
|
-
private
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
*
|
24
|
-
* @param
|
25
|
-
* @param
|
26
|
-
* @param
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
*
|
32
|
-
* @
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
*
|
38
|
-
* @
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
*
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
*
|
49
|
-
* @param
|
50
|
-
* @
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
* This
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
* This
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
*
|
80
|
-
*
|
81
|
-
*
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
* This
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
* This
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
*
|
101
|
-
* @
|
102
|
-
* @
|
103
|
-
|
104
|
-
|
105
|
-
|
1
|
+
import type { Nullable } from "@babylonjs/core/types.js";
|
2
|
+
import type { Camera } from "@babylonjs/core/Cameras/camera.js";
|
3
|
+
import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
|
4
|
+
import { PostProcess } from "@babylonjs/core/PostProcesses/postProcess.js";
|
5
|
+
import type { Scene } from "@babylonjs/core/scene.js";
|
6
|
+
import "@babylonjs/core/Engines/Extensions/engine.dynamicTexture.js";
|
7
|
+
import "./asciiart.fragment";
|
8
|
+
/**
|
9
|
+
* AsciiArtFontTexture is the helper class used to easily create your ascii art font texture.
|
10
|
+
*
|
11
|
+
* It basically takes care rendering the font front the given font size to a texture.
|
12
|
+
* This is used later on in the postprocess.
|
13
|
+
*/
|
14
|
+
export declare class AsciiArtFontTexture extends BaseTexture {
|
15
|
+
private _font;
|
16
|
+
private _text;
|
17
|
+
private _charSize;
|
18
|
+
/**
|
19
|
+
* Gets the size of one char in the texture (each char fits in size * size space in the texture).
|
20
|
+
*/
|
21
|
+
get charSize(): number;
|
22
|
+
/**
|
23
|
+
* Create a new instance of the Ascii Art FontTexture class
|
24
|
+
* @param name the name of the texture
|
25
|
+
* @param font the font to use, use the W3C CSS notation
|
26
|
+
* @param text the caracter set to use in the rendering.
|
27
|
+
* @param scene the scene that owns the texture
|
28
|
+
*/
|
29
|
+
constructor(name: string, font: string, text: string, scene?: Nullable<Scene>);
|
30
|
+
/**
|
31
|
+
* Gets the max char width of a font.
|
32
|
+
* @param font the font to use, use the W3C CSS notation
|
33
|
+
* @return the max char width
|
34
|
+
*/
|
35
|
+
private _getFontWidth;
|
36
|
+
/**
|
37
|
+
* Gets the max char height of a font.
|
38
|
+
* @param font the font to use, use the W3C CSS notation
|
39
|
+
* @return the max char height
|
40
|
+
*/
|
41
|
+
private _getFontHeight;
|
42
|
+
/**
|
43
|
+
* Clones the current AsciiArtTexture.
|
44
|
+
* @return the clone of the texture.
|
45
|
+
*/
|
46
|
+
clone(): AsciiArtFontTexture;
|
47
|
+
/**
|
48
|
+
* Parses a json object representing the texture and returns an instance of it.
|
49
|
+
* @param source the source JSON representation
|
50
|
+
* @param scene the scene to create the texture for
|
51
|
+
* @return the parsed texture
|
52
|
+
*/
|
53
|
+
static Parse(source: any, scene: Scene): AsciiArtFontTexture;
|
54
|
+
}
|
55
|
+
/**
|
56
|
+
* Option available in the Ascii Art Post Process.
|
57
|
+
*/
|
58
|
+
export interface IAsciiArtPostProcessOptions {
|
59
|
+
/**
|
60
|
+
* The font to use following the w3c font definition.
|
61
|
+
*/
|
62
|
+
font?: string;
|
63
|
+
/**
|
64
|
+
* The character set to use in the postprocess.
|
65
|
+
*/
|
66
|
+
characterSet?: string;
|
67
|
+
/**
|
68
|
+
* This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
|
69
|
+
* This number is defined between 0 and 1;
|
70
|
+
*/
|
71
|
+
mixToTile?: number;
|
72
|
+
/**
|
73
|
+
* This defines the amount you want to mix the normal rendering pass in the ascii art.
|
74
|
+
* This number is defined between 0 and 1;
|
75
|
+
*/
|
76
|
+
mixToNormal?: number;
|
77
|
+
}
|
78
|
+
/**
|
79
|
+
* AsciiArtPostProcess helps rendering everithing in Ascii Art.
|
80
|
+
*
|
81
|
+
* Simmply add it to your scene and let the nerd that lives in you have fun.
|
82
|
+
* Example usage: var pp = new AsciiArtPostProcess("myAscii", "20px Monospace", camera);
|
83
|
+
*/
|
84
|
+
export declare class AsciiArtPostProcess extends PostProcess {
|
85
|
+
/**
|
86
|
+
* The font texture used to render the char in the post process.
|
87
|
+
*/
|
88
|
+
private _asciiArtFontTexture;
|
89
|
+
/**
|
90
|
+
* This defines the amount you want to mix the "tile" or caracter space colored in the ascii art.
|
91
|
+
* This number is defined between 0 and 1;
|
92
|
+
*/
|
93
|
+
mixToTile: number;
|
94
|
+
/**
|
95
|
+
* This defines the amount you want to mix the normal rendering pass in the ascii art.
|
96
|
+
* This number is defined between 0 and 1;
|
97
|
+
*/
|
98
|
+
mixToNormal: number;
|
99
|
+
/**
|
100
|
+
* Instantiates a new Ascii Art Post Process.
|
101
|
+
* @param name the name to give to the postprocess
|
102
|
+
* @camera the camera to apply the post process to.
|
103
|
+
* @param camera
|
104
|
+
* @param options can either be the font name or an option object following the IAsciiArtPostProcessOptions format
|
105
|
+
*/
|
106
|
+
constructor(name: string, camera: Camera, options?: string | IAsciiArtPostProcessOptions);
|
107
|
+
}
|