Discussion:
is this a z-fighting issue?
(too old to reply)
Richy
2007-07-30 09:33:53 UTC
Permalink
Hi,

I have posted a pic of the issue at http://austere3d.gallery.netspace.net.au/Unresolved/planetissue

I am experimenting with a planet model, I have taken a 129 x 129
heightmap and generated a 129 x 129 mesh and then mapped it around a
large sphere. The mesh is broken into four meshes
(64x64,64x65,65x64,65x65) and all four meshes are then rendered. I do
not do any translations as each mesh is created with the relevant
coordinates.

I get this issue in a lot of places around the planet, usually where
near mountains overwrite far mountains. I cannot see any overlap of
the heightmap cells, so I do not think cells are encroaching on the
space of other cells.

Is this a z-fighting issue? I am not sure how to resolve this issue at
present.

Cheers,

Richy
ZMan
2007-07-30 15:37:11 UTC
Permalink
It certainly looks like one.

Change your near/far in your projection matrices and see if the issue gets
better. That will confirm it.

The other issue is if you have coplanar triangles that do not have identical
vertices. The rounding in the math during rasterisation can give slightly
different results and no amount of nar/far tweaking will fix that. You just
have to move on slightly above the other.
Post by Richy
Hi,
I have posted a pic of the issue at
http://austere3d.gallery.netspace.net.au/Unresolved/planetissue
I am experimenting with a planet model, I have taken a 129 x 129
heightmap and generated a 129 x 129 mesh and then mapped it around a
large sphere. The mesh is broken into four meshes
(64x64,64x65,65x64,65x65) and all four meshes are then rendered. I do
not do any translations as each mesh is created with the relevant
coordinates.
I get this issue in a lot of places around the planet, usually where
near mountains overwrite far mountains. I cannot see any overlap of
the heightmap cells, so I do not think cells are encroaching on the
space of other cells.
Is this a z-fighting issue? I am not sure how to resolve this issue at
present.
Cheers,
Richy
Richy
2007-07-31 03:35:33 UTC
Permalink
It turned out to be the near plane, which I had set long ago to 0.01
so that walls didn't vanish when I got up close to them. Now that I'm
onto planet/terrain mapping this was causing those disturbances in the
rendering. Everything looks fine now (though I'm sure the wall problem
will return).

Cheers,

Richy
Post by ZMan
It certainly looks like one.
Change your near/far in your projection matrices and see if the issue gets
better. That will confirm it.
The other issue is if you have coplanar triangles that do not have identical
vertices. The rounding in the math during rasterisation can give slightly
different results and no amount of nar/far tweaking will fix that. You just
have to move on slightly above the other.
Post by Richy
Hi,
I have posted a pic of the issue at
http://austere3d.gallery.netspace.net.au/Unresolved/planetissue
I am experimenting with a planet model, I have taken a 129 x 129
heightmap and generated a 129 x 129 mesh and then mapped it around a
large sphere. The mesh is broken into four meshes
(64x64,64x65,65x64,65x65) and all four meshes are then rendered. I do
not do any translations as each mesh is created with the relevant
coordinates.
I get this issue in a lot of places around the planet, usually where
near mountains overwrite far mountains. I cannot see any overlap of
the heightmap cells, so I do not think cells are encroaching on the
space of other cells.
Is this a z-fighting issue? I am not sure how to resolve this issue at
present.
Cheers,
Richy- Hide quoted text -
- Show quoted text -
mathieu
2007-08-17 15:50:45 UTC
Permalink
Richy,

I don't understand the image, the bug is too heavy I think.
In first image, what is supposed to be this purple zone in the foreground?
In both the images, are the holes in your data, or should the terrain be
flat according to the data? When you rotate the view, does this hole remain
in the center of the screen?

-Mat
Post by Richy
It turned out to be the near plane, which I had set long ago to 0.01
so that walls didn't vanish when I got up close to them. Now that I'm
onto planet/terrain mapping this was causing those disturbances in the
rendering. Everything looks fine now (though I'm sure the wall problem
will return).
Cheers,
Richy
Post by ZMan
It certainly looks like one.
Change your near/far in your projection matrices and see if the issue gets
better. That will confirm it.
The other issue is if you have coplanar triangles that do not have identical
vertices. The rounding in the math during rasterisation can give slightly
different results and no amount of nar/far tweaking will fix that. You just
have to move on slightly above the other.
Post by Richy
Hi,
I have posted a pic of the issue at
http://austere3d.gallery.netspace.net.au/Unresolved/planetissue
I am experimenting with a planet model, I have taken a 129 x 129
heightmap and generated a 129 x 129 mesh and then mapped it around a
large sphere. The mesh is broken into four meshes
(64x64,64x65,65x64,65x65) and all four meshes are then rendered. I do
not do any translations as each mesh is created with the relevant
coordinates.
I get this issue in a lot of places around the planet, usually where
near mountains overwrite far mountains. I cannot see any overlap of
the heightmap cells, so I do not think cells are encroaching on the
space of other cells.
Is this a z-fighting issue? I am not sure how to resolve this issue at
present.
Cheers,
Richy- Hide quoted text -
- Show quoted text -
Richy
2007-08-19 05:50:10 UTC
Permalink
Hi Mat,

