babylonjs-addons 9.14.0 → 9.16.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.
|
@@ -2711,8 +2711,6 @@ import { MaterialPluginBase } from "babylonjs/Materials/materialPluginBase.pure"
|
|
|
2711
2711
|
import { Nullable } from "babylonjs/types";
|
|
2712
2712
|
import { UniformBuffer } from "babylonjs/Materials/uniformBuffer";
|
|
2713
2713
|
import { ShaderLanguage } from "babylonjs/Materials/shaderLanguage";
|
|
2714
|
-
import "babylonjs-addons/atmosphere/ShadersWGSL/ShadersInclude/atmosphereFunctions";
|
|
2715
|
-
import "babylonjs-addons/atmosphere/ShadersWGSL/ShadersInclude/atmosphereUboDeclaration";
|
|
2716
2714
|
class AtmospherePBRMaterialDefines extends MaterialDefines {
|
|
2717
2715
|
USE_CUSTOM_REFLECTION: boolean;
|
|
2718
2716
|
USE_AERIAL_PERSPECTIVE_LUT: boolean;
|
|
@@ -2763,6 +2761,33 @@ export class AtmospherePBRMaterialPlugin extends MaterialPluginBase {
|
|
|
2763
2761
|
* @override
|
|
2764
2762
|
*/
|
|
2765
2763
|
isReadyForSubMesh(): boolean;
|
|
2764
|
+
/**
|
|
2765
|
+
* Ensures the shader includes for this material's shader language are registered, kicking off a lazy
|
|
2766
|
+
* load if needed. Registration from a previously created material (or an explicit preload) is detected
|
|
2767
|
+
* synchronously via the ShaderStore, so only the very first atmosphere material can incur a load delay.
|
|
2768
|
+
* @returns True when the includes are registered and the plugin can proceed.
|
|
2769
|
+
*/
|
|
2770
|
+
private _ensureShaderIncludesLoaded;
|
|
2771
|
+
/**
|
|
2772
|
+
* Fire-and-forget load of the shader includes used from isReadyForSubMesh. Backs off after a failure and
|
|
2773
|
+
* logs so a missing registration doesn't silently stall rendering forever; a retry still recovers from
|
|
2774
|
+
* transient failures such as a dropped network request.
|
|
2775
|
+
* @param shaderLanguage - The shader language whose includes to load.
|
|
2776
|
+
* @param state - The shared load state for that language.
|
|
2777
|
+
*/
|
|
2778
|
+
private _tryLoadShaderIncludesAsync;
|
|
2779
|
+
/**
|
|
2780
|
+
* Preloads (and registers into the ShaderStore) the atmosphere shader includes for the given shader
|
|
2781
|
+
* language, ahead of creating any atmosphere-enabled material. Await this before creating meshes when
|
|
2782
|
+
* they must render in their creation frame with zero delay. Safe to call multiple times; concurrent
|
|
2783
|
+
* calls coalesce onto a single load.
|
|
2784
|
+
*
|
|
2785
|
+
* As an alternative, `Material.forceCompilationAsync(mesh)` (or `Scene.whenReadyAsync`) also awaits the
|
|
2786
|
+
* includes, because readiness is gated through `isReadyForSubMesh`.
|
|
2787
|
+
* @param shaderLanguage - The shader language to preload includes for (defaults to GLSL). Pass `ShaderLanguage.WGSL` for WebGPU.
|
|
2788
|
+
* @returns A promise that resolves once the includes are registered.
|
|
2789
|
+
*/
|
|
2790
|
+
static PreloadShaderIncludesAsync(shaderLanguage?: ShaderLanguage): Promise<void>;
|
|
2766
2791
|
/**
|
|
2767
2792
|
* @override
|
|
2768
2793
|
*/
|
|
@@ -3215,6 +3240,22 @@ export class Atmosphere implements IDisposable {
|
|
|
3215
3240
|
* @param options - The options used to create the atmosphere.
|
|
3216
3241
|
*/
|
|
3217
3242
|
constructor(name: string, scene: Scene, lights: DirectionalLight[], options?: IAtmosphereOptions);
|
|
3243
|
+
/**
|
|
3244
|
+
* Fire-and-forget wrapper around {@link preloadMaterialPluginShaderIncludesAsync} used during construction.
|
|
3245
|
+
* Swallows failures so a rejected preload does not surface as an unhandled promise rejection; the plugin's
|
|
3246
|
+
* `isReadyForSubMesh` already retries and logs on failure.
|
|
3247
|
+
* @returns A promise that always resolves.
|
|
3248
|
+
*/
|
|
3249
|
+
private _eagerlyPreloadMaterialPluginShaderIncludesAsync;
|
|
3250
|
+
/**
|
|
3251
|
+
* Preloads the shader includes used by the atmosphere PBR material plugin so that atmosphere-enabled
|
|
3252
|
+
* materials can render in their creation frame with no delay. The plugin registers these includes lazily
|
|
3253
|
+
* (to keep the module tree-shakeable), so without a preload the very first atmosphere material may skip a
|
|
3254
|
+
* frame while they load. Await this before creating meshes that must render immediately. Safe to call
|
|
3255
|
+
* multiple times.
|
|
3256
|
+
* @returns A promise that resolves once the includes are registered.
|
|
3257
|
+
*/
|
|
3258
|
+
preloadMaterialPluginShaderIncludesAsync(): Promise<void>;
|
|
3218
3259
|
/**
|
|
3219
3260
|
* @override
|
|
3220
3261
|
*/
|
|
@@ -6084,6 +6125,33 @@ declare namespace ADDONS {
|
|
|
6084
6125
|
* @override
|
|
6085
6126
|
*/
|
|
6086
6127
|
isReadyForSubMesh(): boolean;
|
|
6128
|
+
/**
|
|
6129
|
+
* Ensures the shader includes for this material's shader language are registered, kicking off a lazy
|
|
6130
|
+
* load if needed. Registration from a previously created material (or an explicit preload) is detected
|
|
6131
|
+
* synchronously via the ShaderStore, so only the very first atmosphere material can incur a load delay.
|
|
6132
|
+
* @returns True when the includes are registered and the plugin can proceed.
|
|
6133
|
+
*/
|
|
6134
|
+
private _ensureShaderIncludesLoaded;
|
|
6135
|
+
/**
|
|
6136
|
+
* Fire-and-forget load of the shader includes used from isReadyForSubMesh. Backs off after a failure and
|
|
6137
|
+
* logs so a missing registration doesn't silently stall rendering forever; a retry still recovers from
|
|
6138
|
+
* transient failures such as a dropped network request.
|
|
6139
|
+
* @param shaderLanguage - The shader language whose includes to load.
|
|
6140
|
+
* @param state - The shared load state for that language.
|
|
6141
|
+
*/
|
|
6142
|
+
private _tryLoadShaderIncludesAsync;
|
|
6143
|
+
/**
|
|
6144
|
+
* Preloads (and registers into the ShaderStore) the atmosphere shader includes for the given shader
|
|
6145
|
+
* language, ahead of creating any atmosphere-enabled material. Await this before creating meshes when
|
|
6146
|
+
* they must render in their creation frame with zero delay. Safe to call multiple times; concurrent
|
|
6147
|
+
* calls coalesce onto a single load.
|
|
6148
|
+
*
|
|
6149
|
+
* As an alternative, `Material.forceCompilationAsync(mesh)` (or `Scene.whenReadyAsync`) also awaits the
|
|
6150
|
+
* includes, because readiness is gated through `isReadyForSubMesh`.
|
|
6151
|
+
* @param shaderLanguage - The shader language to preload includes for (defaults to GLSL). Pass `ShaderLanguage.WGSL` for WebGPU.
|
|
6152
|
+
* @returns A promise that resolves once the includes are registered.
|
|
6153
|
+
*/
|
|
6154
|
+
static PreloadShaderIncludesAsync(shaderLanguage?: BABYLON.ShaderLanguage): Promise<void>;
|
|
6087
6155
|
/**
|
|
6088
6156
|
* @override
|
|
6089
6157
|
*/
|
|
@@ -6514,6 +6582,22 @@ declare namespace ADDONS {
|
|
|
6514
6582
|
* @param options - The options used to create the atmosphere.
|
|
6515
6583
|
*/
|
|
6516
6584
|
constructor(name: string, scene: BABYLON.Scene, lights: BABYLON.DirectionalLight[], options?: IAtmosphereOptions);
|
|
6585
|
+
/**
|
|
6586
|
+
* Fire-and-forget wrapper around {@link preloadMaterialPluginShaderIncludesAsync} used during construction.
|
|
6587
|
+
* Swallows failures so a rejected preload does not surface as an unhandled promise rejection; the plugin's
|
|
6588
|
+
* `isReadyForSubMesh` already retries and logs on failure.
|
|
6589
|
+
* @returns A promise that always resolves.
|
|
6590
|
+
*/
|
|
6591
|
+
private _eagerlyPreloadMaterialPluginShaderIncludesAsync;
|
|
6592
|
+
/**
|
|
6593
|
+
* Preloads the shader includes used by the atmosphere PBR material plugin so that atmosphere-enabled
|
|
6594
|
+
* materials can render in their creation frame with no delay. The plugin registers these includes lazily
|
|
6595
|
+
* (to keep the module tree-shakeable), so without a preload the very first atmosphere material may skip a
|
|
6596
|
+
* frame while they load. Await this before creating meshes that must render immediately. Safe to call
|
|
6597
|
+
* multiple times.
|
|
6598
|
+
* @returns A promise that resolves once the includes are registered.
|
|
6599
|
+
*/
|
|
6600
|
+
preloadMaterialPluginShaderIncludesAsync(): Promise<void>;
|
|
6517
6601
|
/**
|
|
6518
6602
|
* @override
|
|
6519
6603
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babylonjs-addons",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.16.0",
|
|
4
4
|
"main": "babylonjs.addons.min.js",
|
|
5
5
|
"types": "babylonjs.addons.module.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"test:escheck": "es-check es6 ./babylonjs.addons.js"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"babylonjs": "9.
|
|
19
|
+
"babylonjs": "9.16.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@dev/addons": "1.0.0",
|