mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-07-29 08:14:38 +02:00
registerBabylonRuntime
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
20
packages/frontend-misskey-world-engine/src/babylonRuntime.ts
Normal file
20
packages/frontend-misskey-world-engine/src/babylonRuntime.ts
Normal 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,
|
||||
);
|
||||
}
|
||||
@@ -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; };
|
||||
|
||||
@@ -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 };
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user