I tried some WebGL technology before such as three js and pixi js. When I learned WebGL technology, I found shader which made me really fascinated. But WebGL can only be rendered on the canvas not the the HTML DOM. Then I kind of wonder if I could render that to the actual HTML DOM. I know that CSS Custom Filter can do such thing, but for the time being, Its not available yet on the modern browser. So I searched for another alternative, and then I found SVG Filter that I think could do almost close to what CSS Custom Filter does. But I've never used SVG filter before, so first of all, how to use SVG Filter and I wonder if I could apply some shader to it ?
-
w3.org/Graphics/SVG/IG/resources/svgprimer.html#filters to use shaders you'd need to create your SVG as an image, copy that image to a canvas and then do shading on the canvas.– Robert LongsonJan 24 at 13:05
-
Thank you for the answer @RobertLongson, I know that would work, but that's not what I'm looking for to do. So my question is Can we use SVG Filter on the div element on the HTML, instead of the canvas ?– Reynald LamuryJan 24 at 13:14
-
In some browsers you can, yes.– Robert LongsonJan 24 at 13:15
-
1developer.mozilla.org/en-US/docs/Web/SVG/…– Robert LongsonJan 24 at 13:17
-
But can we apply shader to it ? that would be very nice– Reynald LamuryJan 24 at 13:23
|
Show 1 more comment