c++ - Direct3D9: after enabling mipmaps my texture coordinates seem to be wrong -


i have texture contains symbols , characters use put strings , icons on final render target. produce string example, render every character single quad appropriate texture coordinates.

my problem starts when try use mipmaps texture containing symbols. without mipmaps, works intended. after changing createtexture() call generate mip levels , adding d3dusage_autogenmipmap usage parameter, garbled output this:

enter image description here

the texture created this:

createtexture(width, height, 0, d3dusage_dynamic | d3dusage_autogenmipmap, d3dfmt_a8r8g8b8, d3dpool_default, &m_texture, nullptr); 

i use following texture filtering when rendering:

setsamplerstate(0, d3dsamp_minfilter, d3dtexf_linear); setsamplerstate(0, d3dsamp_magfilter, d3dtexf_linear); setsamplerstate(0, d3dsamp_mipfilter, d3dtexf_linear); 

everything rendered still part of texture texture coordinates seem wrong somehow. tried debugging issue pix there render target looks intended. (i believe, pix uses software rendering while gpu nvidia quadro latest drivers.)

i don't know should keep looking. texture coordinates should correct works without mipmaps. did miss when switching on mipmapping texture? ideas causing this?

edit: tried reference driver (d3ddevtype_ref instead of d3ddevtype_hal) , have same problem, suggests it's not driver issue in application code. still, have no idea it's working if don't use mipmaps.


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -