Reconcile volumetric fields after surface arrival

This commit is contained in:
Meta Vens 2026-07-15 17:31:02 +01:00
commit 37d9f993e1
4 changed files with 47 additions and 1 deletions

View file

@ -25,6 +25,7 @@ namespace GameCult.Eve.UnityScene.Fields
public long PresentedFrameId { get; private set; } = -1;
public int PresentedLayerCount => _targets.Count(target => target.TargetTexture != null);
public long CompositeCount { get; private set; }
public void Bind(EveUnityPlayableWorldClientHost host, IEveUnityFieldsSplatsDocumentSource? source)
{
@ -77,6 +78,7 @@ namespace GameCult.Eve.UnityScene.Fields
if (_host == null || _document == null || camera == null ||
_host.ActiveCameraTransform != camera.transform)
return;
if (PresentedLayerCount == 0) RenderLayers(_document);
var field = ActiveField();
if (field == null || !EnsureMaterial(field)) return;
ApplyFieldBindings(field, _document);
@ -113,6 +115,7 @@ namespace GameCult.Eve.UnityScene.Fields
_commands.SetRenderTarget(BuiltinRenderTextureType.CameraTarget);
_commands.DrawProcedural(Matrix4x4.identity, _material!, compositePass, MeshTopology.Triangles, 3, 1);
context.ExecuteCommandBuffer(_commands);
CompositeCount++;
}
private EveUnityFieldVolumeProjection? ActiveField() =>
@ -218,6 +221,7 @@ namespace GameCult.Eve.UnityScene.Fields
_sourceShader = null;
_activeNodeId = "";
PresentedFrameId = -1;
CompositeCount = 0;
}
private void SetMatrix(EveUnityFieldVolumeProjection field, string propKey, Matrix4x4 value)

View file

@ -1,7 +1,7 @@
{
"name": "org.gamecult.eve.unity-scene",
"displayName": "Eve Unity Scene Lowering",
"version": "0.3.33",
"version": "0.3.34",
"unity": "2021.3",
"description": "Provider-agnostic Unity scene shell for gamecult.eve.surface.v1 interactive world surfaces.",
"dependencies": {