Fix model shader generation when normals are missing
See original GitHub issueprocessPbrMetallicRoughness always expects normals to exist, but that is not always the case. We should have a separate shader path for those models that would look similar to the constant lighting in processModelMaterialsCommon.
This will fix https://github.com/AnalyticalGraphicsInc/cesium/issues/5835.
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (11 by maintainers)
Top Results From Across the Web
Fix model shader generation when normals are missing #5838
I tried the --materialCommon hint from the linked forum topic, but that appears to be the worst of both worlds (missing textures in...
Read more >GLSL shader generation of normals - Stack Overflow
I need to draw very fast flat shaded models. I generate normals on CPU every single frame. This is very slow. I tried...
Read more >Calculating Normals in the Shader - YouTube
This week we have a look at how we can recalculate our Normals in our Shader, for when we're using WPO or Displacement...
Read more >Bad Shading on Imported Mesh - Blender Stack Exchange
This is generally caused by custom normal data. Under the Properties Window > Object Data > Geometry Data press Clear Custom Split Normals...
Read more >Missing Vertex Attributes - GDN {GIANTS Developer Network}
The Editor tells me, when I want to assign Shader Parameter "Decals" or "staticLight" that my shape is'nt provied to do this.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

BabylonJS has an option to createNormals based on the mesh:
https://doc.babylonjs.com/api/classes/babylon.abstractmesh#createnormals
Might be worth looking at it and get inspiration from here:
https://github.com/BabylonJS/Babylon.js/blob/c54863cf32d8045db2fc0b56949974563db75fd7/src/Mesh/babylon.abstractMesh.ts#L1801
Congratulations on closing the issue! I found these Cesium forum links in the comments above:
https://groups.google.com/forum/#!topic/cesium-dev/eXxk3Oi0hEM https://groups.google.com/forum/#!topic/cesium-dev/se_9ov5HwA8 https://groups.google.com/forum/#!topic/cesium-dev/YSNaoirGXMw
If this issue affects any of these threads, please post a comment like the following:
I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.
🌍 🌎 🌏