1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-07-29 08:14:38 +02:00

registerBabylonRuntime

This commit is contained in:
syuilo
2026-06-03 08:42:07 +09:00
parent 32af098cd9
commit f55adc19d3
7 changed files with 35 additions and 27 deletions

View File

@@ -4,13 +4,11 @@
*/
import * as BABYLON from '@babylonjs/core/pure';
import '@babylonjs/core/Engines/WebGPU/Extensions/engine.rawTexture';
import { AvatarPreviewEngine } from './avatarPreviewEngine.js';
import { registerBabylonRuntime } from './babylonRuntime.js';
import type { PlayerProfile } from './PlayerContainer.js';
BABYLON.RegisterFullEngineExtensions();
BABYLON.RegisterEnginesExtensionsEngineRawTexture();
BABYLON.RegisterCollisionCoordinator();
registerBabylonRuntime();
export async function createAvatarPreviewEngine(params: {
canvas: HTMLCanvasElement; options: { graphicsQuality: number; resolution: number; fps: number | null }; profile: PlayerProfile;

View File

@@ -4,17 +4,15 @@
*/
import * as BABYLON from '@babylonjs/core/pure';
import '@babylonjs/core/Engines/WebGPU/Extensions/engine.rawTexture';
import { AvatarPreviewEngine } from './avatarPreviewEngine.js';
import { registerBabylonRuntime } from './babylonRuntime.js';
import type { PlayerProfile } from './PlayerContainer.js';
registerBabylonRuntime();
let engine: AvatarPreviewEngine | null = null;
let canvas: OffscreenCanvas | null = null;
BABYLON.RegisterFullEngineExtensions();
BABYLON.RegisterEnginesExtensionsEngineRawTexture();
BABYLON.RegisterCollisionCoordinator();
// TODO: 他のWorkerと実装を共通化
onmessage = async (event) => {
//console.log('Worker received message:', event.data);

View File

@@ -0,0 +1,20 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
import * as BABYLON from '@babylonjs/core/pure';
//import '@babylonjs/core/Engines/WebGPU/Extensions/engine.rawTexture';
export function registerBabylonRuntime(): void {
BABYLON.RegisterCoreEngineExtensions();
BABYLON.RegisterFullWebGPUEngineExtensions();
//BABYLON.RegisterEnginesWebGPUExtensionsEngineRawTexture();
BABYLON.RegisterBufferAlign();
BABYLON.RegisterCubeTexture();
BABYLON.RegisterStandardMaterial();
BABYLON.RegisterCollisionCoordinator();
BABYLON.RegisterPostProcessRenderPipelineManagerSceneComponent(
BABYLON.PostProcessRenderPipelineManager,
);
}

View File

@@ -4,13 +4,11 @@
*/
import * as BABYLON from '@babylonjs/core/pure';
import '@babylonjs/core/Engines/WebGPU/Extensions/engine.rawTexture';
import { registerBabylonRuntime } from '../babylonRuntime.js';
import { RoomEngine } from './engine.js';
import type { RoomState, RoomAttachments } from 'misskey-world/src/room/type.js';
BABYLON.RegisterFullEngineExtensions();
BABYLON.RegisterEnginesExtensionsEngineRawTexture();
BABYLON.RegisterCollisionCoordinator();
registerBabylonRuntime();
export async function createRoomEngine(params: {
roomState: RoomState; roomAttachments: RoomAttachments; canvas: HTMLCanvasElement; options: { antialias: boolean; resolution: number; fov: number; graphicsQuality: number; fps: number | null; useVirtualJoystick?: boolean; };

View File

@@ -4,12 +4,10 @@
*/
import * as BABYLON from '@babylonjs/core/pure';
import '@babylonjs/core/Engines/WebGPU/Extensions/engine.rawTexture';
import { registerBabylonRuntime } from '../babylonRuntime.js';
import { RoomFurniturePreviewEngine } from './previewEngine.js';
BABYLON.RegisterFullEngineExtensions();
BABYLON.RegisterEnginesExtensionsEngineRawTexture();
BABYLON.RegisterCollisionCoordinator();
registerBabylonRuntime();
export async function createRoomPreviewEngine(params: {
canvas: HTMLCanvasElement; options: { graphicsQuality: number; resolution: number; fps: number | null };

View File

@@ -4,16 +4,14 @@
*/
import * as BABYLON from '@babylonjs/core/pure';
import '@babylonjs/core/Engines/WebGPU/Extensions/engine.rawTexture';
import { registerBabylonRuntime } from '../babylonRuntime.js';
import { RoomFurniturePreviewEngine } from './previewEngine.js';
registerBabylonRuntime();
let engine: RoomFurniturePreviewEngine | null = null;
let canvas: OffscreenCanvas | null = null;
BABYLON.RegisterFullEngineExtensions();
BABYLON.RegisterEnginesExtensionsEngineRawTexture();
BABYLON.RegisterCollisionCoordinator();
// TODO: 他のWorkerと実装を共通化
onmessage = async (event) => {
//console.log('Worker received message:', event.data);

View File

@@ -4,17 +4,15 @@
*/
import * as BABYLON from '@babylonjs/core/pure';
import '@babylonjs/core/Engines/WebGPU/Extensions/engine.rawTexture';
import { registerBabylonRuntime } from '../babylonRuntime.js';
import { RoomEngine } from './engine.js';
import type { RoomState, RoomAttachments } from 'misskey-world/src/room/type.js';
registerBabylonRuntime();
let engine: RoomEngine | null = null;
let canvas: OffscreenCanvas | null = null;
BABYLON.RegisterFullEngineExtensions();
BABYLON.RegisterEnginesExtensionsEngineRawTexture();
BABYLON.RegisterCollisionCoordinator();
// TODO: 他のWorkerと実装を共通化
onmessage = async (event) => {
//console.log('Worker received message:', event.data);