The skybox is backwards?

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
ispeedonthe405
Posts: 3
Joined: Mon Sep 17, 2007 7:35 pm
Location: Orange County, CA
Contact:

The skybox is backwards?

Post by ispeedonthe405 »

I used 'search' first so don't yell at me.

Screenshot says it all:

http://www.ispeedonthe405.com/pics/screenshot.jpg

I've tried this with multiple formats, and in the samples as well as my own project, with the same results. The texture is about as simple as you can get:

http://www.ispeedonthe405.com/pics/def_skybox.png

I'm not doing anything tricky with the code, either:

Code: Select all

// default skybox
video::ITexture* pTex = m_VideoDriver->getTexture( "Textures\\def_skybox.png" );
m_SceneManager->addSkyBoxSceneNode( pTex, pTex, pTex, pTex, pTex, pTex ); 

What's the deal?
mybrainisfull
Posts: 15
Joined: Sun Jul 29, 2007 4:51 pm
Location: State College, PA

Post by mybrainisfull »

http://irrlicht.sourceforge.net/phpBB2/ ... rt+texture

This is a discussion about something else but people have posted the solution to your problem
ispeedonthe405
Posts: 3
Joined: Mon Sep 17, 2007 7:35 pm
Location: Orange County, CA
Contact:

Post by ispeedonthe405 »

No, that doesn't actually solve the problem.

I'll just mirror the skybox textures before I export them. Works fine.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

There's an older patch for that here: http://irrlicht.sourceforge.net/phpBB2/ ... torder=asc

I think I used that patch and it worked (I'm not 100% sure if it was from this thread, as I did patch that more than a year ago and had completely forgotten about it).
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
ispeedonthe405
Posts: 3
Joined: Mon Sep 17, 2007 7:35 pm
Location: Orange County, CA
Contact:

Post by ispeedonthe405 »

Maybe that did work under an earlier version but in the current build you end up with only one poly on each face. Or at least, I do.

The following however does work; each face is textured as you'd expect looking towards each direction:

http://www.ispeedonthe405.com/pics/forward.jpg
http://www.ispeedonthe405.com/pics/back.jpg
http://www.ispeedonthe405.com/pics/left.jpg
http://www.ispeedonthe405.com/pics/right.jpg
http://www.ispeedonthe405.com/pics/up.jpg
http://www.ispeedonthe405.com/pics/down.jpg

Code: Select all

// create front side

Material[2] = mat;
Material[2].Textures[0] = front;
Vertices[8]  = video::S3DVertex( l,-l, l, 0,0,1, video::SColor(255,255,255,255), t, t);
Vertices[9]  = video::S3DVertex(-l,-l, l, 0,0,1, video::SColor(255,255,255,255), o, t);
Vertices[10] = video::S3DVertex(-l, l, l, 0,0,1, video::SColor(255,255,255,255), o, o);
Vertices[11] = video::S3DVertex( l, l, l, 0,0,1, video::SColor(255,255,255,255), t, o);

// create left side

Material[3] = mat;
Material[3].Textures[0] = left;
Vertices[12] = video::S3DVertex(-l,-l, l, -1,0,0, video::SColor(255,255,255,255), t, t);
Vertices[13] = video::S3DVertex(-l,-l,-l, -1,0,0, video::SColor(255,255,255,255), o, t);
Vertices[14] = video::S3DVertex(-l, l,-l, -1,0,0, video::SColor(255,255,255,255), o, o);
Vertices[15] = video::S3DVertex(-l, l, l, -1,0,0, video::SColor(255,255,255,255), t, o);

// create back side

Material[0] = mat;
Material[0].Textures[0] = back;
Vertices[0] = video::S3DVertex(-l,-l,-l, 0,0,-1, video::SColor(255,255,255,255), t, t);
Vertices[1] = video::S3DVertex( l,-l,-l, 0,0,-1, video::SColor(255,255,255,255), o, t);
Vertices[2] = video::S3DVertex( l, l,-l, 0,0,-1, video::SColor(255,255,255,255), o, o);
Vertices[3] = video::S3DVertex(-l, l,-l, 0,0,-1, video::SColor(255,255,255,255), t, o);

// create right side

Material[1] = mat;
Material[1].Textures[0] = right;
Vertices[4] = video::S3DVertex( l,-l,-l, 1,0,0, video::SColor(255,255,255,255), t, t);
Vertices[5] = video::S3DVertex( l,-l, l, 1,0,0, video::SColor(255,255,255,255), o, t);
Vertices[6] = video::S3DVertex( l, l, l, 1,0,0, video::SColor(255,255,255,255), o, o);
Vertices[7] = video::S3DVertex( l, l,-l, 1,0,0, video::SColor(255,255,255,255), t, o);

// create top side

Material[4] = mat;
Material[4].Textures[0] = top;
Vertices[16] = video::S3DVertex( l, l, l, 0,1,0, video::SColor(255,255,255,255), t, t);
Vertices[17] = video::S3DVertex(-l, l, l, 0,1,0, video::SColor(255,255,255,255), o, t);
Vertices[18] = video::S3DVertex(-l, l,-l, 0,1,0, video::SColor(255,255,255,255), o, o);
Vertices[19] = video::S3DVertex( l, l,-l, 0,1,0, video::SColor(255,255,255,255), t, o);

// create bottom side

Material[5] = mat;
Material[5].Textures[0] = bottom;
Vertices[20] = video::S3DVertex(-l,-l, l, 0,-1,0, video::SColor(255,255,255,255), o, o);
Vertices[21] = video::S3DVertex( l,-l, l, 0,-1,0, video::SColor(255,255,255,255), t, o);
Vertices[22] = video::S3DVertex( l,-l,-l, 0,-1,0, video::SColor(255,255,255,255), t, t);
Vertices[23] = video::S3DVertex(-l,-l,-l, 0,-1,0, video::SColor(255,255,255,255), o, t);
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I have fixed the skybox. You need to update existing skyboxes, though. Exchange right and left texture, rotate up-texture 270 degrees clockwise, and rotate down-texture 90 degrees clockwise.
I have checked the new orientation with TerraGen skyboxes which work out of the box.
Post Reply