minerender 2.1.0-alpha.4 → 2.1.0-alpha.5

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.
package/dist/bundle.js CHANGED
@@ -37267,8 +37267,8 @@ var MineRender = (() => {
37267
37267
  } else {
37268
37268
  if (warned === false) {
37269
37269
  warned = true;
37270
- var warn2 = process$1.emitWarning ? process$1.emitWarning : console.warn.bind(console);
37271
- warn2("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.", "DeprecationWarning", "DEP0094");
37270
+ var warn = process$1.emitWarning ? process$1.emitWarning : console.warn.bind(console);
37271
+ warn("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.", "DeprecationWarning", "DEP0094");
37272
37272
  }
37273
37273
  if (argsLen === 2) operator = "!=";
37274
37274
  }
@@ -68378,6 +68378,7 @@ return ${compiler2.callType("value", tagType)}
68378
68378
  }
68379
68379
  static loadInBackground(src, format2 = RGBAFormat, rotation = 0) {
68380
68380
  const texture = this.createTexture();
68381
+ texture.colorSpace = SRGBColorSpace;
68381
68382
  const image = ImageLoader.loadElement(src);
68382
68383
  image.onload = function() {
68383
68384
  texture.needsUpdate = true;
@@ -68389,6 +68390,7 @@ return ${compiler2.callType("value", tagType)}
68389
68390
  }
68390
68391
  static load(src, format2 = RGBAFormat, rotation = 0) {
68391
68392
  const texture = new Texture();
68393
+ texture.colorSpace = SRGBColorSpace;
68392
68394
  ImageLoader.getData(src).then((image) => {
68393
68395
  texture.needsUpdate = true;
68394
68396
  texture.image = image;
@@ -68414,7 +68416,9 @@ return ${compiler2.callType("value", tagType)}
68414
68416
  return new Texture();
68415
68417
  }
68416
68418
  static createCanvasTexture(canvas) {
68417
- return this.initTextureProps(new CanvasTexture(canvas));
68419
+ const texture = new CanvasTexture(canvas);
68420
+ texture.colorSpace = SRGBColorSpace;
68421
+ return this.initTextureProps(texture);
68418
68422
  }
68419
68423
  static getImage(key) {
68420
68424
  const keyStr = serializeTextureKey(key);
@@ -68531,6 +68535,9 @@ return ${compiler2.callType("value", tagType)}
68531
68535
  gl_FragColor = vec4(lift + color.rgb * light2, 1.0);
68532
68536
 
68533
68537
  }
68538
+
68539
+ #include <tonemapping_fragment>
68540
+ #include <colorspace_fragment>
68534
68541
  }
68535
68542
  `;
68536
68543
  try {
@@ -85247,13 +85254,13 @@ uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuf
85247
85254
  renderer.setClearColor(0, 0);
85248
85255
  renderer.shadowMap.enabled = true;
85249
85256
  renderer.shadowMap.type = PCFSoftShadowMap;
85250
- renderer.outputEncoding = LinearEncoding;
85257
+ renderer.outputColorSpace = SRGBColorSpace;
85251
85258
  renderer.setSize(this.viewWidth, this.viewHeight);
85252
85259
  return renderer;
85253
85260
  }
85254
85261
  createComposer() {
85262
+ if (!this.options.composer.enabled) return void 0;
85255
85263
  const composer = new EffectComposer(this.renderer);
85256
- if (!this.options.composer.enabled) return composer;
85257
85264
  composer.setSize(this.viewWidth, this.viewHeight);
85258
85265
  composer.addPass(new RenderPass(this.scene, this.camera));
85259
85266
  return composer;
@@ -85362,7 +85369,7 @@ uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuf
85362
85369
  this.camera.updateProjectionMatrix();
85363
85370
  }
85364
85371
  this.renderer.setSize(width, height);
85365
- this.composer.setSize(width, height);
85372
+ this.composer?.setSize(width, height);
85366
85373
  this._dirty = true;
85367
85374
  }
85368
85375
  //<editor-fold desc="RENDER">
@@ -85421,7 +85428,7 @@ uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuf
85421
85428
  }
85422
85429
  }
85423
85430
  this._debugHelpers.length = 0;
85424
- this.composer.dispose();
85431
+ this.composer?.dispose();
85425
85432
  this.renderer.dispose();
85426
85433
  this.renderer.forceContextLoss();
85427
85434
  }
@@ -85441,7 +85448,7 @@ uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuf
85441
85448
  if (this._stats) {
85442
85449
  this._stats.begin();
85443
85450
  }
85444
- if (this.options.composer.enabled) {
85451
+ if (this.options.composer.enabled && this.composer) {
85445
85452
  this.composer.render();
85446
85453
  } else {
85447
85454
  this.renderer.render(this.scene, this.camera);