@babylonjs/smart-filters 0.7.11-alpha → 0.7.13-alpha
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/dist/blockFoundation/outputBlock.d.ts +5 -0
- package/dist/blockFoundation/outputBlock.d.ts.map +1 -1
- package/dist/blockFoundation/outputBlock.js +30 -1
- package/dist/blockFoundation/outputBlock.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/serialization/importCustomBlockDefinition.js +1 -25
- package/dist/serialization/importCustomBlockDefinition.js.map +1 -1
- package/dist/utils/buildTools/buildShaders.js +1 -1
- package/dist/utils/buildTools/buildShaders.js.map +1 -1
- package/dist/utils/buildTools/convertGlslIntoBlock.d.ts +7 -0
- package/dist/utils/buildTools/convertGlslIntoBlock.d.ts.map +1 -0
- package/dist/utils/buildTools/convertGlslIntoBlock.js +217 -0
- package/dist/utils/buildTools/convertGlslIntoBlock.js.map +1 -0
- package/dist/utils/buildTools/convertGlslIntoShaderProgram.d.ts +26 -0
- package/dist/utils/buildTools/convertGlslIntoShaderProgram.d.ts.map +1 -0
- package/dist/utils/buildTools/{convertShaderForHardcodedBlock.js → convertGlslIntoShaderProgram.js} +43 -30
- package/dist/utils/buildTools/convertGlslIntoShaderProgram.js.map +1 -0
- package/dist/utils/buildTools/convertShaders.d.ts +13 -0
- package/dist/utils/buildTools/convertShaders.d.ts.map +1 -0
- package/dist/utils/buildTools/convertShaders.js +37 -0
- package/dist/utils/buildTools/convertShaders.js.map +1 -0
- package/dist/utils/buildTools/shaderConverter.d.ts +2 -1
- package/dist/utils/buildTools/shaderConverter.d.ts.map +1 -1
- package/dist/utils/buildTools/shaderConverter.js +26 -1
- package/dist/utils/buildTools/shaderConverter.js.map +1 -1
- package/dist/utils/buildTools/watchShaders.js +2 -2
- package/dist/utils/buildTools/watchShaders.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -10
- package/readme.md +2 -0
- package/src/blockFoundation/outputBlock.ts +33 -1
- package/src/index.ts +0 -2
- package/src/serialization/importCustomBlockDefinition.ts +1 -26
- package/src/utils/buildTools/buildShaders.ts +1 -1
- package/src/utils/buildTools/convertGlslIntoBlock.ts +251 -0
- package/src/utils/buildTools/{convertShaderForHardcodedBlock.ts → convertGlslIntoShaderProgram.ts} +56 -35
- package/src/utils/buildTools/convertShaders.ts +42 -0
- package/src/utils/buildTools/shaderConverter.ts +28 -2
- package/src/utils/buildTools/watchShaders.ts +2 -2
- package/src/version.ts +1 -1
- package/dist/blockFoundation/outputBlock.shader.d.ts +0 -13
- package/dist/blockFoundation/outputBlock.shader.d.ts.map +0 -1
- package/dist/blockFoundation/outputBlock.shader.js +0 -31
- package/dist/blockFoundation/outputBlock.shader.js.map +0 -1
- package/dist/blockRegistration/IBlockRegistration.d.ts +0 -36
- package/dist/blockRegistration/IBlockRegistration.d.ts.map +0 -1
- package/dist/blockRegistration/IBlockRegistration.js +0 -2
- package/dist/blockRegistration/IBlockRegistration.js.map +0 -1
- package/dist/blockRegistration/blockSerializers.d.ts +0 -13
- package/dist/blockRegistration/blockSerializers.d.ts.map +0 -1
- package/dist/blockRegistration/blockSerializers.js +0 -35
- package/dist/blockRegistration/blockSerializers.js.map +0 -1
- package/dist/blockRegistration/builtInBlockRegistrations.d.ts +0 -13
- package/dist/blockRegistration/builtInBlockRegistrations.d.ts.map +0 -1
- package/dist/blockRegistration/builtInBlockRegistrations.js +0 -266
- package/dist/blockRegistration/builtInBlockRegistrations.js.map +0 -1
- package/dist/blockRegistration/index.d.ts +0 -3
- package/dist/blockRegistration/index.d.ts.map +0 -1
- package/dist/blockRegistration/index.js +0 -3
- package/dist/blockRegistration/index.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.d.ts +0 -56
- package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.js +0 -66
- package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.shader.d.ts +0 -13
- package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.shader.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.shader.js +0 -36
- package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.shader.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/blurBlock.d.ts +0 -56
- package/dist/blocks/babylon/demo/effects/blurBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/blurBlock.deserializer.d.ts +0 -29
- package/dist/blocks/babylon/demo/effects/blurBlock.deserializer.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/blurBlock.deserializer.js +0 -16
- package/dist/blocks/babylon/demo/effects/blurBlock.deserializer.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/blurBlock.js +0 -100
- package/dist/blocks/babylon/demo/effects/blurBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/blurBlock.serializer.d.ts +0 -8
- package/dist/blocks/babylon/demo/effects/blurBlock.serializer.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/blurBlock.serializer.js +0 -28
- package/dist/blocks/babylon/demo/effects/blurBlock.serializer.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/compositionBlock.d.ts +0 -118
- package/dist/blocks/babylon/demo/effects/compositionBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/compositionBlock.deserializer.d.ts +0 -25
- package/dist/blocks/babylon/demo/effects/compositionBlock.deserializer.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/compositionBlock.deserializer.js +0 -15
- package/dist/blocks/babylon/demo/effects/compositionBlock.deserializer.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/compositionBlock.js +0 -219
- package/dist/blocks/babylon/demo/effects/compositionBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/compositionBlock.serializer.d.ts +0 -6
- package/dist/blocks/babylon/demo/effects/compositionBlock.serializer.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/compositionBlock.serializer.js +0 -25
- package/dist/blocks/babylon/demo/effects/compositionBlock.serializer.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/contrastBlock.d.ts +0 -63
- package/dist/blocks/babylon/demo/effects/contrastBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/contrastBlock.js +0 -122
- package/dist/blocks/babylon/demo/effects/contrastBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/desaturateBlock.d.ts +0 -63
- package/dist/blocks/babylon/demo/effects/desaturateBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/desaturateBlock.js +0 -107
- package/dist/blocks/babylon/demo/effects/desaturateBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.d.ts +0 -79
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.d.ts +0 -33
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.js +0 -17
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.js +0 -171
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.serializer.d.ts +0 -6
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.serializer.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.serializer.js +0 -27
- package/dist/blocks/babylon/demo/effects/directionalBlurBlock.serializer.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/exposureBlock.d.ts +0 -63
- package/dist/blocks/babylon/demo/effects/exposureBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/exposureBlock.js +0 -95
- package/dist/blocks/babylon/demo/effects/exposureBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/greenScreenBlock.d.ts +0 -75
- package/dist/blocks/babylon/demo/effects/greenScreenBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/greenScreenBlock.js +0 -121
- package/dist/blocks/babylon/demo/effects/greenScreenBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/index.d.ts +0 -15
- package/dist/blocks/babylon/demo/effects/index.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/index.js +0 -15
- package/dist/blocks/babylon/demo/effects/index.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/kaleidoscopeBlock.d.ts +0 -63
- package/dist/blocks/babylon/demo/effects/kaleidoscopeBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/kaleidoscopeBlock.js +0 -159
- package/dist/blocks/babylon/demo/effects/kaleidoscopeBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/maskBlock.d.ts +0 -62
- package/dist/blocks/babylon/demo/effects/maskBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/maskBlock.js +0 -75
- package/dist/blocks/babylon/demo/effects/maskBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/maskBlock.shader.d.ts +0 -14
- package/dist/blocks/babylon/demo/effects/maskBlock.shader.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/maskBlock.shader.js +0 -37
- package/dist/blocks/babylon/demo/effects/maskBlock.shader.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/pixelateBlock.d.ts +0 -62
- package/dist/blocks/babylon/demo/effects/pixelateBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/pixelateBlock.js +0 -77
- package/dist/blocks/babylon/demo/effects/pixelateBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/pixelateBlock.shader.d.ts +0 -15
- package/dist/blocks/babylon/demo/effects/pixelateBlock.shader.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/pixelateBlock.shader.js +0 -44
- package/dist/blocks/babylon/demo/effects/pixelateBlock.shader.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/posterizeBlock.d.ts +0 -63
- package/dist/blocks/babylon/demo/effects/posterizeBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/posterizeBlock.js +0 -108
- package/dist/blocks/babylon/demo/effects/posterizeBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/spritesheetBlock.d.ts +0 -81
- package/dist/blocks/babylon/demo/effects/spritesheetBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/spritesheetBlock.js +0 -103
- package/dist/blocks/babylon/demo/effects/spritesheetBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/spritesheetBlock.shader.d.ts +0 -18
- package/dist/blocks/babylon/demo/effects/spritesheetBlock.shader.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/spritesheetBlock.shader.js +0 -57
- package/dist/blocks/babylon/demo/effects/spritesheetBlock.shader.js.map +0 -1
- package/dist/blocks/babylon/demo/effects/tintBlock.d.ts +0 -7
- package/dist/blocks/babylon/demo/effects/tintBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/effects/tintBlock.js +0 -51
- package/dist/blocks/babylon/demo/effects/tintBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/transitions/index.d.ts +0 -2
- package/dist/blocks/babylon/demo/transitions/index.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/transitions/index.js +0 -2
- package/dist/blocks/babylon/demo/transitions/index.js.map +0 -1
- package/dist/blocks/babylon/demo/transitions/wipeBlock.d.ts +0 -69
- package/dist/blocks/babylon/demo/transitions/wipeBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/transitions/wipeBlock.js +0 -110
- package/dist/blocks/babylon/demo/transitions/wipeBlock.js.map +0 -1
- package/dist/blocks/babylon/demo/utilities/index.d.ts +0 -2
- package/dist/blocks/babylon/demo/utilities/index.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/utilities/index.js +0 -2
- package/dist/blocks/babylon/demo/utilities/index.js.map +0 -1
- package/dist/blocks/babylon/demo/utilities/premultiplyAlphaBlock.d.ts +0 -58
- package/dist/blocks/babylon/demo/utilities/premultiplyAlphaBlock.d.ts.map +0 -1
- package/dist/blocks/babylon/demo/utilities/premultiplyAlphaBlock.js +0 -87
- package/dist/blocks/babylon/demo/utilities/premultiplyAlphaBlock.js.map +0 -1
- package/dist/blocks/blockNamespaces.d.ts +0 -5
- package/dist/blocks/blockNamespaces.d.ts.map +0 -1
- package/dist/blocks/blockNamespaces.js +0 -5
- package/dist/blocks/blockNamespaces.js.map +0 -1
- package/dist/blocks/blockTypes.d.ts +0 -22
- package/dist/blocks/blockTypes.d.ts.map +0 -1
- package/dist/blocks/blockTypes.js +0 -22
- package/dist/blocks/blockTypes.js.map +0 -1
- package/dist/blocks/index.d.ts +0 -6
- package/dist/blocks/index.d.ts.map +0 -1
- package/dist/blocks/index.js +0 -6
- package/dist/blocks/index.js.map +0 -1
- package/dist/utils/buildTools/convertShaderForHardcodedBlock.d.ts +0 -13
- package/dist/utils/buildTools/convertShaderForHardcodedBlock.d.ts.map +0 -1
- package/dist/utils/buildTools/convertShaderForHardcodedBlock.js.map +0 -1
- package/src/blockFoundation/outputBlock.fragment.glsl +0 -5
- package/src/blockFoundation/outputBlock.shader.ts +0 -33
- package/src/blockRegistration/IBlockRegistration.ts +0 -45
- package/src/blockRegistration/blockSerializers.ts +0 -52
- package/src/blockRegistration/builtInBlockRegistrations.ts +0 -390
- package/src/blockRegistration/index.ts +0 -2
- package/src/blocks/babylon/demo/effects/blackAndWhiteBlock.fragment.glsl +0 -10
- package/src/blocks/babylon/demo/effects/blackAndWhiteBlock.shader.ts +0 -38
- package/src/blocks/babylon/demo/effects/blackAndWhiteBlock.ts +0 -80
- package/src/blocks/babylon/demo/effects/blurBlock.deserializer.ts +0 -38
- package/src/blocks/babylon/demo/effects/blurBlock.serializer.ts +0 -32
- package/src/blocks/babylon/demo/effects/blurBlock.ts +0 -119
- package/src/blocks/babylon/demo/effects/compositionBlock.deserializer.ts +0 -32
- package/src/blocks/babylon/demo/effects/compositionBlock.serializer.ts +0 -29
- package/src/blocks/babylon/demo/effects/compositionBlock.ts +0 -293
- package/src/blocks/babylon/demo/effects/contrastBlock.ts +0 -152
- package/src/blocks/babylon/demo/effects/desaturateBlock.ts +0 -137
- package/src/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.ts +0 -47
- package/src/blocks/babylon/demo/effects/directionalBlurBlock.serializer.ts +0 -31
- package/src/blocks/babylon/demo/effects/directionalBlurBlock.ts +0 -193
- package/src/blocks/babylon/demo/effects/exposureBlock.ts +0 -120
- package/src/blocks/babylon/demo/effects/greenScreenBlock.ts +0 -152
- package/src/blocks/babylon/demo/effects/index.ts +0 -14
- package/src/blocks/babylon/demo/effects/kaleidoscopeBlock.ts +0 -186
- package/src/blocks/babylon/demo/effects/maskBlock.fragment.glsl +0 -10
- package/src/blocks/babylon/demo/effects/maskBlock.shader.ts +0 -39
- package/src/blocks/babylon/demo/effects/maskBlock.ts +0 -94
- package/src/blocks/babylon/demo/effects/pixelateBlock.fragment.glsl +0 -18
- package/src/blocks/babylon/demo/effects/pixelateBlock.shader.ts +0 -46
- package/src/blocks/babylon/demo/effects/pixelateBlock.ts +0 -101
- package/src/blocks/babylon/demo/effects/posterizeBlock.ts +0 -139
- package/src/blocks/babylon/demo/effects/spritesheetBlock.fragment.glsl +0 -26
- package/src/blocks/babylon/demo/effects/spritesheetBlock.shader.ts +0 -59
- package/src/blocks/babylon/demo/effects/spritesheetBlock.ts +0 -135
- package/src/blocks/babylon/demo/effects/tintBlock.ts +0 -52
- package/src/blocks/babylon/demo/transitions/index.ts +0 -1
- package/src/blocks/babylon/demo/transitions/wipeBlock.ts +0 -138
- package/src/blocks/babylon/demo/utilities/index.ts +0 -1
- package/src/blocks/babylon/demo/utilities/premultiplyAlphaBlock.ts +0 -106
- package/src/blocks/blockNamespaces.ts +0 -4
- package/src/blocks/blockTypes.ts +0 -21
- package/src/blocks/index.ts +0 -5
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import type { Effect } from "@babylonjs/core/Materials/effect";
|
|
2
|
-
import { type RuntimeData } from "../../../../connection/connectionPoint.js";
|
|
3
|
-
import { ConnectionPointType } from "../../../../connection/connectionPointType.js";
|
|
4
|
-
import { type IDisableableBlock, DisableableShaderBlock } from "../../../../blockFoundation/disableableShaderBlock.js";
|
|
5
|
-
import { DisableableShaderBinding } from "../../../../runtime/shaderRuntime.js";
|
|
6
|
-
import type { ShaderProgram } from "../../../../utils/shaderCodeUtils.js";
|
|
7
|
-
import type { SmartFilter } from "../../../../smartFilter.js";
|
|
8
|
-
/**
|
|
9
|
-
* The shader bindings for the Kaleidoscope block.
|
|
10
|
-
*/
|
|
11
|
-
export declare class KaleidoscopeShaderBinding extends DisableableShaderBinding {
|
|
12
|
-
private readonly _inputTexture;
|
|
13
|
-
private readonly _time;
|
|
14
|
-
/**
|
|
15
|
-
* Creates a new shader binding instance for the Kaleidoscope block.
|
|
16
|
-
* @param parentBlock - The parent block
|
|
17
|
-
* @param inputTexture - the input texture
|
|
18
|
-
* @param time - the time
|
|
19
|
-
*/
|
|
20
|
-
constructor(parentBlock: IDisableableBlock, inputTexture: RuntimeData<ConnectionPointType.Texture>, time: RuntimeData<ConnectionPointType.Float>);
|
|
21
|
-
/**
|
|
22
|
-
* Binds all the required data to the shader when rendering.
|
|
23
|
-
* @param effect - defines the effect to bind the data to
|
|
24
|
-
*/
|
|
25
|
-
bind(effect: Effect): void;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* A block performing a Kaleidoscope looking like effect.
|
|
29
|
-
*/
|
|
30
|
-
export declare class KaleidoscopeBlock extends DisableableShaderBlock {
|
|
31
|
-
/**
|
|
32
|
-
* The class name of the block.
|
|
33
|
-
*/
|
|
34
|
-
static ClassName: string;
|
|
35
|
-
/**
|
|
36
|
-
* The namespace of the block.
|
|
37
|
-
*/
|
|
38
|
-
static Namespace: string;
|
|
39
|
-
/**
|
|
40
|
-
* The input texture connection point.
|
|
41
|
-
*/
|
|
42
|
-
readonly input: import("../../../../connection/connectionPoint.js").ConnectionPoint<ConnectionPointType.Texture>;
|
|
43
|
-
/**
|
|
44
|
-
* The time connection point.
|
|
45
|
-
*/
|
|
46
|
-
readonly time: import("../../../../connection/connectionPoint.js").ConnectionPoint<ConnectionPointType.Float>;
|
|
47
|
-
/**
|
|
48
|
-
* The shader program (vertex and fragment code) to use to render the block
|
|
49
|
-
*/
|
|
50
|
-
static ShaderCode: ShaderProgram;
|
|
51
|
-
/**
|
|
52
|
-
* Instantiates a new Block.
|
|
53
|
-
* @param smartFilter - The smart filter this block belongs to
|
|
54
|
-
* @param name - The friendly name of the block
|
|
55
|
-
*/
|
|
56
|
-
constructor(smartFilter: SmartFilter, name: string);
|
|
57
|
-
/**
|
|
58
|
-
* Get the class instance that binds all the required data to the shader (effect) when rendering.
|
|
59
|
-
* @returns The class instance that binds the data to the effect
|
|
60
|
-
*/
|
|
61
|
-
getShaderBinding(): DisableableShaderBinding;
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=kaleidoscopeBlock.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kaleidoscopeBlock.d.ts","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/kaleidoscopeBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE/D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAAE,KAAK,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AAEvH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AA+F9D;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,wBAAwB;IACnE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA2C;IACzE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyC;IAE/D;;;;;OAKG;gBAEC,WAAW,EAAE,iBAAiB,EAC9B,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,OAAO,CAAC,EACtD,IAAI,EAAE,WAAW,CAAC,mBAAmB,CAAC,KAAK,CAAC;IAOhD;;;OAGG;IACa,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAK7C;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,sBAAsB;IACzD;;OAEG;IACH,OAAuB,SAAS,SAAyB;IAEzD;;OAEG;IACH,OAAuB,SAAS,SAA+B;IAE/D;;OAEG;IACH,SAAgB,KAAK,mGAA6D;IAElF;;OAEG;IACH,SAAgB,IAAI,iGAA0D;IAE9E;;OAEG;IACH,OAAuB,UAAU,gBAAiB;IAElD;;;;OAIG;gBACS,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM;IAIlD;;;OAGG;IACI,gBAAgB,IAAI,wBAAwB;CAMtD"}
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import {} from "../../../../connection/connectionPoint.js";
|
|
2
|
-
import { ConnectionPointType } from "../../../../connection/connectionPointType.js";
|
|
3
|
-
import { DisableableShaderBlock } from "../../../../blockFoundation/disableableShaderBlock.js";
|
|
4
|
-
import { DisableStrategy } from "../../../../blockFoundation/index.js";
|
|
5
|
-
import { DisableableShaderBinding } from "../../../../runtime/shaderRuntime.js";
|
|
6
|
-
import { kaleidoscopeBlockType } from "../../../blockTypes.js";
|
|
7
|
-
import { babylonDemoEffectsNamespace } from "../../../blockNamespaces.js";
|
|
8
|
-
const shaderProgram = {
|
|
9
|
-
vertex: `
|
|
10
|
-
// Attributes
|
|
11
|
-
attribute vec2 position;
|
|
12
|
-
|
|
13
|
-
// Output
|
|
14
|
-
varying vec2 vUV;
|
|
15
|
-
|
|
16
|
-
void main(void) {
|
|
17
|
-
vUV = position;
|
|
18
|
-
gl_Position = vec4(position, 0.0, 1.0);
|
|
19
|
-
}
|
|
20
|
-
`,
|
|
21
|
-
fragment: {
|
|
22
|
-
uniform: `
|
|
23
|
-
uniform sampler2D _input_;
|
|
24
|
-
uniform float _time_;
|
|
25
|
-
uniform bool _disabled_;
|
|
26
|
-
`,
|
|
27
|
-
const: `
|
|
28
|
-
const float _width_ = 200.;
|
|
29
|
-
const float _height_ = 300.;
|
|
30
|
-
const vec2 _imageRatio_ = vec2(700. / _width_, 1024. / _height_);
|
|
31
|
-
const vec2 _imageRelativeSize_ = 1. / _imageRatio_;
|
|
32
|
-
const float _halfDiag_ = sqrt(_imageRelativeSize_.x * _imageRelativeSize_.x + _imageRelativeSize_.y * _imageRelativeSize_.y) * 0.5;
|
|
33
|
-
|
|
34
|
-
const float _radius_ = 0.9;
|
|
35
|
-
const float _radius2_ = 0.4;
|
|
36
|
-
|
|
37
|
-
const float _segments_ = 6.;
|
|
38
|
-
const float _segmentArc_ = (2. * 3.1415926535897932384626433832795 / _segments_);
|
|
39
|
-
`,
|
|
40
|
-
mainFunctionName: "_kaleidoscope_",
|
|
41
|
-
mainInputTexture: "_input_",
|
|
42
|
-
functions: [
|
|
43
|
-
{
|
|
44
|
-
name: "_kaleidoscope_",
|
|
45
|
-
code: `
|
|
46
|
-
vec4 _kaleidoscope_(vec2 vUV) {
|
|
47
|
-
if (_disabled_) return texture2D(_input_, vUV);
|
|
48
|
-
|
|
49
|
-
float distanceToCircle = abs(length(vUV) - _radius_);
|
|
50
|
-
vec4 result = vec4(0., 0., 0., 0.);
|
|
51
|
-
|
|
52
|
-
if (distanceToCircle < _halfDiag_ * 10000.) {
|
|
53
|
-
float pointTheta = atan(vUV.y, vUV.x);
|
|
54
|
-
pointTheta += _time_;
|
|
55
|
-
for (float i = -1.; i < 2.; i += 1.) {
|
|
56
|
-
float chunk = floor(pointTheta / _segmentArc_) + i;
|
|
57
|
-
float chunkStart = -_time_ + chunk * _segmentArc_ + _segmentArc_ * 0.5;
|
|
58
|
-
vec2 chunkStartCenter = vec2(cos(chunkStart), sin(chunkStart)) * _radius_;
|
|
59
|
-
vec2 chunkStartPoint = vUV - chunkStartCenter;
|
|
60
|
-
chunkStartPoint *= _imageRatio_;
|
|
61
|
-
chunkStartPoint *= vec2(0.5, 0.5);
|
|
62
|
-
chunkStartPoint += vec2(0.5, 0.5);
|
|
63
|
-
|
|
64
|
-
if (chunkStartPoint.x > 0. && chunkStartPoint.x < 1. && chunkStartPoint.y > 0. && chunkStartPoint.y < 1.) {
|
|
65
|
-
result = texture2D(_input_, chunkStartPoint);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
for (float i = -1.; i < 2.; i += 1.) {
|
|
70
|
-
float chunk = floor(pointTheta / _segmentArc_) + i;
|
|
71
|
-
float chunkStart = -_time_ + chunk * _segmentArc_ + _segmentArc_ * 0.5;
|
|
72
|
-
vec2 chunkStartCenter = vec2(cos(chunkStart), sin(chunkStart)) * _radius2_;
|
|
73
|
-
vec2 chunkStartPoint = vUV - chunkStartCenter;
|
|
74
|
-
chunkStartPoint *= _imageRatio_;
|
|
75
|
-
chunkStartPoint *= vec2(0.5, 0.5);
|
|
76
|
-
chunkStartPoint += vec2(0.5, 0.5);
|
|
77
|
-
|
|
78
|
-
if (chunkStartPoint.x > 0. && chunkStartPoint.x < 1. && chunkStartPoint.y > 0. && chunkStartPoint.y < 1.) {
|
|
79
|
-
vec4 top = texture2D(_input_, chunkStartPoint);
|
|
80
|
-
result = mix(result, top, (result.a <= 0.) ? 1. : top.a);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return result;
|
|
86
|
-
}
|
|
87
|
-
`,
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
/**
|
|
93
|
-
* The shader bindings for the Kaleidoscope block.
|
|
94
|
-
*/
|
|
95
|
-
export class KaleidoscopeShaderBinding extends DisableableShaderBinding {
|
|
96
|
-
/**
|
|
97
|
-
* Creates a new shader binding instance for the Kaleidoscope block.
|
|
98
|
-
* @param parentBlock - The parent block
|
|
99
|
-
* @param inputTexture - the input texture
|
|
100
|
-
* @param time - the time
|
|
101
|
-
*/
|
|
102
|
-
constructor(parentBlock, inputTexture, time) {
|
|
103
|
-
super(parentBlock);
|
|
104
|
-
this._inputTexture = inputTexture;
|
|
105
|
-
this._time = time;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Binds all the required data to the shader when rendering.
|
|
109
|
-
* @param effect - defines the effect to bind the data to
|
|
110
|
-
*/
|
|
111
|
-
bind(effect) {
|
|
112
|
-
super.bind(effect);
|
|
113
|
-
effect.setTexture(this.getRemappedName("input"), this._inputTexture.value);
|
|
114
|
-
effect.setFloat(this.getRemappedName("time"), this._time.value);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* A block performing a Kaleidoscope looking like effect.
|
|
119
|
-
*/
|
|
120
|
-
export class KaleidoscopeBlock extends DisableableShaderBlock {
|
|
121
|
-
/**
|
|
122
|
-
* Instantiates a new Block.
|
|
123
|
-
* @param smartFilter - The smart filter this block belongs to
|
|
124
|
-
* @param name - The friendly name of the block
|
|
125
|
-
*/
|
|
126
|
-
constructor(smartFilter, name) {
|
|
127
|
-
super(smartFilter, name, false, DisableStrategy.Manual);
|
|
128
|
-
/**
|
|
129
|
-
* The input texture connection point.
|
|
130
|
-
*/
|
|
131
|
-
this.input = this._registerInput("input", ConnectionPointType.Texture);
|
|
132
|
-
/**
|
|
133
|
-
* The time connection point.
|
|
134
|
-
*/
|
|
135
|
-
this.time = this._registerInput("time", ConnectionPointType.Float);
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Get the class instance that binds all the required data to the shader (effect) when rendering.
|
|
139
|
-
* @returns The class instance that binds the data to the effect
|
|
140
|
-
*/
|
|
141
|
-
getShaderBinding() {
|
|
142
|
-
const input = this._confirmRuntimeDataSupplied(this.input);
|
|
143
|
-
const time = this._confirmRuntimeDataSupplied(this.time);
|
|
144
|
-
return new KaleidoscopeShaderBinding(this, input, time);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* The class name of the block.
|
|
149
|
-
*/
|
|
150
|
-
KaleidoscopeBlock.ClassName = kaleidoscopeBlockType;
|
|
151
|
-
/**
|
|
152
|
-
* The namespace of the block.
|
|
153
|
-
*/
|
|
154
|
-
KaleidoscopeBlock.Namespace = babylonDemoEffectsNamespace;
|
|
155
|
-
/**
|
|
156
|
-
* The shader program (vertex and fragment code) to use to render the block
|
|
157
|
-
*/
|
|
158
|
-
KaleidoscopeBlock.ShaderCode = shaderProgram;
|
|
159
|
-
//# sourceMappingURL=kaleidoscopeBlock.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kaleidoscopeBlock.js","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/kaleidoscopeBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAA0B,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AACvH,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAIhF,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAE1E,MAAM,aAAa,GAAkB;IACjC,MAAM,EAAE;;;;;;;;;;;KAWP;IAED,QAAQ,EAAE;QACN,OAAO,EAAE;;;;aAIJ;QAEL,KAAK,EAAE;;;;;;;;;;;;aAYF;QAEL,gBAAgB,EAAE,gBAAgB;QAElC,gBAAgB,EAAE,SAAS;QAE3B,SAAS,EAAE;YACP;gBACI,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA0CT;aACA;SACJ;KACJ;CACJ,CAAC;AAEF;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,wBAAwB;IAInE;;;;;OAKG;IACH,YACI,WAA8B,EAC9B,YAAsD,EACtD,IAA4C;QAE5C,KAAK,CAAC,WAAW,CAAC,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACtB,CAAC;IAED;;;OAGG;IACa,IAAI,CAAC,MAAc;QAC/B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC3E,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACpE,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,sBAAsB;IA0BzD;;;;OAIG;IACH,YAAY,WAAwB,EAAE,IAAY;QAC9C,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QArB5D;;WAEG;QACa,UAAK,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAElF;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAc9E,CAAC;IAED;;;OAGG;IACI,gBAAgB;QACnB,MAAM,KAAK,GAAG,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3D,MAAM,IAAI,GAAG,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEzD,OAAO,IAAI,yBAAyB,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;;AA3CD;;GAEG;AACoB,2BAAS,GAAG,qBAAqB,AAAxB,CAAyB;AAEzD;;GAEG;AACoB,2BAAS,GAAG,2BAA2B,AAA9B,CAA+B;AAY/D;;GAEG;AACoB,4BAAU,GAAG,aAAa,AAAhB,CAAiB"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { Effect } from "@babylonjs/core/Materials/effect";
|
|
2
|
-
import { type RuntimeData } from "../../../../connection/connectionPoint.js";
|
|
3
|
-
import { ConnectionPointType } from "../../../../connection/connectionPointType.js";
|
|
4
|
-
import { type IDisableableBlock, DisableableShaderBlock } from "../../../../blockFoundation/disableableShaderBlock.js";
|
|
5
|
-
import { DisableableShaderBinding } from "../../../../runtime/shaderRuntime.js";
|
|
6
|
-
import type { SmartFilter } from "../../../../smartFilter.js";
|
|
7
|
-
/**
|
|
8
|
-
* The shader bindings for the Mask block.
|
|
9
|
-
*/
|
|
10
|
-
export declare class MaskShaderBinding extends DisableableShaderBinding {
|
|
11
|
-
private readonly _inputTexture;
|
|
12
|
-
private readonly _maskTexture;
|
|
13
|
-
/**
|
|
14
|
-
* Creates a new shader binding instance for the Mask block.
|
|
15
|
-
* @param parentBlock - The parent block
|
|
16
|
-
* @param inputTexture - the input texture
|
|
17
|
-
* @param maskTexture - the mask texture
|
|
18
|
-
*/
|
|
19
|
-
constructor(parentBlock: IDisableableBlock, inputTexture: RuntimeData<ConnectionPointType.Texture>, maskTexture: RuntimeData<ConnectionPointType.Texture>);
|
|
20
|
-
/**
|
|
21
|
-
* Binds all the required data to the shader when rendering.
|
|
22
|
-
* @param effect - defines the effect to bind the data to
|
|
23
|
-
*/
|
|
24
|
-
bind(effect: Effect): void;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* A simple block to apply a mask from one texture to the color of another texture
|
|
28
|
-
*/
|
|
29
|
-
export declare class MaskBlock extends DisableableShaderBlock {
|
|
30
|
-
/**
|
|
31
|
-
* The class name of the block.
|
|
32
|
-
*/
|
|
33
|
-
static ClassName: string;
|
|
34
|
-
/**
|
|
35
|
-
* The namespace of the block.
|
|
36
|
-
*/
|
|
37
|
-
static Namespace: string;
|
|
38
|
-
/**
|
|
39
|
-
* The input texture connection point.
|
|
40
|
-
*/
|
|
41
|
-
readonly input: import("../../../../connection/connectionPoint.js").ConnectionPoint<ConnectionPointType.Texture>;
|
|
42
|
-
/**
|
|
43
|
-
* The mask texture connection point.
|
|
44
|
-
*/
|
|
45
|
-
readonly mask: import("../../../../connection/connectionPoint.js").ConnectionPoint<ConnectionPointType.Texture>;
|
|
46
|
-
/**
|
|
47
|
-
* The shader program (vertex and fragment code) to use to render the block
|
|
48
|
-
*/
|
|
49
|
-
static ShaderCode: import("../../../../index.js").ShaderProgram;
|
|
50
|
-
/**
|
|
51
|
-
* Instantiates a new Block.
|
|
52
|
-
* @param smartFilter - The smart filter this block belongs to
|
|
53
|
-
* @param name - The friendly name of the block
|
|
54
|
-
*/
|
|
55
|
-
constructor(smartFilter: SmartFilter, name: string);
|
|
56
|
-
/**
|
|
57
|
-
* Get the class instance that binds all the required data to the shader (effect) when rendering.
|
|
58
|
-
* @returns The class instance that binds the data to the effect
|
|
59
|
-
*/
|
|
60
|
-
getShaderBinding(): DisableableShaderBinding;
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=maskBlock.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"maskBlock.d.ts","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/maskBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAG/D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAAE,KAAK,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AACvH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAK9D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,wBAAwB;IAC3D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA2C;IACzE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA2C;IAExE;;;;;OAKG;gBAEC,WAAW,EAAE,iBAAiB,EAC9B,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,OAAO,CAAC,EACtD,WAAW,EAAE,WAAW,CAAC,mBAAmB,CAAC,OAAO,CAAC;IAOzD;;;OAGG;IACa,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAK7C;AAED;;GAEG;AACH,qBAAa,SAAU,SAAQ,sBAAsB;IACjD;;OAEG;IACH,OAAuB,SAAS,SAAiB;IAEjD;;OAEG;IACH,OAAuB,SAAS,SAA+B;IAE/D;;OAEG;IACH,SAAgB,KAAK,mGAA6D;IAElF;;OAEG;IACH,SAAgB,IAAI,mGAA4D;IAChF;;OAEG;IACH,OAAuB,UAAU,+CAAiB;IAElD;;;;OAIG;gBACS,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM;IAIlD;;;OAGG;IACI,gBAAgB,IAAI,wBAAwB;CAMtD"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { maskBlockType } from "../../../blockTypes.js";
|
|
2
|
-
import {} from "../../../../connection/connectionPoint.js";
|
|
3
|
-
import { ConnectionPointType } from "../../../../connection/connectionPointType.js";
|
|
4
|
-
import { DisableableShaderBlock } from "../../../../blockFoundation/disableableShaderBlock.js";
|
|
5
|
-
import { DisableableShaderBinding } from "../../../../runtime/shaderRuntime.js";
|
|
6
|
-
import { babylonDemoEffectsNamespace } from "../../../blockNamespaces.js";
|
|
7
|
-
import { uniforms, shaderProgram } from "./maskBlock.shader.js";
|
|
8
|
-
/**
|
|
9
|
-
* The shader bindings for the Mask block.
|
|
10
|
-
*/
|
|
11
|
-
export class MaskShaderBinding extends DisableableShaderBinding {
|
|
12
|
-
/**
|
|
13
|
-
* Creates a new shader binding instance for the Mask block.
|
|
14
|
-
* @param parentBlock - The parent block
|
|
15
|
-
* @param inputTexture - the input texture
|
|
16
|
-
* @param maskTexture - the mask texture
|
|
17
|
-
*/
|
|
18
|
-
constructor(parentBlock, inputTexture, maskTexture) {
|
|
19
|
-
super(parentBlock);
|
|
20
|
-
this._inputTexture = inputTexture;
|
|
21
|
-
this._maskTexture = maskTexture;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Binds all the required data to the shader when rendering.
|
|
25
|
-
* @param effect - defines the effect to bind the data to
|
|
26
|
-
*/
|
|
27
|
-
bind(effect) {
|
|
28
|
-
super.bind(effect);
|
|
29
|
-
effect.setTexture(this.getRemappedName(uniforms.input), this._inputTexture.value);
|
|
30
|
-
effect.setTexture(this.getRemappedName(uniforms.mask), this._maskTexture.value);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* A simple block to apply a mask from one texture to the color of another texture
|
|
35
|
-
*/
|
|
36
|
-
export class MaskBlock extends DisableableShaderBlock {
|
|
37
|
-
/**
|
|
38
|
-
* Instantiates a new Block.
|
|
39
|
-
* @param smartFilter - The smart filter this block belongs to
|
|
40
|
-
* @param name - The friendly name of the block
|
|
41
|
-
*/
|
|
42
|
-
constructor(smartFilter, name) {
|
|
43
|
-
super(smartFilter, name);
|
|
44
|
-
/**
|
|
45
|
-
* The input texture connection point.
|
|
46
|
-
*/
|
|
47
|
-
this.input = this._registerInput("input", ConnectionPointType.Texture);
|
|
48
|
-
/**
|
|
49
|
-
* The mask texture connection point.
|
|
50
|
-
*/
|
|
51
|
-
this.mask = this._registerInput("mask", ConnectionPointType.Texture);
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Get the class instance that binds all the required data to the shader (effect) when rendering.
|
|
55
|
-
* @returns The class instance that binds the data to the effect
|
|
56
|
-
*/
|
|
57
|
-
getShaderBinding() {
|
|
58
|
-
const input = this._confirmRuntimeDataSupplied(this.input);
|
|
59
|
-
const mask = this._confirmRuntimeDataSupplied(this.mask);
|
|
60
|
-
return new MaskShaderBinding(this, input, mask);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* The class name of the block.
|
|
65
|
-
*/
|
|
66
|
-
MaskBlock.ClassName = maskBlockType;
|
|
67
|
-
/**
|
|
68
|
-
* The namespace of the block.
|
|
69
|
-
*/
|
|
70
|
-
MaskBlock.Namespace = babylonDemoEffectsNamespace;
|
|
71
|
-
/**
|
|
72
|
-
* The shader program (vertex and fragment code) to use to render the block
|
|
73
|
-
*/
|
|
74
|
-
MaskBlock.ShaderCode = shaderProgram;
|
|
75
|
-
//# sourceMappingURL=maskBlock.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"maskBlock.js","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/maskBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAoB,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAA0B,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AACvH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAGhF,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,wBAAwB;IAI3D;;;;;OAKG;IACH,YACI,WAA8B,EAC9B,YAAsD,EACtD,WAAqD;QAErD,KAAK,CAAC,WAAW,CAAC,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IACpC,CAAC;IAED;;;OAGG;IACa,IAAI,CAAC,MAAc;QAC/B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAClF,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IACpF,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,sBAAsB;IAyBjD;;;;OAIG;IACH,YAAY,WAAwB,EAAE,IAAY;QAC9C,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QApB7B;;WAEG;QACa,UAAK,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAElF;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAahF,CAAC;IAED;;;OAGG;IACI,gBAAgB;QACnB,MAAM,KAAK,GAAG,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3D,MAAM,IAAI,GAAG,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEzD,OAAO,IAAI,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;;AA1CD;;GAEG;AACoB,mBAAS,GAAG,aAAa,AAAhB,CAAiB;AAEjD;;GAEG;AACoB,mBAAS,GAAG,2BAA2B,AAA9B,CAA+B;AAW/D;;GAEG;AACoB,oBAAU,GAAG,aAAa,AAAhB,CAAiB"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ShaderProgram } from "../../../../utils/shaderCodeUtils";
|
|
2
|
-
/**
|
|
3
|
-
* The shader program for the block.
|
|
4
|
-
*/
|
|
5
|
-
export declare const shaderProgram: ShaderProgram;
|
|
6
|
-
/**
|
|
7
|
-
* The uniform names for this shader, to be used in the shader binding so
|
|
8
|
-
* that the names are always in sync.
|
|
9
|
-
*/
|
|
10
|
-
export declare const uniforms: {
|
|
11
|
-
input: string;
|
|
12
|
-
mask: string;
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=maskBlock.shader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"maskBlock.shader.d.ts","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/maskBlock.shader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,aAwB3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;CAGpB,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The shader program for the block.
|
|
3
|
-
*/
|
|
4
|
-
export const shaderProgram = {
|
|
5
|
-
vertex: undefined,
|
|
6
|
-
fragment: {
|
|
7
|
-
uniform: `
|
|
8
|
-
uniform sampler2D _input_; // main
|
|
9
|
-
uniform sampler2D _mask_;`,
|
|
10
|
-
mainInputTexture: "_input_",
|
|
11
|
-
mainFunctionName: "_maskBlock_",
|
|
12
|
-
functions: [
|
|
13
|
-
{
|
|
14
|
-
name: "_maskBlock_",
|
|
15
|
-
code: `
|
|
16
|
-
vec4 _maskBlock_(vec2 vUV) {
|
|
17
|
-
vec4 color = texture2D(_input_, vUV);
|
|
18
|
-
vec3 maskColor = texture2D(_mask_, vUV).rgb;
|
|
19
|
-
float luminance = dot(maskColor, vec3(0.3, 0.59, 0.11));
|
|
20
|
-
|
|
21
|
-
return vec4(color.rgb * luminance, luminance * color.a);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
`,
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* The uniform names for this shader, to be used in the shader binding so
|
|
31
|
-
* that the names are always in sync.
|
|
32
|
-
*/
|
|
33
|
-
export const uniforms = {
|
|
34
|
-
input: "input",
|
|
35
|
-
mask: "mask",
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=maskBlock.shader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"maskBlock.shader.js","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/maskBlock.shader.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAkB;IACxC,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE;QACN,OAAO,EAAE;;sCAEqB;QAC9B,gBAAgB,EAAE,SAAS;QAC3B,gBAAgB,EAAE,aAAa;QAC/B,SAAS,EAAE;YACP;gBACI,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE;;;;;;;;;qBASD;aACR;SACJ;KACJ;CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACpB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;CACf,CAAC"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { Effect } from "@babylonjs/core/Materials/effect";
|
|
2
|
-
import { type RuntimeData } from "../../../../connection/connectionPoint.js";
|
|
3
|
-
import { ConnectionPointType } from "../../../../connection/connectionPointType.js";
|
|
4
|
-
import { type IDisableableBlock, DisableableShaderBlock } from "../../../../blockFoundation/disableableShaderBlock.js";
|
|
5
|
-
import { DisableableShaderBinding } from "../../../../runtime/shaderRuntime.js";
|
|
6
|
-
import type { SmartFilter } from "../../../../smartFilter.js";
|
|
7
|
-
/**
|
|
8
|
-
* The shader bindings for the Pixelate block.
|
|
9
|
-
*/
|
|
10
|
-
export declare class PixelateShaderBinding extends DisableableShaderBinding {
|
|
11
|
-
private readonly _inputTexture;
|
|
12
|
-
private readonly _intensity;
|
|
13
|
-
/**
|
|
14
|
-
* Creates a new shader binding instance for the Kaleidoscope block.
|
|
15
|
-
* @param parentBlock - The parent block
|
|
16
|
-
* @param inputTexture - The input texture
|
|
17
|
-
* @param intensity - The intensity of the effect
|
|
18
|
-
*/
|
|
19
|
-
constructor(parentBlock: IDisableableBlock, inputTexture: RuntimeData<ConnectionPointType.Texture>, intensity: RuntimeData<ConnectionPointType.Float>);
|
|
20
|
-
/**
|
|
21
|
-
* Binds all the required data to the shader when rendering.
|
|
22
|
-
* @param effect - defines the effect to bind the data to
|
|
23
|
-
*/
|
|
24
|
-
bind(effect: Effect): void;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* A simple block pixelating the input texture.
|
|
28
|
-
*/
|
|
29
|
-
export declare class PixelateBlock extends DisableableShaderBlock {
|
|
30
|
-
/**
|
|
31
|
-
* The class name of the block.
|
|
32
|
-
*/
|
|
33
|
-
static ClassName: string;
|
|
34
|
-
/**
|
|
35
|
-
* The namespace of the block.
|
|
36
|
-
*/
|
|
37
|
-
static Namespace: string;
|
|
38
|
-
/**
|
|
39
|
-
* The input texture connection point.
|
|
40
|
-
*/
|
|
41
|
-
readonly input: import("../../../../connection/connectionPoint.js").ConnectionPoint<ConnectionPointType.Texture>;
|
|
42
|
-
/**
|
|
43
|
-
* The intensity connection point.
|
|
44
|
-
*/
|
|
45
|
-
readonly intensity: import("../../../../connection/connectionPointWithDefault.js").ConnectionPointWithDefault<ConnectionPointType.Float>;
|
|
46
|
-
/**
|
|
47
|
-
* The shader program (vertex and fragment code) to use to render the block
|
|
48
|
-
*/
|
|
49
|
-
static ShaderCode: import("../../../../index.js").ShaderProgram;
|
|
50
|
-
/**
|
|
51
|
-
* Instantiates a new Block.
|
|
52
|
-
* @param smartFilter - The smart filter this block belongs to
|
|
53
|
-
* @param name - The friendly name of the block
|
|
54
|
-
*/
|
|
55
|
-
constructor(smartFilter: SmartFilter, name: string);
|
|
56
|
-
/**
|
|
57
|
-
* Get the class instance that binds all the required data to the shader (effect) when rendering.
|
|
58
|
-
* @returns The class instance that binds the data to the effect
|
|
59
|
-
*/
|
|
60
|
-
getShaderBinding(): DisableableShaderBinding;
|
|
61
|
-
}
|
|
62
|
-
//# sourceMappingURL=pixelateBlock.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pixelateBlock.d.ts","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/pixelateBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAG/D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAAE,KAAK,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AAEvH,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAEhF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAK9D;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,wBAAwB;IAC/D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA2C;IACzE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyC;IAEpE;;;;;OAKG;gBAEC,WAAW,EAAE,iBAAiB,EAC9B,YAAY,EAAE,WAAW,CAAC,mBAAmB,CAAC,OAAO,CAAC,EACtD,SAAS,EAAE,WAAW,CAAC,mBAAmB,CAAC,KAAK,CAAC;IAOrD;;;OAGG;IACa,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAK7C;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,sBAAsB;IACrD;;OAEG;IACH,OAAuB,SAAS,SAAqB;IAErD;;OAEG;IACH,OAAuB,SAAS,SAA+B;IAE/D;;OAEG;IACH,SAAgB,KAAK,mGAA6D;IAElF;;OAEG;IACH,SAAgB,SAAS,uHAIvB;IAEF;;OAEG;IACH,OAAuB,UAAU,+CAAiB;IAElD;;;;OAIG;gBACS,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM;IAIlD;;;OAGG;IACI,gBAAgB,IAAI,wBAAwB;CAMtD"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { pixelateBlockType } from "../../../blockTypes.js";
|
|
2
|
-
import {} from "../../../../connection/connectionPoint.js";
|
|
3
|
-
import { ConnectionPointType } from "../../../../connection/connectionPointType.js";
|
|
4
|
-
import { DisableableShaderBlock } from "../../../../blockFoundation/disableableShaderBlock.js";
|
|
5
|
-
import { DisableStrategy } from "../../../../blockFoundation/index.js";
|
|
6
|
-
import { DisableableShaderBinding } from "../../../../runtime/shaderRuntime.js";
|
|
7
|
-
import { createStrongRef } from "../../../../runtime/strongRef.js";
|
|
8
|
-
import { babylonDemoEffectsNamespace } from "../../../blockNamespaces.js";
|
|
9
|
-
import { shaderProgram, uniforms } from "./pixelateBlock.shader.js";
|
|
10
|
-
/**
|
|
11
|
-
* The shader bindings for the Pixelate block.
|
|
12
|
-
*/
|
|
13
|
-
export class PixelateShaderBinding extends DisableableShaderBinding {
|
|
14
|
-
/**
|
|
15
|
-
* Creates a new shader binding instance for the Kaleidoscope block.
|
|
16
|
-
* @param parentBlock - The parent block
|
|
17
|
-
* @param inputTexture - The input texture
|
|
18
|
-
* @param intensity - The intensity of the effect
|
|
19
|
-
*/
|
|
20
|
-
constructor(parentBlock, inputTexture, intensity) {
|
|
21
|
-
super(parentBlock);
|
|
22
|
-
this._inputTexture = inputTexture;
|
|
23
|
-
this._intensity = intensity;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Binds all the required data to the shader when rendering.
|
|
27
|
-
* @param effect - defines the effect to bind the data to
|
|
28
|
-
*/
|
|
29
|
-
bind(effect) {
|
|
30
|
-
super.bind(effect);
|
|
31
|
-
effect.setTexture(this.getRemappedName(uniforms.input), this._inputTexture.value);
|
|
32
|
-
effect.setFloat(this.getRemappedName(uniforms.intensity), this._intensity.value);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* A simple block pixelating the input texture.
|
|
37
|
-
*/
|
|
38
|
-
export class PixelateBlock extends DisableableShaderBlock {
|
|
39
|
-
/**
|
|
40
|
-
* Instantiates a new Block.
|
|
41
|
-
* @param smartFilter - The smart filter this block belongs to
|
|
42
|
-
* @param name - The friendly name of the block
|
|
43
|
-
*/
|
|
44
|
-
constructor(smartFilter, name) {
|
|
45
|
-
super(smartFilter, name, false, DisableStrategy.Manual);
|
|
46
|
-
/**
|
|
47
|
-
* The input texture connection point.
|
|
48
|
-
*/
|
|
49
|
-
this.input = this._registerInput("input", ConnectionPointType.Texture);
|
|
50
|
-
/**
|
|
51
|
-
* The intensity connection point.
|
|
52
|
-
*/
|
|
53
|
-
this.intensity = this._registerOptionalInput("intensity", ConnectionPointType.Float, createStrongRef(0.3));
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Get the class instance that binds all the required data to the shader (effect) when rendering.
|
|
57
|
-
* @returns The class instance that binds the data to the effect
|
|
58
|
-
*/
|
|
59
|
-
getShaderBinding() {
|
|
60
|
-
const input = this._confirmRuntimeDataSupplied(this.input);
|
|
61
|
-
const intensity = this.intensity.runtimeData;
|
|
62
|
-
return new PixelateShaderBinding(this, input, intensity);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* The class name of the block.
|
|
67
|
-
*/
|
|
68
|
-
PixelateBlock.ClassName = pixelateBlockType;
|
|
69
|
-
/**
|
|
70
|
-
* The namespace of the block.
|
|
71
|
-
*/
|
|
72
|
-
PixelateBlock.Namespace = babylonDemoEffectsNamespace;
|
|
73
|
-
/**
|
|
74
|
-
* The shader program (vertex and fragment code) to use to render the block
|
|
75
|
-
*/
|
|
76
|
-
PixelateBlock.ShaderCode = shaderProgram;
|
|
77
|
-
//# sourceMappingURL=pixelateBlock.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pixelateBlock.js","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/pixelateBlock.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAoB,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAA0B,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AACvH,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEpE;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,wBAAwB;IAI/D;;;;;OAKG;IACH,YACI,WAA8B,EAC9B,YAAsD,EACtD,SAAiD;QAEjD,KAAK,CAAC,WAAW,CAAC,CAAC;QACnB,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAChC,CAAC;IAED;;;OAGG;IACa,IAAI,CAAC,MAAc;QAC/B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAClF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACrF,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,sBAAsB;IA8BrD;;;;OAIG;IACH,YAAY,WAAwB,EAAE,IAAY;QAC9C,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QAzB5D;;WAEG;QACa,UAAK,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAElF;;WAEG;QACa,cAAS,GAAG,IAAI,CAAC,sBAAsB,CACnD,WAAW,EACX,mBAAmB,CAAC,KAAK,EACzB,eAAe,CAAC,GAAG,CAAC,CACvB,CAAC;IAcF,CAAC;IAED;;;OAGG;IACI,gBAAgB;QACnB,MAAM,KAAK,GAAG,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3D,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC;QAE7C,OAAO,IAAI,qBAAqB,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IAC7D,CAAC;;AA/CD;;GAEG;AACoB,uBAAS,GAAG,iBAAiB,AAApB,CAAqB;AAErD;;GAEG;AACoB,uBAAS,GAAG,2BAA2B,AAA9B,CAA+B;AAgB/D;;GAEG;AACoB,wBAAU,GAAG,aAAa,AAAhB,CAAiB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ShaderProgram } from "../../../../utils/shaderCodeUtils";
|
|
2
|
-
/**
|
|
3
|
-
* The shader program for the block.
|
|
4
|
-
*/
|
|
5
|
-
export declare const shaderProgram: ShaderProgram;
|
|
6
|
-
/**
|
|
7
|
-
* The uniform names for this shader, to be used in the shader binding so
|
|
8
|
-
* that the names are always in sync.
|
|
9
|
-
*/
|
|
10
|
-
export declare const uniforms: {
|
|
11
|
-
input: string;
|
|
12
|
-
intensity: string;
|
|
13
|
-
disabled: string;
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=pixelateBlock.shader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pixelateBlock.shader.d.ts","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/effects/pixelateBlock.shader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAEvE;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,aA8B3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The shader program for the block.
|
|
3
|
-
*/
|
|
4
|
-
export const shaderProgram = {
|
|
5
|
-
vertex: undefined,
|
|
6
|
-
fragment: {
|
|
7
|
-
uniform: `
|
|
8
|
-
uniform sampler2D _input_; // main
|
|
9
|
-
uniform float _intensity_;
|
|
10
|
-
uniform bool _disabled_;`,
|
|
11
|
-
const: ` const float _videoPixelatePower_ = 6.0;
|
|
12
|
-
const float _videoPixelateMin_ = 10.0;
|
|
13
|
-
const float _videoPixelateMax_ = 1920.0;
|
|
14
|
-
const float _aspect_ = 1.72;`,
|
|
15
|
-
mainInputTexture: "_input_",
|
|
16
|
-
mainFunctionName: "_pixelate_",
|
|
17
|
-
functions: [
|
|
18
|
-
{
|
|
19
|
-
name: "_pixelate_",
|
|
20
|
-
code: `
|
|
21
|
-
vec4 _pixelate_(vec2 vUV) {
|
|
22
|
-
if (!_disabled_) {
|
|
23
|
-
float pixelateStrength = mix(_videoPixelateMin_, _videoPixelateMax_, pow(1. - _intensity_, _videoPixelatePower_));
|
|
24
|
-
vec2 _pixelate_ = vec2(pixelateStrength * _aspect_, pixelateStrength);
|
|
25
|
-
vUV = floor(_pixelate_ * vUV) / _pixelate_;
|
|
26
|
-
}
|
|
27
|
-
return texture2D(_input_, vUV);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
`,
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* The uniform names for this shader, to be used in the shader binding so
|
|
37
|
-
* that the names are always in sync.
|
|
38
|
-
*/
|
|
39
|
-
export const uniforms = {
|
|
40
|
-
input: "input",
|
|
41
|
-
intensity: "intensity",
|
|
42
|
-
disabled: "disabled",
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=pixelateBlock.shader.js.map
|