visgl / deck.gl

WebGL2 powered visualization framework
https://deck.gl
MIT License
12.2k stars 2.09k forks source link

The accuracy of loading DSM terrain data is missing[Bug] #6568

Closed Paweled closed 2 years ago

Paweled commented 2 years ago

Description

I use import {terrainlayer} from '@ deck gl/geo-layers'; Render terrain data. Setting: meshmaxerror = 0; The renderings are as follows: image

It looks like a square, the effect is not very good-looking, and it feels like the lack of precision.

The coordinate format of this is UTM, coordinateSystem= COORDINATE_ SYSTEM. CARTESIAN,

Flavors

Expected Behavior

Each mesh should be triangular。 The effect should be like this: image

Steps to Reproduce

Setting: meshmaxerror = 0;

Environment

Logs

No response

ibgreen commented 2 years ago

@kylebarron @igorDykhta @chrisgervang

kylebarron commented 2 years ago

meshMaxError should never be 0 if you want a visually-appealing terrain mesh. When set to 0 the triangles can't approximate the underlying gridded terrain data, and you actually end up creating triangles that exactly reproduce the underlying square pixels.

Paweled commented 2 years ago

The above two figures set meshmaxerror = 0; But the second effect looks better.

The first one uses UTM coordinate format, image image

The second is the result of my modification of the source code. I only convert the UTM coordinates to the distance (m), and then make the tile offset (WGS84 coordinate format) image image @kylebarron

kylebarron commented 2 years ago

I'm still not sure I entirely follow. Are you saying there's an error with how the mesh is generated or with how it's rendered (or both?).

Paweled commented 2 years ago

I'm still not sure I entirely follow. Are you saying there's an error with how the mesh is generated or with how it's rendered (or both?).

The triangular meshes(indices) of these two methods are the same, and the only difference is the coordinates and rendering method(coordinateSystem).

I don't know how to calculate this UTM coordinate. Can it be converted to WGS84 coordinate? How should I convert?

Pessimistress commented 2 years ago

I'm moving this thread to Discussions. As @kylebarron already pointed out, you should set meshMaxError to a number larger than 0. If you still believe there is a bug in deck.gl, please create a Codepen/Code Sandboxthat reproduce your issue.