@needle-tools/engine 4.13.1-next.9fc3e64 → 4.14.0-next.31f837e
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/generateMeshBVH.worker-DFcS3P04.js +21 -0
- package/dist/{gltf-progressive-Dbi_Tfhb.js → gltf-progressive-8voIgNp_.js} +4 -4
- package/dist/{gltf-progressive-CaUGGjVL.umd.cjs → gltf-progressive-BRRBj-nY.umd.cjs} +1 -1
- package/dist/{gltf-progressive-DuAR0MQR.min.js → gltf-progressive-Dkh3tG4-.min.js} +1 -1
- package/dist/loader.worker-C6cXDgR1.js +23 -0
- package/dist/{materialx-BF23AVE8.umd.cjs → materialx-CxlgposR.umd.cjs} +1 -1
- package/dist/{materialx-fkoFuRh3.js → materialx-D66rYPqe.js} +2 -2
- package/dist/{materialx-B9ddsHcF.min.js → materialx-Dx8st96L.min.js} +1 -1
- package/dist/{needle-engine.bundle-Dqrh7aWw.umd.cjs → needle-engine.bundle-BQXG5qbQ.umd.cjs} +136 -143
- package/dist/{needle-engine.bundle-BZRE5G6O.js → needle-engine.bundle-Byl5i6zJ.js} +6120 -5904
- package/dist/{needle-engine.bundle-DwybonUg.min.js → needle-engine.bundle-D7w0XD7M.min.js} +147 -154
- package/dist/needle-engine.d.ts +61 -9
- package/dist/needle-engine.js +416 -415
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/dist/{postprocessing-DdM-tz1j.js → postprocessing-BkSpxpYB.js} +2 -2
- package/dist/{postprocessing-BVNrgYZK.min.js → postprocessing-Ce5-UWiA.min.js} +1 -1
- package/dist/{postprocessing-CI2TjWpu.umd.cjs → postprocessing-DFVElmAh.umd.cjs} +1 -1
- package/dist/{three-BW2s1Yl-.umd.cjs → three-Bad8p1pf.umd.cjs} +46 -46
- package/dist/{three-I__hSXzr.min.js → three-CWn13_u1.min.js} +33 -33
- package/dist/{three-VvRoMeIN.js → three-DFV1-P9z.js} +4209 -4209
- package/dist/{three-examples-BhfOE7NG.js → three-examples-43yqn3mL.js} +1 -1
- package/dist/{three-examples-Bpfu6ke_.umd.cjs → three-examples-CO-tx3Sp.umd.cjs} +1 -1
- package/dist/{three-examples-D8zAE_7t.min.js → three-examples-DKuJVGT4.min.js} +1 -1
- package/dist/{three-mesh-ui-BU55xDxJ.umd.cjs → three-mesh-ui-ChzVOraf.umd.cjs} +1 -1
- package/dist/{three-mesh-ui-C3QbemOV.min.js → three-mesh-ui-DyEA5HQF.min.js} +1 -1
- package/dist/{three-mesh-ui-CcMp-FQm.js → three-mesh-ui-fSAQJxdI.js} +1 -1
- package/dist/{vendor-COVQl0b8.umd.cjs → vendor-B51YffMU.umd.cjs} +1 -1
- package/dist/{vendor-BiyIZ61v.js → vendor-CgpZ5ivC.js} +1 -1
- package/dist/{vendor-DW7zqjuT.min.js → vendor-pe19S9r5.min.js} +1 -1
- package/lib/engine/api.d.ts +1 -0
- package/lib/engine/api.js +1 -0
- package/lib/engine/api.js.map +1 -1
- package/lib/engine/engine_lightdata.js +8 -6
- package/lib/engine/engine_lightdata.js.map +1 -1
- package/lib/engine/engine_materialpropertyblock.d.ts +47 -0
- package/lib/engine/engine_materialpropertyblock.js +412 -0
- package/lib/engine/engine_materialpropertyblock.js.map +1 -0
- package/lib/engine-components/ReflectionProbe.d.ts +0 -1
- package/lib/engine-components/ReflectionProbe.js +15 -76
- package/lib/engine-components/ReflectionProbe.js.map +1 -1
- package/lib/engine-components/RendererLightmap.d.ts +13 -9
- package/lib/engine-components/RendererLightmap.js +68 -81
- package/lib/engine-components/RendererLightmap.js.map +1 -1
- package/package.json +2 -2
- package/src/engine/api.ts +1 -0
- package/src/engine/engine_lightdata.ts +8 -6
- package/src/engine/engine_materialpropertyblock.ts +500 -0
- package/src/engine-components/ReflectionProbe.ts +17 -89
- package/src/engine-components/RendererLightmap.ts +76 -87
- package/dist/generateMeshBVH.worker-iyfPIK6R.js +0 -21
- package/dist/loader.worker-C1GG9A7C.js +0 -23
package/dist/needle-engine.d.ts
CHANGED
|
@@ -10056,6 +10056,40 @@ export declare class MaskableGraphic extends Graphic {
|
|
|
10056
10056
|
protected onAfterCreated(): void;
|
|
10057
10057
|
}
|
|
10058
10058
|
|
|
10059
|
+
export declare class MaterialPropertyBlock<T extends Material = Material> {
|
|
10060
|
+
private _overrides;
|
|
10061
|
+
private _defines;
|
|
10062
|
+
private _object;
|
|
10063
|
+
get object(): Object3D | null;
|
|
10064
|
+
constructor(object?: Object3D | null);
|
|
10065
|
+
static get<T extends Material = Material>(object: Object3D): MaterialPropertyBlock<T>;
|
|
10066
|
+
dispose(): void;
|
|
10067
|
+
setOverride<K extends NonFunctionPropertyNames<T>>(name: K, value: T[K], textureTransform?: TextureTransform): void;
|
|
10068
|
+
setOverride(name: string, value: MaterialPropertyType, textureTransform?: TextureTransform): void;
|
|
10069
|
+
getOverride(name: string): PropertyBlockOverride | undefined;
|
|
10070
|
+
clearOverride(name: string): void;
|
|
10071
|
+
clearAllOverrides(): void;
|
|
10072
|
+
removeOverride(name: string): void;
|
|
10073
|
+
get overrides(): PropertyBlockOverride[];
|
|
10074
|
+
hasOverrides(): boolean;
|
|
10075
|
+
/**
|
|
10076
|
+
* Set a shader define that will be included in the program cache key
|
|
10077
|
+
* This allows different objects sharing the same material to have different shader programs
|
|
10078
|
+
*/
|
|
10079
|
+
setDefine(name: string, value: string | number | boolean): void;
|
|
10080
|
+
/**
|
|
10081
|
+
* Remove a shader define
|
|
10082
|
+
*/
|
|
10083
|
+
clearDefine(name: string): void;
|
|
10084
|
+
/**
|
|
10085
|
+
* Get all defines set on this property block
|
|
10086
|
+
*/
|
|
10087
|
+
getDefines(): Readonly<Record<string, string | number | boolean>>;
|
|
10088
|
+
getCacheKey(): string;
|
|
10089
|
+
}
|
|
10090
|
+
|
|
10091
|
+
declare type MaterialPropertyType = number | number[] | Color | Texture | Vector2 | Vector3 | Vector4 | null;
|
|
10092
|
+
|
|
10059
10093
|
export declare namespace MaterialX {
|
|
10060
10094
|
/**
|
|
10061
10095
|
* Utility function to load a MaterialX material from a URL. This can be used in your own code to load MaterialX materials outside of the glTF loading process. The URL should point to a MaterialX XML file.
|
|
@@ -12184,6 +12218,10 @@ export declare class NoiseModule {
|
|
|
12184
12218
|
apply(_index: number, pos: Vec3, vel: Vec3, _deltaTime: number, age: number, life: number): void;
|
|
12185
12219
|
}
|
|
12186
12220
|
|
|
12221
|
+
declare type NonFunctionPropertyNames<T> = {
|
|
12222
|
+
[K in keyof T]: T[K] extends Function ? never : K;
|
|
12223
|
+
}[keyof T];
|
|
12224
|
+
|
|
12187
12225
|
/** Removes all undefined functions */
|
|
12188
12226
|
declare type NoUndefinedNoFunctions<T> = FilterTypes<T, Function | undefined | null>;
|
|
12189
12227
|
|
|
@@ -14653,6 +14691,12 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
14653
14691
|
constructor(reason: string);
|
|
14654
14692
|
}
|
|
14655
14693
|
|
|
14694
|
+
declare interface PropertyBlockOverride {
|
|
14695
|
+
name: string;
|
|
14696
|
+
value: MaterialPropertyType;
|
|
14697
|
+
textureTransform?: TextureTransform;
|
|
14698
|
+
}
|
|
14699
|
+
|
|
14656
14700
|
export declare const PUBLIC_KEY: string;
|
|
14657
14701
|
|
|
14658
14702
|
/** Adds an entry to the browser history. Internally uses `window.history.pushState` */
|
|
@@ -15083,7 +15127,6 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
15083
15127
|
awake(): void;
|
|
15084
15128
|
start(): void;
|
|
15085
15129
|
onDestroy(): void;
|
|
15086
|
-
private static _rendererMaterialsCache;
|
|
15087
15130
|
onSet(_rend: IRenderer): void;
|
|
15088
15131
|
onUnset(_rend: IRenderer): void;
|
|
15089
15132
|
}
|
|
@@ -15485,23 +15528,27 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
15485
15528
|
private lightmapIndex;
|
|
15486
15529
|
private lightmapScaleOffset;
|
|
15487
15530
|
private readonly renderer;
|
|
15488
|
-
private
|
|
15531
|
+
private _isApplied;
|
|
15489
15532
|
private get context();
|
|
15490
15533
|
private get gameObject();
|
|
15491
15534
|
private lightmapTexture;
|
|
15492
|
-
private lightmapScaleOffsetUniform;
|
|
15493
|
-
private lightmapUniform;
|
|
15494
15535
|
constructor(renderer: Renderer);
|
|
15495
15536
|
init(lightmapIndex: number, lightmapScaleOffset: Vector4, lightmapTexture: Texture): void;
|
|
15496
|
-
updateLightmapUniforms(
|
|
15537
|
+
updateLightmapUniforms(_material: any): void;
|
|
15497
15538
|
/**
|
|
15498
|
-
* Apply the lightmap to the object
|
|
15539
|
+
* Apply the lightmap to the object using MaterialPropertyBlock instead of cloning materials.
|
|
15540
|
+
* The lightmap texture and its per-object UV transform are set as overrides via PropertyBlock.
|
|
15541
|
+
* Three.js reads material.lightMap to determine shader defines and upload uniforms,
|
|
15542
|
+
* and uses texture.offset/repeat to compute lightMapTransform in the vertex shader.
|
|
15499
15543
|
*/
|
|
15500
15544
|
applyLightmap(): void;
|
|
15545
|
+
/** Update the lightMap override on all property blocks (e.g. after LOD swap) */
|
|
15546
|
+
private updatePropertyBlockTexture;
|
|
15547
|
+
/**
|
|
15548
|
+
* Remove the lightmap from the object
|
|
15549
|
+
*/
|
|
15550
|
+
onUnset(): void;
|
|
15501
15551
|
private ensureLightmapUvs;
|
|
15502
|
-
private ensureLightmapMaterial;
|
|
15503
|
-
private assignLightmapTexture;
|
|
15504
|
-
private onBeforeCompile;
|
|
15505
15552
|
private setLightmapDebugMaterial;
|
|
15506
15553
|
}
|
|
15507
15554
|
|
|
@@ -19271,6 +19318,11 @@ export declare class OrbitControls extends Component implements ICameraControlle
|
|
|
19271
19318
|
/**@obsolete use Graphics.textureToCanvas */
|
|
19272
19319
|
export declare function textureToCanvas(texture: Texture, force?: boolean): HTMLCanvasElement | null;
|
|
19273
19320
|
|
|
19321
|
+
declare interface TextureTransform {
|
|
19322
|
+
offset?: Vector2;
|
|
19323
|
+
repeat?: Vector2;
|
|
19324
|
+
}
|
|
19325
|
+
|
|
19274
19326
|
declare enum TextWrapMode {
|
|
19275
19327
|
singleLine = "singleLine",
|
|
19276
19328
|
hardBreaks = "hardBreaks",
|