Skip to content

Commit

Permalink
Refactor merge geometry custom shader application to avoi shader conf…
Browse files Browse the repository at this point in the history
…licts
  • Loading branch information
vasturiano committed Dec 9, 2024
1 parent 29c0f81 commit debda4e
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/layers/hexbin.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,17 @@ export default Kapsule({
return geom;
}));

const hexPoints = new THREE.Mesh(
hexPointsGeometry,
applyShaderExtensionToMaterial(
new THREE.MeshLambertMaterial({
color: 0xffffff,
transparent: true,
vertexColors: true,
side: THREE.DoubleSide
}),
invisibleUndergroundShaderExtend
)
);
const hexMaterial = new THREE.MeshLambertMaterial({
color: 0xffffff,
transparent: true,
vertexColors: true,
side: THREE.DoubleSide
});
hexMaterial.onBeforeCompile = shader => {
hexMaterial.userData.shader = invisibleUndergroundShaderExtend(shader);
};

const hexPoints = new THREE.Mesh(hexPointsGeometry, hexMaterial);

hexPoints.__globeObjType = 'hexBinPoints'; // Add object type
hexPoints.__data = hexBins; // Attach obj data
Expand Down

0 comments on commit debda4e

Please sign in to comment.