laymur 0.21.0 → 0.21.1
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MathUtils, WebGLRenderTarget, UnsignedByteType, LinearFilter, RGBAFormat, Matrix3, Scene, PerspectiveCamera } from 'three';
|
|
1
|
+
import { Color, MathUtils, WebGLRenderTarget, UnsignedByteType, LinearFilter, RGBAFormat, Matrix3, Scene, PerspectiveCamera } from 'three';
|
|
2
2
|
import { assertValidPositiveNumber } from '../../miscellaneous/asserts.js';
|
|
3
3
|
import { UIColor } from '../../miscellaneous/color/UIColor.js';
|
|
4
4
|
import source from '../../shaders/UIImage.glsl.js';
|
|
@@ -6,6 +6,8 @@ import { DUMMY_DEFAULT_WIDTH, DUMMY_DEFAULT_HEIGHT } from '../UIDummy/UIDummy.In
|
|
|
6
6
|
import { UIElement } from '../UIElement/UIElement.js';
|
|
7
7
|
import { SCENE_DEFAULT_RESOLUTION_FACTOR, SCENE_MIN_RESOLUTION_FACTOR, SCENE_MAX_RESOLUTION_FACTOR, SCENE_DEFAULT_USE_DEPTH, SCENE_DEFAULT_CLEAR_COLOR, SCENE_DEFAULT_CAMERA_FOV, SCENE_DEFAULT_CAMERA_NEAR, SCENE_DEFAULT_CAMERA_FAR, SCENE_DEFAULT_UPDATE_MODE, UISceneUpdateMode } from './UIScene.Internal.js';
|
|
8
8
|
|
|
9
|
+
let previousClearColor = new Color();
|
|
10
|
+
let previousClearAlpha = 0;
|
|
9
11
|
/** Renders Three.js scene to texture */
|
|
10
12
|
class UIScene extends UIElement {
|
|
11
13
|
/**
|
|
@@ -143,10 +145,15 @@ class UIScene extends UIElement {
|
|
|
143
145
|
});
|
|
144
146
|
this._private_colorInternal.setDirtyFalse();
|
|
145
147
|
}
|
|
148
|
+
const previousRenderTarget = renderer.getRenderTarget();
|
|
149
|
+
previousClearColor = renderer.getClearColor(previousClearColor);
|
|
150
|
+
previousClearAlpha = renderer.getClearAlpha();
|
|
146
151
|
renderer.setClearColor(this._private_clearColorInternal.getHexRGB(), this._private_clearColorInternal.a);
|
|
147
152
|
renderer.setRenderTarget(this._private_renderTarget);
|
|
148
153
|
renderer.clear(true, true, false);
|
|
149
154
|
renderer.render(this._private_sceneInternal, this._private_cameraInternal);
|
|
155
|
+
renderer.setRenderTarget(previousRenderTarget);
|
|
156
|
+
renderer.setClearColor(previousClearColor, previousClearAlpha);
|
|
150
157
|
this._private_propertyDirty = false;
|
|
151
158
|
this._private_updateRequired = false;
|
|
152
159
|
}
|