Publish gravity fog through generic Eve fields
This commit is contained in:
parent
84429ad6eb
commit
6f0375f4ad
22 changed files with 293 additions and 230 deletions
|
|
@ -26,7 +26,7 @@ public sealed class AetheriaRenderSplatLayerRenderer : MonoBehaviour
|
|||
return false;
|
||||
}
|
||||
|
||||
public void Render(AetheriaRuntimeRenderSplatsViewportDocument document, int width, int height)
|
||||
public void Render(EveFieldsSplatsDocument document, int width, int height)
|
||||
{
|
||||
if (document == null) return;
|
||||
ResolveRenderer();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Eve.PluginFields;
|
||||
using UnityEngine;
|
||||
|
||||
public sealed class AetheriaSceneRenderSplatSource : MonoBehaviour
|
||||
|
|
@ -43,7 +44,7 @@ public sealed class AetheriaSceneRenderSplatSource : MonoBehaviour
|
|||
[SerializeField]
|
||||
private AetheriaSceneRenderSplatFixture[] fixtures = Array.Empty<AetheriaSceneRenderSplatFixture>();
|
||||
|
||||
public AetheriaRuntimeRenderSplatsViewportDocument BuildDocument(AetheriaRuntimeViewportBounds viewport)
|
||||
public EveFieldsSplatsDocument BuildDocument(AetheriaRuntimeViewportBounds viewport)
|
||||
{
|
||||
viewport ??= new AetheriaRuntimeViewportBounds();
|
||||
var normalizedViewport = Normalize(viewport);
|
||||
|
|
@ -58,13 +59,19 @@ public sealed class AetheriaSceneRenderSplatSource : MonoBehaviour
|
|||
foreach (var fixture in fixtures ?? Array.Empty<AetheriaSceneRenderSplatFixture>())
|
||||
fixture.AddTo(builder, layerIndices);
|
||||
|
||||
return new AetheriaRuntimeRenderSplatsViewportDocument
|
||||
return new EveFieldsSplatsDocument
|
||||
{
|
||||
PublishedAtUtc = DateTimeOffset.UtcNow.ToString("O"),
|
||||
SimulationTimeSeconds = Application.isPlaying ? Time.timeAsDouble : 0,
|
||||
RunId = "scene",
|
||||
ZoneName = string.IsNullOrWhiteSpace(documentName) ? gameObject.scene.name : documentName,
|
||||
Viewport = normalizedViewport,
|
||||
Viewport = new EveFieldsViewport
|
||||
{
|
||||
MinX = normalizedViewport.MinX,
|
||||
MinY = normalizedViewport.MinY,
|
||||
MaxX = normalizedViewport.MaxX,
|
||||
MaxY = normalizedViewport.MaxY
|
||||
},
|
||||
Layers = layers,
|
||||
Splats = builder.Build()
|
||||
};
|
||||
|
|
@ -81,7 +88,7 @@ public sealed class AetheriaSceneRenderSplatSource : MonoBehaviour
|
|||
};
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeRenderSplatLayerDefinition[] BuildLayers()
|
||||
private static EveFieldsSplatLayer[] BuildLayers()
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
|
|
@ -96,14 +103,14 @@ public sealed class AetheriaSceneRenderSplatSource : MonoBehaviour
|
|||
};
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeRenderSplatLayerDefinition Layer(
|
||||
private static EveFieldsSplatLayer Layer(
|
||||
string key,
|
||||
string displayName,
|
||||
int channel,
|
||||
string blendMode = AetheriaRuntimeRenderSplatBlendModes.Add,
|
||||
string graphicsFormat = "R16_SFloat")
|
||||
{
|
||||
return new AetheriaRuntimeRenderSplatLayerDefinition
|
||||
return new EveFieldsSplatLayer
|
||||
{
|
||||
LayerKey = key,
|
||||
DisplayName = displayName,
|
||||
|
|
@ -163,9 +170,9 @@ public sealed class AetheriaSceneRenderSplatSource : MonoBehaviour
|
|||
_sourceFlags.Add(splat.SourceFlags);
|
||||
}
|
||||
|
||||
public AetheriaRuntimeRenderSplatSoa Build()
|
||||
public EveFieldsSplatSoa Build()
|
||||
{
|
||||
return new AetheriaRuntimeRenderSplatSoa
|
||||
return new EveFieldsSplatSoa
|
||||
{
|
||||
Count = _centerX.Count,
|
||||
CenterX = _centerX.ToArray(),
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
using System;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Eve.PluginFields;
|
||||
using GameCult.Mesh;
|
||||
|
||||
public sealed class AetheriaUnityGameViewportDocuments : IDisposable
|
||||
{
|
||||
private readonly CultMeshReactiveDocument<AetheriaRuntimeZoneContactsDocument> _contacts;
|
||||
private readonly CultMeshReactiveDocument<AetheriaRuntimeObjectsViewportDocument> _objectsViewport;
|
||||
private readonly CultMeshReactiveDocument<AetheriaRuntimeRenderSplatsViewportDocument> _renderSplatsViewport;
|
||||
private readonly CultMeshReactiveDocument<EveFieldsSplatsDocument> _renderSplatsViewport;
|
||||
|
||||
private AetheriaUnityGameViewportDocuments(
|
||||
AetheriaClientState state,
|
||||
|
|
@ -30,7 +31,7 @@ public sealed class AetheriaUnityGameViewportDocuments : IDisposable
|
|||
|
||||
public AetheriaRuntimeZoneContactsDocument CurrentContacts => _contacts?.Current;
|
||||
public AetheriaRuntimeObjectsViewportDocument CurrentObjectsViewport => _objectsViewport?.Current;
|
||||
public AetheriaRuntimeRenderSplatsViewportDocument CurrentRenderSplatsViewport => _renderSplatsViewport?.Current;
|
||||
public EveFieldsSplatsDocument CurrentRenderSplatsViewport => _renderSplatsViewport?.Current;
|
||||
|
||||
public static AetheriaUnityGameViewportDocuments OpenMap(
|
||||
AetheriaClientState state,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Eve.PluginFields;
|
||||
using UnityEngine;
|
||||
|
||||
public sealed class AetheriaUnityRenderSplatViewportSource : MonoBehaviour
|
||||
|
|
@ -40,7 +41,7 @@ public sealed class AetheriaUnityRenderSplatViewportSource : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
public AetheriaRuntimeRenderSplatsViewportDocument CurrentDocument =>
|
||||
public EveFieldsSplatsDocument CurrentDocument =>
|
||||
_viewportDocuments?.CurrentRenderSplatsViewport;
|
||||
|
||||
public bool RenderInLateUpdate
|
||||
|
|
|
|||
Loading…
Reference in a new issue