Soundor
Web Runtime

Web Runtime 0.4.0

Release notes for Web Runtime 0.4.0.

All Web Runtime releases

3 changes — 3 features

Minor Changes

  • #94 d9df7bf Thanks @dm-balakin! - Canvas nodes and a 2D context. createCanvas() (and <Canvas> in @soundor/react) makes a node code draws on, with width/height and getContext('2d') as on the Web, plus the devicePixelRatio, ImageData and canvas globals. The JUCE runtime draws with Skia on the CPU: state and compositing, transforms, paths, line styles, gradients and patterns, text, drawImage and ImageData; what it does not draw yet (shadows, filters, Path2D) throws instead of drawing something else. The web runtime's canvas is a real <canvas>.

  • #97 b3c6eeb Thanks @dm-balakin! - Three.js's WebGLRenderer runs unmodified on Soundor's WebGL 2. The native tests cover it against the npm package, pinned. Nodes' styles can now be written one property at a time (node.style.width = 120, which is how Three's setSize() writes it), and lengths accept CSS pixels ('120px'), in both runtimes.

  • #95 8118dab Thanks @dm-balakin! - WebGL 2 on canvas nodes. getContext('webgl2') gives a WebGL2RenderingContext in both runtimes, typed from the Khronos IDL. The JUCE runtime runs it on the GPU through ANGLE's WebGL-compatible OpenGL ES 3.0 context, so calls are validated as in a browser. It returns null where there is no hardware GPU, and the log says why. What it draws is read back into the canvas for now. Texture uploads take arrays, ImageData and canvas nodes. getContext() now returns null for types other than '2d' and 'webgl2' in both runtimes, and the web runtime's contexts take canvas and image nodes wherever they take an image.

On this page