Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: why do I have to set a GL_TEXTURE_MIN_FILTER
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why do I have to set a GL_TEXTURE_MIN_FILTER



correct you are, sloppy writing on my part.

They actually look not very good in my particular case and I've gone back to the linear interpolation. I should probably actually do the job of creating the mipmap files myself if I really care.

On Apr 22, 2009, at 9:37 PM, Nico Schmidt wrote:

For the record: mipmapped textures require a third more memory then the non-mipmapped version:
1/4 + 1/4^2 + 1/4^3 + 1/4^4 ... = 1/3


On Apr 22, 2009, at 1:49 PM, Roland King wrote:

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


_______________________________________________ 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
References: 
 >why do I have to set a GL_TEXTURE_MIN_FILTER (From: Roland King <email@hidden>)
 >Re: why do I have to set a GL_TEXTURE_MIN_FILTER (From: Roland King <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.