A
A
Asmodeyby2013-12-29 19:40:37
Canvas
Asmodeyby, 2013-12-29 19:40:37

Working with the image behind the canvas with WebGL

Hello. I study WebGl, in particular glsl shaders. Wrote a simple shader to blur an image. There were many tutorials on the web on this topic and it was not difficult to figure it out. The image that is specified in javascript is blurred. But if I want to blur what is behind the canvas on the page? Is it possible to do so? I understand that you need to render something into a texture and stretch this texture onto a rectangle that is in the canvas. But what should be used? Is it possible to write some kind of buffer into a texture and use it?
I'm not asking for ready-made solutions, I just would like to know if my idea is real and if so, how to implement it.
Thanks in advance, Denis.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2014-12-30
@Asmodeyby

In my opinion, this cannot be done. All rendering is done on the canvas element. For example, the wiki has the following "WebGL is the context of the HTML canvas element".

A
Asmodeyby, 2014-01-02
@Asmodeyby

Yes, without crutches, the plan cannot be done. The easiest way is to use this library and drive the image into the canvas. Thank you very much for the replies. If I manage to implement my plan, I'll post an example. Perhaps someone else will need this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question