|
From: James T. <ja...@co...> - 2003-10-14 23:15:24
|
I have changed the default rendering to GL_LINEAR and I plan on leaving
it like that unless anybody complains, the speed difference is barley
noticable, and the quality is greatly improved. The reason I have not
added a new parameter is becuase the choice occurs when the image is
loaded, and adding extra calls inside Stretch would be an unwanted speed
penalty.
-James Turk
Filippos Papadopoulos wrote:
>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.
>
>
|