CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.74k stars 3.45k forks source link

Do the vertex shaders throughout Cesium normalize normals? #6008

Open pjcozzi opened 6 years ago

pjcozzi commented 6 years ago

Potentially not since the fragment shaders renormalize since the interpolated values will not be normal.

However, if the vertex shader outputs normals for two points on a triangle edge are of drastically different length, it skews the interpolated normals towards the longer normal - which would lead to lighting artifacts.

Surely more subtle than #4030, etc., but still worth investigating.

pjcozzi commented 6 years ago

Also, this is a non-issue if the normals stored in the vertex buffers are always normalized - and not changed other than perhaps precision during transforms - which they may be through out Cesium.