   Strange behavior in OpenGl blending
  Hi all.I have a problem with OpenGL blending.Let me describe a situation:1) Application window has a background image - pyramides 800x600 pixels.2) Application creates dynamic texture 9x9 pixels. Top left triangle of texture (sum x and y coordinates is not higher 9) is 0xF0FFFFFF. Yes, it is 32 bits.Bottom right triangle is 0x00FFFF00.3) Dynamic texture is rendered to 400x400 quad right after background render.The result image ishttp://picasaweb.google.com/lh/photo/EiBj_GQOQzd5xGChjmLbMA?feat=directlinkQuestion: why yellow line is drawn?I enabled/disabled POINT/LINE/POLYGON_SMOOTH - but yellow line remains.I changed GL_CLAMP to GL_REPEAT - but line remains.I used glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);to implement blending.It is tested under MacOSX 10.4 and 10.6Please give me an advice...Thank you :)   
  Try GL_CLAMP_TO_EDGE as texture wrap mode (or warp? I always forget)you have linear filtering and repeat as wrap mode, so the yellow line is the opposite side of the triangle filtered. I hope that's clear.Anyway, try GL_CLAMP_TO_EDGE.   ;  No, it did not help.Yellow line became solid.I changed texture coordinates from 1.0/1.0 to 0.98/0.98 - it helped. But the question remains...;  wrap mode?That shouldn't affect "solidness".glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);   ;  The yellow line is caused by linear interpolation of the alpha channel. If use GL_NEAREST as magnification filter the yellow will be gone, but it will cause your texture to appear 'blocky'.May I ask why you draw a quad and make half of it transparent? It would be easier to draw a triangle, that would save you these problems. Then you can also disable blending, which is faster.EDIT: Also, keep in mind OpenGL doesn't support textures with a resolution smaller than 64x64. It may work, but you shouldn't depend on it.   ;  Triangle is just example. This approach is used to show level selection. Real texture represents  complex shape.64x64 ? Wow, it can be cause...   ;Quote:Original post by Rene ZThe yellow line is caused by linear interpolation of the alpha channel. If use GL_NEAREST as magnification filter the yellow will be gone, but it will cause your texture to appear 'blocky'.yes, when I use GL_NEAREST - yellow line is gone, but wanted effect is gone too :);Quote:Original post by szecswrap mode?That shouldn't affect "solidness".glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);Still no good?Would you please show us the whole code?   ;Quote:Original post by Rene ZEDIT: Also, keep in mind OpenGL doesn't support textures with a resolution smaller than 64x64. It may work, but you shouldn't depend on it.I increased texture size to 64x64.Yes, it helped. Now it draws perfectly in [0.0, 1.0] texture coordinates.GREAT thanks!;Quote:Original post by szecsQuote:Original post by szecswrap mode?That shouldn't affect "solidness".glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);Still no good?Would you please show us the whole code?Full code is mix of SDL and own OpenGL code, it is pretty big.GL_CLAMP_TO_EDGE does not result in wanted effect.