How can I access texOffset

I want to use texOffset in order to loop over some pixels.

In my vertex shader I added:

out vec2 texOffset;

And in the fragment shader I added:

in vec2 texOffset;

And I try to use it with:

float xInc = texOffset.x;

But since I added those lines the shader won't compile anymore due an Unknow error.



  • edited October 2015 Answer ✓

    texOffset is a uniform, not an attribute. Just remove it from your vertex shader and declare it in your fragment shader like this:

    uniform vec2 texOffset;
  • When you told about in and out I took it a bit to strict :) Thanks. My useless shader is finished now. Time to learn CUDA soon to do it the proper way :)

Sign In or Register to comment.