feat(render-modes): add Colored / Monochrome toggle to the Render menu

The textures axis had no UI control. Add Colored (textures on — show item
materials, textures, vertex colours) / Monochrome (textures off — flat clay
by surface role) options to the Render dropdown, wired to useViewer.textures.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Wassim SAMAD
2026-06-15 17:41:38 -04:00
co-authored by Claude Fable 5
parent 3d5a36c73d
commit 4411b8ab5f
@@ -26,8 +26,10 @@ import {
ChevronRight, ChevronRight,
Diamond, Diamond,
Layers, Layers,
Palette,
PenLine, PenLine,
Sparkles, Sparkles,
Square,
} from 'lucide-react' } from 'lucide-react'
import Link from 'next/link' import Link from 'next/link'
import { useShallow } from 'zustand/react/shallow' import { useShallow } from 'zustand/react/shallow'
@@ -37,6 +39,7 @@ import {
DropdownMenu, DropdownMenu,
DropdownMenuContent, DropdownMenuContent,
DropdownMenuItem, DropdownMenuItem,
DropdownMenuSeparator,
DropdownMenuTrigger, DropdownMenuTrigger,
} from './ui/primitives/dropdown-menu' } from './ui/primitives/dropdown-menu'
import { TooltipProvider } from './ui/primitives/tooltip' import { TooltipProvider } from './ui/primitives/tooltip'
@@ -87,8 +90,14 @@ const SHADING_OPTIONS = [
{ id: 'rendered', name: 'Rendered', detail: 'Full ambient occlusion', icon: Sparkles }, { id: 'rendered', name: 'Rendered', detail: 'Full ambient occlusion', icon: Sparkles },
] as const ] as const
const TEXTURE_OPTIONS = [
{ id: true, name: 'Colored', detail: 'Show materials, textures & colours', icon: Palette },
{ id: false, name: 'Monochrome', detail: 'Flat clay surfaces by role', icon: Square },
] as const
function RenderModeMenu() { function RenderModeMenu() {
const shading = useViewer((s) => s.shading) const shading = useViewer((s) => s.shading)
const textures = useViewer((s) => s.textures)
const active = SHADING_OPTIONS.find((o) => o.id === shading) ?? SHADING_OPTIONS[0] const active = SHADING_OPTIONS.find((o) => o.id === shading) ?? SHADING_OPTIONS[0]
const ActiveIcon = active.icon const ActiveIcon = active.icon
return ( return (
@@ -121,6 +130,23 @@ function RenderModeMenu() {
</DropdownMenuItem> </DropdownMenuItem>
) )
})} })}
<DropdownMenuSeparator />
{TEXTURE_OPTIONS.map((option) => {
const OptionIcon = option.icon
return (
<DropdownMenuItem
key={option.name}
onSelect={() => useViewer.getState().setTextures(option.id)}
>
<OptionIcon />
<div className="flex flex-col">
<span className="text-foreground">{option.name}</span>
<span className="text-muted-foreground text-xs">{option.detail}</span>
</div>
{textures === option.id ? <Check className="ml-auto text-foreground" /> : null}
</DropdownMenuItem>
)
})}
</DropdownMenuContent> </DropdownMenuContent>
</DropdownMenu> </DropdownMenu>
) )