v2.4.0

playcanvas/enginev2.4.0Jan 15, 2025by mvaligursky

AI Summary

Implementation of Depth of Field, renaming of shader chunks, and migration of unit tests from Karma to Node.

Key Highlights

  • Depth of Field implementation using render passes
  • Shader chunk renaming (skinTex -> skin, skinBatchTex -> skinBatch)
  • Deprecation of WebGL1 based texture sampling names with _EXT
  • Migrated from Karma to Node for unit tests
  • Bun build support

Breaking Changes

  • A few shader chunks available to ShaderMaterial use their original names
  • Rename skinTex and skinBatchTex chunk names to skin and skinBatch
  • Deprecate WebGL1 based texture sampling names with _EXT

New Features

  • Basic XR navigation ESM script
  • GSplat support for 1 and 2 bands of SH
  • Shadow cascades can be cross-blended using dithering
  • PCSS softness improvements

Full Release Notes

## Breaking changes
* [BREAKING] A few shader chunks available to `ShaderMaterial` use their original names by @mvaligursky in https://github.com/playcanvas/engine/pull/7277
* [BREAKING] Rename `skinTex` and `skinBatchTex` chunk names to `skin` and `skinBatch` by @mvaligursky in https://github.com/playcanvas/engine/pull/7278
* [BREAKING] Deprecate WebGL1 based texture sampling names with `_EXT` by @mvaligursky in https://github.com/playcanvas/engine/pull/7221

