minerender 2.1.0-alpha.46 → 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.
@@ -1651,6 +1651,8 @@ interface CameraOptions {
1651
1651
  interface RenderOptions {
1652
1652
  /** Maximum draw rate (60 by default); zero or a negative value disables the limit. */
1653
1653
  fpsLimit: number;
1654
+ /** Drawing-buffer pixels per CSS pixel (default 1); also scales toImage() output. */
1655
+ pixelRatio?: number;
1654
1656
  stats: boolean;
1655
1657
  antialias: boolean;
1656
1658
  shade: boolean;
@@ -1651,6 +1651,8 @@ interface CameraOptions {
1651
1651
  interface RenderOptions {
1652
1652
  /** Maximum draw rate (60 by default); zero or a negative value disables the limit. */
1653
1653
  fpsLimit: number;
1654
+ /** Drawing-buffer pixels per CSS pixel (default 1); also scales toImage() output. */
1655
+ pixelRatio?: number;
1654
1656
  stats: boolean;
1655
1657
  antialias: boolean;
1656
1658
  shade: boolean;
@@ -890,7 +890,12 @@ var init_Materials = __esm({
890
890
  const vertShader = `
891
891
  uniform bool SHADE;
892
892
 
893
+ // Keep MSAA edge pixels from sampling outside the face's atlas region.
894
+ #if __VERSION__ >= 300
895
+ centroid out vec2 vUv;
896
+ #else
893
897
  varying vec2 vUv;
898
+ #endif
894
899
  varying vec3 vTint;
895
900
  varying float light;
896
901
  varying float lift;
@@ -947,7 +952,11 @@ var init_Materials = __esm({
947
952
  uniform bool EMISSIVE;
948
953
  uniform float BRIGHTNESS;
949
954
 
955
+ #if __VERSION__ >= 300
956
+ centroid in vec2 vUv;
957
+ #else
950
958
  varying vec2 vUv;
959
+ #endif
951
960
  varying vec3 vTint;
952
961
  varying float light;
953
962
  varying float lift;
@@ -9667,6 +9676,10 @@ var Renderer = class _Renderer {
9667
9676
  this._dirty = true;
9668
9677
  };
9669
9678
  this.options = (0, import_ts_deepmerge9.default)({}, _Renderer.DEFAULT_OPTIONS, options ?? {});
9679
+ const pixelRatio = this.options.render.pixelRatio ?? 1;
9680
+ if (!Number.isFinite(pixelRatio) || pixelRatio <= 0) {
9681
+ throw new RangeError("render.pixelRatio must be a finite positive number");
9682
+ }
9670
9683
  this._animationLoop = this.animate.bind(this);
9671
9684
  this._frameInterval = this.options.render.fpsLimit > 0 ? 1e3 / this.options.render.fpsLimit : void 0;
9672
9685
  this._scene = this.createScene();
@@ -9701,6 +9714,7 @@ var Renderer = class _Renderer {
9701
9714
  },
9702
9715
  render: {
9703
9716
  fpsLimit: 60,
9717
+ pixelRatio: 1,
9704
9718
  stats: false,
9705
9719
  antialias: true,
9706
9720
  shade: true,
@@ -9755,6 +9769,7 @@ var Renderer = class _Renderer {
9755
9769
  renderer.shadowMap.enabled = true;
9756
9770
  renderer.shadowMap.type = import_three26.PCFSoftShadowMap;
9757
9771
  renderer.outputColorSpace = import_three26.SRGBColorSpace;
9772
+ renderer.setPixelRatio(this.options.render.pixelRatio ?? 1);
9758
9773
  renderer.setSize(this.viewWidth, this.viewHeight);
9759
9774
  return renderer;
9760
9775
  }