mip map distance

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Pr3t3nd3r
Posts: 186
Joined: Tue Feb 08, 2005 6:02 pm
Location: Romania
Contact:

mip map distance

Post by Pr3t3nd3r »

cand anyone give me some sugestions how i cand cange the distance at what the mip maps are generated and used ?
Pr3t3nd3r
Posts: 186
Joined: Tue Feb 08, 2005 6:02 pm
Location: Romania
Contact:

Post by Pr3t3nd3r »

OK OK. please. not all in the same time.

The answer (basically this seems to be the universal answer i get ...) is it is impossible.
Mip map are used when they are need'it and that' id you can't change that.

The problem is that mip maps gets blurred. And very small texture 32/32 and lower are so blurred that them are containing much useful information...

An way to get better textures (non blurred) will be an bether algorithm for:

copy32BitMipMap
copy16BitMipMap ...
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

After a quick 2 second search through DirectX 9 Help File

http://msdn.microsoft.com/library/defau ... exture.asp

Notice the 3rd parameter, specifying the # of mip map levels for this texture.

Quick search through Irrlicht code for CreateTexture in DX9 code revealed -

Code: Select all

	hr = Device->CreateTexture(
		TextureSize.Width,
		TextureSize.Height,
		1, // mip map level count, we don't want mipmaps here
		D3DUSAGE_RENDERTARGET,
		d3DFormat,
		D3DPOOL_DEFAULT,
		&Texture,
		NULL);
and

Code: Select all

	hr = Device->CreateTexture(optSize.Width, optSize.Height,
		mipmaps ? 0 : 1, // number of mipmaplevels (0 = automatic all)
		usage, // usage
		format, D3DPOOL_MANAGED , &Texture, NULL);
and

Code: Select all

		hr = Device->CreateTexture(optSize.Width, optSize.Height,
			(flags & ETCF_CREATE_MIP_MAPS) ? 0 : 1, // number of mipmaplevels (0 = automatic all)
			0, D3DFMT_A1R5G5B5, D3DPOOL_MANAGED, &Texture, NULL);
Seems this is used, because of some bug when linking in DX8

D3DXFilterTexture

The engine would need some modifications, but it's more than possible.
Image
Pr3t3nd3r_guest

Post by Pr3t3nd3r_guest »

Is used 1 because it use
copy32BitMipMap
copy16BitMipMap

I don't know if using the automatic generated textures generated by direct x will get better quality ... (i think they use the same algorithm ...)

... a possibility to manually add all mip maps will be cool too ...
Pr3t3nd3r_guest

Post by Pr3t3nd3r_guest »

an other think i love to test if is possble is to disable textures from 32/32 and lower resolution (and to use for them 64/64) ...
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

Tip: try to comment the line #define _IRR_COMPILE_WITH_DIRECTX_8_ in file IrrCompileConfig.h and recompile Irrlicht. You will notice that mip-map levels will have much more quality... But DirectX8 will be disabled...
Post Reply