Hi,
We are working on a cesium viewer in unity and we ran into a problem with custom terrain data from geotiffs. It seems that when requesting the pretiled 3d meshes based on our geotiffs we don’t get normals, the quantized mesh ends before there is a normals extension. When requesting cesium world terrain we get them, so I guess the request is correct.
To load the quantized mesh we are using GitHub - jhkluiver/UnityQuantizedMeshViewer: Apply heightmap (DEM) on real world tile data in Unity.
And added support for Normal import. But there is no extension header with extensionId:1 in the custom asset.
...
var request = $"https://assets.cesium.com/{AssetID}/{DetailLevel}/{coordinate.X}/{coordinate.Y}.terrain?extensions=octvertexnormals-watermask-metadata&v=1.2.0";
headers.Add("Accept","application/vnd.quantized-mesh;extensions=octvertexnormals-watermask-metadata");
...
Do we need to do something with our own terrain asset to generate normals? Or is something wrong with the request?
2 Likes
@AuroraMaps
All assets uploaded as Terrain
type to Cesium ion will be generated with normals.
A few questions for you:
- Have you tried streaming your terrain asset into CesiumJS with normals enabled? You can replace the asset in this sandcastle. Note: You may need to add your Access Token from Cesium ion to this.
- To narrow down the problem, can you please confirm whether you are able to successfully stream Cesium World Terrain without normals in your Unity application?
- Can you please provide any error messages you may be receiving?
-Sam
-
To me it looks like there is no lighting in the cesiumJS either. This is a test asset from our testing account “makenoise”.
This last one is the same area in the same sandcastle with the cesium world terrain. It looks properly lit.
-
We are able to stream cesium world terrain with and without normals in unity.
(removing the extensions in the request).
But the custom asset comes without, no mather what (in the .terrain file there are no extension with the id 1 and it read the file to the end).
- No error messages at all
A colleague of mine just tested it with another geotif on his account and had the same result in cesiumJS.
Update: My colleague tested geotiff files for a different area from a different source and there normals where generated. So could something wrong in the geotiff files result in this?
@makenoise
Yes! Based on the details that you have provided, this appears to be an issue with the terrain geotiff. We can reconfirm this by moving the time slider in Cesium ion, which changes the position of the Sun and the resulting lighting and shadows. We would be happy to take a look at your data (to debug) if you give us permission to. To do this, we would need you to confirm that your asset id is 481931.
-Sam
@makenoise
It seems likely that we have come across a bug. The team is currently investigating this issue - we will have an update for you in a few days.
-Sam
2 Likes
@makenoise
Thank you for your patience! I am writing to inform you that we have formally submitted an issue internally. Since the issue was submitted on a private repository, you will not be able to track it on GitHub. However, I will provide updates on this thread.
-Sam
2 Likes
Thank you for the update!
@makenoise
The fix should be live now! Let me know if everything works as expected. As always, do not hesitate to reach out if you have any questions or concerns.
-Sam