Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / dbSync() and Flicker removal ops

Author
Message
psx
17
Years of Service
User Offline
Joined: 16th Apr 2007
Location:
Posted: 27th Jul 2007 07:29
Hi everyone, and here is a new question.
I'm sitting on the DarkGameSDK.
When I run my apps, I see a little glitches, or flicker
when camera moves.

My code looks like this



I read the docs to SDK, and found that
SDK uses DoubleBuffer method,
and we should call dbSync() twice.
The first call prepares BackBuffer, and the second
flips the Front and Back buffers.

Well I didn't get it completely.
When I call dbSync() twice, nothing changes,
and I still can see a little flicker, while camera moves.

How should I use dbSync() in correct way?
What should I do to remove this little flicker?
Chalkey
17
Years of Service
User Offline
Joined: 25th May 2007
Location:
Posted: 27th Jul 2007 16:51
To psx,

Your code should look like this...



The last project I worked on I used OpenGL and GLUT, and used glutSwapBuffers to call the back buffer onto the contents of the front buffer. Ive never had to this in the Dark GDK and as far as I know you dont have to. Ive noticed a little error in your code... you use LoopSDK rather than LoopGDK(), you could try altering it and see if it makes a difference.

Also, most half decent graphic cards have a 'Vertical Sync' option. Forcing this on will lock the maximum frame rate to the monitor refresh rate which will prevent tearing or flickering when the camera moves in a game. You could give that a try...

Hope this helps
Chalk
Cellbloc Studios
20
Years of Service
User Offline
Joined: 15th Mar 2004
Location: Atlanta, GA
Posted: 27th Jul 2007 17:20
I have noticed with the spinning cube example that it "seems" to slow down every now and then, then speed right back up to it's normal spin rate.

Has anyone else seen this also?

Your mod has been erased by a signature
psx
17
Years of Service
User Offline
Joined: 16th Apr 2007
Location:
Posted: 28th Jul 2007 10:05
Quote: " It is important to note the very first dbSync will only render the back buffer and reveal the contents of that buffer on the second dbSync command, as the system is based on a double buffered refresh. "

This is from SDK help.
Note that it is recommended to call dbSync() twice.

to Chalkey
About your note to use LoopGDK instead LoopSDK.
I use previous version of DGDK - DarkGameSDK, which functions
are declared with SDK, not GDK ending.
And you talk about VerticalSync option.
But SDK supplies no commands to control it.
How can I turn on this feature?
Anyway thanks.
Chalkey
17
Years of Service
User Offline
Joined: 25th May 2007
Location:
Posted: 28th Jul 2007 11:44
Sorry I didnt realise the difference between the software kits... But should it not be LoopSDK() with brackets rather than just LoopSDK?

Any way, the Vertical Sync command I mentioned is not found in the GDK but its usually an option on most decent graphic cards that can be turned on in your control pannel - weather or not it will solve your problem I dont know but I remember back in the day when I used to play Half-Life I had the same tearing/flickering problem until I used VSync.

The only other thing I can think of is not calling dbSync() more than once in your main game loop...

Sorry if this isnt any help
Chalk
psx
17
Years of Service
User Offline
Joined: 16th Apr 2007
Location:
Posted: 28th Jul 2007 11:53
Oh its nothing. Thanks. But I want to ask you final question.
In your apps on DGDK, do you see any flicker?
Any tearing or something.
If not, so it must be because of some fixes made in DGDK.
Maybe DarkGameSDK works in this way.
Chalkey
17
Years of Service
User Offline
Joined: 25th May 2007
Location:
Posted: 28th Jul 2007 12:10
No tearing for me - I tried a small app with a load of pointless dbSync() here and there and still ran okay.

Chalk
Try
20
Years of Service
User Offline
Joined: 16th Aug 2004
Location:
Posted: 28th Jul 2007 12:43
psx,
You might want to try that with a scene full of objects(at least a room or something to cover the entire screen), you can't judge by a spinning cube!

With a filled scene and a decent monitor refresh rate (at least 85-100 Hertz) you shouldn't notice any flickers. So, check your screen refresh rate and your graphics drivers, etc. as usual!

Quote: "It is important to note the very first dbSync will only render the back buffer and reveal the contents of that buffer on the second dbSync command, as the system is based on a double buffered refresh."

May be it's just me! But I didn't get what you said it has to be there! It just says that in the first loop ( first dbSync() call ) you won't have the front buffer! (No flip!) It didn't mentioned to call dbSync() twice! did it?!!!

Cheers,
-Try
psx
17
Years of Service
User Offline
Joined: 16th Apr 2007
Location:
Posted: 31st Jul 2007 17:09
Ah yes, now I see. It say "the very first". sigh.

Now about monitor. I'm using LCD monitor and its refresh rate
is 60Hz. And I test the scene with full room and textures.

When I move the camera I can see a little tearing, but I cant catch it to a screenshot.

Maybe this is because of vertical sync.

Attachments

Login to view attachments
James Bondo
17
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 1st Aug 2007 00:48
That screenshot looks good.
And tearing is caused by not having vertical sync and the fps is higher than the screen refresh rate.

Using Dark GDK.NET
psx
17
Years of Service
User Offline
Joined: 16th Apr 2007
Location:
Posted: 3rd Aug 2007 14:53
Thanks James.
I've got DarkGDK yesterday,
the compiler errors took some time to fix,
and what you think?

The app runs smoothly!! No tearing!!
It all was because of old version of DarkGameSDK.
OK now this thread is complete.
Thanks everyone.

Login to post a reply

Server time is: 2024-09-29 01:21:05
Your offset time is: 2024-09-29 01:21:05