using AcDream.App.Rendering.Wb; using AcDream.Core.Meshing; using Xunit; namespace AcDream.Core.Tests.Rendering.Wb; /// /// A.5 T21: lock in the depth-write attribution per translucency kind. /// /// WbDrawDispatcher.Draw uses a two-pass structure: /// /// Opaque pass — DepthMask(true): writes depth so that /// later transparent geometry sorts correctly against solid surfaces. /// Transparent pass — DepthMask(false): reads depth but /// does NOT write it, so alpha-blended surfaces don't occlude each /// other by Z-fighting. /// /// The partition that decides which pass a batch enters is /// : /// Opaque and ClipMap go to the opaque pass (depth write); /// AlphaBlend, Additive, InvAlpha go to the /// transparent pass (no depth write). /// /// public sealed class WbDispatcherDepthMaskTests { [Theory] [InlineData(TranslucencyKind.Opaque, true)] // opaque pass — depth write [InlineData(TranslucencyKind.ClipMap, true)] // foliage — depth write (binary alpha / A2C) [InlineData(TranslucencyKind.AlphaBlend, false)] // transparent — no depth write [InlineData(TranslucencyKind.Additive, false)] [InlineData(TranslucencyKind.InvAlpha, false)] public void IsOpaquePartition_ImpliesDepthWriteAttribution( TranslucencyKind kind, bool expectsDepthWrite) { bool isOpaque = WbDrawDispatcher.IsOpaquePublic(kind); Assert.Equal(expectsDepthWrite, isOpaque); } }