[212] Pathtracer Etappe 2: Entrauscher (À-trous/SVGF), Materialtabelle je Baustoff, Glas mit fester Fresnel-Spiegelung, Bild-Export mit N Samples, Nachthimmel

- denoise.rs: À-trous nach SVGF ohne Zeit-Reprojektion (Albedo demoduliert, Normale/Tiefe/Varianz), CPU-Referenz + WGSL, Mischgewicht nach Sample-Zahl; Schalter set_pathtrace_denoise (Renderer, web)
- pt_material.rs: Material-Ebene (materialIndex) -> Look nach Baustoff/Bildkarte wie [211], mittlere Bildkarten-Farbe; Art/Rauigkeit/Metall im BVH-Dreieck; pathtraceMaterials (TS), ptMaterials im CLI-model3d
- Glas: Spiegelung als fester Anteil (reflected), Durchgänge ohne Abpraller/Russian Roulette
- Bild-Export [223] im Pathtracing-Stil: N Samples (Dialog, Vorgabe 64), intern bis 4 MPx
- Sonne unter dem Horizont: Nachthimmel; behoben: achsparallele Strahlen (Ortho-Ansichten) trafen nichts
- render_png --denoise off, --pt-goal
This commit is contained in:
Claude committed 2026-11-13 14:39:17 +00:00
1 parent b78214af1d
commit 730ce9dddf
24 files changed
+1511 -171

No files matched your search

+12 -2
View File
@@ -13,7 +13,7 @@ import { defaultTargetLayout, placeImageOnLayout } from "../state/layoutImageAct
import { saveBinaryFile } from "../native/saveFile";
import { captureImage, getCamera, viewportAvailable, type ViewCamera } from "../viewport/cameraBridge";
import { cameraToView } from "../viewport/cameraView";
import { IMAGE_MAX_EDGE, clampImageSize, imageFileName } from "../viewport/imageExport";
import { IMAGE_MAX_EDGE, PT_EXPORT_MAX_SAMPLES, PT_EXPORT_SAMPLES, clampImageSize, exportSamples, imageFileName } from "../viewport/imageExport";
type SizeId = "view" | "hd" | "uhd" | "a4" | "a3" | "a2" | "custom";
const SIZE_IDS: SizeId[] = ["view", "hd", "uhd", "a4", "a3", "a2", "custom"];
@@ -39,6 +39,9 @@ export const ImageExportDialogHost = memo(function ImageExportDialogHost() {
const [size, setSize] = useState<SizeId>("uhd");
const [dims, setDims] = useState({ width: 3840, height: 2160 });
const [transparent, setTransparent] = useState(false);
// [212] Samples je Pixel, wenn die 3D-Ansicht im Stil „Pathtracing (Vorschau)“ steht.
const [samples, setSamples] = useState(PT_EXPORT_SAMPLES);
const [pathtrace, setPathtrace] = useState(false);
const [cameraKey, setCameraKey] = useState("live");
const [phase, setPhase] = useState<Phase>("setup");
const [message, setMessage] = useState("");
@@ -53,6 +56,7 @@ export const ImageExportDialogHost = memo(function ImageExportDialogHost() {
const a = getCamera()?.aspect;
const asp = a && Number.isFinite(a) && a > 0 ? a : 16 / 9;
setAspect(asp);
setPathtrace(st.renderMode === "pathtrace");
setCameraKey("live");
setPhase("setup");
setMessage("");
@@ -118,7 +122,7 @@ export const ImageExportDialogHost = memo(function ImageExportDialogHost() {
setMessage("");
// Dem Browser einen Frame lassen, damit „Arbeite …" erscheint, bevor das Zeichnen den Hauptthread belegt.
await new Promise((r) => requestAnimationFrame(() => r(null)));
const img = await captureImage({ width: dims.width, height: dims.height, transparent, ...(camera ? { camera } : {}) });
const img = await captureImage({ width: dims.width, height: dims.height, transparent, ...(camera ? { camera } : {}), ...(pathtrace ? { samples: exportSamples(samples) } : {}) });
if (!img) {
setPhase("error");
setMessage(viewportAvailable() ? t("image3d.empty") : t("image3d.noViewport"));
@@ -196,6 +200,12 @@ export const ImageExportDialogHost = memo(function ImageExportDialogHost() {
<input type="checkbox" data-testid="image3d-transparent" checked={transparent} disabled={busy} onChange={(e) => setTransparent(e.target.checked)} />
{t("image3d.transparent")}
</label>
{pathtrace && (
<label style={{ display: "flex", gap: 6, alignItems: "center", marginTop: 6 }}>
{t("image3d.samples")}{" "}
<input className="imp-input" type="number" min={1} max={PT_EXPORT_MAX_SAMPLES} style={{ width: 90 }} data-testid="image3d-samples" value={samples} disabled={busy} onChange={(e) => setSamples(Number(e.target.value))} />
</label>
)}
</section>
</>
)}