PDA

View Full Version : weird green line



g0l3m
05-30-2007, 04:50 AM
Hello all,

I'm rendering decoded data from a video stream to a texture and doing the YUV to RGB
conversion on a shader.
Everything works great apart from a weird green line that seems to be
appearing on the top, bottom, and left hand side of the texture.
(It doesn't appear on the right hand side).

Not sure if it's a UV issue or what is causing this...Does anyone have any ideas?

(Wish I knew how to attach a screen shot...although I don't think it would help all that much).

Cheers,
g.

Relic
05-30-2007, 06:02 AM
The video overlay might be a green surface.
Or your texture border color?

I'd would look at the wrap modes and/or texture coordinates.
Linear filtering on the texture? Use GL_CLAMP_TO_EDGE.
Let the uv-coordinates run from corner to corner, 0.0 to 1.0 or (0, 0) to (width, height) for TEXTURE_RECTANGLE. The OpenGL rasterization takes care for the sample point interpolation.

If that's not it you'd need to post your OpenGL code.

g0l3m
05-30-2007, 07:27 AM
Super!!! Was doing linear filtering, but was using GL_CLAMP...rather than GL_CLAMP_TO_EDGE !!!

Thx for the help. (BTW, if the explanation of why this happened doesn't involve you typing a huge reply, I'd love to know).

cheers,
g.

k_szczech
05-30-2007, 08:29 AM
I guess the green color could be either:
-border of texture
-unused (and thus uninitialized) areas of texture

Relic
05-30-2007, 09:49 AM
No huge typing effort required to explain that. ;)
- Read the OpenGL 2.1 spec appendix D.6 and
- for the exact formula of linear filtering read Chapter 3 Rasterization formula (3.26) on page 176. Image 3.10 explains the alpha and beta values in that formula.