npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@configura/babylon-scene-kit

v0.2.4

Published

Readme

@configura/babylon-scene-kit

A lightweight wrapper around Babylon.js that bootstraps a fully-featured 3D scene with opinionated defaults. Provides engine setup, lighting, shadows, post-processing pipelines, environment, and render-loop control through a single createSceneKit() call.

SceneKit imports the Babylon runtime feature modules needed by its built-in environment helper, IBL, and default post-process pipeline. Consumers loading their own model formats or creating additional Babylon systems still need to register the relevant loaders/runtime packages for those paths.

Requirements

  • Babylon.js 9.x — the package declares @babylonjs/core ^9.9.1 as a peer dependency.
  • @babylonjs/inspector is optional and only needed if you call showInspector().

Default Features

All features are enabled by default and can be configured or disabled via options:

Usage

import { ArcRotateCamera } from "@babylonjs/core/Cameras/arcRotateCamera";
import { Vector3 } from "@babylonjs/core/Maths/math.vector";
import { createSceneKit } from "@configura/babylon-scene-kit";

const canvas = document.querySelector("canvas")!;

const kit = await createSceneKit<ArcRotateCamera>({
  canvas,
  camera: (scene, element) => {
    const camera = new ArcRotateCamera(
      "camera",
      Math.PI / 4,
      Math.PI / 3,
      10,
      Vector3.Zero(),
      scene,
    );
    camera.attachControl(element, true);
    return camera;
  },
});

kit.scheduleRender();

Render Modes

  • "on-demand" (default) — nothing renders unless you call kit.scheduleRender(). Ideal for static product views that only update on interaction.
  • "continuous" — renders every frame via engine.runRenderLoop. Switch at runtime with kit.setRenderMode("continuous").

Shadow Policy

Control per-mesh shadow behavior without touching the shadow generators directly:

import { setShadowPolicy } from "@configura/babylon-scene-kit";

// Disable shadows on a specific mesh
setShadowPolicy(mesh, { cast: false, receive: false });

Inspector

await kit.showInspector(); // dynamically imports @babylonjs/inspector
kit.hideInspector();

Requires @babylonjs/inspector installed as a dependency in the consuming app.

Cleanup

kit.destroy(); // disposes scene, engine, lights, shadows, event listeners

Ground modes

environment.groundMode selects visible (default), shadowOnly, or none and controls ground creation. environment.helperOptions accepts BabylonJS options except createGround. Visible mode respects enableGroundShadow and enableGroundMirror; shadow-only mode enables shadows and disables mirrors, with opacity 0.6 by default (groundOpacity overrides it). None mode creates no ground. environment.enabled: false disables the ground and skybox. mainColor takes precedence over groundColor and skyboxColor.

After geometry changes, call kit.environmentHelper?.updateOptions({}) and schedule a render. This refreshes the shadow-only plane using Babylon's ground calculation. Directional projections extend the far depth to cover shadows on the environment ground, whether visible or shadow-only. This fitting does not depend on the filter; it prevents receiver-depth clipping with PCF and PCSS. A small tolerance prevents depth-boundary rounding errors, and Babylon retains its normal X/Y fitting. Custom projections and fixed bounds retain caller control.