renderScene method

void renderScene(
  1. WebGLRenderList currentRenderList,
  2. Object3D scene,
  3. Camera camera, [
  4. Vector4? viewport,
])

Implementation

void renderScene(WebGLRenderList currentRenderList, Object3D scene, Camera camera, [Vector4? viewport]) {
  List<RenderItem> opaqueObjects = currentRenderList.opaque;
  final transmissiveObjects = currentRenderList.transmissive;
  final transparentObjects = currentRenderList.transparent;

  currentRenderState!.setupLightsView(camera);

  if (transmissiveObjects.isNotEmpty) {
    renderTransmissionPass(opaqueObjects, scene, camera);
  }

  if (viewport != null){
    _currentViewport.setFrom(viewport);
    state.viewport(_currentViewport);
  }

  if (opaqueObjects.isNotEmpty) renderObjects(opaqueObjects, scene, camera);
  if (transmissiveObjects.isNotEmpty) renderObjects(transmissiveObjects, scene, camera);
  if (transparentObjects.isNotEmpty)renderObjects(transparentObjects, scene, camera);

  // Ensure depth buffer writing is enabled so it can be cleared on next render

  state.buffers["depth"].setTest(true);
  state.buffers["depth"].setMask(true);
  state.buffers["color"].setMask(true);

  state.setPolygonOffset(false);
}