OpenGL Jaggies
I am currently working on my first game using OpenGL and I am having a few problems. When I rotate the camera, the image rotates just fine but the polygons break up and the textures jump, forming jags in the image. When I stop rotating everything looks fine. The frame rate is high, roughly 90 fps, so I''m pretty sure that''s not the problem. The only thing I can think of is that maybe flipping the buffers faster than my monitor refreshes could cause this. Anybody have any ideas on what is causing this or how to solve it? Thanks a bunch.
Wraith
cdickinson@scu.edu
[email=cdickinson@scu.edu]Wraith[/email]BasketQase Software
arew we talking sheering? that''s what it sounds like from what you said... when you look around it "jaggies" or sheers the image.
i don''t know much about opengl but i''m sure there is a way to wait for vertical blank. the problem is that it''s blting the backbuffer to the front buffer in between when the vertical blank is taking place and only part of the image being bltted is being drawn.
you usually notice it more with higher frame rates in my experience
-my two cents-
i don''t know much about opengl but i''m sure there is a way to wait for vertical blank. the problem is that it''s blting the backbuffer to the front buffer in between when the vertical blank is taking place and only part of the image being bltted is being drawn.
you usually notice it more with higher frame rates in my experience
-my two cents-
-werdup-
Wowsers. It sounds like you''ve got a vertical sync problem. Anyway, this can be corrected one of two ways. First of all, if you''re using GLUT, I can''t help you as I''m not into that, but for a normal Win32 program, you''d use these:
1) If you''re using single buffering (you specify when you set up your PixelFormat), then after you''re done rendering make these calls:
BeginPaint( HWND, &PAINTSTRUCT );
EndPaint( HWND, &PAINTSTRUCT );
That will go ahead and sync the vertical refresh. The other way of doing it is to be cool and use double-buffering (once again, specified on creation with ChoosePixelFormat(..) ). The way this works is you render everything like normal, and call SwapBuffers( HDC ); at the end of an update cycle. That will sync it as well.
Now, if you don''t understand what I''m talking about, the refresh rate of your monitor is how fast the little gun in your monitor can go (measured in Hz). Unless you tell GL and Windows to slow down a bit, they tend to enjoy going a bit faster than your monitor can, so you''re update might get half drawn by the time the gun passes over it, therefore causing the "tearing" you''ve noticed.
Pythius
1) If you''re using single buffering (you specify when you set up your PixelFormat), then after you''re done rendering make these calls:
BeginPaint( HWND, &PAINTSTRUCT );
EndPaint( HWND, &PAINTSTRUCT );
That will go ahead and sync the vertical refresh. The other way of doing it is to be cool and use double-buffering (once again, specified on creation with ChoosePixelFormat(..) ). The way this works is you render everything like normal, and call SwapBuffers( HDC ); at the end of an update cycle. That will sync it as well.
Now, if you don''t understand what I''m talking about, the refresh rate of your monitor is how fast the little gun in your monitor can go (measured in Hz). Unless you tell GL and Windows to slow down a bit, they tend to enjoy going a bit faster than your monitor can, so you''re update might get half drawn by the time the gun passes over it, therefore causing the "tearing" you''ve noticed.
Pythius
"The object of war is not to die for your country, but to make the other bastard die for his"
Sorry I didn''t include all the info. I am using Win32 and double buffering, and flipping just the way you said. I still get the shearing, though... In other gl games like Quake 3 I don''t have this problem, so unless they''re doing some little trick, I don''t know what''s happening. Then again, I don''t get _quite_ that high of a frame rate in Quake, either.
Wraith
cdickinson@scu.edu
Wraith
cdickinson@scu.edu
[email=cdickinson@scu.edu]Wraith[/email]BasketQase Software
Well, I can only think of one thing. Your texture mode. It should be either GL_LINEAR, or GL_LINEAR_MIPMAP_(whichever), in my first texturing ptogram my textures looked fine until i started rotating the polys (got the amazing jumping, shearing textures, heh), and that was the problem. Hope that helps.
--
HitScan

--
HitScan
--HitScan
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement