mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-23 09:54:06 +02:00
wip
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -22,19 +22,19 @@ export const cardboardBox = defineObject({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
placement: 'top',
|
placement: 'top',
|
||||||
createInstance: ({ scene, options, root }) => {
|
createInstance: ({ scene, options, model }) => {
|
||||||
return {
|
return {
|
||||||
onInited: () => {
|
onInited: () => {
|
||||||
//const boxMesh = root.getChildMeshes().find(m => m.name === 'Box') as BABYLON.Mesh;
|
const material = model.findMaterial('__X_BODY__');
|
||||||
//if (options.variation === 'mikan') {
|
if (options.variation === 'mikan') {
|
||||||
// const tex = new BABYLON.Texture('/client-assets/room/objects/cardboard-box/textures/mikan.png', scene, false, false);
|
const tex = new BABYLON.Texture('/client-assets/room/objects/cardboard-box/textures/mikan.png', scene, false, false);
|
||||||
// (boxMesh.material as BABYLON.PBRMaterial).albedoTexture = tex;
|
material.albedoTexture = tex;
|
||||||
// (boxMesh.material as BABYLON.PBRMaterial).albedoColor = new BABYLON.Color3(1, 1, 1);
|
material.albedoColor = new BABYLON.Color3(1, 1, 1);
|
||||||
//} else if (options.variation === 'aizon') {
|
} else if (options.variation === 'aizon') {
|
||||||
// const tex = new BABYLON.Texture('/client-assets/room/objects/cardboard-box/textures/aizon.png', scene, false, false);
|
const tex = new BABYLON.Texture('/client-assets/room/objects/cardboard-box/textures/aizon.png', scene, false, false);
|
||||||
// (boxMesh.material as BABYLON.PBRMaterial).albedoTexture = tex;
|
material.albedoTexture = tex;
|
||||||
// (boxMesh.material as BABYLON.PBRMaterial).albedoColor = new BABYLON.Color3(1, 1, 1);
|
material.albedoColor = new BABYLON.Color3(1, 1, 1);
|
||||||
//}
|
}
|
||||||
},
|
},
|
||||||
interactions: {},
|
interactions: {},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ export const tv = defineObject({
|
|||||||
const screenMesh = model.findMesh('__TV_SCREEN__');
|
const screenMesh = model.findMesh('__TV_SCREEN__');
|
||||||
screenMesh.markVerticesDataAsUpdatable(BABYLON.VertexBuffer.UVKind, true);
|
screenMesh.markVerticesDataAsUpdatable(BABYLON.VertexBuffer.UVKind, true);
|
||||||
|
|
||||||
|
model.bakeExcludeMeshes = [screenMesh];
|
||||||
|
|
||||||
initTv(room, screenMesh);
|
initTv(room, screenMesh);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -282,19 +282,19 @@ const TV_PROGRAMS = {
|
|||||||
timeline: [index: number, duration: number][];
|
timeline: [index: number, duration: number][];
|
||||||
}>;
|
}>;
|
||||||
|
|
||||||
let tvScreenMaterial: BABYLON.StandardMaterial | null = null;
|
let tvScreenMaterial: BABYLON.PBRMaterial | null = null;
|
||||||
|
|
||||||
export function initTv(room: RoomEngine, screenMesh: BABYLON.Mesh) {
|
export function initTv(room: RoomEngine, screenMesh: BABYLON.Mesh) {
|
||||||
const tvProgramId = 'shopping';
|
const tvProgramId = 'shopping';
|
||||||
const tvProgram = TV_PROGRAMS[tvProgramId];
|
const tvProgram = TV_PROGRAMS[tvProgramId];
|
||||||
if (tvScreenMaterial == null) {
|
if (tvScreenMaterial == null) {
|
||||||
tvScreenMaterial = new BABYLON.StandardMaterial('tvScreenMaterial', room.scene);
|
tvScreenMaterial = new BABYLON.PBRMaterial('tvScreenMaterial', room.scene);
|
||||||
tvScreenMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0);
|
tvScreenMaterial.albedoColor = new BABYLON.Color3(0, 0, 0);
|
||||||
tvScreenMaterial.ambientColor = new BABYLON.Color3(0, 0, 0);
|
tvScreenMaterial.ambientColor = new BABYLON.Color3(0, 0, 0);
|
||||||
tvScreenMaterial.specularColor = new BABYLON.Color3(0, 0, 0);
|
tvScreenMaterial.roughness = 1;
|
||||||
tvScreenMaterial.emissiveTexture = new BABYLON.Texture(`/client-assets/room/tv/${tvProgramId}/${tvProgramId}.png`, room.scene, false, false);
|
tvScreenMaterial.emissiveTexture = new BABYLON.Texture(`/client-assets/room/tv/${tvProgramId}/${tvProgramId}.png`, room.scene, false, false);
|
||||||
tvScreenMaterial.emissiveTexture.level = 0.5;
|
tvScreenMaterial.emissiveTexture.level = 1.0;
|
||||||
tvScreenMaterial.emissiveColor = new BABYLON.Color3(0.4, 0.4, 0.4);
|
tvScreenMaterial.emissiveColor = new BABYLON.Color3(0.5, 0.5, 0.5);
|
||||||
tvScreenMaterial.freeze();
|
tvScreenMaterial.freeze();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user