The problem is that the base map doesn’t get applied.
I have a Plane, created in THREE and a Knife imported from GLTF
. I have applied the same material to both, but it looks different on them. The Plane uses all of textures and looks much better, while the Knife looks flat. Also, if I remove all of the textures from the material except for the base map, the Plane has the base texture and the Knife doesn’t have it. How can I fix this issue?
This is base map only
This is how it looks with all of the textures
Here is the file I have created and exported from 3dsMax 2023
test.glb (675.8 KB)
And here is some code
const cubeRendererTarget = new THREE.WebGLCubeRenderTarget(128, {
format: THREE.RGBAFormat,
generateMipmaps: true,
minFilter: THREE.LinearMipMapLinearFilter,
encoding: THREE.sRGBEncoding,
});
const cubeCamera = new THREE.CubeCamera(1, 10000, cubeRendererTarget);
const metalTilesMaterial = new THREE.MeshStandardMaterial(
{
map: tilesBaseColor,
normalMap: tilesNormalMap,
displacementMap: tilesHeightMap,
displacementScale: 0.05,
roughnessMap: tilesRoughnessMap,
roughness: 0.5,
aoMap: tilesAmbientOcclusionMap,
metalnessMap: tilesMetallic,
metalness: 1,
envMap: cubeRendererTarget.texture,
},
);
const gltfLoader = new GLTFLoader();
gltfLoader.load(KnifeWithUnwrapMap,
function ( object ) {
object.scene.traverse(function (child) {
if (child instanceof THREE.Mesh) {
child.material = metalTilesMaterial;
}
});
scene.add( object.scene );
},
);
const plane = new THREE.Mesh(
new THREE.PlaneGeometry(2, 2, 500, 500),
metalTilesMaterial,
);
plane.geometry.attributes.uv2 = plane.geometry.attributes.uv;
plane.add(cubeCamera);