@awayjs/scene 0.13.303 → 0.13.305
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/bundle/awayjs-scene.umd.js +2 -2
- package/bundle/awayjs-scene.umd.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/image/SceneImage2D.d.ts.map +1 -1
- package/dist/lib/image/SceneImage2D.js +9 -1
- package/index.ts +1 -1
- package/lib/image/SceneImage2D.ts +11 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
console.debug('AwayJS - Scene - 0.13.
|
|
1
|
+
console.debug('AwayJS - Scene - 0.13.305');
|
|
2
2
|
export { Timeline } from './lib/base/Timeline';
|
|
3
3
|
export { ControllerBase } from './lib/controllers/ControllerBase';
|
|
4
4
|
export { FirstPersonController } from './lib/controllers/FirstPersonController';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SceneImage2D.d.ts","sourceRoot":"","sources":["../../../lib/image/SceneImage2D.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAIzD,OAAO,EACN,cAAc,EACd,MAAM,EACN,SAAS,EACT,KAAK,
|
|
1
|
+
{"version":3,"file":"SceneImage2D.d.ts","sourceRoot":"","sources":["../../../lib/image/SceneImage2D.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAIzD,OAAO,EACN,cAAc,EACd,MAAM,EACN,SAAS,EACT,KAAK,EAML,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,KAAK,EACb,aAAa,EAGb,OAAO,EACP,MAAM,eAAe,CAAC;AAOvB;;GAEG;AACH,qBAAa,YAAa,SAAQ,aAAa;IAC9C,OAAc,SAAS,EAAE,MAAM,CAA0B;WAE3C,QAAQ,CACrB,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,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,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,OAAO;IAC3I,IAAI,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,OAAO;IAmBlJ,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAiBrC,OAAO,CAAC,aAAa;IA8ErB,OAAO,CAAC,cAAc;IAsJf,KAAK;IAEL,KAAK,IAAI,YAAY;CAc5B"}
|
|
@@ -5,7 +5,7 @@ import { DisplayObjectContainer } from '../display/DisplayObjectContainer';
|
|
|
5
5
|
import { DisplayObject } from '../display/DisplayObject';
|
|
6
6
|
import { Billboard } from '../display/Billboard';
|
|
7
7
|
import { Settings } from '../Settings';
|
|
8
|
-
import { Rectangle, Point, PerspectiveProjection, CoordinateSystem, Vector3D, Transform, } from '@awayjs/core';
|
|
8
|
+
import { Rectangle, Point, PerspectiveProjection, CoordinateSystem, Vector3D, Transform, ColorUtils, } from '@awayjs/core';
|
|
9
9
|
import { Stage, BitmapImage2D, _Stage_BitmapImage2D, BlendMode } from '@awayjs/stage';
|
|
10
10
|
import { DefaultRenderer, RenderGroup, Style } from '@awayjs/renderer';
|
|
11
11
|
// empty matrix for transform reset
|
|
@@ -324,6 +324,8 @@ var SceneImage2D = /** @class */ (function (_super) {
|
|
|
324
324
|
this._lastUsedFill = null;
|
|
325
325
|
this.dropAllReferences();
|
|
326
326
|
this.unmarkToUnload();
|
|
327
|
+
if (this._initalFillColor !== null)
|
|
328
|
+
this.fillRect(this._rect, this._initalFillColor);
|
|
327
329
|
this._stage.threshold(source, this, sourceRect, destPoint, operation, threshold, color, mask, copySource);
|
|
328
330
|
this._imageDataDirty = true;
|
|
329
331
|
};
|
|
@@ -511,6 +513,12 @@ var SceneImage2D = /** @class */ (function (_super) {
|
|
|
511
513
|
// because target image is stupid filled - it not require merging
|
|
512
514
|
// BUT when blend is required - we shpuld skip color clear and use empty TMP
|
|
513
515
|
if (!useBlend && this._lastUsedFill !== null) {
|
|
516
|
+
if (this._transparent) {
|
|
517
|
+
//premulitply fill color!
|
|
518
|
+
var _a = ColorUtils.float32ColorToARGB(this._lastUsedFill), a = _a[0], r = _a[1], g = _a[2], b = _a[3];
|
|
519
|
+
a /= 0xFF;
|
|
520
|
+
this._lastUsedFill = ColorUtils.ARGBtoFloat32(a * 0xFF, r * a | 0, g * a | 0, b * a | 0);
|
|
521
|
+
}
|
|
514
522
|
// bitmap was filled plain, go clear TMP to this color too
|
|
515
523
|
renderer.disableClear = false;
|
|
516
524
|
renderer.view.backgroundColor = this._lastUsedFill & 0xffffff;
|
package/index.ts
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
CoordinateSystem,
|
|
16
16
|
Vector3D,
|
|
17
17
|
Transform,
|
|
18
|
+
ColorUtils,
|
|
18
19
|
} from '@awayjs/core';
|
|
19
20
|
|
|
20
21
|
import { Stage,
|
|
@@ -437,6 +438,9 @@ export class SceneImage2D extends BitmapImage2D {
|
|
|
437
438
|
this.dropAllReferences();
|
|
438
439
|
this.unmarkToUnload();
|
|
439
440
|
|
|
441
|
+
if (this._initalFillColor !== null)
|
|
442
|
+
this.fillRect(this._rect, this._initalFillColor);
|
|
443
|
+
|
|
440
444
|
this._stage.threshold(source, this, sourceRect, destPoint, operation, threshold, color, mask, copySource);
|
|
441
445
|
this._imageDataDirty = true;
|
|
442
446
|
}
|
|
@@ -775,6 +779,13 @@ export class SceneImage2D extends BitmapImage2D {
|
|
|
775
779
|
// because target image is stupid filled - it not require merging
|
|
776
780
|
// BUT when blend is required - we shpuld skip color clear and use empty TMP
|
|
777
781
|
if (!useBlend && this._lastUsedFill !== null) {
|
|
782
|
+
|
|
783
|
+
if (this._transparent) {
|
|
784
|
+
//premulitply fill color!
|
|
785
|
+
let [a, r, g, b] = ColorUtils.float32ColorToARGB(this._lastUsedFill);
|
|
786
|
+
a /= 0xFF;
|
|
787
|
+
this._lastUsedFill = ColorUtils.ARGBtoFloat32(a * 0xFF, r * a | 0, g * a | 0, b * a | 0);
|
|
788
|
+
}
|
|
778
789
|
// bitmap was filled plain, go clear TMP to this color too
|
|
779
790
|
renderer.disableClear = false;
|
|
780
791
|
renderer.view.backgroundColor = this._lastUsedFill & 0xffffff;
|