CesiumGS / CesiumGS/cesium-native

upsampleGltfForRasterOverlays produces unnormalized normals

Open
#845 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
623
Forks
277
PR merge metrics
No merged PRs in 30d

Description

glTFs created by the `upsampleGltfForRasterOverlays` often fail [validation](https://github.khronos.org/glTF-Validator/) with messages like this:

```
{
"code": "ACCESSOR_VECTOR3_NON_UNIT",
"message": "Vector3 at accessor indices 810..812 is not of unit length: 0.9929924240874767.",
"severity": 0,
"pointer": "/meshes/0/primitives/0/attributes/NORMAL"
}
```

This is almost certainly caused by the linear interpolation of vertex attributes in order to trim triangles that cross the tile edge. We should re-normalize the normals after interpolating. This is slightly tricky only because we don't currently know which attributes are normals, and hence should be renormalized. Note that TANGENT also has [normalization requirements](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#meshes-overview).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.