[MDX] Weird flickering going on

Started by
20 comments, last by remigius 17 years, 11 months ago
My terrain rendering application was working perfectly ('pefectly' being a relative term based on phase of development). One day, though, with no changes to the code, the program still works like it was except there is this horrendous flickering and I can't for the life of me figure out what is causing it. The strange part is, I ran my app in PIX and whenever I use F12 to take a screnshot, the screenshot comes out exactly like it should, yet I still get the horrendous flickering. Also, PIX reported an almost constant 60 FPS, so it may have something to do with vsync, but I doubt it. However, if you think it may have something to do with it, I don't know how to turn off vsync so an answer for that would be much appreciated. Thanks for the help. -AJ
V/R,-AJThere are 10 kinds of people in the world: Those who understand binary and those who don't...
Advertisement
You can control V-Sync with the PresentParameters.PresentationInterval property. But it is still possible that your GFX driver overrides these settings. It is somewhere in the control panel for your GFX but depends on the model and driver you use.
That's right, when creating the D3D device, use

presentParams.PresentationInterval = useVSync ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE;

to (de)activate vsync.
Thanks y'all, but that didn't help anything [sad]. Any other ideas?

-AJ
V/R,-AJThere are 10 kinds of people in the world: Those who understand binary and those who don't...
How do you render?

I would also recomend that you post as much source as possible.
[s]--------------------------------------------------------[/s]chromecode.com - software with source code
Quote:Original post by Enselic
How do you render?

I would also recomend that you post as much source as possible.


I apologize, but I didn't think it mattered since it was working and now it doesn't with no changes to the code. I'm not at the computer that has the code on it right now, though, so I will update this post with code as soon as I get home.

As general overview for how I render:

BeginScene();
Process keyboard input for camera movement
Set new view matrix based on keyboard input
SetStreamSource(0, vb, 0);
device.IndexBuffer = ib;
DrawIndexedPrimitives();
EndScene();

I'll post the actual code as well pertinent code ASAP.

-AJ
V/R,-AJThere are 10 kinds of people in the world: Those who understand binary and those who don't...
Well the rendering looks totally ok, though maybe you should read keyboard input prior to BeginScene().

These mysterious bugs are the most fun ones [smile].
[s]--------------------------------------------------------[/s]chromecode.com - software with source code
Are you sure you clearing the depth buffer? If not, it will cause some strange flickering and artifacts.
Sean Henley [C++ Tutor]Rensselaer Polytechnic Institute
Quote:Original post by Enselic
These mysterious bugs are the most fun ones [smile].


Indeed [smile]


Quote:Original post by Sr_Guapo
Are you sure you clearing the depth buffer? If not, it will cause some strange flickering and artifacts.


I'm very sure. That was actually the first thing I checked. The first line of the OnPaint override is:

device.Clear(ClearFlags.Target | ClearFlags.ZBuffer, whatever, other, paramters, this, function, takes);

-AJ
V/R,-AJThere are 10 kinds of people in the world: Those who understand binary and those who don't...
Do you render inside the OnPaint method? In this case you have to make sure that you have disabled the background drawing of the control you use. If you don’t do this it can cause flickering between your image and the background that is used to clear the control.

This topic is closed to new replies.

Advertisement