|[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]|
|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
Visit the Apple Store online or at retail locations.
Copyright © 2011 Apple Inc. All rights reserved.