Archived

This topic is now archived and is closed to further replies.

MagTDK

DX9 render state problem

Recommended Posts

MagTDK    122
I''ve recently switched over to DX9 but have ran into a minor problem. I''m getting a blinking effect when my view point is outside my world map. It''s a rapid change between solid colors like hot pink, green and yellow. Before when working in DX8 I used to get a mirror effect instead. Note that I''m not clearing the frame buffer each frame. Anyone know what causes this? I believe it''s a render state but I''m not sure which one (still trying to find it). I''d like to get it to what I had before with the mirror effect.

Share this post


Link to post
Share on other sites
S1CA    1418
"Note that I''m not clearing the frame buffer each frame"

Check that your viewport sizes are correct and not out by 1.


The DEBUG Direct3D runtime will set your back buffer to red and green and cycle between them when:

- You''ve used a swap effect of a certain type and not cleared the back buffer. D3D fills the surface in as a debugging aid so that you can spot things like parts of the screen you aren''t rendering to. DirectSound does the same for the same reason when it fills buffers with white noise so you can tell when you''ve played a buffer without filling it.

- The other reason is when there''s a serious error or warning happening repeatedly - it''ll flash your screen colours to tell you. Look at the debug output to be sure.

500 500

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
MagTDK    122

Thanks for the response S1CA.

I checked my app again and I didn''t see any errors in the debug output.

What I even did was comment out everything except for the creation of my window and graphic device and I still got the flashing colors (Even in release mode).

Then I loaded up the DX9 tutorial03 on matrices and changed this line:
// No longer clear the render target.
g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_ZBUFFER, 0, 1.0f, 0 );

And it still flashes both in debug and release. I wonder if the tutorial acts the same on your computer?

Share this post


Link to post
Share on other sites
MichaelT    214
You need to change Direct3D properties to "Use Retail version of Direct3D" instead of "Use Debug version of Direct3D". You can find it in your control panel/directx.

____________________________________________________________
Try RealityRift at www.planetrift.com

Share this post


Link to post
Share on other sites
S1CA    1418
I still got the flashing colors (Even in release mode).

Release Mode?

No, no, no, no . The flashing I''m talking about is from the Debug Direct3D Runtime . Take a look at the DirectX applet in the control panel, under the D3D tab, there''s a "Debug/Retain D3D Runtime" section with two radio buttons.

If changing the radio button to Retail and then running your app again doesn''t make the flashing go away then the flashing is from something else.

To me the flashing sounds like its because you aren''t rendering to all of your back buffer - that''s why the clear fixes it, you should render to ALL of the back buffer OR change the swap effect if you don''t intend on clearing. The D3D runtime deliberately fills the buffer to help you see this, but even if it hasn''t, then what your app is rendering may still be the cause.

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
MagTDK    122

lol...man do I feel stupid

Using the Retail version of Direct3D fixed the problem.
Thanks for your help guys.

- I think all this lack of sleep is starting to effect me.

Share this post


Link to post
Share on other sites