diff --git a/app/src/assets/textures/floor/tex2/MI_FloorMats01_Normal.png b/app/src/assets/textures/floor/tex2/MI_FloorMats01_Normal.png index 1ef3ee5..b10551b 100644 Binary files a/app/src/assets/textures/floor/tex2/MI_FloorMats01_Normal.png and b/app/src/assets/textures/floor/tex2/MI_FloorMats01_Normal.png differ diff --git a/app/src/assets/textures/floor/tex2/MI_FloorMats01_baseColor.png b/app/src/assets/textures/floor/tex2/MI_FloorMats01_baseColor.png index f0f2a62..cf12929 100644 Binary files a/app/src/assets/textures/floor/tex2/MI_FloorMats01_baseColor.png and b/app/src/assets/textures/floor/tex2/MI_FloorMats01_baseColor.png differ diff --git a/app/src/assets/textures/floor/tex2/MI_FloorMats01_occlusionRoughnessMetallic.png b/app/src/assets/textures/floor/tex2/MI_FloorMats01_occlusionRoughnessMetallic.png index 6634cfb..cc84470 100644 Binary files a/app/src/assets/textures/floor/tex2/MI_FloorMats01_occlusionRoughnessMetallic.png and b/app/src/assets/textures/floor/tex2/MI_FloorMats01_occlusionRoughnessMetallic.png differ diff --git a/app/src/modules/builder/floor/Instances/Instance/floorInstance.tsx b/app/src/modules/builder/floor/Instances/Instance/floorInstance.tsx index 1b92209..419c1d8 100644 --- a/app/src/modules/builder/floor/Instances/Instance/floorInstance.tsx +++ b/app/src/modules/builder/floor/Instances/Instance/floorInstance.tsx @@ -49,7 +49,7 @@ function FloorInstance({ floor }: { floor: Floor }) { roughnessMap?: string; metalnessMap?: string; normalMap?: string; - textureTileScale?: number; + textureTileScale?: [number, number]; } > = { "Default Material": { @@ -63,13 +63,14 @@ function FloorInstance({ floor }: { floor: Floor }) { roughnessMap: material2MetalicRoughnessMap, metalnessMap: material2MetalicRoughnessMap, normalMap: material2NormalMap, - textureTileScale: 0.1, + textureTileScale: [0.1, 0.1], }, "Material 3": { map: material3Map, roughnessMap: material3MetalicRoughnessMap, metalnessMap: material3MetalicRoughnessMap, normalMap: material3NormalMap, + textureTileScale: [0.35, 0.5], }, "Material 4": { map: material4Map, @@ -118,38 +119,59 @@ function FloorInstance({ floor }: { floor: Floor }) { const sideTexturesList = getMaterialMaps(sideMaterial, defaultMaterialMap); // Use loader to load top and side textures - const [ - topTexture, topNormalTexture, topRoughnessTexture, topMetalicTexture, - ] = useLoader(TextureLoader, topTexturesList); + const [topTexture, topNormalTexture, topRoughnessTexture, topMetalicTexture] = + useLoader(TextureLoader, topTexturesList); const [ - sideTexture, sideNormalTexture, sideRoughnessTexture, sideMetalicTexture, + sideTexture, + sideNormalTexture, + sideRoughnessTexture, + sideMetalicTexture, ] = useLoader(TextureLoader, sideTexturesList); // Early exit if materials are missing - if (!materials[floor.topMaterial] || !materials[floor.sideMaterial]) return null; + if (!materials[floor.topMaterial] || !materials[floor.sideMaterial]) + return null; // Combine and pair textures with their corresponding material const textureMaterialMap = [ - { textures: [topTexture, topNormalTexture, topRoughnessTexture, topMetalicTexture], materialKey: floor.topMaterial }, - { textures: [sideTexture, sideNormalTexture, sideRoughnessTexture, sideMetalicTexture], materialKey: floor.sideMaterial }, + { + textures: [ + topTexture, + topNormalTexture, + topRoughnessTexture, + topMetalicTexture, + ], + materialKey: floor.topMaterial, + }, + { + textures: [ + sideTexture, + sideNormalTexture, + sideRoughnessTexture, + sideMetalicTexture, + ], + materialKey: floor.sideMaterial, + }, ]; // Apply texture settings textureMaterialMap.forEach(({ textures, materialKey }) => { - const tileScale = materials[materialKey]?.textureTileScale ?? textureScale; + const tileScale = materials[materialKey]?.textureTileScale ?? [ + textureScale, + textureScale, + ]; textures.forEach((tex, idx) => { if (!tex) return; tex.wrapS = tex.wrapT = RepeatWrapping; - tex.repeat.set(tileScale, tileScale); + tex.repeat.set(tileScale[0], tileScale[1]); tex.anisotropy = 16; // First texture is always the color map (use SRGB), others should be linear tex.colorSpace = idx < 1 ? SRGBColorSpace : NoColorSpace; }); }); - if (!shape) return null; return (