Hello.
I'm using Irrlicht FPP camera, but I set camera position manually (because Bullet controlls player's position) via camera->setPosition(). When I move forward everything is fine, but when I move backwards, a part of terrain seems to be not updated properly and is just not rendered (probably some kind of frustum culling optimization). Here is how it looks: (I moved a little bit backwards and some part of terrain is not rendered):
now when I'm in this position, I can move a little bit to the left, right, backward or forward and it stays like this. Missing terrain part appears when I move too much or move mouse even a tiny bit. I understand it's some kind of frustum optimization, so turning it off is not an option - since even a tiny mouse movement fixes this problem, so I guess it's not a big deal. I've tried using camera->updateAbsolutePosition() each frame but it doesn't help.
Terrain part disappears when moving backwards
Re: Terrain part disappears when moving backwards
Try first if it's maybe the near- or farplane of the camera itself. You can change the value of those in the camera.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Terrain part disappears when moving backwards
Thanks for the reply, but unfortunately it's not the problem. My znear is very small (like 5 cm), and here the distance from camera to terrain is like 2 meters. Usually if I move forward everything is fine, but when I move backwards sometimes a big part of terrain is not rendered.
Re: Terrain part disappears when moving backwards
Unfortunately I'm not familiar with the terrain-code itself. I remember it had some problems with scaling from a past thread. Aside from that I don't know. But we need concrete code to reproduce the bug if we should help hunting the problem.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Terrain part disappears when moving backwards
Found the problem!
It was caused by too big, default camera movement delta.
I guess there should be some kind of a formula which would give the maximum possible value for camera movement delta based on terrain scale.
It was caused by too big, default camera movement delta.
Code: Select all
irr::scene::ITerrainSceneNode::setCameraMovementDelta