From d6af0671863fd6a513bb32a3897a158da316fa8f Mon Sep 17 00:00:00 2001 From: reidlab Date: Tue, 15 Aug 2023 20:22:56 -0700 Subject: [PATCH] update acrylic --- .../ui/components/acrylic/index.tsx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/ReplicatedStorage/ui/components/acrylic/index.tsx b/src/ReplicatedStorage/ui/components/acrylic/index.tsx index acf9ccc..e59eaa1 100644 --- a/src/ReplicatedStorage/ui/components/acrylic/index.tsx +++ b/src/ReplicatedStorage/ui/components/acrylic/index.tsx @@ -19,14 +19,6 @@ function getOffset(): number { return map(Workspace.CurrentCamera!.ViewportSize.Y, 0, 2560, 8, 56) } -const DOFEffect = Make("DepthOfFieldEffect", { - FarIntensity: 0, - InFocusRadius: 0.1, - NearIntensity: 1 -}) - -DOFEffect.Parent = Lighting - interface acrylicProps extends Roact.JsxInstanceProperties { radius: number distance: number @@ -131,6 +123,13 @@ function acrylic(props: acrylicProps): Roact.Element { const fovHandle = Workspace.CurrentCamera!.GetPropertyChangedSignal("FieldOfView").Connect(updateInstance) const viewportHandle = Workspace.CurrentCamera!.GetPropertyChangedSignal("ViewportSize").Connect(updateInstance) + Make("DepthOfFieldEffect", { + FarIntensity: 0, + InFocusRadius: 0.1, + NearIntensity: 1, + Parent: Lighting + }) + return () => { posHandle.Disconnect() fovHandle.Disconnect()