Preserve reflection render target aspect

This commit is contained in:
2026-06-04 11:54:59 +02:00
parent 5127bbc743
commit 90308e4b1b
+8 -2
View File
@@ -1051,8 +1051,14 @@ function resize() {
renderer.setSize(width, height, false);
camera.aspect = width / height;
camera.updateProjectionMatrix();
const reflectionWidth = Math.max(1024, Math.min(4096, Math.floor(width * reflectionPixelRatio * 1.5)));
const reflectionHeight = Math.max(576, Math.min(2304, Math.floor(height * reflectionPixelRatio * 1.5)));
const desiredReflectionScale = reflectionPixelRatio * 1.5;
const reflectionScale = Math.max(1, Math.min(
desiredReflectionScale,
4096 / width,
2304 / height
));
const reflectionWidth = Math.floor(width * reflectionScale);
const reflectionHeight = Math.floor(height * reflectionScale);
reflectionTargetSize.set(reflectionWidth, reflectionHeight);
tableReflectionTarget.setSize(
reflectionTargetSize.x,