PDA

View Full Version : Texture state and texture parameters



zen
03-12-2002, 05:15 PM
According to the specs the MIN_FILTER and MAG_FILTER parameters are saved in the texture state which in turn is saved in the texture objects.Yet I have the following problem:I create a texture object and at some time after creation I bind it and change the above parameters via TexParameteri.The texture filtering I see doesn't change although if I do a GetTextureParameteriv on the same texture it returns the filter I want.Any ideas as to why that might be happening?Is this supposed to be that way or is it a bug(either in my code or the driver's).

I just remebered a tut on filtering.It created multiple texture objects,one for each filter type.Does that mean I have to delete and re-create the texture object to change the filter?

[This message has been edited by zen (edited 03-12-2002).]

Omaha
03-12-2002, 07:54 PM
Are you sure you're binding before setting the parameters?

zen
03-13-2002, 02:46 AM
Yes.I also have a console command to get info for a texture object.If I use that for the texture for which I changed the filtering the reported filter modes are the ones I have set,but I still see the old filter modes.Perhaps I have to reupload the textures or recreate the objects?

zeckensack
03-13-2002, 03:05 AM
Maybe you just mixed up on GL_LINEAR_MIPMAP_NEAREST and GL_NEAREST_MIPMAP_LINEAR ?

The first one of these two is better.

zen
03-13-2002, 03:18 AM
no,let me explain the problem a little better:I'm implementing a texture cache.I have some console vars for various texture parameters(all textures in the cache have these parameterers which are set on init and can be changed from the console,kind of like q3a).So when I change the parameters for filtering and restart the cache I run through the list of textures,bind them and set the new global values for the parameters.Now as I've allready said using the glGetTexParameteri command(through a console cmd) to get texture info returns the correct filters but it is not what I see.
Note that upon cache restart some textures are reloaded so the corresponding objects are deleted and recreated.These look just fine.This(together with that tut and the fact that vid_restart in q3a reloads everything) makes me think I need to recreate the objects instead of just changing the params.