Author Topic: Z Buffer problem  (Read 2304 times)

mischa

    Reputation: 23
Z Buffer problem
« on: September 13, 2011, 10:57:15 am »
September 13, 2011, 10:57:15 am
Hi,

I am currently working on a big city model. The movie starts with a birdseye view (looking directly downwards) to give an overview over the city and also ends with this camera view. I have no faces lying on the same level, but at a far view the faces start flickering and after a while the landscape and a water object which are about 3 meters under my model become visible in the streets. I think that this is a z Buffer problem resulting from the far position of the camera and the object distances being close in comparison to the camera distance. When I am at a "normal" distance everything looks like it should look. Anyone had this problem also? Any solution? I would like to push the landscape deeper, but the problem is that all my people and trees will "fall down" with the landscape and will not stay on my model as they should.

Thx for any hints. Tried to contact Ferry already, but no feedback yet. The movie has to be finnished in 2 weeks...

Re: Z Buffer problem
« Reply #1 on: September 13, 2011, 12:06:19 pm »
September 13, 2011, 12:06:19 pm
Hi,

I am currently working on a big city model. The movie starts with a birdseye view (looking directly downwards) to give an overview over the city and also ends with this camera view. I have no faces lying on the same level, but at a far view the faces start flickering and after a while the landscape and a water object which are about 3 meters under my model become visible in the streets. I think that this is a z Buffer problem resulting from the far position of the camera and the object distances being close in comparison to the camera distance. When I am at a "normal" distance everything looks like it should look. Anyone had this problem also? Any solution? I would like to push the landscape deeper, but the problem is that all my people and trees will "fall down" with the landscape and will not stay on my model as they should.

Thx for any hints. Tried to contact Ferry already, but no feedback yet. The movie has to be finnished in 2 weeks...

Yup that's a z-buffer issue allright. There are 2 solutions:

  • Edit the material of one of the surfaces so its z-value is offset and forced below or above other surfaces.
  • Add a camera effect so the z-range is more efficiently used. For a far shot you could set the minimum z-value at 50 meters for example so the range runs from 50m to 4000m.
  • Move the planes of your model further apart so they won't cause any z-fighting

mischa

    Reputation: 23
Re: Z Buffer problem
« Reply #2 on: September 13, 2011, 01:12:03 pm »
September 13, 2011, 01:12:03 pm
Hi Remko,

thanx for the quick reply. I modified already the material depth and as I said the landscape is around 3 meters away from the street object. Will try your other tip with the z depth effect, that sounds like a important feature I haven t seen yet. Another problem I hav is that even in high quality rendering the shadows of the buildings appear only after being much closer as my camera is at the beginning. Is there also an clip effect for this problem?

Thx so far,

Mischa

mischa

    Reputation: 23
Re: Z Buffer problem
« Reply #3 on: September 13, 2011, 01:13:19 pm »
September 13, 2011, 01:13:19 pm
Yup that's a z-buffer issue allright. There are 2 solutions:

  • Edit the material of one of the surfaces so its z-value is offset and forced below or above other surfaces.
  • Add a camera effect so the z-range is more efficiently used. For a far shot you could set the minimum z-value at 50 meters for example so the range runs from 50m to 4000m.
  • Move the planes of your model further apart so they won't cause any z-fighting

Does that mena that objects that are closer than 50 m will have zdepth problems?

mischa

    Reputation: 23
Re: Z Buffer problem
« Reply #4 on: September 13, 2011, 01:21:26 pm »
September 13, 2011, 01:21:26 pm
I added a shadow range efect, which makes it better but even in the max. setting (1) I still have the problem that at the beginnig of the movie the buildings don t cast shadows and when flying closer the shadows fade in.

Re: Z Buffer problem
« Reply #5 on: September 13, 2011, 01:39:37 pm »
September 13, 2011, 01:39:37 pm
Will try your other tip with the z depth effect, that sounds like a important feature I haven t seen yet.

