mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-23 04:04:08 +02:00
wip
This commit is contained in:
@@ -84,13 +84,21 @@ export const allInOnePc = defineObject({
|
||||
|
||||
applyFit();
|
||||
|
||||
const applyScreenBrightness = () => {
|
||||
const b = options.screenBrightness;
|
||||
screenMaterial.emissiveColor = new BABYLON.Color3(b, b, b);
|
||||
light.intensity = (5 * b) * WORLD_SCALE * WORLD_SCALE;
|
||||
};
|
||||
|
||||
applyScreenBrightness();
|
||||
|
||||
const applyCustomPicture = () => new Promise<void>((resolve) => {
|
||||
if (options.customPicture != null) {
|
||||
screenMaterial.unfreeze();
|
||||
const tex = new BABYLON.Texture(options.customPicture, scene, false, false, undefined, () => {
|
||||
screenMaterial.emissiveColor = new BABYLON.Color3(1, 1, 1);
|
||||
screenMaterial.emissiveTexture = tex;
|
||||
applyFit();
|
||||
applyScreenBrightness();
|
||||
resolve();
|
||||
}, (message, exception) => {
|
||||
console.warn('Failed to load texture:', message, exception);
|
||||
@@ -107,14 +115,6 @@ export const allInOnePc = defineObject({
|
||||
|
||||
await applyCustomPicture();
|
||||
|
||||
const applyScreenBrightness = () => {
|
||||
const b = options.screenBrightness;
|
||||
screenMaterial.emissiveColor = new BABYLON.Color3(b, b, b);
|
||||
light.intensity = (5 * b) * WORLD_SCALE * WORLD_SCALE;
|
||||
};
|
||||
|
||||
applyScreenBrightness();
|
||||
|
||||
const applyBodyColor = () => {
|
||||
const [r, g, b] = options.bodyColor;
|
||||
bodyMaterial.albedoColor = new BABYLON.Color3(r, g, b);
|
||||
|
||||
Reference in New Issue
Block a user