Skip to content

Latest commit

ย 

History

History
94 lines (73 loc) ยท 3.18 KB

File metadata and controls

94 lines (73 loc) ยท 3.18 KB

Molecular Dynamics Visualization UI

An interactive 3D molecular dynamics visualization platform built with React, Three.js, and WebGPU for high-performance rendering of large protein structures.

๐Ÿš€ Features

  • Interactive 3D Visualization: Real-time molecular structure rendering with orbit controls
  • WebGPU Acceleration: GPU-powered rendering for large protein structures (10k+ atoms)
  • Performance Monitoring: Built-in FPS counter to track rendering performance
  • Chain Selection: Interactive chain highlighting and information display
  • PDB Support: Load and visualize PDB format molecular structures
  • Trajectory Playback: Animate molecular dynamics simulation trajectories

๐Ÿ“ธ Screenshots

Molecular Visualization 1 Molecular Visualization 2
Molecular Visualization 3 Molecular Visualization 4

๐Ÿ› ๏ธ Tech Stack

  • React - UI framework
  • TypeScript - Type-safe development
  • Three.js / React Three Fiber - 3D rendering
  • WebGPU - GPU-accelerated compute and rendering
  • React Three Drei - Helpful Three.js utilities

๐Ÿ“‹ Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn
  • WebGPU-compatible browser (Chrome 113+, Edge 113+)

๐ŸŽฎ Usage

  1. Load a Structure: Upload a PDB file or use the included example (trajectory.json)
  2. Navigate: Use mouse to rotate (left-click drag), pan (right-click drag), and zoom (scroll)
  3. Select Chains: Click on molecular chains to highlight and view detailed information
  4. Monitor Performance: Check the FPS counter in the top-right for rendering performance

๐Ÿ”ง Configuration

The application automatically detects WebGPU support and falls back to WebGL for systems without WebGPU:

  • WebGPU Mode: Used for structures with 10,000+ atoms
  • WebGL Mode: Used for smaller structures or WebGPU-incompatible browsers

๐Ÿ“ Project Structure

md-ui/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/         # React components
โ”‚   โ”‚   โ”œโ”€โ”€ MolecularView.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ BackboneView.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ GPUAtomRenderer.tsx
โ”‚   โ”‚   โ””โ”€โ”€ FPSCounter.tsx
โ”‚   โ”œโ”€โ”€ gpu/               # WebGPU context and shaders
โ”‚   โ”‚   โ”œโ”€โ”€ WebGpuContext.ts
โ”‚   โ”‚   โ”œโ”€โ”€ computePipeline.ts
โ”‚   โ”‚   โ””โ”€โ”€ shaders/
โ”‚   โ”œโ”€โ”€ types/             # TypeScript type definitions
โ”‚   โ””โ”€โ”€ pages/             # Page components
โ”œโ”€โ”€ images/                # Screenshots and assets
โ””โ”€โ”€ public/                # Static files

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“„ License

This project is open source and available under the MIT License.

๐Ÿ”— Resources