mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-25 12:04:04 +02:00
Update engine.ts
This commit is contained in:
@@ -204,6 +204,7 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
private zGridPreviewPlane: BABYLON.Mesh;
|
private zGridPreviewPlane: BABYLON.Mesh;
|
||||||
private selectionOutlineLayer: BABYLON.SelectionOutlineLayer;
|
private selectionOutlineLayer: BABYLON.SelectionOutlineLayer;
|
||||||
public sr: BABYLON.SnapshotRenderingHelper;
|
public sr: BABYLON.SnapshotRenderingHelper;
|
||||||
|
private gl: BABYLON.GlowLayer | null = null;
|
||||||
public timer: Timer = new Timer();
|
public timer: Timer = new Timer();
|
||||||
|
|
||||||
private _isEditMode = false;
|
private _isEditMode = false;
|
||||||
@@ -339,15 +340,15 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
this.turnOnRoomLight();
|
this.turnOnRoomLight();
|
||||||
|
|
||||||
if (USE_GLOW) {
|
if (USE_GLOW) {
|
||||||
const gl = new BABYLON.GlowLayer('glow', this.scene, {
|
this.gl = new BABYLON.GlowLayer('glow', this.scene, {
|
||||||
//mainTextureFixedSize: 512,
|
//mainTextureFixedSize: 512,
|
||||||
blurKernelSize: 64,
|
blurKernelSize: 64,
|
||||||
});
|
});
|
||||||
gl.intensity = 0.5;
|
this.gl.intensity = 0.5;
|
||||||
this.scene.setRenderingAutoClearDepthStencil(gl.renderingGroupId, false);
|
this.scene.setRenderingAutoClearDepthStencil(this.gl.renderingGroupId, false);
|
||||||
|
|
||||||
if (SNAPSHOT_RENDERING) {
|
if (SNAPSHOT_RENDERING) {
|
||||||
this.sr.updateMeshesForEffectLayer(gl);
|
this.sr.updateMeshesForEffectLayer(this.gl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1488,6 +1489,9 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
if (SNAPSHOT_RENDERING) {
|
if (SNAPSHOT_RENDERING) {
|
||||||
this.sr.disableSnapshotRendering();
|
this.sr.disableSnapshotRendering();
|
||||||
}
|
}
|
||||||
|
if (this.gl != null) {
|
||||||
|
this.gl.isEnabled = false; // 重いので切る
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async exitEditMode() {
|
public async exitEditMode() {
|
||||||
@@ -1499,6 +1503,9 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
if (SNAPSHOT_RENDERING) {
|
if (SNAPSHOT_RENDERING) {
|
||||||
this.sr.enableSnapshotRendering();
|
this.sr.enableSnapshotRendering();
|
||||||
}
|
}
|
||||||
|
if (this.gl != null) {
|
||||||
|
this.gl.isEnabled = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async bake() {
|
public async bake() {
|
||||||
|
|||||||
Reference in New Issue
Block a user