Save Current "render" as SVG

Hello my fellow PlayCanvas Developers!

I was wondering, if it’s possible to export the currently rendered scene from the camera which is displayed in the canvas. As an SVG. I’ve seen, that there are libraries online where you have to “intercept” the draw method and draw into an SVG aswell. Is it possbile to do this in PlayCanvas? I’ve seen examples on here to output a .png file (even tough the image wasn’t updated according to the camera view).

Has anyone got any ideas on this ?

Thanks in advance!

Unlikely as it is all rasterized. Why do you need SVG?

Hmm Okay. Just wondering if it’s possible, because it would be great with A a transparent Canvas and B because SVG scale great and you could therefore use them for advertising etc.

Can you give an example? Use the SVG as advertisement? Could someone just use the WebGL canvas instead and change the size of it? Even if it was possible, wouldn’t the resolution of textures be a factor as they are rasterised images?

Can you give an example? Use the SVG as advertisement? Could someone just use the WebGL canvas instead and change the size of it? Even if it was possible, wouldn’t the resolution of textures be a factor as they are rasterised images?

Well an Example would be, that let’s say you have a cool model embedded on a website with playCanvas. The Model may represent some process of your company, but you don’t actually have other pictures of it and want it to be represented 1:1 as on your website. Would be cool if you could export an SVG on the transparent canvas of the current state, and then use it to paste into a prospect of products or something. I was just wondering if it would work because a friend asked me if it was possible. But it may be satisfactory to just print a .PNG of the currently rendered object as long as transparency is guaranteed.

The scaling part of the SVG doesn’t seem to apply here and as mentioned above, the textures used will be a limiting factor here as they are a set size. You can only scale up so much before they become upscaled. A PNG with a transparent background should be possible here with a max size of 2K (maybe 4K on some devices).