just to follow up to my own post, I found that OpenGL ES also has a
Texture parameter, GL_GENERATE_MIPMAPS which, when set true,
generates all the mipmaps for you when you set the level 0 one. I
found as expected that if I set that before setting in my texture,
I did not need to change the texture filter mode from the default
as I had a full and complete mipmap set. Of course those mipmaps
are nothing custom, just autoscaled versions of the original and
the whole ends up using 2x as much memory as it did, this is
however another way to accomplish the same thing.
On Apr 22, 2009, at 12:53 AM, Roland King wrote:
I'm trying to set a very simple texture onto a rectangle on my
screen. My texture is a 256x256 circle. I've set the texture up,
I've set up the texture coords and enabled the texture array and
when I display it .. I get a gray rectangle, no texture has been
applied. This is Open GL ES on the iphone
After some random messing about I found that adding this line
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
sorts it out. I now get my circle texture applied onto my
rectangle, suitably stretched and messed around with, in a fairly
default mode. But I don't understand why. The 'red book' talks
about GL_TEXTURE_MIN_FILTER when discussing mipmaps, I don't have
a mipmap, or at least not explicitly. I've set one single texture
and that's it (at level 0). I haven't 'enabled' mipmaps, so I
expected my one single texture would just get .. used, but perhaps
mipmaps don't need to be explicitly enabled, they just sort of
exist and you have to explicitly tell GL how to map anything apart
from 256x256.
Is there a paragraph in the OpenGL Programming Guide (red book) I
missed here which tells me I need to set up a min (and/or mag)
filter any time I used a texture? I think the example code I've
used before probably has always done so.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden