mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-13 22:15:41 +02:00
wip
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
Binary file not shown.
@@ -1612,9 +1612,9 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
||||
}
|
||||
|
||||
this.sr.disableSnapshotRendering();
|
||||
if (this.gl != null) {
|
||||
this.gl.isEnabled = false; // 重いので切る
|
||||
}
|
||||
//if (this.gl != null) {
|
||||
// this.gl.isEnabled = false; // 重いので切る
|
||||
//}
|
||||
|
||||
if (this.gridPlane.material == null) {
|
||||
import('@babylonjs/materials').then(m => {
|
||||
@@ -1639,9 +1639,9 @@ export class RoomEngine extends EventEmitter<RoomEngineEvents> {
|
||||
await this.bake();
|
||||
|
||||
this.sr.enableSnapshotRendering();
|
||||
if (this.gl != null) {
|
||||
this.gl.isEnabled = true;
|
||||
}
|
||||
//if (this.gl != null) {
|
||||
// this.gl.isEnabled = true;
|
||||
//}
|
||||
}
|
||||
|
||||
public async bake() {
|
||||
|
||||
@@ -27,7 +27,7 @@ export const electronicDisplayBoard = defineObject({
|
||||
},
|
||||
default: {
|
||||
text: 'Hello, Misskey!',
|
||||
frameColor: [0.2, 0.2, 0.2],
|
||||
frameColor: [0.05, 0.05, 0.05],
|
||||
ledColor: [1, 1, 1],
|
||||
},
|
||||
},
|
||||
@@ -44,6 +44,7 @@ export const electronicDisplayBoard = defineObject({
|
||||
const texLoading = Promise.withResolvers<void>();
|
||||
|
||||
const tex = new BABYLON.Texture('/client-assets/room/textures/dot-matrix-chars.png', scene, false, false, undefined, () => {
|
||||
tex.level = 2;
|
||||
textMaterial.emissiveTexture = tex;
|
||||
textMaterial.albedoTexture = tex;
|
||||
textMaterial.disableLighting = true;
|
||||
@@ -68,6 +69,7 @@ export const electronicDisplayBoard = defineObject({
|
||||
const textManager = new RecyvlingTextGrid(displayMesh, maxChars, {
|
||||
meshFlipped: true,
|
||||
material: textMaterial,
|
||||
charUScale: 1.15,
|
||||
});
|
||||
|
||||
model.bakeExcludeMeshes = [displayMesh];
|
||||
|
||||
@@ -392,6 +392,7 @@ export class RecyvlingTextGrid {
|
||||
private currentText = '';
|
||||
private meshFlipped: boolean;
|
||||
private repeatSeparator: string;
|
||||
private charUScale: number;
|
||||
|
||||
/* (non-flipped)
|
||||
a d--e
|
||||
@@ -416,6 +417,7 @@ export class RecyvlingTextGrid {
|
||||
meshFlipped: boolean;
|
||||
material: BABYLON.StandardMaterial;
|
||||
repeatSeparator?: string;
|
||||
charUScale?: number;
|
||||
}) {
|
||||
this.mesh = mesh;
|
||||
this.mesh.material = options.material;
|
||||
@@ -426,6 +428,7 @@ export class RecyvlingTextGrid {
|
||||
this.uvs = mesh.getVerticesData(BABYLON.VertexBuffer.UVKind)!;
|
||||
this.meshFlipped = options.meshFlipped;
|
||||
this.repeatSeparator = options.repeatSeparator ?? ' ■ ';
|
||||
this.charUScale = options.charUScale ?? 1;
|
||||
|
||||
for (let j = 0; j < (this.verticesCountPerFace * 2); j += 2) {
|
||||
const x = this.uvs[j];
|
||||
@@ -515,14 +518,14 @@ export class RecyvlingTextGrid {
|
||||
const uvIndex = i * (this.verticesCountPerFace * 2); // uvは(x,y)の2要素なので*2
|
||||
|
||||
if (this.meshFlipped) {
|
||||
this.uvs[uvIndex + this.aIndex + 0] = this.uvs[uvIndex + this.cIndex + 0] = this.uvs[uvIndex + this.eIndex + 0] = (charX + 0) / TEXT_TEXTURE_CHAR_COLS;
|
||||
this.uvs[uvIndex + this.aIndex + 0] = this.uvs[uvIndex + this.cIndex + 0] = this.uvs[uvIndex + this.eIndex + 0] = ((charX + 0) / TEXT_TEXTURE_CHAR_COLS) - ((1 / TEXT_TEXTURE_CHAR_COLS) * (1 - this.charUScale));
|
||||
this.uvs[uvIndex + this.aIndex + 1] = this.uvs[uvIndex + this.bIndex + 1] = this.uvs[uvIndex + this.dIndex + 1] = (charY + 0) / TEXT_TEXTURE_CHAR_ROWS;
|
||||
this.uvs[uvIndex + this.bIndex + 0] = this.uvs[uvIndex + this.dIndex + 0] = this.uvs[uvIndex + this.fIndex + 0] = (charX + 1) / TEXT_TEXTURE_CHAR_COLS;
|
||||
this.uvs[uvIndex + this.bIndex + 0] = this.uvs[uvIndex + this.dIndex + 0] = this.uvs[uvIndex + this.fIndex + 0] = ((charX + 1) / TEXT_TEXTURE_CHAR_COLS) + ((1 / TEXT_TEXTURE_CHAR_COLS) * (1 - this.charUScale));
|
||||
this.uvs[uvIndex + this.cIndex + 1] = this.uvs[uvIndex + this.eIndex + 1] = this.uvs[uvIndex + this.fIndex + 1] = (charY + 1) / TEXT_TEXTURE_CHAR_ROWS;
|
||||
} else {
|
||||
this.uvs[uvIndex + this.aIndex + 0] = this.uvs[uvIndex + this.dIndex + 0] = this.uvs[uvIndex + this.bIndex + 0] = (charX + 0) / TEXT_TEXTURE_CHAR_COLS;
|
||||
this.uvs[uvIndex + this.aIndex + 0] = this.uvs[uvIndex + this.dIndex + 0] = this.uvs[uvIndex + this.bIndex + 0] = ((charX + 0) / TEXT_TEXTURE_CHAR_COLS) - ((1 / TEXT_TEXTURE_CHAR_COLS) * (1 - this.charUScale));
|
||||
this.uvs[uvIndex + this.aIndex + 1] = this.uvs[uvIndex + this.dIndex + 1] = this.uvs[uvIndex + this.eIndex + 1] = (charY + 0) / TEXT_TEXTURE_CHAR_ROWS;
|
||||
this.uvs[uvIndex + this.eIndex + 0] = this.uvs[uvIndex + this.fIndex + 0] = this.uvs[uvIndex + this.cIndex + 0] = (charX + 1) / TEXT_TEXTURE_CHAR_COLS;
|
||||
this.uvs[uvIndex + this.eIndex + 0] = this.uvs[uvIndex + this.fIndex + 0] = this.uvs[uvIndex + this.cIndex + 0] = ((charX + 1) / TEXT_TEXTURE_CHAR_COLS) + ((1 / TEXT_TEXTURE_CHAR_COLS) * (1 - this.charUScale));
|
||||
this.uvs[uvIndex + this.bIndex + 1] = this.uvs[uvIndex + this.cIndex + 1] = this.uvs[uvIndex + this.fIndex + 1] = (charY + 1) / TEXT_TEXTURE_CHAR_ROWS;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user