Excerpt from another thread:
In movies, you can get rid of z-fighting quite easily once you've made the clip (I assume you've zoomed out quite a lot and the camera is quite high up when the z-fighting appears):

1) New effect -> Scene Effects -> Camera Clip Planes
2) Increase the "Near Plane" slider until the z-fighting is gone.

The rule of thumb is that the closer the "Near plane" is to the eye position and the greater the distance between the "Near" and "Far" camera clip planes is, the more z-fighting you're likely to encounter.

In real-time 3D, the distance where z-fighting begins to occur also depends on the distance from the camera to the polygons in question. If the polygons are close to the camera, z-fighting only occurs when the polygons are, say 1mm from each other while at a distance of 2km from the camera it occurs when polygons are, say within 1m of each other.

Re: Z Buffer problem
« Reply #6 on: September 13, 2011, 01:49:23 pm »
September 13, 2011, 01:49:23 pm
I added a shadow range efect, which makes it better but even in the max. setting (1) I still have the problem that at the beginnig of the movie the buildings don t cast shadows and when flying closer the shadows fade in.

Hmm, it looks like the "Shadow range" effect is capped at 1 in the Movie section (You can increase it to 2 in the Weather section). I'll add that to the bug tracker list right now.

So for now, you'll have to delete this effect from your clip, then go to the advanced weather options and set Shadow -> Range to 2. Then return to the movie section - if you aren't miles from the ground you should be able to see the shadows again.


mischa

    Reputation: 23
Re: Z Buffer problem
« Reply #7 on: September 13, 2011, 02:18:11 pm »
September 13, 2011, 02:18:11 pm
Hmm, it looks like the "Shadow range" effect is capped at 1 in the Movie section (You can increase it to 2 in the Weather section). I'll add that to the bug tracker list right now.

So for now, you'll have to delete this effect from your clip, then go to the advanced weather options and set Shadow -> Range to 2. Then return to the movie section - if you aren't miles from the ground you should be able to see the shadows again.



Ok thx, will try that. Does that effect affect the render time? Is that the only side effect this modification has, or why is the standard value for the shadows smaller?

Re: Z Buffer problem
« Reply #8 on: September 13, 2011, 02:25:31 pm »
September 13, 2011, 02:25:31 pm
Does that effect affect the render time? Is that the only side effect this modification has, or why is the standard value for the shadows smaller?

It's a mistake that there is a difference between the maximum shadow range in the Build and Movie sections (both should be capped at 2). Different values shouldn't affect the render time.

mischa

    Reputation: 23
Re: Z Buffer problem
« Reply #9 on: September 13, 2011, 03:03:06 pm »
September 13, 2011, 03:03:06 pm
It's a mistake that there is a difference between the maximum shadow range in the Build and Movie sections (both should be capped at 2). Different values shouldn't affect the render time.

ok, rendered the scene with the in the weather section adjusted shadow range and the camera clip effect. Now the movie looks like it shouldlook, thx veeeeeeeeeeeeeery much!  :D

You did not reply me what side effect the modification of the shadow range has. (longer rendertimes, strange looking shadows in normal eye levl,...?)

mischa

    Reputation: 23
Re: Z Buffer problem
« Reply #10 on: September 13, 2011, 03:22:05 pm »
September 13, 2011, 03:22:05 pm
ok, rendered the scene with the in the weather section adjusted shadow range and the camera clip effect. Now the movie looks like it shouldlook, thx veeeeeeeeeeeeeery much!  :D

You did not reply me what side effect the modification of the shadow range has. (longer rendertimes, strange looking shadows in normal eye levl,...?)
was so happy and jumping around that my problem was gone, that I did not see that you said that it will not effect the rendertime... sorry  :-P

Re: Z Buffer problem
« Reply #11 on: September 13, 2011, 04:44:43 pm »
September 13, 2011, 04:44:43 pm
Heh no worries, good to hear you got it working :)