Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/dev/core/src/Materials/Textures/mirrorTexture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { BlurPostProcess } from "../../PostProcesses/blurPostProcess";
import { Constants } from "../../Engines/constants";
import { Plane } from "../../Maths/math.plane";
import type { UniformBuffer } from "../uniformBuffer";
import type { TextureSize } from "../../Materials/Textures/textureCreationOptions";

/**
* Mirror texture can be used to simulate the view from a mirror in a scene.
* It will dynamically be rendered every frame to adapt to the camera point of view.
Expand Down Expand Up @@ -102,6 +104,15 @@ export class MirrorTexture extends RenderTargetTexture {
this.blurKernelY = this._adaptiveBlurKernel * dh;
}

public override resize(size: TextureSize | { ratio: number }): void {
super.resize(size);
if (!this._adaptiveBlurKernel) {
this._preparePostProcesses();
} else {
this._autoComputeBlurKernel();
}
}

protected override _onRatioRescale(): void {
if (this._sizeRatio) {
this.resize(this._initialSizeParameter);
Expand Down
Loading