patriciogonzalezvivo / glslEditor

Simple WebGL Fragment Shader Editor

Home Page:http://editor.thebookofshaders.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update to new buffer copy - much faster now!

Atair1 opened this issue · comments

commented

Edit: Sorry this was meant for the Blender glsl plugin.. i clicked on the wrong repo before writing the comment!!

Hi, i never got into github, so i am not familiar with making suggestions the proper way..
What i cam here to say:
there is a newer approach to copy data from buffers: https://developer.blender.org/D7053

basically changing lines 194, 195, 196 to:

buffer = bgl.Buffer(bgl.GL_FLOAT, self.width * self.height * 4)
bgl.glReadBuffer(bgl.GL_BACK)
bgl.glReadPixels(0, 0, self.width, self.height, bgl.GL_RGBA, bgl.GL_FLOAT, buffer)

and 207 to:
image.pixels.foreach_set(buffer)

makes everything much faster..