Another small release! A few bug fixes and some enhancements to materials!
water-material.mp4
Materials
2 new uniforms
u_screen_texture
- This is the texture of the screen right before the material draw callu_time_ms
- This is the milliseconds since page navigation (performance.now()
under the hood)
2 new attribute/varyings
a_screenuv
- The vertex attribute corresponding to the screen uv relative to the current graphicv_screenuv
- The fragment varying corresponding to the screen uv relative to the current graphic
Finally there is a new convenience api for updating shader values in materials. .update(shader => {...})
game.input.pointers.primary.on('move', evt => {
heartActor.pos = evt.worldPos;
swirlMaterial.update(shader => {
shader.trySetUniformFloatVector('iMouse', evt.worldPos);
});
});
What's Changed
- feat: Materials can now use the screen texture by @eonarheim in #2849
- fix: Adjust font cache to prevent downward spiral on mobile by @eonarheim in #2850
- fix: #2848 Sprite tint respected in constructor by @eonarheim in #2852
- fix: TileMap packing + TileMap debug draw configurable by @eonarheim in #2851
Full Changelog: v0.28.3...v0.28.4