Skip to content
프로젝트

소개

Dynamic global Illumination addon for three.js

디자인 및 미디어

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
기록 수집 중
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Speedball GI

Real-time BVH-traced dynamic diffuse global illumination for three.js WebGPU and its WebGL2 fallback. Speedball keeps solving during motion; structural rebuilds wait for a safe idle window.

Launch the Sponza demo

Install

npm install speedball-gi three three-mesh-bvh

Speedball supports Three r185 through r187:

{
  "three": ">=0.185.0 <0.188.0",
  "three-mesh-bvh": ">=0.9.11 <0.10.0"
}

Quick start

Install GI before the first render or renderer.setAnimationLoop() call.

import { installSpeedballGI } from 'speedball-gi';

const gi = installSpeedballGI({
  renderer,
  scene,
  camera,
  intensity: 10,
  divisions: 16,
  rays: 64,
  cascades: 1,
  jitterMode: 'gated',
  onError: console.error,
});

renderer.setAnimationLoop(async () => {
  gi.update();
  await renderer.renderAsync(scene, camera);
});

// Dispose GI before renderer and scene resources.
function dispose() {
  gi.dispose();
  renderer.dispose();
}

Continuous solving is enabled by default. gated holds a stable sampling basis for low-latency, mostly flicker-free lighting. montecarlo refreshes the basis every solve for maximum discovery and expects more hysteresis.

GI selects the initialized renderer backend automatically. To force WebGL2, use new THREE.WebGPURenderer({ forceWebGL: true }); the GI API stays the same. WebGL2 requires EXT_color_buffer_float. The classic THREE.WebGLRenderer is not supported. Try the demo with ?renderer=webgl.

Dynamic scenes

The default integration detects scene changes automatically. Engines and editors that already know what changed can disable those scans and send exact events:

const gi = installSpeedballGI({
  renderer,
  scene,
  camera,
  autoDetectChanges: false,
});

gi.markTransformsDirty(mesh);
gi.markDeformsDirty(streamedMesh);
gi.markMaterialValuesDirty(material);
gi.forceLightingRefresh();
gi.markTopologyDirty();

Use excludeFromGI(object) for sky domes, helpers, and gizmos. The installer supports one active probe field per module instance.

Documentation

License

MIT — see LICENSE.

관련 프로젝트 살펴보기

불러오는 중…