1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-07-30 05:44:36 +02:00
This commit is contained in:
syuilo
2026-07-28 10:47:40 +09:00
parent f53b50ee54
commit 86762db14e
4 changed files with 24 additions and 15 deletions

View File

@@ -37,6 +37,7 @@ export class LobbyEnvManager extends WorldEnvManager {
this.skyboxMat.disableLighting = true;
this.skybox.material = this.skyboxMat;
this.skybox.infiniteDistance = true;
this.engine.gl!.addExcludedMesh(this.skybox);
const ambientLight1 = new BABYLON.HemisphericLight('ambientLight1', new BABYLON.Vector3(0, 1, 0), this.engine.scene);
ambientLight1.diffuse = new BABYLON.Color3(1.0, 0.9, 0.8);
@@ -372,16 +373,17 @@ export class LobbyEnvManager extends WorldEnvManager {
this.engine.sr.updateMesh([worldRingH, ...worldRingH.getChildMeshes(), worldRingM, ...worldRingM.getChildMeshes()], false);
}, 100);
const sphere = this.meshes.find(m => m.name.includes('__DOME__'));
const texture = new BABYLON.CustomProceduralTexture('texture', '/client-assets/world/envs/lobby/shaders/bg', 4096, this.engine.scene);
texture.hasAlpha = true;
texture.wrapU = BABYLON.Texture.MIRROR_ADDRESSMODE;
texture.wrapV = BABYLON.Texture.MIRROR_ADDRESSMODE;
sphere.material = new BABYLON.StandardMaterial('sphereMat', this.engine.scene);
(sphere.material as BABYLON.StandardMaterial).diffuseTexture = texture;
(sphere.material as BABYLON.StandardMaterial).emissiveColor = new BABYLON.Color3(1, 1, 1);
(sphere.material as BABYLON.StandardMaterial).disableLighting = true;
(sphere.material as BABYLON.StandardMaterial).useAlphaFromDiffuseTexture = true;
const dome = this.meshes.find(m => m.name.includes('__DOME__'));
const domeTexture = new BABYLON.CustomProceduralTexture('texture', '/client-assets/world/envs/lobby/shaders/bg', 4096, this.engine.scene);
domeTexture.hasAlpha = true;
domeTexture.wrapU = BABYLON.Texture.MIRROR_ADDRESSMODE;
domeTexture.wrapV = BABYLON.Texture.MIRROR_ADDRESSMODE;
dome.material = new BABYLON.StandardMaterial('sphereMat', this.engine.scene);
(dome.material as BABYLON.StandardMaterial).diffuseTexture = domeTexture;
(dome.material as BABYLON.StandardMaterial).emissiveColor = new BABYLON.Color3(1, 1, 1);
(dome.material as BABYLON.StandardMaterial).disableLighting = true;
(dome.material as BABYLON.StandardMaterial).useAlphaFromDiffuseTexture = true;
//this.engine.gl!.addExcludedMesh(dome);
const screenMeshes = this.meshes.filter(m => m.name.includes('__SCREEN__'));
const screenMaterial = screenMeshes[0].material as BABYLON.PBRMaterial;

View File

@@ -78,15 +78,22 @@ uniform float time;
void main(void) {
vec2 uv = gl_FragCoord.xy / vec2(4096.0, 4096.0);
float noise = snoise(vec3(uv.x * 3.0, uv.y * 3.0, time * 0.05));
float radius = 0.001;
float spacing = 0.01;
float noise = snoise(vec3((uv.x * 3.0) + (time * 0.05), uv.y * 3.0, time * 0.01));
noise = max(0.0, noise - 0.5) * 2.0;
noise = min(1.0, noise * 1.5);
float radius = 0.0015;
float spacing = 0.02;
float x = mod(uv.x, spacing);
float y = mod(uv.y, spacing);
float dist = sqrt((x - spacing / 2.0) * (x - spacing / 2.0) + (y - spacing / 2.0) * (y - spacing / 2.0));
if (dist < radius) {
gl_FragColor = vec4(1.0, 1.0, 1.0, max(0.0, noise - 0.5) * 2.0);
gl_FragColor = vec4(1.0, 1.0, 1.0, noise);
} else {
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
gl_FragColor = vec4(1.0, 1.0, 1.0, 0.0);
}
//gl_FragColor = vec4(noise, noise, noise, 1.0);
//vec2 uv = gl_FragCoord.xy / vec2(4096.0, 4096.0);
//gl_FragColor = vec4(uv.x, uv.y, 0.0, 1.0);
}