Will TSL work with SVGRenderer?


I’m just wondering if TSL will ever work with SVGRenderer? Or will this always be the case per the docs:

There are, however, some important limitations with SVGRenderer:

  • No advanced shading
  • No texture support
  • No shadow support

Also another quick question, has anyone ever gotten InstancedMesh to work with SVGRenderer? I’ve only ever gotten a blank screen.

In terms of interactivity / actual shader calculations? Unlikely. SVGRenderer calculates absolutely everything on the CPU, there’s no shaders used there.

It technically could do the SVG style calculations based on TSL, which could be fun to implement TSL on CPU, but the amount of work and maintenance required to up-keep it may likely make it not worth it.

Alternatively, someone could write a proposal to generate SVG fill-images on the GPU, which would make TSL / textures / actual materials work in SVGRenderer, but the complexity once again may go through the roof :eyes:

1 Like

Thanks for the info. Have you ever had any joy with InstancedMesh and SVGRenderer if you don’t mind me tacking on another question? I’ve had no joy myself. Curious if it’s also not possible.

There would be little or no performance benefit to using InstancedMesh in SVG, because SVG does not have the concept of GPU instancing like WebGL or WebGPU. Someone would need to volunteer to implement this in SVGRenderer, and probably no one has yet for that reason. I think PRs would be welcome, but it’s not on any roadmap otherwise.

1 Like

Thanks for the additional info, Don. My questions come from a more niche usage of three.js with SVGRenderer, which is with a pen plotter. I’ve been experimenting the past several months and was wondering if I could push further with both TSL and InstancedMesh.

Btw, I’ve loved your recent blog posts, especially Emission and Bloom. Learned a lot. Thank you.

1 Like