mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-13 14:05:35 +02:00
wip
This commit is contained in:
Binary file not shown.
@@ -858,8 +858,11 @@ export class RoomEngine extends EventEmitter {
|
||||
this.shadowGeneratorForSunLight?.addShadowCaster(m);
|
||||
//if (m.material) (m.material as BABYLON.PBRMaterial).ambientColor = new BABYLON.Color3(1, 1, 1);
|
||||
if (m.material) {
|
||||
(m.material as BABYLON.PBRMaterial).reflectionTexture = this.envMapIndoor;
|
||||
//(m.material as BABYLON.PBRMaterial).ambientColor = new BABYLON.Color3(0.5, 0.5, 0.5);
|
||||
if ((m.material as BABYLON.PBRMaterial).metadata?.disableEnvMap) {
|
||||
(m.material as BABYLON.PBRMaterial).ambientColor = new BABYLON.Color3(0.5, 0.5, 0.5);
|
||||
} else {
|
||||
(m.material as BABYLON.PBRMaterial).reflectionTexture = this.envMapIndoor;
|
||||
}
|
||||
(m.material as BABYLON.PBRMaterial).useGLTFLightFalloff = true; // Clustered Lightingではphysical falloffを持つマテリアルはアーチファクトが発生する https://doc.babylonjs.com/features/featuresDeepDive/lights/clusteredLighting/#materials-with-a-physical-falloff-may-cause-artefacts
|
||||
}
|
||||
}
|
||||
@@ -1426,6 +1429,11 @@ export class RoomEngine extends EventEmitter {
|
||||
if (!forInit) this.sr.disableSnapshotRendering(); // このメソッドは参照カウント方式な点に留意
|
||||
this.roomLight.intensity = 18 * WORLD_SCALE * WORLD_SCALE;
|
||||
this.envMapIndoor.level = 0.6;
|
||||
for (const m of this.scene.materials) {
|
||||
if (m.metadata?.disableEnvMap) {
|
||||
m.ambientColor = new BABYLON.Color3(0.5, 0.5, 0.5);
|
||||
}
|
||||
}
|
||||
if (!forInit) {
|
||||
// workerで実行される可能性がある
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
@@ -1439,6 +1447,11 @@ export class RoomEngine extends EventEmitter {
|
||||
this.sr.disableSnapshotRendering(); // このメソッドは参照カウント方式な点に留意
|
||||
this.roomLight.intensity = 0;
|
||||
this.envMapIndoor.level = 0.025;
|
||||
for (const m of this.scene.materials) {
|
||||
if (m.metadata?.disableEnvMap) {
|
||||
m.ambientColor = new BABYLON.Color3(0.025, 0.025, 0.025);
|
||||
}
|
||||
}
|
||||
// workerで実行される可能性がある
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -117,6 +117,7 @@ export class SimpleHeyaManager extends HeyaManager<SimpleHeyaOptions> {
|
||||
};
|
||||
|
||||
const wallMaterial = findMaterial(this.meshes[0], '__WALL__');
|
||||
//wallMaterial.metadata.disableEnvMap = true;
|
||||
this.wallMaterials = {
|
||||
n: wallMaterial.clone('wallNMaterial'),
|
||||
s: wallMaterial.clone('wallSMaterial'),
|
||||
@@ -125,6 +126,7 @@ export class SimpleHeyaManager extends HeyaManager<SimpleHeyaOptions> {
|
||||
};
|
||||
|
||||
const beamMaterial = findMaterial(this.meshes[0], '__BEAM__');
|
||||
//beamMaterial.metadata.disableEnvMap = true;
|
||||
this.wallBeamMaterials = {
|
||||
n: beamMaterial.clone('wallNBeamMaterial'),
|
||||
s: beamMaterial.clone('wallSBeamMaterial'),
|
||||
@@ -133,6 +135,7 @@ export class SimpleHeyaManager extends HeyaManager<SimpleHeyaOptions> {
|
||||
};
|
||||
|
||||
const pillarMaterial = findMaterial(this.meshes[0], '__PILLAR__');
|
||||
//pillarMaterial.metadata.disableEnvMap = true;
|
||||
this.pillarMaterials = {
|
||||
nw: pillarMaterial.clone('pillarNWMaterial'),
|
||||
ne: pillarMaterial.clone('pillarNEMaterial'),
|
||||
@@ -155,7 +158,12 @@ export class SimpleHeyaManager extends HeyaManager<SimpleHeyaOptions> {
|
||||
}
|
||||
|
||||
this.ceilingMaterial = findMaterial(this.meshes[0], '__CEILING__');
|
||||
//this.ceilingMaterial.metadata.disableEnvMap = true;
|
||||
this.floorMaterial = findMaterial(this.meshes[0], '__FLOOR__');
|
||||
//this.floorMaterial.metadata.disableEnvMap = true;
|
||||
|
||||
const baseboardMaterial = findMaterial(this.meshes[0], '__BASEBOARD__');
|
||||
//baseboardMaterial.metadata.disableEnvMap = true;
|
||||
|
||||
await this.applyOptions(options);
|
||||
}
|
||||
|
||||
@@ -25,15 +25,17 @@ export const lavaLamp = defineObject({
|
||||
light.range = cm(100);
|
||||
if (room?.lightContainer != null) room.lightContainer.addLight(light);
|
||||
|
||||
const mat = new BABYLON.PBRMaterial('lavaLampLightMat', scene);
|
||||
mat.emissiveColor = new BABYLON.Color3(1.0, 0.5, 0.2);
|
||||
mat.disableLighting = true;
|
||||
const sphere = BABYLON.MeshBuilder.CreateSphere('lavaLampLightSphere', { diameter: cm(4) }, scene);
|
||||
sphere.parent = root;
|
||||
sphere.position = new BABYLON.Vector3(0, cm(15), 0);
|
||||
const mat = new BABYLON.StandardMaterial('lavaLampLightMat', scene);
|
||||
mat.emissiveColor = new BABYLON.Color3(1.0, 0.5, 0.2);
|
||||
|
||||
mat.alpha = 0.5;
|
||||
//mat.disableLighting = true;
|
||||
sphere.material = mat;
|
||||
const sphere2 = BABYLON.MeshBuilder.CreateSphere('lavaLampLightSphere2', { diameter: cm(2) }, scene);
|
||||
sphere2.parent = root;
|
||||
sphere2.position = new BABYLON.Vector3(0, cm(15), 0);
|
||||
sphere2.material = mat;
|
||||
|
||||
const anim = new BABYLON.Animation('lavaLampLightAnim', 'position.y', 60, BABYLON.Animation.ANIMATIONTYPE_FLOAT, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
|
||||
anim.setKeys([
|
||||
@@ -42,6 +44,8 @@ export const lavaLamp = defineObject({
|
||||
]);
|
||||
sphere.animations = [anim];
|
||||
scene.beginAnimation(sphere, 0, 500, true);
|
||||
sphere2.animations = [anim];
|
||||
scene.beginAnimation(sphere2, 0, 500, true, 0.6);
|
||||
|
||||
const emitter = new BABYLON.TransformNode('emitter', scene);
|
||||
emitter.parent = root;
|
||||
|
||||
Reference in New Issue
Block a user