优化
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
yinsx
2026-01-05 16:30:14 +08:00
parent 661aa63f9f
commit 260c7e706c
6 changed files with 0 additions and 51 deletions

View File

@ -36,7 +36,6 @@ steps:
- main
- master
- dev
# 第三步:上传构建文件
- name: 上传构建文件
image: appleboy/drone-scp

View File

@ -8,8 +8,6 @@ type ErrorCallback = ((error?: unknown) => void) | null | undefined;
export const AppConfig = {
container: 'renderDom',
modelUrlList: [] as string[],
success: null as OptionalCallback,
error: null as ErrorCallback,
env: {
envPath: '/hdr/sanGiuseppeBridge.env',
intensity: 1.5,

View File

@ -1,21 +0,0 @@
import { AppConfig } from './AppConfig';
/**
* 负责获取渲染容器 DOM
*/
export class AppDom {
private _renderDom: HTMLCanvasElement | null;
constructor() {
this._renderDom = null;
}
get renderDom(): HTMLCanvasElement | null {
return this._renderDom;
}
Awake(): void {
const dom = document.getElementById(AppConfig.container) || document.querySelector('#renderDom');
this._renderDom = (dom as HTMLCanvasElement) ?? null;
}
}

View File

@ -38,23 +38,5 @@ export class AppLight extends Monobehiver {
"mainLight",
new Vector3(0, -0.5, -1),
);
light.position = new Vector3(-0.6, 2.12, 2);
light.diffuse = new Color3(1, 0.86, 0.80);
light.specular = new Color3(1, 1, 1);
light.intensity = 1;
light.shadowMinZ = 0.01;
light.shadowMaxZ = 100;
const generator = new ShadowGenerator(4096, light);
generator.usePercentageCloserFiltering = true;
generator.filteringQuality = ShadowGenerator.QUALITY_HIGH;
generator.transparencyShadow = true;
this.lightList.push(light);
this.shadowGenerator = generator;
}
}

View File

@ -19,10 +19,5 @@ export class AppScene extends Monobehiver {
this.object = new Scene(this.mainApp.appEngin.object);
this.object.clearColor = new Color4(0, 0, 0, 0); // 透明背景
this.object.skipFrustumClipping = true; // 跳过视锥剔除优化性能
// 1. 开启色调映射(Tone mapping)
// this.object.imageProcessingConfiguration.toneMappingEnabled = true;
// 2. 设置色调映射类型为ACES
// this.object.imageProcessingConfiguration.toneMappingType = ImageProcessingConfiguration.TONEMAPPING_ACES;
}
}

View File

@ -3,7 +3,6 @@
* @description 主应用类,负责初始化和协调所有子模块
*/
import { AppDom } from './AppDom';
import { AppEngin } from './AppEngin';
import { AppScene } from './AppScene';
import { AppCamera } from './AppCamera';
@ -19,7 +18,6 @@ import { EventBridge } from '../event/bridge';
* 负责管理DOM、引擎、场景、相机、灯光、环境、模型和动画等子模块
*/
export class MainApp {
appDom: AppDom;
appEngin: AppEngin;
appScene: AppScene;
appCamera: AppCamera;
@ -30,7 +28,6 @@ export class MainApp {
constructor() {
this.appDom = new AppDom();
this.appEngin = new AppEngin(this);
this.appScene = new AppScene(this);
this.appCamera = new AppCamera(this);
@ -58,7 +55,6 @@ export class MainApp {
/** 唤醒/初始化所有子模块 */
async Awake(): Promise<void> {
this.appDom.Awake();
this.appEngin.Awake();
this.appScene.Awake();
this.appCamera.Awake();