From: Filippos P. <css...@cs...> - 2003-10-14 22:28:59
|
On Mon, 13 Oct 2003, James Turk wrote: > > >> - I also believe that it would be better to use GL_LINEAR for Image > >> Stretching not GL_NEAREST. Maybe u could put an extra parameter in the > >> function Resize/Stretch. > >> > > > > In SDLGL_Util.cpp, I changed the lines > glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); > glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); > to > glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); > glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); > and noticed a visible difference. I'm not an OpenGL expert, so why > would anyone want to use GL_NEAREST? > > From what I've seen I propose simply changing these lines and nothing > else but if I am going to bother leaving GL_NEAREST, instead of forcing the > change inside Resize/Stretch, would it not be best to simply have that > as an option defined for each ZImage, that way a minimal number of calls > to glTexParamteri would be required, and none would be required inside > the rendering loop in most situations, which I'd consider a good thing. > > Feel free to share any thoughts on this, the finer points of OpenGL are > certainly not my specialty. > > -James Well i am not an OpenGL guru either ;) To be honest i havent fully understood what you wanna say here (see English is not my native language). I can tell these (by what i have understood): Why not putting an extra parameter in the Stretch/Resize function (or in the constructor of a ZImage) e.g named 'smooth' ? This way it is up to the developer to decide if he needs smoothed image or not. Someone would say that GL_LINEAR produces blurred images, which is not always a good case. On the other hand GL_NEAREST is faster than LINEAR. |