skybox 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.
oldskoolPunk
Posts: 199
Joined: Wed Nov 29, 2006 4:07 am

skybox texture quality

Post by oldskoolPunk »

Hi again.

I am adding a skybox to my scene using the example code in the terrain rendering tutorial. My texture is a simple gradient 1024 image. The gradient looks smooth in Gimp, but when rendered on my skybox in Irrlicht it looks striped. Does anyone have any tips on making the gradient look as smooth on my skybox as it does in Gimp?
Image
Signature? I ain't signin nuthin!
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Are you calling this before creating the textures?

Code: Select all

driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
oldskoolPunk
Posts: 199
Joined: Wed Nov 29, 2006 4:07 am

Post by oldskoolPunk »

Thank you for responding. Yes I am calling this before and after, like in the terrain example demo.

Code: Select all

driver->setTextureCreationFlag(irr::video::ETCF_CREATE_MIP_MAPS, false);
    scenemanager->addSkyBoxSceneNode( 
                                      driver->getTexture("top.bmp"),	
                                      driver->getTexture("bottom.bmp"),	
                                      driver->getTexture("sides.bmp"),	
                                      driver->getTexture("sides.bmp"),	
                                      driver->getTexture("sides.bmp"),	
                                      driver->getTexture("sides.bmp"));
    driver->setTextureCreationFlag(irr::video::ETCF_CREATE_MIP_MAPS, true);
I have tried tga and bmp at size 1024.
Signature? I ain't signin nuthin!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I guess this is the old dx bug with improper device choice. At least you should have asked for 32bit depth!? But it seems to happen from time to time that some devices choose 16bit screens. Try to use OpenGL, try to play with the depth setting, try fullscreen and windowed mode, etc.
oldskoolPunk
Posts: 199
Joined: Wed Nov 29, 2006 4:07 am

Post by oldskoolPunk »

Hi thanks for the idea.

I am using openGL, with this call, also asking for 32 bit color...

Code: Select all

irr::IrrlichtDevice *device = irr::createDevice(irr::video::EDT_OPENGL,irr::core::dimension2d<irr::s32>(800,600),32,false,false,false,&receiver);
I tried fullscreen and got the same results. When I use the Direct3D9 renderer, the sky texture is smooth! But I would prefer to use OpenGL because I am in the process of learning a little bit about GLSL.

I am running this on an older graphics card, a Geforce 5500 FX, but I am using updated drivers. Could this be the problem?
Signature? I ain't signin nuthin!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hmm, I thought it was dx, nvm. There's a new init scheme for OpenGL under Windows found in the code snippets or bug forum. It also supports anti-aliasing for Windows/OpenGL. You might want to test that one. It will probably go into the library anytime soon, but I cannot tell you a date.
Just to make sure, you also have the latest Irrlicht version? Because older versions had problems with depth buffer choice. That could also be a problem here, maybe the chosen depth value cannot be provided and the screen depth is lowered instead (not that the two depths have anything in common, it's related by other reasons...)
oldskoolPunk
Posts: 199
Joined: Wed Nov 29, 2006 4:07 am

Post by oldskoolPunk »

Thank you again Hybrid.
I have tried versions 1.3 and 1.3.1 they both have the same striping to the skybox texture. I tried a skydome (which I think im going to like better!) but it has the same striping colors.
I have applied the same blue gradient texture to my terrain and my character, and the striping effect is only seen on the skybox or skydome.
Image

I have not tried the latest version yet, because I know when I download it and try to use it, it will break my DirectX :( I always have to try to find a "special" build to get the DX renderer to work. Why can't the official builds render with DirectX? Is there some sort of legal issue? Or do they just not like DirectX lol.

Edit: I found an awesome little trick for converting skybox textures into one spherical skydome texture!
Signature? I ain't signin nuthin!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

There should be a dx supporting version on the FAQ forum, provided by garritg. This is only necessary for mingw compilation, the MSVC libs to include dx support. The problem is that the official dev-c++ dx devpak does only include debug libraries. These are not allowed for distribution.
You can just try the examples from the 1.4 SDK, you will spot any difference already there.
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Do this.

Code: Select all

driver->setTextureCreationFlag(video::ETCF_ALWAYS_32_BIT, true);
Irrlicht does by default use 16bit depth. This is forcing all to 32bit.

I had the same problem with my skybox for my first demo.
This as corrected the problem.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, Irrlicht should do 32bit textures from jpg images, unless you have a 16bit device or force to 16bit somehow. I'll check the code, though, to be really sure.
oldskoolPunk
Posts: 199
Joined: Wed Nov 29, 2006 4:07 am

Post by oldskoolPunk »

Thank you christianclavet. But unfortunately that did not work either. I also tried it as a jpg (saving it at 100% quality) but it still had stripes. I saved it from GIMP as a 32bit bmp (X8R8G8B8) and the texture showed up white in both openGL and DirectX. Dunno what that means.
I will download the new sdk tonight and give it a go.
Signature? I ain't signin nuthin!
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Irrlicht doesn't support 32bit bmps i don't think. They're just 32bit cos they have an alpha channel i think so you don't need to go that high for a skybox image so try it as a 24bit bmp and see if that's better than the jpg.
Image Image Image
sp00n
Posts: 114
Joined: Wed Sep 13, 2006 9:39 am

Post by sp00n »

Are you use a 1024x1024 textures for skybox?
Similar thing occured when I'd use a 128x128 textures, but now i'm using 512x512 and all showns good (both for jpg and png and bmp24 formats)
And one more question - what is your screen resolutiuon set at your project?
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Strange. It should have worked. Normally when we see stripes, when there should be a clean gradient, it's because your color depth sample is too low (mostly seen 16 bit display or texture depth). Can you check your display settings of your video cards? (OGL or DX setting for display depth). Also you also MUST set your display depth of IRRlich device to 32bits.

32Bit pictures (RGBA) are only used when you need an alpha(transparency) channel. It's not used in the same way as the display depth. Also a JPEG picture are always 24bit depht (RGB), or 8Bit if in greyscale. From the pictures you've sent so far, I don't see the banding here.

Hybrid: that answer came from my personal experience on Windows, using the DirectX9 driver. I HAD to force 32bits on the skybox so that it would be clean. (Asked the forum when I had the problem the first time)
oldskoolPunk
Posts: 199
Joined: Wed Nov 29, 2006 4:07 am

Post by oldskoolPunk »

JP, thanks for the info. So thats why they turn white. No matter to me anyways, I prefer .tga . But sadly, no, 24bit bmp was my first try after tga and it looks the same (striped)

sp00n, I am testing all this at 800x600. After reading your post I did test at higher resolutions, but got the same effect. Ive also tried 512 and 256 sized textures, getting the same effect.

christianclavet, thanks alot for the in-depth reply. I have tried it at 16bits just to see what it looks like. The stripes (ok banding :) is MUCH worse then, so I am fairy sure that everything is set to 32bits. I am sorry about the low quality of my above images. The banding is difficult to see in them, but it is showing up here on my monitor. I admit, it is faint, but is very clearly there, especially in full screen gameplay.

Maybe this is a problem with my specific setup?
Image[/img]
Signature? I ain't signin nuthin!
Post Reply