@twinlight/three
v0.0.6
Published
three.js integration for TwinLight: CameraSync (OrbitControls -> control channel) and ThreeOverlay interaction surface.
Readme
@twinlight/three
three.js integration helpers for TwinLight. TwinLight is a remote native renderer, not a WebGL implementation, so this package mirrors three.js scene state into TwinLight while local three.js remains useful for controls, overlays, gizmos, and migration adapters.
60-second scene bridge
import { SceneBridge } from "@twinlight/three";
const bridge = new SceneBridge((message) => {
client.send(message);
});
bridge
.bindScene(scene, { camera, controls })
.start();Limited renderer-like adapter
import { TwinLightRenderer } from "@twinlight/three";
const renderer = new TwinLightRenderer({ client });
renderer.setSize(1280, 720);
renderer.render(scene, camera);TwinLightRenderer.render(scene, camera) mirrors scene and camera state. Final pixels arrive asynchronously from the native renderer through the selected TwinLight viewport transport.
Professional integration notes
SceneBridgeis the public facade name for the existing diff engine.Viewportcomposes the remote surface with a local transparent three.js overlay.- Pure mappers such as
cameraMessage,transformMessage, andmaterialMessageremain stable named exports for tests and custom integrations.
Not supported
TwinLightRendereris not aTHREE.WebGLRenderersubclass.- No WebGL render targets, shader compilation, postprocessing composer parity, or immediate readback.
- No automatic translation of arbitrary
ShaderMaterialcode.
