Quote: "Are you sure the images you create do not have mipmaps already?"
No. That was the point of my post. I have done DX programming:
Quote: "
*** from msdn help *****
HRESULT D3DXCreateTextureFromFileEx(
__in LPDIRECT3DDEVICE9 pDevice,
__in LPCTSTR pSrcFile,
__in UINT Width,
__in UINT Height,
__in UINT MipLevels,
__in DWORD Usage,
__in D3DFORMAT Format,
__in D3DPOOL Pool,
__in DWORD Filter,
__in DWORD MipFilter,
__in D3DCOLOR ColorKey,
__inout D3DXIMAGE_INFO *pSrcInfo,
__out PALETTEENTRY *pPalette,
__out LPDIRECT3DTEXTURE9 *ppTexture
);
"
Note the "UINT MipLevels" parameter. This tells the load funtion to either use the mip levels of the file or create them. I don't know what DGDK does in this case..... Perhaps DGDK has a default mip level it uses...?
The major question is "does DGDK use mip levels?":
Quote: "*** from msdn help *****
HRESULT D3DXCreateTextureFromFileInMemoryEx(
__in LPDIRECT3DDEVICE9 pDevice,
__in LPCVOID pSrcData,
__in UINT SrcDataSize,
__in UINT Width,
__in UINT Height,
__in UINT MipLevels,
__in DWORD Usage,
__in D3DFORMAT Format,
__in D3DPOOL Pool,
__in DWORD Filter,
__in DWORD MipFilter,
__in D3DCOLOR ColorKey,
__inout D3DXIMAGE_INFO *pSrcInfo,
__out PALETTEENTRY *pPalette,
__out LPDIRECT3DTEXTURE9 *ppTexture
);
"
Again, notice the "UINT MipLevels"......
If it does (or doesn't), I would like to know. If it doesn't, I would like to know if there is a way.
@Hassan,
It's not just a matter of making a series of half-sized images, it's a matter of sending those images to the video card to use like a single image. As the object gets further away from the camera (or simply smaller sized in the view), a high-res version of the texture is not needed. Using a smaller mip makes the object render faster.
The fastest code is the code never written.