Random Surface Aliasing

Started by
2 comments, last by Geronimo2000 19 years, 11 months ago
I have a simple Direct3D application in a C# window. I render multiple scenes to different panels. Sometimes, seemingly at random, when I resize the windows, one or more scene will suddenly blur, alias, or even completely disappear. Sometimes the geometry will change as well! I was hoping a grizzled pro might know what is causing this issue. If so, thanks in advance.
Advertisement
Do you reset the device properly after resizing the windows?
The device may need to allocate more space for the framebuffer(s), but it cannot usually do so until the host application gives it''s consent for the operation (by calling Reset).
At very least, you see aliasing/blurring. At worst cases, you don''t see anything but garbage and/or background clear color.

Remember that after reset, you have to recreate all your resources that were in video memory. Managed resources are an exception, d3d caches them to system memory automatically.

-Nik

Niko Suni

Nik - I believe you were right on the money, but it leaves me somewhat confused with respect to the override hwnd parameter you can pass to device.present(). If I must reset my device whenever the window resizes, what extra power does the override hwnd paramter give you? (I thought the idea was you could draw to any window successfully while in windowed mode). What have I totally missed?
quote:Original post by Geronimo2000
I thought the idea was you could draw to any window successfully while in windowed mode.


Theoretically, yes. However, in practice, some device/driver combinations do not handle the stretching very gracefully.

Framebuffer stretching, I believe, was implemented only for convenience in debugging (not absolutely having to reset the device in windowed mode). For production quality, you need to use 1:1 size correspondence between the viewport and the frame buffer.

I haven''t studied much on the subject of multiple d3d viewports, so I cannot offer much alternatives. However, many apps pull the technique off nicely, for example 3DS Max.

-Nik

Niko Suni

This topic is closed to new replies.

Advertisement