diff --git a/site/web/src/components/ReplayViewer.tsx b/site/web/src/components/ReplayViewer.tsx index d23b487..2979832 100644 --- a/site/web/src/components/ReplayViewer.tsx +++ b/site/web/src/components/ReplayViewer.tsx @@ -778,8 +778,9 @@ export default function ReplayViewer({ m, replay, sync }: Props) { vfxObjs.delete(i); vo = undefined; } - vo?.update(t, camUE); - if (!own) { + // 게임 효과가 지금 아무것도 그리지 않으면(효과가 짧게 끝나는 연막 등) 기본 모양을 대신 그린다 + const drew = vo?.update(t, camUE) ?? false; + if (!own && drew) { if (ov0) ov0.obj.visible = false; continue; } diff --git a/site/web/src/lib/vfx.ts b/site/web/src/lib/vfx.ts index c4cb417..d7810a0 100644 --- a/site/web/src/lib/vfx.ts +++ b/site/web/src/lib/vfx.ts @@ -713,7 +713,7 @@ function makeMaterial(db: VfxDb, name: string, o: MatOpts): THREE.ShaderMaterial uAST: { value: new THREE.Vector4(...mi.alphaST) }, uTime: { value: 0 }, uTint: { - value: o.overlay != null ? new THREE.Vector3().setFromColor(new THREE.Color(o.overlay)).multiplyScalar(1.6) : new THREE.Vector3(...mi.tint), + value: o.overlay != null ? new THREE.Vector3().setFromColor(new THREE.Color(o.overlay)).multiplyScalar(1.1) : new THREE.Vector3(...mi.tint), }, uFade: { value: o.overlay != null ? 0.35 : 1 }, uGrad: { value: mi.grad && !opaque ? 1 : 0 }, @@ -1344,7 +1344,10 @@ class SystemInst { this.scale = sc; const bigOf = (e: VEmitter) => (e.size?.[1]?.[0] ?? e.size?.[0]?.[0] ?? 0) * (sc[0] ?? 1); const domeLike = (e: VEmitter) => e.type === 'mesh' && bigOf(e) >= 5 && /smoke|nebula|dome|cover|wisp|sphere|shell/i.test(e.name + (e.mesh ?? '')); - const hasDome = !!DOME[agent] && sys.emitters.some((e) => domeLike(e) && /Opaque|Masked/.test(matInfo(db, e.material).blend)); + const solidDome = !!DOME[agent] && sys.emitters.some((e) => domeLike(e) && /Opaque|Masked/.test(matInfo(db, e.material).blend)); + // 불투명 돔이 없는 연막(오멘처럼 반투명 층으로만 된 것)은 가장 큰 돔 모양 하나를 몸으로 칠한다 + const softDome = !solidDome && DOME[agent] ? sys.emitters.filter(domeLike).sort((a, b) => bigOf(b) - bigOf(a))[0] : undefined; + const hasDome = solidDome || !!softDome; sys.emitters.forEach((e0, ei) => { // 줄기(beam)는 아직 못 그린다. 팀 구별 층(FoF)은 재질 그래프 없이는 통째로 붉게 덮여 뺀다 if (e0.type === 'beam' || /FoF/.test(e0.name)) return; @@ -1378,9 +1381,7 @@ class SystemInst { const domeC = DOME[agent]; const dome = domeC && - (mi.blend === 'BLEND_Opaque' || mi.blend === 'BLEND_Masked') && - big >= 5 && - /smoke|nebula|dome|cover|wisp|sphere|shell/i.test(e.name + e.mesh) + (e === softDome || ((mi.blend === 'BLEND_Opaque' || mi.blend === 'BLEND_Masked') && big >= 5 && /smoke|nebula|dome|cover|wisp|sphere|shell/i.test(e.name + e.mesh))) ? { ...domeC, // 가장자리 빛: 게임 데이터의 팀 색(적이면 붉은 것 등)이 있으면 그것, 없으면 몸 색을 밝게 @@ -1624,6 +1625,8 @@ export class VfxObject { if (fx.hidden || fx.role === 'disabled' || fx.role === 'target') continue; const key = spec.team === 'enemy' ? (fx.enemy ?? fx.ally) : (fx.ally ?? fx.enemy); if (!key || !db.systems[key] || SKIP_SYS.test(key)) continue; + // 아군용 · 적용이 따로 붙은 것(오멘 연막 DomeTwist_ALLY / _FOE 등)은 보는 쪽 것만 + if (spec.team === 'enemy' ? /_ALLY(_|$)/i.test(key) : /_(FOE|ENEMY)(_|$)/i.test(key)) continue; const t0 = spec.t0, end = spec.end; if (cellular && fx.role === 'patch') { @@ -1783,10 +1786,12 @@ export class VfxObject { return [a, b]; } - update(tMs: number, cam: THREE.Vector3) { + /** 그렸으면 true (메시나 입자가 하나라도 보임). false 면 뷰어가 기본 모양을 대신 그린다 */ + update(tMs: number, cam: THREE.Vector3): boolean { const sp = this.spec; // 메시: 생긴 뒤 사라질 때까지 (투사체는 날아가는 동안) const meshOn = tMs >= sp.t0 && tMs <= sp.end; + let drew = meshOn && this.meshes.length > 0; this.meshRoot.visible = meshOn; if (meshOn) { const pl = sp.placeAt(tMs); @@ -1811,8 +1816,9 @@ export class VfxObject { const tau = (tMs - s.on) / 1000; const stop = s.off == null ? null : (s.off - s.on) / 1000; const fixed = s.fixedAt === 'end' ? sp.placeAt(sp.end) : s.fixedAt === 'start' ? sp.placeAt(sp.t0) : null; - inst.update(tau, stop, fixed ? () => fixed : (sec) => sp.placeAt(s.on + sec * 1000), cam, s.fixedAt ? 0 : sp.speed); + if (inst.update(tau, stop, fixed ? () => fixed : (sec) => sp.placeAt(s.on + sec * 1000), cam, s.fixedAt ? 0 : sp.speed)) drew = true; }); + return drew; } dispose() {