What's Changed
This release breaks most lit/frag chunks. Most of these chunks have had their signatures changed to accept the various values they need, instead of relying on globals. With that said, most globals are still set in the shader. An example of this change is:
vec3 combineColor() {
vec3 ret = vec3(0);
ret = dAlbedo * dDiffuseLight;
...
}
Is now expressed:
vec3 combineColor(vec3 albedo, vec3 sheenSpecularity, float clearcoatSpecularity) {
vec3 ret = vec3(0);
ret = albedo * dDiffuseLight;
...
}
The affected chunks are documented here: https://dev-developer.playcanvas.com/en/user-manual/graphics/shader-chunk-migrations/#engine-v162
Breaking changes
- Further separation of frontend and backend shaders by @GSterbrant in #5104
- Implementation of BlendState by @mvaligursky in #5083
- DepthState implementation for WebGL and WebGPU by @mvaligursky in #5150
- Updates to Plane’s class constructor, to take a distance instead of a point by @mvaligursky in #5196
New features
- Function RenderPass.execute is now optional by @mvaligursky in #5100
- Extended GamePad support by @MushAsterion in #5044
- Added Debug.gpuError to log out gpu validation errors in debug mode by @mvaligursky in #5110
- Added couple of additional GPU markers to forward renderer by @mvaligursky in #5111
- WebGPU support to shadow atlas (shadow cascades + clustered shadows) by @mvaligursky in #5118
- Exposed MeshInstance.castShadow by @mvaligursky in #5130
- Updated mesh batching to support triangle strips used by UI system by @mvaligursky in #5132
- WebGPU clear renderer, allowing render target clear using a quad rendering by @mvaligursky in #5128
- Precision of MorphTarget data can be specified by @mvaligursky in #5138
- Examples working on WebGPU device are enabled to use it in Examples Browser by @mvaligursky in #5151
- Quat: add the setFromDirections method and tests for it by @querielo in #5145
- WebGPU Render pipeline validation in debug mode by @mvaligursky in #5173
- Parse models asynchronously by @slimbuck in #5078
- Simple planar-renderer script to render planar reflections by @mvaligursky in #5186
- Change
raycastAll
sorting default tofalse
by @MushAsterion in #5181 - Implements results filtering for
raycastAll
andraycastFirst
by @MushAsterion in #5180 - Add
RaycastResult
sorting onRigidBodyComponentSystem#raycastAll
by @MushAsterion in #5179
Fixes
- Convert local light shadow rendering to use render passes by @mvaligursky in #5103
- Optimize the handling of cull state for negatively scaled world transforms by @mvaligursky in #5204
- Update obj parser by @slimbuck in #5200
- Enabled BlendTrees1D on WebGPU as working now by @mvaligursky in #5195
- Add specular occlusion to sheen. by @GSterbrant in #5119
- Alpha test fix by @slimbuck in #5126
- Small optimizations to the way target textures are constructed in Morph by @mvaligursky in #5134
- Optimization to Morph.aabb calculation by @mvaligursky in #5137
- Lazily evaluate disjoint timer extension by @mvaligursky in #5139
- Optimize morph target animation creation from glb data by @mvaligursky in #5140
- Updated tint wasm compiler to up to date version by @mvaligursky in #5141
- WebGPU renderer handles canvas size change by @mvaligursky in #5148
- Support empty AnimTracks by @ellthompson in #5112
- Fix for blend tree animations by @ellthompson in #5155
- Optimized GPU cost if zero clustered lights by @mvaligursky in #5131
- WebGPU - fix rendering with single-sampled framebuffer by @mvaligursky in #5164
- Deprecate
StandardMaterial#shininess
by @willeastcott in #5166 - Http arrayBuffer fix by @slimbuck in #5165
- Correctly handle absolute URLs in gltf by @slimbuck in #5169
- Outline post effect shader uses textureLod to avoid non-uniform sampling in a branch by @mvaligursky in #5171
- Sample shadow maps using LOD instruction on WebGPU by @mvaligursky in #5174
- Workaround for 8bit GLB index buffers not supported on WebGPU by @mvaligursky in #5175
- Unloaded animation assignment fix by @ellthompson in #5172
- Small optimization of BoundingBox.computeMinMax by @mvaligursky in #5177
- Don’t include code using vertex_tangent unless needed by @mvaligursky in #5176
- Improved error logging when using current render target as texture by @mvaligursky in #5182
- Clamp shadow distance to camera far plane by @slimbuck in #5183
- Remove VSM blur weights restriction by @slimbuck in #5184
- Improved handling of features and limit for WebGPU by @mvaligursky in #5188
- Set default value for twoSidedLightingNegScaleFactor as renderer does not always set it by @mvaligursky in #5189
- Fix to the way WebGPU device handles render target resizing by @mvaligursky in #5193
- Addition of private helper debug only function to help guard against destroyed objects being used. by @mvaligursky in #5194
- Output types for extras module build by @slimbuck in #5197
- Removed setting material.blend as not needed by ParticleEmitter by @mvaligursky in #5120
Examples
- Anim engine examples updated to work on WebGPU by @mvaligursky in #5203
- Updated LightsBaked engine example to bake specular (direction) as well by @mvaligursky in #5202
- Few engine examples in the loaders section enabled on WebGPU by @mvaligursky in #5198
- Small fixes in examples to avoid debug errors / warnings by @mvaligursky in #5129
- Support device type switching by @ellthompson in #5147
- Dropped number of chairs in the Compound Collision example by @mvaligursky in #5149
- Mini stats fix by @ellthompson in #5156
- Enabled multiple examples for WebGPU by @mvaligursky in #5158
- Fixes and workarounds to bring multiple examples to work on WebGPU by @mvaligursky in #5170
Full Changelog: v1.61.3...v1.62.0