Closed kirill-konshin closed 3 years ago
So this is just the way that frame buffers work (or any typed array) - you can't change their length at will like with a javascript array. So the current approach OGL takes is to mimic the WebGL API in that users must re-create a RenderTarget upon resize.
A good example of this can be found in the Post extra class: https://github.com/oframe/ogl/blob/master/src/extras/Post.js#L79-L80
Makes sense, thank you for the answer. That's pretty much exactly how I solved it, by creating new targets in resize method.
Currently looks like the values of width and height, provided to
RenderTarget
, are permanently bound to textures etc., which requires to re-create theRenderTarget
if originalgl.canvas.width
has changed.It would be great if there'd be some API to resize the
RenderTarget
.