Cannot get rid of texture wrapping seam in OpenGL -
take @ following image - see clouds in background have annoying seam:
http://simoneschbach.com/seam.png
this seam occurring when wrap around occurs, supplying texture coordinates programmatically following code:
gbackgroundpos += 0.0003f; // gbackgroundpos climbs indefinitely... glfloat bgcoords[] = { gbackgroundpos, 1.0, gbackgroundpos + 0.5f, 1.0, gbackgroundpos, 0.0, gbackgroundpos + 0.5f, 0.0 };
i have enabled texture wrapping during texture init follows:
gltexparameteri(gl_texture_2d, gl_texture_wrap_s, gl_repeat); gltexparameteri(gl_texture_2d, gl_texture_wrap_t, gl_repeat);
does know can here rid of visible seam?
the problem have solved technique, extremely simple implement:
http://vcg.isti.cnr.it/~tarini/no-seams/
there open-source demo @ link, exposes used fragment shader.
the trick easy adopt without complete understanding of why works, explained in journal of graphic tools article: "cylindrical , toroidal parameterizations without vertex seams" can found, example, @ http://vcg.isti.cnr.it/publications/2012/tar12/.
unfortunately, other solutions listed here won't work:
gl_repeat (as gl_texture_wrap), alone, not need. problem, noted, triangle connecting point s = 0.9 , s = 0.1 interpolates way across cylinder, not forward across seam.
replicating vertices on "cut" (the texture seam) work on static geometries, texture coordinates sent attributes (but, then, drawbacks many: introduces replication, , seams breaking geometry: 2 sides of texture cut topologically disconnected). in case specific case, texture coordinates produced procedurally that's not option.
Comments
Post a Comment