# WebGPU frameworks for 2D graphics with BabylonJS

**URL:** <https://forum.babylonjs.com/t/webgpu-frameworks-for-2d-graphics-with-babylonjs/42307>\
**Category:** Questions\
**Created:** [July 10, 2023, 3:27pm UTC](https://forum.babylonjs.com/t/webgpu-frameworks-for-2d-graphics-with-babylonjs/42307 "2023-07-10T15:27:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gems](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gems/32/30552_2.png) [@gems](https://forum.babylonjs.com/u/gems)\
**Post date:** [July 10, 2023, 3:27pm UTC](https://forum.babylonjs.com/t/webgpu-frameworks-for-2d-graphics-with-babylonjs/42307/1 "2023-07-10T15:27:07Z")

</div>

Hello,

I’m looking for a way to integrate 2D graphics with BabylonJS - ideally some way to draw polygons, strokes and lines in 2D and share a texture into BabylonJS within WebGPU context.

Best I could see is Contrast Renderer, though this is for Rust (with Emscripten example):

> **[GitHub - Lichtso/contrast\_renderer: Contrast is a web-gpu based 2D render...](https://github.com/Lichtso/contrast_renderer)**
>
> Contrast is a web-gpu based 2D render engine written in Rust - GitHub - Lichtso/contrast\_renderer: Contrast is a web-gpu based 2D render engine written in Rust

And others I’ve been looking into are Fabric, PIXI - perhaps even an SVG lib (if there is an elegant way to get this into a texture).

Looking for suggestions or ideas!

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [July 10, 2023, 9:56pm UTC](https://forum.babylonjs.com/t/webgpu-frameworks-for-2d-graphics-with-babylonjs/42307/2 "2023-07-10T21:56:40Z")

</div>

You should be able to use their canvas element into an HtmlElementTexture within babylon ?

---

<div class="post-metadata">

**Author:** ![gems](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gems/32/30552_2.png) [@gems](https://forum.babylonjs.com/u/gems)\
**Post date:** [July 14, 2023, 2:28pm UTC](https://forum.babylonjs.com/t/webgpu-frameworks-for-2d-graphics-with-babylonjs/42307/3 "2023-07-14T14:28:23Z")

</div>

For sure, however it doesn’t have a JS interface (must be written in Rust) - perhaps makes sense to do this in Babylon with an orthographic camera