## Other changes
* Depth of Field implementation using render passes by @mvaligursky in https://github.com/playcanvas/engine/pull/7210
* Small change to the default level of `blurLevel` for the HDR Bloom by @mvaligursky in https://github.com/playcanvas/engine/pull/7166
* Gsplat shader chunk updates by @slimbuck in https://github.com/playcanvas/engine/pull/7169
* Export internal `CameraShaderParams` class which is currently required by the Editor by @mvaligursky in https://github.com/playcanvas/engine/pull/7168
* Speed up gsplat sh packaging by @slimbuck in https://github.com/playcanvas/engine/pull/7170
* Add basic XR navigation ESM script by @willeastcott in https://github.com/playcanvas/engine/pull/7171
* Updated the way shaders include tonemapping chunks by @mvaligursky in https://github.com/playcanvas/engine/pull/7174 #7176
* Update to render passes - generate scene half sized texture by @mvaligursky in https://github.com/playcanvas/engine/pull/7175
* Further gsplat shader refinements by @slimbuck in https://github.com/playcanvas/engine/pull/7185
* Texture tracing log contains its pixel format by @mvaligursky in https://github.com/playcanvas/engine/pull/7190
* Clamp GS SH coefficients correctly by @slimbuck in https://github.com/playcanvas/engine/pull/7193
* Add skinning support to glTF exporter by @willeastcott in https://github.com/playcanvas/engine/pull/7197
* Hide component constructors by @willeastcott in https://github.com/playcanvas/engine/pull/7203
* Delete unused import by @willeastcott in https://github.com/playcanvas/engine/pull/7207
* Remove `CameraComponentSystem` `onUpdate` handler by @willeastcott in https://github.com/playcanvas/engine/pull/7208
* [Fix] Change gloss default value to 1 by @mvaligursky in https://github.com/playcanvas/engine/pull/7216
* Migrate `TextElement` tests from Karma to Node by @willeastcott in https://github.com/playcanvas/engine/pull/7217
* Migrate `ImageElement` tests from Karma to Node by @willeastcott in https://github.com/playcanvas/engine/pull/7219
* DOF support for WebGPU by @mvaligursky in https://github.com/playcanvas/engine/pull/7218
* Update NPM depenedencies by @willeastcott in https://github.com/playcanvas/engine/pull/7222
* DOF - near blur is optional by @mvaligursky in https://github.com/playcanvas/engine/pull/7220
* Switch to `node-canvas` for running unit tests by @willeastcott in https://github.com/playcanvas/engine/pull/7223
* Move unit test assets to a new folder by @willeastcott in https://github.com/playcanvas/engine/pull/7224
* Updated preprocessor to optionally remove defines from source by @mvaligursky in https://github.com/playcanvas/engine/pull/7226
* Minor refactor to unit tests by @willeastcott in https://github.com/playcanvas/engine/pull/7227
* Migrate `ScriptComponent` tests from Karma to Node by @willeastcott in https://github.com/playcanvas/engine/pull/7228
* Migrate `BundleRegistry` tests from Karma to Node by @willeastcott in https://github.com/playcanvas/engine/pull/7229
* Optimized shadow cascade matrix selector shader function by @mvaligursky in https://github.com/playcanvas/engine/pull/7230
* Tweak `jsdom` and server for unit tests by @willeastcott in https://github.com/playcanvas/engine/pull/7231
* Migrate `SpriteComponent` tests from Karma to Node by @willeastcott in https://github.com/playcanvas/engine/pull/7232
* Address PCSS softness by @GSterbrant in https://github.com/playcanvas/engine/pull/5483
* Shadow cascades can be cross-blended using dithering by @mvaligursky in https://github.com/playcanvas/engine/pull/7233
* Migrate `BundleHandler` tests from Karma to Node by @willeastcott in https://github.com/playcanvas/engine/pull/7235
* Migrate `Http` tests from Karma to Node by @willeastcott in https://github.com/playcanvas/engine/pull/7236
* [ImgBot] Optimize images by @imgbot in https://github.com/playcanvas/engine/pull/7225
* Migrate `ElementDragHelper` tests from Karma to Node by @willeastcott in https://github.com/playcanvas/engine/pull/7237
* Remove Karma by @willeastcott in https://github.com/playcanvas/engine/pull/7238
* Render pass tracing now logs values used to clear color/depth/stencil buffer by @mvaligursky in https://github.com/playcanvas/engine/pull/7239
* Bun build support by @kpal81xd in https://github.com/playcanvas/engine/pull/7242
* Handle NaNs in GSplat data by @slimbuck in https://github.com/playcanvas/engine/pull/7243
* Store PLY header comments by @slimbuck in https://github.com/playcanvas/engine/pull/7246
* Support 1 and 2 bands of SH in uncompressed gsplat data by @slimbuck in https://github.com/playcanvas/engine/pull/7248
* ESM Preload Fix by @marklundin in https://github.com/playcanvas/engine/pull/7161
* ESM Script clone fix by @marklundin in https://github.com/playcanvas/engine/pull/7251
* Use Dependabot to update NPM dependencies by @willeastcott in https://github.com/playcanvas/engine/pull/7254
* Migrate from Terser and Babel to SWC by @marklundin in https://github.com/playcanvas/engine/pull/6920
* Added DOF support to `CameraFrame` script by @mvaligursky in https://github.com/playcanvas/engine/pull/7272
* Add arrow key controls to `camera-controls.mjs` by @vincentwoo in https://github.com/playcanvas/engine/pull/7270
* Support chunks to be included by VS of `ShaderMaterial` by @mvaligursky in https://github.com/playcanvas/engine/pull/7276
* ESM First Person Controller by @kpal81xd in https://github.com/playcanvas/engine/pull/7252
* ESM Grid Mesh Script by @kpal81xd in https://github.com/playcanvas/engine/pull/7147
* `ShaderMaterial` shader generator - remove manually specified chunk includes by @mvaligursky in https://github.com/playcanvas/engine/pull/7279
* `ShaderMaterial` generator provides `GAMMA` and `TONEMAPPING` defines to VS by @mvaligursky in https://github.com/playcanvas/engine/pull/7280
* Remove obsolete deprecated functionality for `litShaderArgs` by @mvaligursky in https://github.com/playcanvas/engine/pull/7281
* Camera controls updates by @kpal81xd in https://github.com/playcanvas/engine/pull/7205

