Preserve reflection render target aspect
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user