effect-motion
API ReferencethreeNamespacesRendererFunctions

compile

function compile(

Function: compile()

function compile(
   self,
   scene,
camera): Effect<void, ThreeException>;

Defined in: packages/three/src/Renderer.ts:230

Compile the shader pipelines a scene needs, ahead of drawing it.

Parameters

ParameterType
selfRenderer
sceneScene
cameraCamera

Returns

Effect<void, ThreeException>

Remarks

WebGPU compiles a pipeline the first time it is used, which lands as a visible hitch (roughly 40–80ms) on the first frame. Calling this after the scene is populated but before anything is shown moves that cost into startup.

On this page