feat(envcell): CellHasTransparent predicate (shell-batching prep)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e27923b4b5
commit
f72f7ce1f4
1 changed files with 23 additions and 0 deletions
|
|
@ -1053,6 +1053,29 @@ public sealed unsafe class EnvCellRenderer : IDisposable
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// True if the cell's prepared snapshot has any transparent render batch.
|
||||
/// The pview shell pass uses this to skip the (heavy per-frame) transparent
|
||||
/// <see cref="Render"/> call for opaque-only cells — most cell geometry is
|
||||
/// opaque walls/floors/ceilings, so this removes the bulk of the per-cell
|
||||
/// transparent draws. Read-only; mirrors the [shell] probe's batch scan.
|
||||
/// </summary>
|
||||
public bool CellHasTransparent(uint cellId)
|
||||
{
|
||||
var snapshot = _activeSnapshot;
|
||||
if (snapshot is null || !snapshot.BatchedByCell.TryGetValue(cellId, out var gfxDict))
|
||||
return false;
|
||||
foreach (var (gfxObjId, transforms) in gfxDict)
|
||||
{
|
||||
if (transforms.Count == 0) continue;
|
||||
var rd = _meshManager.TryGetRenderData(gfxObjId);
|
||||
if (rd is null) continue;
|
||||
foreach (var b in rd.Batches)
|
||||
if (b.IsTransparent) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// GetCellLightSet (A7 Fix D D-2 helper)
|
||||
// Per-cell up-to-8 point lights, cached per frame. Camera-independent, like
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue