vasturiano / globe.gl

UI component for Globe Data Visualization using ThreeJS/WebGL
https://vasturiano.github.io/globe.gl/example/world-population/
MIT License
2.15k stars 312 forks source link

Labels layer with transparent globe image #162

Open guillemc opened 1 year ago

guillemc commented 1 year ago

Describe the bug Labels (but not their associated dots) are showing through the globe when using a globe image with transparent background.

To Reproduce See this Codepen example

Expected behavior We would expect labels to not show through (just like the dots).

vasturiano commented 1 year ago

@guillemc thanks for reaching out.

Well, there's no easy way to make the text rendered only on one side, because it is an extruded geometry, and the back of the faces are not directly exposed (they're facing "inside" the geometry). And TextGeometry doesn't allow easy separation of the material on the front and back of the geometry, only the beveled sides.

However, to make it consistent I have now changed the label dots to be rendered on both sides, so they won't disappear while the labels persist when seen from the back.