Hi,

I was playing around with the CoreImage Kernel Language for a long time and want to make a step forward. But here I've got some starting problems. What I would like is to attach some textures and do various computations in a for-loop. Unfortunately the GLSL Patch in QuartzComposer does not seem to like my texture arrays. As long as I am only using one texture from that array (e.g.. texture[0]) I am able to connect an image to that texture. As soon as I add something which uses a second texture from the same array (e.g.. texture[1]) all the inputs vanish from the patch.

I also tried to use "OpenGL Shader Builder.app" instead but there I've got the problem that I don't know how to bind the textures. Instead of all the textures I provided I get only TEXTURE0 no matter what index of the texture array I use.

VertexShader:

void main()
{
        //Transform vertex by modelview and projection matrices
        gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
        
//Forward current color and texture coordinates after applying texture matrix
        gl_FrontColor = gl_Color;
        gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
}


FragmentShader:

uniform sampler2D texture[2];

void main()
{
        vec2 texCoord = gl_TexCoord[0].xy;
        //Multiply color by texture
gl_FragColor = texture2D(texture[0], texCoord) + texture2D(texture[1], texCoord);
}

Thanks in advance,

Michael
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to