#webgl #3d #leptos #animation #graphics

yanked leptos-motion-webgl

WebGL rendering engine for leptos-motion

2 releases (1 stable)

1.1.0 Sep 16, 2025
0.9.0 Sep 12, 2025

#72 in #webgl

Download history

51 downloads per month

MIT/Apache

1MB
26K SLoC

Leptos Motion WebGL

A high-performance WebGL rendering engine for Leptos Motion, providing full 3D graphics capabilities with type safety and reactive integration.

Features

  • WebGL2 Rendering: Modern WebGL2 context with full feature support
  • Type Safety: Rust's type system ensures compile-time safety for 3D operations
  • Reactive Integration: Native Leptos signal integration for dynamic scenes
  • Performance: Optimized rendering pipeline with minimal overhead
  • Scene Graph: Hierarchical object management with efficient traversal
  • Camera System: Multiple camera types with controls and animations
  • Material System: Flexible material system with lighting support
  • Geometry Management: Efficient vertex buffer management and instancing

Quick Start

use leptos_motion_webgl::{WebGLRenderer, Scene, PerspectiveCamera};
use leptos::prelude::*;

#[component]
fn WebGLDemo() -> impl IntoView {
    let canvas_ref = NodeRef::<leptos::html::Canvas>::new();

    create_effect(move |_| {
        if let Some(canvas) = canvas_ref.get() {
            let mut renderer = WebGLRenderer::new(canvas).unwrap();
            let scene = Scene::new();
            let mut camera = PerspectiveCamera::new(75.0, 1.0, 0.1, 1000.0);

            renderer.render(&scene, &mut camera);
        }
    });

    view! {
        <canvas node_ref=canvas_ref width="800" height="600"></canvas>
    }
}

Dependencies

~24–33MB
~607K SLoC