mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-05 03:34:07 +02:00
wip
This commit is contained in:
@@ -19,7 +19,7 @@ export type RoomControllerOptions = {
|
|||||||
workerMode?: boolean;
|
workerMode?: boolean;
|
||||||
graphicsQuality: number;
|
graphicsQuality: number;
|
||||||
fps: number | null;
|
fps: number | null;
|
||||||
resolution: number | null;
|
resolution: number;
|
||||||
useVirtualJoystick?: boolean;
|
useVirtualJoystick?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -96,11 +96,19 @@ export class RoomController {
|
|||||||
if (this.options.resolution === 2) babylonEngine.setHardwareScalingLevel(0.5);
|
if (this.options.resolution === 2) babylonEngine.setHardwareScalingLevel(0.5);
|
||||||
if (this.options.resolution === 0.5) babylonEngine.setHardwareScalingLevel(2);
|
if (this.options.resolution === 0.5) babylonEngine.setHardwareScalingLevel(2);
|
||||||
|
|
||||||
this.engine = new RoomEngine(this.roomState.value, { canvas, engine: babylonEngine, ...this.options });
|
this.engine = new RoomEngine(this.roomState.value, {
|
||||||
|
canvas,
|
||||||
|
engine: babylonEngine,
|
||||||
|
sharpen: this.options.resolution >= 1,
|
||||||
|
...this.options,
|
||||||
|
});
|
||||||
|
|
||||||
this.engine.on('loadingProgress', ({ progress }) => {
|
this.engine.on('loadingProgress', ({ progress }) => {
|
||||||
this.initializeProgress.value = progress;
|
this.initializeProgress.value = progress;
|
||||||
});
|
});
|
||||||
|
|
||||||
await this.engine.init();
|
await this.engine.init();
|
||||||
|
|
||||||
this.initializeProgress.value = 1;
|
this.initializeProgress.value = 1;
|
||||||
this.isReady.value = true;
|
this.isReady.value = true;
|
||||||
|
|
||||||
|
|||||||
@@ -225,6 +225,7 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
engine: BABYLON.WebGPUEngine;
|
engine: BABYLON.WebGPUEngine;
|
||||||
graphicsQuality: number;
|
graphicsQuality: number;
|
||||||
fps: number | null;
|
fps: number | null;
|
||||||
|
sharpen: boolean;
|
||||||
useVirtualJoystick?: boolean;
|
useVirtualJoystick?: boolean;
|
||||||
}) {
|
}) {
|
||||||
super();
|
super();
|
||||||
@@ -455,9 +456,11 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
|||||||
//pipeline.chromaticAberration.radialIntensity = 2;
|
//pipeline.chromaticAberration.radialIntensity = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.sharpen) {
|
||||||
pipeline.sharpenEnabled = true;
|
pipeline.sharpenEnabled = true;
|
||||||
pipeline.sharpen.edgeAmount = 0.5;
|
pipeline.sharpen.edgeAmount = 0.5;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (_DEV_) {
|
if (_DEV_) {
|
||||||
// snapshot renderingかつglow layerが有効だとなんかクラッシュする
|
// snapshot renderingかつglow layerが有効だとなんかクラッシュする
|
||||||
|
|||||||
@@ -24,11 +24,19 @@ onmessage = async (event) => {
|
|||||||
if (event.data.options.resolution === 2) babylonEngine.setHardwareScalingLevel(0.5);
|
if (event.data.options.resolution === 2) babylonEngine.setHardwareScalingLevel(0.5);
|
||||||
if (event.data.options.resolution === 0.5) babylonEngine.setHardwareScalingLevel(2);
|
if (event.data.options.resolution === 0.5) babylonEngine.setHardwareScalingLevel(2);
|
||||||
|
|
||||||
engine = new RoomEngine(roomState, { canvas, engine: babylonEngine, ...event.data.options });
|
engine = new RoomEngine(roomState, {
|
||||||
|
canvas,
|
||||||
|
engine: babylonEngine,
|
||||||
|
sharpen: event.data.options.resolution >= 1,
|
||||||
|
...event.data.options,
|
||||||
|
});
|
||||||
|
|
||||||
engine.on('loadingProgress', ({ progress }) => {
|
engine.on('loadingProgress', ({ progress }) => {
|
||||||
self.postMessage({ type: 'progress', progress });
|
self.postMessage({ type: 'progress', progress });
|
||||||
});
|
});
|
||||||
|
|
||||||
await engine.init();
|
await engine.init();
|
||||||
|
|
||||||
self.postMessage({ type: 'inited' });
|
self.postMessage({ type: 'inited' });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user