## Fixes
* [Fix] The material loading do not print validation warnings for few unsupported properties by @mvaligursky in https://github.com/playcanvas/engine/pull/7167
* [WebglGraphicsDevice] Catch and return async error in readTextureAsync by @liamdon in https://github.com/playcanvas/engine/pull/7173
* [Fix] Fix to just introduced tonemapping issue with HDR by @mvaligursky in https://github.com/playcanvas/engine/pull/7176
* [Fix] Exposed `PIXELFORMAT_R8` format for locking by @mvaligursky in https://github.com/playcanvas/engine/pull/7177 #7178
* Fix negative tonemapped values by @slimbuck in https://github.com/playcanvas/engine/pull/7179
* Fixes for gsplat spherical harmonics by @slimbuck in https://github.com/playcanvas/engine/pull/7182
* [Fix] Correctly handle VSM not being supported by clustered lighting by @mvaligursky in https://github.com/playcanvas/engine/pull/7184
* Shader fix by @slimbuck in https://github.com/playcanvas/engine/pull/7187
* Add missing early-out in gsplat shader by @slimbuck in https://github.com/playcanvas/engine/pull/7189
* [FIX] Allow sphere maps to work when an envAtlas is set by @willeastcott in https://github.com/playcanvas/engine/pull/7201
* [FIX] Correctly set texture dimensions from video source by @willeastcott in https://github.com/playcanvas/engine/pull/7200
* [FIX] Ensure enabled property is cloned for all components by @willeastcott in https://github.com/playcanvas/engine/pull/7199
* [FIX] Handle case where `pbrMetallicRoughness` is not present by @willeastcott in https://github.com/playcanvas/engine/pull/7198
* Minor refactor of `CameraComponent` by @willeastcott in https://github.com/playcanvas/engine/pull/7209
* Eliminate all imports in JSDoc blocks by @willeastcott in https://github.com/playcanvas/engine/pull/7212
* Delete unused unit test assets by @willeastcott in https://github.com/playcanvas/engine/pull/7213
* Migrate `AssetReference` tests from Karma to Node by @willeastcott in https://github.com/playcanvas/engine/pull/7214
* [Fix] HDR lightmap baking is working by @mvaligursky in https://github.com/playcanvas/engine/pull/7247
* Fix Apple Silicon Tests by @marklundin in https://github.com/playcanvas/engine/pull/7253
* [Fix] Remove PVRT texture formats with sRGB encoding as not supported on any platform by @mvaligursky in https://github.com/playcanvas/engine/pull/7256
* Expose PLY load progress by @slimbuck in https://github.com/playcanvas/engine/pull/7259
* Overhaul of directional PCSS shadows by @mvaligursky in https://github.com/playcanvas/engine/pull/7258
* Configure Renovate by @renovate in https://github.com/playcanvas/engine/pull/7260
* Migrate renovate config by @renovate in https://github.com/playcanvas/engine/pull/7264
* Renovate: Pin `devDependencies` by @willeastcott in https://github.com/playcanvas/engine/pull/7265
* Pin dependencies by @renovate in https://github.com/playcanvas/engine/pull/7263
* Update all npm dependencies by @renovate in https://github.com/playcanvas/engine/pull/7266
* Remove Dependabot by @willeastcott in https://github.com/playcanvas/engine/pull/7268
* Move renovate.json to .github folder by @willeastcott in https://github.com/playcanvas/engine/pull/7269
* Request new feature "float32-blendable" for WebGPU device by @mvaligursky in https://github.com/playcanvas/engine/pull/7271
* Added PCSS option to ShadowCascades example by @mvaligursky in https://github.com/playcanvas/engine/pull/7275
* [Fix] Fixes to an issue causing the fringing to be upside down when TAA is enabled on WebGPU by @mvaligursky in https://github.com/playcanvas/engine/pull/7274

## New Contributors
* @renovate made their first contribution in https://github.com/playcanvas/engine/pull/7260
* @vincentwoo made their first contribution in https://github.com/playcanvas/engine/pull/7270

**Full Changelog**: https://github.com/playcanvas/engine/compare/v2.3.3...v2.4.0