1
votes

I am trying to replace my GDIPlus rendering with Direct3D. I am rendering some large images of the order (10K x 10K) and it gets really slow with GDI. I am now rendering the image as texture onto a Quad using Direct3D. The image does render but the quality is really off when the image is zoomed out.

I am using the following filters.

m_pDevice3D->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
m_pDevice3D->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
//m_pDevice3D->SetSamplerState(0, D3DSAMP_MAXANISOTROPY, 4);
m_pDevice3D->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR);

I have already tried rendering using Anisotropic filter already with no significant improvement.

1
screenshots might help? - MuertoExcobito

1 Answers

1
votes

You can not render a large image on a small surface with a good quality without paying the price of an extensive filtering.

This is a signal processing issue named aliasing. To reproduce a signal, you need a medium that has at least twice the resolution or the spectrum will fold on itself.

In 3D rendering, the typical way to do it is by generating a mipchain. It consists of pre filtered version of the image dividing the resolution by two until we reach a size of 1x1. The GPU is then able to pick the proper version.

If your image is dynamic, and you know the display area, you will prefer a runtime filtering, but to do that with a GPU, you will have to recent direct x version with shaders or work with temporary offscreen surface to ping pong the reduction step by step.