encodeScene abstract method

void encodeScene({
  1. required NodeFrame frame,
  2. required PassEncoder encoder,
  3. required Scene scene,
  4. required Matrix4 viewProjection,
  5. required Vector3 cameraPosition,
  6. int casterIndex = -1,
})

Draws every visible mesh of scene into an open pass, as the renderer draws the world.

For a plugin whose content is ordinary geometry in an unordinary place — a first person weapon, a portal's far side — so it inherits materials, skinning and lighting instead of growing a second copy of them.

The shadows a draw samples come from SceneShadows.from over frame: only what the calling node declared a read of, so a node that never claimed the atlas gets nothing to sample rather than a renderer field.

Takes the NodeFrame rather than the settings, the pass state and the shadows separately. Those three came off the frame at every call site, and the shadows had to be assembled there too — three lines a caller could get wrong quietly. Getting them wrong looked like a weapon lit as though the room were not, and there was no way for this method to tell.

viewProjection stays a parameter because it is the one thing genuinely the caller's: the view model draws the same scene through a different camera, which is what makes it a separate pass. Build it with toDepthRange, or it is right on one backend and wrong on the other.

Implementation

void encodeScene({
  required NodeFrame frame,
  required PassEncoder encoder,
  required Scene scene,
  required vm.Matrix4 viewProjection,
  required vm.Vector3 cameraPosition,
  int casterIndex = -1,
});