Remove paint color picker and tone down body material reflections

Body panels now use a fixed matte MeshStandardMaterial instead of the
glossy clearcoat MeshPhysicalMaterial, which produced overly strong
highlights on the tailgate/bumper.
This commit is contained in:
Maaxxs 2026-08-31 01:02:30 +02:00
parent 40a309df9b
commit a6f6adcaba
3 changed files with 5 additions and 81 deletions

42
app.js
View file

@ -22,7 +22,6 @@ const lidStateLabel = document.getElementById("lidStateLabel");
const toggleFloor = document.getElementById("toggleFloor"); const toggleFloor = document.getElementById("toggleFloor");
const floorStateLabel = document.getElementById("floorStateLabel"); const floorStateLabel = document.getElementById("floorStateLabel");
const floorToggleRow = document.getElementById("floorToggleRow"); const floorToggleRow = document.getElementById("floorToggleRow");
const paintSwatches = document.getElementById("paintSwatches");
const subPresetsBox = document.getElementById("subPresets"); const subPresetsBox = document.getElementById("subPresets");
const subW = document.getElementById("subW"); const subW = document.getElementById("subW");
@ -51,16 +50,7 @@ let floorAnimId = null;
const FLOOR_DOWN_ANGLE = 0; const FLOOR_DOWN_ANGLE = 0;
const FLOOR_UP_ANGLE = -0.8; const FLOOR_UP_ANGLE = -0.8;
const PAINT_COLORS = [ const BODY_PAINT_COLOR = 0x3c4046;
{ id: "graphite", label: "Graphitgrau", color: 0x3c4046 },
{ id: "black", label: "Schwarz", color: 0x14151a },
{ id: "white", label: "Weiß", color: 0xe9ebee },
{ id: "silver", label: "Silber", color: 0xaab0b6 },
{ id: "red", label: "Rot", color: 0x8a1620 },
{ id: "blue", label: "Blau", color: 0x1f4a7a },
{ id: "orange", label: "Orange", color: 0xd9631e },
];
let bodyPaintColor = PAINT_COLORS[0].color;
const VIN_RE = /^[A-HJ-NPR-Z0-9]{17}$/; // ISO 3779: no I, O, Q const VIN_RE = /^[A-HJ-NPR-Z0-9]{17}$/; // ISO 3779: no I, O, Q
@ -83,7 +73,6 @@ async function init() {
buildChips(); buildChips();
buildSubPresets(); buildSubPresets();
buildPaintSwatches();
setupScene(); setupScene();
searchInput.addEventListener("input", onInput); searchInput.addEventListener("input", onInput);
@ -194,25 +183,6 @@ function buildChips() {
}); });
} }
function buildPaintSwatches() {
paintSwatches.innerHTML = "";
PAINT_COLORS.forEach((p, i) => {
const btn = document.createElement("button");
btn.className = "swatch";
btn.type = "button";
btn.title = p.label;
btn.style.background = "#" + p.color.toString(16).padStart(6, "0");
if (i === 0) btn.classList.add("active");
btn.addEventListener("click", () => {
bodyPaintColor = p.color;
[...paintSwatches.children].forEach((c) => c.classList.remove("active"));
btn.classList.add("active");
rebuildTrunkOnly();
});
paintSwatches.appendChild(btn);
});
}
function buildSubPresets() { function buildSubPresets() {
subPresetsBox.innerHTML = ""; subPresetsBox.innerHTML = "";
SUB_PRESETS.forEach((preset) => { SUB_PRESETS.forEach((preset) => {
@ -483,12 +453,10 @@ function createNoiseTexture(baseColor, speckleBase, speckleRange, alpha) {
} }
function paintMaterial(color) { function paintMaterial(color) {
return new THREE.MeshPhysicalMaterial({ return new THREE.MeshStandardMaterial({
color, color,
metalness: 0.6, metalness: 0.1,
roughness: 0.28, roughness: 0.7,
clearcoat: 1,
clearcoatRoughness: 0.12,
}); });
} }
@ -534,7 +502,7 @@ function buildRearAssembly(bw, tw, h, zBack) {
const bumperDrop = Math.max(h * 0.35, 0.18); const bumperDrop = Math.max(h * 0.35, 0.18);
const headerH = Math.max(h * 0.32, 0.18); const headerH = Math.max(h * 0.32, 0.18);
const bodyTopY = h + headerH; const bodyTopY = h + headerH;
const paintMat = paintMaterial(bodyPaintColor); const paintMat = paintMaterial(BODY_PAINT_COLOR);
const trimMat = new THREE.MeshStandardMaterial({ color: 0x1c1d20, roughness: 0.85 }); const trimMat = new THREE.MeshStandardMaterial({ color: 0x1c1d20, roughness: 0.85 });
const lightMat = new THREE.MeshPhysicalMaterial({ const lightMat = new THREE.MeshPhysicalMaterial({
color: 0x7a0f14, emissive: 0xff2233, emissiveIntensity: 1.1, metalness: 0.3, roughness: 0.3, clearcoat: 0.8, color: 0x7a0f14, emissive: 0xff2233, emissiveIntensity: 1.1, metalness: 0.3, roughness: 0.3, clearcoat: 0.8,

View file

@ -64,10 +64,6 @@
Referenz-Koffer (55×40×20 cm) einblenden Referenz-Koffer (55×40×20 cm) einblenden
</label> </label>
</div> </div>
<div class="paint-picker">
<span class="paint-label">Lackfarbe</span>
<div class="swatches" id="paintSwatches"></div>
</div>
<div class="viewer-hint">Ziehen (Hintergrund) zum Drehen · Ziehen (Box) zum Verschieben · Scrollen zum Zoomen</div> <div class="viewer-hint">Ziehen (Hintergrund) zum Drehen · Ziehen (Box) zum Verschieben · Scrollen zum Zoomen</div>
</div> </div>
</section> </section>

View file

@ -356,46 +356,6 @@ main {
min-height: 420px; min-height: 420px;
} }
.paint-picker {
position: absolute;
top: 12px;
right: 14px;
display: flex;
align-items: center;
gap: 9px;
background: rgba(0,0,0,0.4);
padding: 7px 12px;
border-radius: 999px;
}
.paint-label {
font-size: 0.75rem;
color: var(--text-dim);
}
.swatches {
display: flex;
gap: 6px;
}
.swatch {
width: 20px;
height: 20px;
border-radius: 50%;
border: 2px solid rgba(255,255,255,0.15);
cursor: pointer;
padding: 0;
}
.swatch:hover {
border-color: rgba(255,255,255,0.4);
}
.swatch.active {
border-color: var(--accent);
box-shadow: 0 0 0 2px rgba(255,138,61,0.3);
}
.viewer-hint { .viewer-hint {
position: absolute; position: absolute;
bottom: 10px; bottom: 10px;