Releases: q5js/q5.js
v3.0 beta4
2.27.1
doubleClicked
, requestPointerLock
and exitPointerLock
, setOutputVolume
, and sound.onended
added.
q5 input event listeners are now all attached to the window, not the canvas element, besides 'wheel' events**. q5 input handler functions like mousePressed
can run even with HTML elements placed above the canvas, this enables users to add HTML based UI or CSS based post processing effects.
**Making the window level event listener for wheel events not passive would be necessary to be able to use e.preventDefault
but browsers warn that it's bad for performance.
q5's core system, that runs preload
, setup
, and initiates the draw
loop has been modified to allow for more flexibility regarding the timing of user sketch loading in global mode. User defined functions, besides preload
, are now wrapped with FES and added to q5 after preloading is finished.
v3.0 beta3
2.26.1
q5-webgpu: The saveCanvas
function now works in the middle of draw
or anywhere else (just like with the Canvas2D renderer). Previously saveCanvas
only let users save the previous frame if it had finished renderer, so it failed if you tried to save during the first draw call. Now it can finish rendering a frame and initiates rendering a new frame so additional drawing can occur after its used, but doesn't increase frameCount
.
2.26.0
After more extensive testing and improvements made to createGraphics
in q5 WebGPU, I got it mostly working but decided that it's probably best for it to be disabled by default. See issue #104 for more info.
storeItem
and other localStorage
functions didn't work when used in a sketch file loaded from a different domain, fixed that.
v3.0 beta2
2.25.1
createTextImage
and textImage
now support multi-line text!
Multi-line text and text images now vertically align properly when using the CENTER
("middle"
) and BOTTOM
settings.
q5 WebGPU: Fixed regression, graphics and images can now be saved.
2.25.0
The new entirely Promise based preload system is complete.
Q5.prototype.registerPreloadMethod
now calls _incrementPreload()
before calling the registered preload method.
Each load* function immediately returns an object by default when using q5's preload system. This object now has a property .promise
that can be awaited. Though this may be useful in specific cases, I recommend using the async load
function instead of this for typical file loading.
let q = await Q5.WebGPU();
// what's being loaded is unclear
await load('monospace');
// makes it clear that a font is being loaded
await loadFont('monospace').promise;
textCache
function (undocumented) was removed. Using textImage
or createTextImage
is now the only way to make text images. Editing the size of the cache is something I don't really expect anyone to need to do, but just in case I made it accessible on the q5 instance as _textCacheMaxSize
.
q5 WebGPU:
textWeight
implemented!load
now works with font family category names (like "monospace")saveCanvas
working again
v3.0 beta1
2.24.4
The preload system now uses Promise.all
behind the scenes.
Fixed frameRate
bug reported by @codingMASTER398. If called multiple times before setup
finished, it created multiple draw
loops.
2.24.3
q5-webgpu: blendMode
can now be used in draw
to switch blend modes.
2.24.2
Added jit
function
2.24.0
Version bump.
v3.0 beta0
2.23.14
Removed recently added functions randomX
and randomY
.
2.23.13
Refactored WebGPU fallback mode. q._c2d
is true when the c2d renderer is used, including in WebGPU fallback mode. q._webgpu
is true when using the webgpu renderer or WebGPU fallback mode.
2.23.12
Fixed error with using named colors and mouse positioning in WebGPU fallback mode.
2.23.11
Deleted the q5-ai.js module since it's been superseded by AI integrated directly into Chromium's dev console and also several online code editors. Users can get help directly in those environments, instead of having to click a link to navigate to a different page or get hints from a more extensive friendly error system like with p5.js.
Added a new friendly error system that simply shows users the line in their sketch file from which the error originates, since comprehending JS stack traces can be a point of friction for beginners.
Fixed regression with _isTouchAware
an internal prop used to check if the user defined touch functions. Somehow this included mouseReleased
and not touchEnded
, unit tests would catch these types of issues.
2.23.10
disablePreloadSystem()
changed to usePreloadSystem(false)
. In the future, when using p5 v2 with q5play, users will be able to set usePreloadSystem()
or simply define a preload
function to automatically use the preload system.
2.23.8
q5 WebGPU: fixed translate
which now works properly when x, y scaling is not 1.
2.23.7
Included _colorMode
, _colorFormat
, and Color
in pushStyles
and popStyles
.
WebGPU renderer improvements:
colorMode(RGB, 255)
now works- added
quadraticVertex
,bezierVertex
,curve
, andbezier
functions - stroke caps are now properly added to custom shapes
arc
rendered upside down, fixed this with proper y position calculations
p5 v2 API parity additions:
textWeight
function (only in C2D mode)lineMode(SIMPLE)
shim for existingstrokeJoin('none')
2.23.6
Updated docs and bug fixes.
2.23.0 (3.0 beta0)
Run Q5.WebGPU()
to start using the q5.js WebGPU renderer! It'll be officially released in v3.0.
v2.22
2.22.4
createGraphics
now accepts as a third parameter, a renderer constant C2D
or WEBGPU
.
For aesthetics you can now do createCanvas(200, 200, WEBGPU)
as well, but note that an instance of q5 webgpu must be created and loaded before a webgpu canvas can be created.
2.22.3
Audio recording capability added to q5-record. It works with the built-in q5-sound module and the p5.sound library!
2.22.2
colorMode
bug fixesloadFont
bug fixes
2.22.0
- updated color documentation
- support for HSL and HSB color modes #106
- q5 webgpu renderer now supports all of q5's color modes
- added gamut as third param to
colorMode
function - removed
askAI
as the default error handler, since Chrome and many online editors now integrate this feature in the dev console - previous frame can be used as a frame buffer in frame shaders if
myShader.applyBeforeDraw = true
, demo coming soon
v2.21
2.21.6
Added support for frame rates higher than the display rate.
For better organization, moved background
function from shapes module to canvas module for each of the renderers respectively.
webgpu: fixed regression that caused previous frames to be drawn with normal blending
2.21.1
Added support for custom shaders to q5 WebGPU.
https://q5js.org/learn/#shadersSection
v2.20
2.20.7
In q5 WebGPU, text can now have strokes.
2.20.0
Video can now be played on the webgpu canvas using importExternalTexture
. This functionality was added in q5-webgpu-image.js because the shader for video is nearly the same as the one for displaying images, and it uses the same vertex buffer.
createCapture
implemented in q5-dom.js
v2.19
2.19.4
q5-record recorder video quality can now be set by adjusting the video bitrate directly. A certain bitrate may be enough to capture a particular sketch at a "high" visual quality, but it may be far too low for another.
2.19.2
Implemented save
/saveCanvas
in q5 WebGPU #92
2.19.1
Implemented canvas drawing permanence and background
with alpha in q5 WebGPU #99
In q5 WebGPU images are just c2d images that get converted to gpu textures on load and modification.
Various bug fixes.
v2.18
2.18.2
q5-record added to q5.js! Big thanks to @Tezumie for his work on this.