mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-13 12:55:30 +02:00
scale intensity
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject } from '../engine.js';
|
||||
import { defineObject, WORLD_SCALE } from '../engine.js';
|
||||
import { cm, createPlaneUvMapper } from '../utility.js';
|
||||
|
||||
export const allInOnePc = defineObject({
|
||||
@@ -107,7 +107,7 @@ export const allInOnePc = defineObject({
|
||||
const applyScreenBrightness = () => {
|
||||
const b = options.screenBrightness;
|
||||
screenMaterial.emissiveColor = new BABYLON.Color3(b, b, b);
|
||||
light.intensity = 50000 * b;
|
||||
light.intensity = (5 * b) * WORLD_SCALE * WORLD_SCALE;
|
||||
};
|
||||
|
||||
applyScreenBrightness();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject } from '../engine.js';
|
||||
import { defineObject, WORLD_SCALE } from '../engine.js';
|
||||
import { cm } from '../utility.js';
|
||||
|
||||
export const beamLamp = defineObject({
|
||||
@@ -22,7 +22,7 @@ export const beamLamp = defineObject({
|
||||
const light = new BABYLON.PointLight('beamLampLight', new BABYLON.Vector3(0, cm(10), 0), scene, room?.lightContainer != null);
|
||||
light.parent = root;
|
||||
light.diffuse = new BABYLON.Color3(1.0, 0.5, 0.2);
|
||||
light.intensity = 300;
|
||||
light.intensity = 0.03 * WORLD_SCALE * WORLD_SCALE;
|
||||
light.range = cm(100);
|
||||
if (room?.lightContainer != null) room.lightContainer.addLight(light);
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject } from '../engine.js';
|
||||
import { defineObject, WORLD_SCALE } from '../engine.js';
|
||||
import { cm } from '../utility.js';
|
||||
|
||||
export const desktopPc = defineObject({
|
||||
@@ -50,13 +50,13 @@ export const desktopPc = defineObject({
|
||||
createInstance: ({ options, model, root, scene, room }) => {
|
||||
const light1 = new BABYLON.SpotLight('', new BABYLON.Vector3(0, cm(10), cm(22)), new BABYLON.Vector3(0, 0, 1), Math.PI / 1, 2, scene, room?.lightContainer != null);
|
||||
light1.parent = root;
|
||||
light1.intensity = 500;
|
||||
light1.intensity = 0.05 * WORLD_SCALE * WORLD_SCALE;
|
||||
light1.range = cm(30);
|
||||
if (room?.lightContainer != null) room.lightContainer.addLight(light1);
|
||||
|
||||
const light2 = new BABYLON.SpotLight('', new BABYLON.Vector3(cm(-5), cm(33), cm(-9)), new BABYLON.Vector3(1, 0, 0), Math.PI / 1, 2, scene, room?.lightContainer != null);
|
||||
light2.parent = root;
|
||||
light2.intensity = 500;
|
||||
light2.intensity = 0.05 * WORLD_SCALE * WORLD_SCALE;
|
||||
light2.range = cm(30);
|
||||
if (room?.lightContainer != null) room.lightContainer.addLight(light2);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject } from '../engine.js';
|
||||
import { defineObject, WORLD_SCALE } from '../engine.js';
|
||||
import { cm, createPlaneUvMapper } from '../utility.js';
|
||||
|
||||
export const laptopPc = defineObject({
|
||||
@@ -117,7 +117,7 @@ export const laptopPc = defineObject({
|
||||
const applyScreenBrightness = () => {
|
||||
const b = options.screenBrightness;
|
||||
screenMaterial.emissiveColor = new BABYLON.Color3(b, b, b);
|
||||
light.intensity = 20000 * b;
|
||||
light.intensity = (2 * b) * WORLD_SCALE * WORLD_SCALE;
|
||||
};
|
||||
|
||||
applyScreenBrightness();
|
||||
@@ -142,7 +142,7 @@ export const laptopPc = defineObject({
|
||||
if (angle <= -Math.PI / 2) {
|
||||
light.intensity = 0;
|
||||
} else {
|
||||
light.intensity = 20000 * options.screenBrightness;
|
||||
light.intensity = (2 * options.screenBrightness) * WORLD_SCALE * WORLD_SCALE;
|
||||
}
|
||||
model.updated();
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject } from '../engine.js';
|
||||
import { defineObject, WORLD_SCALE } from '../engine.js';
|
||||
import { cm } from '../utility.js';
|
||||
|
||||
export const lavaLamp = defineObject({
|
||||
@@ -21,7 +21,7 @@ export const lavaLamp = defineObject({
|
||||
const light = new BABYLON.PointLight('lavaLampLight', new BABYLON.Vector3(0, cm(11), 0), scene, room?.lightContainer != null);
|
||||
light.parent = root;
|
||||
light.diffuse = new BABYLON.Color3(1.0, 0.5, 0.2);
|
||||
light.intensity = 300;
|
||||
light.intensity = 0.03 * WORLD_SCALE * WORLD_SCALE;
|
||||
light.range = cm(100);
|
||||
if (room?.lightContainer != null) room.lightContainer.addLight(light);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject } from '../engine.js';
|
||||
import { defineObject, WORLD_SCALE } from '../engine.js';
|
||||
import { cm, get7segMeshesOfCurrentTime } from '../utility.js';
|
||||
|
||||
export const tabletopDigitalClock = defineObject({
|
||||
@@ -37,7 +37,7 @@ export const tabletopDigitalClock = defineObject({
|
||||
createInstance: ({ root, room, options, model, scene }) => {
|
||||
const light = new BABYLON.SpotLight('', new BABYLON.Vector3(0, cm(3), cm(1)), new BABYLON.Vector3(0, 0, 1), Math.PI / 1, 2, scene, room?.lightContainer != null);
|
||||
light.parent = root;
|
||||
light.intensity = 100;
|
||||
light.intensity = 0.01 * WORLD_SCALE * WORLD_SCALE;
|
||||
light.range = cm(30);
|
||||
if (room?.lightContainer != null) room.lightContainer.addLight(light);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject } from '../engine.js';
|
||||
import { defineObject, WORLD_SCALE } from '../engine.js';
|
||||
import { cm, createPlaneUvMapper, initTv } from '../utility.js';
|
||||
|
||||
export const tv = defineObject({
|
||||
@@ -59,7 +59,7 @@ export const tv = defineObject({
|
||||
const applyScreenBrightness = () => {
|
||||
const b = options.screenBrightness;
|
||||
screenMaterial.emissiveColor = new BABYLON.Color3(b, b, b);
|
||||
light.intensity = 70000 * b;
|
||||
light.intensity = (7 * b) * WORLD_SCALE * WORLD_SCALE;
|
||||
};
|
||||
|
||||
applyScreenBrightness();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import * as BABYLON from '@babylonjs/core';
|
||||
import { defineObject } from '../engine.js';
|
||||
import { defineObject, WORLD_SCALE } from '../engine.js';
|
||||
import { cm } from '../utility.js';
|
||||
|
||||
export const woodRingFloorLamp = defineObject({
|
||||
@@ -83,7 +83,7 @@ export const woodRingFloorLamp = defineObject({
|
||||
|
||||
const applyLightBrightness = () => {
|
||||
for (const light of lights) {
|
||||
light.intensity = 10000 * options.lightBrightness;
|
||||
light.intensity = 1 * options.lightBrightness * WORLD_SCALE * WORLD_SCALE;
|
||||
light.range = cm(200) * options.lightBrightness;
|
||||
}
|
||||
for (const lamp of lamps) {
|
||||
|
||||
@@ -87,7 +87,7 @@ export const woodRingsPendantLight = defineObject({
|
||||
applyLightColor();
|
||||
|
||||
const applyLightBrightness = () => {
|
||||
light.intensity = 10000 * options.lightBrightness;
|
||||
light.intensity = 1 * options.lightBrightness * WORLD_SCALE * WORLD_SCALE;
|
||||
light.range = cm(200) * options.lightBrightness;
|
||||
const emissive = lamp.material as BABYLON.PBRMaterial;
|
||||
emissive.emissiveIntensity = options.lightBrightness * 10;
|
||||
|
||||
Reference in New Issue
Block a user