Skip to content

v2.2

Compare
Choose a tag to compare
@quinton-ashley quinton-ashley released this 05 Sep 15:05
· 125 commits to main since this release

v2.2.4

Removed the q5-q2d.js and q5-q2d.min.js files. I don't think it's necessary to maintain two separate bundles for q5, since the default bundle file size is so small anyway. If anyone just wants to use the q2d renderer only, they can load from the src folder or make their own bundle.

Implemented Vector.setHeading and Vector.slerp #60

Fix for #69

v2.2.3

Q5.webgpu() should be run at the bottom* of sketch files (not the top), otherwise variables might not be initialized before setup is run.

Bug fix for float color format conversion in color function.

Bug fix for clear and background which are no longer affected by transformations.

v2.2.2

It's now easier to use q5's WebGPU mode, simply run Q5.webgpu() at the bottom of your sketch!

v2.2.1

q5.js now contains the webgpu and q2d renderers as part of the default bundle.

v2.2.0

Added transformations (scaling, rotation, translation) and blendMode support to the webgpu renderer!

Demo: https://aijs.io/editor?user=quinton-ashley&project=q5-webgpu_transformations

Also, the sketches you create with the q5-webgpu renderer will still display properly if WebGPU is not supported on a viewer's browser!

In that case, q5 will put a warning in the console and fall back to the q2d renderer. A compatibility layer is applied which sets the color mode to "rgba" in float format and translates the origin to the center of the canvas on every frame. For now, be sure to set noStroke in your setup code and clear the canvas at the start of your draw function to match current q5 webgpu limitations.

Changes:

  • webgpu: color function fully works with the default rgba float format

Internal changes:

  • q2d: clear function moved to the q2d-canvas module, so even if q2d-drawing is not loaded, the canvas can be cleared
  • q2d: rectangles with rounded corners are now drawn using ctx.roundRect()
  • webgpu: scaling from pixels to normalized coordinates is now done in the vertex shader after transformations are applied