From: Stephen J B. <sj...@ht...> - 2000-04-25 20:44:09
|
On Tue, 25 Apr 2000 sh...@pl... wrote: > I posted this message a couple of weeks ago in comp.graphics.api.opengl, > but only got one barely relevant response. I've given up reading that news group - it's a mess. > In a simulation that I'm developing, the ground is a very large polygon > that's textured using a series of Mipmaps generated from a 64 X 64 rgb > image using gluBuild2dMipmaps(). Both GL_WRAP_T and GL_WRAP_S are set to > GL_REPEAT. > > The problem is that as the "eye" moves, the ground appears to be very shaky, > almost as if looking down on a large tray with thousands of wriggling worms. > glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0); > glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 5); This is OK - but is there any special reason for doing this? For a 64x64 map, it isn't necessary. Is it possible that you may be cutting off some of the lower level MIPmaps elsewhere in the code? That would certainly make the texture aliasing much worse. > glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST ); So it looks like you are seeing aliasing due to this ^^^^^^^^^^^^^^^^^^^^^^^^^ Try GL_LINEAR_MIPMAP_LINEAR > Yes, I'm aware that with the LINEAR_MIPMAP_LINEAR option, I can reduce the > shimmering effect, but it slows down the simulation considerably. Well, you get what you pay for! With most modern hardware, there is no additional penalty for GL_LINEAR* over GL_NEAREST* - but if you are rendering in software, you are screwed - the extra load in reading 8 times the number of pixels and doing trilinear interpolation is gonna hurt. You could try GL_LINEAR_MIPMAP_NEAREST - that should be faster (with a software only renderer) because it only has to read 4 times the number of pixels and do bilinear blending. The crawling artifact should still be improved - although you'll see abrupt changes in MIPmap level still. > Any suggestions and fixes would be deeply appreciated and gratefully acknowledged in the > (non-commercial) application that I'm trying to develop. Well, you are seeing aliasing - and that's inevitable without doing some filtering - which is what GL_LINEAR* does for you. If you absolutely cannot do any better then go to a higher resolution map - but filter it heavily in your paint program. Also try to keep the contrast in the map as low as possible and avoid high frequency information. Steve Baker (817)619-2657 (Vox/Vox-Mail) L3Com/Link Simulation & Training (817)619-2466 (Fax) Work: sj...@ht... http://www.hti.com Home: sjb...@ai... http://web2.airmail.net/sjbaker1 |