WebGPURenderer constructor

WebGPURenderer([
  1. Map? parameters
])

Implementation

WebGPURenderer([Map? parameters]) {
  parameters ??= {};

  // public

  // this.domElement = ( parameters.canvas != undefined ) ? parameters.canvas : this._createCanvasElement();

  this.autoClear = true;
  this.autoClearColor = true;
  this.autoClearDepth = true;
  this.autoClearStencil = true;

  this.outputEncoding = LinearEncoding;

  this.sortObjects = true;

  // internals

  this._parameters = {};
  this._parameters.addAll(parameters);

  this._pixelRatio = 1;
  // this._width = this.domElement.width;
  // this._height = this.domElement.height;
  this._width = this._parameters["width"];
  this._height = this._parameters["height"];

  this._viewport = null;
  this._scissor = null;

  this._adapter = null;
  this._device = null;
  this._context = null;
  this._colorBuffer = null;
  this._depthBuffer = null;

  this._info = null;
  this._properties = null;
  // this._attributes = null;
  this._geometries = null;
  this._nodes = null;
  // this._bindings = null;
  this._objects = null;
  // this._renderPipelines = null;
  this._computePipelines = null;
  this._renderLists = null;
  this._textures = null;
  this._background = null;

  // this._renderPassDescriptor = null;

  this._currentRenderList = null;
  this._opaqueSort = null;
  this._transparentSort = null;

  this._clearAlpha = 1;
  this._clearColor = new Color(0x000000);
  this._clearDepth = 1;
  this._clearStencil = 0;

  this._renderTarget = null;

  // some parameters require default values other than "undefined"

  this._parameters["antialias"] = (parameters["antialias"] == true);

  if (this._parameters["antialias"] == true) {
    this._parameters["sampleCount"] = parameters["sampleCount"] ?? 4;
  } else {
    this._parameters["sampleCount"] = 1;
  }

  this._parameters["requiredFeatures"] =
      (parameters["requiredFeatures"] == undefined)
          ? []
          : parameters["requiredFeatures"];
  this._parameters["requiredLimits"] =
      (parameters["requiredLimits"] == undefined)
          ? {}
          : parameters["requiredLimits"];
}