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.
Balu

distant objects in outdoor scenes look ugly

Post by Balu »

Hi!

I made a little outdoor scene by using a 3ds terrain model (with OctTreeTriangleSelector, what worked pretty well), but I noticed that models added to the scene look very ugly from a distance. I guess this is due to the zbuffer resolution. Is there any trick to improve that, or will a future release of the engine focus on that problem?

Greetings,
Balu
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

What do you mean "look ugly"?

Are you talking about a problem with aliasing? Model sizes?
Crud, how do I do this again?
Balu

Post by Balu »

Well, I mean that hidden parts become visible in 'stripes'. For example, if I place the bsp file from the techdemo in the terrain and move away from it, internal parts become visible and the 'castle' appears like ripped apart and the line between terrain and 'castle' is not straight anymore. I guess the hidden pixels are sorted out by use of the zbuffer, and if you have a bigger distance, then the resolution of the zbuffer is too small to correctly sort out the pixels. So, I wonder what could be a solution for that.

Balu
stampsm
Posts: 142
Joined: Mon Nov 10, 2003 5:52 pm
Location: Las Vegas

Post by stampsm »

possibly set up multible levels of detail for the castle based on distance so if you are a distance away the inner walls aren't drawn and there is a bigger difference in the distance between the poylgons
an added benefit is that there will be a proformance boost since less polygons are being drawn
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

The stripes are triangles outside of the bsp render area. They are calcuated as extending past your max draw radius.

Extend the draw radius or do what most games do and implement a fog of some type to hide your max distance.
Crud, how do I do this again?
Spartacus
Posts: 70
Joined: Fri Nov 21, 2003 11:56 pm

Post by Spartacus »

Fog support 0% Planned Enables fog

would love to know how to expand max distance
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

Spartacus, you don't have to completely rely on the engine for every feature. You can implement it yourself.

You answer is on this page:
http://irrlicht.sourceforge.net/docu/cl ... eNode.html
Crud, how do I do this again?
Balu

Post by Balu »

With max distance you mean setFarValue? That I did already. It was set to 100000.0 instead of 2000.0 (default?). I guess the only satisfying solution would be the use of a stencil and to replace the bsp model depending on the distance (a kind of LOT).
I don't want to use fog, because my intention is to have a nice landscape rendered, with far view etc. As I haven't programmed stencils before, I have some work to do, or is there some support by the engine I haven't found yet?

Thanx for all the answers...

Balu
Khanz

Post by Khanz »

When you use stencil, 24-bit depth buffer is used, otherwise 16 bits is used. Of course you can change default depth-buffer format to 24-bit.

For DX8 device you need to open CVideoDirectX8::initDriver function (CVideoDirectX8.cpp file, line 157) and replace D3DFMT_D16 with D3DFMT_D24X8:

Code: Select all

if (!StencilBuffer)
	present.AutoDepthStencilFormat = D3DFMT_D16;
Balu

Post by Balu »

AH! I found that the *NearValue* was much too *small* maybe! As the engine already uses D24S8 the zbuffer depth should be big enough!

But I have to check it out more...

Balu
Balu

Post by Balu »

YES! That's much better, now!
If I use...

setFOV(0.01);
setNearValue(15.0f);

it is much better, although not perfect...

...but now I have the problem that the skybox has disappeared!

Balu
Balu

Post by Balu »

oops... it is setFOV(0.1f);
one zero too much!

But the skybox is black, only at the corners it can be seen a bit... :(

Balu
Spartacus
Posts: 70
Joined: Fri Nov 21, 2003 11:56 pm

Post by Spartacus »

Well yea.. I know that just im not fully famliar with namespacing yet, I never have really used it in any of my own projects/applications.
rt
Posts: 150
Joined: Sun Nov 30, 2003 6:54 am
Location: canada
Contact:

reason

Post by rt »

i was wondering if anyone ever found out why setting the nearvalue fixes the problem of object becoming see-through as you move away from them.
setting the near value to a larger number is really only a hack because if you move far enough away the problem is still there, just not as noticible. there must be something causing this behaviour which can be fixed. if it is in the zbuffer then what can be done?
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

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...
Crud, how do I do this again?
Post Reply