Babylon.js

BabylonJSApache-2.0活跃维护

基于 TypeScript 的 Web 3D 游戏与渲染引擎,封装 WebGL/WebGPU/WebXR,让开发者直接在浏览器里搭建高性能 3D 场景和游戏。

Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.

9.35.0发布于 2026-11-06 19:46 UTC26,312star +7 / 7 天3,721fork同步于 2026-11-10 05:21 UTC

怎么上手

从 README 代码块原样提取,可能是其中一种安装方式
npm install babylonjs --save
硬件要求

README 没有说明硬件要求。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

这个项目的说明还在生成中,先参考下面「最近发版」和 README。

最近发版

5 个版本9.35.0
  1. 9.35.0最新正式版2026-11-06 · 2026-11-06 19:46 UTC

    Core

    • Fix WebGL effect samplers being dropped when compiled during context loss - by serdarucel (#19033)
    • Release GPU resources in ProceduralTexture, HDRIrradianceFiltering and DynamicTexture dispose - [Bug Fix] by bkaradzic-microsoft (#19121)
    • NativeEngine: Honor MRT attachment mip generation intent - [Bug Fix] by bkaradzic-microsoft (#19120)
    • Sample IBL CDF radiance at the icdf bin center - [Bug Fix] by bkaradzic-microsoft (#19114)
    • Update HTML-in-Canvas typings to the latest WICG explainer API - by RaananW (#19116)
    • WebGPU/Effect: don't rebuild effects whose shader code is still loading after a context loss - by Deadlywolf712 (#19115)

    Inspector

    • Add audio engine inspection to Inspector Lite - [New Feature] by ryantrem (#19119)
  2. 9.34.02026-11-05 · 2026-11-05 08:54 UTC
    查看更新说明

    Core

    • WebGPU: find cached texture views without building a key string - by enriqxxx (#19091)

    Inspector

  3. 9.33.32026-11-05 · 2026-11-05 01:48 UTC
    查看更新说明

    Core

    • Shader preprocessor: #if !X is #if !defined(X) - by enriqxxx (#19098)
    • Flow Graph Editor: add sound reactions and diagnostics - [New Feature] by RaananW (#19102)
    • WebGPU: invalidate cached draws when vertex buffers change - [Bug Fix] by Popov72 (#19051)
    • WebGPU: createRenderPipelineAsync prewarms the front face the draws of the mesh use - by enriqxxx (#19108)
    • Add bent-normal reflection occlusion - by sebavan (#19069)
    • WebGPU: createRenderPipelineAsync can prewarm the pipeline of draws that bind depth or unfilterable float textures - by enriqxxx (#19107)
    • WebGPU: maxFramesInFlight, a limit on the frames the GPU has in flight (opt-in) - by enriqxxx (#19093)
    • Skip zero-count Buffer.updateDirectly uploads - by RizgarOzan (#19100)
    • Copy assigned by-value parameters when inlining shader functions - [Bug Fix] by bkaradzic-microsoft (#19077)
    • Fix DirectionalLight fixed-frustum shadows under reverse depth - by christabone (#19056)
    • Fix HDR texture support in volumetric light scattering - by BarthPaleologue (#19036)
    • Fix duplicate depth texture entry in the WebGPU MRT texture cache - by Bboissen (#19045)
    • Preserve direct draws without native command batching - by Popov72 (#19076)

    Inspector

    Loaders

    • Fix FBX animation refinement growing across bones - [Bug Fix] by Popov72 (#19050)
    • Load glTF Gaussian splats compressed with KHR_gaussian_splatting_compression_spz - by CedricGuillemet (#19106)
  4. 9.33.22026-11-02 · 2026-11-02 20:06 UTC
    查看更新说明

    Core

    • WebGPU: convert half-float readbacks with Float16Array where it exists - by enriqxxx (#19072)
    • Flow Graph: graph-declared sound assets and mesh intersection event - [New Feature] by RaananW (#19101)
    • DirectionalLight: document that shadowOrthoScale widens extents set by hand too - by enriqxxx (#19092)
    • Stop Gaussian splatting and vertex-pulling materials from growing shared attribute and uniform lists - [Bug Fix] by CedricGuillemet (#19080)
    • Clamp native anisotropic filtering level to caps.maxAnisotropy - by bkaradzic-microsoft (#19078)
    • Fix instanced bounding boxes with high precision matrices - by bkaradzic-microsoft (#19081)

    Sandbox

    • Show USD support in the Sandbox drag-and-drop prompt - by Jeggery (#19088)
  5. 9.33.12026-10-30 · 2026-10-30 23:57 UTC
    查看更新说明

    Core

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Babylon.js

    Getting started? Play directly with the Babylon.js API using our playground. It also contains a lot of samples to learn how to use it.

    npm version Build Status Average time to resolve an issue Percentage of issues still open Build size Twitter Discourse users

    Any questions? Here is our official forum.

    CDN

    ⚠️ WARNING: The CDN should not be used in production environments. The purpose of our CDN is to serve Babylon packages to users learning how to use the platform or running small experiments. Once you've built an application and are ready to share it with the world at large, you should serve all packages from your own CDN.

    For the preview release, use the following URLs:

    A list of additional references can be found here.

    npm

    BabylonJS and its modules are published on npm with full typing support. To install, use:

    npm install babylonjs --save
    

    alternatively, you can now rely on our ES6 packages. Using the ES6 version will allow tree shaking among other bundling benefits.

    This will allow you to import BabylonJS entirely using:

    import * as BABYLON from 'babylonjs';
    

    or individual classes using:

    import { Scene, Engine } from 'babylonjs';
    

    If using TypeScript, don't forget to add 'babylonjs' to 'types' in tsconfig.json:

        ...
        "types": [
            "babylonjs",
            "anotherAwesomeDependency"
        ],
        ...
    

    To add a module, install the respective package. A list of extra packages and their installation instructions can be found on the babylonjs user on npm.

    Usage

    See Getting Started:

    // Get the canvas DOM element
    var canvas = document.getElementById('renderCanvas');
    // Load the 3D engine
    var engine = new BABYLON.Engine(canvas, true, {preserveDrawingBuffer: true, stencil: true});
    // CreateScene function that creates and return the scene
    var createScene = function(){
        // Create a basic BJS Scene object
        var scene = new BABYLON.Scene(engine);
        // Create a FreeCamera, and set its position to {x: 0, y: 5, z: -10}
        var camera = new BABYLON.FreeCamera('camera1', new BABYLON.Vector3(0, 5, -10), scene);
        // Target the camera to scene origin
        camera.setTarget(BABYLON.Vector3.Zero());
        // Attach the camera to the canvas
        camera.attachControl(canvas, false);
        // Create a basic light, aiming 0, 1, 0 - meaning, to the sky
        var light = new BABYLON.HemisphericLight('light1', new BABYLON.Vector3(0, 1, 0), scene);
        // Create a built-in "sphere" shape using the SphereBuilder
        var sphere = BABYLON.MeshBuilder.CreateSphere('sphere1', {segments: 16, diameter: 2, sideOrientation: BABYLON.Mesh.FRONTSIDE}, scene);
        // Move the sphere upward 1/2 of its height
        sphere.position.y = 1;
        // Create a built-in "ground" shape;
        var ground = BABYLON.MeshBuilder.CreateGround("ground1", { width: 6, height: 6, subdivisions: 2, updatable: false }, scene);
        // Return the created scene
        return scene;
    }
    // call the createScene function
    var scene = createScene();
    // run the render loop
    engine.runRenderLoop(function(){
        scene.render();
    });
    // the canvas/window resize event handler
    window.addEventListener('resize', function(){
        engine.resize();
    });
    

    Contributing

    Building and developing this repository requires Node.js 22.22.2 or newer within the Node 22 line, or Node.js 24.16.0 or newer within the Node 24 line, and npm 11.18.0 or newer. These are development-tool requirements; they do not change the runtime requirements of the published Babylon.js libraries.

    If you want to contribute, please read our contribution guidelines first.

    Documentation

    Useful links

    • Official web site: www.babylonjs.com
    • Online playground to learn by experimentating
    • Online sandbox where you can test your .babylon and glTF scenes with a simple drag'n'drop
    • Online shader creation tool where you can learn how to create GLSL shaders
    • 3DS Max exporter can be used to generate a .babylon file from 3DS Max
    • Maya exporter can be used to generate a .babylon file from Maya
    • Blender exporter can be used to generate a .babylon file from Blender 3d
    • Unity 5 (deprecated) exporter can be used to export your geometries from Unity 5 scene editor(animations are supported)
    • glTF Tools by KhronosGroup

    Features

    To get a complete list of supported features, please visit our website.