Fuzzy images?
When 0.5/width and 0.5/height were mentioned, they meant width and height of the texture (ie: 0.5/16). Also you're not drawing it 1:1, as someone pointed out. You're drawing from (0,0) to (5,-5), not (0,0) to (16, 16)
D3DXCreateTextureFromFileEx(g_App.GetDevice(), //device "leaf.png", //file name D3DX_DEFAULT, //width D3DX_DEFAULT, //height D3DX_DEFAULT, //mip levels NULL, //usage D3DFMT_UNKNOWN, //texture color format D3DPOOL_MANAGED, //memory class D3DX_FILTER_NONE, //filter ----------------------[important] D3DX_FILTER_NONE, //mip filter ----------------------[important] 0, //no color key (NEW) NULL, //source info NULL, //pallette &pLeafTexture); //texture object
This would work in my days..
Ok, I have changed the min and mag filters to D3DTEXF_POINT. The image is a LOT better. There is still a little problem because the image get's blurry very quickly when I zoom out, but it doesn't matter too much...
Anyway, thank you everyone for helping!
Anyway, thank you everyone for helping!
Try offseting the u, v by 0.5/width or 0.5/height,
setting the x, y to the same of texture size,
and setting the filter to D3DTEXF_LINEAR,
then you can get a sharp image with smooth zooming.
I came into the same problem of you and resolved by that.
setting the x, y to the same of texture size,
and setting the filter to D3DTEXF_LINEAR,
then you can get a sharp image with smooth zooming.
I came into the same problem of you and resolved by that.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement