Skybox problem

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.
Post Reply
Marcos Triviño
Posts: 12
Joined: Wed Mar 03, 2010 3:38 pm

Skybox problem

Post by Marcos Triviño »

Hi all,

i am a little problem with my skybox, because I see the intersection line.
and i unknow how i can resolved this problem.

Image


Thank for your help.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Try to disable mipmaps while loading the skybox textures. It should solve that issue. Also look into the texture clamp mode.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
polylux
Posts: 267
Joined: Thu Aug 27, 2009 12:39 pm
Location: EU

Post by polylux »

Yup, that's a bit annoying in the case the skybox is loaded with the scene (via loadScene()).
beer->setMotivationCallback(this);
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

I have the same problem but didn't (yet) find a solution.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
freetimecoder
Posts: 226
Joined: Fri Aug 22, 2008 8:50 pm
Contact:

Post by freetimecoder »

Me too, all you can do ist making the lines thinner, but I could never get them to disappear. Depending on the resolution of your game it can be really annoying.
Dareltibus
Posts: 115
Joined: Mon May 17, 2010 7:42 am

try this

Post by Dareltibus »

maybe your hardware loss a bit of precision during some float operation.. try to copy the sky box class directly from irrlicht source files (obviously renaming it in a different way) and change just these numbers

Code: Select all


class CSkyBoxSceneNodeTWO : public ISceneNode
	{


	//(...) start editing from here

        f32 b=0.9999; //you can adjust here as you wish now ;-)

	// create front side


	Material[0] = mat;
	Material[0].setTexture(0, front);
	Vertices[0] = video::S3DVertex(-1,-1,-b, 0,0,1, video::SColor(...), t, t);
	Vertices[1] = video::S3DVertex( 1,-1,-b, 0,0,1, video::SColor(...), o, t);
	Vertices[2] = video::S3DVertex( 1, 1,-b, 0,0,1, video::SColor(...), o, o);
	Vertices[3] = video::S3DVertex(-1, 1,-b, 0,0,1, video::SColor(...), t, o);

	// create left side

	Material[1] = mat;
	Material[1].setTexture(0, left);
	Vertices[4] = video::S3DVertex( b,-1,-1, -1,0,0, video::SColor(...), t, t);
	Vertices[5] = video::S3DVertex( b,-1, 1, -1,0,0, video::SColor(...), o, t);
	Vertices[6] = video::S3DVertex( b, 1, 1, -1,0,0, video::SColor(...), o, o);
	Vertices[7] = video::S3DVertex( b, 1,-1, -1,0,0, video::SColor(...), t, o);

	// create back side

	Material[2] = mat;
	Material[2].setTexture(0, back);
	Vertices[8]  = video::S3DVertex( 1,-1, b, 0,0,-1, video::SColor(...), t, t);
	Vertices[9]  = video::S3DVertex(-1,-1, b, 0,0,-1, video::SColor(...), o, t);
	Vertices[10] = video::S3DVertex(-1, 1, b, 0,0,-1, video::SColor(...), o, o);
	Vertices[11] = video::S3DVertex( 1, 1, b, 0,0,-1, video::SColor(...), t, o);

	// create right side

	Material[3] = mat;
	Material[3].setTexture(0, right);
	Vertices[12] = video::S3DVertex(-b,-1, 1, 1,0,0, video::SColor(...), t, t);
	Vertices[13] = video::S3DVertex(-b,-1,-1, 1,0,0, video::SColor(...), o, t);
	Vertices[14] = video::S3DVertex(-b, 1,-1, 1,0,0, video::SColor(...), o, o);
	Vertices[15] = video::S3DVertex(-b, 1, 1, 1,0,0, video::SColor(...), t, o);

	// create top side

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

	// create bottom side

	Material[5] = mat;
	Material[5].setTexture(0, bottom);
	Vertices[20] = video::S3DVertex( 1,-b, 1, 0,1,0, video::SColor(...), o, o);
	Vertices[21] = video::S3DVertex( 1,-b,-1, 0,1,0, video::SColor(...), t, o);
	Vertices[22] = video::S3DVertex(-1,-b,-1, 0,1,0, video::SColor(...), t, t);
	Vertices[23] = video::S3DVertex(-1,-b, 1, 0,1,0, video::SColor(...), o, t);

	//(...) end editing

	}

the box is a cube. if the face are not meeting on the edges I just move the face a bit in the direction of the center. collapsing them without touching the total surface of each single face. if something wrong with this metod and you see some strange artifact along the corners try also putting this variable to true

Code: Select all

mat.ZWriteEnable = false; //-> mat.ZWriteEnable = true;
but i think now is ok. just catch the right "b" value. (i think it is between 0.999 and 0.99999 anyway)

P.S. the color are always
video::SColor(255,255,255,255)
i just written
video::SColor(...)
to save space

i hope this will works ;-)
Marcos Triviño
Posts: 12
Joined: Wed Mar 03, 2010 3:38 pm

Post by Marcos Triviño »

Hi BlindSide,

I added this line before the load of the scene.

driver->setTextureCreationFlag(video::ETCF_CREATE_MIP_MAPS, false);


But it works so and so only on some scenaries...

What most surprises me is that in the irrEdit look good the skybox textures

other comments,
when I apply this line all objects look more brighter.

***
I now will see the Dareltibus idea.

Thanks you.
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Well ... I guess that with the line you added before loading the scene it is completely loaded without mipmaps. Don't think this is such a good idea.

The problem doesn't occur in IrrEdit, that's right. It wasen't there in my projects before I switched to Irrlicht 1.7 (or 1.6? can't remember). I just noticed it in earlier version when using the OpenGL driver. As IrrEdit uses DirectX and still Irrlicht 1.5 the problem is not there. I hope there will be a fix for this in the next release, but I posted this topic in the bug reports forum a while ago.
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Marcos Triviño
Posts: 12
Joined: Wed Mar 03, 2010 3:38 pm

Post by Marcos Triviño »

Brainsaw wrote:Well ... I guess that with the line you added before loading the scene it is completely loaded without mipmaps. Don't think this is such a good idea.

The problem doesn't occur in IrrEdit, that's right. It wasen't there in my projects before I switched to Irrlicht 1.7 (or 1.6? can't remember). I just noticed it in earlier version when using the OpenGL driver. As IrrEdit uses DirectX and still Irrlicht 1.5 the problem is not there. I hope there will be a fix for this in the next release, but I posted this topic in the bug reports forum a while ago.
thanks Brainsaw,
then I probably need to switch to DirectX... ¿? hummmm ¿?... the principal problem for this switch will be the shaders... ... .. hummm...

well... for now I will continue with Dareltibus' idea...

Thanks very much.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, it's a mipmap problem. For loadScene there's no easy fix in Irrlicht 1.7, but in 1.8 we will have a way to disable mipmap rendering in SMaterial. This will be deserialized to the material and will load correctly afterwards. Mipmap disabling on a per-texture base is only possible when loading the texture manually. Simply because texture creation flags are not serialized to the scene. If you do load those textures manually, it's no problem to disable mipmaps for the skybox, there shouldn't be any change in mipmap levels, so just don't make your textures too large for the scene.
Brainsaw
Posts: 1183
Joined: Wed Jan 07, 2004 12:57 pm
Location: Bavaria

Post by Brainsaw »

Nice to hear that it will be fixed. Just hope that niko will compile a new version of IrrEdit where you can disable the flag, otherwise I'll have to do another plugin ;)
Dustbin::Games on the web: https://www.dustbin-online.de/

Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Post Reply