Add Bloom effect to post-processing and update color space in scene rendering

This commit is contained in:
2025-07-21 18:11:02 +05:30
parent 2984a283e2
commit 8a6312322c
2 changed files with 10 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
import { EffectComposer, N8AO, Outline } from "@react-three/postprocessing";
import { Bloom, EffectComposer, N8AO, Outline } from "@react-three/postprocessing";
import { BlendFunction } from "postprocessing";
import {
useDeletableFloorItem,
@@ -77,6 +77,12 @@ export default function PostProcessing() {
denoiseRadius={6}
denoiseSamples={16}
/>
<Bloom
intensity={0.1}
luminanceThreshold={0.9}
luminanceSmoothing={0.025}
mipmapBlur={false}
/>
{selectedWallAsset && (
<Outline
selection={flattenChildren(selectedWallAsset.children)}

View File

@@ -13,7 +13,7 @@ import { useParams } from "react-router-dom";
import { getAllProjects } from "../../services/dashboard/getAllProjects";
import { getUserData } from "../../functions/getUserData";
import { useLoadingProgress, useSocketStore } from "../../store/builder/store";
import { Color } from "three";
import { Color, SRGBColorSpace } from "three";
export default function Scene({ layout }: { readonly layout: 'Main Layout' | 'Comparison Layout' }) {
const map = useMemo(() => [
@@ -67,7 +67,7 @@ export default function Scene({ layout }: { readonly layout: 'Main Layout' | 'Co
onCreated={(e) => {
e.scene.background = layout === 'Main Layout' ? null : new Color(0x19191d);
}}
gl={{ powerPreference: "high-performance", antialias: true, preserveDrawingBuffer: true }}
gl={{ outputColorSpace: SRGBColorSpace, powerPreference: "high-performance", antialias: true, preserveDrawingBuffer: true }}
>
<Setup />
<Collaboration />
@@ -77,4 +77,4 @@ export default function Scene({ layout }: { readonly layout: 'Main Layout' | 'Co
</Canvas>
</KeyboardControls>
);
}
}