mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-25 03:54:07 +02:00
wip
This commit is contained in:
@@ -212,6 +212,8 @@ const resolutionRaw = prefer.model('world.resolution');
|
||||
const resolutionAutoValue = computed<number>(() => deviceKind !== 'desktop' ? 0.5 : 1);
|
||||
const resolution = computed<number>(() => resolutionRaw.value ?? resolutionAutoValue.value);
|
||||
|
||||
const antialias = prefer.model('world.antialias');
|
||||
|
||||
const useVirtualJoystick = isTouchUsing && (deviceKind === 'smartphone' || deviceKind === 'tablet');
|
||||
//const useVirtualJoystick = true;
|
||||
|
||||
@@ -264,6 +266,7 @@ const roomControllerOptions = computed<RoomControllerOptions>(() => ({
|
||||
graphicsQuality: graphicsQuality.value,
|
||||
fps: fps.value,
|
||||
resolution: resolution.value,
|
||||
antialias: antialias.value,
|
||||
useVirtualJoystick,
|
||||
workerMode: true,
|
||||
}));
|
||||
@@ -380,7 +383,7 @@ onMounted(async () => {
|
||||
}
|
||||
});
|
||||
|
||||
watch([graphicsQuality, fps, resolution], () => {
|
||||
watch([graphicsQuality, fps, resolution, antialias], () => {
|
||||
refresh();
|
||||
});
|
||||
});
|
||||
@@ -585,6 +588,10 @@ function showOtherMenu(ev: PointerEvent) {
|
||||
value: 0.5,
|
||||
}],
|
||||
ref: resolutionRaw,
|
||||
}, {
|
||||
type: 'switch',
|
||||
text: i18n.ts._room.antialiasing,
|
||||
ref: antialias,
|
||||
}, {
|
||||
type: 'divider',
|
||||
}, {
|
||||
|
||||
@@ -542,6 +542,9 @@ export const PREF_DEF = definePreferences({
|
||||
'world.resolution': {
|
||||
default: null as 0.5 | 1 | 2 | null,
|
||||
},
|
||||
'world.antialias': {
|
||||
default: true,
|
||||
},
|
||||
|
||||
'experimental.stackingRouterView': {
|
||||
default: false,
|
||||
|
||||
@@ -20,6 +20,7 @@ export type RoomControllerOptions = {
|
||||
graphicsQuality: number;
|
||||
fps: number | null;
|
||||
resolution: number;
|
||||
antialias: boolean;
|
||||
useVirtualJoystick?: boolean;
|
||||
};
|
||||
|
||||
@@ -84,7 +85,7 @@ export class RoomController {
|
||||
}
|
||||
};
|
||||
} else {
|
||||
const babylonEngine = new BABYLON.WebGPUEngine(canvas, { doNotHandleContextLost: true, powerPreference: 'high-performance', antialias: this.options.graphicsQuality >= GRAPHICS_QUALITY_MEDIUM });
|
||||
const babylonEngine = new BABYLON.WebGPUEngine(canvas, { doNotHandleContextLost: true, powerPreference: 'high-performance', antialias: this.options.antialias });
|
||||
babylonEngine.compatibilityMode = false;
|
||||
babylonEngine.enableOfflineSupport = false;
|
||||
babylonEngine.onContextLostObservable.add(() => {
|
||||
|
||||
@@ -226,6 +226,7 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
||||
engine: BABYLON.WebGPUEngine;
|
||||
graphicsQuality: number;
|
||||
fps: number | null;
|
||||
antialias: boolean;
|
||||
useVirtualJoystick?: boolean;
|
||||
}) {
|
||||
super();
|
||||
@@ -407,7 +408,9 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
||||
|
||||
if (options.graphicsQuality >= GRAPHICS_QUALITY_HIGH) {
|
||||
const pipeline = new BABYLON.DefaultRenderingPipeline('default', true, this.scene);
|
||||
pipeline.samples = 4;
|
||||
if (options.antialias) {
|
||||
pipeline.samples = 4;
|
||||
}
|
||||
|
||||
// snapshot renderingと相性が悪そう
|
||||
//pipeline.depthOfFieldEnabled = true;
|
||||
@@ -456,7 +459,6 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
||||
}).then(() => {
|
||||
loadedCount++;
|
||||
this.emit('loadingProgress', { progress: loadedCount / objects.length });
|
||||
console.log(`Loaded object ${o.id} (${o.type})`);
|
||||
})));
|
||||
|
||||
// 不具合のもと
|
||||
|
||||
@@ -17,7 +17,7 @@ onmessage = async (event) => {
|
||||
case 'init': {
|
||||
const roomState = event.data.roomState as RoomState;
|
||||
canvas = event.data.canvas as HTMLCanvasElement;
|
||||
const babylonEngine = new BABYLON.WebGPUEngine(canvas, { doNotHandleContextLost: true, powerPreference: 'high-performance', antialias: event.data.options.graphicsQuality >= GRAPHICS_QUALITY_MEDIUM });
|
||||
const babylonEngine = new BABYLON.WebGPUEngine(canvas, { doNotHandleContextLost: true, powerPreference: 'high-performance', antialias: event.data.options.antialias });
|
||||
babylonEngine.compatibilityMode = false;
|
||||
babylonEngine.enableOfflineSupport = false;
|
||||
await babylonEngine.initAsync();
|
||||
|
||||
@@ -13307,5 +13307,9 @@ export interface Locale extends ILocale {
|
||||
* バグ、またはデバイスのリソース不足の可能性が考えられます。
|
||||
*/
|
||||
"crushed_description": string;
|
||||
/**
|
||||
* アンチエイリアス
|
||||
*/
|
||||
"antialiasing": string;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user