From 2a316f6cc78ce36013ad30013eecf0f0bbf317be Mon Sep 17 00:00:00 2001 From: bflatastic Date: Wed, 24 Dec 2025 22:54:11 +0700 Subject: [PATCH] grid fixes, toast z-index on 3d world page, smaller onboarding helper and moved to above promptbox --- .../PageEnigma/Editor/InfiniteGridHelper.ts | 7 +++- .../app/src/pages/PageEnigma/Editor/scene.ts | 2 +- .../PageEnigma/comps/OnboardingHelper.tsx | 41 +++++++++++-------- .../components/toaster/src/lib/toaster.tsx | 2 +- .../viewer-3d/src/lib/viewer-3d.tsx | 6 ++- 5 files changed, 34 insertions(+), 24 deletions(-) diff --git a/frontend/apps/editor3d/app/src/pages/PageEnigma/Editor/InfiniteGridHelper.ts b/frontend/apps/editor3d/app/src/pages/PageEnigma/Editor/InfiniteGridHelper.ts index af41dcb356..42a3e3f0ff 100644 --- a/frontend/apps/editor3d/app/src/pages/PageEnigma/Editor/InfiniteGridHelper.ts +++ b/frontend/apps/editor3d/app/src/pages/PageEnigma/Editor/InfiniteGridHelper.ts @@ -77,9 +77,9 @@ export class InfiniteGridHelper extends THREE.Mesh { float g1 = getGrid(uSize1); float g2 = getGrid(uSize2); - float grid = mix(g2 * 0.3, g1, g1); + float grid = mix(g2 * 0.1, g1, g1); - gl_FragColor = vec4(uColor.rgb, grid * fadeOut); + gl_FragColor = vec4(uColor.rgb, grid * fadeOut * 0.04); gl_FragColor.a = mix(0.5 * gl_FragColor.a, gl_FragColor.a, g2); if (gl_FragColor.a <= 0.0) discard; @@ -88,6 +88,9 @@ export class InfiniteGridHelper extends THREE.Mesh { extensions: { derivatives: true, }, + blending: THREE.AdditiveBlending, + depthTest: true, + depthWrite: false, }); super(geometry, material); diff --git a/frontend/apps/editor3d/app/src/pages/PageEnigma/Editor/scene.ts b/frontend/apps/editor3d/app/src/pages/PageEnigma/Editor/scene.ts index 05f40c766b..a278e9b8b5 100644 --- a/frontend/apps/editor3d/app/src/pages/PageEnigma/Editor/scene.ts +++ b/frontend/apps/editor3d/app/src/pages/PageEnigma/Editor/scene.ts @@ -1084,7 +1084,7 @@ class Scene { // Create visual infinite grid const size1 = 0.5; // Primary grid const size2 = 2.5; // Secondary grid - const color = new THREE.Color(0x444444); + const color = new THREE.Color(0xffffff); const distance = 80; this.gridHelper = new InfiniteGridHelper(size1, size2, color, distance); diff --git a/frontend/apps/editor3d/app/src/pages/PageEnigma/comps/OnboardingHelper.tsx b/frontend/apps/editor3d/app/src/pages/PageEnigma/comps/OnboardingHelper.tsx index ee3e463690..0382945b4f 100644 --- a/frontend/apps/editor3d/app/src/pages/PageEnigma/comps/OnboardingHelper.tsx +++ b/frontend/apps/editor3d/app/src/pages/PageEnigma/comps/OnboardingHelper.tsx @@ -13,6 +13,7 @@ export const OnboardingHelper = () => { useEffect(() => { // Check if the helper was dismissed + /* const dismissedData = localStorage.getItem(STORAGE_KEY); if (dismissedData) { const { timestamp } = JSON.parse(dismissedData); @@ -24,6 +25,7 @@ export const OnboardingHelper = () => { localStorage.removeItem(STORAGE_KEY); } } + */ }, []); const handleClose = () => { @@ -61,7 +63,7 @@ export const OnboardingHelper = () => { return ( { leaveFrom="opacity-100" leaveTo="opacity-0" > -
-
-

Hold

- -

and drag

-
-
+
+
- - - - - - - +
+ + + + + + +
+

Move

+
+
+
+
+ +
+

Look

-

to move around the scene

-
- +
+
diff --git a/frontend/libs/components/toaster/src/lib/toaster.tsx b/frontend/libs/components/toaster/src/lib/toaster.tsx index f18da7150a..6782c93295 100644 --- a/frontend/libs/components/toaster/src/lib/toaster.tsx +++ b/frontend/libs/components/toaster/src/lib/toaster.tsx @@ -15,7 +15,7 @@ export function Toaster({ offsetBottom = 12, offsetLeft = 12, offsetRight = 12, - zIndex = 9, + zIndex = 15, }: ToasterProps) { return ( (null); @@ -93,7 +93,9 @@ export function Viewer3D({ frontLight.position.set(0, 4, 10); scene.add(frontLight); - const gridHelper = new THREE.GridHelper(10, 10, 0x444444, 0x333333); + const gridHelper = new THREE.GridHelper(10, 10, 0xffffff, 0xffffff); + gridHelper.material.opacity = 0.05; + gridHelper.material.transparent = true; gridHelper.visible = showGrid; scene.add(gridHelper); gridRef.current = gridHelper;