I have to show a selected region of image on my Glcontrol. For that I have two variables LeftSideVal and RightSideVal. LeftSideVal is in the range of 0 to 0.5 and RightSideVal is in the range of 0.5 to 1.0.
If I set the LeftSideVal =0.3 and RightSideVal=0.8 then I have to show the region between 0.3 and 0.8 on GLControl with full of it's size (viewport).
I have tried like below. But it is not working properly. Shows some blurred area when changing the values.
GL.Viewport(new Rectangle(0, 0, glControl.Width, glControl.Height));
===Shader Code===
if( vTexCoord.x >=LeftSideVal && vTexCoord.x <=RightSideVal){
vec4 color=texture2D (sTexture, vec2(vTexCoord.x+LeftSideVal,vTexCoord.y));
gl_FragColor=color;
}