
Babylonjs Engine
Implement production-ready Babylon.js patterns—GLTF loading, PBR, physics, particles, WebXR, and performance—for 3D web experiences.
Overview
Babylonjs-engine is an agent skill for the Build phase that supplies production-oriented Babylon.js code patterns for loading, rendering, physics, XR, and performance in web 3D apps.
Install
npx skills add https://github.com/freshtechbro/claudedesignskills --skill babylonjs-engineWhat is this skill?
- 10 documentation sections from model loading through animation patterns
- GLTF model viewer with OnPluginActivatedObservable progress callbacks
- Coverage: advanced materials, physics, particles, post-processing, GUI, WebXR
- Dedicated performance optimization and camera system patterns
- ES module imports aligned with @babylonjs/core and glTF loaders
- 10 major topic sections in the skill table of contents
Adoption & trust: 764 installs on skills.sh; 227 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are building a WebGL product but lack vetted patterns for GLTF loading, materials, physics, and XR without piecing together outdated forum posts.
Who is it for?
Indie game and 3D SaaS builders using Babylon.js who want a structured pattern library while coding with Claude Code or Cursor.
Skip if: 2D-only SPAs, native Unity/Unreal pipelines, or beginners who have not shipped any WebGL hello-world yet.
When should I use this skill?
When implementing or extending a Babylon.js scene requiring loaders, materials, physics, particles, post-processing, GUI, WebXR, cameras, or performance work.
What do I get? / Deliverables
You get implementable Babylon.js examples across major engine subsystems so your agent can drop in loaders, effects, and optimization hooks in your scene codebase.
- Scene loader and material implementation snippets
- Subsystem modules (physics, particles, post-process, XR) wired to your scene
- Performance and camera configuration references
Recommended Skills
Journey fit
3D engine integration and scene architecture happen during product build, not during idea research or post-launch SEO. Frontend subphase covers WebGL scenes, loaders, materials, cameras, and in-scene GUI tied to the browser runtime.
How it compares
Engine pattern reference skill—not a hosted 3D SaaS or generic CSS layout guide.
Common Questions / FAQ
Who is babylonjs-engine for?
Solo developers and small teams building browser-based 3D games, viewers, or XR demos with the Babylon.js ecosystem.
When should I use babylonjs-engine?
Use it in Build while implementing scenes, loaders, physics, particles, post FX, GUI overlays, or WebXR in a Babylon.js frontend.
Is babylonjs-engine safe to install?
Review the Security Audits panel on this Prism page; generated code may load external models and scripts—audit URLs and dependencies in your project.
SKILL.md
READMESKILL.md - Babylonjs Engine
# Babylon.js Real-World Examples Comprehensive collection of production-ready Babylon.js patterns and implementations. ## Table of Contents - [Model Loading & Optimization](#model-loading--optimization) - [Advanced Materials](#advanced-materials) - [Physics Simulations](#physics-simulations) - [Particle Systems](#particle-systems) - [Post-Processing Effects](#post-processing-effects) - [GUI & User Interface](#gui--user-interface) - [WebXR & VR](#webxr--vr) - [Performance Optimization](#performance-optimization) - [Camera Systems](#camera-systems) - [Animation Patterns](#animation-patterns) --- ## Model Loading & Optimization ### GLTF Model Viewer with Progress ```javascript import { SceneLoader } from '@babylonjs/core/Loading/sceneLoader.js'; import { Texture } from '@babylonjs/core/Materials/Textures/texture.js'; import { PBRMaterial } from '@babylonjs/core/Materials/PBR/pbrMaterial.js'; import '@babylonjs/loaders/glTF'; async function createModelViewer(scene, modelUrl, fileName) { // Show loading progress let loadingScreen = document.getElementById('loading'); BABYLON.SceneLoader.OnPluginActivatedObservable.addOnce((loader) => { loader.onProgress = (event) => { const progress = event.lengthComputable ? (event.loaded / event.total) * 100 : 0; if (loadingScreen) { loadingScreen.textContent = `Loading: ${progress.toFixed(0)}%`; } }; }); // Load model const result = await SceneLoader.ImportMeshAsync( null, modelUrl, fileName, scene ); if (loadingScreen) { loadingScreen.style.display = 'none'; } // Center model const meshes = result.meshes; const boundingBox = meshes[0].getHierarchyBoundingVectors(); const center = BABYLON.Vector3.Center(boundingBox.min, boundingBox.max); meshes.forEach(mesh => { mesh.position.subtractInPlace(center); }); // Scale to fit const size = boundingBox.max.subtract(boundingBox.min); const maxDimension = Math.max(size.x, size.y, size.z); const scale = 5 / maxDimension; result.meshes[0].scaling.scaleInPlace(scale); // Setup environment const envTexture = BABYLON.CubeTexture.CreateFromPrefilteredData( 'https://assets.babylonjs.com/environments/environmentSpecular.env', scene ); scene.environmentTexture = envTexture; // Apply PBR to all meshes meshes.forEach(mesh => { if (mesh.material && mesh.material.albedoTexture) { // Already has material, enhance it mesh.material.environmentIntensity = 1.0; } else if (!mesh.material) { // No material, create default const pbr = new PBRMaterial('defaultPBR', scene); pbr.metallic = 0.0; pbr.roughness = 0.5; pbr.baseColor = new BABYLON.Color3(0.8, 0.8, 0.8); mesh.material = pbr; } }); return result; } ``` ### Optimized LOD (Level of Detail) ```javascript async function createLODMesh(scene, highResUrl, medResUrl, lowResUrl) { // Load all LOD levels const highRes = await SceneLoader.ImportMeshAsync(null, '', highResUrl, scene); const medRes = await SceneLoader.ImportMeshAsync(null, '', medResUrl, scene); const lowRes = await SceneLoader.ImportMeshAsync(null, '', lowResUrl, scene); const mainMesh = highRes.meshes[0]; const medMesh = medRes.meshes[0]; const lowMesh = lowRes.meshes[0]; // Add LOD levels mainMesh.addLODLevel(15, medMesh); // Switch at 15 units mainMesh.addLODLevel(30, lowMesh); // Switch at 30 units mainMesh.addLODLevel(50, null); // Don't render beyond 50 units return mainMesh; } ``` ### Mesh Simplification ```javascript async function simplifyMesh(mesh, quality = 0.5) { const simplified = await mesh.simplify( [ { quality: quality, distance: 10 }, { quality: quality * 0.5, distance: 25 }, { quality: quality * 0.25, distance: 50 } ], true, // parallelProcessing BABYLON.SimplificationType.QUADRATIC ); return simplified; } ``` ### Batch Model Loading ```javascript asy