Bad texture quality

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
ejik
Posts: 6
Joined: Mon May 18, 2009 6:22 am

Bad texture quality

Post by ejik »

Hello!

I am new to Irrlicht and I am writing a small FPS simulator.
The problem is that texture details of objects are very bad starting from some (not very big) distance from the camera.

My hardware is DELL Latitude D630 laptop with graphics card based on Intel 965 chipset, 1GB of RAM, 2GHz of CPU speed.
This was enough for playing such games as Medal of Honour Pacific Assault with pretty good video quality, or MSFS2004...

My code of creating device:

Code: Select all

dev_params.AntiAlias			= true;
	dev_params.Bits					= 32;
	dev_params.DriverType			= video::EDT_DIRECT3D9;
	dev_params.Fullscreen			= true;
	dev_params.HighPrecisionFPU		= true;
	dev_params.Vsync				= true;
	dev_params.WindowSize			= dimension2d<s32>(640, 480);
	dev_params.Stencilbuffer		= true;
	dev_params.WithAlphaChannel		= true;
	dev_params.ZBufferBits			= 32;

	device = createDeviceEx(dev_params);
640x480 is prerequisite for my application. However I tried to use higher resolutions but result was same - bad texture details for distanced objects.

The application starts and bevahes normally, but in the console window I can see following message:
Anti aliasing disabled because hardware/driver lacks necessary caps.

So, is there any chance to improve graphics quality in my situation?

Thanks in advance
Cloudef
Posts: 123
Joined: Wed Dec 03, 2008 9:02 pm
Location: Finland

Post by Cloudef »

32 bit textures higher resolution on textures, correct uvw on models, mipmaps and AF.
CuteAlien
Admin
Posts: 9930
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Use another texture filtering. You can enable the material flags for EMF_TRILINEAR_FILTER and EMF_ANISOTROPIC_FILTER to improve texture rendering (costs certainly some speed).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

this is what comes first to my mind when I read "Bad texture quality":
are you using POT textures !?!?! ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
ejik
Posts: 6
Joined: Mon May 18, 2009 6:22 am

Post by ejik »

CuteAlien wrote:Use another texture filtering. You can enable the material flags for EMF_TRILINEAR_FILTER and EMF_ANISOTROPIC_FILTER to improve texture rendering (costs certainly some speed).
These parameters are set via irrEdit. But even with them I have bad quality.
ejik
Posts: 6
Joined: Mon May 18, 2009 6:22 am

Post by ejik »

Cloudef wrote:32 bit textures higher resolution on textures, correct uvw on models, mipmaps and AF.
Textures are true color high resolution BMP.
Object is a simple rectangle with one face. coordinates of textures are correct. BTW, where can I see/correct mipmaps or AF?
ejik
Posts: 6
Joined: Mon May 18, 2009 6:22 am

Post by ejik »

Acki wrote:this is what comes first to my mind when I read "Bad texture quality":
are you using POT textures !?!?! ;)
Sorry, I don't know what is POT :oops:
But I use BMP texture. One of them is 1841x1839 BMP file 24bit color depth.
loki1985
Posts: 214
Joined: Thu Mar 31, 2005 2:36 pm

Post by loki1985 »

ejik wrote:Sorry, I don't know what is POT :oops:
But I use BMP texture. One of them is 1841x1839 BMP file 24bit color depth.
POT: power of two (as in 2,4,8,16,32,64,128,256 etc).

neither 1841 nor 1839 is POT, as Acki said that is a potential problem (and probably the issue).
Cloudef
Posts: 123
Joined: Wed Dec 03, 2008 9:02 pm
Location: Finland

Post by Cloudef »

Even your bmp(God who uses bmp's still?) is 32 bit you have to set texture creation flag to 32 bit. There is also texture quality flags if i remember right (Optimize for speed, optimize for quality) And even your object is simple triangle, its uvw's can be so that it makes your texture look really fuzzy. So try to scale uvw down.
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

Thats not really correct. For BMP 1, 4, 8, 16, 24 oder 32 bpp are allowed. And by the way. BMPs are not bad at all. Just try to compress 10 images as png. Then save these images as BMP and compress them. In my test the archive with the BMPs has a better ratio.
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

Yes of course. Because PNGs are already compressed.
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
ejik
Posts: 6
Joined: Mon May 18, 2009 6:22 am

Post by ejik »

I have done like all you guys said, i.e. forced 32bit textures and modified texture to be POT (I made it 512x512 JPG) and it seems to be better.

Thanks!
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

@Sylence you got the point ;) thats why BMPs are not bad at all. Its a nice "straight forward" format.
loki1985
Posts: 214
Joined: Thu Mar 31, 2005 2:36 pm

Post by loki1985 »

Nox wrote:@Sylence you got the point ;) thats why BMPs are not bad at all. Its a nice "straight forward" format.
so BMPs are "not bad at all" because they are uncompressed?
BMP is a shitty format, mostly because a lot of different incompatible versions exist (per definition and implementation, not widespreadness). not very straightforward. if you want straightforward, use (uncompressed) TGA.

and PNG is kinda like TGA with compression in an container format which supports thirdparty extensions and metadata.

and best of all: it is standardised.
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

Well, im not very experienced concerning the formatdefinitions and standards. BMP has its disadvantages too thats right i.e. missing alphachannel. But i only know that loading a BMP is very easy and i had never problems with BMPs. Im sorry that i dont blame a format for being not under public control or whatever. Im more the "userguy". If it works, is easy to use for my purpose and is not to restrictive i normally have no problem to use it. By the way i use png, jpg, gif, tiff, tga etc. too....
Post Reply