-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebGL #1629
Comments
I believe this is out of the scope for Deno... we do not need to implement every library in core, but you can make one and PR a link in registry |
Not out of scope. I want to support WebGL in core. But i won't be ready to start this for many months. |
@kyranet It needs native bindings, you can't use OpenCL/CUDA in JS 😆 |
I assume this would slowly lead to a native implementation of And sorry about my previous message, I wasn't very sure of what @sh7dm meant with GPGPU 👍 |
The plan is to use Angle: https://cs.chromium.org/chromium/src/third_party/angle/BUILD.gn following the example of https://github.com/stackgl/headless-gl |
@ry it renders its output to file? |
@sh7dm rendering to an image is one option. But you can also create a window with Angle, as seen in this example: https://cs.chromium.org/chromium/src/third_party/angle/samples/WindowTest/WindowTest.cpp?g=0 |
Although still not a standard, webgpu is also an interesting choice. |
@quininer interesting |
I'd love to see this happen! I've been building a TypeScript UI framework on top of Skia (via CanvasKit) and Aurelia vNext. It's still early, but very promising (think of it as a competitor to Flutter, but heavily inspired by WPF). I had hoped, as a phase two, to look into trying to convince the Deno team to surface WebGL APIs and a mechanism to create platform windows. I think there's a compelling set of scenarios here for building cross-platform games and GUIs without HTML/CSS being involved, and with a stronger, capabilities-based security model. Sadly, I wouldn't say that I have the experience required to make this contribution to Deno myself, but I'd love to be involved in providing use cases and helping to prove out what Deno ends up supporting. I'm also happy to act as a liaison to the Skia folks, as I think having CanvasKit enabled for Deno, independent of my own work, is a very powerful enabler. I could also help coordinate with other popular libraries, such as Pixi.js and Babylon.js. My open source team has some presence in those communities and I think it's to all our benefit to collaborate and try to make this happen. Thanks for all the awesome work that's going on here. Keep it up Deno team! |
I will have a try to implement a minimal demo with https://github.com/rust-skia/rust-skia and https://github.com/pcwalton/surfman when I had time. |
aside: rust-skia looks like a good candidate to use https://github.com/denoland/cargo_gn |
Instead of supporting WebGL directly in core (or at least in addition to), it might make more sense to consider WebGPU. I realize it is early in the process for such things but we are already on the bleeding edge for several other things like WASM ESM, etc. and there is already wgpu, a rust implementation we might be able to bring in via cargo. |
Considering WebGPU, I'm working on bindings to wgpu-rs following the WebGPU IDL interface as a Deno plugin. |
@maierfelix has been made a webgpu-node implementation based on Google's Dawn working with Nodejs, and even made ray-tracing extension works!!. better integrate his excellent work And more importantly, enabling webgpu based tensorflow.js |
@mko-io I would prefer the webgpu rust implementation since deno is also written in rust. |
I think glow would be the right way support WebGL |
Are there still plans to implement WebGL considering WebGPU has landed already? |
WebGL can technically be polyfilled using webgpu, but that's quite the task, but i think that would be the best solution, as we wouldn't need to depend on a second graphics api |
I'm going to close this. We have WebGPU now, which is going to be capable of everything WebGL is. There is no point in implementing both APIs (like fetch and XXLHttpRequest). |
Do you have any good idea about "WebGL polyfill over WebGPU"? I am interested in such a thing. WebGL need a canvas for create context, and the corresponding thing in deno is // modified from https://deno.com/blog/v1.40#webgpu-windowing--bring-your-own-window
import {
EventType,
WindowBuilder,
} from "https://deno.land/x/sdl2@0.8.0/mod.ts";
const win = new WindowBuilder("Hello, World!", 800, 600).build();
/* Returns a Deno.UnsafeWindowSurface */
const surface = win.windowSurface();
/* Returns a WebGL WebGLRenderingContext */
const gl = surface.getContext("webgl");
gl.Clear(gl.COLOR_BUFFER_BIT); Is this good? |
Idea: create a GPGPU library or even standart functions for Deno.
The text was updated successfully, but these errors were encountered: