Present() = pixelated

Started by
12 comments, last by pathon 15 years, 5 months ago
I was bored, and I couldn't immediately find any concise, readable examples that illustrated the basic concepts of what remigius recommended, so I tried to modify one of the early DX SDK examples to include some of that behavior. It renders to a 640x480 texture, but stretches it onto a 1024x768 backbuffer.

http://gamedev.pastebin.com/m552be2d0

Important things to note:
- No matter what, you are going to need to reset your device. I know it's not what you want to hear, but properly handling resetting your device is important for a lot of reasons, including lost device situations.

- This method allows you to keep rendering your scene at 640x480, and I would think the same performance, BUT: your back buffer will have to match the dimensions of the client area you're rendering to for this trick to do any good. So again, you're going to need to reset your device.

- Of course, pay attention to the handling of resources in the default pool (in this example, the vertex buffers and render target) upon losing the device. This code does not handle that.

Also, this will use simple bilinear filtering. It doesn't delve into the topic of more advanced resampling methods.
Advertisement
Thanks for your help, Neverender

I integrated your code into my game and it now it stretches normal on Vista with Aero disabled...

The game menu now looks perfect - no artifacts (like it should) but when I load a level the graphics go back to the horrible quality like it used to be in menu :(

Edit: nvm, bug on my part :)

[Edited by - pathon on November 16, 2008 1:09:20 AM]
I can't seem to solve some issues after adding the render-to-texture code.

Playing movies now no longer work and neither do fades :/
bump :(

The screen fills with white whenever something transparent is being rendered e.g. fade - so I need a quad that supports transparency?

[Edited by - pathon on November 16, 2008 7:53:43 PM]

This topic is closed to new replies.

Advertisement