Difference of Rendering texture

Started by
1 comment, last by wexuv 18 years, 3 months ago
There's 1 pixel offset of rendering texture on different video card. how to resovle this problem? reference: 1. if(FAILED(m_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &m_d3dpp, &m_pD3DDevice))) { .... } but when i set D3DDEVTYPE = D3DDEVTYPE_REF, it not appears any difference on different video card, but runs very slowly. 2. use sis* card D3DPRESENT_PARAMETERS m_d3dpp; m_d3dpp.BackBufferWidth = windowWidth; m_d3dpp.BackBufferHeight = windowHeight; ..... i set windowWidth = 400,windowHeight = 300, no difference but when i set windowWidth = 300, windowHeight = 200,some textures appear 1 pixel offset; 3. all render correctly on my intel 82865 card.
Advertisement
The reason you get the same results output with D3DDEVTYPE_REF is because D3DDEVTYPE_REF tells DirectX to run in software mode. This means that instead of letting the graphics adaptor sweat, you put all load on the processor.

Since the software implementation is the same on all computers, the outcome is the same.

However, with D3DDEVTYPE_HAL you tell DirectX to use hardware acceleration. Since graphics adapters differ slightly in its implementation, it sometimes results in unwanted graphical glitches.

The solution to this depends on the context, but experiment with valus to get it look OK. You can also "camoflague" the 1px offset with some skilled artistic work :).

For instance, try to move the texture 0.05f or something similar, if you are lucky this small change will make all graphical adapters to come up with the same final on-screen position.
[s]--------------------------------------------------------[/s]chromecode.com - software with source code
i use OpenGL to get always the same result. but render a little slower than d3d.
and in OpenGL there's another problem with drawing a line, the reason is
that "Filled primitives and line primitives follow different rules for rasterization".mabey it's the same reason in d3d,i'll try as you said. thank you,Enselic.

This topic is closed to new replies.

Advertisement