PDA

View Full Version : Fragment Shader about the range of gl_TexCoord[0].st



wwwq
04-24-2005, 08:54 PM
I want to catch the color of one point and its neighbors.

like this
vec4 w3 = vec4(texture2D(tttTexture, vec2(gl_TexCoord[0].s+delp,gl_TexCoord[0].t-delp)));

How can I make sure the s+delp and the t-delp without overflow the range [0,1]

Is the st range from [0,1]?

thanks

_michal
04-25-2005, 12:03 AM
Do clamp?


clamp (gl_TexCoord[0].s+delp,0.,1.)