I am trying to apply displacementMap texture on a MeshStandartMaterial of a BoxGeometry.
Code:
// Geometry
const boxGeometry =new THREE.BoxGeometry( 1, 1, 1, 256, 256, 256 );
// Material
const boxMaterial = new THREE.MeshStandardMaterial({
map: colorTexture,
displacementMap: heightTexture,
displacementScale: 0.1
});
// Mesh
const box = new THREE.Mesh(boxGeometry, boxMaterial);
scene.add(box);
DisplacementMap:
The result:
How to get rid of those gaps? I tried to increase/decrease segments on a geometry and adjust the displacementScale, but nothing helped.