minerender 2.1.0-alpha.47 → 2.1.0-alpha.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1650,6 +1650,8 @@ interface CameraOptions {
1650
1650
  interface RenderOptions {
1651
1651
  /** Maximum draw rate (60 by default); zero or a negative value disables the limit. */
1652
1652
  fpsLimit: number;
1653
+ /** Drawing-buffer pixels per CSS pixel (default 1); also scales toImage() output. */
1654
+ pixelRatio?: number;
1653
1655
  stats: boolean;
1654
1656
  antialias: boolean;
1655
1657
  shade: boolean;
@@ -1650,6 +1650,8 @@ interface CameraOptions {
1650
1650
  interface RenderOptions {
1651
1651
  /** Maximum draw rate (60 by default); zero or a negative value disables the limit. */
1652
1652
  fpsLimit: number;
1653
+ /** Drawing-buffer pixels per CSS pixel (default 1); also scales toImage() output. */
1654
+ pixelRatio?: number;
1653
1655
  stats: boolean;
1654
1656
  antialias: boolean;
1655
1657
  shade: boolean;
@@ -9628,6 +9628,10 @@ var _Renderer = class _Renderer {
9628
9628
  this._dirty = true;
9629
9629
  };
9630
9630
  this.options = (0, import_ts_deepmerge9.default)({}, _Renderer.DEFAULT_OPTIONS, options ?? {});
9631
+ const pixelRatio = this.options.render.pixelRatio ?? 1;
9632
+ if (!Number.isFinite(pixelRatio) || pixelRatio <= 0) {
9633
+ throw new RangeError("render.pixelRatio must be a finite positive number");
9634
+ }
9631
9635
  this._animationLoop = this.animate.bind(this);
9632
9636
  this._frameInterval = this.options.render.fpsLimit > 0 ? 1e3 / this.options.render.fpsLimit : void 0;
9633
9637
  this._scene = this.createScene();
@@ -9677,6 +9681,7 @@ var _Renderer = class _Renderer {
9677
9681
  renderer.shadowMap.enabled = true;
9678
9682
  renderer.shadowMap.type = import_three26.PCFSoftShadowMap;
9679
9683
  renderer.outputColorSpace = import_three26.SRGBColorSpace;
9684
+ renderer.setPixelRatio(this.options.render.pixelRatio ?? 1);
9680
9685
  renderer.setSize(this.viewWidth, this.viewHeight);
9681
9686
  return renderer;
9682
9687
  }
@@ -9932,6 +9937,7 @@ _Renderer.DEFAULT_OPTIONS = (0, import_ts_deepmerge9.default)({}, {
9932
9937
  },
9933
9938
  render: {
9934
9939
  fpsLimit: 60,
9940
+ pixelRatio: 1,
9935
9941
  stats: false,
9936
9942
  antialias: true,
9937
9943
  shade: true,