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.
@@ -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;
@@ -843,7 +843,12 @@ var init_Materials = __esm({
843
843
  const vertShader = `
844
844
  uniform bool SHADE;
845
845
 
846
+ // Keep MSAA edge pixels from sampling outside the face's atlas region.
847
+ #if __VERSION__ >= 300
848
+ centroid out vec2 vUv;
849
+ #else
846
850
  varying vec2 vUv;
851
+ #endif
847
852
  varying vec3 vTint;
848
853
  varying float light;
849
854
  varying float lift;
@@ -900,7 +905,11 @@ var init_Materials = __esm({
900
905
  uniform bool EMISSIVE;
901
906
  uniform float BRIGHTNESS;
902
907
 
908
+ #if __VERSION__ >= 300
909
+ centroid in vec2 vUv;
910
+ #else
903
911
  varying vec2 vUv;
912
+ #endif
904
913
  varying vec3 vTint;
905
914
  varying float light;
906
915
  varying float lift;
@@ -9619,6 +9628,10 @@ var _Renderer = class _Renderer {
9619
9628
  this._dirty = true;
9620
9629
  };
9621
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
+ }
9622
9635
  this._animationLoop = this.animate.bind(this);
9623
9636
  this._frameInterval = this.options.render.fpsLimit > 0 ? 1e3 / this.options.render.fpsLimit : void 0;
9624
9637
  this._scene = this.createScene();
@@ -9668,6 +9681,7 @@ var _Renderer = class _Renderer {
9668
9681
  renderer.shadowMap.enabled = true;
9669
9682
  renderer.shadowMap.type = import_three26.PCFSoftShadowMap;
9670
9683
  renderer.outputColorSpace = import_three26.SRGBColorSpace;
9684
+ renderer.setPixelRatio(this.options.render.pixelRatio ?? 1);
9671
9685
  renderer.setSize(this.viewWidth, this.viewHeight);
9672
9686
  return renderer;
9673
9687
  }
@@ -9923,6 +9937,7 @@ _Renderer.DEFAULT_OPTIONS = (0, import_ts_deepmerge9.default)({}, {
9923
9937
  },
9924
9938
  render: {
9925
9939
  fpsLimit: 60,
9940
+ pixelRatio: 1,
9926
9941
  stats: false,
9927
9942
  antialias: true,
9928
9943
  shade: true,