3D Viewer Presets Demo
This page demonstrates the new preset-based 3D viewer system. The refactored ModelViewer uses environment presets and tiered controls for simpler, more consistent usage across the site.
✨ New Features:
- Environment Presets - Studio, Dramatic, Soft, Minimal lighting setups
- Control Tiers - None, Simple, Advanced, Debug visibility levels
- Debug Mode - One flag to show all helpers and preset selector
- Simplified API - 5 props instead of 15+
Example 1: Gallery Viewer (Studio Preset)
Professional character showcase with balanced 3-point lighting. Simple controls for end users (rotate toggle + reset button).
preset="studio" | controlTier="simple" | autoRotate=true Example 2: Dramatic Preset (High Contrast)
High-contrast lighting for action poses and dramatic scenes. Very bright key light with minimal fill creates strong shadows.
preset="glb" | controlTier="advanced" | toonShading=true Example 3: Soft Preset (Gentle Lighting)
Even, diffused lighting for cute characters and friendly scenes. No shadows, bright fill light creates a gentle atmosphere.
preset="glb" | controlTier="simple" | autoRotate=true Example 4: Minimal Preset (Embedded Viewer)
Compact viewer for inline embedding in comics or blog posts. No visible controls, single key light, auto-rotate enabled.
preset="minimal" | controlTier="none" | width=400 | height=400 Example 5: Debug Mode (Full Controls)
Development mode with all debug helpers and full control panel. Shows bounding box, grid, axes, light positions, and preset selector.
preset="studio" | controlTier="debug" | debugMode=true Debug Mode Features: Bounding box (green), Grid & axes, Light position helpers (spheres), Preset selector dropdown, All lighting controls
Usage Guide
Available Presets
studio (Default)
Balanced 3-point lighting for professional showcase
Use for: Character gallery, detailed models
dramatic
High-contrast lighting for action scenes
Use for: Dynamic poses, villain shots
soft
Even, gentle lighting for cute characters
Use for: Chibi models, friendly atmospheres
minimal
Lightweight preset for embedded viewers
Use for: Small inline viewers, mobile
Control Tiers
Code Example
---
import { ModelViewer } from '@components/react/3d';
---
<ModelViewer
client:load
modelPath="/models/character.glb"
preset="studio"
controlTier="simple"
autoRotate={true}
height="600px"
/> Migration Guide: See docs/components/3D_MIGRATION_GUIDE.md
for detailed examples of migrating from old API to new preset system.
Documentation
- Architecture Overview:
docs/components/3D_ARCHITECTURE.md - Migration Guide:
docs/components/3D_MIGRATION_GUIDE.md - Blender Workflow:
docs/components/BLENDER_WORKFLOW.md - Preset Configuration:
src/components/react/3d/presets/environments.ts