distant objects in outdoor scenes look ugly

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
rt
Posts: 150
Joined: Sun Nov 30, 2003 6:54 am
Location: canada
Contact:

thin

Post by rt »

saigumi wrote:Setting the far value increases the render distance.

Most games "fix" the problem of objects flashing in by using fog, levels that hide far distance with mountains, walls, treelines, etc...
thanks for the tips, but i was asking about the nearvalue and why it helps object to become not see-through, not the farvalue. the problem wouldn't bug me so much, but the flickering of objects is dependant on object thickness as well which means that thin object become see-through much sooner.. and in that case fog won't help since the object isn't that far away. that is why i would like to know how to fix this problem (even at the expense of performance). i plan to debug the source, but i was hoping that someone could point me in the right direction first.
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

No, that's not a problem either.

Setting the near value adjust how close you want object to get before they do dissapear. When the vertices of the mesh are closer than the near value, or behind the camera and other vertices of the same mesh are in front of you, you will get a torn look and parts of the mesh "missing" because they might be facing the other way or behind the camera.

You can set the near value as close as you want or as far as you want. Though, you can decrease performance and get other weird visual effect if you don't keep your near/far/ and Field of View in a decent ratio of each other.

You can fix it is to check to see if the distance of your camera to the outside of your object is less than your near value. If it is, turn it invisible.

if (abs(Obj->getPosition() - Camera->getPosition()) < Camera->getNear())
Obj->setVisible(false);

You can find out more about this by reading up on the more commonly used term of "Clipping Plane".
Crud, how do I do this again?
rt
Posts: 150
Joined: Sun Nov 30, 2003 6:54 am
Location: canada
Contact:

Post by rt »

saigumi wrote:Setting the near value adjust how close you want object to get before they do dissapear. When the vertices of the mesh are closer than the near value, or behind the camera and other vertices of the same mesh are in front of you, you will get a torn look and parts of the mesh "missing" because they might be facing the other way or behind the camera
i appreciate that you're trying to help, but i don't think you are understanding the problem that this thread is describing. i must have not described it well enough. it has nothing to do with objects being too close to the camera.
look at the pics from this thread (http://irrlicht.sourceforge.net/phpBB2/ ... .php?t=616)
i suggest you try this experiment to see the problem your self. create a box room as a .bsp (or maybe even .3ds.. i use gtk to create buildings so i haven't tried using .3ds to create a large structure), then load that .bsp box room into irrlicht and also load in that 'sydney' model and place her so that she is standing on the floor of the room (the floor thickness should be around 5 units). now add a fps camera with a large farvalue and fly down while looking up at the box room.. keep flying until you exit the box and then keep going.. at some point you will start to see the model 'flicker' into sight even though it is inside the room!

the problem can also be seen if you take a very thin mesh and 'lay' it on the floor of the box. place it about 0.5 units above the floor. if you move away from it then you will see the thin mesh start to stripe out revealing the floor underneath it.

that is the problem.. now my question is based on the fact that if you set nearvalue to a larger number (and of course alter fov so that it looks good) then you can move farther away than you could with a small nearvalue without the model showing through the box.
my question is why does the nearvalue affect this phenomenon? also, if you reduce the thickness of the floor then the problem shows up at a shorter distance also. i hope this helps you to understand excatly what i'm talking about.. i can provide a sample program which demonstates this problem if you'd like :)
Post Reply