Skybox problem
-
- Posts: 12
- Joined: Wed Mar 03, 2010 3:38 pm
Skybox problem
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.
Thank for your help.
i am a little problem with my skybox, because I see the intersection line.
and i unknow how i can resolved this problem.
Thank for your help.
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
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
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
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
-
- Posts: 226
- Joined: Fri Aug 22, 2008 8:50 pm
- Contact:
-
- Posts: 115
- Joined: Mon May 17, 2010 7:42 am
try this
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
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
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
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
}
Code: Select all
mat.ZWriteEnable = false; //-> mat.ZWriteEnable = true;
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
-
- Posts: 12
- Joined: Wed Mar 03, 2010 3:38 pm
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.
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.
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.
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
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
-
- Posts: 12
- Joined: Wed Mar 03, 2010 3:38 pm
thanks Brainsaw,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.
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.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
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.
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
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames