Hi, 
if you feel adventurous, you can try to use my OpenGL packages for this.
In a few days, this might even be a pleasant experience!

Here is how you would do this, right now:
https://gist.github.com/SimonDanisch/98aee37ddb76279cf774
still very messy, but this will ultimately be reduced to something like:

imgdata = texture([Vector4(0f0) for x=1:w, y=1:h])
gldisplay(imgdata)
#when you want to update:
imgdata[1:end,1:end] = [Vector4(float32(x/w), float32(y/h), 0f0, 1f0) for 
x=1:w, y=1:h]

*These are the packages you need( I hope)*

Pkg.add("Meshes")
Pkg.add("Images")

Pkg.add("ImmutableArrays")

Pkg.add("React")
Pkg.add("GLFW")
Pkg.clone("https://github.com/SimonDanisch/GLUtil.jl.git";)
Pkg.clone("https://github.com/SimonDanisch/ModernGL.jl.git";)
Pkg.clone("https://github.com/SimonDanisch/GLWindow.jl.git";)


If you need ultimate performance and feel even more adventurous, you can try to 
implement your code in the shader.
Just change the shader to:

const fsh = """
in vec2 uv;
uniform sampler2D image;

uniform float customparam1; // if you need attributes from julia, put them here
uniform vec3 customparam2; // you can simply upload them like the texture in 
the render object
out vec4 fragment_color;
void main() {
        fragment_color = vec4(uv, 0, 1); //uv is already x/w, y/h
}
"""

You upload the custom params like this:

const fullscreenquad = RenderObject(
    [
        :position     => GLBuffer(GLfloat[-1,-1, -1,1, 1,1, 1,1, 1,-1, 
-1,-1], 2), 
        :image         => image,
        :customparm1 => 1.0f0,

    ], GLProgram(vsh, fsh, "vertexshader", "fragmentshader"))

Reply via email to