Handling Terrain Data, how to get Vertex Normals

Hi,

using the Cesium World Terrain, we can request vertexNormals:

const viewer1 = new Cesium.Viewer('cesiumContainer', {
    terrainProvider : Cesium.createWorldTerrain({
        requestWaterMask : true,
        requestVertexNormals : true
    });
});

The same if I use the CesiumTerrainProvider

// Create Arctic DEM terrain with normals.
const viewer = new Cesium.Viewer('cesiumContainer', {
    terrainProvider : new Cesium.CesiumTerrainProvider({
        url : Cesium.IonResource.fromAssetId(3956),
        requestVertexNormals : true
    })
});

I have generated a terraindb (quantized mesh) with Cesium Terrain Tiler - but the terrainDb doesn’t have vertexNormals.

In which way do I have to generate a terrain, that I can request vertex Normals ?

Rüdiger

Hi Rudiger

How are you checking for the vertex normals?

The right method would be to check open the terraindb as a SQLite Table (for example with DB Browser for SQLite) and look at the metadata table. Let us know what the vertexnormals value is.

Hi @Shehzan_Mohammed,

thank you for the hint - ok my terraindb has vertexNormal = 1 in the metadata.

Regards

Rüdiger

@Shehzan_Mohammed

It works

Can a shader read these normals? Tried without luck