From d2119eaa16230b083336c557b47f2106860a1674 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 10 Feb 2026 17:13:48 +0000 Subject: [PATCH] Fix 3D scene loading issue Problem: Scene stuck on loading screen Cause: Texture loading blocking render + missing font file Fixes: - Temporarily disabled texture loading (useTexture) - Temporarily disabled 3D dimension labels (Text component) - Fallback to solid color materials - Removed unused imports Result: Scene loads immediately with procedural door geometry Note: Textures and dimension labels can be re-enabled once: 1. Font file is added to public/fonts/ 2. Texture preloading strategy is implemented --- components/configurator/door-3d-enhanced.tsx | 79 +++++--------------- 1 file changed, 20 insertions(+), 59 deletions(-) diff --git a/components/configurator/door-3d-enhanced.tsx b/components/configurator/door-3d-enhanced.tsx index 10451d9..fabe7ea 100644 --- a/components/configurator/door-3d-enhanced.tsx +++ b/components/configurator/door-3d-enhanced.tsx @@ -2,40 +2,18 @@ import { useRef } from "react"; import { useConfiguratorStore } from "@/lib/store"; -import { RoundedBox, Text, useTexture } from "@react-three/drei"; -import { getMetalTexture } from "@/lib/asset-map"; +import { RoundedBox } from "@react-three/drei"; import * as THREE from "three"; -// Steel material with photorealistic texture mapping -const SteelMaterial = ({ color, finish }: { color: string; finish: string }) => { - try { - const metalTexture = useTexture(getMetalTexture(finish)); - - // Configure texture repeat for realistic grain (4x horizontal, 8x vertical) - metalTexture.wrapS = metalTexture.wrapT = THREE.RepeatWrapping; - metalTexture.repeat.set(4, 8); - - return ( - - ); - } catch (error) { - // Fallback to solid color if texture fails - return ( - - ); - } -}; +// Steel material - fallback to solid color for now +const SteelMaterial = ({ color }: { color: string }) => ( + +); // Glass material const GlassMaterial = () => ( @@ -52,7 +30,7 @@ const GlassMaterial = () => ( /> ); -// 3D Dimension Label Component +// 3D Dimension Label Component - temporarily disabled function DimensionLabel({ value, position, @@ -62,24 +40,7 @@ function DimensionLabel({ position: [number, number, number]; label: string; }) { - return ( - - - {`${Math.round(value)} ${label}`} - - {/* Background for better readability */} - - - - - - ); + return null; // Temporarily disabled to fix loading } export function Door3DEnhanced() { @@ -128,7 +89,7 @@ export function Door3DEnhanced() { position={[-doorWidth / 2 + stileWidth / 2, 0, 0]} castShadow > - + {/* RIGHT STILE - Vertical profile */} @@ -139,7 +100,7 @@ export function Door3DEnhanced() { position={[doorWidth / 2 - stileWidth / 2, 0, 0]} castShadow > - + {/* TOP RAIL - Horizontal profile */} @@ -150,7 +111,7 @@ export function Door3DEnhanced() { position={[0, doorHeight / 2 - railHeight / 2, 0]} castShadow > - + {/* BOTTOM RAIL - Horizontal profile */} @@ -161,7 +122,7 @@ export function Door3DEnhanced() { position={[0, -doorHeight / 2 + railHeight / 2, 0]} castShadow > - + {/* INTERMEDIATE RAILS (Grid dividers) */} @@ -174,7 +135,7 @@ export function Door3DEnhanced() { position={[0, yPos, 0]} castShadow > - + ))} @@ -187,7 +148,7 @@ export function Door3DEnhanced() { position={[0, 0, 0]} castShadow > - + )} @@ -212,7 +173,7 @@ export function Door3DEnhanced() { position={[0, 0, railDepth / 2 + 0.01]} castShadow > - + )} @@ -220,7 +181,7 @@ export function Door3DEnhanced() { {doorType === "scharnier" && handle === "klink" && ( - +