vasturiano / globe.gl

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

Displacement Map on Polygons #84

Open sowhat13 opened 2 years ago

sowhat13 commented 2 years ago

Is there anyway to use displacement map or bump map on polygons? Like we use on the globe, shaping them by geographical elevations?

world.polygonCapMaterial(
    new THREE.MeshStandardMaterial({
      color: "rgb(255,100,8)",
      displacementMap: disMap,
      displacementScale: 5,
    })
  );

I tried that but it didn't work like I expected. Is there a feature like that (I mean shaping the polygons, not polygonAltitude )?

vasturiano commented 2 years ago

@sowhat13 either bumpMap or displacementMap should work with a custom polygon material.

I'm assuming disMap is a valid ThreeJS Texture in your case. Do you have any console error in your example that may give a hint as to the source of the issue? Or could you make a reduced example on https://codepen.io ?