Web Runtime 0.4.0
Release notes for Web Runtime 0.4.0.
3 changes — 3 features
Minor Changes
-
#94
d9df7bfThanks @dm-balakin! - Canvas nodes and a 2D context.createCanvas()(and<Canvas>in@soundor/react) makes a node code draws on, withwidth/heightandgetContext('2d')as on the Web, plus thedevicePixelRatio,ImageDataand canvas globals. The JUCE runtime draws with Skia on the CPU: state and compositing, transforms, paths, line styles, gradients and patterns, text,drawImageandImageData; 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
b3c6eebThanks @dm-balakin! - Three.js'sWebGLRendererruns 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'ssetSize()writes it), and lengths accept CSS pixels ('120px'), in both runtimes. -
#95
8118dabThanks @dm-balakin! - WebGL 2 on canvas nodes.getContext('webgl2')gives aWebGL2RenderingContextin 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,ImageDataand 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.