playcanvas 1.50.1 → 1.51.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/build/playcanvas-extras.js +1 -1
- package/build/playcanvas.d.ts +52 -65
- package/build/playcanvas.dbg.js +13160 -13350
- package/build/playcanvas.js +11580 -11780
- package/build/playcanvas.min.js +2 -2
- package/build/playcanvas.mjs +11410 -11573
- package/build/playcanvas.prf.js +12710 -12910
- package/package.json +4 -4
- package/scripts/parsers/vox-parser.js +18 -6
- package/scripts/parsers/vox-parser.mjs +13 -4
- package/scripts/utils/cubemap-renderer.js +23 -7
package/build/playcanvas.d.ts
CHANGED
|
@@ -1724,13 +1724,13 @@ export class AnimComponentLayer {
|
|
|
1724
1724
|
*/
|
|
1725
1725
|
assignMask(mask?: any): void;
|
|
1726
1726
|
/**
|
|
1727
|
-
* Assigns an animation track to a state in the current graph. If a state for the given
|
|
1728
|
-
* @param
|
|
1727
|
+
* Assigns an animation track to a state or blend tree node in the current graph. If a state for the given nodePath doesn't exist, it will be created. If all states nodes are linked and the {@link AnimComponent#activate} value was set to true then the component will begin playing.
|
|
1728
|
+
* @param nodePath - Either the state name or the path to a blend tree node that this animation should be associated with. Each section of a blend tree path is split using a period (`.`) therefore state names should not include this character (e.g "MyStateName" or "MyStateName.BlendTreeNode").
|
|
1729
1729
|
* @param animTrack - The animation track that will be assigned to this state and played whenever this state is active.
|
|
1730
1730
|
* @param [speed] - Update the speed of the state you are assigning an animation to. Defaults to 1.
|
|
1731
1731
|
* @param [loop] - Update the loop property of the state you are assigning an animation to. Defaults to true.
|
|
1732
1732
|
*/
|
|
1733
|
-
assignAnimation(
|
|
1733
|
+
assignAnimation(nodePath: string, animTrack: any, speed?: number, loop?: boolean): void;
|
|
1734
1734
|
/**
|
|
1735
1735
|
* Removes animations from a node in the loaded state graph.
|
|
1736
1736
|
* @param nodeName - The name of the node that should have its animation tracks removed.
|
|
@@ -1875,15 +1875,15 @@ export class AnimComponent extends Component {
|
|
|
1875
1875
|
*/
|
|
1876
1876
|
findAnimationLayer(name: string): AnimComponentLayer;
|
|
1877
1877
|
/**
|
|
1878
|
-
* Associates an animation with a state in the loaded state graph. If all states are linked and the {@link AnimComponent#activate} value was set to true then the component will begin playing.
|
|
1879
|
-
* If no state graph is loaded, a default state graph will be created with a single state based on the provided
|
|
1880
|
-
* @param
|
|
1878
|
+
* Associates an animation with a state or blend tree node in the loaded state graph. If all states are linked and the {@link AnimComponent#activate} value was set to true then the component will begin playing.
|
|
1879
|
+
* If no state graph is loaded, a default state graph will be created with a single state based on the provided nodePath parameter.
|
|
1880
|
+
* @param nodePath - Either the state name or the path to a blend tree node that this animation should be associated with. Each section of a blend tree path is split using a period (`.`) therefore state names should not include this character (e.g "MyStateName" or "MyStateName.BlendTreeNode").
|
|
1881
1881
|
* @param animTrack - The animation track that will be assigned to this state and played whenever this state is active.
|
|
1882
1882
|
* @param [layerName] - The name of the anim component layer to update. If omitted the default layer is used. If no state graph has been previously loaded this parameter is ignored.
|
|
1883
1883
|
* @param [speed] - Update the speed of the state you are assigning an animation to. Defaults to 1.
|
|
1884
1884
|
* @param [loop] - Update the loop property of the state you are assigning an animation to. Defaults to true.
|
|
1885
1885
|
*/
|
|
1886
|
-
assignAnimation(
|
|
1886
|
+
assignAnimation(nodePath: string, animTrack: any, layerName?: string, speed?: number, loop?: boolean): void;
|
|
1887
1887
|
/**
|
|
1888
1888
|
* Removes animations from a node in the loaded state graph.
|
|
1889
1889
|
* @param nodeName - The name of the node that should have its animation tracks removed.
|
|
@@ -2246,6 +2246,8 @@ LAYERID_SKYBOX, LAYERID_UI, LAYERID_IMMEDIATE].
|
|
|
2246
2246
|
* @property disablePostEffectsLayer - Layer ID of a layer on which the postprocessing of the camera stops being applied to.
|
|
2247
2247
|
Defaults to LAYERID_UI, which causes post processing to not be applied to UI layer and
|
|
2248
2248
|
any following layers for the camera. Set to undefined for post-processing to be applied to all layers of the camera.
|
|
2249
|
+
* @property onPreRender - Custom function that is called before the camera renders the scene.
|
|
2250
|
+
* @property onPostRender - Custom function that is called after the camera renders the scene.
|
|
2249
2251
|
* @param system - The ComponentSystem that created this
|
|
2250
2252
|
Component.
|
|
2251
2253
|
* @param entity - The Entity that this Component is attached to.
|
|
@@ -2514,6 +2516,14 @@ export class CameraComponent extends Component {
|
|
|
2514
2516
|
* any following layers for the camera. Set to undefined for post-processing to be applied to all layers of the camera.
|
|
2515
2517
|
*/
|
|
2516
2518
|
disablePostEffectsLayer: number;
|
|
2519
|
+
/**
|
|
2520
|
+
* Custom function that is called before the camera renders the scene.
|
|
2521
|
+
*/
|
|
2522
|
+
onPreRender: (...params: any[]) => any;
|
|
2523
|
+
/**
|
|
2524
|
+
* Custom function that is called after the camera renders the scene.
|
|
2525
|
+
*/
|
|
2526
|
+
onPostRender: (...params: any[]) => any;
|
|
2517
2527
|
}
|
|
2518
2528
|
|
|
2519
2529
|
/**
|
|
@@ -7352,12 +7362,6 @@ export class PostEffect {
|
|
|
7352
7362
|
*/
|
|
7353
7363
|
export function drawFullscreenQuad(device: GraphicsDevice, target: RenderTarget, vertexBuffer: VertexBuffer, shader: Shader, rect?: Vec4): void;
|
|
7354
7364
|
|
|
7355
|
-
/**
|
|
7356
|
-
* Prefilter a cubemap for use by a {@link StandardMaterial} as an environment map. Should only be used for cubemaps that can't be prefiltered ahead of time (in the editor).
|
|
7357
|
-
* @param options - The options for how the cubemap is prefiltered.
|
|
7358
|
-
*/
|
|
7359
|
-
export function prefilterCubemap(options: any): void;
|
|
7360
|
-
|
|
7361
7365
|
/**
|
|
7362
7366
|
* Object containing all default shader chunks used by shader generators.
|
|
7363
7367
|
*/
|
|
@@ -7489,11 +7493,17 @@ export class RenderTarget {
|
|
|
7489
7493
|
* the function performs a standard resample.
|
|
7490
7494
|
* @param [options.numSamples] - Optional number of samples (default is 1024).
|
|
7491
7495
|
* @param [options.face] - Optional cubemap face to update (default is update all faces).
|
|
7496
|
+
* @param [options.distribution] - Specify convolution distribution - 'none', 'lambert', 'phong', 'ggx'. Default depends on specularPower.
|
|
7497
|
+
* @param [options.rect] - Optional viewport rectangle.
|
|
7498
|
+
* @param [options.seamPixels] - Optional number of seam pixels to render
|
|
7492
7499
|
*/
|
|
7493
7500
|
export function reprojectTexture(source: Texture, target: Texture, options?: {
|
|
7494
7501
|
specularPower?: number;
|
|
7495
7502
|
numSamples?: number;
|
|
7496
7503
|
face?: number;
|
|
7504
|
+
distribution?: string;
|
|
7505
|
+
rect?: Vec4;
|
|
7506
|
+
seamPixels?: number;
|
|
7497
7507
|
}): void;
|
|
7498
7508
|
|
|
7499
7509
|
/**
|
|
@@ -8265,13 +8275,13 @@ export class VertexIterator {
|
|
|
8265
8275
|
* Moves the vertex iterator on to the next vertex.
|
|
8266
8276
|
* @example
|
|
8267
8277
|
* var iterator = new pc.VertexIterator(vertexBuffer);
|
|
8268
|
-
iterator.element[pc.
|
|
8278
|
+
iterator.element[pc.SEMANTIC_POSITION].set(-0.9, -0.9, 0.0);
|
|
8269
8279
|
iterator.element[pc.SEMANTIC_COLOR].set(255, 0, 0, 255);
|
|
8270
8280
|
iterator.next();
|
|
8271
|
-
iterator.element[pc.
|
|
8281
|
+
iterator.element[pc.SEMANTIC_POSITION].set(0.9, -0.9, 0.0);
|
|
8272
8282
|
iterator.element[pc.SEMANTIC_COLOR].set(0, 255, 0, 255);
|
|
8273
8283
|
iterator.next();
|
|
8274
|
-
iterator.element[pc.
|
|
8284
|
+
iterator.element[pc.SEMANTIC_POSITION].set(0.0, 0.9, 0.0);
|
|
8275
8285
|
iterator.element[pc.SEMANTIC_COLOR].set(0, 0, 255, 255);
|
|
8276
8286
|
iterator.end();
|
|
8277
8287
|
* @param [count] - Optional number of steps to move on when calling next. Defaults to 1.
|
|
@@ -8282,13 +8292,13 @@ export class VertexIterator {
|
|
|
8282
8292
|
the vertex buffer is unlocked and vertex data is uploaded to video memory.
|
|
8283
8293
|
* @example
|
|
8284
8294
|
* var iterator = new pc.VertexIterator(vertexBuffer);
|
|
8285
|
-
iterator.element[pc.
|
|
8295
|
+
iterator.element[pc.SEMANTIC_POSITION].set(-0.9, -0.9, 0.0);
|
|
8286
8296
|
iterator.element[pc.SEMANTIC_COLOR].set(255, 0, 0, 255);
|
|
8287
8297
|
iterator.next();
|
|
8288
|
-
iterator.element[pc.
|
|
8298
|
+
iterator.element[pc.SEMANTIC_POSITION].set(0.9, -0.9, 0.0);
|
|
8289
8299
|
iterator.element[pc.SEMANTIC_COLOR].set(0, 255, 0, 255);
|
|
8290
8300
|
iterator.next();
|
|
8291
|
-
iterator.element[pc.
|
|
8301
|
+
iterator.element[pc.SEMANTIC_POSITION].set(0.0, 0.9, 0.0);
|
|
8292
8302
|
iterator.element[pc.SEMANTIC_COLOR].set(0, 0, 255, 255);
|
|
8293
8303
|
iterator.end();
|
|
8294
8304
|
*/
|
|
@@ -13320,6 +13330,11 @@ export const SHADOW_VSM32: number;
|
|
|
13320
13330
|
*/
|
|
13321
13331
|
export const SHADOW_PCF5: number;
|
|
13322
13332
|
|
|
13333
|
+
/**
|
|
13334
|
+
* Render depth (color-packed on WebGL 1.0), can be used for PCF 1x1 sampling.
|
|
13335
|
+
*/
|
|
13336
|
+
export const SHADOW_PCF1: number;
|
|
13337
|
+
|
|
13323
13338
|
/**
|
|
13324
13339
|
* Box filter.
|
|
13325
13340
|
*/
|
|
@@ -14927,15 +14942,9 @@ export class Material {
|
|
|
14927
14942
|
* - alphaFade: fade value. See {@link Material#alphaFade}.
|
|
14928
14943
|
* - sphereMap: if {@link StandardMaterial#sphereMap} is used.
|
|
14929
14944
|
* - cubeMap: if {@link StandardMaterial#cubeMap} is used.
|
|
14930
|
-
* - dpAtlas: if dual-paraboloid reflection is used. Dual paraboloid reflections replace prefiltered cubemaps on certain platform (mostly Android) for performance reasons.
|
|
14931
14945
|
* - ambientSH: if ambient spherical harmonics are used. Ambient SH replace prefiltered cubemap ambient on certain platform (mostly Android) for performance reasons.
|
|
14932
14946
|
* - useSpecular: if any specular or reflections are needed at all.
|
|
14933
|
-
* - rgbmAmbient: if ambient cubemap or spherical harmonics are RGBM-encoded.
|
|
14934
|
-
* - hdrAmbient: if ambient cubemap or spherical harmonics are plain float HDR data.
|
|
14935
|
-
* - rgbmReflection: if reflection cubemap or dual paraboloid are RGBM-encoded.
|
|
14936
|
-
* - hdrReflection: if reflection cubemap or dual paraboloid are plain float HDR data.
|
|
14937
14947
|
* - fixSeams: if cubemaps require seam fixing (see {@link Texture#options.fixCubemapSeams}).
|
|
14938
|
-
* - prefilteredCubemap: if prefiltered cubemaps are used.
|
|
14939
14948
|
* - emissiveFormat: how emissiveMap must be sampled. This value is based on {@link Texture#options.rgbm} and {@link Texture#options.format}. Possible values are:
|
|
14940
14949
|
* - 0: sRGB texture
|
|
14941
14950
|
* - 1: RGBM-encoded HDR texture
|
|
@@ -14951,11 +14960,13 @@ export class Material {
|
|
|
14951
14960
|
* - refraction: if refraction is used.
|
|
14952
14961
|
* - skyboxIntensity: if reflected skybox intensity should be modulated.
|
|
14953
14962
|
* - useCubeMapRotation: if cube map rotation is enabled.
|
|
14954
|
-
* - useRightHandedCubeMap: if the cube map uses a right-handed coordinate system. The convention for pre-generated cubemaps is left-handed.
|
|
14955
|
-
* - useTexCubeLod: if textureCubeLodEXT function should be used to read prefiltered cubemaps. Usually true of iOS, false on other devices due to quality/performance balance.
|
|
14956
14963
|
* - useInstancing: if hardware instancing compatible shader should be generated. Transform is read from per-instance {@link VertexBuffer} instead of shader's uniforms.
|
|
14957
14964
|
* - useMorphPosition: if morphing code should be generated to morph positions.
|
|
14958
14965
|
* - useMorphNormal: if morphing code should be generated to morph normals.
|
|
14966
|
+
* - reflectionSource: one of "envAtlas", "cubeMap", "sphereMap"
|
|
14967
|
+
* - reflectionEncoding: one of null, "rgbm", "rgbe", "linear", "srgb"
|
|
14968
|
+
* - ambientSource: one of "ambientSH", "envAtlas", "constant"
|
|
14969
|
+
* - ambientEncoding: one of null, "rgbm", "rgbe", "linear", "srgb"
|
|
14959
14970
|
*/
|
|
14960
14971
|
export class StandardMaterial extends Material {
|
|
14961
14972
|
/**
|
|
@@ -15660,15 +15671,9 @@ export class StandardMaterial extends Material {
|
|
|
15660
15671
|
- alphaFade: fade value. See {@link Material#alphaFade}.
|
|
15661
15672
|
- sphereMap: if {@link StandardMaterial#sphereMap} is used.
|
|
15662
15673
|
- cubeMap: if {@link StandardMaterial#cubeMap} is used.
|
|
15663
|
-
- dpAtlas: if dual-paraboloid reflection is used. Dual paraboloid reflections replace prefiltered cubemaps on certain platform (mostly Android) for performance reasons.
|
|
15664
15674
|
- ambientSH: if ambient spherical harmonics are used. Ambient SH replace prefiltered cubemap ambient on certain platform (mostly Android) for performance reasons.
|
|
15665
15675
|
- useSpecular: if any specular or reflections are needed at all.
|
|
15666
|
-
- rgbmAmbient: if ambient cubemap or spherical harmonics are RGBM-encoded.
|
|
15667
|
-
- hdrAmbient: if ambient cubemap or spherical harmonics are plain float HDR data.
|
|
15668
|
-
- rgbmReflection: if reflection cubemap or dual paraboloid are RGBM-encoded.
|
|
15669
|
-
- hdrReflection: if reflection cubemap or dual paraboloid are plain float HDR data.
|
|
15670
15676
|
- fixSeams: if cubemaps require seam fixing (see {@link Texture#options.fixCubemapSeams}).
|
|
15671
|
-
- prefilteredCubemap: if prefiltered cubemaps are used.
|
|
15672
15677
|
- emissiveFormat: how emissiveMap must be sampled. This value is based on {@link Texture#options.rgbm} and {@link Texture#options.format}. Possible values are:
|
|
15673
15678
|
- 0: sRGB texture
|
|
15674
15679
|
- 1: RGBM-encoded HDR texture
|
|
@@ -15684,11 +15689,13 @@ export class StandardMaterial extends Material {
|
|
|
15684
15689
|
- refraction: if refraction is used.
|
|
15685
15690
|
- skyboxIntensity: if reflected skybox intensity should be modulated.
|
|
15686
15691
|
- useCubeMapRotation: if cube map rotation is enabled.
|
|
15687
|
-
- useRightHandedCubeMap: if the cube map uses a right-handed coordinate system. The convention for pre-generated cubemaps is left-handed.
|
|
15688
|
-
- useTexCubeLod: if textureCubeLodEXT function should be used to read prefiltered cubemaps. Usually true of iOS, false on other devices due to quality/performance balance.
|
|
15689
15692
|
- useInstancing: if hardware instancing compatible shader should be generated. Transform is read from per-instance {@link VertexBuffer} instead of shader's uniforms.
|
|
15690
15693
|
- useMorphPosition: if morphing code should be generated to morph positions.
|
|
15691
15694
|
- useMorphNormal: if morphing code should be generated to morph normals.
|
|
15695
|
+
- reflectionSource: one of "envAtlas", "cubeMap", "sphereMap"
|
|
15696
|
+
- reflectionEncoding: one of null, "rgbm", "rgbe", "linear", "srgb"
|
|
15697
|
+
- ambientSource: one of "ambientSH", "envAtlas", "constant"
|
|
15698
|
+
- ambientEncoding: one of null, "rgbm", "rgbe", "linear", "srgb"
|
|
15692
15699
|
*/
|
|
15693
15700
|
onUpdateShader: callbacks.UpdateShader;
|
|
15694
15701
|
}
|
|
@@ -16531,16 +16538,12 @@ export class ForwardRenderer {
|
|
|
16531
16538
|
* @property exposure - The exposure value tweaks the overall brightness of
|
|
16532
16539
|
* the scene. Defaults to 1.
|
|
16533
16540
|
* @property skybox - The base cubemap texture used as the scene's skybox, if mip level is 0. Defaults to null.
|
|
16534
|
-
* @property skyboxPrefiltered128 - The prefiltered cubemap texture (size 128x128) used as the scene's skybox, if mip level 1. Defaults to null.
|
|
16535
|
-
* @property skyboxPrefiltered64 - The prefiltered cubemap texture (size 64x64) used as the scene's skybox, if mip level 2. Defaults to null.
|
|
16536
|
-
* @property skyboxPrefiltered32 - The prefiltered cubemap texture (size 32x32) used as the scene's skybox, if mip level 3. Defaults to null.
|
|
16537
|
-
* @property skyboxPrefiltered16 - The prefiltered cubemap texture (size 16x16) used as the scene's skybox, if mip level 4. Defaults to null.
|
|
16538
|
-
* @property skyboxPrefiltered8 - The prefiltered cubemap texture (size 8x8) used as the scene's skybox, if mip level 5. Defaults to null.
|
|
16539
|
-
* @property skyboxPrefiltered4 - The prefiltered cubemap texture (size 4x4) used as the scene's skybox, if mip level 6. Defaults to null.
|
|
16540
16541
|
* @property skyboxIntensity - Multiplier for skybox intensity. Defaults to 1.
|
|
16541
16542
|
* @property skyboxRotation - The rotation of the skybox to be displayed. Defaults to {@link Quat.IDENTITY}.
|
|
16542
16543
|
* @property skyboxMip - The mip level of the skybox to be displayed. Only valid
|
|
16543
16544
|
* for prefiltered cubemap skyboxes. Defaults to 0 (base level).
|
|
16545
|
+
* @property prefilteredCubemaps - Set of 6 prefiltered cubemaps.
|
|
16546
|
+
* @property envAtlas - The environment lighting atlas.
|
|
16544
16547
|
* @property lightmapSizeMultiplier - The lightmap resolution multiplier.
|
|
16545
16548
|
* Defaults to 1.
|
|
16546
16549
|
* @property lightmapMaxResolution - The maximum lightmap resolution. Defaults to
|
|
@@ -16645,30 +16648,6 @@ export class Scene extends EventHandler {
|
|
|
16645
16648
|
* The base cubemap texture used as the scene's skybox, if mip level is 0. Defaults to null.
|
|
16646
16649
|
*/
|
|
16647
16650
|
skybox: Texture;
|
|
16648
|
-
/**
|
|
16649
|
-
* The prefiltered cubemap texture (size 128x128) used as the scene's skybox, if mip level 1. Defaults to null.
|
|
16650
|
-
*/
|
|
16651
|
-
skyboxPrefiltered128: Texture;
|
|
16652
|
-
/**
|
|
16653
|
-
* The prefiltered cubemap texture (size 64x64) used as the scene's skybox, if mip level 2. Defaults to null.
|
|
16654
|
-
*/
|
|
16655
|
-
skyboxPrefiltered64: Texture;
|
|
16656
|
-
/**
|
|
16657
|
-
* The prefiltered cubemap texture (size 32x32) used as the scene's skybox, if mip level 3. Defaults to null.
|
|
16658
|
-
*/
|
|
16659
|
-
skyboxPrefiltered32: Texture;
|
|
16660
|
-
/**
|
|
16661
|
-
* The prefiltered cubemap texture (size 16x16) used as the scene's skybox, if mip level 4. Defaults to null.
|
|
16662
|
-
*/
|
|
16663
|
-
skyboxPrefiltered16: Texture;
|
|
16664
|
-
/**
|
|
16665
|
-
* The prefiltered cubemap texture (size 8x8) used as the scene's skybox, if mip level 5. Defaults to null.
|
|
16666
|
-
*/
|
|
16667
|
-
skyboxPrefiltered8: Texture;
|
|
16668
|
-
/**
|
|
16669
|
-
* The prefiltered cubemap texture (size 4x4) used as the scene's skybox, if mip level 6. Defaults to null.
|
|
16670
|
-
*/
|
|
16671
|
-
skyboxPrefiltered4: Texture;
|
|
16672
16651
|
/**
|
|
16673
16652
|
* Multiplier for skybox intensity. Defaults to 1.
|
|
16674
16653
|
*/
|
|
@@ -16682,6 +16661,14 @@ export class Scene extends EventHandler {
|
|
|
16682
16661
|
for prefiltered cubemap skyboxes. Defaults to 0 (base level).
|
|
16683
16662
|
*/
|
|
16684
16663
|
skyboxMip: number;
|
|
16664
|
+
/**
|
|
16665
|
+
* Set of 6 prefiltered cubemaps.
|
|
16666
|
+
*/
|
|
16667
|
+
prefilteredCubemaps: Texture[];
|
|
16668
|
+
/**
|
|
16669
|
+
* The environment lighting atlas.
|
|
16670
|
+
*/
|
|
16671
|
+
envAtlas: Texture;
|
|
16685
16672
|
/**
|
|
16686
16673
|
* The lightmap resolution multiplier.
|
|
16687
16674
|
Defaults to 1.
|