@babylonjs/core 8.2.1 → 8.3.0
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/AudioV2/webAudio/webAudioEngine.d.ts +1 -0
- package/AudioV2/webAudio/webAudioEngine.js +12 -3
- package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +14 -2
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +2 -1
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/nativeEngine.js +14 -2
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +1 -1
- package/Engines/thinEngine.functions.d.ts +1 -1
- package/Engines/thinEngine.functions.js.map +1 -1
- package/Engines/thinEngine.js +3 -0
- package/Engines/thinEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/fxaaPostProcessBlock.d.ts +25 -0
- package/FrameGraph/Node/Blocks/PostProcesses/fxaaPostProcessBlock.js +35 -0
- package/FrameGraph/Node/Blocks/PostProcesses/fxaaPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/grainPostProcessBlock.d.ts +34 -0
- package/FrameGraph/Node/Blocks/PostProcesses/grainPostProcessBlock.js +74 -0
- package/FrameGraph/Node/Blocks/PostProcesses/grainPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/index.d.ts +2 -0
- package/FrameGraph/Node/Blocks/index.js +2 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/fxaaTask.d.ts +17 -0
- package/FrameGraph/Tasks/PostProcesses/fxaaTask.js +23 -0
- package/FrameGraph/Tasks/PostProcesses/fxaaTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/grainTask.d.ts +16 -0
- package/FrameGraph/Tasks/PostProcesses/grainTask.js +17 -0
- package/FrameGraph/Tasks/PostProcesses/grainTask.js.map +1 -0
- package/FrameGraph/index.d.ts +2 -0
- package/FrameGraph/index.js +2 -0
- package/FrameGraph/index.js.map +1 -1
- package/Materials/Textures/dynamicTexture.js +4 -0
- package/Materials/Textures/dynamicTexture.js.map +1 -1
- package/Meshes/meshUtils.d.ts +11 -1
- package/Meshes/meshUtils.js +22 -0
- package/Meshes/meshUtils.js.map +1 -1
- package/PostProcesses/fxaaPostProcess.d.ts +2 -2
- package/PostProcesses/fxaaPostProcess.js +17 -27
- package/PostProcesses/fxaaPostProcess.js.map +1 -1
- package/PostProcesses/grainPostProcess.d.ts +6 -3
- package/PostProcesses/grainPostProcess.js +35 -24
- package/PostProcesses/grainPostProcess.js.map +1 -1
- package/PostProcesses/index.d.ts +2 -0
- package/PostProcesses/index.js +2 -0
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/thinFXAAPostProcess.d.ts +34 -0
- package/PostProcesses/thinFXAAPostProcess.js +70 -0
- package/PostProcesses/thinFXAAPostProcess.js.map +1 -0
- package/PostProcesses/thinGrainPostProcess.d.ts +32 -0
- package/PostProcesses/thinGrainPostProcess.js +55 -0
- package/PostProcesses/thinGrainPostProcess.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { EffectWrapper } from "../Materials/effectRenderer.js";
|
|
2
|
+
import { Engine } from "../Engines/engine.js";
|
|
3
|
+
/**
|
|
4
|
+
* Post process used to render a grain effect
|
|
5
|
+
*/
|
|
6
|
+
export class ThinGrainPostProcess extends EffectWrapper {
|
|
7
|
+
_gatherImports(useWebGPU, list) {
|
|
8
|
+
if (useWebGPU) {
|
|
9
|
+
this._webGPUReady = true;
|
|
10
|
+
list.push(import("../ShadersWGSL/grain.fragment.js"));
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
list.push(import("../Shaders/grain.fragment.js"));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Constructs a new grain post process
|
|
18
|
+
* @param name Name of the effect
|
|
19
|
+
* @param engine Engine to use to render the effect. If not provided, the last created engine will be used
|
|
20
|
+
* @param options Options to configure the effect
|
|
21
|
+
*/
|
|
22
|
+
constructor(name, engine = null, options) {
|
|
23
|
+
super({
|
|
24
|
+
...options,
|
|
25
|
+
name,
|
|
26
|
+
engine: engine || Engine.LastCreatedEngine,
|
|
27
|
+
useShaderStore: true,
|
|
28
|
+
useAsPostProcess: true,
|
|
29
|
+
fragmentShader: ThinGrainPostProcess.FragmentUrl,
|
|
30
|
+
uniforms: ThinGrainPostProcess.Uniforms,
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* The intensity of the grain added (default: 30)
|
|
34
|
+
*/
|
|
35
|
+
this.intensity = 30;
|
|
36
|
+
/**
|
|
37
|
+
* If the grain should be randomized on every frame
|
|
38
|
+
*/
|
|
39
|
+
this.animated = false;
|
|
40
|
+
}
|
|
41
|
+
bind(noDefaultBindings = false) {
|
|
42
|
+
super.bind(noDefaultBindings);
|
|
43
|
+
this._drawWrapper.effect.setFloat("intensity", this.intensity);
|
|
44
|
+
this._drawWrapper.effect.setFloat("animatedSeed", this.animated ? Math.random() + 1 : 1);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The fragment shader url
|
|
49
|
+
*/
|
|
50
|
+
ThinGrainPostProcess.FragmentUrl = "grain";
|
|
51
|
+
/**
|
|
52
|
+
* The list of uniforms used by the effect
|
|
53
|
+
*/
|
|
54
|
+
ThinGrainPostProcess.Uniforms = ["intensity", "animatedSeed"];
|
|
55
|
+
//# sourceMappingURL=thinGrainPostProcess.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thinGrainPostProcess.js","sourceRoot":"","sources":["../../../../dev/core/src/PostProcesses/thinGrainPostProcess.ts"],"names":[],"mappings":"AAEA,OAAO,EA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DD;;GAEG;AACoB,gCAAW,GAAG,OAAO,AAAV,CAAW;AAE7C;;GAEG;AACoB,6BAAQ,GAAG,CAAC,WAAW,EAAE,cAAc,CAAC,AAAhC,CAAiC","sourcesContent":["// eslint-disable-next-line import/no-internal-modules\r\nimport type { Nullable, AbstractEngine, EffectWrapperCreationOptions } from \"core/index\";\r\nimport { EffectWrapper } from \"../Materials/effectRenderer\";\r\nimport { Engine } from \"../Engines/engine\";\r\n\r\n/**\r\n * Post process used to render a grain effect\r\n */\r\nexport class ThinGrainPostProcess extends EffectWrapper {\r\n /**\r\n * The fragment shader url\r\n */\r\n public static readonly FragmentUrl = \"grain\";\r\n\r\n /**\r\n * The list of uniforms used by the effect\r\n */\r\n public static readonly Uniforms = [\"intensity\", \"animatedSeed\"];\r\n\r\n protected override _gatherImports(useWebGPU: boolean, list: Promise<any>[]) {\r\n if (useWebGPU) {\r\n this._webGPUReady = true;\r\n list.push(import(\"../ShadersWGSL/grain.fragment\"));\r\n } else {\r\n list.push(import(\"../Shaders/grain.fragment\"));\r\n }\r\n }\r\n\r\n /**\r\n * Constructs a new grain post process\r\n * @param name Name of the effect\r\n * @param engine Engine to use to render the effect. If not provided, the last created engine will be used\r\n * @param options Options to configure the effect\r\n */\r\n constructor(name: string, engine: Nullable<AbstractEngine> = null, options?: EffectWrapperCreationOptions) {\r\n super({\r\n ...options,\r\n name,\r\n engine: engine || Engine.LastCreatedEngine!,\r\n useShaderStore: true,\r\n useAsPostProcess: true,\r\n fragmentShader: ThinGrainPostProcess.FragmentUrl,\r\n uniforms: ThinGrainPostProcess.Uniforms,\r\n });\r\n }\r\n\r\n /**\r\n * The intensity of the grain added (default: 30)\r\n */\r\n public intensity = 30;\r\n\r\n /**\r\n * If the grain should be randomized on every frame\r\n */\r\n public animated = false;\r\n\r\n public override bind(noDefaultBindings = false) {\r\n super.bind(noDefaultBindings);\r\n this._drawWrapper.effect!.setFloat(\"intensity\", this.intensity);\r\n this._drawWrapper.effect!.setFloat(\"animatedSeed\", this.animated ? Math.random() + 1 : 1);\r\n }\r\n}\r\n"]}
|