In both pictures I have an issue with wrapping a terrain around a
sphere, you can see it in that there is like a V shape where the
terrain comes together. That is a separate issue though.

The problem is that, in the first picture, the blue texture is showing
through the brown texture which is closer to the camera. In the second
picture, there are similar issues, it looks like somebody has
scratched away at the closer texture to reveal the texture beneath.

This is a z-fighting issue caused by having a very distant far plane,
I guess it is caused by floating point inaccuracies. I can fix this by
moving the far plane closer to the camera, and not having such a large
sphere/planet.

Cheers,

Richy

That is not the issue, the issue
Post by mathieu
Richy,
I don't understand the image, the bug is too heavy I think.
In first image, what is supposed to be this purple zone in the foreground?
In both the images, are the holes in your data, or should the terrain be
flat according to the data? When you rotate the view, does this hole remain
in the center of the screen?
-Mat
Post by Richy
It turned out to be the near plane, which I had set long ago to 0.01
so that walls didn't vanish when I got up close to them. Now that I'm
onto planet/terrain mapping this was causing those disturbances in the
rendering. Everything looks fine now (though I'm sure the wall problem
will return).
Cheers,
Richy
Post by ZMan
It certainly looks like one.
Change your near/far in your projection matrices and see if the issue gets
better. That will confirm it.
The other issue is if you have coplanar triangles that do not have identical
vertices. The rounding in the math during rasterisation can give slightly
different results and no amount of nar/far tweaking will fix that. You just
have to move on slightly above the other.
Post by Richy
Hi,
I have posted a pic of the issue at
http://austere3d.gallery.netspace.net.au/Unresolved/planetissue
I am experimenting with a planet model, I have taken a 129 x 129
heightmap and generated a 129 x 129 mesh and then mapped it around a
large sphere. The mesh is broken into four meshes
(64x64,64x65,65x64,65x65) and all four meshes are then rendered. I do
not do any translations as each mesh is created with the relevant
coordinates.
I get this issue in a lot of places around the planet, usually where
near mountains overwrite far mountains. I cannot see any overlap of
the heightmap cells, so I do not think cells are encroaching on the
space of other cells.
Is this a z-fighting issue? I am not sure how to resolve this issue at
present.
Cheers,
Richy- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -
m***@yahoo.fr
2007-08-22 14:12:15 UTC
Permalink
Post by Richy
This is a z-fighting issue caused by having a very distant far plane,
I guess it is caused by floating point inaccuracies. I can fix this by
moving the far plane closer to the camera, and not having such a large
sphere/planet.
I already had problems with near/far planes, like you, in a google-
earth-like app.
You wont solve it reducing the size of the planet, because if you do
that you will also have to reduce your clipping planes distance with
the same ratio, and you will get exactly the same inaccuracy in your z-
buffer.

Near/far clipping planes distance should be liked to the camera
altitude. If your camera is far from the planet, use big front/
clipping distances. When the cam altitude is lower, reduce both the
values.
To increase accuracy in your z-buffer, you should use the biggest
possible value for near plane distance.

I my app :
Near clipping plane = 0.1 x the camera altitude.
Far clipping plane = 100x camera altitude.

-Mathieu
Richy
2007-08-24 06:04:51 UTC
Permalink
Excellent, thanks for that, I will give it a shot.

Richy
Post by m***@yahoo.fr
Post by Richy
This is a z-fighting issue caused by having a very distant far plane,
I guess it is caused by floating point inaccuracies. I can fix this by
moving the far plane closer to the camera, and not having such a large
sphere/planet.
I already had problems with near/far planes, like you, in a google-
earth-like app.
You wont solve it reducing the size of the planet, because if you do
that you will also have to reduce your clipping planes distance with
the same ratio, and you will get exactly the same inaccuracy in your z-
buffer.
Near/far clipping planes distance should be liked to the camera
altitude. If your camera is far from the planet, use big front/
clipping distances. When the cam altitude is lower, reduce both the
values.
To increase accuracy in your z-buffer, you should use the biggest
possible value for near plane distance.
Near clipping plane = 0.1 x the camera altitude.
Far clipping plane = 100x camera altitude.
-Mathieu
Loading...