v2.6.0

playcanvas/enginev2.6.0Mar 19, 2025by mvaligursky

AI Summary

A major release featuring a comprehensive refactoring of the shader generation system to be define-driven and the migration of several shaders to native WGSL for WebGPU.

Key Highlights

  • Internal shader chunks have changed (breaking change potential)
  • Define-driven lighting and shader generation
  • Skybox, Ministats, and Reproject texture shaders now use native WGSL
  • Visibility conditions added for post-processing effects (SSAO, Bloom, etc.)
  • Configurable order for mesh rendering

Breaking Changes

  • Internal shader chunks have changed, this could be a breaking change if you have overwritten those.

New Features

  • Visibility conditions for SSAO, Bloom, Grading, Vignette, and Fringing
  • Configurable order for mesh rendering
  • Vogel spiral in the sampling method of PCSS for directional light

Full Release Notes

## Breaking changes
- some internal [shader chunks have changed](https://developer.playcanvas.com/user-manual/graphics/shader-chunk-migrations/#engine-v26), this could be a breaking change for you if you have overwritten those.

## Changes
* More configurable order for mesh rendering by @mvaligursky in https://github.com/playcanvas/engine/pull/7422
* Skybox shaders on WebGPU use native WGSL chunks by @mvaligursky in https://github.com/playcanvas/engine/pull/7343
* Refactor fragment shader generation of lit-material for few passes  by @mvaligursky in https://github.com/playcanvas/engine/pull/7344
* Processor handles loop of includes by @mvaligursky in https://github.com/playcanvas/engine/pull/7346
* Add visibility conditions for SSAO, Bloom, Grading, Vignette, Fringin… by @marklundin in https://github.com/playcanvas/engine/pull/7347
* Preprocessor handles || and && in the expressions by @mvaligursky in https://github.com/playcanvas/engine/pull/7350
* Immediate line rendering on WebGPU uses native WGSL shader by @mvaligursky in https://github.com/playcanvas/engine/pull/7355
* Ministats rendering shader uses WGSL on WebGPU by @mvaligursky in https://github.com/playcanvas/engine/pull/7356
* Changes canvas to optional dependency by @kpal81xd in https://github.com/playcanvas/engine/pull/7358
* OutlineRenderer meshInstances null check by @kpal81xd in https://github.com/playcanvas/engine/pull/7360
* Partially refactored the lighting / shadowing part of the lit-shader generation by @mvaligursky in https://github.com/playcanvas/engine/pull/7352
* Moved zero render target checked to a better place by @mvaligursky in https://github.com/playcanvas/engine/pull/7354
* Avoid using __ in defines to avoid GLSL warning by @mvaligursky in https://github.com/playcanvas/engine/pull/7373
* Shader allocation tracing now logs the language used (GLSL / WGSL) by @mvaligursky in https://github.com/playcanvas/engine/pull/7376
* Improvements to Preprocessor - spaces after #else, comments in #include blocks by @mvaligursky in https://github.com/playcanvas/engine/pull/7377
* Use a Vogel spiral in the sampling method of PCSS for directional light by @querielo in https://github.com/playcanvas/engine/pull/7371
* Lit/Standard material vertex shader is now a chunk driven by defines by @mvaligursky in https://github.com/playcanvas/engine/pull/7381
* A step towards converting lit-shader fragment generator to be define driven by @mvaligursky in https://github.com/playcanvas/engine/pull/7385
* Adjusted syntax of variables the preprocessor uses for injection by @mvaligursky in https://github.com/playcanvas/engine/pull/7386
* Futher refactoring of fragment part of the lit-shader by @mvaligursky in https://github.com/playcanvas/engine/pull/7387
* Refactor the way lit-shader integrates lightmapping by @mvaligursky in https://github.com/playcanvas/engine/pull/7388
* Refactoring of TBN shader part of lit-shader by @mvaligursky in https://github.com/playcanvas/engine/pull/7389
* LitShader generator refactoring - the main is a single string now by @mvaligursky in https://github.com/playcanvas/engine/pull/7390
* Further litShader refactoring by @mvaligursky in https://github.com/playcanvas/engine/pull/7393
* Update to the way we strip unused MRT outputs by @mvaligursky in https://github.com/playcanvas/engine/pull/7395
* Further lit-shader refactoring by @mvaligursky in https://github.com/playcanvas/engine/pull/7396
* Refactoring fo envMultiply and envConst chunks by @mvaligursky in https://github.com/playcanvas/engine/pull/7399
* Refactor specular occlusions shader chunks by @mvaligursky in https://github.com/playcanvas/engine/pull/7400
* Refactor reflection-source related chunk and code by @mvaligursky in https://github.com/playcanvas/engine/pull/7401
* Refactor of lit-shader generator, mostly related to the ambient lighting by @mvaligursky in https://github.com/playcanvas/engine/pull/7408
* Preprocessor reports errors in mismatched #ifdef #endif by @mvaligursky in https://github.com/playcanvas/engine/pull/7409
* Refactoring the lighting code from lit-shader to defines driven chunks by @mvaligursky in https://github.com/playcanvas/engine/pull/7414
* Finalizing the lit-shader refactoring by moving shader code to chunks by @mvaligursky in https://github.com/playcanvas/engine/pull/7416
* Pin dependencies by @renovate in https://github.com/playcanvas/engine/pull/7419
* Update all npm dependencies by @renovate in https://github.com/playcanvas/engine/pull/7420
* Refactor new and existing internal lighting related chunks to avoid globals by @mvaligursky in https://github.com/playcanvas/engine/pull/7418
* Update dependency node to v22 by @renovate in https://github.com/playcanvas/engine/pull/7423
* Improved code formatting of defines for reproject texture shader by @mvaligursky in https://github.com/playcanvas/engine/pull/7428
* Outline renderer prepares even disabled entities  by @mvaligursky in https://github.com/playcanvas/engine/pull/7427
* Small refactor of internal reproject code / shader by @mvaligursky in https://github.com/playcanvas/engine/pull/7429
* Validate shader vertex attributes are available in vertex buffers by @mvaligursky in https://github.com/playcanvas/engine/pull/7431
* Reproject texture functionality uses native WGSL shaders on WebGPU by @mvaligursky in https://github.com/playcanvas/engine/pull/7434
* Improved WebGPU error reporting, main focus on shader compilation issues by @mvaligursky in https://github.com/playcanvas/engine/pull/7435
* When the light uses unsupported shadow type, remap it to PCF3 by @mvaligursky in https://github.com/playcanvas/engine/pull/7441
* Use less memory loading compressed.ply by @slimbuck in https://github.com/playcanvas/engine/pull/7442
* Small internal refactor of ShaderProcessor by @mvaligursky in https://github.com/playcanvas/engine/pull/7446
* Convert internal morph target blending shader to WGSL on WebGPU by @mvaligursky in https://github.com/playcanvas/engine/pull/7445
* GS sorter speedup by @slimbuck in https://github.com/playcanvas/engine/pull/7447
* Improved validation of vertex attributes required by the shader by @mvaligursky in https://github.com/playcanvas/engine/pull/7448

## Fixes
* Image Element mask fix by @kpal81xd in https://github.com/playcanvas/engine/pull/7341
* [Fix] Fixes to processing WGSL shader by @mvaligursky in https://github.com/playcanvas/engine/pull/7342
* [Fix] Generate valid shader when multiple lights with cascades are used at the same time by @mvaligursky in https://github.com/playcanvas/engine/pull/7369
* [Fix] Fixed incorrect 2D texture array setup with compressed format by @mvaligursky in https://github.com/playcanvas/engine/pull/7372
* ensure postrender callback is cleaned up in outline renderer by @MAG-AdrianMeredith in https://github.com/playcanvas/engine/pull/7367
* [Fix] Fix to texture upload issue on WebGPU by @mvaligursky in https://github.com/playcanvas/engine/pull/7375
* Fixed grid enabled/disabled by @kpal81xd in https://github.com/playcanvas/engine/pull/7374
* Fix gsplat blending by @slimbuck in https://github.com/playcanvas/engine/pull/7379
* Fix gsplat rounding issues by @slimbuck in https://github.com/playcanvas/engine/pull/7380
* Fix gsplat discoloration by @slimbuck in https://github.com/playcanvas/engine/pull/7383
* Grid render component fix by @kpal81xd in https://github.com/playcanvas/engine/pull/7384
* [Fix] Create a dummy framebuffer on NullDevice to avoid undefined access by @mvaligursky in https://github.com/playcanvas/engine/pull/7382
* [Fix] StandardMaterial.useTonemap parameter is no longer ignored by @mvaligursky in https://github.com/playcanvas/engine/pull/7405
* [Fix] Fix reversed face culling when rendering shadows on WebGPU by @mvaligursky in https://github.com/playcanvas/engine/pull/7407
* Gsplat viewport size fix by @slimbuck in https://github.com/playcanvas/engine/pull/7425
* Fix to Lightmapper’s ambient baking when clustered lighting is enabled by @mvaligursky in https://github.com/playcanvas/engine/pull/7433
* Fixes to VSM shadow sampling by @mvaligursky in https://github.com/playcanvas/engine/pull/7436
* [FIX] Allow `GSplatComponent#clone` to handle null instance by @willeastcott in https://github.com/playcanvas/engine/pull/7437
* [Fix] Dummy texture used by the default Sprite material uses sRGB format by @mvaligursky in https://github.com/playcanvas/engine/pull/7440
* Fix for recent change by @slimbuck in https://github.com/playcanvas/engine/pull/7443
* [Fix] NullGraphicsDevice initializes device caps by @mvaligursky in https://github.com/playcanvas/engine/pull/7444
* [FIX] Ensure base URL is correctly when origin is null by @marklundin in https://github.com/playcanvas/engine/pull/7439

## Examples
* Shadow catcher shader support + script + example by @mvaligursky in https://github.com/playcanvas/engine/pull/7426
* 9-Sliced UI rendering engine example + related shader fix by @mvaligursky in https://github.com/playcanvas/engine/pull/7391
* Examples disable user selection by @kpal81xd in https://github.com/playcanvas/engine/pull/7362
* Pin monaco version to 0.33.0 by @kpal81xd in https://github.com/playcanvas/engine/pull/7424
* Gizmo doc example update by @kpal81xd in https://github.com/playcanvas/engine/pull/7432
* Moved ShaderCompile example to test folder by @mvaligursky in https://github.com/playcanvas/engine/pull/7449
* Updated HDR example to not allow control for UI tonemapping by @mvaligursky in https://github.com/playcanvas/engine/pull/7452


**Full Changelog**: https://github.com/playcanvas/engine/compare/v2.5.2...v2.6.0