Triangles disappearing then reappearing

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.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Triangles disappearing then reappearing

Post by JP »

This seems to depend on the angle of the node to the camera, and sometime's doesn't occur at all :?

Here's some pics:

A fairly normal scene:
Image

Loss of triangles:
Image

So basically when i tilt up my cannon it loses quite a few triangles and becomes see thru quite a lot, when i move it back down it regains those triangles. This also sometimes happens with my cannonballs, they used to be fine and would always appear as a nice sphere but then all of a sudden, without any obvious changes in the code they would just fire from the cannon as usual but always have about half the triangles see thru, and then just as quickly as that problem had appeared it disappeared and the cannonballs were back to nice spheres. Now i've changed my cannon model to a newer and better one the holey cannonball problem is back along with the new cannon being a bit dodgy.

Both the cannon and cannonball models are .ms3d models. The cannon is 2212 triangles in total and the cannonball is 528.

I know that if you load a model with too many triangles then Irrlicht can't cope and will only show some of them, but that tells you in the command prompt when you load the file and there's nothing in the command prompt at any time which relates to the loss of triangles :?

Any ideas folks?
Image Image Image
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

What driver, what material type, what version of Irrlicht, what other information can you provide?
belfegor
Posts: 383
Joined: Mon Sep 18, 2006 7:22 pm
Location: Serbia

Post by belfegor »

Try not to penetrate camera with models also try setting
setNearValue() to smaller value.

But i dont know about cannon ball.

Hope it helps.
Small FPS demo made using Irrlicht&NewtonDEMO
InfoHERE
Its at very early stage but i think im crazy enough to finish it all alone.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

It's definetly not the camera penetrating it, it does do that, but it's not noticeable due to back face culling being turned off and that only happens at the part of the cannon closest to the screen.

It's DX9 atm, i'll check it in OGL and see how that works, version 1.1 of Irrlicht i believe. And here's the code which loads the cannon:

IAnimatedMesh* mesh = smgr->getMesh("Meshes/cannon.ms3d");
node = smgr->addMeshSceneNode(mesh->getMesh(0));
node->setMaterialFlag(EMF_LIGHTING, false);
node->setMaterialFlag(EMF_BACK_FACE_CULLING, false);
node->setScale(vector3df(0.25f, 0.25f, 0.25f));
node->setPosition(vector3df(0, -2, 95));

EDIT: yeah it's version 1.1, and also it displays fine in OGL... Though i did have some problems on some PCs when using OGL for this project as everything would display in white, and i mean everything! Not just the models but the background (not just the skybox but the driver's background, which was set to black), images etc. :?
Image Image Image
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

are you using an nvidia card and the latest drivers?
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=16507
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
area51
Posts: 338
Joined: Thu Mar 18, 2004 10:20 pm
Location: UK
Contact:

Post by area51 »

I had a similar problem with .X files, any driver. Went back to version 1.0 and it worked fine.
________
Chevrolet bruin
Last edited by area51 on Fri Feb 25, 2011 12:09 am, edited 1 time in total.
Avalanche
Posts: 18
Joined: Tue Sep 05, 2006 7:21 am

Post by Avalanche »

i have similar thing happening here
i only notice this on windows vista and directx
windows xp + directx is fine
vista + openGL is fine
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Cheers for the link bitplane, got it fixed now i think. It seems to only happen when in windowed mode, i'm developing in fullscreen windowed mode but when i make releases of it i make it completely fullscreen so it shouldn't occur in any releases of the game which is fine really. I had just updated my forceware drivers, though i think i may have had the problem before that as well. It's strange because the cannonballs didn't always lose triangles, it depended on the mode of my game, either shooting at pirates or ships, very bizarre!

But anyway, all fixed up now :D
Image Image Image
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Incidentally, just noticed that if my cannon doesn't have a texture then the cannon and its 'balls' (so to speak :shock: ) display perfectly :?
Image Image Image
Lideln
Posts: 79
Joined: Sat Jun 24, 2006 11:35 am
Location: Paris, France

Post by Lideln »

Hi,

I have the same issue on my computer (I finally succeeded in displaying a map correctly :o )

Sometimes, when I move the camera over the map, triangles are disappearing, and even more ("eden more" :roll: ) : the map disappears entirely !!! :shock:
But when I get back to the latest camera position, it works fine again.
If I move the camera far from the map (I use kind of isometric camera), the issue occurs but later (by "later" I mean that I have to move the camera farther)

Its weird, because like JP, my camera does not hit the map mesh.

To be continued... :)
--
Lideln, France
Lideln
Posts: 79
Joined: Sat Jun 24, 2006 11:35 am
Location: Paris, France

Post by Lideln »

I have some details on this issue, that occurs also in my app.
I load a PLANE level, that is, only 4 vertices (so, one face).
When I move (not towards top or bottom, but just in the horizontal plane), the map sometimes just disappears... The camera is not under it, or whatever, it is located above the map, and the level still disappears.

This is very strange (I can post my app if needed), because nothing could cause that behavior.

If someone has an idea... I can't give more details, this is as simple ! :)

Good night,
--
Lideln, France
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Are you running fullscreen and have played around with vsync?
Image Image Image
Lideln
Posts: 79
Joined: Sat Jun 24, 2006 11:35 am
Location: Paris, France

Post by Lideln »

Not at all.

I run in window mode because I have dual screen, then if I run fullscreen it will take both screens...
(and I like to control my computer even while playing a game, so windowed mode has my preference)

VSync huuuuu No, I did not do anything special about that.

This issue is weird, is it the same issue than yours ?
This is a bit frustrating !

Ah, something else : the map disappears, but the objects I put on it are still visible :shock:

Any idea ? Do you need the code, or the .blend, or something ?

Have a nice day,
--
Lideln, France
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Have you not been reading this thread then? :lol:

Did you not see that i solved my problem by running full screen with vsync on? Read the thread that bitplane posted!

Obviously if you want to keep it windowed then you've got some other issues, but running in OpenGL may well fix it, as i've already said ;)

If you try out the things suggested you may find out whether it's the same problem or a different problem, then you can work from there.
Image Image Image
Lideln
Posts: 79
Joined: Sat Jun 24, 2006 11:35 am
Location: Paris, France

Post by Lideln »

Hi JP :)

I had already read the thread :)

I can't run fullscreen, it constraints my mouse in what seems to be an invisible window, and nothing is accessible (I have to add the ESCAPE key to quit, because I had to manually reboot my computer when I tried...)

And for OpenGL, I'm already using it since Im under Linux :wink:

Thats all... Any other idea ? :lol:

Thanks anyway,

Lideln
--
Lideln, France
Post Reply