Enhance advanced rendering settings and water material handling

This commit is contained in:
2026-04-06 18:06:16 +02:00
parent 14bb36f7a6
commit 47362036bf
5 changed files with 127 additions and 42 deletions

View File

@@ -16,14 +16,6 @@ export function ViewportCanvas({ panelId, world, sceneDocument, projectAssets, l
if (container === null) {
return;
}
const testCanvas = document.createElement("canvas");
const hasWebGl = testCanvas.getContext("webgl2") !== null ||
testCanvas.getContext("webgl") !== null ||
testCanvas.getContext("experimental-webgl") !== null;
if (!hasWebGl) {
setViewportMessage("WebGL is unavailable in this browser environment. The viewport shell is visible, but rendering is disabled.");
return;
}
try {
const viewportHost = new ViewportHost();
hostRef.current = viewportHost;

View File

@@ -449,6 +449,7 @@ export class ViewportHost {
this.boxCreatePreviewMesh.material.dispose();
this.boxCreatePreviewEdges.geometry.dispose();
this.boxCreatePreviewEdges.material.dispose();
this.renderer.forceContextLoss();
this.renderer.dispose();
if (this.container !== null && this.container.contains(this.renderer.domElement)) {
this.container.removeChild(this.renderer.domElement);