Schedule Eve world effects through URP

This commit is contained in:
Meta Vens 2026-07-18 16:36:28 +01:00
commit b8259a8e52
8 changed files with 137 additions and 22 deletions

View file

@ -155,6 +155,15 @@ namespace GameCult.Eve.UnityScene.Tests
Assert.That(typeof(IEveUnityFieldsSplatsDocumentSource).GetEvent("FieldsSplatsAvailable"), Is.Not.Null);
}
[Test]
public void UrpRendererFeatureOwnsGenericWorldEffectScheduling()
{
Assert.That(typeof(EveUnityRendererFeature).IsSubclassOf(typeof(ScriptableRendererFeature)), Is.True);
AssertRenderOrder(typeof(EveUnityFieldsVolumeRenderer), 100);
AssertRenderOrder(typeof(EveUnityFieldsParticleRenderer), 200);
AssertRenderOrder(typeof(EveUnityAdaptiveExposureRenderer), 300);
}
[Test]
public void VolumeRendererCompositesBeforeProviderPostProcessing()
{
@ -163,6 +172,24 @@ namespace GameCult.Eve.UnityScene.Tests
Is.EqualTo(RenderPassEvent.BeforeRenderingPostProcessing));
}
private static void AssertRenderOrder(Type sourceType, int expected)
{
var schedulingInterface = sourceType.GetInterfaces().Single(type =>
string.Equals(type.Name, "IEveUnityRenderPassSource", StringComparison.Ordinal));
var property = schedulingInterface.GetProperty("RenderOrder");
Assert.That(property, Is.Not.Null);
var gameObject = new GameObject("eve-render-pass-order-test");
try
{
var component = gameObject.AddComponent(sourceType);
Assert.That(property!.GetValue(component), Is.EqualTo(expected));
}
finally
{
UnityEngine.Object.DestroyImmediate(gameObject);
}
}
[Test]
public void ParticleRendererExecutesProviderProgramWithoutProviderCode()
{