Tranlsating Texture Channels (R,G,B,A separately)

Is there a way in OpenGL or GLSL to translate an RGBA 2D texture by any number of texels (more than GL_MIN_PROGRAM_TEXEL_OFFSET & GL_MAX_PROGRAM_TEXEL_OFFSET allow for)separately for Red, Geen, Blue and Alpha Channels?

I am taking film scans that have separate color channels captures that are out of registration and aligning them to a reference.

For example, I want to move the red channel 2 texels left and 5 texels down, and the green channel 24 texels right and 13 texels up, etc.

I know I can move texel locations in a Vertx Shader without limitation, but I wouldn’t know how to offset individual color channels.

I appreciate your guidence.

Access the texture multiple times from the shader, and pick out the components you want for the final color.

You have a film scan with an alpha channel? That’s quite a trick.

Anyway, yes, use a fragment shader and sample in a slightly different place for each color component as needed, then combine.

That has the advantage of not needing to be the same across the whole image, which might help, depending on how your color shift happened.

Bruce

What is GL_MAX_PROGRAM_TEXEL_OFFSET for?

What is GL_MAX_PROGRAM_TEXEL_OFFSET for?

It is the maximum offset that can be used in the GLSL textureOffset or texelOffset functions.