Artefacts using big model

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

swiftcoder

Thanks, I will try to render a big model with 2 or more projection matrices. Will see how it be :)

Advertisement

Could please someone give a simple example with logarithmic depth buffer for DirectX 11, because from the article hard to understand how to implement it?

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?

It's worth pointing out the depth buffer being normally non-linear, changing the near clip makes a huge difference compared to moving the far.

So you want to push the near as far forward as possible, but this depends on how close you camera will be to objects in the scene. The far does matter, but getting the near correct is most important. Also remeber you say 3km, but you mean 3k of unitys as scale is arbitrary.

mikiex,

Thaks for clarification, but I want that camera will be as close to object as possible. Do you know something about logarithmic depth buffers. I tried to find an example for DX 11, but I din`t find any code example for it.

mikiex,

Thaks for clarification, but I want that camera will be as close to object as possible. Do you know something about logarithmic depth buffers. I tried to find an example for DX 11, but I din`t find any code example for it.

Close as possible is your eyeball touching the surface a near clip of 0 :) I don't know anything about log depth buffers other than the concept exists, certainly DX11 would make things like this possible I am sure. Consider though not many games in the past have bothered to come up with a physically correct solution, yes its been a matter of contention but every project I've worked on we have managed to work around this issue by faking it.

Could please someone give a simple example with logarithmic depth buffer for DirectX 11, because from the article hard to understand how to implement it?

Add this line to the end of the vertex shader after the projection multiply.


out.Position.z = log(C*out.Position.z + 1) / log(C*Far + 1) * out.Position.w;

where C is a constant used to choose the resolution near the camera: try it with C = 1.0f.

and Far is the far plane distance used to create the projection matrix.

This topic is closed to new replies.

Advertisement