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.
@@ -889,7 +889,12 @@ var init_Materials = __esm({
889
889
  const vertShader = `
890
890
  uniform bool SHADE;
891
891
 
892
+ // Keep MSAA edge pixels from sampling outside the face's atlas region.
893
+ #if __VERSION__ >= 300
894
+ centroid out vec2 vUv;
895
+ #else
892
896
  varying vec2 vUv;
897
+ #endif
893
898
  varying vec3 vTint;
894
899
  varying float light;
895
900
  varying float lift;
@@ -946,7 +951,11 @@ var init_Materials = __esm({
946
951
  uniform bool EMISSIVE;
947
952
  uniform float BRIGHTNESS;
948
953
 
954
+ #if __VERSION__ >= 300
955
+ centroid in vec2 vUv;
956
+ #else
949
957
  varying vec2 vUv;
958
+ #endif
950
959
  varying vec3 vTint;
951
960
  varying float light;
952
961
  varying float lift;
@@ -9518,6 +9527,10 @@ var Renderer = class _Renderer {
9518
9527
  this._dirty = true;
9519
9528
  };
9520
9529
  this.options = (0, import_ts_deepmerge9.default)({}, _Renderer.DEFAULT_OPTIONS, options ?? {});
9530
+ const pixelRatio = this.options.render.pixelRatio ?? 1;
9531
+ if (!Number.isFinite(pixelRatio) || pixelRatio <= 0) {
9532
+ throw new RangeError("render.pixelRatio must be a finite positive number");
9533
+ }
9521
9534
  this._animationLoop = this.animate.bind(this);
9522
9535
  this._frameInterval = this.options.render.fpsLimit > 0 ? 1e3 / this.options.render.fpsLimit : void 0;
9523
9536
  this._scene = this.createScene();
@@ -9552,6 +9565,7 @@ var Renderer = class _Renderer {
9552
9565
  },
9553
9566
  render: {
9554
9567
  fpsLimit: 60,
9568
+ pixelRatio: 1,
9555
9569
  stats: false,
9556
9570
  antialias: true,
9557
9571
  shade: true,
@@ -9606,6 +9620,7 @@ var Renderer = class _Renderer {
9606
9620
  renderer.shadowMap.enabled = true;
9607
9621
  renderer.shadowMap.type = PCFSoftShadowMap;
9608
9622
  renderer.outputColorSpace = SRGBColorSpace4;
9623
+ renderer.setPixelRatio(this.options.render.pixelRatio ?? 1);
9609
9624
  renderer.setSize(this.viewWidth, this.viewHeight);
9610
9625
  return renderer;
9611
9626
  }