Jump to content
  • Advertisement
Sign in to follow this  
pathon

Present() = pixelated

This topic is 3621 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I currently use IDirect3DDevice9::Present(NULL, NULL, NULL, NULL) to display graphics. It works great and scales in window mode if I resize or maximize. The problem is when using window mode on Vista SP1: -It works great, but when I have aero enabled it causes slight performance degradation. -Although when I have aero disabled, the graphics will be fine but when I resize or maximize the window - Present() starts scaling it turns bad. Instead of scaling normally and the graphics being nicely stretched - the graphics now looked horrible quality - kinda like POINT vs BILINEAR (if you know what I mean)

Share this post


Link to post
Share on other sites
Advertisement
I play in a resolution of 640x480 either in fullscreen or windowed.

If I started in window mode and maximized, the game will look similar to if I started in fullscreen. This is why I don't reset() - also because I get much lower FPS in high resolution and I prefer the size of everything when rendered at 640x480.

Share this post


Link to post
Share on other sites

To keep tight control over the stretching/filtering, you could render your entire scene to a render target and display that on a 'fullscreen' quad at the end of the frame (fullscreen meaning, fitting the client area). When rendering the quad, you'll effectively be re-sampling the scene with whatever filtering you want.

Share this post


Link to post
Share on other sites
As I said before - I do not desire or need to call Reset().

Stretching via Present() works perfectly except when running with Aero disabled on Vista.

Share this post


Link to post
Share on other sites
Not desiring to do something, doesn't mean that you are right, only maybe lack of skill/experience to do some tasks, or know certain things.

The first error will show, when you start your program and change desktop resolution with program running, so handling lost devices is kind of essential in this case. That means that you will need to handle reseting of device if you want to have your program running without bugs.

Normally AERO is handled from directx, meaning that when aero is enabled, possibly you have pre-setted the render states of your device, and when the aero is disabled, those render states are different.

Eventually comparing render states when aero is on/off, will show you differences, and what you need to set, to work it properly.

Share this post


Link to post
Share on other sites

Quote:
Original post by pathon
Could you post some example pseudo-code for this?


It's basically the typical post-processing setup, going a bit like this each frame:


  1. (begin drawing)
  2. Set render target on the device
  3. Render entire scene to the target
  4. Wrap up rendering to the target, iirc using EndScene
  5. Set the render target as a texture on the device
  6. Draw a fullscreen quad with the texture applied and the filtering of your choice
  7. Present
  8. (done)


I'm not quite sure how various steps need to be implemented in C++/DX, but I think the DX SDK has a few samples (look for post-processing and be sure to check the help on that SetRenderTarget method) and many only tutorials should also provide info on how to set this up.

Rereading pathon's last comment though, if there really are differences in the render states/sampler filter settings you might want to try explicitly setting the differing states to the values that work for you. It sure beats going the long way around with my suggestion, unless you were planning to do some post-processing anyway.

Share this post


Link to post
Share on other sites
I set different values for samplerstates and it didn't help, I also read the sdk post-processing tutorial and didn't understand it. I followed some tutorials and they didn't work. :(

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!