PDA

View Full Version : GL_LINEAR



chidu
10-22-2008, 11:31 AM
I am trying to use fragment shaders to convert 2x2 image to 2x4 image which is basically I am trying to convert an image to double sized vertical only (not horizontal, atleast not yet)

Even though I have specified the texture parameters as GL_LINEAR for min and mag I am getting the final image sampled as GL_NEAREST.

I am not using any mipmaps

eg on how the double vertical should be sampled is as below

Original 2x2 Image
---------
| a | b |
---------
| c | d |
---------

Final 2x4 image should look like
-----------
| a | b |
-----------
| ac | bd |
-----------
| c | d |
-----------
| c~ | d~ |
-----------

but the final 2x4 image looks like (which is wrong and I believe its doing GL_NEAREST)
-----------
| a | b |
-----------
| a | b |
-----------
| c | d |
-----------
| c | d |
-----------

Let me know what I am doing wrong, apart from setting the GL_LINEAR is there anything else I am missing.

Appreciate your reply.

thx
Chidu

dletozeun
10-23-2008, 05:40 AM
Can you show us a piece of code? Texture setup part would be interesting.