Artefacts using big model

Started by
14 comments, last by Aqua Costa 11 years, 1 month ago

Hello,

I am using DX 11 for rendering. With snall objects everything is OK, but with big objects appears some strange behavior. Some triangles began to disappear and appear chaotically during camera movement. More detail you can see on the attached screenshots.

Length of the ship is 3km, but it has only 15000 triangles.

Does someone know what is the problem here? Maybe someone already faced with something similar?

Advertisement

Looks like z-fighting, what are your projection matrix parameters for far and near z-clip plane?

I have the following parameters for projection matrix:

screenDepth = 100000.0f;
screenNear = 0.01f;

Yeah those are wayyyyy too far apart. Bring in the far plane or push up the near plane.

Hm, looks like this was the reason. I set

screenDepth = 60000.0f;
screenNear = 1.0f;

and everything seems OK, but I cannot understand how in that case render a big/huge maps, for example, for a hundred of thousands km of space? Because of screen depth it cannot be rendered. What I must do in that case?

There are some methods to "increase" the precision of depth buffers, this article talks about some. Take special attention reading the logarithmic depth buffer part.

TiagoCosto's article is the best you get with direct hardware support. For bigger scenes (above the effective accuracy of a logarithmic/floating-point depth buffer, you need to partition the objects in your scene into depth ranges, and render each range with it's own projection matrix with the near/far planes adjusted.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Hm, looks like this was the reason. I set

screenDepth = 60000.0f;
screenNear = 1.0f;

and everything seems OK, but I cannot understand how in that case render a big/huge maps, for example, for a hundred of thousands km of space? Because of screen depth it cannot be rendered. What I must do in that case?

Short story, we cheat.

Long story: Oh no, I won't go into detail. But we use advanced rendering techniques to maximize precision (such as the ones in Outterra blog). Here's another (advanced, not sure if good for a newbie) slide: Rendering vast worlds.

We also render what's far away using 2D billboards instead of actual 3D geometry (the billboard is called impostor because we render the 3D to a texture and then display that texture as a billboard) and stuff like that, or just use fog, etc to hide artifacts.

Very people prefer to render the scene in two passes (2 depth buffers, what's close in one pass, what's far in the other one) and then composite both. It's troublesome but does the job.

Thanks to all for help. It is very interesting. I didn`t now about such techniques. Please, say, if I want to render a huge map, I also could you 3 and more projection matrices for that? But I don`t know how it would display on screen in such case. Will I see all the objects I render in this case on all distances or some of them I would not see?

Thanks to all for help. It is very interesting. I didn`t now about such techniques. Please, say, if I want to render a huge map, I also could you 3 and more projection matrices for that? But I don`t know how it would display on screen in such case. Will I see all the objects I render in this case on all distances or some of them I would not see?

You can render a terrain in multiple regions, sorted by their distance to the viewer. I've done this for a quick clipmap terrain prototype, but while it can be made to work, the depth interactions at region edges can get a little sticky...

Space scenes (which came up earlier in the thread?) are generally much simpler, because they are fairly sparsely populated. You can reasonably sort the entire list of objects from back-to-front, customise the near/far planes for each one, and then just draw them out in order.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

This topic is closed to new replies.

Advertisement