PDA

View Full Version : working around texture wrapping



zed
10-01-2008, 03:19 PM
IIRC d3d has a texture wrapping mode that does this

here are the texture coords
0.0
0.25
0.5
0.75
(0.0)+(1.0) // use either depending on what way we're interpolting towards
0.25
...

a way that works is
0.25,0.5,0.75,1.0,1.25,1.5 etc

but since im asking for numbers greater than 1.0 wont this tile? (though visually it doesnt) i.e will this result in less than optimal performance

Is there another method od solving this

ta zed

Ilian Dinev
10-01-2008, 05:56 PM
o_O? Isn't this simply
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL _REPEAT);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL _REPEAT);

OpenGL has all texture-wrap features D3D has

Brolingstanz
10-01-2008, 06:48 PM
Btw, I noticed that CLAMP is deprecated. I guess we use CLAMP_TO_EDGE when the dark day of removal comes...

zed
10-01-2008, 11:58 PM
>>OpenGL has all texture-wrap features D3D has

http://msdn.microsoft.com/en-us/library/bb206256(VS.85).aspx

GL_REPEAT doesnt achieve this

Brolingstanz
10-02-2008, 05:43 PM
Never even really looked at that before. Looks like some sort of funky piecewise (rational) linear interpolation in the rasterizer (if I had to scrape up a guess).

V-man
10-03-2008, 07:08 AM
I remember that page and remember discussing it. An nVidia guy said that it is a pain to implement in hardware.
It has a use in some particular scenarios.