English 中文(简体)
Stretch blit in DirectX results in jagged edges
原标题:

I have a Direct3D app which runs windowed or fullscreen at a fixed res (say 800x600). To support widescreen modes, I render to the back buffer at 800x600 and then use Blt to draw the final frame into a portion of the front buffer, which is usually bigger (say 1280x720), so the 800x600 image is stretched to 960x720 to maintain the aspect ratio.

This works fine, except in some video cards/OS/driver combination (nVidia Quadro, DX11, Windows 7) where the blit appears to be done using point sampling, resulting in jagged edges and a generally unsmooth final image.

Is there any way to avoid this? For example, force Blt to use a linear filter when scaling up?

(Note : I know I can render the original 800x600 assets to 960x720 instead of stretching at the end, but that has other drawbacks, so stretching at the end is the preferred solution)

最佳回答

I don t think there is any way to control this. I read something saying that this behavour changed in windows7 with some drivers but I can t find the reference now.

You could perhaps render to a texture at 800x600 and then draw a full screen quad using this texture at the actual screen size. Then at least you could control the filtering.

问题回答

Have you considered rendering the scene to a texture and then rendering that texture to the backbuffer stretched? This will give you bilerping.

The reason it works on some machines is that this is exactly how the blit will be implemented by the driver

To get best results, though, you REALLY are betetr off just rendering to the proper sized backbuffer. ie if you want 1280x720 ... render to a 1280x720 back buffer with the appropriate field of view and aspect ratio modifications.





相关问题
Prerequisite for learning directx

I am from .net C# background and I want to learn DirectX. I have knowledge of C++ but I am fairly new to graphic world. I am little confused about how to start learning directx, should I start ...

How to programmatically disable the auto-focus of a webcam?

I am trying to do computer vision using a webcam (the model is Hercules Dualpix). I know it is not the ideal camera to use, but I have no choice here. The problem is the auto-focus makes it hard/...

Making an object orbit a fixed point in directx?

I am trying to make a very simple object rotate around a fixed point in 3dspace. Basically my object is created from a single D3DXVECTOR3, which indicates the current position of the object, ...

3d Alternative for D3DXSPRITE for billboarding

I am looking to billboard a sun image in my 3d world (directx 9). Creating a D3DXSPRITE is great in some cases, but it is only a 2d object and can not exist in my "world" as a 3d object. What is ...

热门标签