Hi!
Im busy making a 3D Engine to be used in a game, Its looking great considering i do things "trial and error" style and i try and use the internet to the fullest for its resources!
Im programming the engine using OpenGL and now Im adding support for GUI, basically(for now), loading bitmap files to the screen...
The problem is that the bitmaps flicker prefusely when drawn to the screen!
Can someone please give me some ideas on how to stop all the flickering?!?!?!
Mmmm... Im not sure what else to say?!?
:blush:
GUI Programming Problems? :(
Started by damn, Sep 28 2005 08:44 PM
4 replies to this topic
#1
Posted 28 September 2005 - 08:44 PM
#2
Posted 28 September 2005 - 10:40 PM
What kind of flickering? Could be many problems, like aliasing or no double buffering.
#3
Posted 29 September 2005 - 10:52 AM
It could also be a Z-Fighting problem.
Are you rendering the bitmaps in Orthographic (Parallel) projection mode
(or)
Rendering the bitmaps as Screen aligned quads ?
If the depth buffer value of the polygon u used to render your GUI-window (or background ) & the depth of the polys for bitmaps are the same u can see this flicker. There are many ways to avoid z-fighting.
Hope it helps
Are you rendering the bitmaps in Orthographic (Parallel) projection mode
(or)
Rendering the bitmaps as Screen aligned quads ?
If the depth buffer value of the polygon u used to render your GUI-window (or background ) & the depth of the polys for bitmaps are the same u can see this flicker. There are many ways to avoid z-fighting.
Hope it helps
#4
Posted 29 September 2005 - 04:12 PM
Maybe you forgot the "ValidateRect(0);" after you have drawn the bitmap.
"Stupid bug! You go squish now!!" - Homer Simpson
#5
Posted 29 September 2005 - 07:54 PM
If you are drawing your bitmaps as textures on quads, and if they are flickering where they overlap, then your issue is with the z buffer, in this case you want to offset the quads. Say order them by depth, then start with the front ones and render them all, changing the z position slightly each time. Alternately, you can render them back to front, and disable depth testing while you render the GUI, however the first option is generally better because it will prevent some overdraw.
If this is not the case, maybe you ensure you have Vertical Sync turned on, so that it doesn't send half of your frame to the screen at a time. This makes sure that your frame wont be sent to the screen until after it is totally drawn, and it wont start drawing the next frame until after the first one has been totally sent.
If this is not the case, maybe you ensure you have Vertical Sync turned on, so that it doesn't send half of your frame to the screen at a time. This makes sure that your frame wont be sent to the screen until after it is totally drawn, and it wont start drawing the next frame until after the first one has been totally sent.
Jesse Coyle
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












