gwaldron / osgearth

3D Maps for OpenSceneGraph / C++14
https://www.pelicanmapping.com/home-1/opensource
Other
1.51k stars 780 forks source link

Scintillation lighting issues at poles of osgearth models #572

Closed KingArthur10 closed 6 years ago

KingArthur10 commented 9 years ago

Reproduction case:

  1. Start osgearth_viewer using the lod_blending.earth example
  2. Navigate to the pole of the earth
  3. Alter camera altitude and move toward the earth

result: notice a scintillation pattern at the pole that flashes in and out. Also, notice that the brightness of the tiles at the poles varies between transitions.

This is especially noticeable when using a lighting model that does not include any atmospheric scatter and no fill lighting. This is especially bad for Nightshade NG as most non-earth bodies have no atmosphere. It appears to be something about the normals at the poles.

You can download a video from the following link that shows the pattern: https://onedrive.live.com/redir?resid=14E05ECE114D24C6!61432&authkey=!AGrlv3mK_b1dhX0&ithint=video%2cmp4

Using osgearth under Ubuntu Linux and an nVidia graphics card.

gwaldron commented 9 years ago

I can't reproduce this, and I can't see any ill effects in the video you posted.

tlareywi commented 9 years ago

This only reproduces when the normalize_edges terrain option is true. Attached two screenshots. The one with normalize_edges enabled (bottom) has a darkened pole with strange brighter 'ray' like artifacts projecting from the pole center. When normalize edges is false, the artifacts do not exist. However, without normalizing edges, we get a 'soccer ball' effect from the normals of a quad not being blended with neighbor quads. (Pole is upper center portion of both images. Both images captured in osgearth_viewer with default lighting models).

non-normalized normalized

gwaldron commented 9 years ago

Thanks for the clarification tlareywi, that is helpful.

gwaldron commented 9 years ago

The quickest fix is you turn OFF edge normalization (set to "false" or simply remove from the earth file) and turn ON normal mapping (see the normalmap.earth example).

This uses a different (and faster/better) mechanism to smooth normals across tiles, and will be the default mechanism in the future. The "normalize_edges" option will eventually go away.

Hope this helps.