Archived

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

Mastaba

Buggy Renderstate?

Recommended Posts

If I get some unexpected behavior when using the HAL device, yet expected behavior when using the REF device, can I rest assured that the unexpected behavior is a bug or "feature" of the video card driver? In particular, I''m getting some odd image filtering effects that really mess up small text drawn with the ID3DXFont interface. Here is what my app is doing when the bug appears: Create fullscreen device in 1024x768 mode. Create ID3DXFont, m_pFont Draw text with m_pFont (text looks ok) ... some time later ... user hits Alt-Enter to signal a switch to windowed mode Release m_pFont Release device Create windowed device, 640x480 on a 1156x864 desktop Create ID3DXFont, m_pFont Draw text with m_pFont (text looks badly filtered) or I can follow this code path: Create windowed device, 640x480 on a 1156x864 desktop Create ID3DXFont, m_pFont Draw text with m_pFont (text looks good) ... some time later ... user hits Alt-Enter to signal a switch to fullscreen mode Release m_pFont Release device Create fullscreen device in 1024x768 mode. Create ID3DXFont, m_pFont Draw text with m_pFont (text looks ok) ... some time later ... user hits Alt-Enter to signal a switch to windowed mode Release m_pFont Release device Create windowed device, 640x480 on a 1156x864 desktop Create ID3DXFont, m_pFont Draw text with m_pFont (text looks badly filtered) The renderstates are set exactly the same each time the device is created, since I only have a single function that creates the device, and initializes the renderstates, which are hardcoded in this function. The REF device exhibits no such filtering effects at anytime when doing the exact same thing. Very close examination of other elements of the rendered scene show that the odd filtering is also being applied to polygons. Its almost as if FSAA was turned on spontaneously, during device creation, when going from a previous fullscreen device to a new windowed device. I''m using a Geforce 3 with 41.09 drivers. Any one have a clue?

Share this post


Link to post
Share on other sites
Also noticed that the filtering even affects the titlebars of other application windows, like Notepad. So I''m going to assume I simply wandered into a bug of the 41.09 drivers.

Share this post


Link to post
Share on other sites
Make sure you enable apps to control antialiasing (from your card settings panel). nVidia drivers can sometimes select the best anti-aliasing level they think is better.

Make sure you check the debug spew. If you can''t manage to get it solved, try posting at microsoft''s DirectX mailing list (DirectXDev). Also, when all fails, drop nvidia mail.

quote:
user hits Alt-Enter to signal a switch to windowed mode
Release m_pFont
Release device
Create windowed device, 640x480 on a 1156x864 desktop

Why not reset the device instead?

Cheers,
Muhammad Haggag

Share this post


Link to post
Share on other sites
Yes, that was the very first thing I checked. Performance was set to Application, FSAA was off, Anisotropic Filtering was off, and Texture Sharpening was off. Debug reports no errors, or unexpected warnings.

I do use Reset when the device is lost, didn''t think to try using it to change the mode. I''ll give it a shot.

Share this post


Link to post
Share on other sites
quote:
Yes, that was the very first thing I checked. Performance was set to Application, FSAA was off, Anisotropic Filtering was off, and Texture Sharpening was off.

Good. It''s likely that the settings are not the problem then (Sometime ago someone reported that filtering wasn''t being controlled by the app even when when he set it to "Application").

By the way, uploading a couple of screenshots somewhere would be useful.

Cheers,
Muhammad Haggag

Share this post


Link to post
Share on other sites
Darn. I changed the fullscreen toggle to simply use Reset instead of the release device - create device sequence, and it still gets the odd fullscreen filtering applied, which looks really bad on small text. I only have 2 ideas left, one is to destroy the window and create a new one. The other idea is to simply use larger text that won''t look so bad under this unwanted filtering, though that obviously will reduce the amount of text viewable.

Share this post


Link to post
Share on other sites
I found out what was going wrong. Turns out it was my bug. I took some screenshots in order to show what was wrong as was suggested, and I noticed when uploding the images that the size of the images was substantially different. I took a close look at the size of the images and sure enough, the window was being resized incorrectly when going from fullscreen to windowed mode. I fixed that, and the filtering went away. So it appears the driver was actually drawing to a 640x480 surface and then filtering it down to my slightly smaller window. So I guess one way of using FSAA on Geforce 3 cards is to create large render target surfaces but use a small window. As that appears to be what happened here.



[edited by - Mastaba on March 4, 2003 4:05:07 PM]

Share this post


Link to post
Share on other sites