Integrate CultMesh UI and URP cleanup
This commit is contained in:
parent
932cc9f906
commit
4d7bb65868
131 changed files with 7209 additions and 5084 deletions
|
|
@ -39,12 +39,12 @@ export type AetheriaRuntimeViewportFeedRequest = {
|
|||
|
||||
export type AetheriaRuntimeViewportFeedSnapshot = {
|
||||
viewport: ViewportResponse;
|
||||
selectedObject: SelectedObjectProjection | null;
|
||||
inventory: InventoryProjection | null;
|
||||
daemonHealth: DaemonHealthProjection;
|
||||
authorityStatus: AuthorityStatusProjection;
|
||||
starbridgeSession: StarbridgeSessionProjection;
|
||||
assetManifest: AssetManifestProjection;
|
||||
selectedObject: SelectedObjectDocument | null;
|
||||
inventory: InventoryDocument | null;
|
||||
daemonHealth: DaemonHealthDocument;
|
||||
authorityStatus: AuthorityStatusDocument;
|
||||
starbridgeSession: StarbridgeSessionDocument;
|
||||
assetManifest: AssetManifestDocument;
|
||||
receivedAtUtc: string;
|
||||
sampleMs: number;
|
||||
};
|
||||
|
|
@ -130,7 +130,7 @@ export type InventoryItem = {
|
|||
iconAsset: AssetRef;
|
||||
};
|
||||
|
||||
export type SelectedObjectProjection = {
|
||||
export type SelectedObjectDocument = {
|
||||
schema: string;
|
||||
frameId: number;
|
||||
runId: string;
|
||||
|
|
@ -139,7 +139,7 @@ export type SelectedObjectProjection = {
|
|||
selected: ViewObject | null;
|
||||
};
|
||||
|
||||
export type InventoryProjection = {
|
||||
export type InventoryDocument = {
|
||||
schema: string;
|
||||
frameId: number;
|
||||
runId: string;
|
||||
|
|
@ -151,7 +151,7 @@ export type InventoryProjection = {
|
|||
cargo: InventoryItem[];
|
||||
};
|
||||
|
||||
export type DaemonHealthProjection = {
|
||||
export type DaemonHealthDocument = {
|
||||
schema: string;
|
||||
daemonId: string;
|
||||
verseId: string;
|
||||
|
|
@ -167,7 +167,7 @@ export type DaemonHealthProjection = {
|
|||
commandBoundaryPath: string;
|
||||
};
|
||||
|
||||
export type AuthorityStatusProjection = {
|
||||
export type AuthorityStatusDocument = {
|
||||
schema: string;
|
||||
verseId: string;
|
||||
policyId: string;
|
||||
|
|
@ -175,10 +175,10 @@ export type AuthorityStatusProjection = {
|
|||
hostRuntimeId: string;
|
||||
defaultMode: string;
|
||||
updatedAtUtc: string;
|
||||
rules: AuthorityRuleProjection[];
|
||||
rules: AuthorityRuleDocument[];
|
||||
};
|
||||
|
||||
export type AuthorityRuleProjection = {
|
||||
export type AuthorityRuleDocument = {
|
||||
ruleId: string;
|
||||
subjectPrefix: string;
|
||||
claimKinds: string[];
|
||||
|
|
@ -188,7 +188,7 @@ export type AuthorityRuleProjection = {
|
|||
priority: number;
|
||||
};
|
||||
|
||||
export type StarbridgeSessionProjection = {
|
||||
export type StarbridgeSessionDocument = {
|
||||
schema: string;
|
||||
frameId: number;
|
||||
publishedAtUtc: string;
|
||||
|
|
@ -200,13 +200,13 @@ export type StarbridgeSessionProjection = {
|
|||
zoneName: string;
|
||||
phase: string;
|
||||
currentWaveIndex: number;
|
||||
baseStatus: StarbridgeBaseStatusProjection;
|
||||
stationStock: StarbridgeStationStockItemProjection[];
|
||||
waveForecast: StarbridgeWaveForecastProjection[];
|
||||
runtimeRoles: StarbridgeRuntimeRoleProjection[];
|
||||
baseStatus: StarbridgeBaseStatusDocument;
|
||||
stationStock: StarbridgeStationStockItemDocument[];
|
||||
waveForecast: StarbridgeWaveForecastDocument[];
|
||||
runtimeRoles: StarbridgeRuntimeRoleDocument[];
|
||||
};
|
||||
|
||||
export type StarbridgeBaseStatusProjection = {
|
||||
export type StarbridgeBaseStatusDocument = {
|
||||
entityKey: string;
|
||||
displayName: string;
|
||||
hull: number;
|
||||
|
|
@ -215,7 +215,7 @@ export type StarbridgeBaseStatusProjection = {
|
|||
isActive: boolean;
|
||||
};
|
||||
|
||||
export type StarbridgeStationStockItemProjection = {
|
||||
export type StarbridgeStationStockItemDocument = {
|
||||
itemKey: string;
|
||||
quantity: number;
|
||||
quality: number;
|
||||
|
|
@ -224,7 +224,7 @@ export type StarbridgeStationStockItemProjection = {
|
|||
iconAsset: AssetRef;
|
||||
};
|
||||
|
||||
export type AssetManifestProjection = {
|
||||
export type AssetManifestDocument = {
|
||||
schema: string;
|
||||
publishedAtUtc: string;
|
||||
runId: string;
|
||||
|
|
@ -250,7 +250,7 @@ export type AssetRef = {
|
|||
metadata: Record<string, string>;
|
||||
};
|
||||
|
||||
export type StarbridgeWaveForecastProjection = {
|
||||
export type StarbridgeWaveForecastDocument = {
|
||||
waveIndex: number;
|
||||
displayName: string;
|
||||
attackerKeys: string[];
|
||||
|
|
@ -258,7 +258,7 @@ export type StarbridgeWaveForecastProjection = {
|
|||
recoveredTechnologyKeys: string[];
|
||||
};
|
||||
|
||||
export type StarbridgeRuntimeRoleProjection = {
|
||||
export type StarbridgeRuntimeRoleDocument = {
|
||||
runtimeId: string;
|
||||
role: string;
|
||||
entityKey: string;
|
||||
|
|
@ -294,12 +294,12 @@ export type AetheriaRtsApi = {
|
|||
mapViewport(request: Viewport): Promise<ViewportResponse>;
|
||||
objectsViewport(request: Viewport): Promise<ObjectsViewportResponse>;
|
||||
gravityViewport(request: Viewport): Promise<GravityViewportResponse>;
|
||||
selectedObject(request: AetheriaRuntimeSelectedObjectRequest): Promise<SelectedObjectProjection>;
|
||||
inventory(request: AetheriaRuntimeSelectedObjectRequest): Promise<InventoryProjection>;
|
||||
daemonHealth(): Promise<DaemonHealthProjection>;
|
||||
authorityStatus(): Promise<AuthorityStatusProjection>;
|
||||
starbridgeSession(): Promise<StarbridgeSessionProjection>;
|
||||
assetManifest(): Promise<AssetManifestProjection>;
|
||||
selectedObject(request: AetheriaRuntimeSelectedObjectRequest): Promise<SelectedObjectDocument>;
|
||||
inventory(request: AetheriaRuntimeSelectedObjectRequest): Promise<InventoryDocument>;
|
||||
daemonHealth(): Promise<DaemonHealthDocument>;
|
||||
authorityStatus(): Promise<AuthorityStatusDocument>;
|
||||
starbridgeSession(): Promise<StarbridgeSessionDocument>;
|
||||
assetManifest(): Promise<AssetManifestDocument>;
|
||||
watchViewportFeed(request: AetheriaRuntimeViewportFeedRequest, callback: (snapshot: AetheriaRuntimeViewportFeedSnapshot) => void): () => void;
|
||||
setMoveVector(request: AetheriaRuntimeSetMoveVectorRequest): Promise<AetheriaRuntimeDaemonCommandReceipt>;
|
||||
setTarget(request: AetheriaRuntimeSetTargetRequest): Promise<AetheriaRuntimeDaemonCommandReceipt>;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import type {
|
||||
AetheriaRtsApi,
|
||||
AuthorityStatusProjection,
|
||||
AuthorityStatusDocument,
|
||||
AetheriaRuntimeViewportFeedSnapshot,
|
||||
BodyView,
|
||||
DaemonHealthProjection,
|
||||
DaemonHealthDocument,
|
||||
GravityInfluence,
|
||||
InventoryItem,
|
||||
InventoryProjection,
|
||||
SelectedObjectProjection,
|
||||
StarbridgeSessionProjection,
|
||||
InventoryDocument,
|
||||
SelectedObjectDocument,
|
||||
StarbridgeSessionDocument,
|
||||
ViewObject,
|
||||
Viewport,
|
||||
ViewportResponse,
|
||||
|
|
@ -38,11 +38,11 @@ let centerX = 0;
|
|||
let centerY = 0;
|
||||
let selectedEntityIndex = -1;
|
||||
let latest: ViewportResponse | null = null;
|
||||
let latestSelected: SelectedObjectProjection | null = null;
|
||||
let latestInventory: InventoryProjection | null = null;
|
||||
let latestDaemonHealth: DaemonHealthProjection | null = null;
|
||||
let latestAuthority: AuthorityStatusProjection | null = null;
|
||||
let latestStarbridge: StarbridgeSessionProjection | null = null;
|
||||
let latestSelected: SelectedObjectDocument | null = null;
|
||||
let latestInventory: InventoryDocument | null = null;
|
||||
let latestDaemonHealth: DaemonHealthDocument | null = null;
|
||||
let latestAuthority: AuthorityStatusDocument | null = null;
|
||||
let latestStarbridge: StarbridgeSessionDocument | null = null;
|
||||
let latestSurfaceIndex: Awaited<ReturnType<AetheriaRtsApi["surfaceCatalogIndex"]>> | null = null;
|
||||
let latestOperationReceipt: string | null = null;
|
||||
let latestReceivedAt = 0;
|
||||
|
|
@ -554,7 +554,7 @@ function surfaceListText(surfaces: ReadonlyArray<{
|
|||
.join(", ");
|
||||
}
|
||||
|
||||
function stockText(session: StarbridgeSessionProjection): string {
|
||||
function stockText(session: StarbridgeSessionDocument): string {
|
||||
if (session.stationStock.length === 0) {
|
||||
return "empty";
|
||||
}
|
||||
|
|
@ -565,7 +565,7 @@ function stockText(session: StarbridgeSessionProjection): string {
|
|||
.join(", ");
|
||||
}
|
||||
|
||||
function waveText(session: StarbridgeSessionProjection): string {
|
||||
function waveText(session: StarbridgeSessionDocument): string {
|
||||
const wave = session.waveForecast[0];
|
||||
if (!wave) {
|
||||
return "none";
|
||||
|
|
@ -575,7 +575,7 @@ function waveText(session: StarbridgeSessionProjection): string {
|
|||
return `${wave.displayName || `Wave ${wave.waveIndex}`}${attackers}`;
|
||||
}
|
||||
|
||||
function roleText(session: StarbridgeSessionProjection): string {
|
||||
function roleText(session: StarbridgeSessionDocument): string {
|
||||
if (session.runtimeRoles.length === 0) {
|
||||
return "none";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,45 +18,45 @@ import {
|
|||
AetheriaRtsSchemas,
|
||||
createAetheriaRuntimeRtsDocuments,
|
||||
createAetheriaRuntimeRtsOperationHandles,
|
||||
createAetheriaRuntimeRtsVerseFacade,
|
||||
createAetheriaRuntimeRtsVerseHandles,
|
||||
createAetheriaRuntimeRtsQueryHandles,
|
||||
describeAetheriaRuntimeRtsLiveFeedSurface,
|
||||
describeAetheriaRuntimeRtsQueryHandles,
|
||||
describeAetheriaRuntimeRtsSurfaceCatalog,
|
||||
type AetheriaRuntimeDaemonCommandReceipt,
|
||||
type AssetManifestProjection,
|
||||
type AuthorityStatusProjection,
|
||||
type DaemonHealthProjection,
|
||||
type AssetManifestDocument,
|
||||
type AuthorityStatusDocument,
|
||||
type DaemonHealthDocument,
|
||||
type GravityViewportResponse,
|
||||
type InventoryProjection,
|
||||
type InventoryDocument,
|
||||
type ObjectsViewportResponse,
|
||||
type AetheriaRuntimeRtsLiveFeedDiagnostic,
|
||||
type AetheriaRuntimeRtsProjectionDiagnostic,
|
||||
type AetheriaRuntimeRtsQueryDiagnostic,
|
||||
type AetheriaRuntimeRtsSurfaceCatalogDiagnostic,
|
||||
type AetheriaRuntimeRtsOperationHandles,
|
||||
type AetheriaRuntimeRtsVerseFacade,
|
||||
type AetheriaRuntimeRtsVerseHandles,
|
||||
type AetheriaRuntimeRtsDocuments,
|
||||
type AetheriaRuntimeViewportFeedRequest,
|
||||
type AetheriaRuntimeViewportFeedSnapshot,
|
||||
type RtsSetMoveVectorRequest,
|
||||
type RtsSetTargetRequest,
|
||||
type SelectedObjectProjection,
|
||||
type SelectedObjectDocument,
|
||||
type SelectedObjectRequest,
|
||||
type StarbridgeSessionProjection,
|
||||
type StarbridgeSessionDocument,
|
||||
type ViewportRequest,
|
||||
type ViewportResponse,
|
||||
} from "./aetheria-rts-bindings.js";
|
||||
import {
|
||||
projectAuthorityStatus,
|
||||
projectAssetManifest,
|
||||
projectDaemonHealth,
|
||||
projectGravityViewportFromFrame,
|
||||
projectInventoryFromFrame,
|
||||
projectObjectsViewportFromFrame,
|
||||
projectSelectedObjectFromFrame,
|
||||
projectStarbridgeSessionSummary,
|
||||
projectViewportFromFrame,
|
||||
} from "./aetheria-rts-local-projection.js";
|
||||
readAuthorityStatusDocument,
|
||||
readAssetManifestDocument,
|
||||
readDaemonHealthDocument,
|
||||
buildGravityViewportDocumentFromFrame,
|
||||
buildInventoryDocumentFromFrame,
|
||||
buildObjectsViewportDocumentFromFrame,
|
||||
buildSelectedObjectDocumentFromFrame,
|
||||
readStarbridgeSessionSummaryDocument,
|
||||
buildViewportDocumentFromFrame,
|
||||
} from "./aetheria-rts-local-documents.js";
|
||||
|
||||
const connectionId = 0x43554c54;
|
||||
|
||||
|
|
@ -81,9 +81,9 @@ export type {
|
|||
AetheriaRuntimeViewportFeedSnapshot,
|
||||
RtsSetMoveVectorRequest,
|
||||
RtsSetTargetRequest,
|
||||
SelectedObjectProjection,
|
||||
SelectedObjectDocument,
|
||||
SelectedObjectRequest,
|
||||
StarbridgeSessionProjection,
|
||||
StarbridgeSessionDocument,
|
||||
ViewObject,
|
||||
ViewportRequest,
|
||||
ViewportResponse,
|
||||
|
|
@ -121,15 +121,15 @@ export class AetheriaCultMeshClient {
|
|||
},
|
||||
);
|
||||
const executors = {
|
||||
mapViewport: async (request: ViewportRequest) => projectViewportFromFrame(await this.fetchLatestFrameDocument(), request),
|
||||
objectsViewport: async (request: ViewportRequest) => projectObjectsViewportFromFrame(await this.fetchLatestFrameDocument(), request),
|
||||
gravityViewport: async (request: ViewportRequest) => projectGravityViewportFromFrame(await this.fetchLatestFrameDocument(), request),
|
||||
selectedObject: async (request: SelectedObjectRequest) => projectSelectedObjectFromFrame(await this.fetchLatestFrameDocument(), request),
|
||||
inventory: async (request: SelectedObjectRequest) => projectInventoryFromFrame(await this.fetchLatestFrameDocument(), request),
|
||||
daemonHealth: async () => projectDaemonHealth(await this.fetchDaemonHealthDocument()),
|
||||
authorityStatus: async () => projectAuthorityStatus(await this.fetchAuthorityPolicyDocument()),
|
||||
starbridgeSession: async () => projectStarbridgeSessionSummary(await this.fetchStarbridgeSessionSummaryDocument()),
|
||||
assetManifest: async () => projectAssetManifest(await this.fetchAssetManifestDocument()),
|
||||
mapViewport: async (request: ViewportRequest) => buildViewportDocumentFromFrame(await this.fetchLatestFrameDocument(), request),
|
||||
objectsViewport: async (request: ViewportRequest) => buildObjectsViewportDocumentFromFrame(await this.fetchLatestFrameDocument(), request),
|
||||
gravityViewport: async (request: ViewportRequest) => buildGravityViewportDocumentFromFrame(await this.fetchLatestFrameDocument(), request),
|
||||
selectedObject: async (request: SelectedObjectRequest) => buildSelectedObjectDocumentFromFrame(await this.fetchLatestFrameDocument(), request),
|
||||
inventory: async (request: SelectedObjectRequest) => buildInventoryDocumentFromFrame(await this.fetchLatestFrameDocument(), request),
|
||||
daemonHealth: async () => readDaemonHealthDocument(await this.fetchDaemonHealthDocument()),
|
||||
authorityStatus: async () => readAuthorityStatusDocument(await this.fetchAuthorityPolicyDocument()),
|
||||
starbridgeSession: async () => readStarbridgeSessionSummaryDocument(await this.fetchStarbridgeSessionSummaryDocument()),
|
||||
assetManifest: async () => readAssetManifestDocument(await this.fetchAssetManifestDocument()),
|
||||
};
|
||||
this.queries = createAetheriaRuntimeRtsQueryHandles(
|
||||
executors,
|
||||
|
|
@ -159,7 +159,7 @@ export class AetheriaCultMeshClient {
|
|||
(commandId, issuedAtUtc, command, context) =>
|
||||
this.sendCommandDocument(commandId, issuedAtUtc, command, context),
|
||||
);
|
||||
this.aetheria = createAetheriaRuntimeRtsVerseFacade(
|
||||
this.aetheria = createAetheriaRuntimeRtsVerseHandles(
|
||||
this.queryVerse.context,
|
||||
this.commandVerse.context,
|
||||
this.queries,
|
||||
|
|
@ -173,7 +173,7 @@ export class AetheriaCultMeshClient {
|
|||
private readonly queries: ReturnType<typeof createAetheriaRuntimeRtsQueryHandles>;
|
||||
private readonly documents: AetheriaRuntimeRtsDocuments;
|
||||
private readonly operations: AetheriaRuntimeRtsOperationHandles;
|
||||
private readonly aetheria: AetheriaRuntimeRtsVerseFacade;
|
||||
private readonly aetheria: AetheriaRuntimeRtsVerseHandles;
|
||||
|
||||
public async close(): Promise<void> {
|
||||
this.#peer?.close();
|
||||
|
|
@ -208,31 +208,31 @@ export class AetheriaCultMeshClient {
|
|||
return this.aetheria.zone().gravity.within(request);
|
||||
}
|
||||
|
||||
public async selectedObject(request: SelectedObjectRequest): Promise<SelectedObjectProjection> {
|
||||
public async selectedObject(request: SelectedObjectRequest): Promise<SelectedObjectDocument> {
|
||||
return this.aetheria.selectedObject(request.entityIndex);
|
||||
}
|
||||
|
||||
public async inventory(request: SelectedObjectRequest): Promise<InventoryProjection> {
|
||||
public async inventory(request: SelectedObjectRequest): Promise<InventoryDocument> {
|
||||
return this.aetheria.inventory(request.entityIndex);
|
||||
}
|
||||
|
||||
public async daemonHealth(): Promise<DaemonHealthProjection> {
|
||||
public async daemonHealth(): Promise<DaemonHealthDocument> {
|
||||
return this.aetheria.daemon.health();
|
||||
}
|
||||
|
||||
public async authorityStatus(): Promise<AuthorityStatusProjection> {
|
||||
public async authorityStatus(): Promise<AuthorityStatusDocument> {
|
||||
return this.aetheria.daemon.authorityStatus();
|
||||
}
|
||||
|
||||
public async starbridgeSession(): Promise<StarbridgeSessionProjection> {
|
||||
public async starbridgeSession(): Promise<StarbridgeSessionDocument> {
|
||||
return this.aetheria.daemon.starbridgeSession();
|
||||
}
|
||||
|
||||
public async assetManifest(): Promise<AssetManifestProjection> {
|
||||
public async assetManifest(): Promise<AssetManifestDocument> {
|
||||
return this.aetheria.daemon.assetManifest();
|
||||
}
|
||||
|
||||
public projectionDiagnostics(): Readonly<Record<string, AetheriaRuntimeRtsProjectionDiagnostic>> {
|
||||
public queryDiagnostics(): Readonly<Record<string, AetheriaRuntimeRtsQueryDiagnostic>> {
|
||||
return describeAetheriaRuntimeRtsQueryHandles(this.queries);
|
||||
}
|
||||
|
||||
|
|
@ -492,7 +492,7 @@ function createAetheriaPublicationDocuments(
|
|||
sourceId: "daemon:aetheria.frame.latest.v1",
|
||||
},
|
||||
),
|
||||
localPath: `${statePath}.daemon.frame.cc`,
|
||||
localPath: statePath,
|
||||
},
|
||||
{
|
||||
...CultMesh.publicationDocument(
|
||||
|
|
@ -503,7 +503,7 @@ function createAetheriaPublicationDocuments(
|
|||
sourceId: "daemon:aetheria.health.latest.v1",
|
||||
},
|
||||
),
|
||||
localPath: `${statePath}.daemon.health.cc`,
|
||||
localPath: statePath,
|
||||
remoteRecordKey: "daemon:aetheria.health.v1",
|
||||
},
|
||||
{
|
||||
|
|
@ -515,7 +515,7 @@ function createAetheriaPublicationDocuments(
|
|||
sourceId: "daemon:aetheria.authority.policy.latest.v1",
|
||||
},
|
||||
),
|
||||
localPath: `${statePath}.authority.policy.cc`,
|
||||
localPath: statePath,
|
||||
remoteRecordKey: "global:aetheria.verse_authority_policy.v1",
|
||||
},
|
||||
{
|
||||
|
|
@ -527,7 +527,7 @@ function createAetheriaPublicationDocuments(
|
|||
sourceId: "daemon:aetheria.starbridge.session.latest.v1",
|
||||
},
|
||||
),
|
||||
localPath: `${statePath}.daemon.starbridge.session.cc`,
|
||||
localPath: statePath,
|
||||
},
|
||||
{
|
||||
...CultMesh.publicationDocument(
|
||||
|
|
@ -538,7 +538,7 @@ function createAetheriaPublicationDocuments(
|
|||
sourceId: "daemon:aetheria.asset_manifest.latest.v1",
|
||||
},
|
||||
),
|
||||
localPath: `${statePath}.daemon.assets.cc`,
|
||||
localPath: statePath,
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ export {
|
|||
createAetheriaRuntimeRtsOperationHandles,
|
||||
createAetheriaRuntimeRtsQueryHandles,
|
||||
createAetheriaRuntimeRtsStatePointers,
|
||||
createAetheriaRuntimeRtsVerseFacade,
|
||||
createAetheriaRuntimeRtsVerseHandles,
|
||||
describeAetheriaRuntimeRtsLiveFeedSurface,
|
||||
describeAetheriaRuntimeRtsQueryHandles,
|
||||
describeAetheriaRuntimeRtsSurfaceCatalog,
|
||||
|
|
@ -20,35 +20,35 @@ export type {
|
|||
AetheriaRuntimeRtsDocumentResolvers,
|
||||
AetheriaRuntimeRtsDocuments,
|
||||
AetheriaRuntimeRtsOperationHandles,
|
||||
AetheriaRuntimeRtsProjectionDiagnostic,
|
||||
AetheriaRuntimeRtsQueryDiagnostic,
|
||||
AetheriaRuntimeRtsStatePointerResolvers,
|
||||
AetheriaRuntimeRtsStatePointers,
|
||||
AetheriaRuntimeRtsSurfaceCatalogDiagnostic,
|
||||
AetheriaRuntimeRtsVerseFacade,
|
||||
AetheriaRuntimeRtsVerseHandles,
|
||||
AetheriaRuntimeSelectedObjectRequest as SelectedObjectRequest,
|
||||
AetheriaRuntimeSetMoveVectorRequest as RtsSetMoveVectorRequest,
|
||||
AetheriaRuntimeSetTargetRequest as RtsSetTargetRequest,
|
||||
AetheriaRuntimeViewportFeedRequest,
|
||||
AetheriaRuntimeViewportFeedSnapshot,
|
||||
AssetManifestEntry,
|
||||
AssetManifestProjection,
|
||||
AssetManifestDocument,
|
||||
AssetRef,
|
||||
AuthorityRuleProjection,
|
||||
AuthorityStatusProjection,
|
||||
AuthorityRuleDocument,
|
||||
AuthorityStatusDocument,
|
||||
BodyView,
|
||||
DaemonHealthProjection,
|
||||
DaemonHealthDocument,
|
||||
EntityStatus,
|
||||
GravityInfluence,
|
||||
GravityViewportResponse,
|
||||
InventoryItem,
|
||||
InventoryProjection,
|
||||
InventoryDocument,
|
||||
ObjectsViewportResponse,
|
||||
SelectedObjectProjection,
|
||||
StarbridgeBaseStatusProjection,
|
||||
StarbridgeRuntimeRoleProjection,
|
||||
StarbridgeSessionProjection,
|
||||
StarbridgeStationStockItemProjection,
|
||||
StarbridgeWaveForecastProjection,
|
||||
SelectedObjectDocument,
|
||||
StarbridgeBaseStatusDocument,
|
||||
StarbridgeRuntimeRoleDocument,
|
||||
StarbridgeSessionDocument,
|
||||
StarbridgeStationStockItemDocument,
|
||||
StarbridgeWaveForecastDocument,
|
||||
ViewObject,
|
||||
ViewportResponse,
|
||||
} from "./aetheria-rts-generated-bindings.js";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// Generated by scripts/generate-rts-bindings.mjs from Aetheria C# MessagePack documents.
|
||||
|
||||
import { CultMesh } from "cultmesh-ts";
|
||||
import type { CultMeshLiveFeedDiagnostic, CultMeshOperationContext, CultMeshOperationReceipt, CultMeshProjectionSource, CultMeshQueryContext, CultMeshQuerySurfaceDiagnostic, CultMeshQueryWatcher, CultMeshRouteHint, CultMeshSurfaceCatalogDiagnostic, CultMeshSurfaceCatalogIndexDiagnostic, CultMeshUnsubscribe, CultMeshVerseContext, CultMeshViewportRequest } from "cultmesh-ts";
|
||||
import type { CultMeshLiveFeedDiagnostic, CultMeshOperationContext, CultMeshOperationReceipt, CultMeshQuerySource, CultMeshQueryContext, CultMeshQuerySurfaceDiagnostic, CultMeshQueryWatcher, CultMeshRouteHint, CultMeshSurfaceCatalogDiagnostic, CultMeshSurfaceCatalogIndexDiagnostic, CultMeshUnsubscribe, CultMeshVerseContext, CultMeshViewportRequest } from "cultmesh-ts";
|
||||
import type { IpcMain } from "electron";
|
||||
|
||||
export const AetheriaRtsSchemas = {
|
||||
|
|
@ -720,7 +720,7 @@ export type AetheriaRuntimeZoneRenderDocumentSlot =
|
|||
| "asteroidBeltPoses"
|
||||
| "wormholeExits"
|
||||
| "droppedPickups"
|
||||
| "entityFacades"
|
||||
| "entitySnapshots"
|
||||
| "orbits"
|
||||
| "bodies";
|
||||
|
||||
|
|
@ -740,7 +740,7 @@ export const aetheriaRuntimeZoneRenderDocumentSlots: Record<AetheriaRuntimeZoneR
|
|||
asteroidBeltPoses: 14,
|
||||
wormholeExits: 15,
|
||||
droppedPickups: 16,
|
||||
entityFacades: 17,
|
||||
entitySnapshots: 17,
|
||||
orbits: 18,
|
||||
bodies: 19,
|
||||
};
|
||||
|
|
@ -1524,7 +1524,7 @@ export type InventoryItem = {
|
|||
iconAsset: AssetRef;
|
||||
};
|
||||
|
||||
export type SelectedObjectProjection = {
|
||||
export type SelectedObjectDocument = {
|
||||
schema: string;
|
||||
frameId: number;
|
||||
runId: string;
|
||||
|
|
@ -1533,7 +1533,7 @@ export type SelectedObjectProjection = {
|
|||
selected: ViewObject | null;
|
||||
};
|
||||
|
||||
export type InventoryProjection = {
|
||||
export type InventoryDocument = {
|
||||
schema: string;
|
||||
frameId: number;
|
||||
runId: string;
|
||||
|
|
@ -1545,7 +1545,7 @@ export type InventoryProjection = {
|
|||
cargo: InventoryItem[];
|
||||
};
|
||||
|
||||
export type DaemonHealthProjection = {
|
||||
export type DaemonHealthDocument = {
|
||||
schema: string;
|
||||
daemonId: string;
|
||||
verseId: string;
|
||||
|
|
@ -1561,7 +1561,7 @@ export type DaemonHealthProjection = {
|
|||
commandBoundaryPath: string;
|
||||
};
|
||||
|
||||
export type AuthorityStatusProjection = {
|
||||
export type AuthorityStatusDocument = {
|
||||
schema: string;
|
||||
verseId: string;
|
||||
policyId: string;
|
||||
|
|
@ -1569,10 +1569,10 @@ export type AuthorityStatusProjection = {
|
|||
hostRuntimeId: string;
|
||||
defaultMode: string;
|
||||
updatedAtUtc: string;
|
||||
rules: AuthorityRuleProjection[];
|
||||
rules: AuthorityRuleDocument[];
|
||||
};
|
||||
|
||||
export type AuthorityRuleProjection = {
|
||||
export type AuthorityRuleDocument = {
|
||||
ruleId: string;
|
||||
subjectPrefix: string;
|
||||
claimKinds: string[];
|
||||
|
|
@ -1582,7 +1582,7 @@ export type AuthorityRuleProjection = {
|
|||
priority: number;
|
||||
};
|
||||
|
||||
export type StarbridgeSessionProjection = {
|
||||
export type StarbridgeSessionDocument = {
|
||||
schema: string;
|
||||
frameId: number;
|
||||
publishedAtUtc: string;
|
||||
|
|
@ -1594,13 +1594,13 @@ export type StarbridgeSessionProjection = {
|
|||
zoneName: string;
|
||||
phase: string;
|
||||
currentWaveIndex: number;
|
||||
baseStatus: StarbridgeBaseStatusProjection;
|
||||
stationStock: StarbridgeStationStockItemProjection[];
|
||||
waveForecast: StarbridgeWaveForecastProjection[];
|
||||
runtimeRoles: StarbridgeRuntimeRoleProjection[];
|
||||
baseStatus: StarbridgeBaseStatusDocument;
|
||||
stationStock: StarbridgeStationStockItemDocument[];
|
||||
waveForecast: StarbridgeWaveForecastDocument[];
|
||||
runtimeRoles: StarbridgeRuntimeRoleDocument[];
|
||||
};
|
||||
|
||||
export type StarbridgeBaseStatusProjection = {
|
||||
export type StarbridgeBaseStatusDocument = {
|
||||
entityKey: string;
|
||||
displayName: string;
|
||||
hull: number;
|
||||
|
|
@ -1609,7 +1609,7 @@ export type StarbridgeBaseStatusProjection = {
|
|||
isActive: boolean;
|
||||
};
|
||||
|
||||
export type StarbridgeStationStockItemProjection = {
|
||||
export type StarbridgeStationStockItemDocument = {
|
||||
itemKey: string;
|
||||
quantity: number;
|
||||
quality: number;
|
||||
|
|
@ -1618,7 +1618,7 @@ export type StarbridgeStationStockItemProjection = {
|
|||
iconAsset: AssetRef;
|
||||
};
|
||||
|
||||
export type AssetManifestProjection = {
|
||||
export type AssetManifestDocument = {
|
||||
schema: string;
|
||||
publishedAtUtc: string;
|
||||
runId: string;
|
||||
|
|
@ -1644,7 +1644,7 @@ export type AssetRef = {
|
|||
metadata: Record<string, string>;
|
||||
};
|
||||
|
||||
export type StarbridgeWaveForecastProjection = {
|
||||
export type StarbridgeWaveForecastDocument = {
|
||||
waveIndex: number;
|
||||
displayName: string;
|
||||
attackerKeys: string[];
|
||||
|
|
@ -1652,7 +1652,7 @@ export type StarbridgeWaveForecastProjection = {
|
|||
recoveredTechnologyKeys: string[];
|
||||
};
|
||||
|
||||
export type StarbridgeRuntimeRoleProjection = {
|
||||
export type StarbridgeRuntimeRoleDocument = {
|
||||
runtimeId: string;
|
||||
role: string;
|
||||
entityKey: string;
|
||||
|
|
@ -1713,12 +1713,12 @@ export type AetheriaRuntimeViewportFeedRequest = {
|
|||
|
||||
export type AetheriaRuntimeViewportFeedSnapshot = {
|
||||
viewport: ViewportResponse;
|
||||
selectedObject: SelectedObjectProjection | null;
|
||||
inventory: InventoryProjection | null;
|
||||
daemonHealth: DaemonHealthProjection;
|
||||
authorityStatus: AuthorityStatusProjection;
|
||||
starbridgeSession: StarbridgeSessionProjection;
|
||||
assetManifest: AssetManifestProjection;
|
||||
selectedObject: SelectedObjectDocument | null;
|
||||
inventory: InventoryDocument | null;
|
||||
daemonHealth: DaemonHealthDocument;
|
||||
authorityStatus: AuthorityStatusDocument;
|
||||
starbridgeSession: StarbridgeSessionDocument;
|
||||
assetManifest: AssetManifestDocument;
|
||||
receivedAtUtc: string;
|
||||
sampleMs: number;
|
||||
};
|
||||
|
|
@ -1727,12 +1727,12 @@ export type AetheriaRtsMainClient = {
|
|||
mapViewport(request: CultMeshViewportRequest): Promise<ViewportResponse>;
|
||||
objectsViewport(request: CultMeshViewportRequest): Promise<ObjectsViewportResponse>;
|
||||
gravityViewport(request: CultMeshViewportRequest): Promise<GravityViewportResponse>;
|
||||
selectedObject(request: AetheriaRuntimeSelectedObjectRequest): Promise<SelectedObjectProjection>;
|
||||
inventory(request: AetheriaRuntimeSelectedObjectRequest): Promise<InventoryProjection>;
|
||||
daemonHealth(): Promise<DaemonHealthProjection>;
|
||||
authorityStatus(): Promise<AuthorityStatusProjection>;
|
||||
starbridgeSession(): Promise<StarbridgeSessionProjection>;
|
||||
assetManifest(): Promise<AssetManifestProjection>;
|
||||
selectedObject(request: AetheriaRuntimeSelectedObjectRequest): Promise<SelectedObjectDocument>;
|
||||
inventory(request: AetheriaRuntimeSelectedObjectRequest): Promise<InventoryDocument>;
|
||||
daemonHealth(): Promise<DaemonHealthDocument>;
|
||||
authorityStatus(): Promise<AuthorityStatusDocument>;
|
||||
starbridgeSession(): Promise<StarbridgeSessionDocument>;
|
||||
assetManifest(): Promise<AssetManifestDocument>;
|
||||
watchViewportFeed(request: AetheriaRuntimeViewportFeedRequest, callback: (snapshot: AetheriaRuntimeViewportFeedSnapshot) => void): CultMeshUnsubscribe;
|
||||
setMoveVector(request: AetheriaRuntimeSetMoveVectorRequest): Promise<AetheriaRuntimeDaemonCommandReceipt>;
|
||||
setTarget(request: AetheriaRuntimeSetTargetRequest): Promise<AetheriaRuntimeDaemonCommandReceipt>;
|
||||
|
|
@ -1806,27 +1806,27 @@ export type AetheriaRuntimeRtsQueryExecutors = {
|
|||
mapViewport: AetheriaRuntimeViewportQueryExecutor<ViewportResponse>;
|
||||
objectsViewport: AetheriaRuntimeViewportQueryExecutor<ObjectsViewportResponse>;
|
||||
gravityViewport: AetheriaRuntimeViewportQueryExecutor<GravityViewportResponse>;
|
||||
selectedObject: AetheriaRuntimeQueryExecutor<AetheriaRuntimeSelectedObjectRequest, SelectedObjectProjection>;
|
||||
inventory: AetheriaRuntimeQueryExecutor<AetheriaRuntimeSelectedObjectRequest, InventoryProjection>;
|
||||
daemonHealth: AetheriaRuntimeQueryExecutor<void, DaemonHealthProjection>;
|
||||
authorityStatus: AetheriaRuntimeQueryExecutor<void, AuthorityStatusProjection>;
|
||||
starbridgeSession: AetheriaRuntimeQueryExecutor<void, StarbridgeSessionProjection>;
|
||||
assetManifest: AetheriaRuntimeQueryExecutor<void, AssetManifestProjection>;
|
||||
selectedObject: AetheriaRuntimeQueryExecutor<AetheriaRuntimeSelectedObjectRequest, SelectedObjectDocument>;
|
||||
inventory: AetheriaRuntimeQueryExecutor<AetheriaRuntimeSelectedObjectRequest, InventoryDocument>;
|
||||
daemonHealth: AetheriaRuntimeQueryExecutor<void, DaemonHealthDocument>;
|
||||
authorityStatus: AetheriaRuntimeQueryExecutor<void, AuthorityStatusDocument>;
|
||||
starbridgeSession: AetheriaRuntimeQueryExecutor<void, StarbridgeSessionDocument>;
|
||||
assetManifest: AetheriaRuntimeQueryExecutor<void, AssetManifestDocument>;
|
||||
};
|
||||
|
||||
export type AetheriaRuntimeRtsQueryWatchers = Partial<{
|
||||
mapViewport: CultMeshQueryWatcher<CultMeshViewportRequest, ViewportResponse>;
|
||||
objectsViewport: CultMeshQueryWatcher<CultMeshViewportRequest, ObjectsViewportResponse>;
|
||||
gravityViewport: CultMeshQueryWatcher<CultMeshViewportRequest, GravityViewportResponse>;
|
||||
selectedObject: CultMeshQueryWatcher<AetheriaRuntimeSelectedObjectRequest, SelectedObjectProjection>;
|
||||
inventory: CultMeshQueryWatcher<AetheriaRuntimeSelectedObjectRequest, InventoryProjection>;
|
||||
daemonHealth: CultMeshQueryWatcher<void, DaemonHealthProjection>;
|
||||
authorityStatus: CultMeshQueryWatcher<void, AuthorityStatusProjection>;
|
||||
starbridgeSession: CultMeshQueryWatcher<void, StarbridgeSessionProjection>;
|
||||
assetManifest: CultMeshQueryWatcher<void, AssetManifestProjection>;
|
||||
selectedObject: CultMeshQueryWatcher<AetheriaRuntimeSelectedObjectRequest, SelectedObjectDocument>;
|
||||
inventory: CultMeshQueryWatcher<AetheriaRuntimeSelectedObjectRequest, InventoryDocument>;
|
||||
daemonHealth: CultMeshQueryWatcher<void, DaemonHealthDocument>;
|
||||
authorityStatus: CultMeshQueryWatcher<void, AuthorityStatusDocument>;
|
||||
starbridgeSession: CultMeshQueryWatcher<void, StarbridgeSessionDocument>;
|
||||
assetManifest: CultMeshQueryWatcher<void, AssetManifestDocument>;
|
||||
}>;
|
||||
|
||||
export type AetheriaRuntimeRtsProjectionDiagnostic = CultMeshQuerySurfaceDiagnostic;
|
||||
export type AetheriaRuntimeRtsQueryDiagnostic = CultMeshQuerySurfaceDiagnostic;
|
||||
|
||||
export type AetheriaRuntimeRtsLiveFeedDiagnostic = CultMeshLiveFeedDiagnostic;
|
||||
|
||||
|
|
@ -1848,24 +1848,24 @@ export type AetheriaRuntimeRtsDocumentResolvers = Partial<{
|
|||
|
||||
export type AetheriaRuntimeRtsStatePointerResolvers = AetheriaRuntimeRtsDocumentResolvers;
|
||||
|
||||
export const AetheriaRuntimeRtsProjectionSources = {
|
||||
daemonFrame: CultMesh.projectionSource("daemon:aetheria.frame.latest.v1", {
|
||||
export const AetheriaRuntimeRtsDocumentSources = {
|
||||
daemonFrame: CultMesh.querySource("daemon:aetheria.frame.latest.v1", {
|
||||
schemaId: AetheriaRtsSchemas.daemonFrame,
|
||||
description: "latest daemon frame"
|
||||
}),
|
||||
daemonHealth: CultMesh.projectionSource("daemon:aetheria.health.latest.v1", {
|
||||
daemonHealth: CultMesh.querySource("daemon:aetheria.health.latest.v1", {
|
||||
schemaId: AetheriaRtsSchemas.daemonHealth,
|
||||
description: "latest daemon health"
|
||||
}),
|
||||
authorityPolicy: CultMesh.projectionSource("daemon:aetheria.authority.policy.latest.v1", {
|
||||
authorityPolicy: CultMesh.querySource("daemon:aetheria.authority.policy.latest.v1", {
|
||||
schemaId: AetheriaRtsSchemas.verseAuthorityPolicy,
|
||||
description: "latest Verse authority policy"
|
||||
}),
|
||||
starbridgeSession: CultMesh.projectionSource("daemon:aetheria.starbridge.session.latest.v1", {
|
||||
starbridgeSession: CultMesh.querySource("daemon:aetheria.starbridge.session.latest.v1", {
|
||||
schemaId: AetheriaRtsSchemas.starbridgeSessionSummary,
|
||||
description: "latest Starbridge session summary"
|
||||
}),
|
||||
assetManifest: CultMesh.projectionSource("daemon:aetheria.asset_manifest.latest.v1", {
|
||||
assetManifest: CultMesh.querySource("daemon:aetheria.asset_manifest.latest.v1", {
|
||||
schemaId: AetheriaRtsSchemas.assetManifest,
|
||||
description: "latest daemon asset manifest"
|
||||
})
|
||||
|
|
@ -1877,48 +1877,48 @@ export function createAetheriaRuntimeRtsDocuments(
|
|||
) {
|
||||
return {
|
||||
daemonFrame: CultMesh.document(
|
||||
AetheriaRuntimeRtsProjectionSources.daemonFrame.sourceId,
|
||||
AetheriaRuntimeRtsDocumentSources.daemonFrame.sourceId,
|
||||
{ schemaId: AetheriaRtsSchemas.daemonFrame },
|
||||
async (context) => resolvers.daemonFrame?.(context),
|
||||
{
|
||||
routeHint,
|
||||
sources: [AetheriaRuntimeRtsProjectionSources.daemonFrame],
|
||||
sources: [AetheriaRuntimeRtsDocumentSources.daemonFrame],
|
||||
},
|
||||
),
|
||||
daemonHealth: CultMesh.document(
|
||||
AetheriaRuntimeRtsProjectionSources.daemonHealth.sourceId,
|
||||
AetheriaRuntimeRtsDocumentSources.daemonHealth.sourceId,
|
||||
{ schemaId: AetheriaRtsSchemas.daemonHealth },
|
||||
async (context) => resolvers.daemonHealth?.(context),
|
||||
{
|
||||
routeHint,
|
||||
sources: [AetheriaRuntimeRtsProjectionSources.daemonHealth],
|
||||
sources: [AetheriaRuntimeRtsDocumentSources.daemonHealth],
|
||||
},
|
||||
),
|
||||
authorityPolicy: CultMesh.document(
|
||||
AetheriaRuntimeRtsProjectionSources.authorityPolicy.sourceId,
|
||||
AetheriaRuntimeRtsDocumentSources.authorityPolicy.sourceId,
|
||||
{ schemaId: AetheriaRtsSchemas.verseAuthorityPolicy },
|
||||
async (context) => resolvers.authorityPolicy?.(context),
|
||||
{
|
||||
routeHint,
|
||||
sources: [AetheriaRuntimeRtsProjectionSources.authorityPolicy],
|
||||
sources: [AetheriaRuntimeRtsDocumentSources.authorityPolicy],
|
||||
},
|
||||
),
|
||||
starbridgeSession: CultMesh.document(
|
||||
AetheriaRuntimeRtsProjectionSources.starbridgeSession.sourceId,
|
||||
AetheriaRuntimeRtsDocumentSources.starbridgeSession.sourceId,
|
||||
{ schemaId: AetheriaRtsSchemas.starbridgeSessionSummary },
|
||||
async (context) => resolvers.starbridgeSession?.(context),
|
||||
{
|
||||
routeHint,
|
||||
sources: [AetheriaRuntimeRtsProjectionSources.starbridgeSession],
|
||||
sources: [AetheriaRuntimeRtsDocumentSources.starbridgeSession],
|
||||
},
|
||||
),
|
||||
assetManifest: CultMesh.document(
|
||||
AetheriaRuntimeRtsProjectionSources.assetManifest.sourceId,
|
||||
AetheriaRuntimeRtsDocumentSources.assetManifest.sourceId,
|
||||
{ schemaId: AetheriaRtsSchemas.assetManifest },
|
||||
async (context) => resolvers.assetManifest?.(context),
|
||||
{
|
||||
routeHint,
|
||||
sources: [AetheriaRuntimeRtsProjectionSources.assetManifest],
|
||||
sources: [AetheriaRuntimeRtsDocumentSources.assetManifest],
|
||||
},
|
||||
),
|
||||
} as const;
|
||||
|
|
@ -1932,60 +1932,51 @@ export function createAetheriaRuntimeRtsQueryHandles(
|
|||
watchers: AetheriaRuntimeRtsQueryWatchers = {},
|
||||
) {
|
||||
return {
|
||||
mapViewport: CultMesh.projectionRecipe<CultMeshViewportRequest, ViewportResponse>(
|
||||
mapViewport: CultMesh.query<CultMeshViewportRequest, ViewportResponse>(
|
||||
AetheriaRtsSchemas.rtsViewport,
|
||||
[AetheriaRuntimeRtsProjectionSources.daemonFrame],
|
||||
executors.mapViewport,
|
||||
{ routeHint, watchProjection: watchers.mapViewport },
|
||||
).asQuerySurface(),
|
||||
objectsViewport: CultMesh.projectionRecipe<CultMeshViewportRequest, ObjectsViewportResponse>(
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.daemonFrame], watchQuery: watchers.mapViewport },
|
||||
),
|
||||
objectsViewport: CultMesh.query<CultMeshViewportRequest, ObjectsViewportResponse>(
|
||||
AetheriaRtsSchemas.objectsViewport,
|
||||
[AetheriaRuntimeRtsProjectionSources.daemonFrame],
|
||||
executors.objectsViewport,
|
||||
{ routeHint, watchProjection: watchers.objectsViewport },
|
||||
).asQuerySurface(),
|
||||
gravityViewport: CultMesh.projectionRecipe<CultMeshViewportRequest, GravityViewportResponse>(
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.daemonFrame], watchQuery: watchers.objectsViewport },
|
||||
),
|
||||
gravityViewport: CultMesh.query<CultMeshViewportRequest, GravityViewportResponse>(
|
||||
AetheriaRtsSchemas.gravityViewport,
|
||||
[AetheriaRuntimeRtsProjectionSources.daemonFrame],
|
||||
executors.gravityViewport,
|
||||
{ routeHint, watchProjection: watchers.gravityViewport },
|
||||
).asQuerySurface(),
|
||||
selectedObject: CultMesh.projectionRecipe<AetheriaRuntimeSelectedObjectRequest, SelectedObjectProjection>(
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.daemonFrame], watchQuery: watchers.gravityViewport },
|
||||
),
|
||||
selectedObject: CultMesh.query<AetheriaRuntimeSelectedObjectRequest, SelectedObjectDocument>(
|
||||
AetheriaRtsSchemas.selectedObject,
|
||||
[AetheriaRuntimeRtsProjectionSources.daemonFrame],
|
||||
executors.selectedObject,
|
||||
{ routeHint, watchProjection: watchers.selectedObject },
|
||||
).asQuerySurface(),
|
||||
inventory: CultMesh.projectionRecipe<AetheriaRuntimeSelectedObjectRequest, InventoryProjection>(
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.daemonFrame], watchQuery: watchers.selectedObject },
|
||||
),
|
||||
inventory: CultMesh.query<AetheriaRuntimeSelectedObjectRequest, InventoryDocument>(
|
||||
AetheriaRtsSchemas.inventory,
|
||||
[AetheriaRuntimeRtsProjectionSources.daemonFrame],
|
||||
executors.inventory,
|
||||
{ routeHint, watchProjection: watchers.inventory },
|
||||
).asQuerySurface(),
|
||||
daemonHealth: CultMesh.projectionRecipe<void, DaemonHealthProjection>(
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.daemonFrame], watchQuery: watchers.inventory },
|
||||
),
|
||||
daemonHealth: CultMesh.query<void, DaemonHealthDocument>(
|
||||
AetheriaRtsSchemas.daemonHealth,
|
||||
[AetheriaRuntimeRtsProjectionSources.daemonHealth],
|
||||
executors.daemonHealth,
|
||||
{ routeHint, watchProjection: watchers.daemonHealth },
|
||||
).asQuerySurface(),
|
||||
authorityStatus: CultMesh.projectionRecipe<void, AuthorityStatusProjection>(
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.daemonHealth], watchQuery: watchers.daemonHealth },
|
||||
),
|
||||
authorityStatus: CultMesh.query<void, AuthorityStatusDocument>(
|
||||
AetheriaRtsSchemas.verseAuthorityPolicy,
|
||||
[AetheriaRuntimeRtsProjectionSources.authorityPolicy],
|
||||
executors.authorityStatus,
|
||||
{ routeHint, watchProjection: watchers.authorityStatus },
|
||||
).asQuerySurface(),
|
||||
starbridgeSession: CultMesh.projectionRecipe<void, StarbridgeSessionProjection>(
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.authorityPolicy], watchQuery: watchers.authorityStatus },
|
||||
),
|
||||
starbridgeSession: CultMesh.query<void, StarbridgeSessionDocument>(
|
||||
AetheriaRtsSchemas.starbridgeSessionSummary,
|
||||
[AetheriaRuntimeRtsProjectionSources.starbridgeSession],
|
||||
executors.starbridgeSession,
|
||||
{ routeHint, watchProjection: watchers.starbridgeSession },
|
||||
).asQuerySurface(),
|
||||
assetManifest: CultMesh.projectionRecipe<void, AssetManifestProjection>(
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.starbridgeSession], watchQuery: watchers.starbridgeSession },
|
||||
),
|
||||
assetManifest: CultMesh.query<void, AssetManifestDocument>(
|
||||
AetheriaRtsSchemas.assetManifest,
|
||||
[AetheriaRuntimeRtsProjectionSources.assetManifest],
|
||||
executors.assetManifest,
|
||||
{ routeHint, watchProjection: watchers.assetManifest },
|
||||
).asQuerySurface(),
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.assetManifest], watchQuery: watchers.assetManifest },
|
||||
),
|
||||
} as const;
|
||||
}
|
||||
|
||||
|
|
@ -2040,15 +2031,15 @@ export function describeAetheriaRuntimeRtsSurfaceCatalog(
|
|||
function describeAetheriaRuntimeRtsQuerySurface(surface: {
|
||||
queryId: string;
|
||||
routeHint: CultMeshRouteHint;
|
||||
sources: readonly CultMeshProjectionSource[];
|
||||
}): AetheriaRuntimeRtsProjectionDiagnostic {
|
||||
sources: readonly CultMeshQuerySource[];
|
||||
}): AetheriaRuntimeRtsQueryDiagnostic {
|
||||
return CultMesh.describeQuerySurface(surface);
|
||||
}
|
||||
|
||||
export function describeAetheriaRuntimeRtsLiveFeedSurface(surface: {
|
||||
feedId: string;
|
||||
routeHint: CultMeshRouteHint;
|
||||
sources: readonly CultMeshProjectionSource[];
|
||||
sources: readonly CultMeshQuerySource[];
|
||||
}): AetheriaRuntimeRtsLiveFeedDiagnostic {
|
||||
return CultMesh.describeLiveFeed(surface);
|
||||
}
|
||||
|
|
@ -2095,9 +2086,9 @@ export function createAetheriaRuntimeRtsOperationHandles(
|
|||
} as const;
|
||||
}
|
||||
|
||||
export type AetheriaRuntimeRtsVerseFacade = ReturnType<typeof createAetheriaRuntimeRtsVerseFacade>;
|
||||
export type AetheriaRuntimeRtsVerseHandles = ReturnType<typeof createAetheriaRuntimeRtsVerseHandles>;
|
||||
|
||||
export function createAetheriaRuntimeRtsVerseFacade(
|
||||
export function createAetheriaRuntimeRtsVerseHandles(
|
||||
queryVerse: CultMeshVerseContext,
|
||||
commandVerse: CultMeshVerseContext,
|
||||
queries: ReturnType<typeof createAetheriaRuntimeRtsQueryHandles>,
|
||||
|
|
|
|||
|
|
@ -23,27 +23,27 @@ import {
|
|||
} from "./aetheria-rts-generated-bindings.js";
|
||||
import { cultMeshRectFromBounds, cultMeshViewportRequest } from "cultmesh-ts";
|
||||
import type {
|
||||
AssetManifestProjection,
|
||||
AssetManifestDocument,
|
||||
AssetRef,
|
||||
AuthorityStatusProjection,
|
||||
AuthorityStatusDocument,
|
||||
BodyView,
|
||||
DaemonHealthProjection,
|
||||
DaemonHealthDocument,
|
||||
GravityViewportResponse,
|
||||
GravityInfluence,
|
||||
InventoryProjection,
|
||||
InventoryDocument,
|
||||
InventoryItem,
|
||||
ObjectsViewportResponse,
|
||||
SelectedObjectProjection,
|
||||
SelectedObjectDocument,
|
||||
SelectedObjectRequest,
|
||||
StarbridgeSessionProjection,
|
||||
StarbridgeSessionDocument,
|
||||
ViewObject,
|
||||
ViewportRequest,
|
||||
ViewportResponse,
|
||||
} from "./aetheria-rts-bindings.js";
|
||||
|
||||
export function projectViewportFromFrame(frameDocument: unknown, request: ViewportRequest): ViewportResponse {
|
||||
const objects = projectObjectsViewportFromFrame(frameDocument, request);
|
||||
const gravity = projectGravityViewportFromFrame(frameDocument, request);
|
||||
export function buildViewportDocumentFromFrame(frameDocument: unknown, request: ViewportRequest): ViewportResponse {
|
||||
const objects = buildObjectsViewportDocumentFromFrame(frameDocument, request);
|
||||
const gravity = buildGravityViewportDocumentFromFrame(frameDocument, request);
|
||||
return {
|
||||
schema: AetheriaRtsSchemas.rtsViewport,
|
||||
frameId: objects.frameId,
|
||||
|
|
@ -61,7 +61,7 @@ export function projectViewportFromFrame(frameDocument: unknown, request: Viewpo
|
|||
};
|
||||
}
|
||||
|
||||
export function projectObjectsViewportFromFrame(
|
||||
export function buildObjectsViewportDocumentFromFrame(
|
||||
frameDocument: unknown,
|
||||
request: ViewportRequest,
|
||||
): ObjectsViewportResponse {
|
||||
|
|
@ -102,7 +102,7 @@ export function projectObjectsViewportFromFrame(
|
|||
};
|
||||
}
|
||||
|
||||
export function projectGravityViewportFromFrame(
|
||||
export function buildGravityViewportDocumentFromFrame(
|
||||
frameDocument: unknown,
|
||||
request: ViewportRequest,
|
||||
): GravityViewportResponse {
|
||||
|
|
@ -132,10 +132,10 @@ export function projectGravityViewportFromFrame(
|
|||
};
|
||||
}
|
||||
|
||||
export function projectSelectedObjectFromFrame(
|
||||
export function buildSelectedObjectDocumentFromFrame(
|
||||
frameDocument: unknown,
|
||||
request: SelectedObjectRequest,
|
||||
): SelectedObjectProjection {
|
||||
): SelectedObjectDocument {
|
||||
const context = frameContext(frameDocument);
|
||||
const entity = context.entities.find(candidate => num(candidate[entitySlots.entityIndex], -1) === request.entityIndex);
|
||||
return {
|
||||
|
|
@ -148,7 +148,7 @@ export function projectSelectedObjectFromFrame(
|
|||
};
|
||||
}
|
||||
|
||||
export function projectInventoryFromFrame(frameDocument: unknown, request: SelectedObjectRequest): InventoryProjection {
|
||||
export function buildInventoryDocumentFromFrame(frameDocument: unknown, request: SelectedObjectRequest): InventoryDocument {
|
||||
const context = frameContext(frameDocument);
|
||||
const entity = context.entities.find(candidate => num(candidate[entitySlots.entityIndex], -1) === request.entityIndex);
|
||||
const allItems = entity ? inventory(entity) : [];
|
||||
|
|
@ -165,7 +165,7 @@ export function projectInventoryFromFrame(frameDocument: unknown, request: Selec
|
|||
};
|
||||
}
|
||||
|
||||
export function projectDaemonHealth(healthDocument: unknown): DaemonHealthProjection {
|
||||
export function readDaemonHealthDocument(healthDocument: unknown): DaemonHealthDocument {
|
||||
const health = arr(healthDocument);
|
||||
return {
|
||||
schema: str(health[healthSlots.schema]) || AetheriaRtsSchemas.daemonHealth,
|
||||
|
|
@ -184,7 +184,7 @@ export function projectDaemonHealth(healthDocument: unknown): DaemonHealthProjec
|
|||
};
|
||||
}
|
||||
|
||||
export function projectAuthorityStatus(policyDocument: unknown): AuthorityStatusProjection {
|
||||
export function readAuthorityStatusDocument(policyDocument: unknown): AuthorityStatusDocument {
|
||||
const policy = arr(policyDocument);
|
||||
return {
|
||||
schema: str(policy[authorityPolicySlots.schema]) || AetheriaRtsSchemas.verseAuthorityPolicy,
|
||||
|
|
@ -206,7 +206,7 @@ export function projectAuthorityStatus(policyDocument: unknown): AuthorityStatus
|
|||
};
|
||||
}
|
||||
|
||||
export function projectStarbridgeSessionSummary(summaryDocument: unknown): StarbridgeSessionProjection {
|
||||
export function readStarbridgeSessionSummaryDocument(summaryDocument: unknown): StarbridgeSessionDocument {
|
||||
const summary = arr(summaryDocument);
|
||||
return {
|
||||
schema: str(summary[starbridgeSummarySlots.schema]) || AetheriaRtsSchemas.starbridgeSessionSummary,
|
||||
|
|
@ -227,7 +227,7 @@ export function projectStarbridgeSessionSummary(summaryDocument: unknown): Starb
|
|||
};
|
||||
}
|
||||
|
||||
export function projectAssetManifest(assetManifestDocument: unknown): AssetManifestProjection {
|
||||
export function readAssetManifestDocument(assetManifestDocument: unknown): AssetManifestDocument {
|
||||
const manifest = arr(assetManifestDocument);
|
||||
return {
|
||||
schema: str(manifest[assetManifestSlots.schema]) || AetheriaRtsSchemas.assetManifest,
|
||||
|
|
@ -296,7 +296,7 @@ function toViewObject(entity: unknown[], runId: string, zoneIndex: number): View
|
|||
};
|
||||
}
|
||||
|
||||
function toStarbridgeBaseStatus(status: unknown[]): StarbridgeSessionProjection["baseStatus"] {
|
||||
function toStarbridgeBaseStatus(status: unknown[]): StarbridgeSessionDocument["baseStatus"] {
|
||||
return {
|
||||
entityKey: str(status[starbridgeBaseSlots.entityKey]),
|
||||
displayName: str(status[starbridgeBaseSlots.displayName]),
|
||||
|
|
@ -307,7 +307,7 @@ function toStarbridgeBaseStatus(status: unknown[]): StarbridgeSessionProjection[
|
|||
};
|
||||
}
|
||||
|
||||
function toStarbridgeStationStockItem(item: unknown[]): StarbridgeSessionProjection["stationStock"][number] {
|
||||
function toStarbridgeStationStockItem(item: unknown[]): StarbridgeSessionDocument["stationStock"][number] {
|
||||
const itemKey = str(item[starbridgeStockSlots.itemKey]);
|
||||
return {
|
||||
itemKey,
|
||||
|
|
@ -319,7 +319,7 @@ function toStarbridgeStationStockItem(item: unknown[]): StarbridgeSessionProject
|
|||
};
|
||||
}
|
||||
|
||||
function toStarbridgeWaveForecast(wave: unknown[]): StarbridgeSessionProjection["waveForecast"][number] {
|
||||
function toStarbridgeWaveForecast(wave: unknown[]): StarbridgeSessionDocument["waveForecast"][number] {
|
||||
return {
|
||||
waveIndex: num(wave[starbridgeWaveForecastSlots.waveIndex]),
|
||||
displayName: str(wave[starbridgeWaveForecastSlots.displayName]),
|
||||
|
|
@ -329,7 +329,7 @@ function toStarbridgeWaveForecast(wave: unknown[]): StarbridgeSessionProjection[
|
|||
};
|
||||
}
|
||||
|
||||
function toStarbridgeRuntimeRole(role: unknown[]): StarbridgeSessionProjection["runtimeRoles"][number] {
|
||||
function toStarbridgeRuntimeRole(role: unknown[]): StarbridgeSessionDocument["runtimeRoles"][number] {
|
||||
return {
|
||||
runtimeId: str(role[starbridgeRoleSlots.runtimeId]),
|
||||
role: str(role[starbridgeRoleSlots.role]),
|
||||
|
|
@ -439,7 +439,7 @@ function entityKey(runId: string, zoneIndex: number, entityIndex: number): strin
|
|||
return `global:aetheria.run_state.${runId}.zone.${zoneIndex}.entity.${entityIndex}.v1`;
|
||||
}
|
||||
|
||||
function toAssetManifestEntry(entry: unknown[]): AssetManifestProjection["assets"][number] {
|
||||
function toAssetManifestEntry(entry: unknown[]): AssetManifestDocument["assets"][number] {
|
||||
return {
|
||||
ref: assetRef(arr(entry[assetManifestEntrySlots.ref])),
|
||||
sizeBytes: num(entry[assetManifestEntrySlots.sizeBytes]),
|
||||
|
|
@ -387,7 +387,7 @@ function render(enums, documents) {
|
|||
.map(document => renderSlotBlock(document.exportName, document.slots))
|
||||
.join("\n\n");
|
||||
|
||||
return `// <auto-generated />\n// Generated by scripts/generate-rts-bindings.mjs from Aetheria C# MessagePack documents.\n\nimport { CultMesh } from "cultmesh-ts";\nimport type { CultMeshLiveFeedDiagnostic, CultMeshOperationContext, CultMeshOperationReceipt, CultMeshProjectionSource, CultMeshQueryContext, CultMeshQuerySurfaceDiagnostic, CultMeshQueryWatcher, CultMeshRouteHint, CultMeshSurfaceCatalogDiagnostic, CultMeshSurfaceCatalogIndexDiagnostic, CultMeshUnsubscribe, CultMeshVerseContext, CultMeshViewportRequest } from "cultmesh-ts";\nimport type { IpcMain } from "electron";\n\nexport const AetheriaRtsSchemas = {\n${schemas}\n} as const;\n\n${enumBlocks}\n\nexport const AetheriaRtsIpcChannels = {\n${renderIpcChannelLines()}\n} as const;\n\n${slotBlocks}\n\n${renderProjectionTypes("CultMeshViewportRequest")}\n\n${renderRtsOperations()}\n`;
|
||||
return `// <auto-generated />\n// Generated by scripts/generate-rts-bindings.mjs from Aetheria C# MessagePack documents.\n\nimport { CultMesh } from "cultmesh-ts";\nimport type { CultMeshLiveFeedDiagnostic, CultMeshOperationContext, CultMeshOperationReceipt, CultMeshQuerySource, CultMeshQueryContext, CultMeshQuerySurfaceDiagnostic, CultMeshQueryWatcher, CultMeshRouteHint, CultMeshSurfaceCatalogDiagnostic, CultMeshSurfaceCatalogIndexDiagnostic, CultMeshUnsubscribe, CultMeshVerseContext, CultMeshViewportRequest } from "cultmesh-ts";\nimport type { IpcMain } from "electron";\n\nexport const AetheriaRtsSchemas = {\n${schemas}\n} as const;\n\n${enumBlocks}\n\nexport const AetheriaRtsIpcChannels = {\n${renderIpcChannelLines()}\n} as const;\n\n${slotBlocks}\n\n${renderRtsDocumentTypes("CultMeshViewportRequest")}\n\n${renderRtsOperations()}\n`;
|
||||
}
|
||||
|
||||
function renderEnumBlock(exportName, entries) {
|
||||
|
|
@ -442,12 +442,12 @@ export type AetheriaRuntimeViewportFeedRequest = {
|
|||
|
||||
export type AetheriaRuntimeViewportFeedSnapshot = {
|
||||
viewport: ViewportResponse;
|
||||
selectedObject: SelectedObjectProjection | null;
|
||||
inventory: InventoryProjection | null;
|
||||
daemonHealth: DaemonHealthProjection;
|
||||
authorityStatus: AuthorityStatusProjection;
|
||||
starbridgeSession: StarbridgeSessionProjection;
|
||||
assetManifest: AssetManifestProjection;
|
||||
selectedObject: SelectedObjectDocument | null;
|
||||
inventory: InventoryDocument | null;
|
||||
daemonHealth: DaemonHealthDocument;
|
||||
authorityStatus: AuthorityStatusDocument;
|
||||
starbridgeSession: StarbridgeSessionDocument;
|
||||
assetManifest: AssetManifestDocument;
|
||||
receivedAtUtc: string;
|
||||
sampleMs: number;
|
||||
};
|
||||
|
|
@ -456,12 +456,12 @@ export type AetheriaRtsMainClient = {
|
|||
mapViewport(request: CultMeshViewportRequest): Promise<ViewportResponse>;
|
||||
objectsViewport(request: CultMeshViewportRequest): Promise<ObjectsViewportResponse>;
|
||||
gravityViewport(request: CultMeshViewportRequest): Promise<GravityViewportResponse>;
|
||||
selectedObject(request: AetheriaRuntimeSelectedObjectRequest): Promise<SelectedObjectProjection>;
|
||||
inventory(request: AetheriaRuntimeSelectedObjectRequest): Promise<InventoryProjection>;
|
||||
daemonHealth(): Promise<DaemonHealthProjection>;
|
||||
authorityStatus(): Promise<AuthorityStatusProjection>;
|
||||
starbridgeSession(): Promise<StarbridgeSessionProjection>;
|
||||
assetManifest(): Promise<AssetManifestProjection>;
|
||||
selectedObject(request: AetheriaRuntimeSelectedObjectRequest): Promise<SelectedObjectDocument>;
|
||||
inventory(request: AetheriaRuntimeSelectedObjectRequest): Promise<InventoryDocument>;
|
||||
daemonHealth(): Promise<DaemonHealthDocument>;
|
||||
authorityStatus(): Promise<AuthorityStatusDocument>;
|
||||
starbridgeSession(): Promise<StarbridgeSessionDocument>;
|
||||
assetManifest(): Promise<AssetManifestDocument>;
|
||||
watchViewportFeed(request: AetheriaRuntimeViewportFeedRequest, callback: (snapshot: AetheriaRuntimeViewportFeedSnapshot) => void): CultMeshUnsubscribe;
|
||||
setMoveVector(request: AetheriaRuntimeSetMoveVectorRequest): Promise<AetheriaRuntimeDaemonCommandReceipt>;
|
||||
setTarget(request: AetheriaRuntimeSetTargetRequest): Promise<AetheriaRuntimeDaemonCommandReceipt>;
|
||||
|
|
@ -535,27 +535,27 @@ export type AetheriaRuntimeRtsQueryExecutors = {
|
|||
mapViewport: AetheriaRuntimeViewportQueryExecutor<ViewportResponse>;
|
||||
objectsViewport: AetheriaRuntimeViewportQueryExecutor<ObjectsViewportResponse>;
|
||||
gravityViewport: AetheriaRuntimeViewportQueryExecutor<GravityViewportResponse>;
|
||||
selectedObject: AetheriaRuntimeQueryExecutor<AetheriaRuntimeSelectedObjectRequest, SelectedObjectProjection>;
|
||||
inventory: AetheriaRuntimeQueryExecutor<AetheriaRuntimeSelectedObjectRequest, InventoryProjection>;
|
||||
daemonHealth: AetheriaRuntimeQueryExecutor<void, DaemonHealthProjection>;
|
||||
authorityStatus: AetheriaRuntimeQueryExecutor<void, AuthorityStatusProjection>;
|
||||
starbridgeSession: AetheriaRuntimeQueryExecutor<void, StarbridgeSessionProjection>;
|
||||
assetManifest: AetheriaRuntimeQueryExecutor<void, AssetManifestProjection>;
|
||||
selectedObject: AetheriaRuntimeQueryExecutor<AetheriaRuntimeSelectedObjectRequest, SelectedObjectDocument>;
|
||||
inventory: AetheriaRuntimeQueryExecutor<AetheriaRuntimeSelectedObjectRequest, InventoryDocument>;
|
||||
daemonHealth: AetheriaRuntimeQueryExecutor<void, DaemonHealthDocument>;
|
||||
authorityStatus: AetheriaRuntimeQueryExecutor<void, AuthorityStatusDocument>;
|
||||
starbridgeSession: AetheriaRuntimeQueryExecutor<void, StarbridgeSessionDocument>;
|
||||
assetManifest: AetheriaRuntimeQueryExecutor<void, AssetManifestDocument>;
|
||||
};
|
||||
|
||||
export type AetheriaRuntimeRtsQueryWatchers = Partial<{
|
||||
mapViewport: CultMeshQueryWatcher<CultMeshViewportRequest, ViewportResponse>;
|
||||
objectsViewport: CultMeshQueryWatcher<CultMeshViewportRequest, ObjectsViewportResponse>;
|
||||
gravityViewport: CultMeshQueryWatcher<CultMeshViewportRequest, GravityViewportResponse>;
|
||||
selectedObject: CultMeshQueryWatcher<AetheriaRuntimeSelectedObjectRequest, SelectedObjectProjection>;
|
||||
inventory: CultMeshQueryWatcher<AetheriaRuntimeSelectedObjectRequest, InventoryProjection>;
|
||||
daemonHealth: CultMeshQueryWatcher<void, DaemonHealthProjection>;
|
||||
authorityStatus: CultMeshQueryWatcher<void, AuthorityStatusProjection>;
|
||||
starbridgeSession: CultMeshQueryWatcher<void, StarbridgeSessionProjection>;
|
||||
assetManifest: CultMeshQueryWatcher<void, AssetManifestProjection>;
|
||||
selectedObject: CultMeshQueryWatcher<AetheriaRuntimeSelectedObjectRequest, SelectedObjectDocument>;
|
||||
inventory: CultMeshQueryWatcher<AetheriaRuntimeSelectedObjectRequest, InventoryDocument>;
|
||||
daemonHealth: CultMeshQueryWatcher<void, DaemonHealthDocument>;
|
||||
authorityStatus: CultMeshQueryWatcher<void, AuthorityStatusDocument>;
|
||||
starbridgeSession: CultMeshQueryWatcher<void, StarbridgeSessionDocument>;
|
||||
assetManifest: CultMeshQueryWatcher<void, AssetManifestDocument>;
|
||||
}>;
|
||||
|
||||
export type AetheriaRuntimeRtsProjectionDiagnostic = CultMeshQuerySurfaceDiagnostic;
|
||||
export type AetheriaRuntimeRtsQueryDiagnostic = CultMeshQuerySurfaceDiagnostic;
|
||||
|
||||
export type AetheriaRuntimeRtsLiveFeedDiagnostic = CultMeshLiveFeedDiagnostic;
|
||||
|
||||
|
|
@ -577,24 +577,24 @@ export type AetheriaRuntimeRtsDocumentResolvers = Partial<{
|
|||
|
||||
export type AetheriaRuntimeRtsStatePointerResolvers = AetheriaRuntimeRtsDocumentResolvers;
|
||||
|
||||
export const AetheriaRuntimeRtsProjectionSources = {
|
||||
daemonFrame: CultMesh.projectionSource("daemon:aetheria.frame.latest.v1", {
|
||||
export const AetheriaRuntimeRtsDocumentSources = {
|
||||
daemonFrame: CultMesh.querySource("daemon:aetheria.frame.latest.v1", {
|
||||
schemaId: AetheriaRtsSchemas.daemonFrame,
|
||||
description: "latest daemon frame"
|
||||
}),
|
||||
daemonHealth: CultMesh.projectionSource("daemon:aetheria.health.latest.v1", {
|
||||
daemonHealth: CultMesh.querySource("daemon:aetheria.health.latest.v1", {
|
||||
schemaId: AetheriaRtsSchemas.daemonHealth,
|
||||
description: "latest daemon health"
|
||||
}),
|
||||
authorityPolicy: CultMesh.projectionSource("daemon:aetheria.authority.policy.latest.v1", {
|
||||
authorityPolicy: CultMesh.querySource("daemon:aetheria.authority.policy.latest.v1", {
|
||||
schemaId: AetheriaRtsSchemas.verseAuthorityPolicy,
|
||||
description: "latest Verse authority policy"
|
||||
}),
|
||||
starbridgeSession: CultMesh.projectionSource("daemon:aetheria.starbridge.session.latest.v1", {
|
||||
starbridgeSession: CultMesh.querySource("daemon:aetheria.starbridge.session.latest.v1", {
|
||||
schemaId: AetheriaRtsSchemas.starbridgeSessionSummary,
|
||||
description: "latest Starbridge session summary"
|
||||
}),
|
||||
assetManifest: CultMesh.projectionSource("daemon:aetheria.asset_manifest.latest.v1", {
|
||||
assetManifest: CultMesh.querySource("daemon:aetheria.asset_manifest.latest.v1", {
|
||||
schemaId: AetheriaRtsSchemas.assetManifest,
|
||||
description: "latest daemon asset manifest"
|
||||
})
|
||||
|
|
@ -606,48 +606,48 @@ export function createAetheriaRuntimeRtsDocuments(
|
|||
) {
|
||||
return {
|
||||
daemonFrame: CultMesh.document(
|
||||
AetheriaRuntimeRtsProjectionSources.daemonFrame.sourceId,
|
||||
AetheriaRuntimeRtsDocumentSources.daemonFrame.sourceId,
|
||||
{ schemaId: AetheriaRtsSchemas.daemonFrame },
|
||||
async (context) => resolvers.daemonFrame?.(context),
|
||||
{
|
||||
routeHint,
|
||||
sources: [AetheriaRuntimeRtsProjectionSources.daemonFrame],
|
||||
sources: [AetheriaRuntimeRtsDocumentSources.daemonFrame],
|
||||
},
|
||||
),
|
||||
daemonHealth: CultMesh.document(
|
||||
AetheriaRuntimeRtsProjectionSources.daemonHealth.sourceId,
|
||||
AetheriaRuntimeRtsDocumentSources.daemonHealth.sourceId,
|
||||
{ schemaId: AetheriaRtsSchemas.daemonHealth },
|
||||
async (context) => resolvers.daemonHealth?.(context),
|
||||
{
|
||||
routeHint,
|
||||
sources: [AetheriaRuntimeRtsProjectionSources.daemonHealth],
|
||||
sources: [AetheriaRuntimeRtsDocumentSources.daemonHealth],
|
||||
},
|
||||
),
|
||||
authorityPolicy: CultMesh.document(
|
||||
AetheriaRuntimeRtsProjectionSources.authorityPolicy.sourceId,
|
||||
AetheriaRuntimeRtsDocumentSources.authorityPolicy.sourceId,
|
||||
{ schemaId: AetheriaRtsSchemas.verseAuthorityPolicy },
|
||||
async (context) => resolvers.authorityPolicy?.(context),
|
||||
{
|
||||
routeHint,
|
||||
sources: [AetheriaRuntimeRtsProjectionSources.authorityPolicy],
|
||||
sources: [AetheriaRuntimeRtsDocumentSources.authorityPolicy],
|
||||
},
|
||||
),
|
||||
starbridgeSession: CultMesh.document(
|
||||
AetheriaRuntimeRtsProjectionSources.starbridgeSession.sourceId,
|
||||
AetheriaRuntimeRtsDocumentSources.starbridgeSession.sourceId,
|
||||
{ schemaId: AetheriaRtsSchemas.starbridgeSessionSummary },
|
||||
async (context) => resolvers.starbridgeSession?.(context),
|
||||
{
|
||||
routeHint,
|
||||
sources: [AetheriaRuntimeRtsProjectionSources.starbridgeSession],
|
||||
sources: [AetheriaRuntimeRtsDocumentSources.starbridgeSession],
|
||||
},
|
||||
),
|
||||
assetManifest: CultMesh.document(
|
||||
AetheriaRuntimeRtsProjectionSources.assetManifest.sourceId,
|
||||
AetheriaRuntimeRtsDocumentSources.assetManifest.sourceId,
|
||||
{ schemaId: AetheriaRtsSchemas.assetManifest },
|
||||
async (context) => resolvers.assetManifest?.(context),
|
||||
{
|
||||
routeHint,
|
||||
sources: [AetheriaRuntimeRtsProjectionSources.assetManifest],
|
||||
sources: [AetheriaRuntimeRtsDocumentSources.assetManifest],
|
||||
},
|
||||
),
|
||||
} as const;
|
||||
|
|
@ -661,60 +661,51 @@ export function createAetheriaRuntimeRtsQueryHandles(
|
|||
watchers: AetheriaRuntimeRtsQueryWatchers = {},
|
||||
) {
|
||||
return {
|
||||
mapViewport: CultMesh.projectionRecipe<CultMeshViewportRequest, ViewportResponse>(
|
||||
mapViewport: CultMesh.query<CultMeshViewportRequest, ViewportResponse>(
|
||||
AetheriaRtsSchemas.rtsViewport,
|
||||
[AetheriaRuntimeRtsProjectionSources.daemonFrame],
|
||||
executors.mapViewport,
|
||||
{ routeHint, watchProjection: watchers.mapViewport },
|
||||
).asQuerySurface(),
|
||||
objectsViewport: CultMesh.projectionRecipe<CultMeshViewportRequest, ObjectsViewportResponse>(
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.daemonFrame], watchQuery: watchers.mapViewport },
|
||||
),
|
||||
objectsViewport: CultMesh.query<CultMeshViewportRequest, ObjectsViewportResponse>(
|
||||
AetheriaRtsSchemas.objectsViewport,
|
||||
[AetheriaRuntimeRtsProjectionSources.daemonFrame],
|
||||
executors.objectsViewport,
|
||||
{ routeHint, watchProjection: watchers.objectsViewport },
|
||||
).asQuerySurface(),
|
||||
gravityViewport: CultMesh.projectionRecipe<CultMeshViewportRequest, GravityViewportResponse>(
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.daemonFrame], watchQuery: watchers.objectsViewport },
|
||||
),
|
||||
gravityViewport: CultMesh.query<CultMeshViewportRequest, GravityViewportResponse>(
|
||||
AetheriaRtsSchemas.gravityViewport,
|
||||
[AetheriaRuntimeRtsProjectionSources.daemonFrame],
|
||||
executors.gravityViewport,
|
||||
{ routeHint, watchProjection: watchers.gravityViewport },
|
||||
).asQuerySurface(),
|
||||
selectedObject: CultMesh.projectionRecipe<AetheriaRuntimeSelectedObjectRequest, SelectedObjectProjection>(
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.daemonFrame], watchQuery: watchers.gravityViewport },
|
||||
),
|
||||
selectedObject: CultMesh.query<AetheriaRuntimeSelectedObjectRequest, SelectedObjectDocument>(
|
||||
AetheriaRtsSchemas.selectedObject,
|
||||
[AetheriaRuntimeRtsProjectionSources.daemonFrame],
|
||||
executors.selectedObject,
|
||||
{ routeHint, watchProjection: watchers.selectedObject },
|
||||
).asQuerySurface(),
|
||||
inventory: CultMesh.projectionRecipe<AetheriaRuntimeSelectedObjectRequest, InventoryProjection>(
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.daemonFrame], watchQuery: watchers.selectedObject },
|
||||
),
|
||||
inventory: CultMesh.query<AetheriaRuntimeSelectedObjectRequest, InventoryDocument>(
|
||||
AetheriaRtsSchemas.inventory,
|
||||
[AetheriaRuntimeRtsProjectionSources.daemonFrame],
|
||||
executors.inventory,
|
||||
{ routeHint, watchProjection: watchers.inventory },
|
||||
).asQuerySurface(),
|
||||
daemonHealth: CultMesh.projectionRecipe<void, DaemonHealthProjection>(
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.daemonFrame], watchQuery: watchers.inventory },
|
||||
),
|
||||
daemonHealth: CultMesh.query<void, DaemonHealthDocument>(
|
||||
AetheriaRtsSchemas.daemonHealth,
|
||||
[AetheriaRuntimeRtsProjectionSources.daemonHealth],
|
||||
executors.daemonHealth,
|
||||
{ routeHint, watchProjection: watchers.daemonHealth },
|
||||
).asQuerySurface(),
|
||||
authorityStatus: CultMesh.projectionRecipe<void, AuthorityStatusProjection>(
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.daemonHealth], watchQuery: watchers.daemonHealth },
|
||||
),
|
||||
authorityStatus: CultMesh.query<void, AuthorityStatusDocument>(
|
||||
AetheriaRtsSchemas.verseAuthorityPolicy,
|
||||
[AetheriaRuntimeRtsProjectionSources.authorityPolicy],
|
||||
executors.authorityStatus,
|
||||
{ routeHint, watchProjection: watchers.authorityStatus },
|
||||
).asQuerySurface(),
|
||||
starbridgeSession: CultMesh.projectionRecipe<void, StarbridgeSessionProjection>(
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.authorityPolicy], watchQuery: watchers.authorityStatus },
|
||||
),
|
||||
starbridgeSession: CultMesh.query<void, StarbridgeSessionDocument>(
|
||||
AetheriaRtsSchemas.starbridgeSessionSummary,
|
||||
[AetheriaRuntimeRtsProjectionSources.starbridgeSession],
|
||||
executors.starbridgeSession,
|
||||
{ routeHint, watchProjection: watchers.starbridgeSession },
|
||||
).asQuerySurface(),
|
||||
assetManifest: CultMesh.projectionRecipe<void, AssetManifestProjection>(
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.starbridgeSession], watchQuery: watchers.starbridgeSession },
|
||||
),
|
||||
assetManifest: CultMesh.query<void, AssetManifestDocument>(
|
||||
AetheriaRtsSchemas.assetManifest,
|
||||
[AetheriaRuntimeRtsProjectionSources.assetManifest],
|
||||
executors.assetManifest,
|
||||
{ routeHint, watchProjection: watchers.assetManifest },
|
||||
).asQuerySurface(),
|
||||
{ routeHint, sources: [AetheriaRuntimeRtsDocumentSources.assetManifest], watchQuery: watchers.assetManifest },
|
||||
),
|
||||
} as const;
|
||||
}
|
||||
|
||||
|
|
@ -769,15 +760,15 @@ export function describeAetheriaRuntimeRtsSurfaceCatalog(
|
|||
function describeAetheriaRuntimeRtsQuerySurface(surface: {
|
||||
queryId: string;
|
||||
routeHint: CultMeshRouteHint;
|
||||
sources: readonly CultMeshProjectionSource[];
|
||||
}): AetheriaRuntimeRtsProjectionDiagnostic {
|
||||
sources: readonly CultMeshQuerySource[];
|
||||
}): AetheriaRuntimeRtsQueryDiagnostic {
|
||||
return CultMesh.describeQuerySurface(surface);
|
||||
}
|
||||
|
||||
export function describeAetheriaRuntimeRtsLiveFeedSurface(surface: {
|
||||
feedId: string;
|
||||
routeHint: CultMeshRouteHint;
|
||||
sources: readonly CultMeshProjectionSource[];
|
||||
sources: readonly CultMeshQuerySource[];
|
||||
}): AetheriaRuntimeRtsLiveFeedDiagnostic {
|
||||
return CultMesh.describeLiveFeed(surface);
|
||||
}
|
||||
|
|
@ -824,9 +815,9 @@ export function createAetheriaRuntimeRtsOperationHandles(
|
|||
} as const;
|
||||
}
|
||||
|
||||
export type AetheriaRuntimeRtsVerseFacade = ReturnType<typeof createAetheriaRuntimeRtsVerseFacade>;
|
||||
export type AetheriaRuntimeRtsVerseHandles = ReturnType<typeof createAetheriaRuntimeRtsVerseHandles>;
|
||||
|
||||
export function createAetheriaRuntimeRtsVerseFacade(
|
||||
export function createAetheriaRuntimeRtsVerseHandles(
|
||||
queryVerse: CultMeshVerseContext,
|
||||
commandVerse: CultMeshVerseContext,
|
||||
queries: ReturnType<typeof createAetheriaRuntimeRtsQueryHandles>,
|
||||
|
|
@ -1027,28 +1018,28 @@ export type AetheriaRuntimeViewportFeedRequest = {
|
|||
|
||||
export type AetheriaRuntimeViewportFeedSnapshot = {
|
||||
viewport: ViewportResponse;
|
||||
selectedObject: SelectedObjectProjection | null;
|
||||
inventory: InventoryProjection | null;
|
||||
daemonHealth: DaemonHealthProjection;
|
||||
authorityStatus: AuthorityStatusProjection;
|
||||
starbridgeSession: StarbridgeSessionProjection;
|
||||
assetManifest: AssetManifestProjection;
|
||||
selectedObject: SelectedObjectDocument | null;
|
||||
inventory: InventoryDocument | null;
|
||||
daemonHealth: DaemonHealthDocument;
|
||||
authorityStatus: AuthorityStatusDocument;
|
||||
starbridgeSession: StarbridgeSessionDocument;
|
||||
assetManifest: AssetManifestDocument;
|
||||
receivedAtUtc: string;
|
||||
sampleMs: number;
|
||||
};
|
||||
|
||||
${renderProjectionTypes("Viewport")}
|
||||
${renderRtsDocumentTypes("Viewport")}
|
||||
|
||||
export type AetheriaRtsApi = {
|
||||
mapViewport(request: Viewport): Promise<ViewportResponse>;
|
||||
objectsViewport(request: Viewport): Promise<ObjectsViewportResponse>;
|
||||
gravityViewport(request: Viewport): Promise<GravityViewportResponse>;
|
||||
selectedObject(request: AetheriaRuntimeSelectedObjectRequest): Promise<SelectedObjectProjection>;
|
||||
inventory(request: AetheriaRuntimeSelectedObjectRequest): Promise<InventoryProjection>;
|
||||
daemonHealth(): Promise<DaemonHealthProjection>;
|
||||
authorityStatus(): Promise<AuthorityStatusProjection>;
|
||||
starbridgeSession(): Promise<StarbridgeSessionProjection>;
|
||||
assetManifest(): Promise<AssetManifestProjection>;
|
||||
selectedObject(request: AetheriaRuntimeSelectedObjectRequest): Promise<SelectedObjectDocument>;
|
||||
inventory(request: AetheriaRuntimeSelectedObjectRequest): Promise<InventoryDocument>;
|
||||
daemonHealth(): Promise<DaemonHealthDocument>;
|
||||
authorityStatus(): Promise<AuthorityStatusDocument>;
|
||||
starbridgeSession(): Promise<StarbridgeSessionDocument>;
|
||||
assetManifest(): Promise<AssetManifestDocument>;
|
||||
watchViewportFeed(request: AetheriaRuntimeViewportFeedRequest, callback: (snapshot: AetheriaRuntimeViewportFeedSnapshot) => void): () => void;
|
||||
setMoveVector(request: AetheriaRuntimeSetMoveVectorRequest): Promise<AetheriaRuntimeDaemonCommandReceipt>;
|
||||
setTarget(request: AetheriaRuntimeSetTargetRequest): Promise<AetheriaRuntimeDaemonCommandReceipt>;
|
||||
|
|
@ -1059,7 +1050,7 @@ export type AetheriaRtsApi = {
|
|||
`;
|
||||
}
|
||||
|
||||
function renderProjectionTypes(viewportTypeName) {
|
||||
function renderRtsDocumentTypes(viewportTypeName) {
|
||||
return `export type ViewportResponse = {
|
||||
schema: string;
|
||||
frameId: number;
|
||||
|
|
@ -1141,7 +1132,7 @@ export type InventoryItem = {
|
|||
iconAsset: AssetRef;
|
||||
};
|
||||
|
||||
export type SelectedObjectProjection = {
|
||||
export type SelectedObjectDocument = {
|
||||
schema: string;
|
||||
frameId: number;
|
||||
runId: string;
|
||||
|
|
@ -1150,7 +1141,7 @@ export type SelectedObjectProjection = {
|
|||
selected: ViewObject | null;
|
||||
};
|
||||
|
||||
export type InventoryProjection = {
|
||||
export type InventoryDocument = {
|
||||
schema: string;
|
||||
frameId: number;
|
||||
runId: string;
|
||||
|
|
@ -1162,7 +1153,7 @@ export type InventoryProjection = {
|
|||
cargo: InventoryItem[];
|
||||
};
|
||||
|
||||
export type DaemonHealthProjection = {
|
||||
export type DaemonHealthDocument = {
|
||||
schema: string;
|
||||
daemonId: string;
|
||||
verseId: string;
|
||||
|
|
@ -1178,7 +1169,7 @@ export type DaemonHealthProjection = {
|
|||
commandBoundaryPath: string;
|
||||
};
|
||||
|
||||
export type AuthorityStatusProjection = {
|
||||
export type AuthorityStatusDocument = {
|
||||
schema: string;
|
||||
verseId: string;
|
||||
policyId: string;
|
||||
|
|
@ -1186,10 +1177,10 @@ export type AuthorityStatusProjection = {
|
|||
hostRuntimeId: string;
|
||||
defaultMode: string;
|
||||
updatedAtUtc: string;
|
||||
rules: AuthorityRuleProjection[];
|
||||
rules: AuthorityRuleDocument[];
|
||||
};
|
||||
|
||||
export type AuthorityRuleProjection = {
|
||||
export type AuthorityRuleDocument = {
|
||||
ruleId: string;
|
||||
subjectPrefix: string;
|
||||
claimKinds: string[];
|
||||
|
|
@ -1199,7 +1190,7 @@ export type AuthorityRuleProjection = {
|
|||
priority: number;
|
||||
};
|
||||
|
||||
export type StarbridgeSessionProjection = {
|
||||
export type StarbridgeSessionDocument = {
|
||||
schema: string;
|
||||
frameId: number;
|
||||
publishedAtUtc: string;
|
||||
|
|
@ -1211,13 +1202,13 @@ export type StarbridgeSessionProjection = {
|
|||
zoneName: string;
|
||||
phase: string;
|
||||
currentWaveIndex: number;
|
||||
baseStatus: StarbridgeBaseStatusProjection;
|
||||
stationStock: StarbridgeStationStockItemProjection[];
|
||||
waveForecast: StarbridgeWaveForecastProjection[];
|
||||
runtimeRoles: StarbridgeRuntimeRoleProjection[];
|
||||
baseStatus: StarbridgeBaseStatusDocument;
|
||||
stationStock: StarbridgeStationStockItemDocument[];
|
||||
waveForecast: StarbridgeWaveForecastDocument[];
|
||||
runtimeRoles: StarbridgeRuntimeRoleDocument[];
|
||||
};
|
||||
|
||||
export type StarbridgeBaseStatusProjection = {
|
||||
export type StarbridgeBaseStatusDocument = {
|
||||
entityKey: string;
|
||||
displayName: string;
|
||||
hull: number;
|
||||
|
|
@ -1226,7 +1217,7 @@ export type StarbridgeBaseStatusProjection = {
|
|||
isActive: boolean;
|
||||
};
|
||||
|
||||
export type StarbridgeStationStockItemProjection = {
|
||||
export type StarbridgeStationStockItemDocument = {
|
||||
itemKey: string;
|
||||
quantity: number;
|
||||
quality: number;
|
||||
|
|
@ -1235,7 +1226,7 @@ export type StarbridgeStationStockItemProjection = {
|
|||
iconAsset: AssetRef;
|
||||
};
|
||||
|
||||
export type AssetManifestProjection = {
|
||||
export type AssetManifestDocument = {
|
||||
schema: string;
|
||||
publishedAtUtc: string;
|
||||
runId: string;
|
||||
|
|
@ -1261,7 +1252,7 @@ export type AssetRef = {
|
|||
metadata: Record<string, string>;
|
||||
};
|
||||
|
||||
export type StarbridgeWaveForecastProjection = {
|
||||
export type StarbridgeWaveForecastDocument = {
|
||||
waveIndex: number;
|
||||
displayName: string;
|
||||
attackerKeys: string[];
|
||||
|
|
@ -1269,7 +1260,7 @@ export type StarbridgeWaveForecastProjection = {
|
|||
recoveredTechnologyKeys: string[];
|
||||
};
|
||||
|
||||
export type StarbridgeRuntimeRoleProjection = {
|
||||
export type StarbridgeRuntimeRoleDocument = {
|
||||
runtimeId: string;
|
||||
role: string;
|
||||
entityKey: string;
|
||||
|
|
|
|||
|
|
@ -146,8 +146,8 @@ $requiredGeneratedBindingSymbols = @(
|
|||
'aetheriaRuntimeDaemonCommandDocumentSlots',
|
||||
'encodeSetMoveVectorCommand',
|
||||
'encodeSetTargetCommand',
|
||||
'AetheriaRuntimeRtsProjectionSources',
|
||||
'AetheriaRuntimeRtsProjectionDiagnostic',
|
||||
'AetheriaRuntimeRtsDocumentSources',
|
||||
'AetheriaRuntimeRtsQueryDiagnostic',
|
||||
'AetheriaRuntimeRtsLiveFeedDiagnostic',
|
||||
'AetheriaRuntimeRtsSurfaceCatalogDiagnostic',
|
||||
'AetheriaRuntimeRtsDocuments',
|
||||
|
|
@ -161,9 +161,9 @@ $requiredGeneratedBindingSymbols = @(
|
|||
'surfaceCatalogIndexDiagnostics(): CultMeshSurfaceCatalogIndexDiagnostic',
|
||||
'ipcMain.handle(AetheriaRtsIpcChannels.surfaceCatalog',
|
||||
'ipcMain.handle(AetheriaRtsIpcChannels.surfaceCatalogIndex',
|
||||
'CultMesh.projectionSource',
|
||||
'CultMesh.projectionRecipe',
|
||||
'CultMeshProjectionSource',
|
||||
'CultMesh.querySource',
|
||||
'CultMesh.query',
|
||||
'CultMeshQuerySource',
|
||||
'routeHint: CultMeshRouteHint',
|
||||
'CultMeshQueryWatcher',
|
||||
'AetheriaRuntimeRtsQueryWatchers',
|
||||
|
|
@ -171,9 +171,8 @@ $requiredGeneratedBindingSymbols = @(
|
|||
'CultMesh.document',
|
||||
'CultMesh.bindDocument',
|
||||
'CultMesh.describeSurface(documents.daemonFrame)',
|
||||
'routeHint, watchProjection',
|
||||
'watchProjection: watchers.objectsViewport',
|
||||
'.asQuerySurface()',
|
||||
'watchQuery: watchers.objectsViewport',
|
||||
'sources: [AetheriaRuntimeRtsDocumentSources.daemonFrame]',
|
||||
'describeAetheriaRuntimeRtsQueryHandles',
|
||||
'describeAetheriaRuntimeRtsLiveFeedSurface',
|
||||
'describeAetheriaRuntimeRtsSurfaceCatalog',
|
||||
|
|
@ -186,19 +185,19 @@ $requiredGeneratedBindingSymbols = @(
|
|||
'CultMesh.operation',
|
||||
'CultMesh.operationReceipt',
|
||||
'AetheriaRuntimeRtsOperationHandles',
|
||||
'AetheriaRuntimeRtsVerseFacade',
|
||||
'createAetheriaRuntimeRtsVerseFacade',
|
||||
'AetheriaRuntimeRtsVerseHandles',
|
||||
'createAetheriaRuntimeRtsVerseHandles',
|
||||
'CultMesh.bindQuery',
|
||||
'CultMesh.bindOperation',
|
||||
'zone: (_zoneId =',
|
||||
'visibleWithin',
|
||||
'entity: (entityKey: string)',
|
||||
'pilot',
|
||||
'selectedObject: CultMesh.projectionRecipe',
|
||||
'inventory: CultMesh.projectionRecipe',
|
||||
'daemonHealth: CultMesh.projectionRecipe',
|
||||
'authorityStatus: CultMesh.projectionRecipe',
|
||||
'starbridgeSession: CultMesh.projectionRecipe'
|
||||
'selectedObject: CultMesh.query',
|
||||
'inventory: CultMesh.query',
|
||||
'daemonHealth: CultMesh.query',
|
||||
'authorityStatus: CultMesh.query',
|
||||
'starbridgeSession: CultMesh.query'
|
||||
)
|
||||
|
||||
foreach ($symbol in $requiredGeneratedBindingSymbols) {
|
||||
|
|
@ -208,17 +207,17 @@ foreach ($symbol in $requiredGeneratedBindingSymbols) {
|
|||
}
|
||||
}
|
||||
|
||||
$forbiddenGeneratedQuerySurfaceHits = & rg -n 'CultMesh\.query\s*[<(]' Electron/aetheria-rts-generated-bindings.ts 2>$null
|
||||
$forbiddenGeneratedQuerySurfaceHits = & rg -n 'CultMesh\.(projectionRecipe|projectionSource)\s*[<(]' Electron/aetheria-rts-generated-bindings.ts 2>$null
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Error "Stage 7B verifier failed: generated RTS read surfaces should use CultMesh projection recipes, not raw query wrappers.`n$forbiddenGeneratedQuerySurfaceHits"
|
||||
Write-Error "Stage 7B verifier failed: generated RTS read surfaces should use CultMesh query/document handles, not projection recipes or projection sources.`n$forbiddenGeneratedQuerySurfaceHits"
|
||||
}
|
||||
if ($LASTEXITCODE -gt 1) {
|
||||
Write-Error "Stage 7B verifier could not run rg for generated projection recipe checks."
|
||||
Write-Error "Stage 7B verifier could not run rg for generated projection vocabulary checks."
|
||||
}
|
||||
|
||||
$forbiddenGeneratedContextPlumbingHits = & rg -n 'CultMesh\.(queryContextFromVerse|operationContextFromVerse)|\.execute\([^,\n]+,\s*queryContext\(|\.invoke\([^,\n]+,\s*operationContext\(' Electron/aetheria-rts-generated-bindings.ts 2>$null
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Error "Stage 7B verifier failed: generated RTS facade should bind surfaces to Verse contexts instead of threading context plumbing.`n$forbiddenGeneratedContextPlumbingHits"
|
||||
Write-Error "Stage 7B verifier failed: generated RTS handles should bind surfaces to Verse contexts instead of threading context plumbing.`n$forbiddenGeneratedContextPlumbingHits"
|
||||
}
|
||||
if ($LASTEXITCODE -gt 1) {
|
||||
Write-Error "Stage 7B verifier could not run rg for generated Verse binding checks."
|
||||
|
|
@ -247,7 +246,7 @@ if (-not $clientText.Contains('this.verse = CultMesh.verse("aetheria.local", thi
|
|||
|
||||
if (-not $clientText.Contains('? this.verse.withRoute("network", this.publicationDescription)') -or
|
||||
-not $clientText.Contains(': this.verse.withRoute("shared-memory", this.publicationDescription)')) {
|
||||
Write-Error "Stage 7B verifier failed: RTS client is not deriving publication-mode Verse views for projection reads."
|
||||
Write-Error "Stage 7B verifier failed: RTS client is not deriving publication-mode Verse views for query reads."
|
||||
}
|
||||
|
||||
if (-not $clientText.Contains('this.commandVerse = this.verse') -or
|
||||
|
|
@ -257,14 +256,14 @@ if (-not $clientText.Contains('this.commandVerse = this.verse') -or
|
|||
}
|
||||
|
||||
if (-not $clientText.Contains('this.publicationDescription = publicationMode === "remote" ? this.endpoint : statePath')) {
|
||||
Write-Error "Stage 7B verifier failed: RTS client projection route metadata does not include the local publication source description."
|
||||
Write-Error "Stage 7B verifier failed: RTS client query route metadata does not include the local publication source description."
|
||||
}
|
||||
|
||||
if (-not $clientText.Contains('return this.queryVerse.queryContext();')) {
|
||||
Write-Error "Stage 7B verifier failed: RTS query call sites should derive query contexts from the shared Verse primitive."
|
||||
}
|
||||
|
||||
if (-not $clientText.Contains('this.aetheria = createAetheriaRuntimeRtsVerseFacade(')) {
|
||||
if (-not $clientText.Contains('this.aetheria = createAetheriaRuntimeRtsVerseHandles(')) {
|
||||
Write-Error "Stage 7B verifier failed: RTS client should bind generated Aetheria domain sugar to its Verse contexts."
|
||||
}
|
||||
|
||||
|
|
@ -282,12 +281,12 @@ if ($LASTEXITCODE -gt 1) {
|
|||
Write-Error "Stage 7B verifier could not run rg for raw context checks."
|
||||
}
|
||||
|
||||
if (-not $clientText.Contains('projectionDiagnostics()')) {
|
||||
Write-Error "Stage 7B verifier failed: RTS client does not expose generated projection diagnostics."
|
||||
if (-not $clientText.Contains('queryDiagnostics()')) {
|
||||
Write-Error "Stage 7B verifier failed: RTS client does not expose generated query diagnostics."
|
||||
}
|
||||
|
||||
if (-not $clientText.Contains('describeAetheriaRuntimeRtsQueryHandles(this.queries)')) {
|
||||
Write-Error "Stage 7B verifier failed: RTS projection diagnostics should be read from generated query handle metadata."
|
||||
Write-Error "Stage 7B verifier failed: RTS query diagnostics should be read from generated query handle metadata."
|
||||
}
|
||||
|
||||
if (-not $clientText.Contains('liveFeedDiagnostics()')) {
|
||||
|
|
@ -374,20 +373,20 @@ if ($LASTEXITCODE -ne 0) {
|
|||
Write-Error "Stage 7B verifier failed: Electron main is not using generated RTS IPC handler registration."
|
||||
}
|
||||
|
||||
$forbiddenClientDirectProjectionReturns = @(
|
||||
$forbiddenClientDirectDocumentReturns = @(
|
||||
'return projectSelectedObjectFromFrame',
|
||||
'return projectInventoryFromFrame',
|
||||
'return projectDaemonHealth',
|
||||
'return projectAuthorityStatus',
|
||||
'return projectStarbridgeSessionSummary'
|
||||
)
|
||||
$forbiddenClientDirectProjectionPattern = ($forbiddenClientDirectProjectionReturns -join '|')
|
||||
$forbiddenClientDirectProjectionHits = & rg -n $forbiddenClientDirectProjectionPattern Electron/aetheria-cultmesh.ts 2>$null
|
||||
$forbiddenClientDirectDocumentPattern = ($forbiddenClientDirectDocumentReturns -join '|')
|
||||
$forbiddenClientDirectDocumentHits = & rg -n $forbiddenClientDirectDocumentPattern Electron/aetheria-cultmesh.ts 2>$null
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Error "Stage 7B verifier failed: RTS client read methods bypass generated query handles.`n$forbiddenClientDirectProjectionHits"
|
||||
Write-Error "Stage 7B verifier failed: RTS client read methods bypass generated query handles.`n$forbiddenClientDirectDocumentHits"
|
||||
}
|
||||
if ($LASTEXITCODE -gt 1) {
|
||||
Write-Error "Stage 7B verifier could not run rg for direct projection return checks."
|
||||
Write-Error "Stage 7B verifier could not run rg for direct document return checks."
|
||||
}
|
||||
|
||||
$requiredRendererContractSymbols = @(
|
||||
|
|
@ -462,30 +461,30 @@ if ($LASTEXITCODE -gt 1) {
|
|||
Write-Error "Stage 7B verifier could not run rg for stale binding checks."
|
||||
}
|
||||
|
||||
& rg -q 'projectViewportFromFrame' Electron/aetheria-rts-local-projection.ts
|
||||
& rg -q 'buildViewportDocumentFromFrame' Electron/aetheria-rts-local-documents.ts
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Stage 7B verifier failed: local RTS frame projection entry point was not found."
|
||||
Write-Error "Stage 7B verifier failed: local RTS frame document entry point was not found."
|
||||
}
|
||||
|
||||
$requiredProjectionSymbols = @(
|
||||
'projectObjectsViewportFromFrame',
|
||||
'projectGravityViewportFromFrame',
|
||||
$requiredLocalDocumentSymbols = @(
|
||||
'buildObjectsViewportDocumentFromFrame',
|
||||
'buildGravityViewportDocumentFromFrame',
|
||||
'AetheriaRtsSchemas.objectsViewport',
|
||||
'AetheriaRtsSchemas.gravityViewport',
|
||||
'projectSelectedObjectFromFrame',
|
||||
'projectInventoryFromFrame',
|
||||
'buildSelectedObjectDocumentFromFrame',
|
||||
'buildInventoryDocumentFromFrame',
|
||||
'AetheriaRtsSchemas.selectedObject',
|
||||
'AetheriaRtsSchemas.inventory',
|
||||
'projectDaemonHealth',
|
||||
'projectAuthorityStatus',
|
||||
'projectStarbridgeSessionSummary',
|
||||
'readDaemonHealthDocument',
|
||||
'readAuthorityStatusDocument',
|
||||
'readStarbridgeSessionSummaryDocument',
|
||||
'AetheriaRtsSchemas.starbridgeSessionSummary'
|
||||
)
|
||||
|
||||
foreach ($symbol in $requiredProjectionSymbols) {
|
||||
& rg -q $symbol Electron/aetheria-rts-local-projection.ts
|
||||
foreach ($symbol in $requiredLocalDocumentSymbols) {
|
||||
& rg -q $symbol Electron/aetheria-rts-local-documents.ts
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Stage 7B verifier failed: expected local RTS projection symbol '$symbol' was not found."
|
||||
Write-Error "Stage 7B verifier failed: expected local RTS document symbol '$symbol' was not found."
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -507,9 +506,17 @@ if ($LASTEXITCODE -ne 0) {
|
|||
Write-Error "Stage 7B verifier failed: Starbridge summary publication binding was not found."
|
||||
}
|
||||
|
||||
& rg -q '.daemon.starbridge.session.cc' Electron/aetheria-cultmesh.ts
|
||||
$forbiddenLocalPublicationSidecars = & rg -n '\.(daemon\.frame|daemon\.health|authority\.policy|daemon\.starbridge\.session|daemon\.assets)\.cc' Electron/aetheria-cultmesh.ts 2>$null
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Error "Stage 7B verifier failed: RTS client should read local publications from the canonical daemon store, not obsolete sidecar files.`n$forbiddenLocalPublicationSidecars"
|
||||
}
|
||||
if ($LASTEXITCODE -gt 1) {
|
||||
Write-Error "Stage 7B verifier could not run rg for obsolete local publication sidecar checks."
|
||||
}
|
||||
|
||||
& rg -q 'localPath: statePath' Electron/aetheria-cultmesh.ts
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Stage 7B verifier failed: RTS client is not reading the daemon Starbridge sidecar publication."
|
||||
Write-Error "Stage 7B verifier failed: RTS client local publication bindings do not point at the canonical daemon store."
|
||||
}
|
||||
|
||||
$requiredGeneratedBindingSymbols = @(
|
||||
|
|
|
|||
|
|
@ -15,10 +15,17 @@ $statePath = Join-Path $tempRoot "aetheria-rts.cc"
|
|||
$endpoint = $null
|
||||
|
||||
try {
|
||||
$daemonOutput = dotnet run --project (Join-Path $repoRoot "Aetheria.State.Daemon\Aetheria.State.Daemon.csproj") -- `
|
||||
--state $statePath `
|
||||
--once `
|
||||
--rts-cultmesh-port 0 2>&1
|
||||
$previousErrorActionPreference = $ErrorActionPreference
|
||||
$ErrorActionPreference = "Continue"
|
||||
try {
|
||||
$daemonOutput = dotnet run --project (Join-Path $repoRoot "Aetheria.State.Daemon\Aetheria.State.Daemon.csproj") -- `
|
||||
--state $statePath `
|
||||
--once `
|
||||
--rts-cultmesh-port 0 2>&1
|
||||
}
|
||||
finally {
|
||||
$ErrorActionPreference = $previousErrorActionPreference
|
||||
}
|
||||
$daemonOutput | Out-Host
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Stage 7C verifier failed: one-shot daemon did not complete."
|
||||
|
|
@ -52,9 +59,9 @@ const viewport = await client.mapViewport({ minX: -5000, minY: -5000, maxX: 5000
|
|||
const objectsViewport = await client.objectsViewport({ minX: -5000, minY: -5000, maxX: 5000, maxY: 5000 });
|
||||
const gravityViewport = await client.gravityViewport({ minX: -5000, minY: -5000, maxX: 5000, maxY: 5000 });
|
||||
if (!Number.isFinite(viewport.frameId))
|
||||
throw new Error("Viewport projection did not produce a frame id.");
|
||||
throw new Error("Viewport query did not produce a frame id.");
|
||||
if (!Array.isArray(viewport.objects) || viewport.objects.length === 0)
|
||||
throw new Error("Viewport projection did not expose visible objects.");
|
||||
throw new Error("Viewport query did not expose visible objects.");
|
||||
if (objectsViewport.schema !== "gamecult.aetheria.objects_viewport.v1")
|
||||
throw new Error(`Objects viewport used unexpected schema: ${objectsViewport.schema}`);
|
||||
if (gravityViewport.schema !== "gamecult.aetheria.gravity_viewport.v1")
|
||||
|
|
@ -66,19 +73,19 @@ if (!Array.isArray(gravityViewport.gravityInfluences) || gravityViewport.gravity
|
|||
|
||||
const selectedIndex = viewport.controlledEntityIndices[0] ?? viewport.objects[0]?.entityIndex;
|
||||
if (!Number.isFinite(selectedIndex))
|
||||
throw new Error("No entity was available for selected-object projection.");
|
||||
throw new Error("No entity was available for the selected-object query.");
|
||||
|
||||
const selected = await client.selectedObject({ entityIndex: selectedIndex });
|
||||
if (!selected.selected)
|
||||
throw new Error(`Selected-object projection did not resolve entity ${selectedIndex}.`);
|
||||
throw new Error(`Selected-object query did not resolve entity ${selectedIndex}.`);
|
||||
|
||||
const inventory = await client.inventory({ entityIndex: selectedIndex });
|
||||
if (!Array.isArray(inventory.equipment) || !Array.isArray(inventory.cargo))
|
||||
throw new Error("Inventory projection did not return equipment and cargo arrays.");
|
||||
throw new Error("Inventory query did not return equipment and cargo arrays.");
|
||||
|
||||
const health = await client.daemonHealth();
|
||||
if (health.status !== "healthy")
|
||||
throw new Error(`Daemon health projection was not healthy: ${health.status}`);
|
||||
throw new Error(`Daemon health document was not healthy: ${health.status}`);
|
||||
|
||||
const authority = await client.authorityStatus();
|
||||
if (authority.policyId !== "aetheria.trusted-coop.v1")
|
||||
|
|
@ -146,7 +153,7 @@ console.log(JSON.stringify({
|
|||
$env:AETHERIA_STAGE7C_CLIENT_MODULE = Join-Path $root "electron-dist\aetheria-cultmesh.js"
|
||||
node $smokeScript
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Stage 7C verifier failed: local Electron runtime facade could not read daemon publications."
|
||||
Write-Error "Stage 7C verifier failed: local Electron runtime handles could not read daemon publications."
|
||||
}
|
||||
}
|
||||
finally {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ internal sealed class AuthoritySmokeChecks
|
|||
PreRejectedCommandsEnterFrameReceipts();
|
||||
ClientTargetCarriesRuntimeIdentity();
|
||||
TwoLocalRuntimeDelegatedPolicyHarness();
|
||||
RtsProjectionProjectsLocalViewportFromFrame();
|
||||
RtsDocumentsBuildLocalViewportFromFrame();
|
||||
StarbridgeSessionSummaryProjectsScenarioFacts();
|
||||
await AetheriaClientStateDocumentsProjectAndSubmitAsync().ConfigureAwait(false);
|
||||
await DaemonOncePublishesStarbridgeSessionFactsAsync().ConfigureAwait(false);
|
||||
|
|
@ -282,28 +282,28 @@ internal sealed class AuthoritySmokeChecks
|
|||
Require(starfireFrame.AccountedCommandIds.Contains(hostileByStarfire.CommandId), "starfire node should account applied hostile command");
|
||||
}
|
||||
|
||||
private static void RtsProjectionProjectsLocalViewportFromFrame()
|
||||
private static void RtsDocumentsBuildLocalViewportFromFrame()
|
||||
{
|
||||
var run = new AetheriaRuntimeRunCheckpointCommit
|
||||
{
|
||||
RunId = "rts-projection-smoke",
|
||||
RunId = "rts-documents-smoke",
|
||||
CurrentZoneIndex = 0,
|
||||
EntranceZoneIndex = 0,
|
||||
ExitZoneIndex = 1,
|
||||
DiscoveredZoneIndices = [0],
|
||||
CurrentEntityKey = EntityKey("rts-projection-smoke", 0, 0),
|
||||
CurrentEntityKey = EntityKey("rts-documents-smoke", 0, 0),
|
||||
Zones =
|
||||
[
|
||||
new AetheriaRuntimeZoneSnapshotCommit
|
||||
{
|
||||
ZoneIndex = 0,
|
||||
Name = "Projection Zone",
|
||||
Name = "Document Zone",
|
||||
PositionX = 12,
|
||||
PositionY = 34,
|
||||
AdjacentZoneIndices = [1],
|
||||
Entities =
|
||||
[
|
||||
ProjectionEntity(
|
||||
SnapshotEntity(
|
||||
0,
|
||||
"Raven",
|
||||
"player",
|
||||
|
|
@ -312,7 +312,7 @@ internal sealed class AuthoritySmokeChecks
|
|||
visibility: 80,
|
||||
hull: 120,
|
||||
cargoItem: "reactor-cell"),
|
||||
ProjectionEntity(
|
||||
SnapshotEntity(
|
||||
1,
|
||||
"Starfire",
|
||||
"player",
|
||||
|
|
@ -321,7 +321,7 @@ internal sealed class AuthoritySmokeChecks
|
|||
visibility: 160,
|
||||
hull: 140,
|
||||
cargoItem: "sensor-pack"),
|
||||
ProjectionEntity(
|
||||
SnapshotEntity(
|
||||
2,
|
||||
"Raider In Shared Sight",
|
||||
"raider",
|
||||
|
|
@ -330,7 +330,7 @@ internal sealed class AuthoritySmokeChecks
|
|||
visibility: 60,
|
||||
hull: 70,
|
||||
cargoItem: "scrap"),
|
||||
ProjectionEntity(
|
||||
SnapshotEntity(
|
||||
3,
|
||||
"Outside Viewport",
|
||||
"raider",
|
||||
|
|
@ -372,7 +372,7 @@ internal sealed class AuthoritySmokeChecks
|
|||
new AetheriaRuntimeZoneSnapshotCommit
|
||||
{
|
||||
ZoneIndex = 1,
|
||||
Name = "Projection Neighbor",
|
||||
Name = "Document Neighbor",
|
||||
PositionX = 72,
|
||||
PositionY = 34,
|
||||
AdjacentZoneIndices = [0],
|
||||
|
|
@ -383,13 +383,13 @@ internal sealed class AuthoritySmokeChecks
|
|||
};
|
||||
var frame = AetheriaRuntimeDaemonFrameDocument.Create(
|
||||
run,
|
||||
"projection-daemon",
|
||||
"projection-session",
|
||||
"documents-daemon",
|
||||
"documents-session",
|
||||
12,
|
||||
0.24,
|
||||
0.02);
|
||||
|
||||
var projection = AetheriaRuntimeRtsProjection.ProjectViewport(
|
||||
var viewportDocument = AetheriaRuntimeRtsDocuments.Viewport(
|
||||
frame,
|
||||
new AetheriaRuntimeRtsViewportBounds
|
||||
{
|
||||
|
|
@ -398,45 +398,45 @@ internal sealed class AuthoritySmokeChecks
|
|||
MaxX = -50,
|
||||
MaxY = 100
|
||||
});
|
||||
var objectProjection = AetheriaRuntimeRtsProjection.ProjectObjectsViewport(
|
||||
var objectsViewport = AetheriaRuntimeRtsDocuments.ObjectsViewport(
|
||||
frame,
|
||||
projection.Viewport);
|
||||
var gravityProjection = AetheriaRuntimeRtsProjection.ProjectGravityViewport(
|
||||
viewportDocument.Viewport);
|
||||
var gravityViewport = AetheriaRuntimeRtsDocuments.GravityViewport(
|
||||
frame,
|
||||
projection.Viewport);
|
||||
var currentZone = AetheriaRuntimeRtsProjection.ProjectCurrentZone(frame);
|
||||
var sectorMap = AetheriaRuntimeRtsProjection.ProjectSectorMap(frame);
|
||||
viewportDocument.Viewport);
|
||||
var currentZone = AetheriaRuntimeRtsDocuments.CurrentZone(frame);
|
||||
var sectorMap = AetheriaRuntimeRtsDocuments.SectorMap(frame);
|
||||
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.RtsViewport, projection.Schema, "projection schema");
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.ObjectsViewport, objectProjection.Schema, "objects viewport projection schema");
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.GravityViewport, gravityProjection.Schema, "gravity viewport projection schema");
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.CurrentZone, currentZone.Schema, "current-zone projection schema");
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.SectorMap, sectorMap.Schema, "sector-map projection schema");
|
||||
RequireEqual("Projection Zone", currentZone.ZoneName, "current-zone projection zone name");
|
||||
RequireEqual(12.0, currentZone.PositionX, "current-zone projection position x");
|
||||
RequireEqual(34.0, currentZone.PositionY, "current-zone projection position y");
|
||||
RequireEqual(2, sectorMap.Zones.Count, "sector-map projection zone count");
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.RtsViewport, viewportDocument.Schema, "viewport document schema");
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.ObjectsViewport, objectsViewport.Schema, "objects viewport document schema");
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.GravityViewport, gravityViewport.Schema, "gravity viewport document schema");
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.CurrentZone, currentZone.Schema, "current-zone document schema");
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.SectorMap, sectorMap.Schema, "sector-map document schema");
|
||||
RequireEqual("Document Zone", currentZone.ZoneName, "current-zone document zone name");
|
||||
RequireEqual(12.0, currentZone.PositionX, "current-zone document position x");
|
||||
RequireEqual(34.0, currentZone.PositionY, "current-zone document position y");
|
||||
RequireEqual(2, sectorMap.Zones.Count, "sector-map document zone count");
|
||||
Require(sectorMap.Zones.Any(zone => zone.ZoneIndex == 0 && zone.Current && zone.Entrance && zone.Discovered), "sector-map should mark current entrance zone");
|
||||
Require(sectorMap.Zones.Any(zone => zone.ZoneIndex == 1 && zone.Exit && !zone.Discovered), "sector-map should mark undiscovered exit zone");
|
||||
Require(sectorMap.Links.Any(link => link.FromZoneIndex == 0 && link.ToZoneIndex == 1 && !link.Discovered), "sector-map should include normalized topology link");
|
||||
RequireEqual(12L, projection.FrameId, "projection frame id");
|
||||
RequireEqual(-50.0, projection.Viewport.MinX, "normalized viewport min x");
|
||||
RequireEqual(500.0, projection.Viewport.MaxX, "normalized viewport max x");
|
||||
Require(projection.ControlledEntityIndices.SequenceEqual([0, 1]), "projection should expose controlled unit set");
|
||||
Require(projection.Objects.Any(item => item.DisplayName == "Raider In Shared Sight"), "projection should use union of controlled unit visibility");
|
||||
Require(!projection.Objects.Any(item => item.DisplayName == "Outside Viewport"), "projection should exclude objects outside viewport");
|
||||
Require(objectProjection.Objects.Select(item => item.EntityIndex).SequenceEqual(projection.Objects.Select(item => item.EntityIndex)), "objects viewport should match composed map object set");
|
||||
var raven = projection.Objects.First(item => item.DisplayName == "Raven");
|
||||
RequireEqual(120.0, raven.Status.Hull, "projection should include entity status");
|
||||
Require(raven.Inventory.Any(item => item.ItemKey == "reactor-cell" && item.Source == "cargo"), "projection should include inventory");
|
||||
Require(projection.GravityInfluences.Any(item => item.BodyKey == "body:near"), "projection should include intersecting gravity influence");
|
||||
Require(!projection.GravityInfluences.Any(item => item.BodyKey == "body:far"), "projection should exclude non-intersecting gravity influence");
|
||||
Require(gravityProjection.GravityInfluences.Select(item => item.BodyKey).SequenceEqual(projection.GravityInfluences.Select(item => item.BodyKey)), "gravity viewport should match composed map gravity set");
|
||||
RequireEqual(12L, viewportDocument.FrameId, "viewport document frame id");
|
||||
RequireEqual(-50.0, viewportDocument.Viewport.MinX, "normalized viewport min x");
|
||||
RequireEqual(500.0, viewportDocument.Viewport.MaxX, "normalized viewport max x");
|
||||
Require(viewportDocument.ControlledEntityIndices.SequenceEqual([0, 1]), "viewport document should expose controlled unit set");
|
||||
Require(viewportDocument.Objects.Any(item => item.DisplayName == "Raider In Shared Sight"), "viewport document should use union of controlled unit visibility");
|
||||
Require(!viewportDocument.Objects.Any(item => item.DisplayName == "Outside Viewport"), "viewport document should exclude objects outside viewport");
|
||||
Require(objectsViewport.Objects.Select(item => item.EntityIndex).SequenceEqual(viewportDocument.Objects.Select(item => item.EntityIndex)), "objects viewport should match composed map object set");
|
||||
var raven = viewportDocument.Objects.First(item => item.DisplayName == "Raven");
|
||||
RequireEqual(120.0, raven.Status.Hull, "viewport document should include entity status");
|
||||
Require(raven.Inventory.Any(item => item.ItemKey == "reactor-cell" && item.Source == "cargo"), "viewport document should include inventory");
|
||||
Require(viewportDocument.GravityInfluences.Any(item => item.BodyKey == "body:near"), "viewport document should include intersecting gravity influence");
|
||||
Require(!viewportDocument.GravityInfluences.Any(item => item.BodyKey == "body:far"), "viewport document should exclude non-intersecting gravity influence");
|
||||
Require(gravityViewport.GravityInfluences.Select(item => item.BodyKey).SequenceEqual(viewportDocument.GravityInfluences.Select(item => item.BodyKey)), "gravity viewport should match composed map gravity set");
|
||||
}
|
||||
|
||||
private static void StarbridgeSessionSummaryProjectsScenarioFacts()
|
||||
{
|
||||
var baseEntity = ProjectionEntity(
|
||||
var baseEntity = SnapshotEntity(
|
||||
4,
|
||||
"Starbridge Base",
|
||||
"player",
|
||||
|
|
@ -460,7 +460,7 @@ internal sealed class AuthoritySmokeChecks
|
|||
Entities =
|
||||
[
|
||||
baseEntity,
|
||||
ProjectionEntity(5, "Pilot Raven", "player", 120, 0, 300, 140, "repair-pod")
|
||||
SnapshotEntity(5, "Pilot Raven", "player", 120, 0, 300, 140, "repair-pod")
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
@ -532,7 +532,7 @@ internal sealed class AuthoritySmokeChecks
|
|||
CurrentWaveIndex = 1
|
||||
};
|
||||
|
||||
var summary = AetheriaRuntimeStarbridgeProjection.ProjectSessionSummary(frame, scenario, session);
|
||||
var summary = AetheriaRuntimeStarbridgeDocuments.SessionSummary(frame, scenario, session);
|
||||
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.StarbridgeSessionSummary, summary.Schema, "starbridge session summary schema");
|
||||
RequireEqual("starbridge.frontier-fabricator", summary.ScenarioId, "starbridge scenario id");
|
||||
|
|
@ -579,8 +579,8 @@ internal sealed class AuthoritySmokeChecks
|
|||
Name = "Client State Documents Zone",
|
||||
Entities =
|
||||
[
|
||||
ProjectionEntity(0, "Document Raven", "player", 0, 0, 600, 140, "document-cargo"),
|
||||
ProjectionEntity(1, "Document Raider", "raider", 100, 0, 120, 80, "raider-cargo")
|
||||
SnapshotEntity(0, "Document Raven", "player", 0, 0, 600, 140, "document-cargo"),
|
||||
SnapshotEntity(1, "Document Raider", "raider", 100, 0, 120, 80, "raider-cargo")
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
@ -660,58 +660,53 @@ internal sealed class AuthoritySmokeChecks
|
|||
using var client = await AetheriaClient
|
||||
.OpenAsync(statePath, "raven-unity", sessionId: "state-documents-session", pullOnOpen: true)
|
||||
.ConfigureAwait(false);
|
||||
var aetheria = client.Aetheria();
|
||||
var viewport = await client
|
||||
.Aetheria()
|
||||
.Viewports
|
||||
.Map(new AetheriaRuntimeRtsViewportBounds { MinX = -20, MinY = -20, MaxX = 150, MaxY = 20 })
|
||||
var state = client.State;
|
||||
var viewportBounds = new AetheriaRuntimeRtsViewportBounds { MinX = -20, MinY = -20, MaxX = 150, MaxY = 20 };
|
||||
var viewport = await state
|
||||
.RtsViewport(viewportBounds)
|
||||
.LatestAsync()
|
||||
.ConfigureAwait(false);
|
||||
Require(viewport.Objects.Any(item => item.DisplayName == "Document Raven"), "managed map document should include controlled object");
|
||||
Require(viewport.Objects.Any(item => item.DisplayName == "Document Raider"), "managed map document should include visible hostile object");
|
||||
var objectsViewport = await client
|
||||
.Aetheria()
|
||||
.Viewports
|
||||
.Objects(new AetheriaRuntimeRtsViewportBounds { MinX = -20, MinY = -20, MaxX = 150, MaxY = 20 })
|
||||
var objectsViewport = await state
|
||||
.ObjectsViewport(viewportBounds)
|
||||
.LatestAsync()
|
||||
.ConfigureAwait(false);
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.ObjectsViewport, objectsViewport.Schema, "managed objects viewport document schema");
|
||||
Require(objectsViewport.Objects.Any(item => item.DisplayName == "Document Raven"), "managed objects viewport document should include controlled object");
|
||||
Require(objectsViewport.Objects.Any(item => item.DisplayName == "Document Raider"), "managed objects viewport document should include visible hostile object");
|
||||
var gravityViewport = await client
|
||||
.Aetheria()
|
||||
.Viewports
|
||||
.Gravity(new AetheriaRuntimeRtsViewportBounds { MinX = -20, MinY = -20, MaxX = 150, MaxY = 20 })
|
||||
var gravityViewport = await state
|
||||
.GravityViewport(viewportBounds)
|
||||
.LatestAsync()
|
||||
.ConfigureAwait(false);
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.GravityViewport, gravityViewport.Schema, "managed gravity viewport document schema");
|
||||
|
||||
var currentZone = await aetheria.Current.Zone.LatestAsync().ConfigureAwait(false);
|
||||
var currentZone = await state.CurrentZone.LatestAsync().ConfigureAwait(false);
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.CurrentZone, currentZone.Schema, "managed current-zone document schema");
|
||||
RequireEqual("Client State Documents Zone", currentZone.ZoneName, "managed current-zone document name");
|
||||
|
||||
var sectorMap = await aetheria.SectorMap.LatestAsync().ConfigureAwait(false);
|
||||
var sectorMap = await state.SectorMap.LatestAsync().ConfigureAwait(false);
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.SectorMap, sectorMap.Schema, "managed sector-map document schema");
|
||||
Require(sectorMap.Zones.Any(zone => zone.ZoneIndex == currentZone.ZoneIndex && zone.Current), "managed sector-map document should include current zone marker");
|
||||
|
||||
var selected = await aetheria.Details.SelectedObject(0).LatestAsync().ConfigureAwait(false);
|
||||
var selected = await state.SelectedObject(0).LatestAsync().ConfigureAwait(false);
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.SelectedObject, selected.Schema, "managed selected-object document schema");
|
||||
Require(selected.Selected?.DisplayName == "Document Raven", "managed selected-object document should resolve entity");
|
||||
|
||||
var inventory = await aetheria.Details.Inventory(0).LatestAsync().ConfigureAwait(false);
|
||||
var inventory = await state.Inventory(0).LatestAsync().ConfigureAwait(false);
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.Inventory, inventory.Schema, "managed inventory document schema");
|
||||
Require(inventory.Cargo.Any(item => item.ItemKey == "document-cargo"), "managed inventory document should expose cargo");
|
||||
|
||||
var starbridgeSummary = await aetheria.Starbridge.Summary.LatestAsync().ConfigureAwait(false);
|
||||
var starbridgeSummary = await state.StarbridgeSummary.LatestAsync().ConfigureAwait(false);
|
||||
RequireEqual("Document Starbridge", starbridgeSummary.ScenarioName, "managed starbridge summary document should project scenario name");
|
||||
RequireEqual("pre-wave", starbridgeSummary.Phase, "managed starbridge summary document should project session phase");
|
||||
Require(starbridgeSummary.StationStock.Any(item => item.ItemKey == "document-cargo"), "managed starbridge summary document should expose station stock");
|
||||
|
||||
var projectedHealth = await aetheria.Daemon.Health.LatestAsync().ConfigureAwait(false);
|
||||
Require(projectedHealth?.Status == "healthy", "managed daemon health document should read local health");
|
||||
var healthDocument = await state.Health.LatestAsync().ConfigureAwait(false);
|
||||
Require(healthDocument?.Status == "healthy", "managed daemon health document should read local health");
|
||||
|
||||
var projectedPolicy = await aetheria.Daemon.AuthorityPolicy.LatestAsync().ConfigureAwait(false);
|
||||
RequireEqual("aetheria.trusted-coop.v1", projectedPolicy?.PolicyId, "managed authority policy document id");
|
||||
var authorityPolicy = await state.AuthorityPolicy.LatestAsync().ConfigureAwait(false);
|
||||
RequireEqual("aetheria.trusted-coop.v1", authorityPolicy?.PolicyId, "managed authority policy document id");
|
||||
|
||||
var command = client.SetMoveVector(1, 0, 0.5);
|
||||
RequireEqual(AetheriaRuntimeDaemonCommandKinds.SetMoveVector, command.Kind, "managed client command kind");
|
||||
|
|
@ -741,7 +736,7 @@ internal sealed class AuthoritySmokeChecks
|
|||
using var client = await AetheriaClient
|
||||
.OpenAsync(statePath, "starbridge-smoke-client", sessionId: "authority-smoke", pullOnOpen: true)
|
||||
.ConfigureAwait(false);
|
||||
var summary = await client.Aetheria().Starbridge.Summary.LatestAsync().ConfigureAwait(false);
|
||||
var summary = await client.State.StarbridgeSummary.LatestAsync().ConfigureAwait(false);
|
||||
|
||||
RequireEqual(AetheriaRuntimeDaemonSchemas.StarbridgeSessionSummary, summary.Schema, "daemon starbridge summary schema");
|
||||
RequireEqual("starbridge.frontier-fabricator", summary.ScenarioId, "daemon starbridge scenario id");
|
||||
|
|
@ -1718,7 +1713,7 @@ internal sealed class AuthoritySmokeChecks
|
|||
.First(candidate => candidate.EntityIndex == entityIndex);
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeEntitySnapshotCommit ProjectionEntity(
|
||||
private static AetheriaRuntimeEntitySnapshotCommit SnapshotEntity(
|
||||
int entityIndex,
|
||||
string name,
|
||||
string factionKey,
|
||||
|
|
|
|||
|
|
@ -550,7 +550,7 @@ static RudpCultNetSchemaServer StartRtsCultMeshHost(
|
|||
|
||||
if (hasFrame && frame != null && TryGetRtsViewportRequest(request, out var viewportRecordKey, out var viewport))
|
||||
{
|
||||
var viewportDocument = AetheriaRuntimeRtsProjection.ProjectViewport(frame, viewport);
|
||||
var viewportDocument = AetheriaRuntimeRtsDocuments.Viewport(frame, viewport);
|
||||
var viewportPut = node.Database.Documents.CreateRawDocumentPutMessage(
|
||||
response.MessageId,
|
||||
new CultRecordHandle<AetheriaRuntimeRtsViewportDocument>(
|
||||
|
|
@ -780,19 +780,19 @@ static async Task PublishDaemonApiDocumentsAsync(
|
|||
.ConfigureAwait(false);
|
||||
if (result.GameSurface != null)
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface)
|
||||
.ReplaceAsync(AetheriaRuntimeEveSurfaceAdapter.ToEveSurfaceState(result.GameSurface))
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToEveSurfaceState(result.GameSurface))
|
||||
.ConfigureAwait(false);
|
||||
if (result.GameTuiSurface != null)
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface)
|
||||
.ReplaceAsync(AetheriaRuntimeEveSurfaceAdapter.ToEveSurfaceState(result.GameTuiSurface))
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToEveSurfaceState(result.GameTuiSurface))
|
||||
.ConfigureAwait(false);
|
||||
if (result.EditorSurface != null)
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface)
|
||||
.ReplaceAsync(AetheriaRuntimeEveSurfaceAdapter.ToEveSurfaceState(result.EditorSurface))
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToEveSurfaceState(result.EditorSurface))
|
||||
.ConfigureAwait(false);
|
||||
if (result.EditorTuiSurface != null)
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface)
|
||||
.ReplaceAsync(AetheriaRuntimeEveSurfaceAdapter.ToEveSurfaceState(result.EditorTuiSurface))
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToEveSurfaceState(result.EditorTuiSurface))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -117,17 +117,17 @@ static async Task ExportFixtureSetAsync(
|
|||
MaxX = options.ViewportMaxX,
|
||||
MaxY = options.ViewportMaxY
|
||||
};
|
||||
WriteArtifact(outputDirectory, manifest, "projection.rts-viewport", AetheriaRuntimeDaemonSchemas.RtsViewport, AetheriaRuntimeRtsProjection.ProjectViewport(frame, viewport));
|
||||
WriteArtifact(outputDirectory, manifest, "projection.objects-viewport", AetheriaRuntimeDaemonSchemas.ObjectsViewport, AetheriaRuntimeRtsProjection.ProjectObjectsViewport(frame, viewport));
|
||||
WriteArtifact(outputDirectory, manifest, "projection.gravity-viewport", AetheriaRuntimeDaemonSchemas.GravityViewport, AetheriaRuntimeRtsProjection.ProjectGravityViewport(frame, viewport));
|
||||
WriteArtifact(outputDirectory, manifest, "projection.current-zone", AetheriaRuntimeDaemonSchemas.CurrentZone, AetheriaRuntimeRtsProjection.ProjectCurrentZone(frame));
|
||||
WriteArtifact(outputDirectory, manifest, "projection.current-entity", AetheriaRuntimeDaemonSchemas.CurrentEntity, AetheriaRuntimeRtsProjection.ProjectCurrentEntity(frame));
|
||||
WriteArtifact(outputDirectory, manifest, "projection.sector-map", AetheriaRuntimeDaemonSchemas.SectorMap, AetheriaRuntimeRtsProjection.ProjectSectorMap(frame));
|
||||
WriteArtifact(outputDirectory, manifest, "projection.zone-render", AetheriaRuntimeDaemonSchemas.ZoneRender, AetheriaRuntimeRtsProjection.ProjectZoneRender(frame));
|
||||
WriteArtifact(outputDirectory, manifest, "document.rts-viewport", AetheriaRuntimeDaemonSchemas.RtsViewport, AetheriaRuntimeRtsDocuments.Viewport(frame, viewport));
|
||||
WriteArtifact(outputDirectory, manifest, "document.objects-viewport", AetheriaRuntimeDaemonSchemas.ObjectsViewport, AetheriaRuntimeRtsDocuments.ObjectsViewport(frame, viewport));
|
||||
WriteArtifact(outputDirectory, manifest, "document.gravity-viewport", AetheriaRuntimeDaemonSchemas.GravityViewport, AetheriaRuntimeRtsDocuments.GravityViewport(frame, viewport));
|
||||
WriteArtifact(outputDirectory, manifest, "document.current-zone", AetheriaRuntimeDaemonSchemas.CurrentZone, AetheriaRuntimeRtsDocuments.CurrentZone(frame));
|
||||
WriteArtifact(outputDirectory, manifest, "document.current-entity", AetheriaRuntimeDaemonSchemas.CurrentEntity, AetheriaRuntimeRtsDocuments.CurrentEntity(frame));
|
||||
WriteArtifact(outputDirectory, manifest, "document.sector-map", AetheriaRuntimeDaemonSchemas.SectorMap, AetheriaRuntimeRtsDocuments.SectorMap(frame));
|
||||
WriteArtifact(outputDirectory, manifest, "document.zone-render", AetheriaRuntimeDaemonSchemas.ZoneRender, AetheriaRuntimeRtsDocuments.ZoneRender(frame));
|
||||
|
||||
var selectedEntityIndex = ResolveSelectedEntityIndex(frame);
|
||||
WriteArtifact(outputDirectory, manifest, "projection.selected-object", AetheriaRuntimeDaemonSchemas.SelectedObject, AetheriaRuntimeRtsProjection.ProjectSelectedObject(frame, selectedEntityIndex));
|
||||
WriteArtifact(outputDirectory, manifest, "projection.inventory", AetheriaRuntimeDaemonSchemas.Inventory, AetheriaRuntimeRtsProjection.ProjectInventory(frame, selectedEntityIndex));
|
||||
WriteArtifact(outputDirectory, manifest, "document.selected-object", AetheriaRuntimeDaemonSchemas.SelectedObject, AetheriaRuntimeRtsDocuments.SelectedObject(frame, selectedEntityIndex));
|
||||
WriteArtifact(outputDirectory, manifest, "document.inventory", AetheriaRuntimeDaemonSchemas.Inventory, AetheriaRuntimeRtsDocuments.Inventory(frame, selectedEntityIndex));
|
||||
|
||||
WriteJson(Path.Combine(outputDirectory, "manifest.json"), manifest);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ await using (var node = await AetheriaStateNode.OpenAsync(statePath, "aetheria-s
|
|||
}
|
||||
}
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface)
|
||||
.ReplaceAsync(AetheriaRuntimeEveSurfaceAdapter.ToEveSurfaceState(daemonGameSurface));
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToEveSurfaceState(daemonGameSurface));
|
||||
await node.MutableDocument<AetheriaRuntimeSession>(AetheriaStateNode.RuntimeSessionKey("smoke-runtime")).ReplaceAsync(new AetheriaRuntimeSession
|
||||
{
|
||||
RuntimeId = "smoke-runtime",
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -63,6 +63,7 @@ public static class AetheriaDocumentRegistry
|
|||
typeof(AetheriaRuntimeDaemonCommandDocument),
|
||||
typeof(AetheriaRuntimeCommittedCommandFactDocument),
|
||||
typeof(AetheriaRuntimeEveCommandDocument),
|
||||
typeof(AetheriaRuntimeSurfaceDocument),
|
||||
typeof(EveSurfaceState),
|
||||
typeof(EveProviderAdvertisementState)
|
||||
];
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ tooling hosts.
|
|||
This is not a minimalist transport library. CultMesh should grow the shared
|
||||
abstractions that make daemon state feel intimate: typed state pointers,
|
||||
reactive wrappers, query handles, operation handles, native slice descriptors,
|
||||
authority claims, locality routing, schema-generated facades, UI bindings,
|
||||
authority claims, locality routing, schema-generated handles, UI bindings,
|
||||
diagnostics, and deterministic math/query primitives. "Primitive" does not
|
||||
only mean a small value type; it means any reusable cross-runtime developer
|
||||
affordance that can be hoisted into the shared library layer. The goal is a
|
||||
|
|
@ -72,12 +72,13 @@ that make that simple.
|
|||
First implementation footholds now exist in CultLib:
|
||||
|
||||
- `E:/Projects/CultLib/src/GameCult.Mesh/CultMeshPrimitives.cs` defines typed operation handles, query surfaces, state pointers, route hints, authority claims, and native slice descriptors.
|
||||
- `E:/Projects/CultLib/src/GameCult.Mesh/CultMeshPrimitives.cs` also exposes fluent operation/query context builders, with `CultMesh.OperationContextFor(...)` and `CultMesh.QueryContextFor(...)` facade entrypoints. Application code should read like a typed Verse call, not like manual transport setup.
|
||||
- `E:/Projects/CultLib/src/GameCult.Mesh/CultMeshPrimitives.cs` also exposes fluent operation/query context builders, with `CultMesh.OperationContextFor(...)` and `CultMesh.QueryContextFor(...)` entrypoints. Application code should read like a typed Verse call, not like manual transport setup.
|
||||
- `E:/Projects/CultLib/src/GameCult.Geometry/CultGeometryPrimitives.cs` defines shared `CultVec2`, `CultVec3`, `CultRect`, `CultCircle`, and `CultSphere` values for query and physics contracts.
|
||||
- `E:/Projects/CultLib/packages/cultmesh-ts/src/index.ts` now exposes TS `CultMeshVec2`, `CultMeshRect`, `CultMeshViewportRequest`, `CultMeshQuerySurface`, `CultMeshQueryContext`, `CultMeshOperationHandle`, `CultMeshOperationContext`, `CultMeshOperationPayload`, `CultMeshDocumentHandle`, `CultMeshDocumentCatalog`, `CultMeshCollectionHandle`, `CultMeshStatePointer`, `CultMeshStateBindingDescriptor`, `CultMeshOperationBindingDescriptor`, `CultMeshOperationInvocationDescriptor`, native slice descriptors, authority claims, route hints, fluent context builders, and facade helpers like `CultMesh.rectFromBounds(...)`, `CultMesh.viewportRequest(...)`, `CultMesh.query(...)`, `CultMesh.operation(...)`, `CultMesh.document(...)`, `CultMesh.documents(...)`, `CultMesh.collection(...)`, `CultMesh.operationPayload(...)`, `CultMesh.statePointer(...)`, `CultMesh.stateBinding(...)`, `CultMesh.operationBinding(...)`, `CultMesh.operationInvocation(...)`, `CultMesh.nativeSliceView(...)`, `CultMesh.operationContextFor(...)`, and `CultMesh.queryContextFor(...)`.
|
||||
- `E:/Projects/CultLib/packages/cultmesh-ts/src/index.ts` now exposes TS `CultMeshVec2`, `CultMeshRect`, `CultMeshViewportRequest`, `CultMeshQuerySurface`, `CultMeshQueryContext`, `CultMeshOperationHandle`, `CultMeshOperationContext`, `CultMeshOperationPayload`, `CultMeshDocumentHandle`, `CultMeshDocumentCatalog`, `CultMeshCollectionHandle`, `CultMeshStatePointer`, `CultMeshStateBindingDescriptor`, `CultMeshOperationBindingDescriptor`, `CultMeshOperationInvocationDescriptor`, native slice descriptors, authority claims, route hints, fluent context builders, and handle helpers like `CultMesh.rectFromBounds(...)`, `CultMesh.viewportRequest(...)`, `CultMesh.query(...)`, `CultMesh.querySource(...)`, `CultMesh.operation(...)`, `CultMesh.document(...)`, `CultMesh.documents(...)`, `CultMesh.collection(...)`, `CultMesh.operationPayload(...)`, `CultMesh.statePointer(...)`, `CultMesh.stateBinding(...)`, `CultMesh.operationBinding(...)`, `CultMesh.operationInvocation(...)`, `CultMesh.nativeSliceView(...)`, `CultMesh.operationContextFor(...)`, and `CultMesh.queryContextFor(...)`.
|
||||
- `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimePlayerSettingsSurfaceBuilder.cs` and `E:/Projects/Eve/packages/org.gamecult.eve.surface/Runtime/EveSurfaceDocument.cs` now expose component `StateBindings` as `IReadOnlyList<CultMeshStateBindingDescriptor>`. Eve no longer owns a parallel live binding DTO, and Aetheria no longer keeps one in its live runtime surface model. Aetheria only keeps a MessagePack DTO at the persisted document boundary and converts to the shared CultMesh primitive before handing surfaces to renderers.
|
||||
- `E:/Projects/Eve/packages/org.gamecult.eve.surface/Runtime/EveSurfaceDocument.cs` also exposes component `EmbeddedDocuments` as first-class CultUI slots. Aetheria runtime surfaces mirror that shape with `AetheriaRuntimeEmbeddedDocumentSlot`, so daemon-owned UI can compose nested synced surfaces such as inventory dropdowns without a Unity-only model, facade, or projector.
|
||||
- Aetheria and Eve live command templates now carry `CultMeshOperationBindingDescriptor`. Eve command requests carry `CultMeshOperationInvocationDescriptor` plus `CultMeshOperationPayload`, so renderer click/change events preserve operation id, schema, route hint, idempotency, and scalar field reads as shared CultMesh metadata. Legacy `command`, `label`, `transport`, and string payload fields remain compatibility projections and persisted DTO fields, but the live API no longer exposes raw command-string/dictionary constructors; controls point at typed CultMesh operations and renderers build requests from shared CultMesh primitives.
|
||||
- `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonOperationsClient.cs` is now a typed operation facade that returns `CultMeshOperationReceipt` from semantic verbs such as `SetMoveVector`, `SetTarget`, `DockNearest`, and inventory transfers. The lower-level daemon command envelope remains an internal transport wrapper, but public client code should receive shared CultMesh receipts, not Aetheria-specific command envelopes.
|
||||
- `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonOperationsClient.cs` is now a typed operation handle surface that returns `CultMeshOperationReceipt` from semantic verbs such as `SetMoveVector`, `SetTarget`, `DockNearest`, and inventory transfers. The lower-level daemon command envelope remains an internal transport wrapper, but public client code should receive shared CultMesh receipts, not Aetheria-specific command envelopes.
|
||||
- `Packages/org.gamecult.aetheria.state/Runtime/AetheriaUi.cs` applies the same rule to Eve/CultUI commands. Unity UI and Eve presenter code should call `AetheriaClient.Ui` and receive `CultMeshOperationReceipt`; `AetheriaRuntimeEveCommandEnvelope` remains a bridge/document persistence detail for the Verse command boundary, not the shape application code leans on.
|
||||
- `AetheriaRuntimeEveCommands` is internal now. It may help smoke tests and internal bridge code manufacture persisted command documents, but it is not the public renderer/client API. Public callers use `AetheriaClient.Ui`, and the shared receipt is the public outcome type.
|
||||
- `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonRenderQueries.cs` now exposes daemon render gravity/body query overloads around `CultMath.rect` in Aetheria XY space. `AetheriaRuntimeXzRect` remains only as a Unity legacy adapter.
|
||||
|
|
@ -85,6 +86,41 @@ First implementation footholds now exist in CultLib:
|
|||
- `E:/Projects/CultLib/packages/cultcache-ts/src/single-file-messagepack-backing-store.ts` and `E:/Projects/CultLib/packages/cultcache-rs/src/lib.rs` now mirror the same schema-stamped recovery for single-file MessagePack snapshots. Their cache registries resolve recovered schema names and normalize envelopes back to registered public document types, so browser/Electron/Rust clients can share durable Verse state without depending on a stale hot catalog.
|
||||
- `E:/Projects/CultLib/packages/cultcache-py/src/cultcache_py/stores.py`, `E:/Projects/CultLib/packages/cultcache-py/src/cultnet_py/replication.py`, and `E:/Projects/CultLib/packages/cultcache-ts/src/cult-cache-inspector.ts` now carry the same primitive into Python stores, raw CultNet replication helpers, and tooling inspection. A stale schema id should be a recoverable runtime detail when the cold payload is schema-stamped, not a client-visible failure mode.
|
||||
|
||||
### Nested CultUI Surface Discovery
|
||||
|
||||
Nested CultUI surfaces are a shared Eve/CultMesh feature, not an Aetheria-only
|
||||
inventory workaround. Discovery starts in `E:/Projects/Eve/tools/parity/parity-manifest.json`,
|
||||
which lists the canonical `embedded-surface` fixture and the active runtime
|
||||
claims for web, Flutter desktop/Linux/Android, iOS/UIKit, Android/Kotlin, Unity
|
||||
UI Toolkit, and Rust document sync. A renderer that claims CultUI GUI parity must
|
||||
advertise `embeddedDocuments` there and require the `embedded-surface` fixture.
|
||||
Every target runtime must be named in that matrix as tested, pending, or
|
||||
unsupported; an omitted runtime is a broken discovery story, not a harmless
|
||||
documentation gap.
|
||||
|
||||
Run the shared evidence from the owning repos:
|
||||
|
||||
```powershell
|
||||
cd E:\Projects\Eve
|
||||
node --test web\eve-dsl.test.mjs
|
||||
powershell -ExecutionPolicy Bypass -File .\scripts\run-parity-harness.ps1
|
||||
|
||||
cd E:\Projects\CultLib\packages\cultnet-rs
|
||||
cargo test rust_preserves_cultui_embedded_surface_slots_through_typed_document_sync
|
||||
```
|
||||
|
||||
When Flutter is installed, also run from `E:/Projects/Eve/flutter/eve_parity`:
|
||||
|
||||
```powershell
|
||||
flutter test --plain-name embedded_surface_fixture_contract
|
||||
```
|
||||
|
||||
Aetheria's local proof stays thin: build the Unity package and run
|
||||
`Aetheria.State.Verify`. The verifier should prove Aetheria consumes the shared
|
||||
contract through `AetheriaRuntimeSurfaceDocuments`, `AetheriaRuntimeEmbeddedDocumentSlot`,
|
||||
and the Eve UI Toolkit lowerer, not through local projectors, facades, or
|
||||
adapter-shaped child state.
|
||||
|
||||
### Typed Document Handles
|
||||
|
||||
Current leak:
|
||||
|
|
@ -149,7 +185,7 @@ const objects = await verse
|
|||
.watch();
|
||||
```
|
||||
|
||||
Queries are derived-state surfaces, not bespoke HTTP endpoints or local projection helpers. CultMesh should own query identity, parameters, caching, invalidation, locality routing, and remote execution. A co-located daemon can execute directly over slabs; a remote peer can execute through the Verse; a browser can consume the same query shape through generated TS/WASM bindings. The RTS binding generator now emits projection response types, `createAetheriaRuntimeRtsQueryHandles(...)` for every RTS read surface, renderer `aetheria-rts-contract.ts`, `AetheriaRtsIpcChannels`, the preload bridge, and `registerAetheriaRtsIpcHandlers(...)`. Those generated read handles are backed by `CultMesh.projectionRecipe(...).asQuerySurface()` with explicit daemon frame, health, authority, and Starbridge source descriptors. The RTS client passes its local publication route into the generated handles once, then uses automatic query contexts so the recipe owns locality defaults. Because `CultMeshQuerySurface` preserves `sources` and `routeHint`, the RTS client can expose `projectionDiagnostics()` directly from generated handle metadata instead of maintaining a parallel diagnostic table. Electron and browser clients consume generated contracts instead of duplicating query/response shapes, IPC channel names, handler registration, or viewport methods as the primary abstraction.
|
||||
Queries are derived-state surfaces, not bespoke HTTP endpoints or local helper layers. CultMesh should own query identity, parameters, caching, invalidation, locality routing, and remote execution. A co-located daemon can execute directly over slabs; a remote peer can execute through the Verse; a browser can consume the same query shape through generated TS/WASM bindings. The RTS binding generator now emits response document types, `createAetheriaRuntimeRtsQueryHandles(...)` for every RTS read surface, renderer `aetheria-rts-contract.ts`, `AetheriaRtsIpcChannels`, the preload bridge, and `registerAetheriaRtsIpcHandlers(...)`. Those generated read handles are backed by `CultMesh.query(...)` with explicit daemon frame, health, authority, and Starbridge source descriptors. The RTS client passes its local publication route into the generated handles once, then uses automatic query contexts so the query handle owns locality defaults. Because `CultMeshQuerySurface` preserves `sources` and `routeHint`, the RTS client exposes `queryDiagnostics()` directly from generated handle metadata instead of maintaining a parallel diagnostic table. Electron and browser clients consume generated contracts instead of duplicating query/response shapes, IPC channel names, handler registration, or viewport methods as the primary abstraction.
|
||||
|
||||
### Reactive State Pointers
|
||||
|
||||
|
|
@ -225,7 +261,7 @@ var context = CultMesh.OperationContextFor("unity-raven")
|
|||
```ts
|
||||
const context = CultMesh.operationContextFor("browser-starfire")
|
||||
.claim("simulation-authority", { shardId: "zone:starfire" })
|
||||
.route("wasm", "browser-local projection")
|
||||
.route("wasm", "browser-local query")
|
||||
.idempotency("move:starfire:1")
|
||||
.build();
|
||||
```
|
||||
|
|
@ -316,7 +352,7 @@ const selected = CultMesh.statePointer(
|
|||
);
|
||||
```
|
||||
|
||||
That pointer is still only a primitive, not the final generated Verse facade.
|
||||
That pointer is still only a primitive, not the final generated Verse handle.
|
||||
The next step is generator-owned state paths, codecs, unavailable-state
|
||||
diagnostics, and UI binding metadata.
|
||||
|
||||
|
|
@ -328,19 +364,19 @@ Bifrost should consume: inspect typed pointer surfaces, resolve/watch them
|
|||
through the local Verse, and leave record keys and daemon-specific resolver
|
||||
rules below the shared primitive layer.
|
||||
|
||||
Those generated pointers are now Verse-bound in the RTS facade as well. The
|
||||
Those generated pointers are now Verse-bound in the RTS handle surface as well. The
|
||||
Electron client supplies publication-reader resolvers once, generated code binds
|
||||
the pointers with `CultMesh.bindStatePointer(queryVerse, pointer)`, and callers
|
||||
can resolve the underlying daemon documents through the facade without manually
|
||||
can resolve the underlying daemon documents through the handle surface without manually
|
||||
constructing query contexts or knowing where the local publication files live.
|
||||
|
||||
The same rule applies to projected documents and collections. Browser,
|
||||
Electron, Unity, Eve, and tool runtimes should ask CultMesh for a typed
|
||||
document or collection handle, bind it to the Verse once, and then call
|
||||
`latest`, `watch`, `replace`, or `watchChanges`. Local CultCache records,
|
||||
remote Verse documents, shared-memory projections, and quorum-backed
|
||||
remote Verse documents, shared-memory queries, and quorum-backed
|
||||
authorities are configuration details behind that handle. Generated Aetheria
|
||||
RTS facades should target this shape instead of emitting schema dictionaries,
|
||||
RTS handles should target this shape instead of emitting schema dictionaries,
|
||||
transport-specific lookups, or hand-written state-file readers.
|
||||
|
||||
## Aetheria Proofs
|
||||
|
|
|
|||
|
|
@ -29,10 +29,11 @@ $mainMenu = Read-Text "Assets\Scripts\UI\MainMenu.cs"
|
|||
Assert-Contains $mainMenu "SetRuntimeInputScreenShell(Func<bool> canOpenRuntimeInputScreen, Action openRuntimeInputScreen)" "MainMenu must receive runtime input-screen handoff explicitly."
|
||||
Assert-Contains $mainMenu "_canOpenRuntimeInputScreen?.Invoke() == true" "MainMenu must query runtime input-screen availability through injected shell."
|
||||
Assert-Contains $mainMenu "_openRuntimeInputScreen?.Invoke();" "MainMenu must open runtime input screen through injected shell."
|
||||
Assert-Contains $mainMenu "LatestSectorMap" "MainMenu observed-game boot must read typed sector-map state."
|
||||
Assert-Contains $mainMenu ".Aetheria()" "MainMenu observed-game boot must enter sector-map state through the semantic Aetheria facade."
|
||||
Assert-Contains $mainMenu "AetheriaUnityRuntimeClientProvider" "MainMenu observed-game boot must enter state through the Unity runtime client provider."
|
||||
Assert-Contains $mainMenu ".RuntimeState(stateBoot, ""unity-main-menu"")" "MainMenu observed-game boot must grab typed runtime state."
|
||||
Assert-Contains $mainMenu ".SectorMap" "MainMenu observed-game boot must read the typed sector-map document handle."
|
||||
Assert-Contains $mainMenu ".LatestAsync()" "MainMenu observed-game boot must read a typed sector-map snapshot."
|
||||
Assert-Contains $mainMenu ".PlayerSettings" "MainMenu must read player settings through the typed document handle."
|
||||
Assert-Contains $mainMenu ".VerseHostSettings" "MainMenu must read Verse host settings through the typed document handle."
|
||||
Assert-NotContains $mainMenu ".SectorMapAsync()" "MainMenu observed-game boot must not use the transitional sector-map helper."
|
||||
Assert-NotContains $mainMenu "LatestDaemonFrame" "MainMenu must not read whole daemon frames for observed-game boot."
|
||||
Assert-NotContains $mainMenu "LatestAuthoritativeRunFrameAsync" "MainMenu must not read whole daemon frames for observed-game boot."
|
||||
|
|
@ -40,13 +41,12 @@ Assert-NotContains $mainMenu "ActionGameManager.Instance.ShowInputScreenFromMenu
|
|||
Assert-NotContains $mainMenu "ActionGameManager.Instance.CanShowInputScreenFromMenu" "MainMenu must not query runtime input screen through ActionGameManager.Instance."
|
||||
|
||||
$mapRenderer = Read-Text "Assets\Scripts\UI\Menu\MapRenderer.cs"
|
||||
Assert-Contains $mapRenderer ".Aetheria()" "MapRenderer must enter map viewport state through the semantic Aetheria facade."
|
||||
Assert-Contains $mapRenderer ".Viewports" "MapRenderer must exercise the managed viewport document facade."
|
||||
Assert-Contains $mapRenderer ".Objects(viewport)" "MapRenderer must read the split objects viewport document handle."
|
||||
Assert-Contains $mapRenderer ".RenderSplats(viewport)" "MapRenderer must read the split render-splats viewport document handle."
|
||||
Assert-Contains $mapRenderer ".Settings" "MapRenderer must read player settings through managed typed state."
|
||||
Assert-Contains $mapRenderer ".Player" "MapRenderer must read player settings through the player settings document handle."
|
||||
Assert-Contains $mapRenderer ".Latest()" "MapRenderer must read a typed player settings snapshot."
|
||||
Assert-Contains $mapRenderer "AetheriaUnityRuntimeClientProvider" "MapRenderer must enter state through the Unity runtime client provider."
|
||||
Assert-Contains $mapRenderer ".MapViewportDocuments(viewport, ""unity-map-renderer"")" "MapRenderer must read managed viewport documents."
|
||||
Assert-Contains $mapRenderer "CurrentObjectsViewport" "MapRenderer must read the split objects viewport document."
|
||||
Assert-Contains $mapRenderer "CurrentRenderSplatsViewport" "MapRenderer must read the split render-splats viewport document."
|
||||
Assert-Contains $mapRenderer "AetheriaUnityRuntimeClientProvider.RuntimeState(""unity-map-renderer"")" "MapRenderer must keep a managed typed state handle."
|
||||
Assert-Contains $mapRenderer "_runtimeState.PlayerSettings.Latest()" "MapRenderer must read typed player settings through its typed state handle."
|
||||
Assert-NotContains $mapRenderer "public ActionGameManager" "MapRenderer must not regain an ActionGameManager serialized dependency."
|
||||
Assert-NotContains $mapRenderer "LatestAuthoritativeRunFrameAsync" "MapRenderer must not regress to whole-frame reads for map viewport data."
|
||||
Assert-NotContains $mapRenderer "ObjectsViewportAsync" "MapRenderer must not use the transitional objects viewport helper."
|
||||
|
|
@ -55,19 +55,18 @@ Assert-NotContains $mapRenderer "PlayerSettingsAsync" "MapRenderer must not use
|
|||
Assert-NotContains $mapRenderer "ActionGameManager.RuntimePlayerSettings" "MapRenderer must not read manager-global player settings."
|
||||
|
||||
$sectorRenderer = Read-Text "Assets\Scripts\UI\Menu\SectorRenderer.cs"
|
||||
Assert-Contains $sectorRenderer "AetheriaClient" "SectorRenderer must keep explicit local Verse client ownership."
|
||||
Assert-Contains $sectorRenderer ".Aetheria()" "SectorRenderer must enter state through the semantic Aetheria facade."
|
||||
Assert-Contains $sectorRenderer ".Current" "SectorRenderer must center from the current-state facade."
|
||||
Assert-Contains $sectorRenderer ".Zone" "SectorRenderer must read the typed current-zone document handle."
|
||||
Assert-Contains $sectorRenderer ".SectorMap" "SectorRenderer zone details must read the typed sector-map document handle."
|
||||
Assert-Contains $sectorRenderer ".LatestAsync()" "SectorRenderer must read typed state snapshots."
|
||||
Assert-Contains $sectorRenderer "AetheriaUnityRuntimeClientProvider.RuntimeState(""unity-sector-renderer"")" "SectorRenderer must keep a managed typed state handle."
|
||||
Assert-Contains $sectorRenderer "RuntimeState.ZoneDetailsSurface(zoneIndex).Latest()" "SectorRenderer zone details must read the managed zone-details surface document through its typed state handle."
|
||||
Assert-Contains $sectorRenderer "RuntimeState.CurrentZone.Latest()" "SectorRenderer must read current zone through its typed state handle."
|
||||
Assert-Contains $sectorRenderer "RenderRuntime(" "SectorRenderer must only render the managed zone-details surface document."
|
||||
Assert-NotContains $sectorRenderer ".CurrentZoneAsync()" "SectorRenderer must not use the transitional current-zone helper."
|
||||
Assert-NotContains $sectorRenderer ".SectorMapAsync()" "SectorRenderer must not use the transitional sector-map helper."
|
||||
Assert-Contains $sectorRenderer ".Details" "SectorRenderer zone details must read daemon zone facts through managed detail documents."
|
||||
Assert-Contains $sectorRenderer ".Zone(zoneIndex)" "SectorRenderer zone details must read the typed zone-details document handle."
|
||||
Assert-Contains $sectorRenderer ".Catalog" "SectorRenderer zone details must read catalog data through managed typed state."
|
||||
Assert-Contains $sectorRenderer ".Settings" "SectorRenderer zone details must read formatting settings through managed typed state."
|
||||
Assert-Contains $sectorRenderer ".Player" "SectorRenderer zone details must read the player settings document handle."
|
||||
Assert-NotContains $sectorRenderer "AetheriaRuntimeZoneDetailsSurfaceBuilder.Build(" "SectorRenderer must not compose zone-details Eve surfaces locally."
|
||||
Assert-NotContains $sectorRenderer "AetheriaRuntimeZoneDetailsSurfaceBuilder.Facts(" "SectorRenderer must not derive zone-detail display facts locally."
|
||||
Assert-NotContains $sectorRenderer "CurrentSectorMap(" "SectorRenderer zone details must not read sector-map state directly."
|
||||
Assert-NotContains $sectorRenderer "CurrentZoneDetails(" "SectorRenderer zone details must not read zone-details state directly."
|
||||
Assert-NotContains $sectorRenderer "CurrentCatalog(" "SectorRenderer zone details must not read catalog state directly."
|
||||
Assert-NotContains $sectorRenderer "CurrentPlayerSettings(" "SectorRenderer zone details must not read formatting settings directly."
|
||||
Assert-NotContains $sectorRenderer "ZoneDetailsAsync" "SectorRenderer zone details must not use the transitional zone-details helper."
|
||||
Assert-NotContains $sectorRenderer "OpenRuntimeCatalog" "SectorRenderer zone details must not use the transitional catalog helper."
|
||||
Assert-NotContains $sectorRenderer "PlayerSettingsAsync" "SectorRenderer zone details must not use the transitional player settings helper."
|
||||
|
|
@ -78,33 +77,54 @@ Assert-NotContains $sectorRenderer "ActionGameManager.RuntimePlayerSettings" "Se
|
|||
Assert-NotContains $sectorRenderer "TryGetObservedZoneSnapshot" "SectorRenderer zone details must not ask ActionGameManager for daemon zone snapshots."
|
||||
Assert-NotContains $sectorRenderer "LatestAuthoritativeRunFrameAsync" "SectorRenderer zone details must not read whole daemon frames."
|
||||
|
||||
$zoneDetailsSurfaceBuilder = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeZoneDetailsSurfaceBuilder.cs"
|
||||
$verseClient = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeVerseClient.cs"
|
||||
$clientState = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaClientState.cs"
|
||||
Assert-Contains $zoneDetailsSurfaceBuilder "BuildFromDocuments(" "Zone-details surface composition must live in the shared runtime package."
|
||||
Assert-Contains $zoneDetailsSurfaceBuilder "AetheriaRuntimeZoneDetailsDocument zoneDetails" "Zone-details surface composition must consume the typed zone-details document."
|
||||
Assert-Contains $zoneDetailsSurfaceBuilder "AetheriaRuntimeSectorMapDocument sectorMap" "Zone-details surface composition must consume the typed sector-map document."
|
||||
Assert-Contains $zoneDetailsSurfaceBuilder "AetheriaRuntimeCatalogSnapshot catalog" "Zone-details surface composition must consume the typed catalog document."
|
||||
Assert-Contains $zoneDetailsSurfaceBuilder "AetheriaRuntimePlayerSettingsDocument playerSettings" "Zone-details surface composition must consume typed player settings."
|
||||
Assert-Contains $clientState "ZoneDetailsSurface(int zoneIndex)" "AetheriaClientState must expose a managed zone-details surface handle."
|
||||
Assert-Contains $verseClient "IndexedDocumentId(""aetheria.zone.details.surface"", zoneIndex)" "Verse client must provide the zone-details surface as a managed CultMesh document."
|
||||
Assert-Contains $verseClient "ZoneDetailsSurfaceAsync(frame, zoneIndex)" "Verse client must derive zone-details surfaces through the managed document handle."
|
||||
Assert-Contains $verseClient "AetheriaRuntimeZoneDetailsSurfaceBuilder.BuildFromDocuments(" "Verse client must hoist zone-details surface composition out of Unity."
|
||||
Assert-Contains $verseClient "RequireManagedCatalog()" "Managed zone-details surface must use the typed catalog document."
|
||||
Assert-Contains $verseClient "RequireManagedPlayerSettings()" "Managed zone-details surface must use typed player settings."
|
||||
|
||||
$sectorMap = Read-Text "Assets\Scripts\UI\Menu\SectorMap.cs"
|
||||
Assert-Contains $sectorMap ".Aetheria()" "SectorMap must enter state through the semantic Aetheria facade."
|
||||
Assert-Contains $sectorMap ".SectorMap" "SectorMap must render from the typed sector-map document handle."
|
||||
Assert-Contains $sectorMap ".LatestAsync()" "SectorMap must read a typed sector-map snapshot."
|
||||
Assert-Contains $sectorMap "AetheriaUnityRuntimeClientProvider" "SectorMap must enter state through the ergonomic Unity runtime provider."
|
||||
Assert-Contains $sectorMap "AetheriaUnityRuntimeClientProvider.RuntimeState(""unity-sector-map"")" "SectorMap must keep a managed typed state handle."
|
||||
Assert-Contains $sectorMap "_sectorMap = _runtimeState.SectorMap.Latest()" "SectorMap must render from the managed typed sector-map document through its typed state handle."
|
||||
Assert-NotContains $sectorMap ".SectorMapAsync()" "SectorMap must not use the transitional sector-map helper."
|
||||
Assert-NotContains $sectorMap ".LatestAsync()" "SectorMap must not walk document handles at the call site."
|
||||
Assert-Contains $sectorMap "Subject<int>" "SectorMap clicks must expose typed zone indices, not Unity GalaxyZone objects."
|
||||
Assert-NotContains $sectorMap "TryGetObservedGalaxy" "SectorMap must not ask ActionGameManager for observed galaxy state."
|
||||
Assert-NotContains $sectorMap "GalaxyZone" "SectorMap must not retain the legacy GalaxyZone graph."
|
||||
Assert-NotContains $sectorMap "Dictionary<Faction" "SectorMap must not retain legacy Faction graph materials."
|
||||
|
||||
$inventoryPanel = Read-Text "Assets\Scripts\UI\Menu\InventoryPanel.cs"
|
||||
Assert-Contains $inventoryPanel ".Aetheria()" "InventoryPanel current-subject UI must enter state through the semantic Aetheria facade."
|
||||
Assert-Contains $inventoryPanel ".Current" "InventoryPanel current-subject UI must read the current-state facade."
|
||||
Assert-Contains $inventoryPanel ".Entity" "InventoryPanel current-subject UI must read the typed current-entity document handle."
|
||||
Assert-Contains $inventoryPanel ".LatestAsync()" "InventoryPanel current-subject UI must read a typed current-entity snapshot."
|
||||
Assert-Contains $inventoryPanel "AetheriaUnityRuntimeClientProvider.RuntimeState(""unity-inventory"")" "InventoryPanel must keep a managed typed state handle."
|
||||
Assert-Contains $inventoryPanel "RuntimeState.InventoryPanelSurface(BuildInventoryPanelSurfaceRequest()).Latest()" "InventoryPanel must read the daemon-presented inventory panel surface through its typed state handle."
|
||||
Assert-Contains $inventoryPanel "RenderInventoryPanelSurface()" "InventoryPanel must lower the daemon-presented inventory panel surface instead of merely fetching it for diagnostics."
|
||||
Assert-Contains $inventoryPanel "HandleInventoryPanelSurfaceCommand" "InventoryPanel must route daemon-presented panel commands through the shared command handler."
|
||||
Assert-Contains $inventoryPanel "embeddedDocumentResolver: ResolveEmbeddedInventorySurface" "InventoryPanel must let the daemon-presented panel wire embedded child surfaces."
|
||||
Assert-Contains $inventoryPanel "RuntimeState.InventoryDropdownSurface(BuildDropdownSurfaceRequest()).Latest()" "InventoryPanel dropdown must read the daemon-presented dropdown surface through its typed state handle."
|
||||
Assert-Contains $inventoryPanel "BuildInventoryPanelSurfaceRequest()" "InventoryPanel must pass view state into the managed inventory surface."
|
||||
Assert-Contains $inventoryPanel "DragSession.TryGetDraggedItem(out var itemDragObject)" "InventoryPanel must mirror drag/drop state into the managed inventory surface request."
|
||||
Assert-NotContains $inventoryPanel ".LatestAsync()" "InventoryPanel must not walk document handles at the call site."
|
||||
Assert-NotContains $inventoryPanel ".CurrentEntityAsync()" "InventoryPanel current-subject UI must not use the transitional current-entity helper."
|
||||
Assert-Contains $inventoryPanel ".Docking" "InventoryPanel dropdown docking access must read the typed current-docking document handle."
|
||||
Assert-Contains $inventoryPanel ".StationRefit" "InventoryPanel dropdown entity options must read the typed station-refit document handle."
|
||||
Assert-NotContains $inventoryPanel ".CurrentDockingAsync()" "InventoryPanel dropdown docking access must not use the transitional current-docking helper."
|
||||
Assert-NotContains $inventoryPanel ".StationRefitAsync()" "InventoryPanel dropdown entity options must not use the transitional station-refit helper."
|
||||
Assert-Contains $inventoryPanel "LoadoutRestoreOptions" "InventoryPanel loadout dropdown must read typed station-refit restore options."
|
||||
Assert-Contains $inventoryPanel "AetheriaRuntimeLoadoutSnapshotProjector" "InventoryPanel loadout saves must project the target entity through the managed state projector."
|
||||
Assert-Contains $inventoryPanel "ProjectLoadoutTemplateAsync(client.State, targetEntityKey)" "InventoryPanel loadout saves must compose from managed typed state."
|
||||
Assert-Contains $inventoryPanel ".Ui.SaveLoadoutTemplateAsync" "InventoryPanel loadout saves must submit through the Aetheria UI command shell."
|
||||
Assert-Contains $inventoryPanel "RuntimeState.DaemonFrame" "InventoryPanel loadout saves must compose from the managed current daemon-frame document."
|
||||
Assert-Contains $inventoryPanel ".CreateLoadoutTemplate(targetEntityKey ?? """")" "InventoryPanel loadout saves must use the typed daemon-frame document loadout factory."
|
||||
Assert-Contains $inventoryPanel ".Ui(""unity-inventory"")" "InventoryPanel loadout saves must submit through the Aetheria UI command shell."
|
||||
Assert-Contains $inventoryPanel ".SaveLoadoutTemplateAsync(loadout, ""unity-inventory"")" "InventoryPanel loadout saves must send typed loadout-template commands."
|
||||
Assert-NotContains $inventoryPanel "LoadoutTemplateAsync(targetEntityKey)" "InventoryPanel loadout saves must not use the transitional loadout helper."
|
||||
Assert-Contains $inventoryPanel "AetheriaRuntimeStationLoadoutRestoreOption" "InventoryPanel loadout restore submission must use typed station-refit option rows."
|
||||
Assert-Contains $inventoryPanel "TryResolveObservedDockingIndex(out var dockingIndex)" "InventoryPanel dropdown docking access must enter through the typed docking adapter."
|
||||
Assert-Contains $inventoryPanel "RuntimeState.StationRefit.Latest()" "InventoryPanel docking/dropdown context must read the typed station-refit document through its typed state handle."
|
||||
Assert-NotContains $inventoryPanel "AetheriaUnityRuntimeClientProvider.CurrentStationRefit(""unity-inventory"")" "InventoryPanel must not use provider snapshot shortcuts at the access site."
|
||||
Assert-NotContains $inventoryPanel "TryGetTypedCurrentDockingBayFacade" "InventoryPanel dropdown docking access must not keep transitional typed facade helpers."
|
||||
Assert-Contains $inventoryPanel "selection.EntityKey" "InventoryPanel dropdown selections must carry typed entity keys."
|
||||
Assert-Contains $inventoryPanel "_displayedEntityKey" "InventoryPanel displayed entity state must cache typed entity identity."
|
||||
|
|
@ -118,37 +138,71 @@ Assert-NotContains $inventoryPanel "ObservedLoadoutTemplates" "InventoryPanel mu
|
|||
Assert-NotContains $inventoryPanel "CreateEntityConstructionBlueprint" "InventoryPanel loadout restore validity must not depend on Unity construction blueprints."
|
||||
Assert-NotContains $inventoryPanel "DockedEntity" "InventoryPanel must not target loadout restore through ActionGameManager.DockedEntity."
|
||||
Assert-NotMatches $inventoryPanel "ExecuteDropdownSelection[\s\S]*?TryGetObservedDockingBay[\s\S]*?private void HideDropdownSurface" "InventoryPanel dropdown selection must not read manager docking-bay identity directly."
|
||||
Assert-NotMatches $inventoryPanel "private AetheriaRuntimeInventoryDropdownSurfaceModel ComposeDropdownSurface\(\)[\s\S]*?TryGetObservedDockingBay[\s\S]*?private void Update" "InventoryPanel dropdown model must not read manager docking-bay identity directly."
|
||||
Assert-NotMatches $inventoryPanel "private AetheriaRuntimeInventoryDropdownSurfaceModel ComposeDropdownSurface\(\)[\s\S]*?TryGetTypedCurrentDockingBayFacade[\s\S]*?private void Update" "InventoryPanel dropdown model must use typed docking state, not Unity docking-bay facade objects."
|
||||
Assert-NotMatches $inventoryPanel "private bool IsDisplayedEntityKey\([^)]*\)[\s\S]*?TryResolveEntityRecordKey[\s\S]*?private bool IsDisplayedCargoBayKey" "InventoryPanel displayed entity checks must use cached typed identity."
|
||||
Assert-NotContains $inventoryPanel "AetheriaRuntimeInventoryDropdownSurfaceModel" "InventoryPanel dropdown must consume a normal runtime surface document, not a shadow model."
|
||||
Assert-NotMatches $inventoryPanel "private .*ComposeDropdownSurface\(\)[\s\S]*?TryGetObservedDockingBay[\s\S]*?private void Update" "InventoryPanel dropdown model must not read manager docking-bay identity directly."
|
||||
Assert-NotMatches $inventoryPanel "private .*ComposeDropdownSurface\(\)[\s\S]*?TryGetTypedCurrentDockingBayFacade[\s\S]*?private void Update" "InventoryPanel dropdown model must use typed docking state, not Unity docking-bay presentation objects."
|
||||
Assert-NotMatches $inventoryPanel "private bool IsDisplayedEntityKey\([^)]*\)[\s\S]*?TryGetRecordKeyForPresentationEntity[\s\S]*?private bool IsDisplayedCargoBayKey" "InventoryPanel displayed entity checks must use cached typed identity."
|
||||
Assert-NotMatches $inventoryPanel "private bool IsDisplayedCargoBayKey\([^)]*\)[\s\S]*?TryResolveCargoBay[\s\S]*?private bool TryResolveCargoBay" "InventoryPanel displayed cargo checks must use cached typed identity."
|
||||
Assert-NotMatches $inventoryPanel "ExecuteDropdownSelection[\s\S]*?ObservedAvailableEntities[\s\S]*?private void HideDropdownSurface" "InventoryPanel dropdown selection must resolve options from typed station-refit keys."
|
||||
Assert-NotMatches $inventoryPanel "private AetheriaRuntimeInventoryDropdownSurfaceModel ComposeDropdownSurface\(\)[\s\S]*?ObservedAvailableEntities[\s\S]*?private void Update" "InventoryPanel dropdown model must use typed station-refit options."
|
||||
Assert-NotContains $inventoryPanel "ResolveDropdownSurfaceModel" "InventoryPanel dropdown must not keep a model resolver beside the runtime surface document."
|
||||
Assert-NotMatches $inventoryPanel "private .*ResolveDropdownSurface\(\)[\s\S]*?ObservedAvailableEntities[\s\S]*?private void Update" "InventoryPanel dropdown surface must use typed station-refit options."
|
||||
Assert-NotContains $inventoryPanel "NodePrototype" "InventoryPanel must not instantiate legacy Unity inventory cells."
|
||||
Assert-NotContains $inventoryPanel "NodeTextures" "InventoryPanel must not own inventory cell foreground sprites."
|
||||
Assert-NotContains $inventoryPanel "ThermalTextures" "InventoryPanel must not own inventory thermal sprites."
|
||||
Assert-NotContains $inventoryPanel "TemperatureDisplay" "InventoryPanel must not own the thermal texture renderer."
|
||||
Assert-NotContains $inventoryPanel "GearOccupancy" "InventoryPanel must not read Unity equipment occupancy as inventory UI truth."
|
||||
Assert-NotContains $inventoryPanel "Occupancy[" "InventoryPanel must not read Unity cargo occupancy as inventory UI truth."
|
||||
Assert-NotContains $inventoryPanel "CellInstances.Add" "InventoryPanel must not compose Unity inventory cell instances."
|
||||
|
||||
$inventoryDropdownSurface = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeInventoryDropdownSurfaceBuilder.cs"
|
||||
Assert-Contains $inventoryDropdownSurface "public string EntityKey { get; }" "Inventory dropdown surface selections must carry typed entity identity."
|
||||
$inventoryDropdownSurfaceDocuments = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeInventoryDropdownSurfaceDocuments.cs"
|
||||
Assert-Contains $inventoryDropdownSurfaceDocuments "public string EntityKey { get; }" "Inventory dropdown surface selections must carry typed entity identity."
|
||||
Assert-Contains $inventoryDropdownSurface "entityKey: entity.EntityKey" "Inventory dropdown surface builder must copy typed entity identity into selections."
|
||||
Assert-Contains $inventoryDropdownSurface "public static AetheriaRuntimeSurfaceDocument Build(" "Inventory dropdown builder must return a normal runtime surface document."
|
||||
Assert-Contains $inventoryDropdownSurface "selectionKind" "Inventory dropdown surface must carry typed selection metadata in command payload."
|
||||
Assert-NotContains $inventoryDropdownSurfaceDocuments "AetheriaRuntimeInventoryDropdownSurfaceModel" "Inventory dropdown documents must not reintroduce a shadow surface model."
|
||||
$inventoryPanelSurface = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeInventoryPanelSurfaceBuilder.cs"
|
||||
Assert-Contains $inventoryPanelSurface "BuildFromDocuments(" "Inventory panel composition must live in the shared runtime package."
|
||||
Assert-Contains $inventoryPanelSurface "AetheriaRuntimeInventoryDocument displayedInventory" "Inventory panel surface must consume the typed inventory document."
|
||||
Assert-Contains $inventoryPanelSurface "inventory.drag_session" "Inventory panel surface must expose drag/drop gesture state."
|
||||
Assert-Contains $inventoryPanelSurface "AetheriaRuntimeEmbeddedDocumentSlot" "Inventory panel surface must embed child CultUI documents through first-class slots."
|
||||
Assert-Contains $inventoryPanelSurface "surface.slot" "Inventory panel surface must expose its dropdown as a nested surface slot."
|
||||
Assert-Contains $inventoryPanelSurface "AddAssetProps(props, ""backgroundAtlas""" "Inventory panel surface must publish the cell background atlas asset ref for renderer-independent CultUI inventory cells."
|
||||
Assert-Contains $inventoryPanelSurface "AddAssetProps(props, ""foregroundAtlas""" "Inventory panel surface must publish the cell foreground atlas asset ref for renderer-independent CultUI inventory cells."
|
||||
Assert-Contains $inventoryPanelSurface "AddAssetProps(props, ""thermalLayer""" "Inventory panel surface must publish the thermal layer atlas asset ref for renderer-independent CultUI inventory cells."
|
||||
Assert-Contains $inventoryPanelSurface "AddAssetProps(props, ""icon""" "Inventory panel surface items must publish icon asset refs so clients do not need Unity-side catalog lookups."
|
||||
$runtimeAssets = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeAssets.cs"
|
||||
Assert-Contains $runtimeAssets "InventoryUiAssets()" "Runtime asset manifest must include inventory UI assets."
|
||||
Assert-Contains $runtimeAssets "inventory.cell.background_atlas" "Runtime asset manifest must publish the inventory cell background atlas."
|
||||
Assert-Contains $runtimeAssets "inventory.cell.foreground_atlas" "Runtime asset manifest must publish the inventory cell foreground atlas."
|
||||
Assert-Contains $runtimeAssets "inventory.cell.thermal_layer_atlas" "Runtime asset manifest must publish the inventory thermal layer atlas."
|
||||
Assert-Contains $runtimeAssets "Sprites/Flat UI/Nodes/Nodes8BG" "Runtime asset manifest must point at the inventory cell background atlas source."
|
||||
Assert-Contains $runtimeAssets "Sprites/Flat UI/Nodes/Nodes8" "Runtime asset manifest must point at the inventory cell foreground atlas source."
|
||||
Assert-Contains $runtimeAssets "Sprites/Flat UI/pipes" "Runtime asset manifest must point at the thermal pipe-layer atlas source."
|
||||
Assert-Contains $clientState "InventoryPanelSurface(" "AetheriaClientState must expose a managed inventory panel surface handle."
|
||||
Assert-Contains $clientState "InventoryDropdownSurface(" "AetheriaClientState must expose a managed inventory dropdown surface handle."
|
||||
Assert-Contains $verseClient "InventoryPanelSurfaceDocumentId(request)" "Verse client must provide inventory panel UI as a managed CultMesh document."
|
||||
Assert-Contains $verseClient "AetheriaRuntimeInventoryPanelSurfaceBuilder.BuildFromDocuments(" "Verse client must hoist inventory panel composition out of Unity."
|
||||
|
||||
$inventoryMenu = Read-Text "Assets\Scripts\UI\Menu\InventoryMenu.cs"
|
||||
Assert-Contains $inventoryMenu ".Aetheria()" "InventoryMenu ship-settings commands must enter state through the semantic Aetheria facade."
|
||||
Assert-Contains $inventoryMenu ".Current" "InventoryMenu ship-settings commands must read the current-state facade."
|
||||
Assert-Contains $inventoryMenu ".Entity" "InventoryMenu ship-settings commands must read the typed current-entity document handle."
|
||||
Assert-Contains $inventoryMenu ".LatestAsync()" "InventoryMenu ship-settings commands must read a typed current-entity snapshot."
|
||||
Assert-Contains $inventoryMenu "AetheriaUnityRuntimeClientProvider.RuntimeState(""unity-inventory-menu"")" "InventoryMenu must keep a managed typed state handle."
|
||||
Assert-Contains $inventoryMenu "RuntimeState.CurrentEntity.Latest()" "InventoryMenu ship-settings commands must read the managed current-entity document through its typed state handle."
|
||||
Assert-Contains $inventoryMenu "RuntimeState.StationRefit.Latest()" "InventoryMenu docking context must read the managed station-refit document through its typed state handle."
|
||||
Assert-Contains $inventoryMenu "RuntimeState.PlayerSettings.Latest()" "InventoryMenu ship-settings defaults must read typed player settings through its typed state handle."
|
||||
Assert-NotContains $inventoryMenu ".LatestAsync()" "InventoryMenu must not walk document handles at the call site."
|
||||
Assert-NotContains $inventoryMenu ".CurrentEntityAsync()" "InventoryMenu ship-settings commands must not use the transitional current-entity helper."
|
||||
Assert-Contains $inventoryMenu "TryResolveCurrentEntityDocument" "InventoryMenu ship-settings state must read the typed current-entity document."
|
||||
Assert-Contains $inventoryMenu "TryReadCurrentEntity(out var latestCurrentEntity)" "InventoryMenu ship-settings state must read the typed current-entity document."
|
||||
Assert-Contains $inventoryMenu "_shipSettingsCurrentEntity" "InventoryMenu ship-settings surface must retain typed current-entity state."
|
||||
Assert-Contains $inventoryMenu "latestCurrentEntity.ShutdownPerformance" "InventoryMenu ship-settings surface must use typed shutdown-performance projection."
|
||||
Assert-Contains $inventoryMenu "TryResolveObservedDockingIndex(out var dockingIndex)" "InventoryMenu current facade access must enter through the typed docking adapter."
|
||||
Assert-Contains $inventoryMenu "latestCurrentEntity.ShutdownPerformance" "InventoryMenu ship-settings surface must use the managed current-entity document."
|
||||
Assert-Contains $inventoryMenu "refit.DockingBays" "InventoryMenu current docking access must use typed station-refit docking rows."
|
||||
Assert-NotContains $inventoryMenu "TryGetTypedCurrentEntityFacade" "InventoryMenu current facade access must not keep transitional typed facade helpers."
|
||||
Assert-NotContains $inventoryMenu "SetObservedFacadeIndex(AetheriaUnityObservedFacadeIndex observedFacadeIndex)" "InventoryMenu must not keep transitional observed facade adaptation."
|
||||
Assert-NotContains $inventoryMenu "_observedFacadeIndex.TryResolveEntityByRecordKey" "InventoryMenu must not adapt current entity facades by typed daemon record key."
|
||||
Assert-Contains $inventoryMenu ".Docking" "InventoryMenu docking facade access must read the typed current-docking document handle."
|
||||
Assert-Contains $inventoryMenu ".StationRefit" "InventoryMenu docking options must read the typed station-refit document handle."
|
||||
Assert-NotContains $inventoryMenu "_observedFacadeIndex.TryGetPresentationEntityByRecordKey" "InventoryMenu must not adapt current entity presentation objects through the old generic facade index."
|
||||
Assert-NotContains $inventoryMenu ".CurrentDockingAsync()" "InventoryMenu docking facade access must not use the transitional current-docking helper."
|
||||
Assert-NotContains $inventoryMenu ".StationRefitAsync()" "InventoryMenu docking options must not use the transitional station-refit helper."
|
||||
Assert-NotContains $inventoryMenu "TryGetTypedCurrentDockingBayFacade" "InventoryMenu docking facade access must not keep transitional typed facade helpers."
|
||||
Assert-Contains $inventoryMenu "ResolveDefaultShutdownPerformance()" "InventoryMenu ship-settings reset must use typed runtime policy for the default threshold."
|
||||
Assert-Contains $inventoryMenu "ResolvePlayerSettings()?.DefaultShutdownPerformance" "InventoryMenu must read default shutdown performance from typed player settings."
|
||||
Assert-Contains $inventoryMenu "PlayerSettingsSnapshot()?.DefaultShutdownPerformance" "InventoryMenu must read default shutdown performance from typed player settings."
|
||||
Assert-NotContains $inventoryMenu "TryGetObservedCurrentEntity(" "InventoryMenu must not read broad manager-global current entity state."
|
||||
Assert-NotContains $inventoryMenu "entity.Settings.ShutdownPerformance" "InventoryMenu ship-settings surface must not read shutdown threshold from a Unity entity facade."
|
||||
Assert-NotContains $inventoryMenu "_shipSettingsEntity" "InventoryMenu ship-settings surface must not store Unity entity facade state."
|
||||
|
|
@ -156,23 +210,22 @@ Assert-NotContains $inventoryMenu "GameManager.Settings.GameplaySettings.Default
|
|||
Assert-NotMatches $inventoryMenu "OnEnable\(\)[\s\S]*?TryGetObservedCurrentEntity[\s\S]*?private void OnDisable" "InventoryMenu OnEnable must not read manager current-entity identity directly."
|
||||
Assert-NotMatches $inventoryMenu "OnBackgroundClick[\s\S]*?TryGetObservedCurrentEntity[\s\S]*?private void RenderCurrentShipSettingsSurface" "InventoryMenu background click must not read manager current-entity identity directly."
|
||||
Assert-NotMatches $inventoryMenu "HandleCurrentShipSettingsSurfaceCommand[\s\S]*?TryGetObservedCurrentEntity[\s\S]*?private void HideCurrentShipSettingsSurface" "InventoryMenu ship-settings command handler must not ask ActionGameManager for current-entity identity."
|
||||
Assert-Contains $inventoryPanel "TryResolveTypedInventoryRows" "InventoryPanel cargo/equipment submissions must validate against typed inventory projection rows."
|
||||
Assert-Contains $inventoryPanel "TryValidateTypedCargoSlot" "InventoryPanel cargo submissions must validate typed cargo slot identity."
|
||||
Assert-Contains $inventoryPanel "TryValidateTypedEquipmentSlot" "InventoryPanel equipment submissions must validate typed equipment slot identity."
|
||||
Assert-Contains $inventoryPanel ".Details" "InventoryPanel must read non-current inventory through managed detail documents."
|
||||
Assert-Contains $inventoryPanel ".Inventory(entityIndex)" "InventoryPanel must read non-current inventory through the typed inventory document handle."
|
||||
Assert-NotContains $inventoryPanel "TryResolveTypedInventoryRows" "InventoryPanel must not describe managed inventory document rows as projection rows."
|
||||
Assert-NotContains $inventoryPanel "TryValidateTypedCargoSlot" "InventoryPanel must not locally validate cargo slot operations; inventory mutation gestures belong to the daemon-presented surface."
|
||||
Assert-NotContains $inventoryPanel "TryValidateTypedEquipmentSlot" "InventoryPanel must not locally validate equipment slot operations; inventory mutation gestures belong to the daemon-presented surface."
|
||||
Assert-NotContains $inventoryPanel "RuntimeState.Inventory(entityIndex).Latest()" "InventoryPanel must not fetch per-entity inventory rows for Unity-side cell composition."
|
||||
Assert-NotContains $inventoryPanel "InventoryAsync(entityIndex)" "InventoryPanel must not use the transitional inventory helper."
|
||||
Assert-Contains $inventoryPanel "origin.Cargo.TryGetValue(item, out var originPosition)" "InventoryPanel cargo submissions must carry the typed origin grid cell."
|
||||
Assert-NotContains $inventoryPanel "origin.Cargo.TryGetValue(item, out var originPosition)" "InventoryPanel must not resolve drag origins through Unity cargo dictionaries."
|
||||
Assert-NotContains $inventoryPanel "int.MinValue" "InventoryPanel cargo/equipment submissions must not send unknown origin coordinates."
|
||||
Assert-NotContains $inventoryPanel "TryResolveObservedCargoBayCommandTarget" "InventoryPanel must not resolve cargo operations through manager command-target adapters."
|
||||
Assert-NotContains $inventoryPanel "TryResolveObservedEquippedItemCommandTarget" "InventoryPanel must not resolve equipment operations through manager command-target adapters."
|
||||
Assert-Contains $inventoryMenu "TryResolveTypedInventoryRows" "InventoryMenu cargo/equipment submissions must validate against typed inventory projection rows."
|
||||
Assert-Contains $inventoryMenu "TryValidateTypedCargoSlot" "InventoryMenu cargo submissions must validate typed cargo slot identity."
|
||||
Assert-Contains $inventoryMenu "TryValidateTypedEquipmentSlot" "InventoryMenu equipment submissions must validate typed equipment slot identity."
|
||||
Assert-Contains $inventoryMenu ".Details" "InventoryMenu must read non-current inventory through managed detail documents."
|
||||
Assert-Contains $inventoryMenu ".Inventory(entityIndex)" "InventoryMenu must read non-current inventory through the typed inventory document handle."
|
||||
Assert-NotContains $inventoryMenu "TryResolveManagedInventoryRows" "InventoryMenu must not locally resolve inventory rows for mutation authority; inventory gestures belong to the daemon-presented surface."
|
||||
Assert-NotContains $inventoryMenu "TryResolveTypedInventoryRows" "InventoryMenu must not describe managed inventory document rows as projection rows."
|
||||
Assert-NotContains $inventoryMenu "TryValidateTypedCargoSlot" "InventoryMenu must not locally validate cargo slot operations; inventory mutation gestures belong to the daemon-presented surface."
|
||||
Assert-NotContains $inventoryMenu "TryValidateTypedEquipmentSlot" "InventoryMenu must not locally validate equipment slot operations; inventory mutation gestures belong to the daemon-presented surface."
|
||||
Assert-NotContains $inventoryMenu "RuntimeState.Inventory(entityIndex).Latest()" "InventoryMenu must not fetch per-entity inventory rows for Unity-side cell interpretation."
|
||||
Assert-NotContains $inventoryMenu "InventoryAsync(entityIndex)" "InventoryMenu must not use the transitional inventory helper."
|
||||
Assert-Contains $inventoryMenu "origin.Cargo.TryGetValue(item, out var originPosition)" "InventoryMenu cargo submissions must carry the typed origin grid cell."
|
||||
Assert-NotContains $inventoryMenu "origin.Cargo.TryGetValue(item, out var originPosition)" "InventoryMenu must not resolve drag origins through Unity cargo dictionaries."
|
||||
Assert-Contains $inventoryMenu "SetActionBarPresentation(AetheriaUnityActionBarPresentation actionBarPresentation)" "InventoryMenu must receive action-bar presentation explicitly."
|
||||
Assert-NotContains $inventoryMenu "ProjectEquippedItemActionBarSlots(" "InventoryMenu must not project Unity-local action-bar binding controls into the shared equipped-item surface."
|
||||
Assert-NotContains $inventoryMenu "RequestWeaponGroupActionBarBinding(" "InventoryMenu must not treat shared equipped-item commands as Unity action-bar binding edits."
|
||||
|
|
@ -188,13 +241,14 @@ Assert-NotContains $inventoryMenu "TryResolveObservedCargoBayCommandTarget" "Inv
|
|||
Assert-NotContains $inventoryMenu "TryResolveObservedEquippedItemCommandTarget" "InventoryMenu must not resolve equipment operations through manager command-target adapters."
|
||||
|
||||
$tradeMenu = Read-Text "Assets\Scripts\UI\Menu\TradeMenu.cs"
|
||||
Assert-Contains $tradeMenu ".Docking" "TradeMenu docking and docked-ship purchase access must read the typed current-docking document handle."
|
||||
Assert-Contains $tradeMenu ".StationRefit" "TradeMenu cargo selector ship options must read the typed station-refit document handle."
|
||||
Assert-Contains $tradeMenu "AetheriaUnityRuntimeClientProvider.RuntimeState(""unity-trade"")" "TradeMenu must keep a managed typed state handle."
|
||||
Assert-Contains $tradeMenu "RuntimeState.StationRefit.Latest()" "TradeMenu cargo selector ship options must read the managed station-refit document through its typed state handle."
|
||||
Assert-NotContains $tradeMenu "AetheriaUnityRuntimeClientProvider.CurrentStationRefit(""unity-trade"")" "TradeMenu must not use provider snapshot shortcuts at the access site."
|
||||
Assert-NotContains $tradeMenu ".CurrentDockingAsync()" "TradeMenu docking and docked-ship purchase access must not use the transitional current-docking helper."
|
||||
Assert-NotContains $tradeMenu ".StationRefitAsync()" "TradeMenu cargo selector ship options must not use the transitional station-refit helper."
|
||||
Assert-Contains $tradeMenu "ResolveStationRefit()?.Credits" "TradeMenu credits must read from the typed station-refit projection."
|
||||
Assert-Contains $tradeMenu "StationRefitSnapshot()?.Credits" "TradeMenu credits must read from the managed station-refit document."
|
||||
Assert-Contains $tradeMenu "BuildStationStockRows" "TradeMenu row list must be built from typed station stock."
|
||||
Assert-Contains $tradeMenu "ResolveStationRefit()?.StationStock" "TradeMenu station stock rows must read from the typed station-refit projection."
|
||||
Assert-Contains $tradeMenu "StationRefitSnapshot()?.StationStock" "TradeMenu station stock rows must read from the managed station-refit document."
|
||||
Assert-Contains $tradeMenu "var sourcePosition = new int2(row.Stock.X, row.Stock.Y)" "TradeMenu trade purchase source position must come from typed station stock."
|
||||
Assert-Contains $tradeMenu "TryResolveCurrentDockingTargetEntityKey" "TradeMenu docked-ship purchase target must resolve from typed current docking."
|
||||
Assert-Contains $tradeMenu "SetTargetCargo" "TradeMenu target cargo selection must store typed entity key and cargo index."
|
||||
|
|
@ -228,32 +282,36 @@ Assert-NotMatches $tradeMenu "private int CountAvailablePlayerShips\([^)]*\)\s*\
|
|||
Assert-NotContains $tradeMenu "HullItemKey" "TradeMenu owned ship counts must come from station stock facts, not UI-side hull comparisons."
|
||||
|
||||
$inventoryPanel = Read-Text "Assets\Scripts\UI\Menu\InventoryPanel.cs"
|
||||
Assert-Contains $inventoryPanel ".StationRefit" "InventoryPanel must resolve station/refit selections from typed station-refit projection."
|
||||
Assert-Contains $inventoryPanel "SetObservedEntityIndex(AetheriaUnityObservedEntityIndex observedEntityIndex)" "InventoryPanel must receive entity adaptation explicitly."
|
||||
Assert-Contains $inventoryPanel "_observedEntityIndex.TryResolveEntityByRecordKey" "InventoryPanel may adapt Unity facade objects only by typed daemon record key."
|
||||
Assert-Contains $inventoryPanel "new AetheriaUnityObservedDockingIndex(ResolveClient, _observedEntityIndex)" "InventoryPanel must adapt docking through the typed docking index."
|
||||
Assert-Contains $inventoryPanel "RuntimeState.StationRefit.Latest()" "InventoryPanel must resolve station/refit selections from the managed station-refit document."
|
||||
Assert-Contains $inventoryPanel "SetPresentationEntityIndex(AetheriaUnityPresentationEntityIndex presentationEntityIndex)" "InventoryPanel must receive entity adaptation explicitly."
|
||||
Assert-Contains $inventoryPanel "_presentationEntityIndex.TryGetPresentationEntityByRecordKey" "InventoryPanel's remaining Unity presentation lookup must be keyed by typed daemon record key."
|
||||
Assert-Contains $inventoryPanel "_presentationEntityIndex.TryGetPresentationDockingBayByRecordKey" "InventoryPanel's remaining docking presentation lookup must be keyed by typed daemon record key."
|
||||
Assert-NotContains $inventoryPanel "SetObservedFacadeIndex(AetheriaUnityObservedFacadeIndex observedFacadeIndex)" "InventoryPanel must not keep transitional generic facade adaptation."
|
||||
Assert-NotContains $inventoryPanel "_observedFacadeIndex" "InventoryPanel must not keep the generic observed facade index."
|
||||
Assert-NotContains $inventoryPanel "ObservedAvailableEntities()" "InventoryPanel must not read broad manager-global available entity collections."
|
||||
Assert-NotContains $inventoryPanel "TryGetObservedDockingBay(" "InventoryPanel must read typed current docking before adapting a Unity docking bay facade."
|
||||
Assert-NotContains $inventoryPanel "TryGetObservedDockingBay(" "InventoryPanel must read typed current docking before touching Unity docking presentation objects."
|
||||
|
||||
$inventoryMenu = Read-Text "Assets\Scripts\UI\Menu\InventoryMenu.cs"
|
||||
Assert-Contains $inventoryMenu ".Docking" "InventoryMenu must resolve docking display state from typed current-docking projection."
|
||||
Assert-Contains $inventoryMenu "new AetheriaUnityObservedDockingIndex(ResolveClient, _observedEntityIndex)" "InventoryMenu must adapt docking bays through the typed docking index."
|
||||
Assert-Contains $inventoryMenu "RuntimeState.StationRefit.Latest()" "InventoryMenu must resolve docking display state from the managed station-refit document."
|
||||
Assert-Contains $inventoryMenu "_presentationEntityIndex.TryGetPresentationDockingBayByRecordKey" "InventoryMenu's remaining docking presentation lookup must be keyed by typed daemon record key."
|
||||
Assert-NotContains $inventoryMenu "_observedFacadeIndex" "InventoryMenu must not keep the generic observed facade index."
|
||||
Assert-NotContains $inventoryMenu "TryGetObservedDockingBay(" "InventoryMenu must not read broad manager-global docking bay state."
|
||||
|
||||
$localMenu = Read-Text "Assets\Scripts\UI\Menu\LocalMenu.cs"
|
||||
Assert-Contains $localMenu "TryResolveDockedLocalStory(out _currentLocation)" "LocalMenu must resolve local story visibility through its typed docking path."
|
||||
Assert-Contains $localMenu ".Aetheria()" "LocalMenu local story visibility must enter state through the semantic Aetheria facade."
|
||||
Assert-Contains $localMenu ".Docking" "LocalMenu must read typed current-docking state before showing local story."
|
||||
Assert-Contains $localMenu "TryResolveDockedLocalInkStory(out _currentLocalInkLocation)" "LocalMenu must resolve local Ink story visibility from managed docking identity."
|
||||
Assert-Contains $localMenu "AetheriaUnityRuntimeClientProvider.RuntimeState(""unity-local-menu"")" "LocalMenu must cache a managed typed state handle before showing local story."
|
||||
Assert-Contains $localMenu "_runtimeState.CurrentDocking.Latest()" "LocalMenu must read current docking from the managed typed document handle."
|
||||
Assert-Contains $localMenu "Ink story execution is still a Unity-local island." "LocalMenu must name its remaining local Ink boundary until story state is a daemon-owned CultMesh document."
|
||||
Assert-NotContains $localMenu "AetheriaUnityRuntimeClientProvider.CurrentDockingState(""unity-local-menu"")" "LocalMenu must not use provider snapshot shortcuts."
|
||||
Assert-NotContains $localMenu ".CurrentDockingAsync()" "LocalMenu must not use the transitional current-docking helper."
|
||||
Assert-Contains $localMenu "SetObservedEntityIndex(AetheriaUnityObservedEntityIndex observedEntityIndex)" "LocalMenu must receive entity adaptation explicitly."
|
||||
Assert-Contains $localMenu "_observedEntityIndex.TryResolveDockingBayByRecordKey" "LocalMenu may adapt story-bearing docking parents only by typed parent key and docking bay index."
|
||||
Assert-Contains $localMenu "SetPresentationEntityIndex(AetheriaUnityPresentationEntityIndex presentationEntityIndex)" "LocalMenu must receive entity adaptation explicitly."
|
||||
Assert-Contains $localMenu "_presentationEntityIndex.TryGetPresentationDockingBayByRecordKey" "LocalMenu's remaining story-bearing docking presentation lookup must be keyed by typed parent key and docking bay index."
|
||||
Assert-NotContains $localMenu "TryResolveDockedLocalStory(" "LocalMenu must not hide the remaining local Ink island behind a generic story resolver name."
|
||||
Assert-NotContains $localMenu "_currentLocation" "LocalMenu must name the remaining local Ink state explicitly."
|
||||
Assert-NotContains $localMenu "SetObservedFacadeIndex(AetheriaUnityObservedFacadeIndex observedFacadeIndex)" "LocalMenu must not keep transitional generic facade adaptation."
|
||||
Assert-NotContains $localMenu "_observedFacadeIndex" "LocalMenu must not keep the generic observed facade index."
|
||||
Assert-Contains $localMenu "dockingState.DockParentEntityKey" "LocalMenu must use typed dock parent identity for local story adaptation."
|
||||
Assert-Contains $localMenu "dockingState.DockingBayIndex" "LocalMenu must use typed docking bay index for local story adaptation."
|
||||
Assert-Contains $localMenu "docking.DockParentEntityKey" "LocalMenu must use typed dock parent identity for local story adaptation."
|
||||
Assert-Contains $localMenu "docking.DockingBayIndex" "LocalMenu must use typed docking bay index for local story adaptation."
|
||||
Assert-NotContains $localMenu "TryGetObservedDockedLocalStory" "LocalMenu must not ask ActionGameManager for docked local story state."
|
||||
Assert-NotContains $localMenu "DockedEntity" "LocalMenu must not read ActionGameManager.DockedEntity."
|
||||
|
||||
|
|
@ -264,13 +322,15 @@ Assert-NotContains $confirmationDialog "ActionGameManager.Instance" "Confirmatio
|
|||
$schematicDisplay = Read-Text "Assets\Scripts\UI\HUD\SchematicDisplay.cs"
|
||||
Assert-Contains $schematicDisplay "public void SetRenderSettings(AetheriaRuntimeDaemonRenderSettings renderSettings)" "SchematicDisplay must receive HUD render settings explicitly."
|
||||
Assert-Contains $schematicDisplay "_renderSettings?.NormalizeThermalRisk(" "SchematicDisplay must normalize thermal risk through injected daemon render settings."
|
||||
Assert-Contains $schematicDisplay "private AetheriaRuntimeCurrentEntityDocument _currentEntityDocument;" "SchematicDisplay must cache the typed current-entity HUD document."
|
||||
Assert-Contains $schematicDisplay "ResolveCurrentEntityHudStatus()" "SchematicDisplay must read player HUD facts from typed current-entity state."
|
||||
Assert-Contains $schematicDisplay ".Aetheria()" "SchematicDisplay must enter current entity HUD state through the semantic Aetheria facade."
|
||||
Assert-Contains $schematicDisplay ".Current" "SchematicDisplay must read current entity HUD state from the current-state facade."
|
||||
Assert-Contains $schematicDisplay ".Entity" "SchematicDisplay must read current entity HUD state from the typed entity document handle."
|
||||
Assert-Contains $schematicDisplay ".LatestAsync()" "SchematicDisplay must read current entity HUD status through a typed document handle."
|
||||
Assert-Contains $schematicDisplay "private AetheriaClientState _runtimeState;" "SchematicDisplay must cache the managed CultMesh runtime state handle."
|
||||
Assert-Contains $schematicDisplay "private AetheriaClientState RuntimeState" "SchematicDisplay must expose local access to the managed typed state handle."
|
||||
Assert-Contains $schematicDisplay "AetheriaUnityRuntimeClientProvider" "SchematicDisplay must enter current entity HUD state through managed typed state."
|
||||
Assert-Contains $schematicDisplay ".RuntimeState(""unity-schematic-display"")" "SchematicDisplay must grab the shared managed typed state handle once."
|
||||
Assert-Contains $schematicDisplay "RuntimeState.CurrentEntity.Latest()?.Hud" "SchematicDisplay must read current entity HUD status through the typed document handle."
|
||||
Assert-Contains $schematicDisplay "RuntimeState.Catalog.Latest()" "SchematicDisplay must read catalog state through a named typed document handle."
|
||||
Assert-Contains $schematicDisplay "RuntimeState.PlayerSettings.Latest()" "SchematicDisplay must read player settings through a named typed document handle."
|
||||
Assert-NotContains $schematicDisplay ".CurrentEntityAsync()" "SchematicDisplay must not use the transitional current-entity helper."
|
||||
Assert-NotContains $schematicDisplay ".CurrentEntityState(""unity-schematic-display"")" "SchematicDisplay must not use provider snapshot shortcuts at the access site."
|
||||
Assert-Contains $schematicDisplay "hud.OverrideShutdown" "SchematicDisplay must render override shutdown from typed HUD state."
|
||||
Assert-Contains $schematicDisplay "hud.HeatsinksEnabled" "SchematicDisplay must render heatsink status from typed HUD state."
|
||||
Assert-Contains $schematicDisplay "hud.Heatstroke" "SchematicDisplay must render heatstroke from typed HUD state."
|
||||
|
|
@ -284,24 +344,26 @@ Assert-NotContains $schematicDisplay "ActionGameManager.Instance.ZoneRenderer" "
|
|||
|
||||
$actionGameManager = Read-Text "Assets\Scripts\Gameplay\ActionGameManager.cs"
|
||||
$observedFrameApplier = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityObservedFrameApplier.cs"
|
||||
$observedTargetQuery = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityObservedTargetQuery.cs"
|
||||
$daemonRenderDocuments = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityDaemonRenderDocuments.cs"
|
||||
$observedZoneContextFactory = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityObservedZoneContextFactory.cs"
|
||||
$targetPresentation = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityTargetPresentation.cs"
|
||||
$observedDockingIndex = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityObservedDockingIndex.cs"
|
||||
$currentEntityBinder = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityCurrentEntityBinder.cs"
|
||||
$currentEntityPresentation = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityCurrentEntityPresentation.cs"
|
||||
$menuShell = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityMenuShell.cs"
|
||||
$gameplayInputShell = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityGameplayInputShell.cs"
|
||||
$pilotOperationController = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityPilotOperationController.cs"
|
||||
$runtimeClientProvider = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityRuntimeClientProvider.cs"
|
||||
$renderSettingsBridge = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityRenderSettingsBridge.cs"
|
||||
$cockpitHudShell = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityCockpitHudShell.cs"
|
||||
$gameplayBootShell = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityGameplayBootShell.cs"
|
||||
$sceneWiring = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityGameplaySceneWiring.cs"
|
||||
Assert-Contains $actionGameManager "private readonly AetheriaUnityObservedEntityIndex _observedEntityIndex" "ActionGameManager must keep observed entity adaptation behind an explicit helper."
|
||||
Assert-Contains $actionGameManager "private AetheriaUnityObservedDockingIndex _observedDocking" "ActionGameManager must keep observed docking adaptation behind an explicit helper."
|
||||
Assert-Contains $actionGameManager "private readonly AetheriaUnityPresentationEntityIndex _presentationEntityIndex" "ActionGameManager must keep observed entity adaptation behind an explicit helper."
|
||||
Assert-Contains $actionGameManager "private AetheriaClientState _gameplayState;" "ActionGameManager must cache the managed CultMesh state handle for gameplay reads."
|
||||
Assert-Contains $actionGameManager "AetheriaUnityRuntimeClientProvider.RuntimeState(""unity-action-game-manager"")" "ActionGameManager must grab gameplay state through the Unity runtime provider."
|
||||
Assert-Contains $actionGameManager "private AetheriaUnityGameplaySceneWiring SceneWiring =>" "ActionGameManager should delegate Unity scene dependency wiring to a focused helper."
|
||||
Assert-Contains $actionGameManager "SceneWiring.ConfigureObservedEntityIndex(_observedEntityIndex)" "ActionGameManager should delegate entity-index injection to scene wiring."
|
||||
Assert-Contains $actionGameManager "SceneWiring.ConfigurePresentationEntityIndex(_presentationEntityIndex)" "ActionGameManager should delegate entity-index injection to scene wiring."
|
||||
Assert-Contains $sceneWiring "public sealed class AetheriaUnityGameplaySceneWiring" "Unity scene wiring should live outside ActionGameManager."
|
||||
Assert-Contains $sceneWiring "Inventory?.SetObservedEntityIndex(observedEntityIndex)" "Scene wiring should inject entity adaptation into InventoryMenu."
|
||||
Assert-Contains $sceneWiring "Inventory?.SetPresentationEntityIndex(presentationEntityIndex)" "Scene wiring should inject entity adaptation into InventoryMenu."
|
||||
Assert-NotContains $actionGameManager "AetheriaUnityObservedFacadeIndex" "ActionGameManager must not keep the generic observed facade index."
|
||||
Assert-NotContains $sceneWiring "SetObservedFacadeIndex" "Scene wiring must not inject the generic observed facade index."
|
||||
Assert-NotContains $actionGameManager "public bool TryResolveObservedEntityRecordKey" "ActionGameManager must not expose facade record-key lookup as public manager API."
|
||||
|
|
@ -310,8 +372,8 @@ Assert-NotContains $actionGameManager "public bool TryResolveObservedDockingBayF
|
|||
Assert-Contains $actionGameManager "var boot = GameplayBootShell.Boot();" "ActionGameManager should delegate runtime boot/catalog setup to the gameplay boot shell."
|
||||
Assert-Contains $actionGameManager "SceneWiring.ConfigureCurrentEntityPresentation(_currentEntityPresentation, boot.RuntimeCatalog);" "ActionGameManager should delegate boot catalog injection into current-entity presentation."
|
||||
Assert-Contains $actionGameManager "SceneWiring.ConfigureTargetPresentation(" "ActionGameManager should delegate boot catalog injection into target presentation."
|
||||
Assert-Contains $actionGameManager "() => ResolveDaemonObserver()?.Client" "ActionGameManager should give target queries the typed local client, not a raw zone snapshot delegate."
|
||||
Assert-Contains $sceneWiring "observedEntityIndex.TryResolveEntityByDaemonIndex" "Scene wiring should adapt target presentation entities through the observed entity index."
|
||||
Assert-Contains $sceneWiring "presentation.ResolveZoneContacts = ReadZoneContacts;" "Scene wiring should give target presentation typed zone-contact state, not a raw zone snapshot delegate."
|
||||
Assert-Contains $sceneWiring "presentationEntityIndex.TryGetPresentationEntityByDaemonIndex" "Scene wiring should adapt target presentation entities through the observed entity index."
|
||||
Assert-Contains $actionGameManager "SceneWiring.ConfigureActionBarPresentation(" "ActionGameManager should delegate boot catalog injection into local action-bar presentation."
|
||||
Assert-NotContains $actionGameManager "private void ConfigureCurrentEntityPresentation(" "ActionGameManager must not own current-entity presentation scene wiring."
|
||||
Assert-NotContains $actionGameManager "private void ConfigureTargetPresentation(" "ActionGameManager must not own target presentation scene wiring."
|
||||
|
|
@ -325,9 +387,9 @@ Assert-Contains $actionGameManager "ItemManager = boot.ItemManager;" "ActionGame
|
|||
Assert-Contains $actionGameManager "_loadoutItemFactory = boot.LoadoutItemFactory;" "ActionGameManager should receive loadout item factory from the gameplay boot shell."
|
||||
Assert-Contains $gameplayBootShell "public sealed class AetheriaUnityGameplayBootShell" "Unity runtime boot/catalog setup should live outside ActionGameManager."
|
||||
Assert-Contains $gameplayBootShell "AetheriaRuntimeStateBoot.Inspect(AetheriaUnityRuntimePaths.GameDataDirectory)" "Gameplay boot shell should inspect the runtime target."
|
||||
Assert-Contains $gameplayBootShell "AetheriaUnityRuntimeClientProvider.ResolveClient(stateBoot.StateFilePath, stateBoot.RuntimeId)" "Gameplay boot shell should resolve the typed runtime client with the inspected Verse runtime id."
|
||||
Assert-Contains $gameplayBootShell "AetheriaUnityRuntimeClientProvider.RuntimeState(stateBoot, stateBoot.RuntimeId)" "Gameplay boot shell should resolve managed typed runtime state with the inspected Verse runtime id."
|
||||
Assert-Contains $gameplayBootShell "Aetheria runtime id: {stateBoot.RuntimeId}" "Gameplay boot shell should log the inspected Verse runtime id."
|
||||
Assert-Contains $gameplayBootShell ".Aetheria()" "Gameplay boot shell should enter managed typed state for runtime catalog."
|
||||
Assert-Contains $gameplayBootShell "AetheriaUnityRuntimeClientProvider" "Gameplay boot shell should enter managed typed state for runtime catalog."
|
||||
Assert-Contains $gameplayBootShell ".Catalog" "Gameplay boot shell should read the managed runtime catalog document handle."
|
||||
Assert-Contains $gameplayBootShell ".Latest()" "Gameplay boot shell should read the latest typed runtime catalog snapshot."
|
||||
Assert-NotContains $gameplayBootShell ".OpenRuntimeCatalog()" "Gameplay boot shell should not use the transitional runtime catalog helper."
|
||||
|
|
@ -357,30 +419,36 @@ Assert-NotContains $actionGameManager "ResolveClient(stateBoot.StateFilePath).Op
|
|||
Assert-NotContains $actionGameManager "ItemManager = new ItemManager(" "ActionGameManager must not construct ItemManager directly."
|
||||
Assert-NotContains $actionGameManager "ZoneRenderer.SetDroppedPickupItemFactory(" "ActionGameManager must not configure renderer pickup factory binding directly."
|
||||
Assert-NotContains $actionGameManager "ZoneRenderer.BodySettingsCollections = Settings.BodySettingsCollections" "ActionGameManager must not configure renderer body settings directly."
|
||||
Assert-Contains $observedFrameApplier ".Aetheria()" "Unity observed frame application must enter state through the semantic Aetheria facade."
|
||||
Assert-Contains $observedFrameApplier ".ZoneRender" "Unity observed frame application must consume the typed zone-render document handle."
|
||||
Assert-Contains $observedFrameApplier ".LatestAsync()" "Unity observed frame application must read typed zone-render snapshots."
|
||||
Assert-Contains $daemonRenderDocuments "state.DaemonFrame.Reactive()" "Unity observed frame state must bind daemon frame by grabbing the managed typed document handle directly."
|
||||
Assert-Contains $daemonRenderDocuments "state.DaemonSoaView.Reactive()" "Unity observed frame state must bind SoA view by grabbing the managed typed document handle directly."
|
||||
Assert-Contains $daemonRenderDocuments "state.ZoneRender.Reactive()" "Unity observed frame state must bind zone render by grabbing the managed typed document handle directly."
|
||||
Assert-NotContains $daemonRenderDocuments "state.ReactiveDaemonFrame()" "Unity observed frame state must not use per-document reactive wrapper methods."
|
||||
Assert-NotContains $daemonRenderDocuments "state.ReactiveDaemonSoaView()" "Unity observed frame state must not use per-document reactive wrapper methods."
|
||||
Assert-NotContains $daemonRenderDocuments "state.ReactiveZoneRender()" "Unity observed frame state must not use per-document reactive wrapper methods."
|
||||
Assert-Contains $observedFrameApplier "observer.LastRenderView?.ZoneRender" "Unity observed frame application must consume the managed render view, not reacquire raw daemon state."
|
||||
Assert-NotContains $observedFrameApplier ".ZoneRenderAsync()" "Unity observed frame application must not use the transitional zone-render helper."
|
||||
Assert-NotContains $observedFrameApplier "ProjectZoneRender(" "Unity observed frame application must not rebuild zone-render feeds from raw frames."
|
||||
Assert-NotContains $observedFrameApplier "LastObservedState?.Run" "Unity observed frame application must not read the raw observed run for current-zone lookups."
|
||||
Assert-NotContains $observedFrameApplier "FramePath" "Unity observed frame application should key the presentation cache by typed projection identity, not publication file paths."
|
||||
Assert-Contains $observedTargetQuery ".Aetheria()" "Unity target queries must enter state through the semantic Aetheria facade."
|
||||
Assert-Contains $observedTargetQuery ".ZoneContacts" "Unity target queries must consume the typed zone-contacts document handle."
|
||||
Assert-Contains $observedTargetQuery ".LatestAsync()" "Unity target queries must read typed zone-contacts snapshots."
|
||||
Assert-NotContains $observedTargetQuery ".ZoneContactsAsync()" "Unity target queries must not use the transitional zone-contacts helper."
|
||||
Assert-NotContains $observedTargetQuery "AetheriaRuntimeZoneSnapshotCommit" "Unity target queries must not receive raw zone snapshots."
|
||||
Assert-NotContains $observedTargetQuery "AetheriaRuntimeDaemonRenderQueries.TryQueryEntityContact" "Unity target queries must not query contacts from raw zone snapshots."
|
||||
Assert-NotContains $observedTargetQuery "AetheriaRuntimeDaemonRenderQueries.TryQueryEntityTarget" "Unity target queries must not query targets from raw zone snapshots."
|
||||
Assert-Contains $targetPresentation "ResolveVisibleContacts" "Unity target presentation must receive typed contact rows."
|
||||
Assert-Contains $sceneWiring "private AetheriaClientState _targetPresentationState;" "Unity target presentation wiring must cache the managed CultMesh state handle."
|
||||
Assert-Contains $sceneWiring "AetheriaUnityRuntimeClientProvider.RuntimeState(""unity-target-presentation"")" "Unity target presentation wiring must grab typed runtime state through the Unity provider."
|
||||
Assert-Contains $sceneWiring "TargetPresentationState.ZoneContacts.Latest()" "Unity target presentation wiring must consume the typed zone-contacts document handle."
|
||||
Assert-NotContains $sceneWiring ".CurrentZoneContacts(""unity-target-presentation"")" "Unity target presentation wiring must not use provider snapshot shortcuts at the access site."
|
||||
Assert-NotContains $targetPresentation "AetheriaRuntimeZoneSnapshotCommit" "Unity target presentation must not receive raw zone snapshots."
|
||||
Assert-NotContains $targetPresentation "AetheriaRuntimeDaemonRenderQueries.TryQueryEntityContact" "Unity target presentation must not query contacts from raw zone snapshots."
|
||||
Assert-NotContains $targetPresentation "AetheriaRuntimeDaemonRenderQueries.TryQueryEntityTarget" "Unity target presentation must not query targets from raw zone snapshots."
|
||||
Assert-Contains $targetPresentation "AetheriaRuntimeZoneContactRow[]" "Unity target presentation must receive typed contact rows."
|
||||
Assert-Contains $targetPresentation "GetObservedVisibleContacts" "Unity target presentation must derive visible indicators from typed contact rows."
|
||||
Assert-NotContains $targetPresentation "QueryEntityContacts(" "Unity target presentation must not query contacts from raw zone snapshots."
|
||||
Assert-NotContains $targetPresentation "ResolveZone" "Unity target presentation must not hold raw zone snapshot access."
|
||||
Assert-Contains $observedDockingIndex ".Aetheria()" "Unity docking state must enter state through the semantic Aetheria facade."
|
||||
Assert-Contains $observedDockingIndex ".DockingState" "Unity docking state must read the typed CultMesh-backed docking snapshot."
|
||||
Assert-NotContains $observedDockingIndex ".CurrentDockingAsync()" "Unity docking state must not use the transitional current-docking helper."
|
||||
Assert-Contains $observedDockingIndex "TryResolveEntityByRecordKey(docking.DockParentEntityKey" "Unity docking facade adaptation must be keyed by typed dock parent identity."
|
||||
Assert-NotContains $observedDockingIndex "AetheriaRuntimeZoneSnapshotCommit" "Unity docking state must not receive raw zone snapshots."
|
||||
Assert-NotContains $observedDockingIndex "TryGetParentSnapshot" "Unity docking state must not scan raw snapshot parent relationships."
|
||||
Assert-NotContains $observedDockingIndex "TryGetEntitySnapshot" "Unity docking state must not scan raw entity snapshots."
|
||||
Assert-NotContains $targetPresentation "ResolveZoneSnapshot" "Unity target presentation must not hold raw zone snapshot access."
|
||||
Assert-NotContains $targetPresentation "Func<AetheriaRuntimeZoneSnapshotCommit" "Unity target presentation must not hold raw zone snapshot access."
|
||||
Assert-Contains $actionGameManager "GameplayState.CurrentDocking.Latest()" "Unity docking state must read the typed CultMesh-backed docking snapshot."
|
||||
Assert-Contains $actionGameManager "TryGetPresentationEntityByRecordKey(docking.DockParentEntityKey" "Unity docking presentation lookup must be keyed by typed dock parent identity."
|
||||
Assert-NotContains $actionGameManager ".CurrentDockingAsync()" "Unity docking state must not use the transitional current-docking helper."
|
||||
Assert-NotContains $actionGameManager ".CurrentDockingState(""unity-action-game-manager"")" "ActionGameManager must not use provider snapshot shortcuts at the access site."
|
||||
Assert-NotContains $actionGameManager "AetheriaRuntimeZoneSnapshotCommit" "Unity docking state must not receive raw zone snapshots."
|
||||
Assert-NotContains $actionGameManager "TryGetParentSnapshot" "Unity docking state must not scan raw snapshot parent relationships."
|
||||
Assert-NotContains $actionGameManager "TryGetEntitySnapshot" "Unity docking state must not scan raw entity snapshots."
|
||||
Assert-Contains $currentEntityBinder "ResolveZoneRender?.Invoke()" "Current-entity binding may resolve dock camera context through the typed zone-render feed."
|
||||
Assert-NotContains $currentEntityBinder "ResolveDaemonZone" "Current-entity binding must not pass raw zone snapshots into docked presentation."
|
||||
Assert-Contains $currentEntityPresentation "AetheriaRuntimeZoneRenderDocument zoneRender" "Docked presentation must consume the typed zone-render document for body lookups."
|
||||
|
|
@ -400,7 +468,8 @@ Assert-Contains $menuShell "public bool CanOpenRuntimeInputScreen()" "Unity menu
|
|||
Assert-Contains $menuShell "public void ShowRuntimeInputScreen()" "Unity menu shell should own runtime input-screen opening."
|
||||
Assert-Contains $gameplayInputShell "public sealed class AetheriaUnityGameplayInputShell" "Unity gameplay input callbacks should live outside ActionGameManager."
|
||||
Assert-Contains $gameplayInputShell "Input.Global.InputScreen.performed += context => MenuShell.ToggleFullscreenMenu(MenuShell.HelpScreen);" "Gameplay input shell should route the runtime input-screen hotkey through the shared menu shell."
|
||||
Assert-Contains $gameplayInputShell "Input.Player.TargetNearest.performed += context => PilotOperationAdapter.RequestTargetNearest();" "Gameplay input shell should lower player targeting input through typed pilot operations."
|
||||
Assert-Contains $gameplayInputShell "Input.Player.TargetNearest.performed += context => PilotOperationController.RequestTargetNearest();" "Gameplay input shell should lower player targeting input through typed pilot operations."
|
||||
Assert-Contains $pilotOperationController "Submit(operations => operations.TargetNearest(), ""target nearest"");" "Pilot operation controller should lower nearest-target input to typed pilot operations."
|
||||
Assert-Contains $gameplayInputShell "private void RegisterActionBarInput()" "Gameplay input shell should own action-bar control registration."
|
||||
Assert-Contains $gameplayInputShell "DragSession.RegisterTarget(dragAction => ActionBarPresentation.RequestBinding(slot, dragAction));" "Gameplay input shell should wire action-bar drag targets through injected presentation."
|
||||
Assert-NotContains $actionGameManager "private bool CanOpenRuntimeInputScreen()" "ActionGameManager should not own runtime input-screen availability."
|
||||
|
|
@ -416,12 +485,14 @@ Assert-NotContains $actionGameManager "private void RequestInteract()" "ActionGa
|
|||
Assert-NotContains $actionGameManager "private void RequestTowToStation()" "ActionGameManager should not keep gameplay request pass-through wrappers."
|
||||
Assert-NotContains $actionGameManager "_towingStation" "ActionGameManager should not cache stale towing context."
|
||||
Assert-NotContains $actionGameManager "UpdateTowingStation" "ActionGameManager should not receive stale towing context callbacks."
|
||||
Assert-Contains $actionGameManager "AetheriaUnityObservedRunProjection.FindZone" "ActionGameManager must not own observed galaxy zone lookup logic."
|
||||
Assert-Contains $actionGameManager "() => AetheriaUnityObservedRunProjection.Galaxy" "ActionGameManager may pass the observed sector projection only into the quarantined zone context adapter."
|
||||
Assert-Contains $actionGameManager "ObservedZoneContextFactory.ResolveGalaxyZone" "ActionGameManager must delegate observed galaxy zone lookup logic."
|
||||
Assert-Contains $observedZoneContextFactory "public GalaxyZone ResolveGalaxyZone(int daemonZoneIndex)" "Observed zone context factory must own observed galaxy zone lookup logic."
|
||||
Assert-Contains $actionGameManager "() => ObservedGalaxy" "ActionGameManager may pass the observed sector projection only into the quarantined zone context adapter."
|
||||
Assert-NotContains $actionGameManager "private static Galaxy ObservedGalaxy" "ActionGameManager must not keep an observed galaxy property."
|
||||
Assert-NotContains $actionGameManager "FindObservedGalaxyZone" "ActionGameManager must not own observed galaxy zone lookup logic."
|
||||
Assert-NotContains $actionGameManager "private GalaxyZone ResolveObservedGalaxyZone" "ActionGameManager must not own observed galaxy zone lookup logic."
|
||||
Assert-NotContains $actionGameManager "public static void ProjectObservedDaemonRun(" "ActionGameManager must not own daemon run projection."
|
||||
Assert-Contains $mainMenu "AetheriaUnityObservedRunProjection.Project(" "MainMenu must project daemon run boot data through the explicit observed-run projection holder."
|
||||
Assert-Contains $mainMenu "ResolveSectorMap(stateBoot)" "MainMenu must boot observed games from the typed sector-map document."
|
||||
Assert-NotContains $actionGameManager "public bool CanShowInputScreenFromMenu()" "ActionGameManager must not expose input-screen availability as public manager API."
|
||||
Assert-NotContains $actionGameManager "public void ShowInputScreenFromMenu()" "ActionGameManager must not expose input-screen opening as public manager API."
|
||||
Assert-NotContains $actionGameManager "public static Galaxy ObservedGalaxy" "ActionGameManager must not expose the observed galaxy as public gameplay state."
|
||||
|
|
@ -443,14 +514,12 @@ Assert-NotContains $actionGameManager "new AetheriaRuntimeDaemonRenderSettings("
|
|||
Assert-NotContains $actionGameManager "public EntityConstructionBlueprint CreateEntityConstructionBlueprint(AetheriaRuntimeLoadoutTemplateSnapshot template)" "ActionGameManager loadout template lowering must remain private renderer/bootstrap adaptation."
|
||||
Assert-NotContains $actionGameManager "public static RuntimePlayerSettings RuntimePlayerSettings" "ActionGameManager must not expose player settings as manager-global gameplay state."
|
||||
Assert-Contains $actionGameManager "AetheriaUnityRuntimeClientProvider.PlayerSettings" "ActionGameManager should read Unity runtime player settings through the runtime client provider."
|
||||
Assert-Contains $gameplayBootShell "AetheriaUnityRuntimeClientProvider.ResolveClient(stateBoot.StateFilePath, stateBoot.RuntimeId)" "Gameplay boot shell should open typed catalog through the runtime client provider."
|
||||
Assert-Contains $gameplayBootShell "AetheriaUnityRuntimeClientProvider.RuntimeState(stateBoot, stateBoot.RuntimeId)" "Gameplay boot shell should open typed state through the runtime client provider."
|
||||
Assert-Contains $runtimeClientProvider "public static class AetheriaUnityRuntimeClientProvider" "Unity runtime client cache should live outside ActionGameManager."
|
||||
Assert-Contains $runtimeClientProvider "public static RuntimePlayerSettings PlayerSettings =>" "Unity runtime client provider should own player settings loading."
|
||||
Assert-Contains $runtimeClientProvider "public static AetheriaClient ResolveClient(string stateFilePath, string runtimeId = """")" "Unity runtime client provider should own runtime-id-aware typed client caching."
|
||||
Assert-Contains $runtimeClientProvider ".Aetheria()" "Unity runtime client provider should read player settings through managed typed state."
|
||||
Assert-Contains $runtimeClientProvider ".Settings" "Unity runtime client provider should read player settings through the settings facade."
|
||||
Assert-Contains $runtimeClientProvider ".Player" "Unity runtime client provider should read the player settings document handle."
|
||||
Assert-Contains $runtimeClientProvider ".Latest()" "Unity runtime client provider should read a typed player settings snapshot."
|
||||
Assert-Contains $runtimeClientProvider "public static RuntimePlayerSettings PlayerSettings" "Unity runtime client provider should own player settings loading."
|
||||
Assert-Contains $runtimeClientProvider "private static AetheriaClient ResolveClient(string stateFilePath, string runtimeId = """")" "Unity runtime client provider should own runtime-id-aware typed client caching."
|
||||
Assert-Contains $runtimeClientProvider ".State" "Unity runtime client provider should read player settings through managed typed state."
|
||||
Assert-Contains $runtimeClientProvider "RuntimeState().PlayerSettings.Latest()" "Unity runtime client provider should read player settings through the named document handle."
|
||||
Assert-NotContains $runtimeClientProvider "PlayerSettingsAsync()" "Unity runtime client provider must not use the transitional player settings helper."
|
||||
Assert-NotContains $actionGameManager "ResolveRuntimeClient(" "ActionGameManager should not own typed client caching."
|
||||
Assert-NotContains $actionGameManager "PlayerSettingsAsync()" "ActionGameManager should not load player settings directly."
|
||||
|
|
@ -547,11 +616,9 @@ Assert-NotContains $hitscanEffect "ActionGameManager.Instance" "Hitscan effects
|
|||
Assert-NotContains $guidedProjectile "ActionGameManager.Instance" "Guided projectiles must not reach through ActionGameManager.Instance."
|
||||
|
||||
$client = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaClient.cs"
|
||||
$loadoutProjector = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeLoadoutSnapshotProjector.cs"
|
||||
Assert-Contains $loadoutProjector "ProjectLoadoutTemplate(" "Typed loadout projection must live in the shared runtime package."
|
||||
Assert-Contains $loadoutProjector "AetheriaRuntimeEntitySnapshotCommit entity" "Shared loadout projection must support daemon entity snapshots."
|
||||
Assert-Contains $loadoutProjector "ProjectLoadoutTemplateAsync(" "Shared loadout projection must compose loadout templates from managed typed state."
|
||||
Assert-Contains $loadoutProjector "AetheriaClientState state" "Shared loadout projection must accept the managed client state surface."
|
||||
Assert-Contains $clientState "CultMeshDocumentHandle<AetheriaRuntimeLoadoutTemplatesDocument> LoadoutTemplates" "Loadout templates must be a named managed CultMesh document."
|
||||
Assert-Contains $inventoryPanel "CreateLoadoutTemplate(targetEntityKey ?? """")" "InventoryPanel loadout saves must compose from typed daemon-frame state."
|
||||
Assert-Contains $inventoryPanel "StationRefitSnapshot()?.LoadoutRestoreOptions" "InventoryPanel loadout restores must use typed station-refit restore options."
|
||||
Assert-NotContains $client "LoadoutTemplateAsync" "AetheriaClient must not expose transitional loadout template projection helpers."
|
||||
|
||||
$inventoryPanel = Read-Text "Assets\Scripts\UI\Menu\InventoryPanel.cs"
|
||||
|
|
@ -585,8 +652,7 @@ Assert-Contains $stateDocs "ZoneDetails" "Daemon schema catalog must advertise z
|
|||
Assert-Contains $stateDocs "ZoneRender" "Daemon schema catalog must advertise zone render feed."
|
||||
|
||||
$catalogStore = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeCatalogStore.cs"
|
||||
Assert-Contains $catalogStore "ProjectTradeValuePolicySurfaceDocument" "Catalog store must expose typed trade-value policy as a designer Eve surface."
|
||||
Assert-Contains $catalogStore "AetheriaRuntimeTradeValuePolicySurfaceBuilder.Build" "Catalog store must build trade-value policy through the shared Eve surface builder."
|
||||
Assert-NotContains $catalogStore "ProjectTradeValuePolicySurfaceDocument" "Catalog store must not own trade-value policy surface projection."
|
||||
|
||||
$tradeValuePolicySurface = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeTradeValuePolicySurfaceBuilder.cs"
|
||||
Assert-Contains $tradeValuePolicySurface "SurfaceId = ""aetheria.tradeValuePolicy""" "Trade-value policy surface must have a stable designer surface id."
|
||||
|
|
@ -606,14 +672,15 @@ Assert-Contains $eveCommandClient "ReadTradeValuePolicyBody" "Eve command client
|
|||
|
||||
$eveCommandBridge = Read-Text "Aetheria.State\AetheriaEveCommandBridge.cs"
|
||||
Assert-Contains $eveCommandBridge "ExecuteTradeValuePolicyCommandAsync" "Eve command bridge must persist typed trade-value policy edits."
|
||||
Assert-Contains $eveCommandBridge "PutTradeValuePolicyAsync" "Trade-value policy edits must write the typed policy document."
|
||||
Assert-Contains $eveCommandBridge "MutableDocument<AetheriaTradeValuePolicy>(AetheriaStateNode.TradeValuePolicyKey)" "Trade-value policy edits must write the typed policy document."
|
||||
Assert-Contains $eveCommandBridge "tradeValuePolicy.ReplaceAsync(policy)" "Trade-value policy edits must persist the typed policy document."
|
||||
|
||||
$tickRunner = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeDaemonTickRunner.cs"
|
||||
Assert-Contains $tickRunner "ProjectTradeValuePolicySurfaceDocument(stateFilePath)" "Daemon editor surface must publish the trade-value policy designer surface."
|
||||
Assert-Contains $tickRunner "AetheriaRuntimeTradeValuePolicySurfaceBuilder.BuildFromCatalog(catalog)" "Daemon editor surface must publish the trade-value policy designer surface."
|
||||
|
||||
$client = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaClient.cs"
|
||||
Assert-Contains $client "AetheriaClientState State" "AetheriaClient must expose the semantic typed state facade."
|
||||
Assert-Contains $client "Aetheria()" "AetheriaClient must expose the canonical domain facade entrypoint."
|
||||
Assert-Contains $client "AetheriaClientState State" "AetheriaClient must expose the managed typed state object."
|
||||
Assert-NotContains $client "Aetheria() => State" "AetheriaClient must not keep an Aetheria() alias over State."
|
||||
Assert-Contains $client "AetheriaControl Control" "AetheriaClient must expose command controls separately from managed state documents."
|
||||
Assert-Contains $client "AetheriaUi Ui" "AetheriaClient must expose UI command submission separately from managed state documents."
|
||||
Assert-NotContains $client "Document<TDocument>()" "AetheriaClient must not forward typed document lookup; use AetheriaClientState."
|
||||
|
|
@ -623,42 +690,43 @@ Assert-NotContains $client "Watch<TDocument>()" "AetheriaClient must not forward
|
|||
Assert-NotContains $client "ReactiveAsync<TDocument>" "AetheriaClient must not forward reactive document creation; use AetheriaClientState."
|
||||
|
||||
$verseClient = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeVerseClient.cs"
|
||||
Assert-Contains $verseClient "AetheriaClientState Aetheria()" "AetheriaRuntimeVerseClient must expose the shared domain state facade."
|
||||
Assert-Contains $verseClient "CreateAetheriaStateFacade" "AetheriaRuntimeVerseClient must own projected state facade creation."
|
||||
Assert-Contains $verseClient "AetheriaClientState Aetheria()" "AetheriaRuntimeVerseClient must expose the managed typed state root for low-level bootstrap."
|
||||
Assert-Contains $verseClient "private AetheriaClientState CreateAetheriaState()" "AetheriaRuntimeVerseClient must own managed state creation."
|
||||
|
||||
$clientState = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaClientState.cs"
|
||||
Assert-Contains $clientState "CultMeshDocumentHandle<TDocument>" "Aetheria state documents must expose CultMesh typed document handles directly."
|
||||
Assert-Contains $clientState "CultMeshDocumentCatalog" "Aetheria state facade must delegate type/schema lookup to CultMesh."
|
||||
Assert-Contains $clientState "CultMesh.Documents" "Aetheria state facade must build its projected document catalog through CultMesh."
|
||||
Assert-Contains $clientState "ICultMeshDocumentHandle" "Aetheria schema lookup must expose CultMesh schema metadata independent of exact CLR type."
|
||||
Assert-NotContains $clientState "AetheriaRuntimeProjectedDocument" "Aetheria state facade must not wrap CultMesh document handles in a private projected-document abstraction."
|
||||
Assert-NotContains $clientState "_documentsByType" "Aetheria state facade must not maintain a private type index beside CultMeshDocumentCatalog."
|
||||
Assert-Contains $clientState "TryGetDocument<TDocument>" "Aetheria state facade must support safe typed document lookup."
|
||||
Assert-Contains $clientState "TryGetDocumentBySchema" "Aetheria state facade must support safe schema document lookup."
|
||||
Assert-Contains $clientState "Document<TDocument>()" "Aetheria state facade must support direct typed document lookup."
|
||||
Assert-Contains $clientState "DocumentBySchema(string schemaVersion)" "Aetheria state facade must support direct schema document lookup."
|
||||
Assert-NotContains $clientState "CultDocumentMessagePackSerialization" "Aetheria projected document aliasing must be owned by CultMesh, not the Aetheria facade."
|
||||
Assert-Contains $clientState "LatestAsync<TDocument>()" "Aetheria state facade must support one-call typed document reads."
|
||||
Assert-Contains $clientState "Watch<TDocument>()" "Aetheria state facade must support reactive typed document lookup."
|
||||
Assert-Contains $clientState "CultMeshDocumentHandle<" "Aetheria state documents must expose CultMesh typed document handles directly."
|
||||
Assert-Contains $clientState "public CultMeshDocumentHandle<AetheriaRuntimeDaemonFrameDocument> DaemonFrame" "Aetheria state must expose named managed typed document handles."
|
||||
Assert-Contains $clientState "public CultMeshDocumentHandle<AetheriaRuntimeCatalogSnapshot> Catalog" "Aetheria state must expose named managed typed document handles."
|
||||
Assert-Contains $clientState "public CultMeshDocumentHandle<AetheriaRuntimeCurrentEntityDocument> CurrentEntity" "Aetheria state must expose named managed typed document handles."
|
||||
Assert-Contains $clientState "public CultMeshDocumentHandle<AetheriaRuntimeInventoryDocument> Inventory(" "Aetheria state must expose parameterized typed document handles."
|
||||
Assert-NotContains $clientState "AetheriaRuntimeProjectedDocument" "Aetheria state must not wrap CultMesh document handles in a private projected-document abstraction."
|
||||
Assert-NotContains $clientState "_documentsByType" "Aetheria state must not maintain a private type index beside named handles."
|
||||
Assert-NotContains $clientState "TryGetDocument<TDocument>" "Aetheria state must not expose generic document lookup beside named handles."
|
||||
Assert-NotContains $clientState "TryGetDocumentBySchema" "Aetheria state must not expose schema-string lookup beside named handles."
|
||||
Assert-NotContains $clientState "Document<TDocument>()" "Aetheria state must not expose generic document lookup beside named handles."
|
||||
Assert-NotContains $clientState "DocumentBySchema(" "Aetheria state must not expose schema-string lookup beside named handles."
|
||||
Assert-NotContains $clientState "CultMeshDocumentCatalog" "Aetheria state must not maintain a generic document catalog beside named handles."
|
||||
Assert-NotContains $clientState "LatestAsync<TDocument>()" "Aetheria state must not expose generic one-call reads beside named handles."
|
||||
Assert-NotContains $clientState "Watch<TDocument>()" "Aetheria state must not expose generic watch shortcuts beside named handles."
|
||||
|
||||
$projection = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeRtsProjection.cs"
|
||||
Assert-Contains $projection "ProjectZoneDetails" "Shared projection code must own the zone-details feed."
|
||||
Assert-Contains $projection "ProjectZoneContacts" "Shared projection code must own the zone-contacts feed."
|
||||
Assert-Contains $projection "ProjectZoneTargetRow" "Zone-contacts projection must carry target geometry rows."
|
||||
Assert-Contains $projection "Distance = Math.Sqrt(deltaX * deltaX + deltaZ * deltaZ)" "Zone-contacts projection must carry target/contact distances."
|
||||
Assert-Contains $projection "ProjectZoneRender" "Shared projection code must own the zone-render feed."
|
||||
Assert-Contains $projection "ProjectCurrentEntity" "Shared projection code must own the current-entity feed."
|
||||
Assert-Contains $projection "ProjectCurrentDocking" "Shared projection code must own the current-docking feed."
|
||||
Assert-Contains $projection "ProjectStationRefit" "Shared projection code must own the station-refit feed."
|
||||
Assert-Contains $projection "Credits = context.Run.Credits" "Station-refit projection must carry typed run credits."
|
||||
Assert-Contains $projection "ProjectStationStock" "Station-refit projection must carry typed station stock."
|
||||
Assert-Contains $projection "CargoItems = ProjectStationStock(entity)" "Station-refit entity options must carry typed cargo rows for target counts."
|
||||
Assert-Contains $projection "ProjectStationStockTradeFacts" "Station-refit projection must enrich station stock with trade facts."
|
||||
Assert-Contains $projection "OwnedQuantity = CountStationOwnedQuantity" "Station-refit projection must publish owned counts for trade rows."
|
||||
Assert-Contains $projection "CanAfford = price >= 0 && credits >= price" "Station-refit projection must publish affordability for trade rows."
|
||||
Assert-Contains $projection "SourceIndex = sourceIndex" "Inventory projections must carry source slot identity for cargo/equipment operations."
|
||||
Assert-Contains $projection "X = slot.X" "Inventory projections must carry item grid X for cargo/equipment operations."
|
||||
Assert-Contains $projection "Y = slot.Y" "Inventory projections must carry item grid Y for cargo/equipment operations."
|
||||
$rtsDocuments = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeRtsDocuments.cs"
|
||||
Assert-Contains $rtsDocuments "ZoneDetails(" "Shared document code must own the zone-details feed."
|
||||
Assert-Contains $rtsDocuments "ZoneContacts(" "Shared document code must own the zone-contacts feed."
|
||||
Assert-Contains $rtsDocuments "ToZoneTargetRow" "Zone-contacts document must carry target geometry rows."
|
||||
Assert-Contains $rtsDocuments "Distance = Math.Sqrt(deltaX * deltaX + deltaZ * deltaZ)" "Zone-contacts document must carry target/contact distances."
|
||||
Assert-Contains $rtsDocuments "ZoneRender(" "Shared document code must own the zone-render feed."
|
||||
Assert-Contains $rtsDocuments "CurrentEntity(" "Shared document code must own the current-entity feed."
|
||||
Assert-Contains $rtsDocuments "CurrentDocking(" "Shared document code must own the current-docking feed."
|
||||
Assert-Contains $rtsDocuments "StationRefit(" "Shared document code must own the station-refit feed."
|
||||
Assert-Contains $rtsDocuments "Credits = context.Run.Credits" "Station-refit document must carry typed run credits."
|
||||
Assert-Contains $rtsDocuments "StationStock(" "Station-refit document must carry typed station stock."
|
||||
Assert-Contains $rtsDocuments "CargoItems = StationStock(entity)" "Station-refit entity options must carry typed cargo rows for target counts."
|
||||
Assert-Contains $rtsDocuments "StationStockTradeFacts(" "Station-refit document must enrich station stock with trade facts."
|
||||
Assert-Contains $rtsDocuments "OwnedQuantity = CountStationOwnedQuantity" "Station-refit document must publish owned counts for trade rows."
|
||||
Assert-Contains $rtsDocuments "CanAfford = price >= 0 && credits >= price" "Station-refit document must publish affordability for trade rows."
|
||||
Assert-Contains $rtsDocuments "SourceIndex = sourceIndex" "Inventory documents must carry source slot identity for cargo/equipment operations."
|
||||
Assert-Contains $rtsDocuments "X = slot.X" "Inventory documents must carry item grid X for cargo/equipment operations."
|
||||
Assert-Contains $rtsDocuments "Y = slot.Y" "Inventory documents must carry item grid Y for cargo/equipment operations."
|
||||
|
||||
$zoneRenderDocs = Read-Text "Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeRtsViewportDocuments.cs"
|
||||
Assert-Contains $zoneRenderDocs "public int SourceIndex" "Inventory item projection documents must carry source index."
|
||||
|
|
@ -689,6 +757,7 @@ Assert-NotContains $zoneRenderDocs "public AetheriaRuntimeRunCheckpointCommit Ru
|
|||
Assert-NotContains $zoneRenderDocs "public AetheriaRuntimeZoneSnapshotCommit Zone" "Zone-render feed must not expose the whole daemon zone snapshot."
|
||||
|
||||
$zoneRenderer = Read-Text "Assets\Scripts\Zone Display\ZoneRenderer.cs"
|
||||
$rtsViewportDocuments = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityRtsViewportDocuments.cs"
|
||||
Assert-Contains $zoneRenderer "ApplyZoneRender" "ZoneRenderer must consume the typed zone-render feed."
|
||||
Assert-Contains $zoneRenderer "_daemonCurrentEntityKey" "ZoneRenderer must track current entity as a render-feed fact, not through a run snapshot."
|
||||
Assert-Contains $zoneRenderer "_daemonSimulationTimeSeconds" "ZoneRenderer must track simulation time as a render-feed fact."
|
||||
|
|
@ -696,14 +765,19 @@ Assert-Contains $zoneRenderer "_zoneRenderBodyPoses" "ZoneRenderer must consume
|
|||
Assert-Contains $zoneRenderer "_zoneRenderAsteroidBeltPoses" "ZoneRenderer must consume asteroid belt poses from the zone-render feed."
|
||||
Assert-Contains $zoneRenderer "beltPose.InstancePoses" "ZoneRenderer asteroid rendering must consume typed asteroid instance poses from the zone-render feed."
|
||||
Assert-Contains $zoneRenderer "RestoreDroppedPickupsFromZoneRender" "ZoneRenderer dropped-pickup restore must consume the typed zone-render feed."
|
||||
Assert-Contains $zoneRenderer ".Aetheria()" "ZoneRenderer target distance cache must enter state through the semantic Aetheria facade."
|
||||
Assert-Contains $zoneRenderer ".ZoneContacts" "ZoneRenderer target distance cache must read the typed zone-contacts document handle."
|
||||
Assert-Contains $zoneRenderer ".LatestAsync()" "ZoneRenderer target distance cache must read a typed zone-contacts snapshot."
|
||||
Assert-Contains $zoneRenderer "AetheriaUnityRuntimeClientProvider" "ZoneRenderer target distance cache must enter state through managed typed documents."
|
||||
Assert-Contains $zoneRenderer ".ZonePresentationDocuments(" "ZoneRenderer target distance cache must bind managed presentation documents."
|
||||
Assert-Contains $zoneRenderer "CurrentContacts" "ZoneRenderer target distance cache must read the typed zone-contacts document from the presentation bundle."
|
||||
Assert-Contains $rtsViewportDocuments "state.ZoneContacts.Reactive()" "Zone presentation documents must bind zone contacts by grabbing the managed typed document handle directly."
|
||||
Assert-NotContains $rtsViewportDocuments "state.ReactiveZoneContacts()" "Zone presentation documents must not use per-document reactive wrapper methods."
|
||||
Assert-NotContains $zoneRenderer ".ZoneContactsAsync()" "ZoneRenderer target distance cache must not use the transitional zone-contacts helper."
|
||||
Assert-Contains $zoneRenderer "_daemonTargetRowsByEntityIndex" "ZoneRenderer target distance cache must store typed target rows."
|
||||
Assert-Contains $zoneRenderer "_daemonContactRows" "ZoneRenderer compass and visibility state must cache typed contact rows."
|
||||
Assert-Contains $zoneRenderer ".Viewports" "ZoneRenderer presentation loading must use managed viewport document handles."
|
||||
Assert-Contains $zoneRenderer ".Objects(ToViewportBounds(viewport))" "ZoneRenderer presentation loading must use the typed objects viewport document handle."
|
||||
Assert-Contains $zoneRenderer ".ZonePresentationDocuments(viewportBounds, ""unity-zone-renderer"")" "ZoneRenderer presentation loading must use managed viewport document handles."
|
||||
Assert-Contains $rtsViewportDocuments "state.ObjectsViewport(viewport).Reactive()" "Zone presentation documents must use the typed objects viewport document handle directly."
|
||||
Assert-Contains $rtsViewportDocuments "state.RenderSplatsViewport(viewport).Reactive()" "Zone presentation documents must use the typed render-splats viewport document handle directly."
|
||||
Assert-NotContains $rtsViewportDocuments "state.ReactiveObjectsViewport(viewport)" "Zone presentation documents must not use per-document reactive wrapper methods."
|
||||
Assert-NotContains $rtsViewportDocuments "state.ReactiveRenderSplatsViewport(viewport)" "Zone presentation documents must not use per-document reactive wrapper methods."
|
||||
Assert-NotContains $zoneRenderer "ObjectsViewportAsync(ToViewportBounds(viewport))" "ZoneRenderer presentation loading must not use the transitional objects viewport helper."
|
||||
Assert-NotContains $zoneRenderer "GravityViewportAsync(viewport)" "ZoneRenderer body view loading must not use the transitional gravity viewport helper."
|
||||
Assert-Contains $zoneRenderDocs "public AetheriaRuntimeBodySnapshotCommit Body" "Gravity/body viewport rows must carry the typed body payload needed for Unity presentation lowering."
|
||||
|
|
@ -731,7 +805,7 @@ $actionGameManager = Read-Text "Assets\Scripts\Gameplay\ActionGameManager.cs"
|
|||
$observedFrameApplier = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityObservedFrameApplier.cs"
|
||||
$gameplayLoopShell = Read-Text "Assets\Scripts\Gameplay\AetheriaUnityGameplayLoopShell.cs"
|
||||
Assert-Contains $actionGameManager "ObservedFrameApplier.ApplyLatestZoneRender()" "ActionGameManager must delegate typed zone-render application to the observed frame applier."
|
||||
Assert-Contains $actionGameManager ".Aetheria()" "ActionGameManager current-entity binding must enter zone-render state through the semantic Aetheria facade."
|
||||
Assert-Contains $actionGameManager "AetheriaUnityRuntimeClientProvider" "ActionGameManager current-entity binding must enter zone-render state through managed typed documents."
|
||||
Assert-Contains $actionGameManager ".ZoneRender" "ActionGameManager current-entity binding must resolve the typed zone-render document handle."
|
||||
Assert-NotContains $actionGameManager ".ZoneRenderAsync()" "ActionGameManager current-entity binding must not use the transitional zone-render helper."
|
||||
Assert-Contains $actionGameManager "private AetheriaUnityGameplayLoopShell GameplayLoopShell =>" "ActionGameManager should delegate per-frame Unity presentation/input ticking to the gameplay loop shell."
|
||||
|
|
@ -740,17 +814,17 @@ Assert-Contains $actionGameManager "GameplayLoopShell.LateTick()" "ActionGameMan
|
|||
Assert-Contains $gameplayLoopShell "public sealed class AetheriaUnityGameplayLoopShell" "Unity gameplay loop presentation ticking should live outside ActionGameManager."
|
||||
Assert-Contains $gameplayLoopShell "ApplyLatestZoneRender?.Invoke();" "Gameplay loop shell should apply the latest typed zone-render feed."
|
||||
Assert-Contains $gameplayLoopShell "CurrentEntityPresentation?.Tick(deltaTime);" "Gameplay loop shell should tick current-entity presentation."
|
||||
Assert-Contains $gameplayLoopShell "PilotFrameAdapter?.Tick(ResolveCurrentEntity?.Invoke(), deltaTime, time);" "Gameplay loop shell should tick pilot frame presentation/input."
|
||||
Assert-Contains $gameplayLoopShell "PilotFrameController?.Tick(ResolveCurrentEntity?.Invoke(), deltaTime, time);" "Gameplay loop shell should tick pilot frame presentation/input."
|
||||
Assert-Contains $gameplayLoopShell "TargetPresentation?.UpdateTargetIndicators(" "Gameplay loop shell should tick target indicators."
|
||||
Assert-NotContains $actionGameManager "_currentEntityPresentation.Tick(Time.deltaTime);" "ActionGameManager must not tick current-entity presentation directly."
|
||||
Assert-NotContains $actionGameManager "PilotFrameAdapter.Tick(CurrentEntity, Time.deltaTime, Time.time)" "ActionGameManager must not tick pilot frame presentation/input directly."
|
||||
Assert-NotContains $actionGameManager "PilotFrameController.Tick(CurrentEntity, Time.deltaTime, Time.time)" "ActionGameManager must not tick pilot frame presentation/input directly."
|
||||
Assert-NotContains $actionGameManager "_targetPresentation.UpdateTargetIndicators(" "ActionGameManager must not tick target indicators directly."
|
||||
Assert-NotContains $actionGameManager "_paused" "ActionGameManager must not own pause state; the loop shell owns it."
|
||||
Assert-NotContains $actionGameManager "_time" "ActionGameManager must not keep unused local simulation time."
|
||||
Assert-Contains $observedFrameApplier "TryRestoreEntityGraphFromZoneRender" "Observed frame applier must restore Unity shell state from the typed zone-render feed."
|
||||
Assert-Contains $observedFrameApplier "ApplyLatestZoneRender" "Observed frame applier must name the handoff as zone-render application."
|
||||
Assert-Contains $observedFrameApplier ".ZoneRender" "Observed frame applier must use the shared zone-render document handle at the frame handoff."
|
||||
Assert-Contains $observedFrameApplier "render.EntitySnapshots" "Observed frame applier entity restoration must consume the typed zone-render entity snapshot payload."
|
||||
Assert-Contains $observedFrameApplier "render.CreateEntitySnapshots()" "Observed frame applier entity restoration must consume the typed zone-render entity snapshot payload."
|
||||
Assert-NotContains $observedFrameApplier "Func<Galaxy>" "Observed frame applier must not depend on the whole observed galaxy facade."
|
||||
Assert-Contains $observedFrameApplier "_resolveObservedZone" "Observed frame applier should name the narrow target-zone resolver explicitly."
|
||||
Assert-NotContains $observedFrameApplier "resolveObservedGalaxy" "Observed frame applier must resolve only the target zone needed for Unity shell adaptation."
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp-firstpass",
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp.csproj", "{47728ed0-fa53-fa99-9dca-8eb78b1dbfe4}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameCult.Aetheria.State.Unity", "GameCult.Aetheria.State.Unity.csproj", "{d6094cfd-26d1-83d1-2366-5762cca2bc33}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniRx", "UniRx.csproj", "{99486114-c78b-e9b0-654f-710398497645}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameCult.Aetheria.EveRuntime", "GameCult.Aetheria.EveRuntime.csproj", "{a1a8b65b-ca79-2fa2-3803-5f4833778bdb}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameCult.Aetheria.State.Unity", "GameCult.Aetheria.State.Unity.csproj", "{d6094cfd-26d1-83d1-2366-5762cca2bc33}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aetheria.Shared.Unity", "Aetheria.Shared.Unity.csproj", "{31542707-f1f7-33c1-eef6-37982be14f82}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp-Editor-firstpass", "Assembly-CSharp-Editor-firstpass.csproj", "{b690125b-09ac-e423-4873-1648ff205166}"
|
||||
|
|
@ -42,12 +42,12 @@ Global
|
|||
{7c9c511c-1c6f-9c1f-c455-88359f498803}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{47728ed0-fa53-fa99-9dca-8eb78b1dbfe4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{47728ed0-fa53-fa99-9dca-8eb78b1dbfe4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{d6094cfd-26d1-83d1-2366-5762cca2bc33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{d6094cfd-26d1-83d1-2366-5762cca2bc33}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{99486114-c78b-e9b0-654f-710398497645}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{99486114-c78b-e9b0-654f-710398497645}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{a1a8b65b-ca79-2fa2-3803-5f4833778bdb}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{a1a8b65b-ca79-2fa2-3803-5f4833778bdb}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{d6094cfd-26d1-83d1-2366-5762cca2bc33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{d6094cfd-26d1-83d1-2366-5762cca2bc33}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{31542707-f1f7-33c1-eef6-37982be14f82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{31542707-f1f7-33c1-eef6-37982be14f82}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{b690125b-09ac-e423-4873-1648ff205166}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
|
|
|
|||
93
Assets/Editor/AetheriaEditorPlayModeTrigger.cs
Normal file
93
Assets/Editor/AetheriaEditorPlayModeTrigger.cs
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
[InitializeOnLoad]
|
||||
public static class AetheriaEditorPlayModeTrigger
|
||||
{
|
||||
private const string FlagPath = "Temp/request-playmode.flag";
|
||||
private const string ScreenshotFlagPath = "Temp/request-screenshot.flag";
|
||||
private const string ScreenshotPath = "Temp/aetheria-game-view-capture.png";
|
||||
private const string ScreenshotStatusPath = "Temp/aetheria-game-view-capture-status.txt";
|
||||
private const string EnsureUrpFlagPath = "Temp/request-ensure-urp.flag";
|
||||
|
||||
static AetheriaEditorPlayModeTrigger()
|
||||
{
|
||||
EditorApplication.update += Poll;
|
||||
}
|
||||
|
||||
private static void Poll()
|
||||
{
|
||||
if (TryConsumeFlag(FlagPath))
|
||||
{
|
||||
Debug.Log("Aetheria editor playmode trigger consumed Temp/request-playmode.flag.");
|
||||
RequestPlayMode();
|
||||
}
|
||||
|
||||
if (TryConsumeFlag(ScreenshotFlagPath))
|
||||
{
|
||||
EditorApplication.delayCall += CaptureScreenshot;
|
||||
}
|
||||
|
||||
if (TryConsumeFlag(EnsureUrpFlagPath))
|
||||
{
|
||||
Debug.Log("Aetheria editor URP bootstrap trigger consumed Temp/request-ensure-urp.flag.");
|
||||
EditorApplication.delayCall += AetheriaUrpBootstrap.EnsureUrpAssetsAndAssign;
|
||||
}
|
||||
}
|
||||
|
||||
private static bool TryConsumeFlag(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
return false;
|
||||
|
||||
File.Delete(path);
|
||||
return true;
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static void RequestPlayMode()
|
||||
{
|
||||
if (EditorApplication.isCompiling || EditorApplication.isUpdating)
|
||||
{
|
||||
EditorApplication.delayCall += RequestPlayMode;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!EditorApplication.isPlayingOrWillChangePlaymode)
|
||||
EditorApplication.isPlaying = true;
|
||||
}
|
||||
|
||||
private static void CaptureScreenshot()
|
||||
{
|
||||
File.WriteAllText(
|
||||
ScreenshotStatusPath,
|
||||
$"CaptureScreenshot invoked. compiling={EditorApplication.isCompiling} updating={EditorApplication.isUpdating} playing={EditorApplication.isPlaying}");
|
||||
|
||||
if (EditorApplication.isCompiling || EditorApplication.isUpdating)
|
||||
{
|
||||
EditorApplication.delayCall += CaptureScreenshot;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!EditorApplication.isPlaying)
|
||||
{
|
||||
RequestPlayMode();
|
||||
EditorApplication.delayCall += CaptureScreenshot;
|
||||
return;
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(ScreenshotPath));
|
||||
ScreenCapture.CaptureScreenshot(ScreenshotPath);
|
||||
File.WriteAllText(
|
||||
ScreenshotStatusPath,
|
||||
$"CaptureScreenshot requested {ScreenshotPath} at {System.DateTime.UtcNow:O}");
|
||||
Debug.Log($"Aetheria editor screenshot trigger captured {ScreenshotPath}.");
|
||||
}
|
||||
}
|
||||
11
Assets/Editor/AetheriaEditorPlayModeTrigger.cs.meta
Normal file
11
Assets/Editor/AetheriaEditorPlayModeTrigger.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 74234565bd344818b6152d034d86f937
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
296
Assets/Editor/AetheriaRenderProbe.cs
Normal file
296
Assets/Editor/AetheriaRenderProbe.cs
Normal file
|
|
@ -0,0 +1,296 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
[InitializeOnLoad]
|
||||
public static class AetheriaRenderProbe
|
||||
{
|
||||
private const string RelativeOutputDirectory = "Temp/AetheriaRenderProbe";
|
||||
|
||||
private static string ProjectRoot =>
|
||||
Path.GetFullPath(Path.Combine(Application.dataPath, ".."));
|
||||
|
||||
private static string OutputDirectory =>
|
||||
Path.Combine(ProjectRoot, RelativeOutputDirectory);
|
||||
|
||||
private static string RequestPath =>
|
||||
Path.Combine(OutputDirectory, "request.txt");
|
||||
|
||||
static AetheriaRenderProbe()
|
||||
{
|
||||
EditorApplication.update += Poll;
|
||||
}
|
||||
|
||||
private static void Poll()
|
||||
{
|
||||
if (!File.Exists(RequestPath))
|
||||
return;
|
||||
|
||||
if (EditorApplication.isCompiling || EditorApplication.isUpdating)
|
||||
return;
|
||||
|
||||
File.Delete(RequestPath);
|
||||
EditorApplication.delayCall += CaptureRequested;
|
||||
}
|
||||
|
||||
private static void CaptureRequested()
|
||||
{
|
||||
try
|
||||
{
|
||||
Capture();
|
||||
}
|
||||
catch (Exception error)
|
||||
{
|
||||
Directory.CreateDirectory(OutputDirectory);
|
||||
File.WriteAllText(
|
||||
Path.Combine(OutputDirectory, "error.txt"),
|
||||
error.ToString());
|
||||
Debug.LogException(error);
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("Aetheria/Rendering/Capture Render Probe")]
|
||||
public static void Capture()
|
||||
{
|
||||
Directory.CreateDirectory(OutputDirectory);
|
||||
|
||||
var summary = new StringBuilder();
|
||||
summary.AppendLine($"CapturedAtUtc: {DateTime.UtcNow:O}");
|
||||
summary.AppendLine($"ActiveScene: {SceneManager.GetActiveScene().path}");
|
||||
summary.AppendLine($"Playing: {EditorApplication.isPlaying}");
|
||||
summary.AppendLine();
|
||||
|
||||
var camera = ResolveCamera();
|
||||
summary.AppendLine(camera != null
|
||||
? $"Camera: {camera.name} orthographic={camera.orthographic} size={camera.orthographicSize} pixel={camera.pixelWidth}x{camera.pixelHeight}"
|
||||
: "Camera: <none>");
|
||||
|
||||
if (camera != null)
|
||||
VolumeSampling.RenderForCamera(camera);
|
||||
|
||||
DumpVolumeSamplers(summary);
|
||||
DumpVolumeCloudRenderers(camera, summary);
|
||||
DumpGlobalTexture(summary, "_NebulaSurfaceHeight", "nebula-surface-height.png");
|
||||
DumpGlobalTexture(summary, "_NebulaPatchHeight", "nebula-patch-height.png");
|
||||
DumpGlobalTexture(summary, "_NebulaPatch", "nebula-patch.png");
|
||||
DumpGlobalTexture(summary, "_NebulaTint", "nebula-tint.png");
|
||||
DumpGlobalTexture(summary, "_AetheriaGravityHeight", "gravity-height.png");
|
||||
|
||||
if (camera != null)
|
||||
DumpCamera(camera, summary);
|
||||
|
||||
File.WriteAllText(Path.Combine(OutputDirectory, "summary.txt"), summary.ToString());
|
||||
AssetDatabase.Refresh();
|
||||
Debug.Log($"Aetheria render probe wrote {Path.GetFullPath(OutputDirectory)}");
|
||||
}
|
||||
|
||||
private static Camera ResolveCamera()
|
||||
{
|
||||
if (Camera.main != null)
|
||||
return Camera.main;
|
||||
|
||||
foreach (var camera in Resources.FindObjectsOfTypeAll<Camera>())
|
||||
{
|
||||
if (camera == null ||
|
||||
!camera.gameObject.scene.IsValid() ||
|
||||
!camera.gameObject.scene.isLoaded ||
|
||||
!camera.enabled)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
return camera;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static void DumpVolumeCloudRenderers(Camera camera, StringBuilder summary)
|
||||
{
|
||||
summary.AppendLine();
|
||||
summary.AppendLine("VolumeCloudRenderers:");
|
||||
|
||||
foreach (var renderer in Resources.FindObjectsOfTypeAll<VolumeCloudRenderer>())
|
||||
{
|
||||
if (renderer == null ||
|
||||
!renderer.gameObject.scene.IsValid() ||
|
||||
!renderer.gameObject.scene.isLoaded)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
summary.AppendLine($"- {renderer.name} enabled={renderer.enabled} active={renderer.gameObject.activeInHierarchy}");
|
||||
summary.AppendLine($" registeredForCamera={VolumeCloudRenderer.TryGetRenderer(camera, out var registered) && registered == renderer}");
|
||||
summary.AppendLine($" renderCount={renderer.DebugRenderCount} lastFrame={renderer.DebugLastRenderFrame} firstFrame={renderer.DebugFirstFrame}");
|
||||
summary.AppendLine($" Undersample={TextureFacts(renderer.DebugUndersampleBuffer)}");
|
||||
summary.AppendLine($" History={TextureFacts(renderer.DebugHistoryBuffer)}");
|
||||
summary.AppendLine($" CurrentCloud={TextureFacts(renderer.DebugCurrentCloudBuffer)}");
|
||||
|
||||
if (renderer.DebugUndersampleBuffer != null)
|
||||
SaveTexture(renderer.DebugUndersampleBuffer, Path.Combine(OutputDirectory, "cloud-undersample.png"));
|
||||
if (renderer.DebugHistoryBuffer != null)
|
||||
SaveTexture(renderer.DebugHistoryBuffer, Path.Combine(OutputDirectory, "cloud-history.png"));
|
||||
if (renderer.DebugCurrentCloudBuffer != null)
|
||||
SaveTexture(renderer.DebugCurrentCloudBuffer, Path.Combine(OutputDirectory, "cloud-current.png"));
|
||||
}
|
||||
}
|
||||
|
||||
private static void DumpVolumeSamplers(StringBuilder summary)
|
||||
{
|
||||
summary.AppendLine();
|
||||
summary.AppendLine("VolumeSamplers:");
|
||||
|
||||
foreach (var sampler in Resources.FindObjectsOfTypeAll<VolumeSampling>())
|
||||
{
|
||||
if (sampler == null ||
|
||||
!sampler.gameObject.scene.IsValid() ||
|
||||
!sampler.gameObject.scene.isLoaded)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
summary.AppendLine($"- {sampler.name} enabled={sampler.enabled} active={sampler.gameObject.activeInHierarchy}");
|
||||
summary.AppendLine($" GridCamera={NameOf(sampler.GridCamera)} GridMesh={NameOf(sampler.GridMesh)}");
|
||||
summary.AppendLine($" SceneSplatSource={NameOf(sampler.SceneSplatSource)} SplatLayerRenderer={NameOf(sampler.SplatLayerRenderer)}");
|
||||
summary.AppendLine($" Surface={TextureFacts(sampler.NebulaSurfaceHeight)}");
|
||||
summary.AppendLine($" PatchHeight={TextureFacts(sampler.NebulaPatchHeight)}");
|
||||
summary.AppendLine($" Patch={TextureFacts(sampler.NebulaPatch)}");
|
||||
summary.AppendLine($" Tint={TextureFacts(sampler.NebulaTint)}");
|
||||
DumpSamplerEnvironment(sampler, summary);
|
||||
|
||||
if (sampler.SceneSplatSource != null)
|
||||
DumpSceneSplatDocument(sampler, summary);
|
||||
}
|
||||
}
|
||||
|
||||
private static void DumpSamplerEnvironment(VolumeSampling sampler, StringBuilder summary)
|
||||
{
|
||||
var settings = sampler.Settings;
|
||||
var environment = settings != null ? settings.DefaultEnvironment : null;
|
||||
summary.AppendLine($" Settings={NameOf(settings)}");
|
||||
if (environment == null)
|
||||
{
|
||||
summary.AppendLine(" Environment=<none>");
|
||||
return;
|
||||
}
|
||||
|
||||
summary.AppendLine(
|
||||
$" Nebula FillDensity={environment.Nebula.FillDensity} FillDistance={environment.Nebula.FillDistance} FillExponent={environment.Nebula.FillExponent} FillOffset={environment.Nebula.FillOffset}");
|
||||
summary.AppendLine(
|
||||
$" Nebula FloorOffset={environment.Nebula.FloorOffset} FloorBlend={environment.Nebula.FloorBlend} PatchDensity={environment.Nebula.PatchDensity} PatchBlend={environment.Nebula.PatchBlend}");
|
||||
summary.AppendLine(
|
||||
$" Nebula Luminance={environment.Nebula.Luminance} Extinction={environment.Nebula.Extinction} TintLodExponent={environment.Nebula.TintLodExponent} SafetyDistance={environment.Nebula.SafetyDistance}");
|
||||
summary.AppendLine(
|
||||
$" Lighting DynamicSkyBoost={environment.Lighting.DynamicSkyBoost} DynamicLodHigh={environment.Lighting.DynamicLodHigh} DynamicLodLow={environment.Lighting.DynamicLodLow} DynamicIntensity={environment.Lighting.DynamicIntensity}");
|
||||
summary.AppendLine(
|
||||
$" Noise Scale={environment.Noise.Scale} Amplitude={environment.Noise.Amplitude} Exponent={environment.Noise.Exponent} Speed={environment.Noise.Speed} SlopeExponent={environment.Noise.SlopeExponent}");
|
||||
summary.AppendLine(
|
||||
$" Flow GlobalScale={environment.Flow.GlobalScale} GlobalAmplitude={environment.Flow.GlobalAmplitude} GlobalScrollSpeed={environment.Flow.GlobalScrollSpeed} Period={environment.Flow.Period} SlopeAmplitude={environment.Flow.SlopeAmplitude} SwirlAmplitude={environment.Flow.SwirlAmplitude}");
|
||||
summary.AppendLine(
|
||||
$" Grid Enabled={environment.Grid.Enabled} Offset={environment.Grid.Offset}");
|
||||
}
|
||||
|
||||
private static void DumpSceneSplatDocument(VolumeSampling sampler, StringBuilder summary)
|
||||
{
|
||||
var size = sampler.GridCamera != null
|
||||
? new Vector2(sampler.GridCamera.orthographicSize * 2f, sampler.GridCamera.orthographicSize * 2f)
|
||||
: new Vector2(1024f, 1024f);
|
||||
var centerTransform = sampler.GridCamera != null ? sampler.GridCamera.transform : sampler.transform;
|
||||
var center = centerTransform != null
|
||||
? new Vector2(centerTransform.position.x, centerTransform.position.z)
|
||||
: Vector2.zero;
|
||||
var half = size * 0.5f;
|
||||
var document = sampler.SceneSplatSource.BuildDocument(new AetheriaRuntimeRtsViewportBounds
|
||||
{
|
||||
MinX = center.x - half.x,
|
||||
MinY = center.y - half.y,
|
||||
MaxX = center.x + half.x,
|
||||
MaxY = center.y + half.y
|
||||
});
|
||||
|
||||
summary.AppendLine($" SceneDocument layers={document.Layers?.Count ?? 0} splats={document.Splats?.Count ?? 0}");
|
||||
}
|
||||
|
||||
private static void DumpGlobalTexture(StringBuilder summary, string globalName, string fileName)
|
||||
{
|
||||
var texture = Shader.GetGlobalTexture(globalName);
|
||||
summary.AppendLine($"{globalName}: {TextureFacts(texture)}");
|
||||
if (texture != null)
|
||||
SaveTexture(texture, Path.Combine(OutputDirectory, fileName));
|
||||
}
|
||||
|
||||
private static void DumpCamera(Camera camera, StringBuilder summary)
|
||||
{
|
||||
var width = Mathf.Max(1, camera.pixelWidth > 0 ? camera.pixelWidth : 1920);
|
||||
var height = Mathf.Max(1, camera.pixelHeight > 0 ? camera.pixelHeight : 1080);
|
||||
var target = RenderTexture.GetTemporary(width, height, 24, RenderTextureFormat.ARGB32);
|
||||
var previousTarget = camera.targetTexture;
|
||||
var previousActive = RenderTexture.active;
|
||||
try
|
||||
{
|
||||
camera.targetTexture = target;
|
||||
camera.Render();
|
||||
SaveRenderTexture(target, Path.Combine(OutputDirectory, "camera-render.png"));
|
||||
summary.AppendLine($"CameraRender: {width}x{height} -> camera-render.png");
|
||||
}
|
||||
finally
|
||||
{
|
||||
camera.targetTexture = previousTarget;
|
||||
RenderTexture.active = previousActive;
|
||||
RenderTexture.ReleaseTemporary(target);
|
||||
}
|
||||
}
|
||||
|
||||
private static void SaveTexture(Texture texture, string path)
|
||||
{
|
||||
var width = Mathf.Max(1, texture.width);
|
||||
var height = Mathf.Max(1, texture.height);
|
||||
var target = RenderTexture.GetTemporary(width, height, 0, RenderTextureFormat.ARGB32);
|
||||
var previous = RenderTexture.active;
|
||||
try
|
||||
{
|
||||
Graphics.Blit(texture, target);
|
||||
SaveRenderTexture(target, path);
|
||||
}
|
||||
finally
|
||||
{
|
||||
RenderTexture.active = previous;
|
||||
RenderTexture.ReleaseTemporary(target);
|
||||
}
|
||||
}
|
||||
|
||||
private static void SaveRenderTexture(RenderTexture target, string path)
|
||||
{
|
||||
var previous = RenderTexture.active;
|
||||
RenderTexture.active = target;
|
||||
var image = new Texture2D(target.width, target.height, TextureFormat.RGBA32, false);
|
||||
try
|
||||
{
|
||||
image.ReadPixels(new Rect(0, 0, target.width, target.height), 0, 0);
|
||||
image.Apply();
|
||||
File.WriteAllBytes(path, image.EncodeToPNG());
|
||||
}
|
||||
finally
|
||||
{
|
||||
UnityEngine.Object.DestroyImmediate(image);
|
||||
RenderTexture.active = previous;
|
||||
}
|
||||
}
|
||||
|
||||
private static string NameOf(UnityEngine.Object value)
|
||||
{
|
||||
return value != null ? value.name : "<none>";
|
||||
}
|
||||
|
||||
private static string TextureFacts(Texture texture)
|
||||
{
|
||||
if (texture == null)
|
||||
return "<none>";
|
||||
|
||||
return $"{texture.name} {texture.width}x{texture.height} {texture.GetType().Name}";
|
||||
}
|
||||
}
|
||||
11
Assets/Editor/AetheriaRenderProbe.cs.meta
Normal file
11
Assets/Editor/AetheriaRenderProbe.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 53a42c6de14b4ed2bb0c02b0faeb95d2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,13 +1,26 @@
|
|||
using UnityEditor;
|
||||
using UnityEditor.SceneManagement;
|
||||
using Aetheria.Rendering.PostProcessing;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
using System.Linq;
|
||||
using System;
|
||||
|
||||
public static class AetheriaUrpBootstrap
|
||||
{
|
||||
private const string SettingsFolder = "Assets/Settings/Rendering";
|
||||
private const string PipelineAssetPath = SettingsFolder + "/AetheriaURPAsset.asset";
|
||||
private const string RendererAssetPath = SettingsFolder + "/AetheriaUniversalRenderer.asset";
|
||||
private const string MainMenuVolumeProfilePath = SettingsFolder + "/AetheriaMainMenuVolumeProfile.asset";
|
||||
private const string DefaultPostProcessDataPath =
|
||||
"Packages/com.unity.render-pipelines.universal/Runtime/Data/PostProcessData.asset";
|
||||
|
||||
[InitializeOnLoadMethod]
|
||||
private static void EnsureAetheriaRendererFeaturesOnLoad()
|
||||
{
|
||||
EditorApplication.delayCall += EnsureUrpAssetsAndAssign;
|
||||
}
|
||||
|
||||
[MenuItem("Aetheria/Rendering/Ensure URP Assets")]
|
||||
public static void EnsureUrpAssetsAndAssign()
|
||||
|
|
@ -28,6 +41,27 @@ public static class AetheriaUrpBootstrap
|
|||
AssetDatabase.CreateAsset(pipelineAsset, PipelineAssetPath);
|
||||
}
|
||||
|
||||
EnsureRendererFeature(
|
||||
rendererData,
|
||||
"AetheriaVolumeSamplingRendererFeature",
|
||||
"Aetheria Volume Sampling");
|
||||
EnsureRendererFeature(
|
||||
rendererData,
|
||||
"AetheriaVolumeCloudRendererFeature",
|
||||
"Aetheria Volume Clouds");
|
||||
EnsureRendererFeature(
|
||||
rendererData,
|
||||
"AetheriaStardustRendererFeature",
|
||||
"Aetheria Stardust");
|
||||
EnsureRendererFeature(
|
||||
rendererData,
|
||||
"Aetheria.Rendering.PostProcessing.AetheriaFogBlurRendererFeature",
|
||||
"Aetheria Fog Blur");
|
||||
EnsurePostProcessing(rendererData);
|
||||
var mainMenuVolumeProfile = EnsureMainMenuVolumeProfile();
|
||||
EnsureLoadedCameraPostProcessing();
|
||||
EnsureLoadedMainMenuVolumes(mainMenuVolumeProfile);
|
||||
|
||||
GraphicsSettings.defaultRenderPipeline = pipelineAsset;
|
||||
QualitySettings.renderPipeline = pipelineAsset;
|
||||
|
||||
|
|
@ -39,6 +73,210 @@ public static class AetheriaUrpBootstrap
|
|||
Debug.Log($"Aetheria URP asset assigned: {PipelineAssetPath}");
|
||||
}
|
||||
|
||||
private static void EnsureRendererFeature(
|
||||
UniversalRendererData rendererData,
|
||||
string featureTypeName,
|
||||
string featureName)
|
||||
{
|
||||
var featureType = AppDomain.CurrentDomain
|
||||
.GetAssemblies()
|
||||
.Select(assembly => assembly.GetType(featureTypeName))
|
||||
.FirstOrDefault(type => type != null);
|
||||
if (featureType == null || !typeof(ScriptableRendererFeature).IsAssignableFrom(featureType))
|
||||
{
|
||||
Debug.LogWarning($"Aetheria URP bootstrap could not find renderer feature type {featureTypeName}.");
|
||||
return;
|
||||
}
|
||||
|
||||
var existing = AssetDatabase
|
||||
.LoadAllAssetsAtPath(RendererAssetPath)
|
||||
.OfType<ScriptableRendererFeature>()
|
||||
.FirstOrDefault(feature => feature.GetType() == featureType);
|
||||
if (existing == null)
|
||||
{
|
||||
existing = (ScriptableRendererFeature)ScriptableObject.CreateInstance(featureType);
|
||||
existing.name = featureName;
|
||||
AssetDatabase.AddObjectToAsset(existing, rendererData);
|
||||
}
|
||||
|
||||
if (!rendererData.rendererFeatures.Contains(existing))
|
||||
rendererData.rendererFeatures.Add(existing);
|
||||
}
|
||||
|
||||
private static void EnsurePostProcessing(UniversalRendererData rendererData)
|
||||
{
|
||||
var serialized = new SerializedObject(rendererData);
|
||||
var postProcessData = serialized.FindProperty("postProcessData");
|
||||
if (postProcessData == null || postProcessData.objectReferenceValue != null)
|
||||
return;
|
||||
|
||||
postProcessData.objectReferenceValue =
|
||||
AssetDatabase.LoadAssetAtPath<PostProcessData>(DefaultPostProcessDataPath);
|
||||
serialized.ApplyModifiedPropertiesWithoutUndo();
|
||||
}
|
||||
|
||||
private static VolumeProfile EnsureMainMenuVolumeProfile()
|
||||
{
|
||||
var profile = AssetDatabase.LoadAssetAtPath<VolumeProfile>(MainMenuVolumeProfilePath);
|
||||
if (profile == null)
|
||||
{
|
||||
profile = ScriptableObject.CreateInstance<VolumeProfile>();
|
||||
profile.name = "AetheriaMainMenuVolumeProfile";
|
||||
AssetDatabase.CreateAsset(profile, MainMenuVolumeProfilePath);
|
||||
}
|
||||
|
||||
EnsureVolumeComponent(profile, out Tonemapping tonemapping);
|
||||
tonemapping.active = true;
|
||||
tonemapping.mode.overrideState = true;
|
||||
tonemapping.mode.value = TonemappingMode.ACES;
|
||||
|
||||
EnsureVolumeComponent(profile, out ColorAdjustments colorAdjustments);
|
||||
colorAdjustments.active = true;
|
||||
colorAdjustments.postExposure.overrideState = true;
|
||||
colorAdjustments.postExposure.value = -1f;
|
||||
|
||||
EnsureVolumeComponent(profile, out Bloom bloom);
|
||||
bloom.active = true;
|
||||
bloom.threshold.overrideState = true;
|
||||
bloom.threshold.value = 1.5f;
|
||||
bloom.intensity.overrideState = true;
|
||||
bloom.intensity.value = 3f;
|
||||
bloom.scatter.overrideState = true;
|
||||
bloom.scatter.value = 0.9f;
|
||||
bloom.tint.overrideState = true;
|
||||
bloom.tint.value = Color.white;
|
||||
|
||||
EnsureVolumeComponent(profile, out Vignette vignette);
|
||||
vignette.active = true;
|
||||
vignette.intensity.overrideState = true;
|
||||
vignette.intensity.value = 0.15f;
|
||||
vignette.smoothness.overrideState = true;
|
||||
vignette.smoothness.value = 0.45f;
|
||||
|
||||
EnsureVolumeComponent(profile, out AetheriaFogBlur fogBlur);
|
||||
fogBlur.active = true;
|
||||
fogBlur.focusDistance.overrideState = true;
|
||||
fogBlur.focusDistance.value = 10f;
|
||||
fogBlur.aperture.overrideState = true;
|
||||
fogBlur.aperture.value = 5.6f;
|
||||
fogBlur.focalLength.overrideState = true;
|
||||
fogBlur.focalLength.value = 50f;
|
||||
fogBlur.kernelSize.overrideState = true;
|
||||
fogBlur.kernelSize.value = (int)AetheriaFogBlurKernelSize.Medium;
|
||||
|
||||
EditorUtility.SetDirty(profile);
|
||||
return profile;
|
||||
}
|
||||
|
||||
private static void EnsureVolumeComponent<T>(VolumeProfile profile, out T component)
|
||||
where T : VolumeComponent
|
||||
{
|
||||
if (!profile.TryGet(out component))
|
||||
{
|
||||
component = profile.Add<T>(true);
|
||||
}
|
||||
}
|
||||
|
||||
private static void EnsureLoadedCameraPostProcessing()
|
||||
{
|
||||
foreach (var camera in Resources.FindObjectsOfTypeAll<Camera>())
|
||||
{
|
||||
if (camera == null || !camera.gameObject.scene.IsValid() || !camera.gameObject.scene.isLoaded)
|
||||
continue;
|
||||
|
||||
var hasAetheriaVolumeRenderer = camera.GetComponent<VolumeCloudRenderer>() != null;
|
||||
if (!camera.CompareTag("MainCamera") && !hasAetheriaVolumeRenderer)
|
||||
continue;
|
||||
|
||||
var data = camera.GetComponent<UniversalAdditionalCameraData>();
|
||||
if (data == null)
|
||||
data = camera.gameObject.AddComponent<UniversalAdditionalCameraData>();
|
||||
|
||||
var changed = false;
|
||||
changed |= SetIfDifferent(() => data.renderPostProcessing, value => data.renderPostProcessing = value, true);
|
||||
changed |= SetIfDifferent<LayerMask>(
|
||||
() => data.volumeLayerMask,
|
||||
value => data.volumeLayerMask = value,
|
||||
LayerMask.GetMask("PostProcessing"));
|
||||
changed |= SetIfDifferent(() => data.volumeTrigger, value => data.volumeTrigger = value, camera.transform);
|
||||
changed |= SetIfDifferent(() => data.requiresDepthOption, value => data.requiresDepthOption = value, CameraOverrideOption.On);
|
||||
changed |= SetIfDifferent(() => data.stopNaN, value => data.stopNaN = value, true);
|
||||
changed |= SetIfDifferent(() => data.dithering, value => data.dithering = value, true);
|
||||
|
||||
changed |= RemoveLegacyPostProcessLayer(camera.gameObject);
|
||||
|
||||
if (!changed)
|
||||
continue;
|
||||
|
||||
EditorUtility.SetDirty(camera.gameObject);
|
||||
EditorUtility.SetDirty(data);
|
||||
EditorSceneManager.MarkSceneDirty(camera.gameObject.scene);
|
||||
}
|
||||
}
|
||||
|
||||
private static bool RemoveLegacyPostProcessLayer(GameObject cameraObject)
|
||||
{
|
||||
var removed = false;
|
||||
foreach (var component in cameraObject.GetComponents<Component>())
|
||||
{
|
||||
if (component == null)
|
||||
continue;
|
||||
|
||||
var type = component.GetType();
|
||||
if (type.FullName != "UnityEngine.Rendering.PostProcessing.PostProcessLayer")
|
||||
continue;
|
||||
|
||||
UnityEngine.Object.DestroyImmediate(component);
|
||||
removed = true;
|
||||
}
|
||||
|
||||
return removed;
|
||||
}
|
||||
|
||||
private static void EnsureLoadedMainMenuVolumes(VolumeProfile mainMenuVolumeProfile)
|
||||
{
|
||||
if (mainMenuVolumeProfile == null)
|
||||
return;
|
||||
|
||||
foreach (var volume in Resources.FindObjectsOfTypeAll<Volume>())
|
||||
{
|
||||
if (volume == null || !volume.gameObject.scene.IsValid() || !volume.gameObject.scene.isLoaded)
|
||||
continue;
|
||||
|
||||
var isMainMenuVolume = volume.gameObject.name == "Postprocessing" &&
|
||||
volume.gameObject.scene.path.Replace('\\', '/').EndsWith("/Main Menu.unity", StringComparison.OrdinalIgnoreCase);
|
||||
if (!isMainMenuVolume)
|
||||
continue;
|
||||
|
||||
var changed = false;
|
||||
changed |= SetIfDifferent(() => volume.isGlobal, value => volume.isGlobal = value, true);
|
||||
changed |= SetIfDifferent(() => volume.sharedProfile, value => volume.sharedProfile = value, mainMenuVolumeProfile);
|
||||
|
||||
var postProcessingLayer = LayerMask.NameToLayer("PostProcessing");
|
||||
if (postProcessingLayer >= 0 && volume.gameObject.layer != postProcessingLayer)
|
||||
{
|
||||
volume.gameObject.layer = postProcessingLayer;
|
||||
changed = true;
|
||||
}
|
||||
|
||||
if (!changed)
|
||||
continue;
|
||||
|
||||
EditorUtility.SetDirty(volume);
|
||||
EditorUtility.SetDirty(volume.gameObject);
|
||||
EditorSceneManager.MarkSceneDirty(volume.gameObject.scene);
|
||||
}
|
||||
}
|
||||
|
||||
private static bool SetIfDifferent<T>(Func<T> get, Action<T> set, T value)
|
||||
{
|
||||
if (Equals(get(), value))
|
||||
return false;
|
||||
|
||||
set(value);
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void EnsureFolder(string folderPath)
|
||||
{
|
||||
var parts = folderPath.Split('/');
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ RenderTexture:
|
|||
m_Height: 256
|
||||
m_AntiAliasing: 1
|
||||
m_MipCount: -1
|
||||
m_DepthStencilFormat: 0
|
||||
m_DepthStencilFormat: 90
|
||||
m_ColorFormat: 45
|
||||
m_MipMap: 0
|
||||
m_GenerateMips: 1
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ RenderTexture:
|
|||
m_Height: 512
|
||||
m_AntiAliasing: 1
|
||||
m_MipCount: -1
|
||||
m_DepthStencilFormat: 0
|
||||
m_DepthStencilFormat: 90
|
||||
m_ColorFormat: 45
|
||||
m_MipMap: 0
|
||||
m_GenerateMips: 1
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ RenderTexture:
|
|||
m_Height: 2048
|
||||
m_AntiAliasing: 1
|
||||
m_MipCount: -1
|
||||
m_DepthStencilFormat: 0
|
||||
m_DepthStencilFormat: 90
|
||||
m_ColorFormat: 49
|
||||
m_MipMap: 0
|
||||
m_GenerateMips: 1
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ RenderTexture:
|
|||
m_Height: 512
|
||||
m_AntiAliasing: 1
|
||||
m_MipCount: -1
|
||||
m_DepthStencilFormat: 0
|
||||
m_DepthStencilFormat: 90
|
||||
m_ColorFormat: 74
|
||||
m_MipMap: 1
|
||||
m_GenerateMips: 1
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ RenderTexture:
|
|||
m_Height: 512
|
||||
m_AntiAliasing: 1
|
||||
m_MipCount: -1
|
||||
m_DepthStencilFormat: 0
|
||||
m_DepthStencilFormat: 90
|
||||
m_ColorFormat: 45
|
||||
m_MipMap: 0
|
||||
m_GenerateMips: 1
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ RenderTexture:
|
|||
m_Height: 512
|
||||
m_AntiAliasing: 1
|
||||
m_MipCount: -1
|
||||
m_DepthStencilFormat: 0
|
||||
m_DepthStencilFormat: 90
|
||||
m_ColorFormat: 74
|
||||
m_MipMap: 1
|
||||
m_GenerateMips: 1
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ RenderTexture:
|
|||
m_Height: 128
|
||||
m_AntiAliasing: 1
|
||||
m_MipCount: -1
|
||||
m_DepthStencilFormat: 0
|
||||
m_DepthStencilFormat: 90
|
||||
m_ColorFormat: 49
|
||||
m_MipMap: 0
|
||||
m_GenerateMips: 1
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ RenderTexture:
|
|||
m_Height: 128
|
||||
m_AntiAliasing: 1
|
||||
m_MipCount: -1
|
||||
m_DepthStencilFormat: 0
|
||||
m_DepthStencilFormat: 90
|
||||
m_ColorFormat: 45
|
||||
m_MipMap: 0
|
||||
m_GenerateMips: 1
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ RenderTexture:
|
|||
m_Height: 1024
|
||||
m_AntiAliasing: 1
|
||||
m_MipCount: -1
|
||||
m_DepthFormat: 0
|
||||
m_DepthFormat: 16
|
||||
m_ColorFormat: 49
|
||||
m_MipMap: 0
|
||||
m_GenerateMips: 1
|
||||
|
|
|
|||
2
Assets/Resources/UnityDefaultRuntimeTheme.tss
Normal file
2
Assets/Resources/UnityDefaultRuntimeTheme.tss
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
@import url("unity-theme://default");
|
||||
VisualElement {}
|
||||
12
Assets/Resources/UnityDefaultRuntimeTheme.tss.meta
Normal file
12
Assets/Resources/UnityDefaultRuntimeTheme.tss.meta
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c26065dab33d48c4cad13c4a4fbafe9b
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 12388, guid: 0000000000000000e000000000000000, type: 0}
|
||||
disableValidation: 0
|
||||
unsupportedSelectorAction: 0
|
||||
BIN
Assets/Scenes/ARPG_Profiles/Postprocessing Profile Main Menu.asset
(Stored with Git LFS)
BIN
Assets/Scenes/ARPG_Profiles/Postprocessing Profile Main Menu.asset
(Stored with Git LFS)
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Mesh;
|
||||
using TMPro;
|
||||
using UniRx.Triggers;
|
||||
using UnityEngine;
|
||||
|
|
@ -52,6 +53,7 @@ public class ActionBarSlot : MonoBehaviour
|
|||
|
||||
public abstract class ActionBarBinding
|
||||
{
|
||||
private static AetheriaClientState s_runtimeState;
|
||||
public Entity Entity { get; }
|
||||
private readonly Func<AetheriaControl> _resolveControl;
|
||||
protected ActionBarSlot Slot { get; }
|
||||
|
|
@ -97,9 +99,8 @@ public abstract class ActionBarBinding
|
|||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider
|
||||
.CurrentCatalog()
|
||||
.FindItem(item, x => x.ItemKey);
|
||||
s_runtimeState ??= AetheriaUnityRuntimeClientProvider.RuntimeState("unity-action-bar");
|
||||
return s_runtimeState.Catalog.Latest()?.FindItem(item, x => x.ItemKey);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@
|
|||
using System;
|
||||
using Cinemachine;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Mesh;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.PostProcessing;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Serialization;
|
||||
using UnityEngine.UI;
|
||||
using float2 = Unity.Mathematics.float2;
|
||||
|
|
@ -29,13 +30,17 @@ public class ActionGameManager : MonoBehaviour
|
|||
private AetheriaUnityGameplayLoopShell _gameplayLoopShell;
|
||||
private AetheriaUnityGameplayBootShell _gameplayBootShell;
|
||||
private AetheriaUnityGameplaySceneWiring _sceneWiring;
|
||||
private AetheriaClientState _gameplayState;
|
||||
private AetheriaClientState GameplayState =>
|
||||
_gameplayState ??= AetheriaUnityRuntimeClientProvider.RuntimeState("unity-action-game-manager");
|
||||
|
||||
private AetheriaUnityPilotCommandSender PilotCommands =>
|
||||
_pilotCommands ??= new AetheriaUnityPilotCommandSender(
|
||||
() => AetheriaUnityRuntimeClientProvider.Control("unity-pilot-commands"),
|
||||
() => Time.unscaledTime);
|
||||
private AetheriaUnityObservedEntityRestorer ObservedEntityRestorer =>
|
||||
_observedEntityRestorer ??= new AetheriaUnityObservedEntityRestorer(
|
||||
_observedEntityIndex,
|
||||
_presentationEntityIndex,
|
||||
ItemManager,
|
||||
EntityBlueprintMaterializer.MaterializeObservedEntity,
|
||||
_loadoutItemFactory.CreateLoadoutItem,
|
||||
|
|
@ -81,16 +86,16 @@ public class ActionGameManager : MonoBehaviour
|
|||
private AetheriaUnityPilotOperationController PilotOperationController =>
|
||||
_pilotOperationController ??= new AetheriaUnityPilotOperationController(
|
||||
() => PilotCommands,
|
||||
_observedEntityIndex,
|
||||
_presentationEntityIndex,
|
||||
() => _viewDirection,
|
||||
() => CurrentEntity);
|
||||
private AetheriaUnityObservedFrameApplier ObservedFrameApplier =>
|
||||
_observedFrameApplier ??= new AetheriaUnityObservedFrameApplier(
|
||||
ResolveDaemonObserver,
|
||||
ResolveObservedGalaxyZone,
|
||||
ObservedZoneContextFactory.ResolveGalaxyZone,
|
||||
() => Zone,
|
||||
zone => Zone = zone,
|
||||
_observedEntityIndex,
|
||||
_presentationEntityIndex,
|
||||
ObservedEntityRestorer,
|
||||
ObservedZoneContextFactory,
|
||||
() => ZoneRenderer,
|
||||
|
|
@ -200,7 +205,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
TargetShieldsFill = TargetShieldsFill,
|
||||
MainMenu = MainMenu
|
||||
};
|
||||
private readonly AetheriaUnityObservedEntityIndex _observedEntityIndex = new AetheriaUnityObservedEntityIndex();
|
||||
private readonly AetheriaUnityPresentationEntityIndex _presentationEntityIndex = new AetheriaUnityPresentationEntityIndex();
|
||||
private static RuntimePlayerSettings RuntimePlayerSettings
|
||||
=> AetheriaUnityRuntimeClientProvider.PlayerSettings;
|
||||
|
||||
|
|
@ -211,9 +216,9 @@ public class ActionGameManager : MonoBehaviour
|
|||
public float TargetSpottedBlinkOffset = -.25f;
|
||||
|
||||
[Header("Postprocessing")]
|
||||
public PostProcessVolume DeathPost;
|
||||
public PostProcessVolume HeatstrokePost;
|
||||
public PostProcessVolume SevereHeatstrokePost;
|
||||
public Volume DeathPost;
|
||||
public Volume HeatstrokePost;
|
||||
public Volume SevereHeatstrokePost;
|
||||
|
||||
[Header("Scene Links")]
|
||||
public GameObject UiRoot;
|
||||
|
|
@ -303,7 +308,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
SceneWiring.ConfigureTargetPresentation(
|
||||
_targetPresentation,
|
||||
boot.RuntimeCatalog,
|
||||
_observedEntityIndex);
|
||||
_presentationEntityIndex);
|
||||
SceneWiring.ConfigureInventoryDragSession(_dragSession);
|
||||
SceneWiring.ConfigureActionBarPresentation(
|
||||
_actionBarPresentation,
|
||||
|
|
@ -313,7 +318,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
() => CurrentEntity,
|
||||
() => AetheriaUnityRuntimeClientProvider.Control("unity-action-bar"));
|
||||
SceneWiring.ConfigureRuntimeInputScreenShell(MenuShell);
|
||||
SceneWiring.ConfigureObservedEntityIndex(_observedEntityIndex);
|
||||
SceneWiring.ConfigurePresentationEntityIndex(_presentationEntityIndex);
|
||||
|
||||
// TODO: Process Stories
|
||||
|
||||
|
|
@ -347,7 +352,7 @@ public class ActionGameManager : MonoBehaviour
|
|||
return false;
|
||||
}
|
||||
|
||||
if (_observedEntityIndex.TryResolveEntityRecordKey(CurrentEntity, out var currentEntityKey) &&
|
||||
if (_presentationEntityIndex.TryGetRecordKeyForPresentationEntity(CurrentEntity, out var currentEntityKey) &&
|
||||
!string.IsNullOrWhiteSpace(docking.CurrentEntityKey) &&
|
||||
!string.Equals(docking.CurrentEntityKey, currentEntityKey, StringComparison.Ordinal))
|
||||
{
|
||||
|
|
@ -369,23 +374,23 @@ public class ActionGameManager : MonoBehaviour
|
|||
return null;
|
||||
}
|
||||
|
||||
if (_observedEntityIndex.TryResolveEntityRecordKey(currentEntity, out var currentEntityKey) &&
|
||||
if (_presentationEntityIndex.TryGetRecordKeyForPresentationEntity(currentEntity, out var currentEntityKey) &&
|
||||
!string.IsNullOrWhiteSpace(docking.CurrentEntityKey) &&
|
||||
!string.Equals(docking.CurrentEntityKey, currentEntityKey, StringComparison.Ordinal))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return _observedEntityIndex.TryResolveEntityByRecordKey(docking.DockParentEntityKey, out var dockParent)
|
||||
return _presentationEntityIndex.TryGetPresentationEntityByRecordKey(docking.DockParentEntityKey, out var dockParent)
|
||||
? dockParent
|
||||
: null;
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeCurrentDockingDocument CurrentDockingSnapshot()
|
||||
private AetheriaRuntimeCurrentDockingDocument CurrentDockingSnapshot()
|
||||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.CurrentDockingState("unity-action-game-manager");
|
||||
return GameplayState.CurrentDocking.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -394,20 +399,6 @@ public class ActionGameManager : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
private GalaxyZone ResolveObservedGalaxyZone(int daemonZoneIndex)
|
||||
{
|
||||
if (daemonZoneIndex < 0 || ObservedGalaxy?.Zones == null)
|
||||
return null;
|
||||
|
||||
foreach (var zone in ObservedGalaxy.Zones)
|
||||
{
|
||||
if (zone != null && zone.ZoneIndex == daemonZoneIndex)
|
||||
return zone;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// public void ToggleEditMode()
|
||||
// {
|
||||
// _editMode = !_editMode;
|
||||
|
|
|
|||
271
Assets/Scripts/Gameplay/AetheriaSceneRenderSplatSource.cs
Normal file
271
Assets/Scripts/Gameplay/AetheriaSceneRenderSplatSource.cs
Normal file
|
|
@ -0,0 +1,271 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using UnityEngine;
|
||||
|
||||
public sealed class AetheriaSceneRenderSplatSource : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private string documentName = "Scene Mock";
|
||||
|
||||
[SerializeField]
|
||||
private AetheriaSceneRenderSplat[] splats =
|
||||
{
|
||||
AetheriaSceneRenderSplat.Animated(
|
||||
AetheriaRuntimeRenderSplatLayerKeys.FogSurfaceHeight,
|
||||
"scene.fog_surface",
|
||||
Vector2.zero,
|
||||
new Vector2(512, 512),
|
||||
Color.white,
|
||||
4,
|
||||
4,
|
||||
0.015f),
|
||||
AetheriaSceneRenderSplat.Animated(
|
||||
AetheriaRuntimeRenderSplatLayerKeys.FogPatchHeight,
|
||||
"scene.fog_patch_height",
|
||||
Vector2.zero,
|
||||
new Vector2(512, 512),
|
||||
Color.white,
|
||||
9,
|
||||
9,
|
||||
0.02f),
|
||||
AetheriaSceneRenderSplat.Animated(
|
||||
AetheriaRuntimeRenderSplatLayerKeys.FogPatch,
|
||||
"scene.fog_patch",
|
||||
Vector2.zero,
|
||||
new Vector2(512, 512),
|
||||
Color.white,
|
||||
6,
|
||||
6,
|
||||
0.01f)
|
||||
};
|
||||
|
||||
[SerializeField]
|
||||
private AetheriaSceneRenderSplatFixture[] fixtures = Array.Empty<AetheriaSceneRenderSplatFixture>();
|
||||
|
||||
public AetheriaRuntimeRenderSplatsViewportDocument BuildDocument(AetheriaRuntimeRtsViewportBounds viewport)
|
||||
{
|
||||
viewport ??= new AetheriaRuntimeRtsViewportBounds();
|
||||
var normalizedViewport = Normalize(viewport);
|
||||
var layers = BuildLayers();
|
||||
var layerIndices = new Dictionary<string, int>(StringComparer.Ordinal);
|
||||
for (var index = 0; index < layers.Length; index++)
|
||||
layerIndices[layers[index].LayerKey] = index;
|
||||
|
||||
var builder = new Builder();
|
||||
foreach (var splat in splats ?? Array.Empty<AetheriaSceneRenderSplat>())
|
||||
splat.AddTo(builder, layerIndices);
|
||||
foreach (var fixture in fixtures ?? Array.Empty<AetheriaSceneRenderSplatFixture>())
|
||||
fixture.AddTo(builder, layerIndices);
|
||||
|
||||
return new AetheriaRuntimeRenderSplatsViewportDocument
|
||||
{
|
||||
PublishedAtUtc = DateTimeOffset.UtcNow.ToString("O"),
|
||||
SimulationTimeSeconds = Application.isPlaying ? Time.timeAsDouble : 0,
|
||||
RunId = "scene",
|
||||
ZoneName = string.IsNullOrWhiteSpace(documentName) ? gameObject.scene.name : documentName,
|
||||
Viewport = normalizedViewport,
|
||||
Layers = layers,
|
||||
Splats = builder.Build()
|
||||
};
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeRtsViewportBounds Normalize(AetheriaRuntimeRtsViewportBounds viewport)
|
||||
{
|
||||
return new AetheriaRuntimeRtsViewportBounds
|
||||
{
|
||||
MinX = Math.Min(viewport.MinX, viewport.MaxX),
|
||||
MinY = Math.Min(viewport.MinY, viewport.MaxY),
|
||||
MaxX = Math.Max(viewport.MinX, viewport.MaxX),
|
||||
MaxY = Math.Max(viewport.MinY, viewport.MaxY)
|
||||
};
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeRenderSplatLayerDefinition[] BuildLayers()
|
||||
{
|
||||
return new[]
|
||||
{
|
||||
Layer(AetheriaRuntimeRenderSplatLayerKeys.GravityHeight, "Gravity Height", AetheriaRuntimeRenderSplatChannels.Gravity),
|
||||
Layer(AetheriaRuntimeRenderSplatLayerKeys.GravityWave, "Gravity Wave", AetheriaRuntimeRenderSplatChannels.GravityWave),
|
||||
Layer(AetheriaRuntimeRenderSplatLayerKeys.Visibility, "Visibility Mask", AetheriaRuntimeRenderSplatChannels.Visibility, AetheriaRuntimeRenderSplatBlendModes.Max),
|
||||
Layer(AetheriaRuntimeRenderSplatLayerKeys.FogSurfaceHeight, "Fog Surface Height", AetheriaRuntimeRenderSplatChannels.Tint),
|
||||
Layer(AetheriaRuntimeRenderSplatLayerKeys.FogPatchHeight, "Fog Patch Height", AetheriaRuntimeRenderSplatChannels.Tint),
|
||||
Layer(AetheriaRuntimeRenderSplatLayerKeys.FogPatch, "Fog Patch", AetheriaRuntimeRenderSplatChannels.Tint, AetheriaRuntimeRenderSplatBlendModes.Max),
|
||||
Layer(AetheriaRuntimeRenderSplatLayerKeys.FogTint, "Fog Tint", AetheriaRuntimeRenderSplatChannels.Tint, graphicsFormat: "B10G11R11_UFloatPack32"),
|
||||
Layer(AetheriaRuntimeRenderSplatLayerKeys.Influence, "Influence", AetheriaRuntimeRenderSplatChannels.Influence)
|
||||
};
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeRenderSplatLayerDefinition Layer(
|
||||
string key,
|
||||
string displayName,
|
||||
int channel,
|
||||
string blendMode = AetheriaRuntimeRenderSplatBlendModes.Add,
|
||||
string graphicsFormat = "R16_SFloat")
|
||||
{
|
||||
return new AetheriaRuntimeRenderSplatLayerDefinition
|
||||
{
|
||||
LayerKey = key,
|
||||
DisplayName = displayName,
|
||||
Channel = channel,
|
||||
BlendMode = blendMode,
|
||||
GraphicsFormat = graphicsFormat
|
||||
};
|
||||
}
|
||||
|
||||
public sealed class Builder
|
||||
{
|
||||
private readonly List<double> _centerX = new List<double>();
|
||||
private readonly List<double> _centerY = new List<double>();
|
||||
private readonly List<double> _halfExtentX = new List<double>();
|
||||
private readonly List<double> _halfExtentY = new List<double>();
|
||||
private readonly List<double> _rotationCos = new List<double>();
|
||||
private readonly List<double> _rotationSin = new List<double>();
|
||||
private readonly List<int> _channel = new List<int>();
|
||||
private readonly List<int> _falloff = new List<int>();
|
||||
private readonly List<double> _valueR = new List<double>();
|
||||
private readonly List<double> _valueG = new List<double>();
|
||||
private readonly List<double> _valueB = new List<double>();
|
||||
private readonly List<double> _valueA = new List<double>();
|
||||
private readonly List<string> _sourceKey = new List<string>();
|
||||
private readonly List<int> _layerIndex = new List<int>();
|
||||
private readonly List<int> _sourceKind = new List<int>();
|
||||
private readonly List<double> _frequencyX = new List<double>();
|
||||
private readonly List<double> _frequencyY = new List<double>();
|
||||
private readonly List<double> _phaseX = new List<double>();
|
||||
private readonly List<double> _phaseY = new List<double>();
|
||||
private readonly List<double> _animationSpeed = new List<double>();
|
||||
private readonly List<double> _sourceFlags = new List<double>();
|
||||
|
||||
public void Add(AetheriaSceneRenderSplat splat, int layerIndex)
|
||||
{
|
||||
var rotationRadians = splat.RotationDegrees * Mathf.Deg2Rad;
|
||||
_layerIndex.Add(layerIndex);
|
||||
_centerX.Add(splat.Center.x);
|
||||
_centerY.Add(splat.Center.y);
|
||||
_halfExtentX.Add(Math.Max(0, splat.HalfExtent.x));
|
||||
_halfExtentY.Add(Math.Max(0, splat.HalfExtent.y));
|
||||
_rotationCos.Add(Math.Cos(rotationRadians));
|
||||
_rotationSin.Add(Math.Sin(rotationRadians));
|
||||
_channel.Add(splat.Channel);
|
||||
_falloff.Add(splat.Falloff);
|
||||
_valueR.Add(splat.Value.r);
|
||||
_valueG.Add(splat.Value.g);
|
||||
_valueB.Add(splat.Value.b);
|
||||
_valueA.Add(splat.Value.a);
|
||||
_sourceKey.Add(splat.SourceKey ?? "");
|
||||
_sourceKind.Add(splat.SourceKind);
|
||||
_frequencyX.Add(splat.Frequency.x);
|
||||
_frequencyY.Add(splat.Frequency.y);
|
||||
_phaseX.Add(splat.Phase.x);
|
||||
_phaseY.Add(splat.Phase.y);
|
||||
_animationSpeed.Add(splat.AnimationSpeed);
|
||||
_sourceFlags.Add(splat.SourceFlags);
|
||||
}
|
||||
|
||||
public AetheriaRuntimeRenderSplatSoa Build()
|
||||
{
|
||||
return new AetheriaRuntimeRenderSplatSoa
|
||||
{
|
||||
Count = _centerX.Count,
|
||||
CenterX = _centerX.ToArray(),
|
||||
CenterY = _centerY.ToArray(),
|
||||
HalfExtentX = _halfExtentX.ToArray(),
|
||||
HalfExtentY = _halfExtentY.ToArray(),
|
||||
RotationCos = _rotationCos.ToArray(),
|
||||
RotationSin = _rotationSin.ToArray(),
|
||||
Channel = _channel.ToArray(),
|
||||
Falloff = _falloff.ToArray(),
|
||||
ValueR = _valueR.ToArray(),
|
||||
ValueG = _valueG.ToArray(),
|
||||
ValueB = _valueB.ToArray(),
|
||||
ValueA = _valueA.ToArray(),
|
||||
SourceKey = _sourceKey.ToArray(),
|
||||
LayerIndex = _layerIndex.ToArray(),
|
||||
SourceKind = _sourceKind.ToArray(),
|
||||
FrequencyX = _frequencyX.ToArray(),
|
||||
FrequencyY = _frequencyY.ToArray(),
|
||||
PhaseX = _phaseX.ToArray(),
|
||||
PhaseY = _phaseY.ToArray(),
|
||||
AnimationSpeed = _animationSpeed.ToArray(),
|
||||
SourceFlags = _sourceFlags.ToArray()
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public sealed class AetheriaSceneRenderSplat
|
||||
{
|
||||
public string LayerKey = AetheriaRuntimeRenderSplatLayerKeys.FogTint;
|
||||
public string SourceKey = "";
|
||||
public Vector2 Center;
|
||||
public Vector2 HalfExtent = Vector2.one * 32;
|
||||
public float RotationDegrees;
|
||||
public int Channel = AetheriaRuntimeRenderSplatChannels.Tint;
|
||||
public int Falloff = AetheriaRuntimeRenderSplatFalloffs.Smooth;
|
||||
public Color Value = Color.white;
|
||||
public int SourceKind = AetheriaRuntimeRenderSplatSourceKinds.Constant;
|
||||
public Vector2 Frequency = Vector2.one;
|
||||
public Vector2 Phase;
|
||||
public float AnimationSpeed;
|
||||
public float SourceFlags;
|
||||
|
||||
public static AetheriaSceneRenderSplat Animated(
|
||||
string layerKey,
|
||||
string sourceKey,
|
||||
Vector2 center,
|
||||
Vector2 halfExtent,
|
||||
Color value,
|
||||
float frequencyX,
|
||||
float frequencyY,
|
||||
float animationSpeed)
|
||||
{
|
||||
return new AetheriaSceneRenderSplat
|
||||
{
|
||||
LayerKey = layerKey,
|
||||
SourceKey = sourceKey,
|
||||
Center = center,
|
||||
HalfExtent = halfExtent,
|
||||
Channel = AetheriaRuntimeRenderSplatChannels.Tint,
|
||||
Falloff = AetheriaRuntimeRenderSplatFalloffs.Solid,
|
||||
Value = value,
|
||||
SourceKind = AetheriaRuntimeRenderSplatSourceKinds.AnimatedSimplexNoise,
|
||||
Frequency = new Vector2(frequencyX, frequencyY),
|
||||
AnimationSpeed = animationSpeed,
|
||||
SourceFlags = 1
|
||||
};
|
||||
}
|
||||
|
||||
public void AddTo(AetheriaSceneRenderSplatSource.Builder builder, IReadOnlyDictionary<string, int> layerIndices)
|
||||
{
|
||||
if (builder == null || !layerIndices.TryGetValue(LayerKey ?? "", out var layerIndex))
|
||||
return;
|
||||
|
||||
builder.Add(this, layerIndex);
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public sealed class AetheriaSceneRenderSplatFixture
|
||||
{
|
||||
public Transform Transform;
|
||||
public AetheriaSceneRenderSplat Splat = new AetheriaSceneRenderSplat();
|
||||
|
||||
public void AddTo(AetheriaSceneRenderSplatSource.Builder builder, IReadOnlyDictionary<string, int> layerIndices)
|
||||
{
|
||||
if (Transform == null || Splat == null)
|
||||
return;
|
||||
|
||||
var previousCenter = Splat.Center;
|
||||
Splat.Center = new Vector2(Transform.position.x, Transform.position.z);
|
||||
try
|
||||
{
|
||||
Splat.AddTo(builder, layerIndices);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Splat.Center = previousCenter;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6c9073f8e2eb4b52b9a11ec60dcfc451
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -7,13 +7,13 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.PostProcessing;
|
||||
using UnityEngine.Rendering;
|
||||
using float3 = Unity.Mathematics.float3;
|
||||
|
||||
public sealed class AetheriaUnityCurrentEntityBinder
|
||||
{
|
||||
public ZoneRenderer ZoneRenderer { get; set; }
|
||||
public PostProcessVolume DeathPost { get; set; }
|
||||
public Volume DeathPost { get; set; }
|
||||
public CanvasGroup GameplayUI { get; set; }
|
||||
public AetheriaUnityCurrentEntityPresentation CurrentEntityPresentation { get; set; }
|
||||
public AetheriaUnityTargetPresentation TargetPresentation { get; set; }
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ public sealed class AetheriaUnityDaemonRenderDocuments : IDisposable
|
|||
if (state == null)
|
||||
throw new ArgumentNullException(nameof(state));
|
||||
|
||||
_frame = state.ReactiveDaemonFrame();
|
||||
_soaView = state.ReactiveDaemonSoaView();
|
||||
_zoneRender = state.ReactiveZoneRender();
|
||||
_frame = state.DaemonFrame.Reactive();
|
||||
_soaView = state.DaemonSoaView.Reactive();
|
||||
_zoneRender = state.ZoneRender.Reactive();
|
||||
}
|
||||
|
||||
public AetheriaRuntimeDaemonRenderView Current =>
|
||||
|
|
|
|||
23
Assets/Scripts/Gameplay/AetheriaUnityEveRuntimeHooks.cs
Normal file
23
Assets/Scripts/Gameplay/AetheriaUnityEveRuntimeHooks.cs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
using GameCult.Aetheria.EveRuntime;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using UnityEngine;
|
||||
|
||||
public static class AetheriaUnityEveRuntimeHooks
|
||||
{
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||
private static void Install()
|
||||
{
|
||||
AetheriaEveRuntimeUnityHooks.ResolveStateBoot =
|
||||
overridePath => AetheriaRuntimeStateBoot.Inspect(
|
||||
AetheriaUnityRuntimePaths.GameDataDirectory,
|
||||
overridePath ?? "");
|
||||
AetheriaEveRuntimeUnityHooks.RuntimeState =
|
||||
(stateBoot, runtimeId) => AetheriaUnityRuntimeClientProvider.RuntimeState(stateBoot, runtimeId);
|
||||
AetheriaEveRuntimeUnityHooks.Control =
|
||||
(stateBoot, runtimeId) => AetheriaUnityRuntimeClientProvider.Control(stateBoot, runtimeId);
|
||||
AetheriaEveRuntimeUnityHooks.Ui =
|
||||
(stateBoot, runtimeId) => AetheriaUnityRuntimeClientProvider.Ui(stateBoot, runtimeId);
|
||||
AetheriaEveRuntimeUnityHooks.StateRefResolver =
|
||||
(stateBoot, runtimeId) => AetheriaUnityRuntimeClientProvider.EveSurfaceStateRefResolver(stateBoot, runtimeId);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Gameplay/AetheriaUnityEveRuntimeHooks.cs.meta
Normal file
11
Assets/Scripts/Gameplay/AetheriaUnityEveRuntimeHooks.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 72069f7b0885490fb690dc771e422aac
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
using System;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Mesh;
|
||||
|
||||
public sealed class AetheriaUnityGameplayBootShell
|
||||
{
|
||||
|
|
@ -34,10 +35,11 @@ public sealed class AetheriaUnityGameplayBootShell
|
|||
$"Aetheria runtime state file is missing at {stateBoot.StateFilePath}; gameplay requires an authoritative daemon mirror.");
|
||||
}
|
||||
|
||||
var runtimeCatalog = AetheriaUnityRuntimeClientProvider.CurrentCatalog(stateBoot, stateBoot.RuntimeId);
|
||||
var runtimeState = AetheriaUnityRuntimeClientProvider.RuntimeState(stateBoot, stateBoot.RuntimeId);
|
||||
var runtimeCatalog = runtimeState.Catalog.Latest();
|
||||
if (runtimeCatalog == null)
|
||||
throw new InvalidOperationException("Aetheria typed runtime catalog is required before gameplay boot.");
|
||||
var sectorMap = AetheriaUnityRuntimeClientProvider.CurrentSectorMap(stateBoot, stateBoot.RuntimeId);
|
||||
var sectorMap = runtimeState.SectorMap.Latest();
|
||||
if (sectorMap == null)
|
||||
throw new InvalidOperationException("Aetheria typed sector map is required before gameplay boot.");
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@
|
|||
using System;
|
||||
using Cinemachine;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Mesh;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.PostProcessing;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public sealed class AetheriaUnityGameplaySceneWiring
|
||||
|
|
@ -34,6 +34,17 @@ public sealed class AetheriaUnityGameplaySceneWiring
|
|||
public Sprite NoShieldIcon { get; set; }
|
||||
public Prototype HostileTargetIndicator { get; set; }
|
||||
public Prototype FriendlyTargetIndicator { get; set; }
|
||||
|
||||
private AetheriaClientState _targetPresentationState;
|
||||
|
||||
private AetheriaClientState TargetPresentationState
|
||||
{
|
||||
get
|
||||
{
|
||||
_targetPresentationState ??= AetheriaUnityRuntimeClientProvider.RuntimeState("unity-target-presentation");
|
||||
return _targetPresentationState;
|
||||
}
|
||||
}
|
||||
public PlaceUIElementWorldspace ViewDot { get; set; }
|
||||
public PlaceUIElementWorldspace TargetIndicator { get; set; }
|
||||
public Image TargetHitpointsFill { get; set; }
|
||||
|
|
@ -78,7 +89,7 @@ public sealed class AetheriaUnityGameplaySceneWiring
|
|||
public void ConfigureTargetPresentation(
|
||||
AetheriaUnityTargetPresentation presentation,
|
||||
AetheriaRuntimeCatalogSnapshot runtimeCatalog,
|
||||
AetheriaUnityObservedEntityIndex observedEntityIndex)
|
||||
AetheriaUnityPresentationEntityIndex presentationEntityIndex)
|
||||
{
|
||||
if (presentation == null)
|
||||
return;
|
||||
|
|
@ -94,18 +105,18 @@ public sealed class AetheriaUnityGameplaySceneWiring
|
|||
presentation.VisibilityToTargetFill = VisibilityToTargetFill;
|
||||
presentation.TargetShieldsFill = TargetShieldsFill;
|
||||
presentation.ResolveEntity = daemonEntityIndex =>
|
||||
observedEntityIndex != null &&
|
||||
observedEntityIndex.TryResolveEntityByDaemonIndex(daemonEntityIndex, out var entity)
|
||||
presentationEntityIndex != null &&
|
||||
presentationEntityIndex.TryGetPresentationEntityByDaemonIndex(daemonEntityIndex, out var entity)
|
||||
? entity
|
||||
: null;
|
||||
presentation.ResolveZoneContacts = ReadZoneContacts;
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeZoneContactsDocument ReadZoneContacts()
|
||||
private AetheriaRuntimeZoneContactsDocument ReadZoneContacts()
|
||||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.CurrentZoneContacts("unity-target-presentation");
|
||||
return TargetPresentationState.ZoneContacts.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -143,12 +154,12 @@ public sealed class AetheriaUnityGameplaySceneWiring
|
|||
MainMenu?.SetRuntimeInputScreenShell(menuShell.CanOpenRuntimeInputScreen, menuShell.ShowRuntimeInputScreen);
|
||||
}
|
||||
|
||||
public void ConfigureObservedEntityIndex(AetheriaUnityObservedEntityIndex observedEntityIndex)
|
||||
public void ConfigurePresentationEntityIndex(AetheriaUnityPresentationEntityIndex presentationEntityIndex)
|
||||
{
|
||||
Inventory?.SetObservedEntityIndex(observedEntityIndex);
|
||||
ShipPanel?.SetObservedEntityIndex(observedEntityIndex);
|
||||
TargetShipPanel?.SetObservedEntityIndex(observedEntityIndex);
|
||||
Inventory?.SetPresentationEntityIndex(presentationEntityIndex);
|
||||
ShipPanel?.SetPresentationEntityIndex(presentationEntityIndex);
|
||||
TargetShipPanel?.SetPresentationEntityIndex(presentationEntityIndex);
|
||||
foreach (var localMenu in UnityEngine.Object.FindObjectsByType<LocalMenu>(FindObjectsSortMode.None))
|
||||
localMenu.SetObservedEntityIndex(observedEntityIndex);
|
||||
localMenu.SetPresentationEntityIndex(presentationEntityIndex);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1561fad48f5f1aa43a9070d788f6eaa7
|
||||
|
|
@ -8,14 +8,14 @@ using GameCult.Aetheria.State.Verse;
|
|||
|
||||
public sealed class AetheriaUnityObservedEntityRestorer
|
||||
{
|
||||
private readonly AetheriaUnityObservedEntityIndex _entityIndex;
|
||||
private readonly AetheriaUnityPresentationEntityIndex _entityIndex;
|
||||
private readonly ItemManager _itemManager;
|
||||
private readonly Func<AetheriaRuntimeEntitySnapshot, bool, EntityConstructionBlueprint> _createBlueprint;
|
||||
private readonly Func<AetheriaRuntimeLoadoutItemSnapshot, ItemInstance> _createLoadoutItem;
|
||||
private readonly Action<string> _logWarning;
|
||||
|
||||
public AetheriaUnityObservedEntityRestorer(
|
||||
AetheriaUnityObservedEntityIndex entityIndex,
|
||||
AetheriaUnityPresentationEntityIndex entityIndex,
|
||||
ItemManager itemManager,
|
||||
Func<AetheriaRuntimeEntitySnapshot, bool, EntityConstructionBlueprint> createBlueprint,
|
||||
Func<AetheriaRuntimeLoadoutItemSnapshot, ItemInstance> createLoadoutItem,
|
||||
|
|
@ -53,7 +53,7 @@ public sealed class AetheriaUnityObservedEntityRestorer
|
|||
}
|
||||
|
||||
ApplyInPlace(entitySnapshots);
|
||||
if (_entityIndex.TryResolveEntityByRecordKey(currentEntityKey, out var resolvedCurrentEntity) &&
|
||||
if (_entityIndex.TryGetPresentationEntityByRecordKey(currentEntityKey, out var resolvedCurrentEntity) &&
|
||||
currentEntity != resolvedCurrentEntity)
|
||||
{
|
||||
reboundCurrentEntity = resolvedCurrentEntity;
|
||||
|
|
@ -107,7 +107,7 @@ public sealed class AetheriaUnityObservedEntityRestorer
|
|||
{
|
||||
foreach (var entitySnapshot in entitySnapshots)
|
||||
{
|
||||
if (!_entityIndex.TryResolveEntityByRecordKey(entitySnapshot.RecordKey, out var entity))
|
||||
if (!_entityIndex.TryGetPresentationEntityByRecordKey(entitySnapshot.RecordKey, out var entity))
|
||||
continue;
|
||||
|
||||
ApplyPoseAndSimpleRuntimeState(entity, entitySnapshot);
|
||||
|
|
@ -115,7 +115,7 @@ public sealed class AetheriaUnityObservedEntityRestorer
|
|||
if (entity.Settings != null)
|
||||
entity.Settings.ShutdownPerformance = (float)entitySnapshot.ShutdownPerformance;
|
||||
entity.RestoreThermalExposure((float)entitySnapshot.Heatstroke, (float)entitySnapshot.Hypothermia);
|
||||
RestoreRuntimeBehaviorState(entity, entitySnapshot, _entityIndex.EntitiesByRecordKey);
|
||||
RestoreRuntimeBehaviorState(entity, entitySnapshot, _entityIndex.PresentationEntitiesByRecordKey);
|
||||
}
|
||||
|
||||
_entityIndex.RefreshDaemonIndex();
|
||||
|
|
@ -123,6 +123,7 @@ public sealed class AetheriaUnityObservedEntityRestorer
|
|||
|
||||
private static void ApplyPoseAndSimpleRuntimeState(Entity entity, AetheriaRuntimeEntitySnapshot entitySnapshot)
|
||||
{
|
||||
entity.DaemonRecordKey = entitySnapshot.RecordKey ?? "";
|
||||
entity.DaemonEntityIndex = entitySnapshot.EntityIndex;
|
||||
entity.Name = entitySnapshot.Name ?? "";
|
||||
entity.CultPosition = new CultMath.float3((float)entitySnapshot.PositionX, (float)entitySnapshot.PositionY, (float)entitySnapshot.PositionZ);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public sealed class AetheriaUnityObservedFrameApplier
|
|||
private readonly Func<int, GalaxyZone> _resolveObservedZone;
|
||||
private readonly Func<Zone> _getZone;
|
||||
private readonly Action<Zone> _setZone;
|
||||
private readonly AetheriaUnityObservedEntityIndex _entityIndex;
|
||||
private readonly AetheriaUnityPresentationEntityIndex _entityIndex;
|
||||
private readonly AetheriaUnityObservedEntityRestorer _entityRestorer;
|
||||
private readonly AetheriaUnityObservedZoneContextFactory _zoneContextFactory;
|
||||
private readonly Func<ZoneRenderer> _resolveZoneRenderer;
|
||||
|
|
@ -31,7 +31,7 @@ public sealed class AetheriaUnityObservedFrameApplier
|
|||
Func<int, GalaxyZone> resolveObservedZone,
|
||||
Func<Zone> getZone,
|
||||
Action<Zone> setZone,
|
||||
AetheriaUnityObservedEntityIndex entityIndex,
|
||||
AetheriaUnityPresentationEntityIndex entityIndex,
|
||||
AetheriaUnityObservedEntityRestorer entityRestorer,
|
||||
AetheriaUnityObservedZoneContextFactory zoneContextFactory,
|
||||
Func<ZoneRenderer> resolveZoneRenderer,
|
||||
|
|
@ -146,8 +146,8 @@ public sealed class AetheriaUnityObservedFrameApplier
|
|||
}
|
||||
|
||||
_entityRestorer.Replace(entitySnapshots, currentEntityKey, _getZone());
|
||||
zoneRenderer?.LoadDaemonZoneView(_entityIndex.EntitiesByDaemonIndex, render);
|
||||
if (_entityIndex.TryResolveEntityByRecordKey(currentEntityKey, out var currentEntity))
|
||||
zoneRenderer?.LoadDaemonZoneView(_entityIndex.PresentationEntitiesByDaemonIndex, render);
|
||||
if (_entityIndex.TryGetPresentationEntityByRecordKey(currentEntityKey, out var currentEntity))
|
||||
_restoreCurrentEntityBinding(currentEntity);
|
||||
zoneRenderer?.RestoreDroppedPickupsFromZoneRender(render);
|
||||
_lastAppliedZoneRenderFrameId = render.FrameId;
|
||||
|
|
|
|||
|
|
@ -67,6 +67,15 @@ public sealed class AetheriaUnityObservedZoneContextFactory
|
|||
return observedZoneContext;
|
||||
}
|
||||
|
||||
public GalaxyZone ResolveGalaxyZone(int daemonZoneIndex)
|
||||
{
|
||||
if (daemonZoneIndex < 0)
|
||||
return null;
|
||||
|
||||
_observedGalaxy ??= _resolveObservedGalaxy();
|
||||
return _observedGalaxy?.Zones?.FirstOrDefault(zone => zone != null && zone.ZoneIndex == daemonZoneIndex);
|
||||
}
|
||||
|
||||
private static ZoneConstructionBlueprint CreateZoneConstructionBlueprint(AetheriaRuntimeZoneRenderDocument render)
|
||||
{
|
||||
var blueprint = new ZoneConstructionBlueprint
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ using System;
|
|||
using Unity.Mathematics;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.Rendering.PostProcessing;
|
||||
using UnityEngine.Rendering;
|
||||
using static Unity.Mathematics.math;
|
||||
|
||||
public sealed class AetheriaUnityPilotFrameController
|
||||
|
|
@ -23,8 +23,8 @@ public sealed class AetheriaUnityPilotFrameController
|
|||
public AetheriaInput Input { get; set; }
|
||||
public AetheriaUnityTargetPresentation TargetPresentation { get; set; }
|
||||
public AetheriaUnityPilotCommandSender PilotCommands { get; set; }
|
||||
public PostProcessVolume HeatstrokePost { get; set; }
|
||||
public PostProcessVolume SevereHeatstrokePost { get; set; }
|
||||
public Volume HeatstrokePost { get; set; }
|
||||
public Volume SevereHeatstrokePost { get; set; }
|
||||
public float2 Sensitivity { get; set; }
|
||||
|
||||
public void Tick(Entity currentEntity, float deltaTime, float timeSeconds)
|
||||
|
|
|
|||
|
|
@ -9,18 +9,18 @@ using Unity.Mathematics;
|
|||
public sealed class AetheriaUnityPilotOperationController
|
||||
{
|
||||
private readonly Func<AetheriaUnityPilotCommandSender> _resolvePilotCommands;
|
||||
private readonly AetheriaUnityObservedEntityIndex _observedEntityIndex;
|
||||
private readonly AetheriaUnityPresentationEntityIndex _presentationEntityIndex;
|
||||
private readonly Func<float3> _resolveViewDirection;
|
||||
private readonly Func<Entity> _resolveCurrentEntity;
|
||||
|
||||
public AetheriaUnityPilotOperationController(
|
||||
Func<AetheriaUnityPilotCommandSender> resolvePilotCommands,
|
||||
AetheriaUnityObservedEntityIndex observedEntityIndex,
|
||||
AetheriaUnityPresentationEntityIndex presentationEntityIndex,
|
||||
Func<float3> resolveViewDirection,
|
||||
Func<Entity> resolveCurrentEntity)
|
||||
{
|
||||
_resolvePilotCommands = resolvePilotCommands ?? throw new ArgumentNullException(nameof(resolvePilotCommands));
|
||||
_observedEntityIndex = observedEntityIndex ?? throw new ArgumentNullException(nameof(observedEntityIndex));
|
||||
_presentationEntityIndex = presentationEntityIndex ?? throw new ArgumentNullException(nameof(presentationEntityIndex));
|
||||
_resolveViewDirection = resolveViewDirection ?? (() => default);
|
||||
_resolveCurrentEntity = resolveCurrentEntity ?? (() => null);
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ public sealed class AetheriaUnityPilotOperationController
|
|||
return;
|
||||
}
|
||||
|
||||
if (!_observedEntityIndex.TryResolveEntityRecordKey(target, out var targetEntityKey) ||
|
||||
if (!_presentationEntityIndex.TryGetRecordKeyForPresentationEntity(target, out var targetEntityKey) ||
|
||||
string.IsNullOrWhiteSpace(targetEntityKey))
|
||||
{
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public sealed class AetheriaUnityObservedEntityIndex
|
||||
public sealed class AetheriaUnityPresentationEntityIndex
|
||||
{
|
||||
private readonly Dictionary<string, Entity> _entitiesByRecordKey = new Dictionary<string, Entity>(StringComparer.Ordinal);
|
||||
private readonly Dictionary<int, Entity> _entitiesByDaemonIndex = new Dictionary<int, Entity>();
|
||||
|
||||
public IReadOnlyDictionary<string, Entity> EntitiesByRecordKey => _entitiesByRecordKey;
|
||||
public IReadOnlyDictionary<string, Entity> PresentationEntitiesByRecordKey => _entitiesByRecordKey;
|
||||
|
||||
public IReadOnlyDictionary<int, Entity> EntitiesByDaemonIndex => _entitiesByDaemonIndex;
|
||||
public IReadOnlyDictionary<int, Entity> PresentationEntitiesByDaemonIndex => _entitiesByDaemonIndex;
|
||||
|
||||
public int Count => _entitiesByRecordKey.Count;
|
||||
|
||||
|
|
@ -26,7 +26,10 @@ public sealed class AetheriaUnityObservedEntityIndex
|
|||
foreach (var pair in entitiesByRecordKey)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(pair.Key) && pair.Value != null)
|
||||
{
|
||||
pair.Value.DaemonRecordKey = pair.Key;
|
||||
_entitiesByRecordKey[pair.Key] = pair.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -38,12 +41,20 @@ public sealed class AetheriaUnityObservedEntityIndex
|
|||
RebuildDaemonIndex();
|
||||
}
|
||||
|
||||
public bool TryResolveEntityRecordKey(Entity entity, out string recordKey)
|
||||
public bool TryGetRecordKeyForPresentationEntity(Entity entity, out string recordKey)
|
||||
{
|
||||
recordKey = "";
|
||||
if (entity == null)
|
||||
return false;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(entity.DaemonRecordKey) &&
|
||||
_entitiesByRecordKey.TryGetValue(entity.DaemonRecordKey, out var indexedEntity) &&
|
||||
ReferenceEquals(indexedEntity, entity))
|
||||
{
|
||||
recordKey = entity.DaemonRecordKey;
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach (var pair in _entitiesByRecordKey)
|
||||
{
|
||||
if (ReferenceEquals(pair.Value, entity))
|
||||
|
|
@ -56,26 +67,26 @@ public sealed class AetheriaUnityObservedEntityIndex
|
|||
return false;
|
||||
}
|
||||
|
||||
public bool TryResolveEntityByRecordKey(string recordKey, out Entity entity)
|
||||
public bool TryGetPresentationEntityByRecordKey(string recordKey, out Entity entity)
|
||||
{
|
||||
entity = null;
|
||||
return !string.IsNullOrWhiteSpace(recordKey) &&
|
||||
_entitiesByRecordKey.TryGetValue(recordKey, out entity);
|
||||
}
|
||||
|
||||
public bool TryResolveEntityByDaemonIndex(int daemonEntityIndex, out Entity entity)
|
||||
public bool TryGetPresentationEntityByDaemonIndex(int daemonEntityIndex, out Entity entity)
|
||||
{
|
||||
return _entitiesByDaemonIndex.TryGetValue(daemonEntityIndex, out entity);
|
||||
}
|
||||
|
||||
public bool TryResolveDockingBayByRecordKey(
|
||||
public bool TryGetPresentationDockingBayByRecordKey(
|
||||
string parentRecordKey,
|
||||
int dockingBayIndex,
|
||||
out EquippedDockingBay dockingBay)
|
||||
{
|
||||
dockingBay = null;
|
||||
if (dockingBayIndex < 0 ||
|
||||
!TryResolveEntityByRecordKey(parentRecordKey, out var parent) ||
|
||||
!TryGetPresentationEntityByRecordKey(parentRecordKey, out var parent) ||
|
||||
parent?.DockingBays == null ||
|
||||
dockingBayIndex >= parent.DockingBays.Count)
|
||||
{
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1561fad48f5f1aa43a9070d788f6eaa7
|
||||
|
|
@ -27,6 +27,8 @@ public sealed class AetheriaUnityRenderSplatViewportSource : MonoBehaviour
|
|||
|
||||
private float _nextRefreshTime;
|
||||
private AetheriaUnityRtsViewportDocuments _viewportDocuments;
|
||||
private AetheriaRuntimeRenderSplatsViewportDocument _fallbackRenderSplatsViewport;
|
||||
private string _lastWarningMessage = "";
|
||||
|
||||
public RenderTexture TargetTexture
|
||||
{
|
||||
|
|
@ -39,6 +41,15 @@ public sealed class AetheriaUnityRenderSplatViewportSource : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
public AetheriaRuntimeRenderSplatsViewportDocument CurrentDocument =>
|
||||
_viewportDocuments?.CurrentRenderSplatsViewport ?? _fallbackRenderSplatsViewport;
|
||||
|
||||
public bool RenderInLateUpdate
|
||||
{
|
||||
get => renderInLateUpdate;
|
||||
set => renderInLateUpdate = value;
|
||||
}
|
||||
|
||||
private void Reset()
|
||||
{
|
||||
rasterizer = GetComponent<AetheriaRenderSplatRasterizer>();
|
||||
|
|
@ -63,7 +74,7 @@ public sealed class AetheriaUnityRenderSplatViewportSource : MonoBehaviour
|
|||
return false;
|
||||
|
||||
RefreshDocument(false);
|
||||
var document = _viewportDocuments?.CurrentRenderSplatsViewport;
|
||||
var document = _viewportDocuments?.CurrentRenderSplatsViewport ?? _fallbackRenderSplatsViewport;
|
||||
if (document == null)
|
||||
return false;
|
||||
|
||||
|
|
@ -118,13 +129,36 @@ public sealed class AetheriaUnityRenderSplatViewportSource : MonoBehaviour
|
|||
.RenderSplatViewportDocuments(viewport, "unity-render-splat-viewport");
|
||||
ClearViewportDocument();
|
||||
_viewportDocuments = nextDocuments;
|
||||
_fallbackRenderSplatsViewport = null;
|
||||
_lastWarningMessage = "";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogWarning($"Failed to read Aetheria render splats from local Verse state: {ex.Message}");
|
||||
ClearViewportDocument();
|
||||
_fallbackRenderSplatsViewport = EmptyRenderSplatsViewport(viewport);
|
||||
WarnOnce($"Failed to read Aetheria render splats from local Verse state: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void WarnOnce(string message)
|
||||
{
|
||||
if (string.Equals(_lastWarningMessage, message, StringComparison.Ordinal))
|
||||
return;
|
||||
|
||||
_lastWarningMessage = message;
|
||||
Debug.LogWarning(message);
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeRenderSplatsViewportDocument EmptyRenderSplatsViewport(
|
||||
AetheriaRuntimeRtsViewportBounds viewport)
|
||||
{
|
||||
return new AetheriaRuntimeRenderSplatsViewportDocument
|
||||
{
|
||||
PublishedAtUtc = DateTimeOffset.UtcNow.ToString("O"),
|
||||
Viewport = viewport ?? new AetheriaRuntimeRtsViewportBounds()
|
||||
};
|
||||
}
|
||||
|
||||
private AetheriaRuntimeRtsViewportBounds ResolveViewportBounds()
|
||||
{
|
||||
var halfSize = size * 0.5f;
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ public sealed class AetheriaUnityRtsViewportDocuments : IDisposable
|
|||
throw new ArgumentNullException(nameof(viewport));
|
||||
|
||||
Viewport = viewport;
|
||||
_contacts = bindContacts ? state.ReactiveZoneContacts() : null;
|
||||
_objectsViewport = bindObjects ? state.ReactiveObjectsViewport(viewport) : null;
|
||||
_renderSplatsViewport = bindRenderSplats ? state.ReactiveRenderSplatsViewport(viewport) : null;
|
||||
_contacts = bindContacts ? state.ZoneContacts.Reactive() : null;
|
||||
_objectsViewport = bindObjects ? state.ObjectsViewport(viewport).Reactive() : null;
|
||||
_renderSplatsViewport = bindRenderSplats ? state.RenderSplatsViewport(viewport).Reactive() : null;
|
||||
}
|
||||
|
||||
public AetheriaRuntimeRtsViewportBounds Viewport { get; }
|
||||
|
|
|
|||
|
|
@ -77,104 +77,6 @@ public static class AetheriaUnityRuntimeClientProvider
|
|||
return RuntimeClient(stateBoot, runtimeId).State;
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeCurrentDockingDocument CurrentDockingState(string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).CurrentDockingState();
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeCurrentDockingDocument CurrentDockingState(
|
||||
AetheriaRuntimeStateBootReport stateBoot,
|
||||
string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(stateBoot, runtimeId).CurrentDockingState();
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeCatalogSnapshot CurrentCatalog(string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).CurrentCatalog();
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeCatalogSnapshot CurrentCatalog(
|
||||
AetheriaRuntimeStateBootReport stateBoot,
|
||||
string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(stateBoot, runtimeId).CurrentCatalog();
|
||||
}
|
||||
|
||||
public static AetheriaRuntimePlayerSettingsDocument CurrentPlayerSettings(string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).CurrentPlayerSettings();
|
||||
}
|
||||
|
||||
public static AetheriaRuntimePlayerSettingsDocument CurrentPlayerSettings(
|
||||
AetheriaRuntimeStateBootReport stateBoot,
|
||||
string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(stateBoot, runtimeId).CurrentPlayerSettings();
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeCurrentEntityDocument CurrentEntityState(string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).CurrentEntityState();
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeCurrentZoneDocument CurrentZoneState(string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).CurrentZoneState();
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeZoneContactsDocument CurrentZoneContacts(string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).CurrentZoneContacts();
|
||||
}
|
||||
|
||||
public static CultMeshReactiveDocument<AetheriaRuntimeZoneContactsDocument> ReactiveZoneContacts(
|
||||
string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).ReactiveZoneContacts();
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeStationRefitDocument CurrentStationRefit(string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).CurrentStationRefit();
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeSectorMapDocument CurrentSectorMap(string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).CurrentSectorMap();
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeSectorMapDocument CurrentSectorMap(
|
||||
AetheriaRuntimeStateBootReport stateBoot,
|
||||
string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(stateBoot, runtimeId).CurrentSectorMap();
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeZoneDetailsDocument CurrentZoneDetails(int zoneIndex, string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).CurrentZoneDetails(zoneIndex);
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeInventoryDocument CurrentInventory(int entityIndex, string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).CurrentInventory(entityIndex);
|
||||
}
|
||||
|
||||
public static CultMeshReactiveDocument<AetheriaRuntimeObjectsViewportDocument> ReactiveObjectsViewport(
|
||||
AetheriaRuntimeRtsViewportBounds viewport,
|
||||
string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).ReactiveObjectsViewport(viewport);
|
||||
}
|
||||
|
||||
public static CultMeshReactiveDocument<AetheriaRuntimeRenderSplatsViewportDocument> ReactiveRenderSplatsViewport(
|
||||
AetheriaRuntimeRtsViewportBounds viewport,
|
||||
string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).ReactiveRenderSplatsViewport(viewport);
|
||||
}
|
||||
|
||||
public static AetheriaUnityRtsViewportDocuments MapViewportDocuments(
|
||||
AetheriaRuntimeRtsViewportBounds viewport,
|
||||
string runtimeId = "")
|
||||
|
|
@ -196,18 +98,6 @@ public static class AetheriaUnityRuntimeClientProvider
|
|||
return AetheriaUnityRtsViewportDocuments.OpenRenderSplats(RuntimeState(runtimeId), viewport);
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeDaemonFrameDocument CurrentDaemonFrame(string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).CurrentDaemonFrame();
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeDaemonFrameDocument CurrentDaemonFrame(
|
||||
AetheriaRuntimeStateBootReport stateBoot,
|
||||
string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(stateBoot, runtimeId).CurrentDaemonFrame();
|
||||
}
|
||||
|
||||
public static AetheriaUnityDaemonRenderDocuments DaemonRenderDocuments(
|
||||
AetheriaRuntimeStateBootReport stateBoot,
|
||||
string runtimeId = "")
|
||||
|
|
@ -215,13 +105,6 @@ public static class AetheriaUnityRuntimeClientProvider
|
|||
return AetheriaUnityDaemonRenderDocuments.Open(RuntimeState(stateBoot, runtimeId));
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeVerseHostSettingsDocument CurrentVerseHostSettings(
|
||||
AetheriaRuntimeStateBootReport stateBoot,
|
||||
string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(stateBoot, runtimeId).CurrentVerseHostSettings();
|
||||
}
|
||||
|
||||
public static AetheriaControl Control(string runtimeId = "")
|
||||
{
|
||||
return RuntimeClient(runtimeId).Control;
|
||||
|
|
@ -277,7 +160,7 @@ public static class AetheriaUnityRuntimeClientProvider
|
|||
{
|
||||
try
|
||||
{
|
||||
var stored = CurrentPlayerSettings();
|
||||
var stored = RuntimeState().PlayerSettings.Latest();
|
||||
if (stored == null)
|
||||
return;
|
||||
|
||||
|
|
|
|||
8
Assets/Scripts/Rendering.meta
Normal file
8
Assets/Scripts/Rendering.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b3c453d425710cb47bfcde9c9acf3b15
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
59
Assets/Scripts/Rendering/AetheriaStardustRendererFeature.cs
Normal file
59
Assets/Scripts/Rendering/AetheriaStardustRendererFeature.cs
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.RenderGraphModule;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
public sealed class AetheriaStardustRendererFeature : ScriptableRendererFeature
|
||||
{
|
||||
private StardustPass _pass;
|
||||
|
||||
public override void Create()
|
||||
{
|
||||
_pass = new StardustPass
|
||||
{
|
||||
renderPassEvent = RenderPassEvent.BeforeRenderingPostProcessing
|
||||
};
|
||||
}
|
||||
|
||||
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
|
||||
{
|
||||
if (_pass == null)
|
||||
Create();
|
||||
|
||||
renderer.EnqueuePass(_pass);
|
||||
}
|
||||
|
||||
private sealed class StardustPass : ScriptableRenderPass
|
||||
{
|
||||
private sealed class PassData
|
||||
{
|
||||
internal Camera Camera;
|
||||
internal TextureHandle ColorTarget;
|
||||
internal TextureHandle DepthTarget;
|
||||
}
|
||||
|
||||
public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer frameData)
|
||||
{
|
||||
var cameraData = frameData.Get<UniversalCameraData>();
|
||||
var resourceData = frameData.Get<UniversalResourceData>();
|
||||
var colorTarget = resourceData.activeColorTexture;
|
||||
if (!colorTarget.IsValid())
|
||||
return;
|
||||
|
||||
using var builder = renderGraph.AddUnsafePass<PassData>("Aetheria Stardust", out var passData);
|
||||
passData.Camera = cameraData.camera;
|
||||
passData.ColorTarget = colorTarget;
|
||||
passData.DepthTarget = resourceData.activeDepthTexture;
|
||||
|
||||
builder.UseTexture(passData.ColorTarget, AccessFlags.ReadWrite);
|
||||
if (passData.DepthTarget.IsValid())
|
||||
builder.UseTexture(passData.DepthTarget, AccessFlags.Read);
|
||||
|
||||
builder.AllowPassCulling(false);
|
||||
builder.SetRenderFunc(static (PassData data, UnsafeGraphContext context) =>
|
||||
{
|
||||
Stardust.RenderForCamera(context.cmd, data.Camera, data.ColorTarget, data.DepthTarget);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8ed96b0a823f44f9afc6c62a94ddc98d
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.RenderGraphModule;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
public sealed class AetheriaVolumeCloudRendererFeature : ScriptableRendererFeature
|
||||
{
|
||||
private VolumeCloudPass _pass;
|
||||
|
||||
public override void Create()
|
||||
{
|
||||
_pass = new VolumeCloudPass
|
||||
{
|
||||
renderPassEvent = RenderPassEvent.BeforeRenderingPostProcessing
|
||||
};
|
||||
_pass.ConfigureInput(ScriptableRenderPassInput.Depth);
|
||||
}
|
||||
|
||||
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
|
||||
{
|
||||
if (_pass == null)
|
||||
Create();
|
||||
|
||||
renderer.EnqueuePass(_pass);
|
||||
}
|
||||
|
||||
private sealed class VolumeCloudPass : ScriptableRenderPass
|
||||
{
|
||||
private sealed class PassData
|
||||
{
|
||||
internal Camera Camera;
|
||||
internal VolumeCloudRenderer Renderer;
|
||||
internal TextureHandle ColorTarget;
|
||||
internal TextureHandle DepthTarget;
|
||||
}
|
||||
|
||||
public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer frameData)
|
||||
{
|
||||
var cameraData = frameData.Get<UniversalCameraData>();
|
||||
if (!VolumeCloudRenderer.TryGetRenderer(cameraData.camera, out var renderer))
|
||||
return;
|
||||
|
||||
var resourceData = frameData.Get<UniversalResourceData>();
|
||||
var colorTarget = resourceData.activeColorTexture;
|
||||
if (!colorTarget.IsValid())
|
||||
return;
|
||||
|
||||
using var builder = renderGraph.AddUnsafePass<PassData>("Aetheria Volume Clouds", out var passData);
|
||||
passData.Camera = cameraData.camera;
|
||||
passData.Renderer = renderer;
|
||||
passData.ColorTarget = colorTarget;
|
||||
passData.DepthTarget = resourceData.activeDepthTexture;
|
||||
|
||||
builder.UseTexture(passData.ColorTarget, AccessFlags.ReadWrite);
|
||||
if (passData.DepthTarget.IsValid())
|
||||
builder.UseTexture(passData.DepthTarget, AccessFlags.Read);
|
||||
|
||||
builder.AllowPassCulling(false);
|
||||
builder.SetRenderFunc(static (PassData data, UnsafeGraphContext context) =>
|
||||
{
|
||||
data.Renderer.RenderClouds(context.cmd, data.Camera, data.ColorTarget, data.DepthTarget);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3a9355da1f1b4fd489be0de05ebd165b
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.RenderGraphModule;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
public sealed class AetheriaVolumeSamplingRendererFeature : ScriptableRendererFeature
|
||||
{
|
||||
private VolumeSamplingPass _pass;
|
||||
|
||||
public override void Create()
|
||||
{
|
||||
_pass = new VolumeSamplingPass
|
||||
{
|
||||
renderPassEvent = RenderPassEvent.BeforeRendering
|
||||
};
|
||||
}
|
||||
|
||||
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
|
||||
{
|
||||
if (_pass == null)
|
||||
Create();
|
||||
|
||||
renderer.EnqueuePass(_pass);
|
||||
}
|
||||
|
||||
private sealed class VolumeSamplingPass : ScriptableRenderPass
|
||||
{
|
||||
private sealed class PassData
|
||||
{
|
||||
internal UnityEngine.Camera Camera;
|
||||
}
|
||||
|
||||
public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer frameData)
|
||||
{
|
||||
using var builder = renderGraph.AddUnsafePass<PassData>("Aetheria Volume Sampling", out var passData);
|
||||
var cameraData = frameData.Get<UniversalCameraData>();
|
||||
passData.Camera = cameraData.camera;
|
||||
builder.AllowPassCulling(false);
|
||||
builder.SetRenderFunc(static (PassData data, UnsafeGraphContext context) =>
|
||||
{
|
||||
VolumeSampling.RenderForCamera(data.Camera);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 24eee20c9f0bf4148804bc31f1be1482
|
||||
|
|
@ -43,6 +43,7 @@ public abstract class Entity
|
|||
public Faction Faction;
|
||||
public EquippableItem Hull;
|
||||
public EquippedItem EquippedHull;
|
||||
public string DaemonRecordKey = "";
|
||||
public int DaemonEntityIndex = -1;
|
||||
|
||||
public float3 Position;
|
||||
|
|
|
|||
|
|
@ -188,11 +188,11 @@ public class DaemonRuntimeDocumentTests
|
|||
MaxX = 100,
|
||||
MaxY = 100
|
||||
};
|
||||
var currentCatalog = client.State.CurrentCatalog();
|
||||
var currentPlayerSettings = client.State.CurrentPlayerSettings();
|
||||
var currentFrame = client.State.CurrentDaemonFrame();
|
||||
var currentEntityState = client.State.CurrentEntityState();
|
||||
var currentObjectsViewport = client.State.CurrentObjectsViewport(viewport);
|
||||
var currentCatalog = client.State.Catalog.Latest();
|
||||
var currentPlayerSettings = client.State.PlayerSettings.Latest();
|
||||
var currentFrame = client.State.DaemonFrame.Latest();
|
||||
var currentEntityState = client.State.CurrentEntity.Latest();
|
||||
var currentObjectsViewport = client.State.ObjectsViewport(viewport).Latest();
|
||||
var objectsViewport = ReadLatest(client.State.ObjectsViewport(viewport));
|
||||
var zoneDetails = ReadLatest(client.State.ZoneDetails(0));
|
||||
var inventory = ReadLatest(client.State.Inventory(0));
|
||||
|
|
@ -206,35 +206,35 @@ public class DaemonRuntimeDocumentTests
|
|||
.ReactiveAsync()
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
using var zoneRenderReactive = client.State.ReactiveZoneRender();
|
||||
using var zoneRenderReactive = client.State.ZoneRender.Reactive();
|
||||
var observedAuthoritativeFrame = ReadLatest(client.State.DaemonFrame);
|
||||
using var catalogReactive = client.State.ReactiveCatalogSnapshot();
|
||||
using var daemonFrameReactive = client.State.ReactiveDaemonFrame();
|
||||
using var daemonSoaViewReactive = client.State.ReactiveDaemonSoaView();
|
||||
using var catalogReactive = client.State.Catalog.Reactive();
|
||||
using var daemonFrameReactive = client.State.DaemonFrame.Reactive();
|
||||
using var daemonSoaViewReactive = client.State.DaemonSoaView.Reactive();
|
||||
Assert.IsTrue(AetheriaRuntimeDaemonRenderView.TryCreateCurrent(
|
||||
daemonFrameReactive,
|
||||
daemonSoaViewReactive,
|
||||
zoneRenderReactive,
|
||||
out var observed));
|
||||
using var loadoutTemplatesReactive = client.State.ReactiveLoadoutTemplates();
|
||||
using var sectorMapReactive = client.State.ReactiveSectorMap();
|
||||
using var playerSettingsReactive = client.State.ReactivePlayerSettingsDocument();
|
||||
using var verseHostSettingsReactive = client.State.ReactiveVerseHostSettings();
|
||||
using var zoneContactsReactive = client.State.ReactiveZoneContacts();
|
||||
using var currentZoneReactive = client.State.ReactiveCurrentZone();
|
||||
using var currentEntityDocumentReactive = client.State.ReactiveCurrentEntity();
|
||||
using var currentDockingReactive = client.State.ReactiveCurrentDocking();
|
||||
using var stationRefitReactive = client.State.ReactiveStationRefit();
|
||||
using var zoneDetailsReactive = client.State.ReactiveZoneDetails(0);
|
||||
using var selectedObjectReactive = client.State.ReactiveSelectedObject(0);
|
||||
using var inventoryReactive = client.State.ReactiveInventory(0);
|
||||
using var mapViewportReactive = client.State.ReactiveRtsViewport(viewport);
|
||||
using var objectsViewportReactive = client.State.ReactiveObjectsViewport(viewport);
|
||||
using var gravityViewportReactive = client.State.ReactiveGravityViewport(viewport);
|
||||
using var renderSplatsViewportReactive = client.State.ReactiveRenderSplatsViewport(viewport);
|
||||
using var playerHudCatalog = client.State.ReactiveCatalogSnapshot();
|
||||
using var playerHudSettings = client.State.ReactivePlayerSettingsDocument();
|
||||
using var playerHudEntity = client.State.ReactiveCurrentEntity();
|
||||
using var loadoutTemplatesReactive = client.State.LoadoutTemplates.Reactive();
|
||||
using var sectorMapReactive = client.State.SectorMap.Reactive();
|
||||
using var playerSettingsReactive = client.State.PlayerSettings.Reactive();
|
||||
using var verseHostSettingsReactive = client.State.VerseHostSettings.Reactive();
|
||||
using var zoneContactsReactive = client.State.ZoneContacts.Reactive();
|
||||
using var currentZoneReactive = client.State.CurrentZone.Reactive();
|
||||
using var currentEntityDocumentReactive = client.State.CurrentEntity.Reactive();
|
||||
using var currentDockingReactive = client.State.CurrentDocking.Reactive();
|
||||
using var stationRefitReactive = client.State.StationRefit.Reactive();
|
||||
using var zoneDetailsReactive = client.State.ZoneDetails(0).Reactive();
|
||||
using var selectedObjectReactive = client.State.SelectedObject(0).Reactive();
|
||||
using var inventoryReactive = client.State.Inventory(0).Reactive();
|
||||
using var mapViewportReactive = client.State.RtsViewport(viewport).Reactive();
|
||||
using var objectsViewportReactive = client.State.ObjectsViewport(viewport).Reactive();
|
||||
using var gravityViewportReactive = client.State.GravityViewport(viewport).Reactive();
|
||||
using var renderSplatsViewportReactive = client.State.RenderSplatsViewport(viewport).Reactive();
|
||||
using var playerHudCatalog = client.State.Catalog.Reactive();
|
||||
using var playerHudSettings = client.State.PlayerSettings.Reactive();
|
||||
using var playerHudEntity = client.State.CurrentEntity.Reactive();
|
||||
var gameSurface = ReadLatest(client.State.GameSurface);
|
||||
var gameTuiSurface = ReadLatest(client.State.GameTuiSurface);
|
||||
var editorSurface = ReadLatest(client.State.EditorSurface);
|
||||
|
|
@ -247,7 +247,7 @@ public class DaemonRuntimeDocumentTests
|
|||
var stationRefit = ReadLatest(client.State.StationRefit);
|
||||
Assert.AreEqual(currentEntity.EntityKey, currentEntityDocumentReactive.Current.EntityKey);
|
||||
Assert.AreEqual(currentDocking.CurrentEntityKey, currentDockingReactive.Current.CurrentEntityKey);
|
||||
Assert.AreEqual(stationRefit.StationEntityKey, stationRefitReactive.Current.StationEntityKey);
|
||||
Assert.AreEqual(stationRefit.CurrentEntityKey, stationRefitReactive.Current.CurrentEntityKey);
|
||||
using var reactiveGameSurface = client.State.GameSurface.Reactive();
|
||||
using var reactiveGameTuiSurface = client.State.GameTuiSurface.Reactive();
|
||||
using var reactiveEditorSurface = client.State.EditorSurface.Reactive();
|
||||
|
|
@ -268,7 +268,7 @@ public class DaemonRuntimeDocumentTests
|
|||
Assert.AreEqual(AetheriaRuntimeDaemonEditorSurfaceBuilder.SurfaceId, reactiveEditorSurface.Current.Surface.Id);
|
||||
Assert.AreEqual(AetheriaRuntimeDaemonEditorSurfaceBuilder.TuiSurfaceId, reactiveEditorTuiSurface.Current.Surface.Id);
|
||||
Assert.AreEqual(currentDocking.CurrentEntityKey, currentDockingReactive.Current.CurrentEntityKey);
|
||||
Assert.AreEqual(stationRefit.StationEntityKey, stationRefitReactive.Current.StationEntityKey);
|
||||
Assert.AreEqual(stationRefit.CurrentEntityKey, stationRefitReactive.Current.CurrentEntityKey);
|
||||
Assert.IsNotNull(ReadLatest(client.State.PlayerSettings));
|
||||
Assert.IsNotNull(ReadLatest(client.State.VerseHostSettings));
|
||||
Assert.IsNotNull(ReadLatest(client.State.ZoneContacts));
|
||||
|
|
@ -301,7 +301,7 @@ public class DaemonRuntimeDocumentTests
|
|||
Assert.AreSame(catalog, catalogReactive.Current);
|
||||
Assert.AreEqual(AetheriaRuntimeDaemonSchemas.Frame, daemonFrameReactive.Current.Schema);
|
||||
Assert.AreEqual(AetheriaRuntimeDaemonSchemas.SoaView, daemonSoaViewReactive.Current.Schema);
|
||||
Assert.AreEqual(AetheriaRuntimeLoadoutTemplatesDocument.SchemaId, loadoutTemplatesReactive.Current.Schema);
|
||||
Assert.AreEqual(typeof(AetheriaRuntimeLoadoutTemplatesDocument), client.State.LoadoutTemplates.DocumentType);
|
||||
Assert.AreEqual(AetheriaRuntimeDaemonSchemas.SectorMap, sectorMapReactive.Current.Schema);
|
||||
Assert.AreEqual(AetheriaRuntimePlayerSettingsDocument.SchemaId, playerSettingsReactive.Current.Schema);
|
||||
Assert.AreEqual(AetheriaRuntimeVerseHostSettingsDocument.SchemaId, verseHostSettings.Schema);
|
||||
|
|
@ -395,19 +395,19 @@ public class DaemonRuntimeDocumentTests
|
|||
.GetResult();
|
||||
|
||||
var aetheria = verse.Aetheria();
|
||||
var currentEntity = ReadLatest(aetheria.Document<AetheriaRuntimeCurrentEntityDocument>());
|
||||
var currentEntity = ReadLatest(aetheria.CurrentEntity);
|
||||
var latestFrameDocument = verse.Document<AetheriaRuntimeDaemonFrameDocument>(
|
||||
AetheriaRuntimeVerseRecordKeys.DaemonFrameLatest);
|
||||
using var latestFrameReactive = latestFrameDocument.Reactive();
|
||||
|
||||
Assert.AreEqual("aetheria.current.entity", aetheria.Current.Entity.DocumentId);
|
||||
Assert.AreEqual("aetheria.current.entity", aetheria.CurrentEntity.DocumentId);
|
||||
Assert.AreEqual("zone.0.entity.0", currentEntity.EntityKey);
|
||||
Assert.AreEqual("Player", currentEntity.Entity?.DisplayName);
|
||||
Assert.AreEqual(AetheriaRuntimeVerseRecordKeys.DaemonFrameLatest.ToString(), latestFrameDocument.DocumentId);
|
||||
Assert.AreEqual(AetheriaRuntimeDaemonSchemas.Frame, latestFrameReactive.Current.Schema);
|
||||
Assert.AreEqual(8, latestFrameReactive.Current.FrameId);
|
||||
Assert.IsTrue(latestFrameDocument.CanSet);
|
||||
Assert.IsTrue(aetheria.Current.Entity.Sources.Any(source =>
|
||||
Assert.IsTrue(aetheria.CurrentEntity.Sources.Any(source =>
|
||||
source.SourceId == AetheriaRuntimeVerseRecordKeys.DaemonFrameLatest.ToString()));
|
||||
}
|
||||
|
||||
|
|
@ -599,16 +599,16 @@ public class DaemonRuntimeDocumentTests
|
|||
var unityEditorSurfaceState = ReadLatest(client.State.EditorSurface);
|
||||
var unityEditorTuiSurfaceState = ReadLatest(client.State.EditorTuiSurface);
|
||||
var surfaceResolver = client.State.CreateEveSurfaceCultMeshStateRefResolver();
|
||||
var unityGameSurface = AetheriaRuntimeEveSurfaceAdapter.ToEveSurfaceDocument(
|
||||
var unityGameSurface = AetheriaRuntimeSurfaceDocuments.ToEveSurfaceDocument(
|
||||
unityGameSurfaceState,
|
||||
surfaceResolver);
|
||||
var unityGameTuiSurface = AetheriaRuntimeEveSurfaceAdapter.ToEveSurfaceDocument(
|
||||
var unityGameTuiSurface = AetheriaRuntimeSurfaceDocuments.ToEveSurfaceDocument(
|
||||
unityGameTuiSurfaceState,
|
||||
surfaceResolver);
|
||||
var unityEditorSurface = AetheriaRuntimeEveSurfaceAdapter.ToEveSurfaceDocument(
|
||||
var unityEditorSurface = AetheriaRuntimeSurfaceDocuments.ToEveSurfaceDocument(
|
||||
unityEditorSurfaceState,
|
||||
surfaceResolver);
|
||||
var unityEditorTuiSurface = AetheriaRuntimeEveSurfaceAdapter.ToEveSurfaceDocument(
|
||||
var unityEditorTuiSurface = AetheriaRuntimeSurfaceDocuments.ToEveSurfaceDocument(
|
||||
unityEditorTuiSurfaceState,
|
||||
surfaceResolver);
|
||||
|
||||
|
|
@ -628,7 +628,7 @@ public class DaemonRuntimeDocumentTests
|
|||
command.Command == "aetheria.daemon.commands.TransferCargoItem"));
|
||||
Assert.AreEqual(AetheriaRuntimeDaemonEditorSurfaceBuilder.TuiSurfaceId, unityEditorTuiSurface.Surface.Id);
|
||||
Assert.AreEqual("editor.daemon", unityEditorTuiSurface.ProviderKind);
|
||||
var genericGameSurface = AetheriaRuntimeEveSurfaceAdapter.ToEveSurfaceDocument(
|
||||
var genericGameSurface = AetheriaRuntimeSurfaceDocuments.ToEveSurfaceDocument(
|
||||
ReadLatest(client.State.GameSurface),
|
||||
surfaceResolver);
|
||||
Assert.AreEqual(AetheriaRuntimeDaemonGameSurfaceBuilder.SurfaceId, genericGameSurface.Surface.Id);
|
||||
|
|
@ -651,18 +651,18 @@ public class DaemonRuntimeDocumentTests
|
|||
"value",
|
||||
AetheriaRuntimeDaemonStateRefs.CurrentTargetName,
|
||||
AetheriaRuntimeDaemonSchemas.Frame));
|
||||
var genericGameTuiSurface = AetheriaRuntimeEveSurfaceAdapter.ToEveSurfaceDocument(
|
||||
var genericGameTuiSurface = AetheriaRuntimeSurfaceDocuments.ToEveSurfaceDocument(
|
||||
ReadLatest(client.State.GameTuiSurface),
|
||||
surfaceResolver);
|
||||
Assert.AreEqual(AetheriaRuntimeDaemonGameSurfaceBuilder.TuiSurfaceId, genericGameTuiSurface.Surface.Id);
|
||||
var genericEditorTuiSurface = AetheriaRuntimeEveSurfaceAdapter.ToEveSurfaceDocument(
|
||||
var genericEditorTuiSurface = AetheriaRuntimeSurfaceDocuments.ToEveSurfaceDocument(
|
||||
ReadLatest(client.State.EditorTuiSurface),
|
||||
surfaceResolver);
|
||||
Assert.AreEqual(AetheriaRuntimeDaemonEditorSurfaceBuilder.TuiSurfaceId, genericEditorTuiSurface.Surface.Id);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void EveSurfaceAdapterResolvesDaemonStateRefsBeforeLowering()
|
||||
public void RuntimeSurfaceDocumentsResolveDaemonStateRefsBeforeLowering()
|
||||
{
|
||||
var surface = new EveSurfaceDocument(
|
||||
"surface-state",
|
||||
|
|
@ -690,7 +690,7 @@ public class DaemonRuntimeDocumentTests
|
|||
var resolver = CultMesh.StateRefResolver(
|
||||
"aetheria.tests.refs",
|
||||
(stateRef, _context) => stateRef == AetheriaRuntimeDaemonStateRefs.CurrentTargetName ? "Live Target" : "");
|
||||
var resolved = AetheriaRuntimeEveSurfaceAdapter.ResolveStateRefs(surface, resolver);
|
||||
var resolved = AetheriaRuntimeSurfaceDocuments.ResolveStateRefs(surface, resolver);
|
||||
|
||||
Assert.IsTrue(ContainsEveSurfaceMetric(resolved.Surface.Root, "Target", "Live Target"));
|
||||
Assert.IsTrue(ContainsEveSurfaceProp(
|
||||
|
|
@ -700,7 +700,7 @@ public class DaemonRuntimeDocumentTests
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void EveSurfaceAdapterResolvesTypedPointerPropsBeforeLowering()
|
||||
public void RuntimeSurfaceDocumentsResolveTypedPointerPropsBeforeLowering()
|
||||
{
|
||||
var surface = new EveSurfaceDocument(
|
||||
"surface-state",
|
||||
|
|
@ -729,7 +729,7 @@ public class DaemonRuntimeDocumentTests
|
|||
var resolver = CultMesh.StateRefResolver(
|
||||
"aetheria.tests.refs",
|
||||
(stateRef, _context) => stateRef == AetheriaRuntimeDaemonStateRefs.CurrentTargetName ? "Live Target" : "");
|
||||
var resolved = AetheriaRuntimeEveSurfaceAdapter.ResolveStateRefs(surface, resolver);
|
||||
var resolved = AetheriaRuntimeSurfaceDocuments.ResolveStateRefs(surface, resolver);
|
||||
|
||||
Assert.IsTrue(ContainsEveSurfaceProp(resolved.Surface.Root, "description", "Live Target"));
|
||||
Assert.IsTrue(ContainsEveSurfaceProp(resolved.Surface.Root, "descriptionRef", AetheriaRuntimeDaemonStateRefs.CurrentTargetName));
|
||||
|
|
@ -2207,9 +2207,9 @@ public class DaemonRuntimeDocumentTests
|
|||
.OpenAsync(statePath, "unity-observer-test", pullOnOpen: true)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
using var observedFrame = client.State.ReactiveDaemonFrame();
|
||||
using var observedSoaView = client.State.ReactiveDaemonSoaView();
|
||||
using var observedZoneRender = client.State.ReactiveZoneRender();
|
||||
using var observedFrame = client.State.DaemonFrame.Reactive();
|
||||
using var observedSoaView = client.State.DaemonSoaView.Reactive();
|
||||
using var observedZoneRender = client.State.ZoneRender.Reactive();
|
||||
Assert.IsTrue(AetheriaRuntimeDaemonRenderView.TryCreateCurrent(
|
||||
observedFrame,
|
||||
observedSoaView,
|
||||
|
|
@ -2265,9 +2265,9 @@ public class DaemonRuntimeDocumentTests
|
|||
.OpenAsync(statePath, "unity-reactive-observer-test", pullOnOpen: true)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
using var observedFrame = client.State.ReactiveDaemonFrame();
|
||||
using var observedSoaView = client.State.ReactiveDaemonSoaView();
|
||||
using var observedZoneRender = client.State.ReactiveZoneRender();
|
||||
using var observedFrame = client.State.DaemonFrame.Reactive();
|
||||
using var observedSoaView = client.State.DaemonSoaView.Reactive();
|
||||
using var observedZoneRender = client.State.ZoneRender.Reactive();
|
||||
var observed = AetheriaRuntimeDaemonRenderView.TryCreateCurrent(
|
||||
observedFrame,
|
||||
observedSoaView,
|
||||
|
|
@ -2312,9 +2312,9 @@ public class DaemonRuntimeDocumentTests
|
|||
.OpenAsync(statePath, "unity-frame-only-observer-test", pullOnOpen: true)
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
using var observedFrame = client.State.ReactiveDaemonFrame();
|
||||
using var observedSoaView = client.State.ReactiveDaemonSoaView();
|
||||
using var observedZoneRender = client.State.ReactiveZoneRender();
|
||||
using var observedFrame = client.State.DaemonFrame.Reactive();
|
||||
using var observedSoaView = client.State.DaemonSoaView.Reactive();
|
||||
using var observedZoneRender = client.State.ZoneRender.Reactive();
|
||||
Assert.IsTrue(AetheriaRuntimeDaemonRenderView.TryCreateCurrent(
|
||||
observedFrame,
|
||||
observedSoaView,
|
||||
|
|
@ -2375,7 +2375,7 @@ public class DaemonRuntimeDocumentTests
|
|||
}
|
||||
|
||||
[Test]
|
||||
public void CommandClientSendsCommandAgainstDaemonFrame
|
||||
public void CommandClientSendsCommandAgainstDaemonFrame()
|
||||
{
|
||||
var statePath = Path.Combine(
|
||||
Path.GetTempPath(),
|
||||
|
|
|
|||
|
|
@ -82,12 +82,12 @@ public class StarbridgePlayerSeatDocumentTests
|
|||
var handle = client.Document<AetheriaRuntimeStarbridgePlayerSeatDocument>(
|
||||
AetheriaRuntimeVerseRecordKeys.StarbridgePlayerSeat(seat.SeatId));
|
||||
using var reactive = handle.Reactive();
|
||||
using var aetheriaSeat = client.State.ReactiveStarbridgePlayerSeat(seat.SeatId);
|
||||
using var aetheriaSeat = client.Aetheria().StarbridgePlayerSeat(seat.SeatId).Reactive();
|
||||
|
||||
Assert.AreEqual("seat-support", handle.Latest().SeatId);
|
||||
Assert.AreEqual(
|
||||
"seat-support",
|
||||
ReadLatest(client.State.StarbridgePlayerSeat(seat.SeatId)).SeatId);
|
||||
ReadLatest(client.Aetheria().StarbridgePlayerSeat(seat.SeatId)).SeatId);
|
||||
Assert.AreEqual("item:cockpit:support", reactive.Current.CockpitItemKey);
|
||||
Assert.AreEqual("item:cockpit:support", aetheriaSeat.Current.CockpitItemKey);
|
||||
Assert.AreEqual("entity:pod:support", reactive.Current.EscapePodEntityKey);
|
||||
|
|
|
|||
|
|
@ -19,6 +19,29 @@
|
|||
"allowUnsafeCode": false,
|
||||
"overrideReferences": true,
|
||||
"precompiledReferences": [
|
||||
"ConcurrentCollections.dll",
|
||||
"GameCult.Caching.MessagePack.dll",
|
||||
"GameCult.Caching.dll",
|
||||
"GameCult.Logging.dll",
|
||||
"GameCult.Mesh.dll",
|
||||
"GameCult.Networking.dll",
|
||||
"Isopoh.Cryptography.Argon2.dll",
|
||||
"Isopoh.Cryptography.Blake2b.dll",
|
||||
"Isopoh.Cryptography.SecureArray.dll",
|
||||
"LiteNetLib.dll",
|
||||
"Microsoft.Bcl.AsyncInterfaces.dll",
|
||||
"Microsoft.Bcl.TimeProvider.dll",
|
||||
"Microsoft.NET.StringTools.dll",
|
||||
"MessagePack.Annotations.dll",
|
||||
"MessagePack.CultMesh.dll",
|
||||
"R3.dll",
|
||||
"System.Collections.Immutable.dll",
|
||||
"System.ComponentModel.Annotations.dll",
|
||||
"System.IO.Pipelines.dll",
|
||||
"System.Text.Encodings.Web.dll",
|
||||
"System.Text.Json.dll",
|
||||
"System.Threading.Channels.dll",
|
||||
"System.Threading.Tasks.Extensions.dll",
|
||||
"nunit.framework.dll"
|
||||
],
|
||||
"autoReferenced": false,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Mesh;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
|
@ -69,6 +70,7 @@ public class SchematicDisplay : MonoBehaviour
|
|||
private SchematicDisplayItem[] _schematicItems;
|
||||
private AetherDrive _aetherDrive;
|
||||
private AetheriaRuntimeDaemonRenderSettings? _renderSettings;
|
||||
private AetheriaClientState _runtimeState;
|
||||
|
||||
private bool _enemy;
|
||||
private Entity _player;
|
||||
|
|
@ -92,6 +94,15 @@ public class SchematicDisplay : MonoBehaviour
|
|||
_renderSettings = renderSettings;
|
||||
}
|
||||
|
||||
private AetheriaClientState RuntimeState
|
||||
{
|
||||
get
|
||||
{
|
||||
_runtimeState ??= AetheriaUnityRuntimeClientProvider.RuntimeState("unity-schematic-display");
|
||||
return _runtimeState;
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowShip(Entity entity, Entity player = null)
|
||||
{
|
||||
_enemy = player != null;
|
||||
|
|
@ -318,7 +329,7 @@ public class SchematicDisplay : MonoBehaviour
|
|||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.CurrentCatalog("unity-schematic-display");
|
||||
return RuntimeState.Catalog.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -332,7 +343,7 @@ public class SchematicDisplay : MonoBehaviour
|
|||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.CurrentPlayerSettings("unity-schematic-display");
|
||||
return RuntimeState.PlayerSettings.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -346,9 +357,7 @@ public class SchematicDisplay : MonoBehaviour
|
|||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider
|
||||
.CurrentEntityState("unity-schematic-display")
|
||||
?.Hud ?? new AetheriaRuntimeCurrentEntityHudStatus();
|
||||
return RuntimeState.CurrentEntity.Latest()?.Hud ?? new AetheriaRuntimeCurrentEntityHudStatus();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using System.Linq;
|
|||
using GameCult.Aetheria.EveRuntime;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Eve.Surface;
|
||||
using GameCult.Mesh;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.InputSystem.Utilities;
|
||||
|
|
@ -18,6 +19,7 @@ public class InputDisplayLayout : MonoBehaviour
|
|||
private string _captureActionName = "";
|
||||
private int _captureBindingIndex = -1;
|
||||
private string _captureBindingLabel = "";
|
||||
private AetheriaClientState _runtimeState;
|
||||
private readonly AetheriaEveUnitySurfaceChrome _surfaceChrome = new AetheriaEveUnitySurfaceChrome
|
||||
{
|
||||
RootAlignItems = Align.Center,
|
||||
|
|
@ -368,8 +370,10 @@ public class InputDisplayLayout : MonoBehaviour
|
|||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider
|
||||
.CurrentPlayerSettings(RequireLocalStateBoot(), "unity-input-screen");
|
||||
_runtimeState ??= AetheriaUnityRuntimeClientProvider.RuntimeState(
|
||||
RequireLocalStateBoot(),
|
||||
"unity-input-screen");
|
||||
return _runtimeState.PlayerSettings.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using GameCult.Aetheria.EveRuntime;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Eve.Surface;
|
||||
using GameCult.Mesh;
|
||||
using TMPro;
|
||||
using UniRx;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.UIElements;
|
||||
using UiButton = UnityEngine.UIElements.Button;
|
||||
|
||||
public class MainMenu : MonoBehaviour
|
||||
{
|
||||
|
|
@ -15,37 +18,46 @@ public class MainMenu : MonoBehaviour
|
|||
public GameSettings Settings;
|
||||
public ConfirmationDialog Dialog;
|
||||
public bool InGame;
|
||||
public float FadeTime = 0.5f;
|
||||
public float FadeDistance = 512f;
|
||||
public float FadeAlphaExponent = 2f;
|
||||
public float FadePositionExponent = 2f;
|
||||
public float HoverSpacing = 8f;
|
||||
public float HoverAnimationDuration = 0.16f;
|
||||
|
||||
private UIDocument _menuSurfaceDocument;
|
||||
private UIDocument _currentMenuSurfaceDocument;
|
||||
private UIDocument _nextMenuSurfaceDocument;
|
||||
private Func<bool> _canOpenRuntimeInputScreen;
|
||||
private Action _openRuntimeInputScreen;
|
||||
private bool _fadeFromRight;
|
||||
private bool _fading;
|
||||
private float _fadeLerp;
|
||||
private readonly List<MenuHoverButton> _hoverButtons = new List<MenuHoverButton>();
|
||||
private readonly AetheriaEveUnitySurfaceChrome _menuSurfaceChrome = new AetheriaEveUnitySurfaceChrome
|
||||
{
|
||||
RootAlignItems = Align.Center,
|
||||
RootJustifyContent = Justify.Center,
|
||||
RootPaddingLeft = 24f,
|
||||
UseShell = false,
|
||||
RootAlignItems = Align.FlexStart,
|
||||
RootJustifyContent = Justify.FlexStart,
|
||||
RootPaddingLeft = 96f,
|
||||
RootPaddingTop = 92f,
|
||||
RootPaddingRight = 24f,
|
||||
RootPaddingTop = 24f,
|
||||
RootPaddingBottom = 24f,
|
||||
RootBackgroundColor = new Color(0f, 0f, 0f, 0.6f),
|
||||
Width = 560f,
|
||||
MinWidth = 0f,
|
||||
MaxWidth = 560f,
|
||||
PaddingLeft = 20f,
|
||||
PaddingRight = 20f,
|
||||
PaddingTop = 20f,
|
||||
PaddingBottom = 20f,
|
||||
BorderRadius = 0f,
|
||||
BorderWidth = 0f,
|
||||
BackgroundColor = new Color(0.08f, 0.1f, 0.14f, 0.96f)
|
||||
RootBackgroundColor = new Color(0f, 0f, 0f, 0f),
|
||||
RootPickingMode = PickingMode.Position
|
||||
};
|
||||
|
||||
void Start()
|
||||
{
|
||||
ShowMain();
|
||||
ShowMain(false);
|
||||
}
|
||||
|
||||
private void ShowMain()
|
||||
void Update()
|
||||
{
|
||||
UpdateMenuFade();
|
||||
UpdateHoverButtons();
|
||||
}
|
||||
|
||||
private void ShowMain(bool animateFromRight = true)
|
||||
{
|
||||
var stateBoot = CurrentStateBoot();
|
||||
var sectorMap = ResolveSectorMap(stateBoot);
|
||||
|
|
@ -60,7 +72,8 @@ public class MainMenu : MonoBehaviour
|
|||
CanOpenRuntimeInputScreen(),
|
||||
InGame,
|
||||
DateTime.UtcNow.ToString("O")),
|
||||
HandleMainSurfaceCommand);
|
||||
HandleMainSurfaceCommand,
|
||||
animateFromRight);
|
||||
}
|
||||
|
||||
private void HandleMainSurfaceCommand(EveSurfaceCommandRequest request)
|
||||
|
|
@ -77,7 +90,7 @@ public class MainMenu : MonoBehaviour
|
|||
if (ResolveSectorMap(CurrentStateBoot()) == null)
|
||||
{
|
||||
Debug.LogWarning("Main-menu Continue requested without a typed Aetheria sector-map projection.");
|
||||
ShowMain();
|
||||
ShowMain(false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -87,7 +100,7 @@ public class MainMenu : MonoBehaviour
|
|||
StartNewGame();
|
||||
return;
|
||||
case AetheriaRuntimeMainMenuCommandKind.ShowSettings:
|
||||
ShowSettings();
|
||||
ShowSettings(true);
|
||||
return;
|
||||
case AetheriaRuntimeMainMenuCommandKind.Quit:
|
||||
Application.Quit();
|
||||
|
|
@ -102,7 +115,7 @@ public class MainMenu : MonoBehaviour
|
|||
{
|
||||
if (!TryStartDaemonObservedGame("Starting Daemon Run"))
|
||||
{
|
||||
ShowMain();
|
||||
ShowMain(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -145,7 +158,9 @@ public class MainMenu : MonoBehaviour
|
|||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider
|
||||
.CurrentSectorMap(stateBoot, "unity-main-menu");
|
||||
.RuntimeState(stateBoot, "unity-main-menu")
|
||||
.SectorMap
|
||||
.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -162,7 +177,9 @@ public class MainMenu : MonoBehaviour
|
|||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider
|
||||
.CurrentPlayerSettings(stateBoot, "unity-main-menu");
|
||||
.RuntimeState(stateBoot, "unity-main-menu")
|
||||
.PlayerSettings
|
||||
.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -179,7 +196,9 @@ public class MainMenu : MonoBehaviour
|
|||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider
|
||||
.CurrentVerseHostSettings(stateBoot, "unity-main-menu");
|
||||
.RuntimeState(stateBoot, "unity-main-menu")
|
||||
.VerseHostSettings
|
||||
.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -192,18 +211,19 @@ public class MainMenu : MonoBehaviour
|
|||
{
|
||||
if (!TryStartDaemonObservedGame("Continuing Daemon Run"))
|
||||
{
|
||||
ShowMain();
|
||||
ShowMain(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowSettings()
|
||||
private void ShowSettings(bool animateFromRight = true)
|
||||
{
|
||||
RenderMenuSurface(
|
||||
AetheriaRuntimeMainMenuSurfaceBuilder.BuildSettings(DateTime.UtcNow.ToString("O")),
|
||||
HandleSettingsSurfaceCommand);
|
||||
HandleSettingsSurfaceCommand,
|
||||
animateFromRight);
|
||||
}
|
||||
|
||||
private void ShowInputSettings()
|
||||
private void ShowInputSettings(bool animateFromRight = true)
|
||||
{
|
||||
var stateBoot = CurrentStateBoot();
|
||||
RenderMenuSurface(
|
||||
|
|
@ -213,19 +233,21 @@ public class MainMenu : MonoBehaviour
|
|||
CanOpenRuntimeInputScreen(),
|
||||
InGame,
|
||||
DateTime.UtcNow.ToString("O")),
|
||||
HandleInputSettingsSurfaceCommand);
|
||||
HandleInputSettingsSurfaceCommand,
|
||||
animateFromRight);
|
||||
}
|
||||
|
||||
private void ShowPlayerSettingsSurface()
|
||||
private void ShowPlayerSettingsSurface(bool animateFromRight = true)
|
||||
{
|
||||
RenderMenuSurface(
|
||||
AetheriaRuntimeMainMenuSurfaceBuilder.BuildPlayerSettingsShell(
|
||||
ResolvePlayerSettings(CurrentStateBoot()),
|
||||
DateTime.UtcNow.ToString("O")),
|
||||
HandlePlayerSettingsSurfaceCommand);
|
||||
HandlePlayerSettingsSurfaceCommand,
|
||||
animateFromRight);
|
||||
}
|
||||
|
||||
private void ShowVerseSettingsSurface()
|
||||
private void ShowVerseSettingsSurface(bool animateFromRight = true)
|
||||
{
|
||||
var stateBoot = CurrentStateBoot();
|
||||
RenderMenuSurface(
|
||||
|
|
@ -234,20 +256,377 @@ public class MainMenu : MonoBehaviour
|
|||
stateBoot,
|
||||
ResolveVerseHostSettings(stateBoot),
|
||||
DateTime.UtcNow.ToString("O"))),
|
||||
HandleVerseSettingsSurfaceCommand);
|
||||
HandleVerseSettingsSurfaceCommand,
|
||||
animateFromRight);
|
||||
}
|
||||
|
||||
private void RenderMenuSurface(
|
||||
AetheriaRuntimeSurfaceDocument document,
|
||||
Action<EveSurfaceCommandRequest> commandHandler)
|
||||
Action<EveSurfaceCommandRequest> commandHandler,
|
||||
bool animateFromRight)
|
||||
{
|
||||
_menuSurfaceDocument = AetheriaEveUnitySurfaceHost.RenderRuntime(
|
||||
var initialRender = _currentMenuSurfaceDocument == null;
|
||||
var targetDocument = initialRender ? _currentMenuSurfaceDocument : _nextMenuSurfaceDocument;
|
||||
targetDocument = AetheriaEveUnitySurfaceHost.RenderRuntime(
|
||||
transform,
|
||||
_menuSurfaceDocument,
|
||||
"Aetheria Menu Surface",
|
||||
targetDocument,
|
||||
initialRender ? "Aetheria Menu Surface" : "Aetheria Menu Surface Transition",
|
||||
document,
|
||||
commandHandler,
|
||||
_menuSurfaceChrome);
|
||||
_menuSurfaceChrome,
|
||||
sortingOrder: initialRender ? 1000 : 1001);
|
||||
|
||||
ApplyMenuStyles(targetDocument.rootVisualElement, IsRootMainMenu(document));
|
||||
SetDocumentTransition(targetDocument, initialRender ? 0f : (animateFromRight ? FadeDistance : -FadeDistance), initialRender ? 1f : 0f);
|
||||
|
||||
if (initialRender)
|
||||
{
|
||||
_currentMenuSurfaceDocument = targetDocument;
|
||||
return;
|
||||
}
|
||||
|
||||
_nextMenuSurfaceDocument = targetDocument;
|
||||
_fadeFromRight = animateFromRight;
|
||||
_fadeLerp = 0f;
|
||||
_fading = true;
|
||||
}
|
||||
|
||||
private static bool IsRootMainMenu(AetheriaRuntimeSurfaceDocument document)
|
||||
{
|
||||
return string.Equals(
|
||||
document?.Surface?.Id,
|
||||
AetheriaRuntimeMainMenuCommands.RootSurfaceId,
|
||||
StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
private void UpdateMenuFade()
|
||||
{
|
||||
if (!_fading)
|
||||
return;
|
||||
|
||||
_fadeLerp += Time.unscaledDeltaTime / Mathf.Max(0.01f, FadeTime);
|
||||
var t = Mathf.Clamp01(_fadeLerp);
|
||||
var outgoing = Mathf.Pow(t, FadePositionExponent);
|
||||
var incoming = Mathf.Pow(1f - t, FadePositionExponent);
|
||||
var direction = _fadeFromRight ? 1f : -1f;
|
||||
|
||||
SetDocumentTransition(
|
||||
_currentMenuSurfaceDocument,
|
||||
-direction * FadeDistance * outgoing,
|
||||
Mathf.Pow(1f - t, FadeAlphaExponent));
|
||||
SetDocumentTransition(
|
||||
_nextMenuSurfaceDocument,
|
||||
direction * FadeDistance * incoming,
|
||||
Mathf.Pow(t, FadeAlphaExponent));
|
||||
|
||||
if (_fadeLerp <= 1f)
|
||||
return;
|
||||
|
||||
_fading = false;
|
||||
AetheriaEveUnitySurfaceHost.Hide(_currentMenuSurfaceDocument);
|
||||
var previous = _currentMenuSurfaceDocument;
|
||||
_currentMenuSurfaceDocument = _nextMenuSurfaceDocument;
|
||||
_nextMenuSurfaceDocument = previous;
|
||||
SetDocumentTransition(_currentMenuSurfaceDocument, 0f, 1f);
|
||||
}
|
||||
|
||||
private static void SetDocumentTransition(UIDocument document, float x, float opacity)
|
||||
{
|
||||
if (document?.rootVisualElement == null)
|
||||
return;
|
||||
|
||||
document.rootVisualElement.style.translate = new Translate(new Length(x, LengthUnit.Pixel), 0f, 0f);
|
||||
document.rootVisualElement.style.opacity = opacity;
|
||||
}
|
||||
|
||||
private void UpdateHoverButtons()
|
||||
{
|
||||
for (var i = _hoverButtons.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var hover = _hoverButtons[i];
|
||||
if (hover.Button == null)
|
||||
{
|
||||
_hoverButtons.RemoveAt(i);
|
||||
continue;
|
||||
}
|
||||
|
||||
var direction = hover.Hovering && hover.Button.enabledInHierarchy ? 1f : -1f;
|
||||
hover.Lerp = Mathf.Clamp01(hover.Lerp + Time.unscaledDeltaTime / Mathf.Max(0.01f, HoverAnimationDuration) * direction);
|
||||
hover.Button.style.letterSpacing = HoverSpacing * hover.Lerp;
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplyMenuStyles(VisualElement root, bool rootMainMenu)
|
||||
{
|
||||
if (root == null)
|
||||
return;
|
||||
|
||||
StyleMenuTree(root, rootMainMenu);
|
||||
|
||||
var surface = rootMainMenu
|
||||
? FindElement(root, $"{AetheriaRuntimeMainMenuCommands.RootSurfaceId}.root")
|
||||
: FindFirstKind(root, "surface");
|
||||
if (surface != null)
|
||||
{
|
||||
surface.style.flexGrow = 0f;
|
||||
surface.style.width = rootMainMenu ? 680f : 560f;
|
||||
surface.style.alignItems = Align.FlexStart;
|
||||
surface.pickingMode = PickingMode.Position;
|
||||
}
|
||||
|
||||
var title = FindElement(root, $"{AetheriaRuntimeMainMenuCommands.RootSurfaceId}.title") as Label;
|
||||
if (title != null)
|
||||
{
|
||||
title.style.fontSize = 82f;
|
||||
title.style.color = new Color(0.82f, 0.95f, 1f, 0.96f);
|
||||
title.style.unityFontStyleAndWeight = FontStyle.Normal;
|
||||
title.style.unityTextAlign = TextAnchor.MiddleLeft;
|
||||
title.style.marginLeft = 0f;
|
||||
title.style.marginBottom = -12f;
|
||||
title.style.width = 660f;
|
||||
}
|
||||
|
||||
var subtitle = FindElement(root, $"{AetheriaRuntimeMainMenuCommands.RootSurfaceId}.subtitle") as Label;
|
||||
if (subtitle != null)
|
||||
{
|
||||
subtitle.style.fontSize = 38f;
|
||||
subtitle.style.color = new Color(0.82f, 0.95f, 1f, 0.92f);
|
||||
subtitle.style.unityFontStyleAndWeight = FontStyle.Normal;
|
||||
subtitle.style.unityTextAlign = TextAnchor.MiddleRight;
|
||||
subtitle.style.marginTop = 0f;
|
||||
subtitle.style.marginBottom = 36f;
|
||||
subtitle.style.width = 660f;
|
||||
}
|
||||
|
||||
RegisterHoverButtons(root);
|
||||
}
|
||||
|
||||
private void StyleMenuTree(VisualElement element, bool rootMainMenu)
|
||||
{
|
||||
if (element == null)
|
||||
return;
|
||||
|
||||
element.pickingMode = PickingMode.Position;
|
||||
|
||||
if (element is UiButton button)
|
||||
StyleMenuButton(button, rootMainMenu);
|
||||
else if (element is TextField textField)
|
||||
StyleMenuTextField(textField, rootMainMenu);
|
||||
else if (element is Label label)
|
||||
StyleMenuLabel(label, rootMainMenu);
|
||||
else
|
||||
StyleMenuContainer(element, rootMainMenu);
|
||||
|
||||
foreach (var child in element.Children())
|
||||
StyleMenuTree(child, rootMainMenu);
|
||||
}
|
||||
|
||||
private static void StyleMenuContainer(VisualElement element, bool rootMainMenu)
|
||||
{
|
||||
element.style.backgroundColor = new Color(0f, 0f, 0f, 0f);
|
||||
element.style.borderLeftWidth = 0f;
|
||||
element.style.borderRightWidth = 0f;
|
||||
element.style.borderTopWidth = 0f;
|
||||
element.style.borderBottomWidth = 0f;
|
||||
element.style.marginLeft = 0f;
|
||||
element.style.marginTop = 0f;
|
||||
element.style.marginBottom = 0f;
|
||||
|
||||
if (element.ClassListContains("eve-row"))
|
||||
{
|
||||
element.style.flexDirection = FlexDirection.Row;
|
||||
element.style.flexWrap = Wrap.Wrap;
|
||||
element.style.alignItems = Align.Center;
|
||||
element.style.marginTop = 2f;
|
||||
element.style.marginBottom = 6f;
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.ClassListContains("eve-card"))
|
||||
{
|
||||
element.style.flexDirection = FlexDirection.Column;
|
||||
element.style.alignItems = Align.FlexStart;
|
||||
element.style.width = rootMainMenu ? 680f : 540f;
|
||||
element.style.marginBottom = 18f;
|
||||
element.style.paddingTop = 0f;
|
||||
element.style.paddingBottom = 2f;
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.ClassListContains("eve-metric") || element.ClassListContains("eve-field"))
|
||||
{
|
||||
element.style.flexDirection = FlexDirection.Row;
|
||||
element.style.alignItems = Align.Center;
|
||||
element.style.width = rootMainMenu ? 320f : 520f;
|
||||
element.style.marginBottom = 5f;
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.ClassListContains("eve-kind-control-text"))
|
||||
{
|
||||
element.style.flexDirection = FlexDirection.Row;
|
||||
element.style.alignItems = Align.Center;
|
||||
element.style.width = rootMainMenu ? 520f : 520f;
|
||||
element.style.marginBottom = rootMainMenu ? 6f : 10f;
|
||||
return;
|
||||
}
|
||||
|
||||
if (element.ClassListContains("eve-surface-root") || element.ClassListContains("eve-kind-surface"))
|
||||
{
|
||||
element.style.flexDirection = FlexDirection.Column;
|
||||
element.style.alignItems = Align.FlexStart;
|
||||
element.style.width = rootMainMenu ? 680f : 560f;
|
||||
return;
|
||||
}
|
||||
|
||||
element.style.flexDirection = FlexDirection.Column;
|
||||
element.style.alignItems = Align.FlexStart;
|
||||
}
|
||||
|
||||
private static void StyleMenuLabel(Label label, bool rootMainMenu)
|
||||
{
|
||||
label.style.color = new Color(0.86f, 0.98f, 1f, 0.94f);
|
||||
label.style.unityFontStyleAndWeight = FontStyle.Normal;
|
||||
label.style.unityTextAlign = TextAnchor.MiddleLeft;
|
||||
label.style.whiteSpace = WhiteSpace.Normal;
|
||||
label.style.marginLeft = 0f;
|
||||
label.style.marginTop = 0f;
|
||||
label.style.marginBottom = 0f;
|
||||
|
||||
if (label.ClassListContains("eve-title"))
|
||||
{
|
||||
label.style.fontSize = rootMainMenu ? 24f : 24f;
|
||||
label.style.unityFontStyleAndWeight = FontStyle.Normal;
|
||||
label.style.marginTop = rootMainMenu ? 0f : 2f;
|
||||
label.style.marginBottom = rootMainMenu ? 0f : 10f;
|
||||
label.style.maxWidth = rootMainMenu ? 620f : 520f;
|
||||
return;
|
||||
}
|
||||
|
||||
if (label.ClassListContains("eve-muted"))
|
||||
{
|
||||
label.style.fontSize = rootMainMenu ? 18f : 15f;
|
||||
label.style.color = new Color(0.78f, 0.92f, 0.98f, 0.84f);
|
||||
label.style.width = rootMainMenu ? 120f : 190f;
|
||||
label.style.marginRight = 12f;
|
||||
return;
|
||||
}
|
||||
|
||||
if (label.ClassListContains("eve-value"))
|
||||
{
|
||||
label.style.fontSize = rootMainMenu ? 20f : 16f;
|
||||
label.style.unityFontStyleAndWeight = FontStyle.Normal;
|
||||
label.style.maxWidth = rootMainMenu ? 360f : 300f;
|
||||
return;
|
||||
}
|
||||
|
||||
label.style.fontSize = rootMainMenu ? 24f : 16f;
|
||||
label.style.maxWidth = rootMainMenu ? 620f : 520f;
|
||||
label.style.marginBottom = rootMainMenu ? 0f : 10f;
|
||||
}
|
||||
|
||||
private static void StyleMenuTextField(TextField field, bool rootMainMenu)
|
||||
{
|
||||
field.style.width = rootMainMenu ? 360f : 520f;
|
||||
field.style.height = rootMainMenu ? 30f : 28f;
|
||||
field.style.marginLeft = 0f;
|
||||
field.style.marginTop = 0f;
|
||||
field.style.marginBottom = rootMainMenu ? 4f : 8f;
|
||||
field.style.color = new Color(0.86f, 0.98f, 1f, 0.96f);
|
||||
field.style.fontSize = rootMainMenu ? 18f : 15f;
|
||||
field.pickingMode = PickingMode.Position;
|
||||
|
||||
field.labelElement.style.minWidth = rootMainMenu ? 100f : 190f;
|
||||
field.labelElement.style.width = rootMainMenu ? 100f : 190f;
|
||||
field.labelElement.style.color = new Color(0.78f, 0.92f, 0.98f, 0.84f);
|
||||
}
|
||||
|
||||
private static void StyleMenuButton(UiButton button, bool rootMainMenu)
|
||||
{
|
||||
button.style.backgroundColor = new Color(0f, 0f, 0f, 0f);
|
||||
button.style.borderLeftWidth = 0f;
|
||||
button.style.borderRightWidth = 0f;
|
||||
button.style.borderTopWidth = 0f;
|
||||
button.style.borderBottomWidth = 0f;
|
||||
button.style.color = new Color(0.86f, 0.98f, 1f, 0.96f);
|
||||
button.style.fontSize = rootMainMenu ? 24f : 16f;
|
||||
button.style.unityFontStyleAndWeight = FontStyle.Normal;
|
||||
button.style.unityTextAlign = TextAnchor.MiddleLeft;
|
||||
button.style.width = rootMainMenu ? 220f : 230f;
|
||||
button.style.height = rootMainMenu ? 32f : 24f;
|
||||
button.style.marginLeft = 0f;
|
||||
button.style.marginTop = 0f;
|
||||
button.style.marginRight = rootMainMenu ? 0f : 14f;
|
||||
button.style.marginBottom = rootMainMenu ? 0f : 4f;
|
||||
button.style.paddingLeft = 0f;
|
||||
button.style.paddingRight = 0f;
|
||||
button.style.paddingTop = 0f;
|
||||
button.style.paddingBottom = 0f;
|
||||
button.style.letterSpacing = 0f;
|
||||
button.focusable = true;
|
||||
button.pickingMode = PickingMode.Position;
|
||||
}
|
||||
|
||||
private void RegisterHoverButtons(VisualElement root)
|
||||
{
|
||||
foreach (var button in FindButtons(root))
|
||||
{
|
||||
var hover = new MenuHoverButton(button);
|
||||
_hoverButtons.Add(hover);
|
||||
button.RegisterCallback<PointerEnterEvent>(_ => hover.Hovering = true);
|
||||
button.RegisterCallback<PointerLeaveEvent>(_ => hover.Hovering = false);
|
||||
}
|
||||
}
|
||||
|
||||
private static IEnumerable<UiButton> FindButtons(VisualElement root)
|
||||
{
|
||||
if (root == null)
|
||||
yield break;
|
||||
|
||||
if (root is UiButton button)
|
||||
yield return button;
|
||||
|
||||
foreach (var child in root.Children())
|
||||
{
|
||||
foreach (var nested in FindButtons(child))
|
||||
yield return nested;
|
||||
}
|
||||
}
|
||||
|
||||
private static VisualElement FindFirstKind(VisualElement root, string kind)
|
||||
{
|
||||
if (root == null)
|
||||
return null;
|
||||
|
||||
if (root.ClassListContains($"eve-kind-{kind}"))
|
||||
return root;
|
||||
|
||||
foreach (var child in root.Children())
|
||||
{
|
||||
var match = FindFirstKind(child, kind);
|
||||
if (match != null)
|
||||
return match;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static VisualElement FindElement(VisualElement root, string name)
|
||||
{
|
||||
if (root == null)
|
||||
return null;
|
||||
|
||||
if (string.Equals(root.name, name, StringComparison.Ordinal))
|
||||
return root;
|
||||
|
||||
foreach (var child in root.Children())
|
||||
{
|
||||
var match = FindElement(child, name);
|
||||
if (match != null)
|
||||
return match;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void HandleSettingsSurfaceCommand(EveSurfaceCommandRequest request)
|
||||
|
|
@ -261,16 +640,16 @@ public class MainMenu : MonoBehaviour
|
|||
switch (command.Kind)
|
||||
{
|
||||
case AetheriaRuntimeMainMenuCommandKind.ShowPlayerSettings:
|
||||
ShowPlayerSettingsSurface();
|
||||
ShowPlayerSettingsSurface(true);
|
||||
return;
|
||||
case AetheriaRuntimeMainMenuCommandKind.ShowVerseSettings:
|
||||
ShowVerseSettingsSurface();
|
||||
ShowVerseSettingsSurface(true);
|
||||
return;
|
||||
case AetheriaRuntimeMainMenuCommandKind.ShowInputSettings:
|
||||
ShowInputSettings();
|
||||
ShowInputSettings(true);
|
||||
return;
|
||||
case AetheriaRuntimeMainMenuCommandKind.BackToMain:
|
||||
ShowMain();
|
||||
ShowMain(false);
|
||||
return;
|
||||
default:
|
||||
Debug.LogWarning($"Unhandled settings menu command kind: {command.Kind}");
|
||||
|
|
@ -289,12 +668,12 @@ public class MainMenu : MonoBehaviour
|
|||
switch (command.Kind)
|
||||
{
|
||||
case AetheriaRuntimeMainMenuCommandKind.BackToSettings:
|
||||
ShowSettings();
|
||||
ShowSettings(false);
|
||||
return;
|
||||
case AetheriaRuntimeMainMenuCommandKind.OpenRuntimeInputScreen:
|
||||
if (!TryOpenRuntimeInputScreen())
|
||||
{
|
||||
ShowInputSettings();
|
||||
ShowInputSettings(false);
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
@ -315,11 +694,11 @@ public class MainMenu : MonoBehaviour
|
|||
switch (command.Kind)
|
||||
{
|
||||
case AetheriaRuntimeMainMenuCommandKind.BackToSettings:
|
||||
ShowSettings();
|
||||
ShowSettings(false);
|
||||
return;
|
||||
case AetheriaRuntimeMainMenuCommandKind.PlayerSettingsCommand:
|
||||
SendKnownAetheriaEveCommand(request, "player-settings");
|
||||
ShowPlayerSettingsSurface();
|
||||
ShowPlayerSettingsSurface(false);
|
||||
return;
|
||||
default:
|
||||
Debug.LogWarning($"Unhandled player-settings command kind: {command.Kind}");
|
||||
|
|
@ -338,15 +717,15 @@ public class MainMenu : MonoBehaviour
|
|||
switch (command.Kind)
|
||||
{
|
||||
case AetheriaRuntimeMainMenuCommandKind.BackToSettings:
|
||||
ShowSettings();
|
||||
ShowSettings(false);
|
||||
return;
|
||||
case AetheriaRuntimeMainMenuCommandKind.ClientTargetCommand:
|
||||
RequestClientTargetCommand(request);
|
||||
ShowVerseSettingsSurface();
|
||||
ShowVerseSettingsSurface(false);
|
||||
return;
|
||||
case AetheriaRuntimeMainMenuCommandKind.VerseHostCommand:
|
||||
SendKnownAetheriaEveCommand(request, "Verse-host");
|
||||
ShowVerseSettingsSurface();
|
||||
ShowVerseSettingsSurface(false);
|
||||
return;
|
||||
default:
|
||||
Debug.LogWarning($"Unhandled verse-settings command kind: {command.Kind}");
|
||||
|
|
@ -356,10 +735,8 @@ public class MainMenu : MonoBehaviour
|
|||
|
||||
private void HideMenuSurface()
|
||||
{
|
||||
if (_menuSurfaceDocument == null)
|
||||
return;
|
||||
|
||||
AetheriaEveUnitySurfaceHost.Hide(_menuSurfaceDocument);
|
||||
AetheriaEveUnitySurfaceHost.Hide(_currentMenuSurfaceDocument);
|
||||
AetheriaEveUnitySurfaceHost.Hide(_nextMenuSurfaceDocument);
|
||||
}
|
||||
|
||||
public void SetRuntimeInputScreenShell(Func<bool> canOpenRuntimeInputScreen, Action openRuntimeInputScreen)
|
||||
|
|
@ -446,10 +823,28 @@ public class MainMenu : MonoBehaviour
|
|||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (_menuSurfaceDocument != null)
|
||||
if (_currentMenuSurfaceDocument != null)
|
||||
{
|
||||
Destroy(_menuSurfaceDocument.gameObject);
|
||||
_menuSurfaceDocument = null;
|
||||
Destroy(_currentMenuSurfaceDocument.gameObject);
|
||||
_currentMenuSurfaceDocument = null;
|
||||
}
|
||||
|
||||
if (_nextMenuSurfaceDocument != null)
|
||||
{
|
||||
Destroy(_nextMenuSurfaceDocument.gameObject);
|
||||
_nextMenuSurfaceDocument = null;
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class MenuHoverButton
|
||||
{
|
||||
public MenuHoverButton(UiButton button)
|
||||
{
|
||||
Button = button;
|
||||
}
|
||||
|
||||
public UiButton Button { get; }
|
||||
public bool Hovering { get; set; }
|
||||
public float Lerp { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ using System.Linq;
|
|||
using GameCult.Aetheria.EveRuntime;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Eve.Surface;
|
||||
using GameCult.Mesh;
|
||||
using UnityEngine;
|
||||
using UniRx;
|
||||
using UniRx.Triggers;
|
||||
|
|
@ -21,17 +22,14 @@ public class InventoryMenu : MonoBehaviour
|
|||
public ConfirmationDialog Dialog;
|
||||
// public ClickCatcher Background;
|
||||
|
||||
private int2 _selectedPosition;
|
||||
private InventoryPanel _selectedPanel;
|
||||
private ItemInstance _selectedItem;
|
||||
private EquippedItem _selectedEquippedItem;
|
||||
private int2[] _selectedCells;
|
||||
private AetheriaRuntimeCurrentEntityDocument _shipSettingsCurrentEntity;
|
||||
private UIDocument _shipSettingsSurfaceDocument;
|
||||
private UIDocument _cargoItemDetailsSurfaceDocument;
|
||||
private UIDocument _equippedItemDetailsSurfaceDocument;
|
||||
private AetheriaUnityActionBarPresentation _actionBarPresentation;
|
||||
private AetheriaUnityObservedEntityIndex _observedEntityIndex;
|
||||
private AetheriaUnityPresentationEntityIndex _presentationEntityIndex;
|
||||
private AetheriaClientState _runtimeState;
|
||||
private readonly AetheriaEveUnitySurfaceChrome _shipSettingsSurfaceChrome = PanelChrome(360f, 420f);
|
||||
private readonly AetheriaEveUnitySurfaceChrome _cargoItemDetailsSurfaceChrome = PanelChrome(420f, 520f);
|
||||
private readonly AetheriaEveUnitySurfaceChrome _equippedItemDetailsSurfaceChrome = PanelChrome(460f, 560f);
|
||||
|
|
@ -55,10 +53,12 @@ public class InventoryMenu : MonoBehaviour
|
|||
_actionBarPresentation = actionBarPresentation;
|
||||
}
|
||||
|
||||
public void SetObservedEntityIndex(AetheriaUnityObservedEntityIndex observedEntityIndex)
|
||||
public void SetPresentationEntityIndex(AetheriaUnityPresentationEntityIndex presentationEntityIndex)
|
||||
{
|
||||
_observedEntityIndex = observedEntityIndex;
|
||||
_presentationEntityIndex = presentationEntityIndex;
|
||||
}
|
||||
|
||||
private AetheriaClientState RuntimeState => _runtimeState ??= AetheriaUnityRuntimeClientProvider.RuntimeState("unity-inventory-menu");
|
||||
// private int2 _dragCellOffset;
|
||||
// private ItemRotation _originalRotation;
|
||||
// //private Shape _previousFakeOccupancy;
|
||||
|
|
@ -108,74 +108,6 @@ public class InventoryMenu : MonoBehaviour
|
|||
{
|
||||
foreach (var panel in InventoryPanels)
|
||||
{
|
||||
panel.OnClickAsObservable().Subscribe(e =>
|
||||
{
|
||||
if (e.data is InventoryCargoEventData cargoEvent)
|
||||
{
|
||||
var item = cargoEvent.CargoBay.Occupancy[cargoEvent.Position.x, cargoEvent.Position.y];
|
||||
if(item!=null)
|
||||
{
|
||||
if (e.clickCount == 2)
|
||||
{
|
||||
HideCargoItemDetailsSurface();
|
||||
HideEquippedItemDetailsSurface();
|
||||
ClearSelectedItemSelection();
|
||||
var otherPanel = panel == InventoryPanels[0] ? InventoryPanels[1] : InventoryPanels[0];
|
||||
RequestCargoItemTransfer(cargoEvent.CargoBay, otherPanel, item);
|
||||
// TODO: SFX: Equip
|
||||
// else
|
||||
// TODO: SFX: Fail
|
||||
}
|
||||
else
|
||||
{
|
||||
HideCurrentShipSettingsSurface();
|
||||
HideCargoItemDetailsSurface();
|
||||
HideEquippedItemDetailsSurface();
|
||||
ClearSelectedItemSelection();
|
||||
_selectedPanel = panel;
|
||||
_selectedPosition = cargoEvent.CargoBay.Cargo[item];
|
||||
_selectedItem = item;
|
||||
_selectedCells = GetSelectedCells(item, _selectedPosition);
|
||||
ApplySelectedCellHighlight();
|
||||
RenderCargoItemDetailsSurface(item);
|
||||
// TODO: SFX: Success
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (e.data is InventoryEntityEventData entityEvent)
|
||||
{
|
||||
var item = entityEvent.Entity.GearOccupancy[entityEvent.Position.x, entityEvent.Position.y];
|
||||
if (item != null)
|
||||
{
|
||||
if (e.clickCount == 2)
|
||||
{
|
||||
HideCargoItemDetailsSurface();
|
||||
HideEquippedItemDetailsSurface();
|
||||
ClearSelectedItemSelection();
|
||||
var otherPanel = panel == InventoryPanels[0] ? InventoryPanels[1] : InventoryPanels[0];
|
||||
RequestEquippedItemTransfer(entityEvent.Entity, item, otherPanel);
|
||||
// TODO: SFX: Unequip
|
||||
// else
|
||||
// TODO: SFX: Fail
|
||||
}
|
||||
else
|
||||
{
|
||||
HideCurrentShipSettingsSurface();
|
||||
HideCargoItemDetailsSurface();
|
||||
ClearSelectedItemSelection();
|
||||
_selectedPanel = panel;
|
||||
_selectedPosition = item.Position;
|
||||
_selectedItem = item.EquippableItem;
|
||||
_selectedEquippedItem = item;
|
||||
_selectedCells = GetSelectedCells(item.EquippableItem, _selectedPosition);
|
||||
ApplySelectedCellHighlight();
|
||||
RenderEquippedItemDetailsSurface(item);
|
||||
// TODO: SFX: Success
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
panel.OnBackgroundClick.Subscribe(data =>
|
||||
{
|
||||
if (!TryReadCurrentEntity(out var currentEntity)) return;
|
||||
|
|
@ -499,122 +431,9 @@ public class InventoryMenu : MonoBehaviour
|
|||
item.Entity.WeaponGroups[groupIndex].items.Contains(item);
|
||||
}
|
||||
|
||||
private void RequestCargoItemTransfer(EquippedCargoBay origin, InventoryPanel destination, ItemInstance item)
|
||||
{
|
||||
if (destination.DisplayedEntity != null && item is EquippableItem equippableItem)
|
||||
{
|
||||
RequestCargoItemEquip(origin, destination.DisplayedEntity, equippableItem);
|
||||
return;
|
||||
}
|
||||
|
||||
if (destination.DisplayedCargo != null)
|
||||
RequestCargoItemTransfer(origin, destination.DisplayedCargo, item);
|
||||
}
|
||||
|
||||
private void ClearSelectedItemSelection()
|
||||
{
|
||||
ClearSelectedCellHighlight();
|
||||
_selectedPanel = null;
|
||||
_selectedItem = null;
|
||||
_selectedEquippedItem = null;
|
||||
_selectedCells = null;
|
||||
_selectedPosition = default;
|
||||
}
|
||||
|
||||
private void RequestEquippedItemTransfer(Entity origin, EquippedItem item, InventoryPanel destination)
|
||||
{
|
||||
if (destination.DisplayedCargo != null)
|
||||
RequestEquippedItemStore(item, destination.DisplayedCargo);
|
||||
}
|
||||
|
||||
private void RequestCargoItemTransfer(
|
||||
EquippedCargoBay origin,
|
||||
EquippedCargoBay destination,
|
||||
ItemInstance item)
|
||||
{
|
||||
if (!TryResolveCargoBay(origin, out var originEntityKey, out var originCargoIndex) ||
|
||||
!TryResolveCargoBay(destination, out var destinationEntityKey, out var destinationCargoIndex) ||
|
||||
item == null ||
|
||||
string.IsNullOrWhiteSpace(item.ItemKey) ||
|
||||
!origin.Cargo.TryGetValue(item, out var originPosition) ||
|
||||
!TryValidateTypedCargoSlot(originEntityKey, originCargoIndex, item, originPosition, true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var quantity = item is SimpleCommodity commodity ? commodity.Quantity : 1;
|
||||
if (quantity <= 0)
|
||||
return;
|
||||
|
||||
TrySubmitOperation(
|
||||
operations => operations.TransferCargoItem(
|
||||
originEntityKey,
|
||||
originCargoIndex,
|
||||
destinationEntityKey,
|
||||
destinationCargoIndex,
|
||||
item.ItemKey,
|
||||
quantity,
|
||||
originPosition.x,
|
||||
originPosition.y,
|
||||
default,
|
||||
default,
|
||||
false),
|
||||
"cargo transfer");
|
||||
}
|
||||
|
||||
private void RequestCargoItemEquip(
|
||||
EquippedCargoBay origin,
|
||||
Entity destination,
|
||||
EquippableItem item)
|
||||
{
|
||||
if (!TryResolveCargoBay(origin, out var originEntityKey, out var originCargoIndex) ||
|
||||
!TryResolveEntityRecordKey(destination, out var destinationEntityKey) ||
|
||||
item == null ||
|
||||
string.IsNullOrWhiteSpace(item.ItemKey) ||
|
||||
!origin.Cargo.TryGetValue(item, out var originPosition) ||
|
||||
!TryValidateTypedCargoSlot(originEntityKey, originCargoIndex, item, originPosition, true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TrySubmitOperation(
|
||||
operations => operations.EquipItem(
|
||||
"cargo",
|
||||
originEntityKey,
|
||||
originCargoIndex,
|
||||
destinationEntityKey,
|
||||
item.ItemKey,
|
||||
originPosition.x,
|
||||
originPosition.y,
|
||||
default,
|
||||
default,
|
||||
false),
|
||||
"cargo equip");
|
||||
}
|
||||
|
||||
private void RequestEquippedItemStore(
|
||||
EquippedItem item,
|
||||
EquippedCargoBay destination)
|
||||
{
|
||||
if (!TryResolveEquippedItem(item, out var originEntityKey, out var equipmentIndex) ||
|
||||
!TryResolveCargoBay(destination, out var destinationEntityKey, out var destinationCargoIndex) ||
|
||||
item?.EquippableItem == null ||
|
||||
!TryValidateTypedEquipmentSlot(originEntityKey, equipmentIndex, item))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TrySubmitOperation(
|
||||
operations => operations.StoreItem(
|
||||
originEntityKey,
|
||||
equipmentIndex,
|
||||
destinationEntityKey,
|
||||
destinationCargoIndex,
|
||||
item.EquippableItem.ItemKey,
|
||||
default,
|
||||
default,
|
||||
false),
|
||||
"equipment store");
|
||||
}
|
||||
|
||||
private void RequestEntityShutdownPerformance(string targetEntityKey, float shutdownPerformance)
|
||||
|
|
@ -678,17 +497,17 @@ public class InventoryMenu : MonoBehaviour
|
|||
"weapon-group membership");
|
||||
}
|
||||
|
||||
private bool TryResolveEntityRecordKey(Entity entity, out string recordKey)
|
||||
private bool TryGetRecordKeyForPresentationEntity(Entity entity, out string recordKey)
|
||||
{
|
||||
recordKey = "";
|
||||
return _observedEntityIndex != null &&
|
||||
_observedEntityIndex.TryResolveEntityRecordKey(entity, out recordKey);
|
||||
return _presentationEntityIndex != null &&
|
||||
_presentationEntityIndex.TryGetRecordKeyForPresentationEntity(entity, out recordKey);
|
||||
}
|
||||
|
||||
private bool IsCurrentEntity(Entity entity)
|
||||
{
|
||||
if (entity == null ||
|
||||
!TryResolveEntityRecordKey(entity, out var entityKey) ||
|
||||
!TryGetRecordKeyForPresentationEntity(entity, out var entityKey) ||
|
||||
string.IsNullOrWhiteSpace(entityKey) ||
|
||||
!TryResolveCurrentEntityKey(out var currentEntityKey))
|
||||
{
|
||||
|
|
@ -732,9 +551,9 @@ public class InventoryMenu : MonoBehaviour
|
|||
{
|
||||
currentEntity = null;
|
||||
var currentEntityKey = CurrentEntitySnapshot()?.EntityKey ?? "";
|
||||
return _observedEntityIndex != null &&
|
||||
return _presentationEntityIndex != null &&
|
||||
!string.IsNullOrWhiteSpace(currentEntityKey) &&
|
||||
_observedEntityIndex.TryResolveEntityByRecordKey(currentEntityKey, out currentEntity);
|
||||
_presentationEntityIndex.TryGetPresentationEntityByRecordKey(currentEntityKey, out currentEntity);
|
||||
}
|
||||
|
||||
private bool TryResolveCurrentDockingBay(out EquippedDockingBay dockingBay)
|
||||
|
|
@ -744,8 +563,8 @@ public class InventoryMenu : MonoBehaviour
|
|||
if (refit?.IsDocked != true ||
|
||||
refit.DockingBayIndex < 0 ||
|
||||
string.IsNullOrWhiteSpace(refit.DockParentEntityKey) ||
|
||||
_observedEntityIndex == null ||
|
||||
!_observedEntityIndex.TryResolveDockingBayByRecordKey(
|
||||
_presentationEntityIndex == null ||
|
||||
!_presentationEntityIndex.TryGetPresentationDockingBayByRecordKey(
|
||||
refit.DockParentEntityKey,
|
||||
refit.DockingBayIndex,
|
||||
out dockingBay))
|
||||
|
|
@ -756,18 +575,13 @@ public class InventoryMenu : MonoBehaviour
|
|||
return dockingBay != null;
|
||||
}
|
||||
|
||||
private bool TryResolveCargoBay(EquippedCargoBay cargoBay, out string entityKey, out int cargoIndex)
|
||||
{
|
||||
return TryResolveEquippedItem(cargoBay, out entityKey, out cargoIndex);
|
||||
}
|
||||
|
||||
private bool TryResolveEquippedItem(EquippedItem item, out string entityKey, out int equipmentIndex)
|
||||
{
|
||||
entityKey = "";
|
||||
equipmentIndex = -1;
|
||||
var entity = item?.Entity;
|
||||
if (entity?.Equipment == null ||
|
||||
!TryResolveEntityRecordKey(entity, out entityKey))
|
||||
!TryGetRecordKeyForPresentationEntity(entity, out entityKey))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -776,97 +590,6 @@ public class InventoryMenu : MonoBehaviour
|
|||
return equipmentIndex >= 0;
|
||||
}
|
||||
|
||||
private bool TryResolveTypedInventoryRows(
|
||||
string entityKey,
|
||||
out IReadOnlyList<AetheriaRuntimeRtsInventoryItem> equipment,
|
||||
out IReadOnlyList<AetheriaRuntimeRtsInventoryItem> cargo)
|
||||
{
|
||||
equipment = Array.Empty<AetheriaRuntimeRtsInventoryItem>();
|
||||
cargo = Array.Empty<AetheriaRuntimeRtsInventoryItem>();
|
||||
if (string.IsNullOrWhiteSpace(entityKey))
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
var current = CurrentEntitySnapshot();
|
||||
if (current != null && string.Equals(current.EntityKey, entityKey, StringComparison.Ordinal))
|
||||
{
|
||||
equipment = current.Equipment ?? Array.Empty<AetheriaRuntimeRtsInventoryItem>();
|
||||
cargo = current.Cargo ?? Array.Empty<AetheriaRuntimeRtsInventoryItem>();
|
||||
return true;
|
||||
}
|
||||
|
||||
var refit = StationRefitSnapshot();
|
||||
var entityIndex = -1;
|
||||
if (refit != null)
|
||||
{
|
||||
if (string.Equals(refit.DockParentEntityKey, entityKey, StringComparison.Ordinal))
|
||||
entityIndex = refit.DockParentEntityIndex;
|
||||
else
|
||||
entityIndex = (refit.AvailableEntities ?? Array.Empty<AetheriaRuntimeStationRefitEntityOption>())
|
||||
.FirstOrDefault(option => string.Equals(option.EntityKey, entityKey, StringComparison.Ordinal))
|
||||
?.EntityIndex ?? -1;
|
||||
}
|
||||
|
||||
if (entityIndex < 0)
|
||||
return false;
|
||||
|
||||
var inventory = InventorySnapshot(entityIndex);
|
||||
if (inventory == null || !string.Equals(inventory.EntityKey, entityKey, StringComparison.Ordinal))
|
||||
return false;
|
||||
|
||||
equipment = inventory.Equipment ?? Array.Empty<AetheriaRuntimeRtsInventoryItem>();
|
||||
cargo = inventory.Cargo ?? Array.Empty<AetheriaRuntimeRtsInventoryItem>();
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogWarning($"Failed to validate Aetheria typed inventory document for {entityKey}: {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private bool TryValidateTypedCargoSlot(
|
||||
string entityKey,
|
||||
int cargoIndex,
|
||||
ItemInstance item,
|
||||
int2 originPosition,
|
||||
bool hasOriginPosition)
|
||||
{
|
||||
if (item == null ||
|
||||
string.IsNullOrWhiteSpace(item.ItemKey) ||
|
||||
!TryResolveTypedInventoryRows(entityKey, out _, out var cargo))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return cargo.Any(row =>
|
||||
string.Equals(row.Source, "cargo", StringComparison.Ordinal) &&
|
||||
row.SourceIndex == cargoIndex &&
|
||||
string.Equals(row.ItemKey, item.ItemKey, StringComparison.Ordinal) &&
|
||||
(!hasOriginPosition || (row.X == originPosition.x && row.Y == originPosition.y)));
|
||||
}
|
||||
|
||||
private bool TryValidateTypedEquipmentSlot(
|
||||
string entityKey,
|
||||
int equipmentIndex,
|
||||
EquippedItem item)
|
||||
{
|
||||
if (item?.EquippableItem == null ||
|
||||
string.IsNullOrWhiteSpace(item.EquippableItem.ItemKey) ||
|
||||
!TryResolveTypedInventoryRows(entityKey, out var equipment, out _))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return equipment.Any(row =>
|
||||
string.Equals(row.Source, "equipment", StringComparison.Ordinal) &&
|
||||
row.SourceIndex == equipmentIndex &&
|
||||
row.X == item.Position.x &&
|
||||
row.Y == item.Position.y &&
|
||||
string.Equals(row.ItemKey, item.EquippableItem.ItemKey, StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
private bool TrySubmitOperation(
|
||||
Action<AetheriaControl> submit,
|
||||
string label)
|
||||
|
|
@ -890,7 +613,7 @@ public class InventoryMenu : MonoBehaviour
|
|||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.CurrentEntityState("unity-inventory-menu");
|
||||
return RuntimeState.CurrentEntity.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -903,7 +626,7 @@ public class InventoryMenu : MonoBehaviour
|
|||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.CurrentStationRefit("unity-inventory-menu");
|
||||
return RuntimeState.StationRefit.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -912,19 +635,6 @@ public class InventoryMenu : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
private AetheriaRuntimeInventoryDocument InventorySnapshot(int entityIndex)
|
||||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.CurrentInventory(entityIndex, "unity-inventory-menu");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogWarning($"Failed to read Aetheria typed inventory document for entity {entityIndex}: {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
// if (Keyboard.current.qKey.wasPressedThisFrame && _dragItem != null)
|
||||
|
|
@ -937,41 +647,6 @@ public class InventoryMenu : MonoBehaviour
|
|||
// }
|
||||
}
|
||||
|
||||
private void ClearSelectedCellHighlight()
|
||||
{
|
||||
if (_selectedPanel == null || _selectedCells == null) return;
|
||||
|
||||
foreach (var v in _selectedCells)
|
||||
{
|
||||
if (_selectedPanel.CellInstances.ContainsKey(v))
|
||||
_selectedPanel.CellInstances[v].Icon.color = _selectedPanel.GetColor(v);
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplySelectedCellHighlight()
|
||||
{
|
||||
if (_selectedPanel == null || _selectedCells == null) return;
|
||||
|
||||
foreach (var v in _selectedCells)
|
||||
{
|
||||
if (_selectedPanel.CellInstances.ContainsKey(v))
|
||||
_selectedPanel.CellInstances[v].Icon.color = _selectedPanel.GetColor(v, true);
|
||||
}
|
||||
}
|
||||
|
||||
private int2[] GetSelectedCells(ItemInstance item, int2 position)
|
||||
{
|
||||
var typedItem = FindTypedInventoryItem(item);
|
||||
if (typedItem != null && typedItem.ShapeCells.Count > 0)
|
||||
{
|
||||
return typedItem.ShapeCells
|
||||
.Select(cell => RotateTypedShapeCell(cell, typedItem, item.Rotation) + position)
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
return Array.Empty<int2>();
|
||||
}
|
||||
|
||||
private AetheriaRuntimeCatalogItem FindTypedInventoryItem(ItemInstance item)
|
||||
{
|
||||
return CatalogSnapshot()?.FindItem(item, x => x.ItemKey);
|
||||
|
|
@ -981,7 +656,7 @@ public class InventoryMenu : MonoBehaviour
|
|||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.CurrentCatalog("unity-inventory-menu");
|
||||
return RuntimeState.Catalog.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -994,7 +669,7 @@ public class InventoryMenu : MonoBehaviour
|
|||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.CurrentPlayerSettings("unity-inventory-menu");
|
||||
return RuntimeState.PlayerSettings.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -1042,20 +717,6 @@ public class InventoryMenu : MonoBehaviour
|
|||
return $"{FormatValue(value - 273.15f)} C";
|
||||
}
|
||||
|
||||
private static int2 RotateTypedShapeCell(
|
||||
AetheriaRuntimeShapeCell cell,
|
||||
AetheriaRuntimeCatalogItem item,
|
||||
ItemRotation rotation)
|
||||
{
|
||||
return rotation switch
|
||||
{
|
||||
ItemRotation.Clockwise => new int2(cell.Y, item.ShapeWidth - 1 - cell.X),
|
||||
ItemRotation.Reversed => new int2(item.ShapeWidth - 1 - cell.X, item.ShapeHeight - 1 - cell.Y),
|
||||
ItemRotation.CounterClockwise => new int2(item.ShapeHeight - 1 - cell.Y, cell.X),
|
||||
_ => new int2(cell.X, cell.Y)
|
||||
};
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (_shipSettingsSurfaceDocument != null)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -5,6 +5,7 @@ using System.Linq;
|
|||
using GameCult.Aetheria.EveRuntime;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Eve.Surface;
|
||||
using GameCult.Mesh;
|
||||
using Ink.Runtime;
|
||||
using TMPro;
|
||||
using UniRx;
|
||||
|
|
@ -20,16 +21,17 @@ public class LocalMenu : MonoBehaviour
|
|||
public ChoicePrefab ChoicePrefab;
|
||||
|
||||
private string _currentPath;
|
||||
private LocationStory _currentLocation;
|
||||
private LocationStory _currentLocalInkLocation;
|
||||
private Story _activeStory;
|
||||
private readonly List<ActiveStoryChoice> _activeChoices = new List<ActiveStoryChoice>();
|
||||
private UIDocument _surfaceDocument;
|
||||
private readonly AetheriaEveUnitySurfaceChrome _surfaceChrome = new AetheriaEveUnitySurfaceChrome();
|
||||
private AetheriaUnityObservedEntityIndex _observedEntityIndex;
|
||||
private AetheriaUnityPresentationEntityIndex _presentationEntityIndex;
|
||||
private AetheriaClientState _runtimeState;
|
||||
|
||||
public void SetObservedEntityIndex(AetheriaUnityObservedEntityIndex observedEntityIndex)
|
||||
public void SetPresentationEntityIndex(AetheriaUnityPresentationEntityIndex presentationEntityIndex)
|
||||
{
|
||||
_observedEntityIndex = observedEntityIndex;
|
||||
_presentationEntityIndex = presentationEntityIndex;
|
||||
}
|
||||
|
||||
private sealed class ActiveStoryChoice
|
||||
|
|
@ -48,13 +50,13 @@ public class LocalMenu : MonoBehaviour
|
|||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (!TryResolveDockedLocalStory(out _currentLocation))
|
||||
if (!TryResolveDockedLocalInkStory(out _currentLocalInkLocation))
|
||||
{
|
||||
HideStorySurface();
|
||||
return;
|
||||
}
|
||||
|
||||
_activeStory = _currentLocation.Story;
|
||||
_activeStory = _currentLocalInkLocation.Story;
|
||||
Continue();
|
||||
}
|
||||
|
||||
|
|
@ -84,7 +86,7 @@ public class LocalMenu : MonoBehaviour
|
|||
else if (!_activeStory.canContinue)
|
||||
{
|
||||
// There's no choices, but we also can't continue; indicates we hit an END
|
||||
if (_activeStory == _currentLocation.Story)
|
||||
if (_activeStory == _currentLocalInkLocation.Story)
|
||||
{
|
||||
// END inside location-based story thread, restart the story
|
||||
_activeStory.ResetState();
|
||||
|
|
@ -93,7 +95,7 @@ public class LocalMenu : MonoBehaviour
|
|||
else
|
||||
{
|
||||
// END inside quest content, switch back to location thread and present choices
|
||||
_activeStory = _currentLocation.Story;
|
||||
_activeStory = _currentLocalInkLocation.Story;
|
||||
Continue();
|
||||
}
|
||||
}
|
||||
|
|
@ -103,10 +105,10 @@ public class LocalMenu : MonoBehaviour
|
|||
|
||||
void PresentCurrentChoices()
|
||||
{
|
||||
Debug.Log($"Current Path: \"{_currentPath}\" in {(_activeStory == _currentLocation.Story ? "Location Story" : "Quest Story")}");
|
||||
if(!string.IsNullOrEmpty(_currentPath) && _currentLocation.KnotQuests.ContainsKey(_currentPath))
|
||||
Debug.Log($"Current Path: \"{_currentPath}\" in {(_activeStory == _currentLocalInkLocation.Story ? "Location Story" : "Quest Story")}");
|
||||
if(!string.IsNullOrEmpty(_currentPath) && _currentLocalInkLocation.KnotQuests.ContainsKey(_currentPath))
|
||||
{
|
||||
foreach (var quest in _currentLocation.KnotQuests[_currentPath])
|
||||
foreach (var quest in _currentLocalInkLocation.KnotQuests[_currentPath])
|
||||
{
|
||||
if (quest.Story == _activeStory) continue; // Don't repeat choices for active injected branch
|
||||
|
||||
|
|
@ -188,23 +190,26 @@ public class LocalMenu : MonoBehaviour
|
|||
|
||||
private string ResolveLocationLabel()
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(_currentLocation?.Name))
|
||||
return _currentLocation.Name;
|
||||
if (!string.IsNullOrWhiteSpace(_currentLocation?.FileName))
|
||||
return _currentLocation.FileName;
|
||||
if (!string.IsNullOrWhiteSpace(_currentLocalInkLocation?.Name))
|
||||
return _currentLocalInkLocation.Name;
|
||||
if (!string.IsNullOrWhiteSpace(_currentLocalInkLocation?.FileName))
|
||||
return _currentLocalInkLocation.FileName;
|
||||
return "Local";
|
||||
}
|
||||
|
||||
private bool TryResolveDockedLocalStory(out LocationStory story)
|
||||
private bool TryResolveDockedLocalInkStory(out LocationStory story)
|
||||
{
|
||||
story = null;
|
||||
var docking = CurrentDockingSnapshot();
|
||||
if (_observedEntityIndex == null ||
|
||||
// Ink story execution is still a Unity-local island. The docking identity
|
||||
// comes from managed typed state; the remaining object lookup should go
|
||||
// away when local story state becomes a daemon-owned CultMesh document.
|
||||
if (_presentationEntityIndex == null ||
|
||||
docking == null ||
|
||||
!docking.IsDocked ||
|
||||
string.IsNullOrWhiteSpace(docking.DockParentEntityKey) ||
|
||||
docking.DockingBayIndex < 0 ||
|
||||
!_observedEntityIndex.TryResolveDockingBayByRecordKey(
|
||||
!_presentationEntityIndex.TryGetPresentationDockingBayByRecordKey(
|
||||
docking.DockParentEntityKey,
|
||||
docking.DockingBayIndex,
|
||||
out var dockingBay) ||
|
||||
|
|
@ -217,11 +222,12 @@ public class LocalMenu : MonoBehaviour
|
|||
return true;
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeCurrentDockingDocument CurrentDockingSnapshot()
|
||||
private AetheriaRuntimeCurrentDockingDocument CurrentDockingSnapshot()
|
||||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.CurrentDockingState("unity-local-menu");
|
||||
_runtimeState ??= AetheriaUnityRuntimeClientProvider.RuntimeState("unity-local-menu");
|
||||
return _runtimeState.CurrentDocking.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Mesh;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using Unity.Mathematics;
|
||||
|
|
@ -33,6 +34,7 @@ public class MapRenderer : MonoBehaviour
|
|||
public RawImage RtsIconPrototype;
|
||||
public float Scale;
|
||||
public float2 Position;
|
||||
private AetheriaClientState _runtimeState;
|
||||
public float IconSize = 1f/128;
|
||||
|
||||
private RectTransform _rect;
|
||||
|
|
@ -307,9 +309,8 @@ public class MapRenderer : MonoBehaviour
|
|||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider
|
||||
.CurrentPlayerSettings("unity-map-renderer")
|
||||
?.ShowAsteroidsInMinimap ?? false;
|
||||
_runtimeState ??= AetheriaUnityRuntimeClientProvider.RuntimeState("unity-map-renderer");
|
||||
return _runtimeState.PlayerSettings.Latest()?.ShowAsteroidsInMinimap ?? false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ using System.Linq;
|
|||
using GameCult.Aetheria.EveRuntime;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Eve.Surface;
|
||||
using GameCult.Mesh;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
|
|
@ -34,6 +35,7 @@ public class MenuPanel : MonoBehaviour
|
|||
private MenuTabBinding _current;
|
||||
private UIDocument _tabSurfaceDocument;
|
||||
private readonly AetheriaEveUnitySurfaceChrome _tabSurfaceChrome = new AetheriaEveUnitySurfaceChrome();
|
||||
private AetheriaClientState _runtimeState;
|
||||
|
||||
public MenuTab CurrentTab { get; private set; }
|
||||
|
||||
|
|
@ -157,12 +159,13 @@ public class MenuPanel : MonoBehaviour
|
|||
.ToArray();
|
||||
}
|
||||
|
||||
private static bool TryResolveCurrentDocking(out AetheriaRuntimeCurrentDockingDocument docking)
|
||||
private bool TryResolveCurrentDocking(out AetheriaRuntimeCurrentDockingDocument docking)
|
||||
{
|
||||
docking = null;
|
||||
try
|
||||
{
|
||||
docking = AetheriaUnityRuntimeClientProvider.CurrentDockingState("unity-runtime-menu-tabs");
|
||||
_runtimeState ??= AetheriaUnityRuntimeClientProvider.RuntimeState("unity-runtime-menu-tabs");
|
||||
docking = _runtimeState.CurrentDocking.Latest();
|
||||
return docking != null;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Mesh;
|
||||
using TMPro;
|
||||
using UniRx;
|
||||
using UnityEngine;
|
||||
|
|
@ -33,6 +34,7 @@ public class SectorMap : MonoBehaviour
|
|||
public Texture2D HomeIcon;
|
||||
public Prototype LegendPrototype;
|
||||
public float IconDistance = 1;
|
||||
private AetheriaClientState _runtimeState;
|
||||
public float IconBackgroundSize = 3;
|
||||
public float LabelDistance = .4f;
|
||||
public float LinkWidth;
|
||||
|
|
@ -219,8 +221,8 @@ public class SectorMap : MonoBehaviour
|
|||
|
||||
private void EnsureSectorMapLoaded()
|
||||
{
|
||||
_sectorMap = AetheriaUnityRuntimeClientProvider
|
||||
.CurrentSectorMap("unity-sector-map");
|
||||
_runtimeState ??= AetheriaUnityRuntimeClientProvider.RuntimeState("unity-sector-map");
|
||||
_sectorMap = _runtimeState.SectorMap.Latest();
|
||||
|
||||
if (_sectorMapLoaded)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using GameCult.Aetheria.EveRuntime;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Eve.Surface;
|
||||
using GameCult.Mesh;
|
||||
using UniRx;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
|
@ -45,6 +44,7 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
private float _sectorBackgroundDepth;
|
||||
private float _sectorCameraDepth;
|
||||
private UIDocument _zoneDetailsSurfaceDocument;
|
||||
private AetheriaClientState _runtimeState;
|
||||
private readonly AetheriaEveUnitySurfaceChrome _zoneDetailsSurfaceChrome = new AetheriaEveUnitySurfaceChrome
|
||||
{
|
||||
RootAlignItems = Align.FlexEnd,
|
||||
|
|
@ -61,6 +61,8 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
|
||||
private float2 _position = float2(0.5f);
|
||||
private float _viewSize = .5f;
|
||||
|
||||
private AetheriaClientState RuntimeState => _runtimeState ??= AetheriaUnityRuntimeClientProvider.RuntimeState("unity-sector-renderer");
|
||||
|
||||
void Start()
|
||||
{
|
||||
|
|
@ -86,32 +88,15 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
|
||||
private void RenderZoneDetailsSurface(int zoneIndex)
|
||||
{
|
||||
var sectorZone = ResolveSectorZone(zoneIndex);
|
||||
var zoneDetails = ResolveZoneDetails(zoneIndex);
|
||||
var ownerFactionIndex = sectorZone?.OwnerFactionIndex ?? -1;
|
||||
var otherFactions = (sectorZone?.FactionIndices ?? Array.Empty<int>())
|
||||
.Where(index => index >= 0 && index != ownerFactionIndex)
|
||||
.Distinct()
|
||||
.Select(FormatFaction)
|
||||
.ToArray();
|
||||
var zoneFacts = AetheriaRuntimeZoneDetailsSurfaceBuilder.Facts(
|
||||
zoneDetails,
|
||||
ResolveHullType);
|
||||
var surface = ResolveZoneDetailsSurface(zoneIndex);
|
||||
if (surface == null)
|
||||
return;
|
||||
|
||||
_zoneDetailsSurfaceDocument = AetheriaEveUnitySurfaceHost.RenderRuntime(
|
||||
transform,
|
||||
_zoneDetailsSurfaceDocument,
|
||||
"Aetheria Sector Zone Details Surface",
|
||||
AetheriaRuntimeZoneDetailsSurfaceBuilder.Build(
|
||||
ResolveZoneName(sectorZone, zoneDetails),
|
||||
ownerFactionIndex >= 0 ? FormatFaction(ownerFactionIndex) : "None",
|
||||
FormatValue((float)zoneFacts.Mass),
|
||||
FormatValue((float)zoneFacts.Radius),
|
||||
otherFactions,
|
||||
zoneFacts.Bodies,
|
||||
zoneFacts.Entities,
|
||||
zoneFacts.HasContents,
|
||||
DateTime.UtcNow.ToString("O")),
|
||||
surface,
|
||||
HandleZoneDetailsSurfaceCommand,
|
||||
_zoneDetailsSurfaceChrome);
|
||||
}
|
||||
|
|
@ -141,105 +126,22 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
AetheriaEveUnitySurfaceHost.Hide(_zoneDetailsSurfaceDocument);
|
||||
}
|
||||
|
||||
private string ResolveZoneName(
|
||||
AetheriaRuntimeSectorMapZone sectorZone,
|
||||
AetheriaRuntimeZoneDetailsDocument zoneDetails)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(zoneDetails?.ZoneName))
|
||||
return zoneDetails.ZoneName;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(sectorZone?.Name))
|
||||
return sectorZone.Name;
|
||||
|
||||
return sectorZone == null ? "Unknown" : $"Zone {sectorZone.ZoneIndex}";
|
||||
}
|
||||
|
||||
private AetheriaRuntimeSectorMapZone ResolveSectorZone(int zoneIndex)
|
||||
private AetheriaRuntimeSurfaceDocument ResolveZoneDetailsSurface(int zoneIndex)
|
||||
{
|
||||
if (zoneIndex < 0)
|
||||
return null;
|
||||
|
||||
try
|
||||
{
|
||||
var sectorMap = AetheriaUnityRuntimeClientProvider.CurrentSectorMap("unity-sector-renderer");
|
||||
return (sectorMap?.Zones ?? Array.Empty<AetheriaRuntimeSectorMapZone>())
|
||||
.FirstOrDefault(zone => zone.ZoneIndex == zoneIndex);
|
||||
return RuntimeState.ZoneDetailsSurface(zoneIndex).Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogWarning($"Failed to read Aetheria sector map zone from local Verse state: {ex.Message}");
|
||||
Debug.LogWarning($"Failed to read Aetheria sector zone details surface from local Verse state: {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static string FormatFaction(int factionIndex)
|
||||
{
|
||||
return factionIndex < 0 ? "None" : $"Faction {factionIndex}";
|
||||
}
|
||||
|
||||
private AetheriaRuntimeZoneDetailsDocument ResolveZoneDetails(int zoneIndex)
|
||||
{
|
||||
if (zoneIndex < 0)
|
||||
return null;
|
||||
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.CurrentZoneDetails(zoneIndex, "unity-sector-renderer");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogWarning($"Failed to read Aetheria sector zone details from local Verse state: {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private string ResolveHullType(string hullItemKey)
|
||||
{
|
||||
var typedHull = ResolveCatalog()?.FindItem(hullItemKey ?? "");
|
||||
return typedHull?.HullType ?? "";
|
||||
}
|
||||
|
||||
private AetheriaRuntimeCatalogSnapshot ResolveCatalog()
|
||||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.CurrentCatalog("unity-sector-renderer");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogWarning($"Failed to read Aetheria sector catalog from local Verse state: {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private AetheriaRuntimePlayerSettingsDocument ResolvePlayerSettings()
|
||||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.CurrentPlayerSettings("unity-sector-renderer");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.LogWarning($"Failed to read Aetheria sector player settings from local Verse state: {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private string FormatValue(float value)
|
||||
{
|
||||
var digits = ResolvePlayerSettings()?.SignificantDigits ?? 3;
|
||||
var magnitude = value == 0f ? 0 : (int)Math.Floor(Math.Log10(Math.Abs(value))) + 1;
|
||||
digits -= magnitude;
|
||||
if (digits < 0)
|
||||
digits = 0;
|
||||
|
||||
var formatted = value.ToString($"N{digits}");
|
||||
var decimalSeparator = Convert.ToChar(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator);
|
||||
return formatted.Contains(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator)
|
||||
? formatted.TrimEnd('0').TrimEnd(decimalSeparator)
|
||||
: formatted;
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
_init = true;
|
||||
|
|
@ -259,7 +161,7 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.CurrentZoneState("unity-sector-renderer");
|
||||
return RuntimeState.CurrentZone.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -299,7 +201,7 @@ public class SectorRenderer : MonoBehaviour, IBeginDragHandler, IDragHandler, IS
|
|||
{
|
||||
_outputTexture.Release();
|
||||
}
|
||||
_outputTexture = new RenderTexture(_size.x, _size.y, 0, RenderTextureFormat.Default);
|
||||
_outputTexture = new RenderTexture(_size.x, _size.y, 16, RenderTextureFormat.Default);
|
||||
SectorCamera.targetTexture = _outputTexture;
|
||||
_outputImage.material.SetTexture("_DetailTex", _outputTexture);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using System.Text.RegularExpressions;
|
|||
using GameCult.Aetheria.EveRuntime;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Eve.Surface;
|
||||
using GameCult.Mesh;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
|
@ -28,6 +29,7 @@ public class TradeMenu : MonoBehaviour
|
|||
private string _targetCargoEntityKey = "";
|
||||
private int _targetCargoIndex = -1;
|
||||
private string _targetCargoLabel = "Docking Bay";
|
||||
private AetheriaClientState _runtimeState;
|
||||
private (ItemFilter filter, HardpointType type) _hardpointFilter;
|
||||
private (ItemFilter filter, SimpleCommodityCategory type) _commodityFilter;
|
||||
private (ItemFilter filter, CompoundCommodityCategory type) _compoundCommodityFilter;
|
||||
|
|
@ -46,6 +48,8 @@ public class TradeMenu : MonoBehaviour
|
|||
private AetheriaRuntimeTradeFilterSurfaceModel _filterSurfaceModel;
|
||||
private Action[] _rowActionCallbacks = Array.Empty<Action>();
|
||||
private AetheriaRuntimeTradeRowActionSurfaceModel _rowActionSurfaceModel;
|
||||
|
||||
private AetheriaClientState RuntimeState => _runtimeState ??= AetheriaUnityRuntimeClientProvider.RuntimeState("unity-trade");
|
||||
|
||||
public EquippedCargoBay Inventory { get; set; }
|
||||
|
||||
|
|
@ -504,7 +508,7 @@ public class TradeMenu : MonoBehaviour
|
|||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.CurrentStationRefit("unity-trade");
|
||||
return RuntimeState.StationRefit.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -518,7 +522,7 @@ public class TradeMenu : MonoBehaviour
|
|||
docking = null;
|
||||
try
|
||||
{
|
||||
docking = AetheriaUnityRuntimeClientProvider.CurrentDockingState("unity-trade");
|
||||
docking = RuntimeState.CurrentDocking.Latest();
|
||||
return docking != null;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
@ -577,7 +581,7 @@ public class TradeMenu : MonoBehaviour
|
|||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.CurrentCatalog("unity-trade");
|
||||
return RuntimeState.Catalog.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -590,7 +594,7 @@ public class TradeMenu : MonoBehaviour
|
|||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider.CurrentPlayerSettings("unity-trade");
|
||||
return RuntimeState.PlayerSettings.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@ using System.Linq;
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Mesh;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.RenderGraphModule;
|
||||
|
||||
/// <summary>
|
||||
/// Based on github.com/yangrc1234/VolumeCloud
|
||||
|
|
@ -33,11 +35,11 @@ public class HaltonSequence
|
|||
/// <summary>
|
||||
/// Cloud renderer post processing.
|
||||
/// </summary>
|
||||
[ImageEffectAllowedInSceneView]
|
||||
[ExecuteInEditMode,RequireComponent(typeof(Camera))]
|
||||
[ImageEffectOpaque]
|
||||
public class VolumeCloudRenderer : EffectBase
|
||||
{
|
||||
private static readonly Dictionary<Camera, VolumeCloudRenderer> RenderersByCamera = new Dictionary<Camera, VolumeCloudRenderer>();
|
||||
|
||||
[Header("Render Settings")]
|
||||
[Range(0, 2)]
|
||||
public int downSample = 1;
|
||||
|
|
@ -50,16 +52,73 @@ public class VolumeCloudRenderer : EffectBase
|
|||
private Matrix4x4 prevV;
|
||||
private Camera mcam;
|
||||
private HaltonSequence sequence = new HaltonSequence() { radix = 3 };
|
||||
private const int TemporalHistoryVersion = 4;
|
||||
private int appliedTemporalHistoryVersion = -1;
|
||||
// The index of 4x4 pixels.
|
||||
private int frameIndex = 0;
|
||||
private bool firstFrame = true;
|
||||
private AetheriaClientState _runtimeState;
|
||||
private int _debugRenderCount;
|
||||
private int _debugLastRenderFrame = -1;
|
||||
|
||||
[SerializeField]
|
||||
private Shader cloudShader;
|
||||
|
||||
[SerializeField]
|
||||
private Texture2D ditherTexture;
|
||||
|
||||
public static bool TryGetRenderer(Camera camera, out VolumeCloudRenderer renderer)
|
||||
{
|
||||
renderer = null;
|
||||
return camera != null
|
||||
&& RenderersByCamera.TryGetValue(camera, out renderer)
|
||||
&& renderer != null
|
||||
&& renderer.isActiveAndEnabled;
|
||||
}
|
||||
|
||||
public int DebugRenderCount => _debugRenderCount;
|
||||
public int DebugLastRenderFrame => _debugLastRenderFrame;
|
||||
public RenderTexture DebugUndersampleBuffer => undersampleBuffer;
|
||||
public RenderTexture DebugHistoryBuffer => fullBuffer != null && fullBuffer.Length > 0 ? fullBuffer[fullBufferIndex] : null;
|
||||
public RenderTexture DebugCurrentCloudBuffer => fullBuffer != null && fullBuffer.Length > 1 ? fullBuffer[fullBufferIndex ^ 1] : null;
|
||||
public bool DebugFirstFrame => firstFrame;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
var camera = GetComponent<Camera>();
|
||||
if (camera != null)
|
||||
RenderersByCamera[camera] = this;
|
||||
ResetTemporalHistory();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
var camera = GetComponent<Camera>();
|
||||
if (camera != null && RenderersByCamera.TryGetValue(camera, out var renderer) && renderer == this)
|
||||
RenderersByCamera.Remove(camera);
|
||||
}
|
||||
|
||||
void EnsureMaterial(bool force = false) {
|
||||
if (cloudShader == null)
|
||||
cloudShader = Shader.Find("Aetheria/CloudShader");
|
||||
|
||||
if (mat == null || force) {
|
||||
mat = new Material(cloudShader);
|
||||
ResetTemporalHistory();
|
||||
}
|
||||
}
|
||||
|
||||
private void ResetTemporalHistory()
|
||||
{
|
||||
firstFrame = true;
|
||||
appliedTemporalHistoryVersion = TemporalHistoryVersion;
|
||||
if (fullBuffer != null)
|
||||
{
|
||||
for (var i = 0; i < fullBuffer.Length; i++)
|
||||
{
|
||||
if (fullBuffer[i] != null)
|
||||
fullBuffer[i].DiscardContents();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -94,8 +153,8 @@ public class VolumeCloudRenderer : EffectBase
|
|||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider
|
||||
.CurrentPlayerSettings("unity-volume-cloud-renderer");
|
||||
_runtimeState ??= AetheriaUnityRuntimeClientProvider.RuntimeState("unity-volume-cloud-renderer");
|
||||
return _runtimeState.PlayerSettings.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
@ -105,31 +164,73 @@ public class VolumeCloudRenderer : EffectBase
|
|||
return null;
|
||||
}
|
||||
|
||||
[ImageEffectOpaque]
|
||||
private void OnRenderImage(RenderTexture source, RenderTexture destination) {
|
||||
if (cloudShader == null) {
|
||||
Graphics.Blit(source, destination);
|
||||
return;
|
||||
}
|
||||
|
||||
public void RenderClouds(UnsafeCommandBuffer cmd, Camera camera, TextureHandle colorTarget, TextureHandle depthTarget)
|
||||
{
|
||||
mcam = GetComponent<Camera>();
|
||||
if (camera != mcam || cloudShader == null)
|
||||
return;
|
||||
|
||||
_debugRenderCount++;
|
||||
_debugLastRenderFrame = Time.frameCount;
|
||||
|
||||
var width = mcam.pixelWidth >> downSample;
|
||||
var height = mcam.pixelHeight >> downSample;
|
||||
if (width <= 0 || height <= 0)
|
||||
return;
|
||||
|
||||
this.EnsureMaterial();
|
||||
EnsureMaterial();
|
||||
EnsureDitherTexture();
|
||||
|
||||
if (appliedTemporalHistoryVersion != TemporalHistoryVersion)
|
||||
ResetTemporalHistory();
|
||||
|
||||
EnsureArray(ref fullBuffer, 2);
|
||||
firstFrame |= EnsureRenderTarget(ref fullBuffer[0], width, height, RenderTextureFormat.ARGBFloat, FilterMode.Bilinear);
|
||||
firstFrame |= EnsureRenderTarget(ref fullBuffer[1], width, height, RenderTextureFormat.ARGBFloat, FilterMode.Bilinear);
|
||||
firstFrame |= EnsureRenderTarget(ref undersampleBuffer, width , height, RenderTextureFormat.ARGBFloat, FilterMode.Bilinear);
|
||||
firstFrame |= EnsureRenderTarget(ref undersampleBuffer, width, height, RenderTextureFormat.ARGBFloat, FilterMode.Bilinear);
|
||||
|
||||
frameIndex = (frameIndex + 1)% 16;
|
||||
frameIndex = (frameIndex + 1) % 16;
|
||||
fullBufferIndex = (fullBufferIndex + 1) % 2;
|
||||
|
||||
/* Some code is from playdead TAA. */
|
||||
ApplyQualityKeywords();
|
||||
|
||||
//1. Pass1, Render a undersampled buffer. The buffer is dithered using blue noise and halton sequence.
|
||||
//If it's first frame, force a high quality sample to make the initial history buffer good enough.
|
||||
var gpuProjection = GL.GetGPUProjectionMatrix(mcam.projectionMatrix, true);
|
||||
mat.SetMatrix("_CamInvProj", (gpuProjection * mcam.worldToCameraMatrix).inverse);
|
||||
mat.SetVector("_ProjectionExtents", mcam.GetProjectionExtents());
|
||||
mat.SetFloat("_RaymarchOffset", sequence.Get());
|
||||
mat.SetVector("_TexelSize", undersampleBuffer.texelSize);
|
||||
mat.SetFloat("_ResetHistory", firstFrame ? 1.0f : 0.0f);
|
||||
|
||||
mat.SetTexture("_UndersampleCloudTex", undersampleBuffer);
|
||||
mat.SetMatrix("_PrevVP", gpuProjection * prevV);
|
||||
|
||||
cmd.SetRenderTarget(undersampleBuffer);
|
||||
cmd.SetViewport(new Rect(0, 0, width, height));
|
||||
cmd.ClearRenderTarget(false, true, Color.clear);
|
||||
cmd.DrawProcedural(Matrix4x4.identity, mat, 0, MeshTopology.Triangles, 3, 1);
|
||||
|
||||
mat.SetTexture("_MainTex", firstFrame ? undersampleBuffer : fullBuffer[fullBufferIndex]);
|
||||
|
||||
cmd.SetRenderTarget(fullBuffer[fullBufferIndex ^ 1]);
|
||||
cmd.SetViewport(new Rect(0, 0, width, height));
|
||||
cmd.ClearRenderTarget(false, true, Color.clear);
|
||||
cmd.DrawProcedural(Matrix4x4.identity, mat, 1, MeshTopology.Triangles, 3, 1);
|
||||
|
||||
mat.SetTexture("_CloudTex", fullBuffer[fullBufferIndex ^ 1]);
|
||||
|
||||
if (depthTarget.IsValid())
|
||||
cmd.SetRenderTarget(colorTarget, depthTarget);
|
||||
else
|
||||
cmd.SetRenderTarget(colorTarget);
|
||||
cmd.SetViewport(mcam.pixelRect);
|
||||
cmd.DrawProcedural(Matrix4x4.identity, mat, 2, MeshTopology.Triangles, 3, 1);
|
||||
|
||||
prevV = mcam.worldToCameraMatrix;
|
||||
firstFrame = false;
|
||||
}
|
||||
|
||||
private void ApplyQualityKeywords()
|
||||
{
|
||||
if (firstFrame || quality == Quality.Ultra) {
|
||||
mat.EnableKeyword("ULTRA_QUALITY");
|
||||
mat.DisableKeyword("HIGH_QUALITY");
|
||||
|
|
@ -151,30 +252,22 @@ public class VolumeCloudRenderer : EffectBase
|
|||
mat.DisableKeyword("MEDIUM_QUALITY");
|
||||
mat.EnableKeyword("LOW_QUALITY");
|
||||
}
|
||||
|
||||
mat.SetMatrix("_CamInvProj", (Camera.current.projectionMatrix * Camera.current.worldToCameraMatrix).inverse);
|
||||
mat.SetVector("_ProjectionExtents", mcam.GetProjectionExtents());
|
||||
mat.SetFloat("_RaymarchOffset", sequence.Get());
|
||||
mat.SetVector("_TexelSize", undersampleBuffer.texelSize);
|
||||
|
||||
Graphics.Blit(null, undersampleBuffer, mat, 0);
|
||||
|
||||
//2. Pass 2, blend undersampled image with history buffer to new buffer.
|
||||
mat.SetTexture("_UndersampleCloudTex", undersampleBuffer);
|
||||
mat.SetMatrix("_PrevVP", GL.GetGPUProjectionMatrix(mcam.projectionMatrix,false) * prevV);
|
||||
mat.SetVector("_ProjectionExtents", mcam.GetProjectionExtents());
|
||||
|
||||
if (firstFrame) { //Wait, is this the first frame? If it is, the history buffer is empty yet. It will cause glitch if we use it directly. Fill it using the undersample buffer.
|
||||
Graphics.Blit(undersampleBuffer, fullBuffer[fullBufferIndex]);
|
||||
}
|
||||
Graphics.Blit(fullBuffer[fullBufferIndex], fullBuffer[fullBufferIndex ^ 1], mat, 1);
|
||||
|
||||
//3. Pass3, Calculate lighting, blend final cloud image with final image.
|
||||
mat.SetTexture("_CloudTex", fullBuffer[fullBufferIndex ^ 1]);
|
||||
Graphics.Blit(source, destination, mat, 2);
|
||||
|
||||
//4. Cleanup
|
||||
prevV = mcam.worldToCameraMatrix;
|
||||
firstFrame = false;
|
||||
}
|
||||
|
||||
private void EnsureDitherTexture()
|
||||
{
|
||||
if (ditherTexture == null)
|
||||
ditherTexture = Resources.Load<Texture2D>("LDR_LLL1_0");
|
||||
|
||||
if (ditherTexture == null)
|
||||
return;
|
||||
|
||||
Shader.SetGlobalTexture("_DitheringTex", ditherTexture);
|
||||
Shader.SetGlobalVector("_DitheringCoords", new Vector4(
|
||||
(float)Math.Max(1, Screen.width) / ditherTexture.width,
|
||||
(float)Math.Max(1, Screen.height) / ditherTexture.height,
|
||||
0,
|
||||
0));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ using UnityEngine.Rendering;
|
|||
using UnityEngine.Serialization;
|
||||
using static Unity.Mathematics.math;
|
||||
using static Unity.Mathematics.noise;
|
||||
using System.Collections.Generic;
|
||||
|
||||
/// <summary>
|
||||
/// Drives the volume render.
|
||||
|
|
@ -19,6 +20,7 @@ using static Unity.Mathematics.noise;
|
|||
[RequireComponent( typeof( Camera ) )]
|
||||
public class VolumeSampling : MonoBehaviour
|
||||
{
|
||||
private static readonly List<VolumeSampling> ActiveSamplers = new List<VolumeSampling>();
|
||||
public Transform GridMesh;
|
||||
public Camera GridCamera;
|
||||
public GameSettings Settings;
|
||||
|
|
@ -29,16 +31,58 @@ public class VolumeSampling : MonoBehaviour
|
|||
public RenderTexture NebulaTint;
|
||||
public AetheriaUnityRenderSplatViewportSource SplatViewportSource;
|
||||
public AetheriaRenderSplatLayerRenderer SplatLayerRenderer;
|
||||
public AetheriaSceneRenderSplatSource SceneSplatSource;
|
||||
|
||||
[SerializeField]
|
||||
private bool useRuntimeRenderSplats;
|
||||
|
||||
[SerializeField]
|
||||
private bool renderSplatsEveryFrame;
|
||||
|
||||
[SerializeField]
|
||||
private float splatRenderIntervalSeconds = 0.25f;
|
||||
|
||||
private MeshRenderer _gridMeshRenderer;
|
||||
private float _flowScroll;
|
||||
private Transform _gridTransform;
|
||||
private Camera _ownerCamera;
|
||||
private Vector2 _lastSplatCenter;
|
||||
private Vector2 _lastSplatSize;
|
||||
private Vector2 _publishedSplatCenter;
|
||||
private Vector2 _publishedSplatSize;
|
||||
private float _nextSplatRenderTime;
|
||||
private bool _hasRenderedSplats;
|
||||
private GlobalKeyword _keywordFlowGlobal;
|
||||
private GlobalKeyword _keywordFlowSlope;
|
||||
private GlobalKeyword _keywordNoiseSlope;
|
||||
|
||||
public static void RenderForCamera(Camera camera)
|
||||
{
|
||||
if (camera == null)
|
||||
return;
|
||||
|
||||
for (var i = 0; i < ActiveSamplers.Count; i++)
|
||||
{
|
||||
var sampler = ActiveSamplers[i];
|
||||
if (sampler != null && sampler.TargetsCamera(camera))
|
||||
sampler.RenderSamplingPass();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (!ActiveSamplers.Contains(this))
|
||||
ActiveSamplers.Add(this);
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
ActiveSamplers.Remove(this);
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_ownerCamera = GetComponent<Camera>();
|
||||
_keywordFlowGlobal = GlobalKeyword.Create("FLOW_GLOBAL");
|
||||
_keywordFlowSlope = GlobalKeyword.Create("FLOW_SLOPE");
|
||||
_keywordNoiseSlope = GlobalKeyword.Create("NOISE_SLOPE");
|
||||
|
|
@ -53,12 +97,28 @@ public class VolumeSampling : MonoBehaviour
|
|||
{
|
||||
if(_gridTransform==null)
|
||||
_gridTransform = GridCamera?.transform;
|
||||
// Shader needs to know the position and scale of cameras used to render input textures
|
||||
if(GridCamera != null)
|
||||
Shader.SetGlobalVector("_GridTransform", new Vector4(_gridTransform.position.x,_gridTransform.position.z,GridCamera.orthographicSize*2));
|
||||
|
||||
RenderSplatTextures();
|
||||
_flowScroll += Settings.DefaultEnvironment.Flow.GlobalScrollSpeed * Time.deltaTime;
|
||||
UpdateGridMeshBounds();
|
||||
}
|
||||
|
||||
private bool TargetsCamera(Camera camera)
|
||||
{
|
||||
_ownerCamera ??= GetComponent<Camera>();
|
||||
return camera == _ownerCamera;
|
||||
}
|
||||
|
||||
private void RenderSamplingPass()
|
||||
{
|
||||
if (_gridTransform == null)
|
||||
_gridTransform = GridCamera?.transform;
|
||||
|
||||
RenderSplatTexturesIfNeeded();
|
||||
PublishSamplingGlobals();
|
||||
}
|
||||
|
||||
private void UpdateGridMeshBounds()
|
||||
{
|
||||
var environment = Settings.DefaultEnvironment;
|
||||
|
||||
if (GridMesh != null)
|
||||
|
|
@ -70,7 +130,19 @@ public class VolumeSampling : MonoBehaviour
|
|||
// GridMesh.position = new Vector3(_gridTransform.position.x, environment.Grid.Offset, _gridTransform.position.z);
|
||||
// GridMesh.localScale = new Vector3(GridCamera.orthographicSize, 1, GridCamera.orthographicSize);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void PublishSamplingGlobals()
|
||||
{
|
||||
var environment = Settings.DefaultEnvironment;
|
||||
|
||||
ResolveSplatViewport(out var center, out var size);
|
||||
_publishedSplatCenter = center;
|
||||
_publishedSplatSize = size;
|
||||
|
||||
// Shader sampling must use the same world-space viewport that produced the splat textures.
|
||||
Shader.SetGlobalVector("_GridTransform", new Vector4(center.x, center.y, size.x));
|
||||
|
||||
// Volumetric sampling parameters are used by several shaders
|
||||
Shader.SetGlobalTexture("_NebulaSurfaceHeight", NebulaSurfaceHeight);
|
||||
Shader.SetGlobalTexture("_NebulaPatchHeight", NebulaPatchHeight);
|
||||
|
|
@ -105,7 +177,6 @@ public class VolumeSampling : MonoBehaviour
|
|||
Shader.SetGlobalFloat("_FlowAmplitude", environment.Flow.GlobalAmplitude);
|
||||
Shader.SetGlobalFloat("_FlowSlopeAmplitude", environment.Flow.SlopeAmplitude);
|
||||
Shader.SetGlobalFloat("_FlowSwirlAmplitude", environment.Flow.SwirlAmplitude);
|
||||
_flowScroll += environment.Flow.GlobalScrollSpeed * Time.deltaTime;
|
||||
Shader.SetGlobalFloat("_FlowScroll", _flowScroll);
|
||||
Shader.SetGlobalFloat("_FlowPeriod", environment.Flow.Period);
|
||||
|
||||
|
|
@ -114,20 +185,33 @@ public class VolumeSampling : MonoBehaviour
|
|||
Shader.SetKeyword(_keywordNoiseSlope, environment.Noise.SlopeExponent != 0);
|
||||
}
|
||||
|
||||
private void RenderSplatTextures()
|
||||
private void RenderSplatTexturesIfNeeded()
|
||||
{
|
||||
ResolveSplatRenderers();
|
||||
if (SplatViewportSource == null)
|
||||
if (SplatLayerRenderer == null)
|
||||
return;
|
||||
|
||||
var size = GridCamera != null
|
||||
? new Vector2(GridCamera.orthographicSize * 2, GridCamera.orthographicSize * 2)
|
||||
: new Vector2(1024, 1024);
|
||||
var center = _gridTransform != null
|
||||
? new Vector2(_gridTransform.position.x, _gridTransform.position.z)
|
||||
: Vector2.zero;
|
||||
SplatViewportSource.SetViewport(center, size);
|
||||
SplatViewportSource.RenderLatest();
|
||||
ResolveSplatViewport(out var center, out var size);
|
||||
var document = ResolveSceneSplatDocument(center, size);
|
||||
if (document == null && useRuntimeRenderSplats)
|
||||
document = ResolveRuntimeSplatDocument(center, size);
|
||||
if (document == null)
|
||||
return;
|
||||
|
||||
var viewportChanged = !_hasRenderedSplats ||
|
||||
!Approximately(center, _lastSplatCenter) ||
|
||||
!Approximately(size, _lastSplatSize);
|
||||
var intervalElapsed = Time.unscaledTime >= _nextSplatRenderTime;
|
||||
if (!renderSplatsEveryFrame && !viewportChanged && !intervalElapsed)
|
||||
return;
|
||||
|
||||
SplatLayerRenderer.Render(document, Mathf.RoundToInt(size.x), Mathf.RoundToInt(size.y));
|
||||
_lastSplatCenter = center;
|
||||
_lastSplatSize = size;
|
||||
_publishedSplatCenter = center;
|
||||
_publishedSplatSize = size;
|
||||
_nextSplatRenderTime = Time.unscaledTime + Mathf.Max(0.02f, splatRenderIntervalSeconds);
|
||||
_hasRenderedSplats = true;
|
||||
|
||||
if (SplatLayerRenderer == null)
|
||||
return;
|
||||
|
|
@ -138,6 +222,52 @@ public class VolumeSampling : MonoBehaviour
|
|||
NebulaTint = ResolveLayerTexture(AetheriaRuntimeRenderSplatLayerKeys.FogTint, NebulaTint);
|
||||
}
|
||||
|
||||
private AetheriaRuntimeRenderSplatsViewportDocument ResolveSceneSplatDocument(Vector2 center, Vector2 size)
|
||||
{
|
||||
if (SceneSplatSource == null)
|
||||
SceneSplatSource = GetComponent<AetheriaSceneRenderSplatSource>();
|
||||
return SceneSplatSource != null
|
||||
? SceneSplatSource.BuildDocument(BuildViewportBounds(center, size))
|
||||
: null;
|
||||
}
|
||||
|
||||
private AetheriaRuntimeRenderSplatsViewportDocument ResolveRuntimeSplatDocument(Vector2 center, Vector2 size)
|
||||
{
|
||||
if (SplatViewportSource == null)
|
||||
return null;
|
||||
|
||||
SplatViewportSource.SetViewport(center, size);
|
||||
return SplatViewportSource.CurrentDocument;
|
||||
}
|
||||
|
||||
private void ResolveSplatViewport(out Vector2 center, out Vector2 size)
|
||||
{
|
||||
size = GridCamera != null
|
||||
? new Vector2(GridCamera.orthographicSize * 2, GridCamera.orthographicSize * 2)
|
||||
: new Vector2(1024, 1024);
|
||||
center = _gridTransform != null
|
||||
? new Vector2(_gridTransform.position.x, _gridTransform.position.z)
|
||||
: Vector2.zero;
|
||||
}
|
||||
|
||||
private static AetheriaRuntimeRtsViewportBounds BuildViewportBounds(Vector2 center, Vector2 size)
|
||||
{
|
||||
var halfSize = size * 0.5f;
|
||||
return new AetheriaRuntimeRtsViewportBounds
|
||||
{
|
||||
MinX = center.x - halfSize.x,
|
||||
MinY = center.y - halfSize.y,
|
||||
MaxX = center.x + halfSize.x,
|
||||
MaxY = center.y + halfSize.y
|
||||
};
|
||||
}
|
||||
|
||||
private static bool Approximately(Vector2 lhs, Vector2 rhs)
|
||||
{
|
||||
return Mathf.Abs(lhs.x - rhs.x) < 0.001f &&
|
||||
Mathf.Abs(lhs.y - rhs.y) < 0.001f;
|
||||
}
|
||||
|
||||
private RenderTexture ResolveLayerTexture(string layerKey, RenderTexture fallback)
|
||||
{
|
||||
return SplatLayerRenderer.TryGetTexture(layerKey, out var texture) && texture != null
|
||||
|
|
@ -152,9 +282,13 @@ public class VolumeSampling : MonoBehaviour
|
|||
if (SplatLayerRenderer == null)
|
||||
SplatLayerRenderer = gameObject.AddComponent<AetheriaRenderSplatLayerRenderer>();
|
||||
|
||||
if (!useRuntimeRenderSplats)
|
||||
return;
|
||||
|
||||
if (SplatViewportSource == null)
|
||||
SplatViewportSource = GetComponent<AetheriaUnityRenderSplatViewportSource>();
|
||||
if (SplatViewportSource == null)
|
||||
SplatViewportSource = gameObject.AddComponent<AetheriaUnityRenderSplatViewportSource>();
|
||||
SplatViewportSource.RenderInLateUpdate = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using Cinemachine;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Mesh;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Serialization;
|
||||
using Object = UnityEngine.Object;
|
||||
|
|
@ -29,6 +30,7 @@ public class ZoneRenderer : MonoBehaviour
|
|||
public CinemachineVirtualCamera SceneCamera;
|
||||
public Camera[] FogCameras;
|
||||
public Camera[] MinimapCameras;
|
||||
private AetheriaClientState _runtimeState;
|
||||
public bool UseRenderSplatTextureLayers = true;
|
||||
public Material FogMaterial;
|
||||
public float FogFarFadeFraction = .125f;
|
||||
|
|
@ -1199,8 +1201,8 @@ public class ZoneRenderer : MonoBehaviour
|
|||
{
|
||||
try
|
||||
{
|
||||
return AetheriaUnityRuntimeClientProvider
|
||||
.CurrentCatalog("unity-zone-renderer");
|
||||
_runtimeState ??= AetheriaUnityRuntimeClientProvider.RuntimeState("unity-zone-renderer");
|
||||
return _runtimeState.Catalog.Latest();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
BIN
Assets/Settings/Rendering/AetheriaMainMenuVolumeProfile.asset
(Stored with Git LFS)
Normal file
BIN
Assets/Settings/Rendering/AetheriaMainMenuVolumeProfile.asset
(Stored with Git LFS)
Normal file
Binary file not shown.
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 621d661451ce43259c2e712812fc2a5c
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Settings/Rendering/AetheriaUniversalRenderer.asset
(Stored with Git LFS)
BIN
Assets/Settings/Rendering/AetheriaUniversalRenderer.asset
(Stored with Git LFS)
Binary file not shown.
BIN
Assets/Settings/Rendering/CustomPostProcessData.asset
(Stored with Git LFS)
Normal file
BIN
Assets/Settings/Rendering/CustomPostProcessData.asset
(Stored with Git LFS)
Normal file
Binary file not shown.
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5496e61d0bd534e4aae81b86f7e4d406
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,68 +1,83 @@
|
|||
Shader "Brushes/Power Brush" {
|
||||
Properties {
|
||||
_Color ("Color", Color) = (1,1,1,1)
|
||||
_Depth ("Depth", Float) = 0.5
|
||||
_Power("Power", Float) = 2
|
||||
_Cutoff("Cutoff", Range(0,1)) = 1
|
||||
}
|
||||
|
||||
Category {
|
||||
Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" }
|
||||
Blend One One
|
||||
ColorMask RGB
|
||||
Cull Off Lighting Off ZWrite Off
|
||||
|
||||
SubShader {
|
||||
Pass {
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert
|
||||
#pragma fragment frag
|
||||
#pragma target 2.0
|
||||
|
||||
#include "UnityCG.cginc"
|
||||
|
||||
fixed4 _Color;
|
||||
float _Depth;
|
||||
half _Power;
|
||||
half _Cutoff;
|
||||
|
||||
struct appdata_t {
|
||||
float4 vertex : POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct v2f {
|
||||
float4 vertex : SV_POSITION;
|
||||
fixed4 color : COLOR;
|
||||
float2 texcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
float4 _MainTex_ST;
|
||||
|
||||
v2f vert (appdata_t v)
|
||||
{
|
||||
v2f o;
|
||||
o.vertex = UnityObjectToClipPos(v.vertex);
|
||||
o.color = v.color;
|
||||
o.texcoord = v.texcoord;
|
||||
return o;
|
||||
}
|
||||
|
||||
float powerPulse( float x, float power )
|
||||
{
|
||||
x = saturate(abs(x))-.001;
|
||||
return pow((x + 1.0f) * (1.0f - x), power);
|
||||
}
|
||||
|
||||
fixed4 frag (v2f i) : SV_Target
|
||||
{
|
||||
float dist = length(i.texcoord-float2(.5,.5))*2;
|
||||
return _Depth * min(_Cutoff, powerPulse(dist,_Power)) * _Color * smoothstep(1, .95, dist);
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
}
|
||||
}
|
||||
Shader "Brushes/Power Brush"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_Color ("Color", Color) = (1,1,1,1)
|
||||
_Depth ("Depth", Float) = 0.5
|
||||
_Power ("Power", Float) = 2
|
||||
_Cutoff ("Cutoff", Range(0,1)) = 1
|
||||
}
|
||||
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue" = "Transparent"
|
||||
"IgnoreProjector" = "True"
|
||||
"RenderType" = "Transparent"
|
||||
"PreviewType" = "Plane"
|
||||
"RenderPipeline" = "UniversalPipeline"
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "PowerBrush"
|
||||
Tags { "LightMode" = "UniversalForward" }
|
||||
|
||||
Blend One One
|
||||
ColorMask RGB
|
||||
Cull Off
|
||||
ZWrite Off
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma vertex Vert
|
||||
#pragma fragment Frag
|
||||
#pragma target 2.0
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
half4 _Color;
|
||||
float _Depth;
|
||||
half _Power;
|
||||
half _Cutoff;
|
||||
CBUFFER_END
|
||||
|
||||
struct Attributes
|
||||
{
|
||||
float4 positionOS : POSITION;
|
||||
half4 color : COLOR;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct Varyings
|
||||
{
|
||||
float4 positionCS : SV_POSITION;
|
||||
half4 color : COLOR;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
Varyings Vert(Attributes input)
|
||||
{
|
||||
Varyings output;
|
||||
output.positionCS = TransformObjectToHClip(input.positionOS.xyz);
|
||||
output.color = input.color;
|
||||
output.uv = input.uv;
|
||||
return output;
|
||||
}
|
||||
|
||||
float PowerPulse(float x, float power)
|
||||
{
|
||||
x = saturate(abs(x)) - 0.001;
|
||||
return pow((x + 1.0) * (1.0 - x), power);
|
||||
}
|
||||
|
||||
half4 Frag(Varyings input) : SV_Target
|
||||
{
|
||||
float dist = length(input.uv - float2(0.5, 0.5)) * 2.0;
|
||||
return _Depth * min(_Cutoff, PowerPulse(dist, _Power)) * _Color * smoothstep(1.0, 0.95, dist);
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,13 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.RenderGraphModule;
|
||||
|
||||
|
||||
public class Stardust : MonoBehaviour
|
||||
{
|
||||
private static readonly List<Stardust> Instances = new List<Stardust>();
|
||||
|
||||
#region variables
|
||||
//public bool debugLog = false;
|
||||
//public float proxyPersistTime = 2;
|
||||
|
|
@ -57,13 +60,52 @@ public class Stardust : MonoBehaviour
|
|||
|
||||
private ComputeBuffer _quadPoints;
|
||||
private const int QUAD_STRIDE = 12;
|
||||
private bool _buffersReady;
|
||||
|
||||
#endregion
|
||||
|
||||
public static void RenderForCamera(UnsafeCommandBuffer cmd, Camera camera, TextureHandle colorTarget, TextureHandle depthTarget)
|
||||
{
|
||||
for (var i = 0; i < Instances.Count; i++)
|
||||
{
|
||||
var stardust = Instances[i];
|
||||
if (stardust == null || !stardust.isActiveAndEnabled || stardust.TargetCamera != camera)
|
||||
continue;
|
||||
|
||||
stardust.RenderStardust(cmd, colorTarget, depthTarget);
|
||||
}
|
||||
}
|
||||
|
||||
#region setup
|
||||
private void OnEnable()
|
||||
{
|
||||
if (!Instances.Contains(this))
|
||||
Instances.Add(this);
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
Instances.Remove(this);
|
||||
ReleaseBuffers();
|
||||
}
|
||||
|
||||
// Use this for initialization
|
||||
void Start()
|
||||
{
|
||||
EnsureBuffers();
|
||||
}
|
||||
|
||||
private void EnsureBuffers()
|
||||
{
|
||||
if (_buffersReady && (_particlesBuffer == null || _quadPoints == null))
|
||||
_buffersReady = false;
|
||||
|
||||
if (_buffersReady)
|
||||
return;
|
||||
|
||||
if (ParticleCalculation == null || ParticleMaterial == null)
|
||||
return;
|
||||
|
||||
//Find compute kernel
|
||||
_updateParticlesKernel = ParticleCalculation.FindKernel("UpdateParticles");
|
||||
|
||||
|
|
@ -92,6 +134,8 @@ public class Stardust : MonoBehaviour
|
|||
new Vector3(-.5f, -.5f),
|
||||
new Vector3(-.5f, .5f)
|
||||
});
|
||||
|
||||
_buffersReady = true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
@ -99,6 +143,18 @@ public class Stardust : MonoBehaviour
|
|||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
EnsureBuffers();
|
||||
if (!_buffersReady || GravityCamera == null)
|
||||
return;
|
||||
|
||||
if (_particlesBuffer == null)
|
||||
{
|
||||
_buffersReady = false;
|
||||
EnsureBuffers();
|
||||
if (!_buffersReady)
|
||||
return;
|
||||
}
|
||||
|
||||
//Bind resources to compute shader
|
||||
ParticleCalculation.SetBuffer(_updateParticlesKernel, "particles", _particlesBuffer);
|
||||
|
||||
|
|
@ -121,10 +177,24 @@ public class Stardust : MonoBehaviour
|
|||
//Dispatch, launch threads on GPU
|
||||
int numberOfGroups = Mathf.CeilToInt((float)Span * Span / GROUP_SIZE);
|
||||
ParticleCalculation.Dispatch(_updateParticlesKernel, numberOfGroups, 1, 1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void RenderStardust(UnsafeCommandBuffer cmd, TextureHandle colorTarget, TextureHandle depthTarget)
|
||||
{
|
||||
EnsureBuffers();
|
||||
if (!_buffersReady || ParticleMaterial == null || _particlesBuffer == null || _quadPoints == null)
|
||||
return;
|
||||
|
||||
ParticleMaterial.SetBuffer("particles", _particlesBuffer);
|
||||
ParticleMaterial.SetBuffer("quadPoints", _quadPoints);
|
||||
Graphics.DrawProcedural(ParticleMaterial, new Bounds(pos, new Vector3(Spacing * Span, 2048, Spacing * Span)), MeshTopology.Triangles, 6, Span * Span, TargetCamera, null, ShadowCastingMode.Off, false, 0);
|
||||
|
||||
if (depthTarget.IsValid())
|
||||
cmd.SetRenderTarget(colorTarget, depthTarget);
|
||||
else
|
||||
cmd.SetRenderTarget(colorTarget);
|
||||
|
||||
cmd.DrawProcedural(Matrix4x4.identity, ParticleMaterial, 0, MeshTopology.Triangles, 6, Span * Span);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
@ -151,14 +221,16 @@ public class Stardust : MonoBehaviour
|
|||
#region cleanup
|
||||
void OnDestroy()
|
||||
{
|
||||
// m_emitterProxies.Release();
|
||||
// _temperature.Release();
|
||||
if(_particlesBuffer!=null)
|
||||
{
|
||||
_particlesBuffer.Release();
|
||||
_quadPoints.Release();
|
||||
}
|
||||
// m_livingProxyIndices.Release();
|
||||
ReleaseBuffers();
|
||||
}
|
||||
|
||||
private void ReleaseBuffers()
|
||||
{
|
||||
_particlesBuffer?.Release();
|
||||
_quadPoints?.Release();
|
||||
_particlesBuffer = null;
|
||||
_quadPoints = null;
|
||||
_buffersReady = false;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,169 +1,101 @@
|
|||
Shader "Aetheria/Stardust (Compute)"
|
||||
Shader "Aetheria/Stardust (Compute)"
|
||||
{
|
||||
Properties {
|
||||
[HDR] _TintColor("Tint Color", Color) = (0.5,0.5,0.5,0.5)
|
||||
_DistanceSizeExponent("Distance Size Exponent", Float) = 1
|
||||
_DistanceIntensityExponent("Distance Intensity Exponent", Float) = 1
|
||||
_EmissionGain("Emission Gain", Range(0, 1)) = 0.3
|
||||
_Power("Power", Float) = 2
|
||||
}
|
||||
Properties
|
||||
{
|
||||
[HDR] _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
|
||||
_DistanceSizeExponent ("Distance Size Exponent", Float) = 1
|
||||
_DistanceIntensityExponent ("Distance Intensity Exponent", Float) = 1
|
||||
_EmissionGain ("Emission Gain", Range(0, 1)) = 0.3
|
||||
_Power ("Power", Float) = 2
|
||||
_AlphaClip ("Alpha Clip", Range(0, 1)) = 0.05
|
||||
}
|
||||
|
||||
SubShader {
|
||||
Tags { "Queue"="AlphaTest" "RenderType"="TransparentCutout" "IgnoreProjector"="True" }
|
||||
Pass {
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex particle_vertex
|
||||
#pragma fragment frag
|
||||
|
||||
#pragma target 5.0
|
||||
#include "UnityCG.cginc"
|
||||
#include "Assets/Shaders/Dither Functions.cginc"
|
||||
|
||||
struct Particle
|
||||
{
|
||||
float3 position;
|
||||
float3 color;
|
||||
float size;
|
||||
};
|
||||
|
||||
StructuredBuffer<Particle> particles;
|
||||
StructuredBuffer<float3> quadPoints;
|
||||
|
||||
float4 _TintColor;
|
||||
float _EmissionGain;
|
||||
float _Power;
|
||||
float _DistanceSizeExponent;
|
||||
float _DistanceIntensityExponent;
|
||||
|
||||
struct v2f
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 screenPos : TEXCOORD1;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
//Vertex shader with no inputs
|
||||
//Uses the system values SV_VertexID and SV_InstanceID to read from compute buffers
|
||||
v2f particle_vertex(uint id : SV_VertexID, uint inst : SV_InstanceID)
|
||||
{
|
||||
v2f o;
|
||||
|
||||
//Only transform world pos by view matrix
|
||||
//To Create a billboarding effect
|
||||
float3 worldPosition = particles[inst].position;
|
||||
float dist = length(worldPosition - _WorldSpaceCameraPos);
|
||||
|
||||
float4 cameraSpacePosition = mul(UNITY_MATRIX_V, float4(worldPosition, 1.0f));
|
||||
//cameraSpacePosition.w /= dist;
|
||||
|
||||
float3 quadPoint = float3(quadPoints[id].xy, 0.0f) * particles[inst].size * pow(dist, _DistanceSizeExponent) / pow(100, _DistanceSizeExponent);
|
||||
o.pos = mul(UNITY_MATRIX_P, cameraSpacePosition + float4(quadPoint, 0.0f));
|
||||
|
||||
//Shift coordinates for uvs
|
||||
o.uv = quadPoints[id] + 0.5f;
|
||||
|
||||
//transfer color of particle and global tint to vertex
|
||||
o.color = float4(particles[inst].color * _TintColor.rgb, 100 * pow(100, _DistanceIntensityExponent) / pow(dist, _DistanceIntensityExponent));
|
||||
o.screenPos = ComputeScreenPos(o.pos);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
||||
float powerPulse( float x, float power )
|
||||
{
|
||||
x = saturate(abs(x));
|
||||
return pow((x + 1.0f) * (1.0f - x), power);
|
||||
}
|
||||
|
||||
float4 frag(v2f i) : COLOR
|
||||
{
|
||||
float emission = powerPulse(length(i.uv-float2(.5,.5))*2,_Power);
|
||||
float2 screenUV = i.screenPos.xy / i.screenPos.w;
|
||||
ditherClip(screenUV, emission * i.color.a);
|
||||
return i.color * emission * (exp(_EmissionGain * 5.0f));
|
||||
}
|
||||
ENDCG
|
||||
}
|
||||
Pass
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
Name "ShadowCaster"
|
||||
Tags { "LightMode" = "ShadowCaster" }
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex particle_vertex
|
||||
#pragma fragment frag
|
||||
|
||||
"Queue" = "Transparent"
|
||||
"RenderType" = "Transparent"
|
||||
"IgnoreProjector" = "True"
|
||||
"RenderPipeline" = "UniversalPipeline"
|
||||
}
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "Stardust"
|
||||
Tags { "LightMode" = "UniversalForward" }
|
||||
|
||||
Blend One One
|
||||
Cull Off
|
||||
ZWrite Off
|
||||
|
||||
HLSLPROGRAM
|
||||
#pragma vertex Vert
|
||||
#pragma fragment Frag
|
||||
#pragma target 5.0
|
||||
#include "UnityCG.cginc"
|
||||
#include "Assets/Shaders/Dither Functions.cginc"
|
||||
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
|
||||
struct Particle
|
||||
{
|
||||
float3 position;
|
||||
float3 color;
|
||||
float size;
|
||||
};
|
||||
|
||||
|
||||
StructuredBuffer<Particle> particles;
|
||||
StructuredBuffer<float3> quadPoints;
|
||||
|
||||
float4 _TintColor;
|
||||
float _EmissionGain;
|
||||
float _Power;
|
||||
float _DistanceSizeExponent;
|
||||
float _DistanceIntensityExponent;
|
||||
|
||||
struct v2f
|
||||
|
||||
CBUFFER_START(UnityPerMaterial)
|
||||
float4 _TintColor;
|
||||
float _EmissionGain;
|
||||
float _Power;
|
||||
float _DistanceSizeExponent;
|
||||
float _DistanceIntensityExponent;
|
||||
float _AlphaClip;
|
||||
CBUFFER_END
|
||||
|
||||
struct Varyings
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float4 positionCS : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 screenPos : TEXCOORD1;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
//Vertex shader with no inputs
|
||||
//Uses the system values SV_VertexID and SV_InstanceID to read from compute buffers
|
||||
v2f particle_vertex(uint id : SV_VertexID, uint inst : SV_InstanceID)
|
||||
|
||||
Varyings Vert(uint vertexId : SV_VertexID, uint instanceId : SV_InstanceID)
|
||||
{
|
||||
v2f o;
|
||||
|
||||
//Only transform world pos by view matrix
|
||||
//To Create a billboarding effect
|
||||
float3 worldPosition = particles[inst].position;
|
||||
float dist = length(worldPosition - _WorldSpaceCameraPos);
|
||||
|
||||
float4 cameraSpacePosition = mul(UNITY_MATRIX_V, float4(worldPosition, 1.0f));
|
||||
//cameraSpacePosition.w /= dist;
|
||||
|
||||
float3 quadPoint = float3(quadPoints[id].xy, 0.0f) * particles[inst].size * pow(dist, _DistanceSizeExponent) / pow(100, _DistanceSizeExponent);
|
||||
o.pos = mul(UNITY_MATRIX_P, cameraSpacePosition + float4(quadPoint, 0.0f));
|
||||
|
||||
//Shift coordinates for uvs
|
||||
o.uv = quadPoints[id] + 0.5f;
|
||||
|
||||
//transfer color of particle and global tint to vertex
|
||||
o.color = float4(particles[inst].color * _TintColor.rgb, 100 * pow(100, _DistanceIntensityExponent) / pow(dist, _DistanceIntensityExponent));
|
||||
o.screenPos = ComputeScreenPos(o.pos);
|
||||
|
||||
return o;
|
||||
Varyings output;
|
||||
|
||||
float3 worldPosition = particles[instanceId].position;
|
||||
float dist = max(length(worldPosition - _WorldSpaceCameraPos.xyz), 0.001);
|
||||
float4 viewPosition = mul(UNITY_MATRIX_V, float4(worldPosition, 1.0));
|
||||
float3 quadPoint = float3(quadPoints[vertexId].xy, 0.0)
|
||||
* particles[instanceId].size
|
||||
* pow(dist, _DistanceSizeExponent)
|
||||
/ pow(100.0, _DistanceSizeExponent);
|
||||
|
||||
output.positionCS = mul(UNITY_MATRIX_P, viewPosition + float4(quadPoint, 0.0));
|
||||
output.uv = quadPoints[vertexId].xy + 0.5;
|
||||
output.color = float4(
|
||||
particles[instanceId].color * _TintColor.rgb,
|
||||
100.0 * pow(100.0, _DistanceIntensityExponent) / pow(dist, _DistanceIntensityExponent));
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
float powerPulse( float x, float power )
|
||||
{
|
||||
x = saturate(abs(x));
|
||||
return pow((x + 1.0f) * (1.0f - x), power);
|
||||
}
|
||||
|
||||
float4 frag(v2f i) : COLOR
|
||||
|
||||
float PowerPulse(float x, float power)
|
||||
{
|
||||
float emission = powerPulse(length(i.uv-float2(.5,.5))*2,_Power);
|
||||
float2 screenUV = i.screenPos.xy / i.screenPos.w;
|
||||
ditherClip(screenUV, emission * i.color.a);
|
||||
SHADOW_CASTER_FRAGMENT(i)
|
||||
x = saturate(abs(x));
|
||||
return pow((x + 1.0) * (1.0 - x), power);
|
||||
}
|
||||
ENDCG
|
||||
|
||||
float4 Frag(Varyings input) : SV_Target
|
||||
{
|
||||
float emission = PowerPulse(length(input.uv - float2(0.5, 0.5)) * 2.0, _Power);
|
||||
clip(emission * input.color.a - _AlphaClip);
|
||||
return float4(input.color.rgb * emission * exp(_EmissionGain * 5.0), 1.0);
|
||||
}
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
34
Assets/Shaders/CustomDoF/AetheriaFogBlur.cs
Normal file
34
Assets/Shaders/CustomDoF/AetheriaFogBlur.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
namespace Aetheria.Rendering.PostProcessing
|
||||
{
|
||||
[Serializable, VolumeComponentMenu("Aetheria/Fog Blur")]
|
||||
[SupportedOnRenderPipeline(typeof(UniversalRenderPipelineAsset))]
|
||||
public sealed class AetheriaFogBlur : VolumeComponent, IPostProcessComponent
|
||||
{
|
||||
[Tooltip("Texture whose red channel defines the fog blur mask.")]
|
||||
public TextureParameter blurMask = new TextureParameter(null, TextureDimension.Tex2D);
|
||||
|
||||
[Min(0.1f), Tooltip("Distance to the point of focus.")]
|
||||
public MinFloatParameter focusDistance = new MinFloatParameter(10f, 0.1f);
|
||||
|
||||
[Tooltip("Ratio of aperture. Smaller values produce a shallower blur.")]
|
||||
public ClampedFloatParameter aperture = new ClampedFloatParameter(5.6f, 0.05f, 32f);
|
||||
|
||||
[Tooltip("Distance between lens and film. Larger values produce a shallower blur.")]
|
||||
public ClampedFloatParameter focalLength = new ClampedFloatParameter(50f, 1f, 300f);
|
||||
|
||||
[Tooltip("Maximum fog blur radius.")]
|
||||
public ClampedIntParameter kernelSize = new ClampedIntParameter((int)AetheriaFogBlurKernelSize.Medium, 0, 3);
|
||||
|
||||
public bool IsActive()
|
||||
{
|
||||
return active && SystemInfo.graphicsShaderLevel >= 35;
|
||||
}
|
||||
|
||||
public bool IsTileCompatible() => false;
|
||||
}
|
||||
}
|
||||
11
Assets/Shaders/CustomDoF/AetheriaFogBlur.cs.meta
Normal file
11
Assets/Shaders/CustomDoF/AetheriaFogBlur.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3c8aa33374e94c7cb0f35af09e54c70c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
279
Assets/Shaders/CustomDoF/AetheriaFogBlurRendererFeature.cs
Normal file
279
Assets/Shaders/CustomDoF/AetheriaFogBlurRendererFeature.cs
Normal file
|
|
@ -0,0 +1,279 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Experimental.Rendering;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.RenderGraphModule;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
namespace Aetheria.Rendering.PostProcessing
|
||||
{
|
||||
public sealed class AetheriaFogBlurRendererFeature : ScriptableRendererFeature
|
||||
{
|
||||
[SerializeField]
|
||||
private Shader shader;
|
||||
|
||||
private FogBlurPass _pass;
|
||||
|
||||
public override void Create()
|
||||
{
|
||||
if (shader == null)
|
||||
shader = Shader.Find("Aetheria/PostProcessing/FogBlur");
|
||||
|
||||
_pass = new FogBlurPass(shader)
|
||||
{
|
||||
renderPassEvent = RenderPassEvent.BeforeRenderingPostProcessing
|
||||
};
|
||||
_pass.ConfigureInput(ScriptableRenderPassInput.Depth);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
_pass?.Dispose();
|
||||
_pass = null;
|
||||
}
|
||||
|
||||
public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
|
||||
{
|
||||
if (_pass == null)
|
||||
Create();
|
||||
|
||||
renderer.EnqueuePass(_pass);
|
||||
}
|
||||
|
||||
private sealed class FogBlurPass : ScriptableRenderPass, IDisposable
|
||||
{
|
||||
private enum Pass
|
||||
{
|
||||
CoCCalculation,
|
||||
CoCTemporalFilter,
|
||||
DownsampleAndPrefilter,
|
||||
BokehSmallKernel,
|
||||
BokehMediumKernel,
|
||||
BokehLargeKernel,
|
||||
BokehVeryLargeKernel,
|
||||
PostFilter,
|
||||
Combine
|
||||
}
|
||||
|
||||
private sealed class PassData
|
||||
{
|
||||
internal Material Material;
|
||||
internal Texture BlurMask;
|
||||
internal bool BlurMaskIsPackedCloud;
|
||||
internal TextureHandle Source;
|
||||
internal TextureHandle Destination;
|
||||
internal TextureHandle CoC;
|
||||
internal TextureHandle DoF;
|
||||
internal TextureHandle Temp;
|
||||
internal float Distance;
|
||||
internal float LensCoeff;
|
||||
internal float MaxCoC;
|
||||
internal float RcpMaxCoC;
|
||||
internal float RcpAspect;
|
||||
internal int KernelPass;
|
||||
internal int Width;
|
||||
internal int Height;
|
||||
internal int HalfWidth;
|
||||
internal int HalfHeight;
|
||||
}
|
||||
|
||||
private const float FilmHeight = 0.024f;
|
||||
|
||||
private readonly ProfilingSampler _profilingSampler = new ProfilingSampler("Aetheria Fog Blur");
|
||||
private Material _material;
|
||||
|
||||
public FogBlurPass(Shader shader)
|
||||
{
|
||||
requiresIntermediateTexture = true;
|
||||
|
||||
if (shader != null && shader.isSupported)
|
||||
_material = CoreUtils.CreateEngineMaterial(shader);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
CoreUtils.Destroy(_material);
|
||||
_material = null;
|
||||
}
|
||||
|
||||
public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer frameData)
|
||||
{
|
||||
if (_material == null)
|
||||
return;
|
||||
|
||||
var fogBlur = VolumeManager.instance.stack.GetComponent<AetheriaFogBlur>();
|
||||
if (fogBlur == null || !fogBlur.IsActive())
|
||||
return;
|
||||
|
||||
var resourceData = frameData.Get<UniversalResourceData>();
|
||||
var cameraData = frameData.Get<UniversalCameraData>();
|
||||
if (resourceData.isActiveTargetBackBuffer)
|
||||
return;
|
||||
|
||||
var source = resourceData.activeColorTexture;
|
||||
if (!source.IsValid())
|
||||
return;
|
||||
|
||||
var blurMask = fogBlur.blurMask.value;
|
||||
var blurMaskIsPackedCloud = false;
|
||||
if (blurMask == null &&
|
||||
VolumeCloudRenderer.TryGetRenderer(cameraData.camera, out var cloudRenderer))
|
||||
{
|
||||
blurMask = cloudRenderer.DebugCurrentCloudBuffer;
|
||||
blurMaskIsPackedCloud = blurMask != null;
|
||||
}
|
||||
|
||||
if (blurMask == null)
|
||||
return;
|
||||
|
||||
var sourceDesc = source.GetDescriptor(renderGraph);
|
||||
var width = sourceDesc.width;
|
||||
var height = sourceDesc.height;
|
||||
if (width <= 0 || height <= 0)
|
||||
return;
|
||||
|
||||
var halfWidth = Mathf.Max(1, width / 2);
|
||||
var halfHeight = Mathf.Max(1, height / 2);
|
||||
|
||||
var destinationDesc = MakeColorDescriptor(sourceDesc, width, height, sourceDesc.colorFormat, "_AetheriaFogBlurColor");
|
||||
var cocDesc = MakeColorDescriptor(sourceDesc, width, height, GraphicsFormat.R8_UNorm, "_AetheriaFogBlurCoC");
|
||||
var dofDesc = MakeColorDescriptor(sourceDesc, halfWidth, halfHeight, sourceDesc.colorFormat, "_AetheriaFogBlurDoF");
|
||||
var tempDesc = MakeColorDescriptor(sourceDesc, halfWidth, halfHeight, sourceDesc.colorFormat, "_AetheriaFogBlurTemp");
|
||||
|
||||
var destination = renderGraph.CreateTexture(destinationDesc);
|
||||
var coc = renderGraph.CreateTexture(cocDesc);
|
||||
var dof = renderGraph.CreateTexture(dofDesc);
|
||||
var temp = renderGraph.CreateTexture(tempDesc);
|
||||
|
||||
using (var builder = renderGraph.AddUnsafePass<PassData>("Aetheria Fog Blur", out var passData, _profilingSampler))
|
||||
{
|
||||
var scaledFilmHeight = FilmHeight * (height / 1080f);
|
||||
var focalLengthMeters = fogBlur.focalLength.value / 1000f;
|
||||
var focusDistance = Mathf.Max(fogBlur.focusDistance.value, focalLengthMeters);
|
||||
var aspect = width / (float)height;
|
||||
var coeff = focalLengthMeters * focalLengthMeters /
|
||||
(fogBlur.aperture.value * (focusDistance - focalLengthMeters) * scaledFilmHeight * 2f);
|
||||
var maxCoC = CalculateMaxCoCRadius((AetheriaFogBlurKernelSize)fogBlur.kernelSize.value, height);
|
||||
|
||||
passData.Material = _material;
|
||||
passData.BlurMask = blurMask;
|
||||
passData.BlurMaskIsPackedCloud = blurMaskIsPackedCloud;
|
||||
passData.Source = source;
|
||||
passData.Destination = destination;
|
||||
passData.CoC = coc;
|
||||
passData.DoF = dof;
|
||||
passData.Temp = temp;
|
||||
passData.Distance = focusDistance;
|
||||
passData.LensCoeff = coeff;
|
||||
passData.MaxCoC = maxCoC;
|
||||
passData.RcpMaxCoC = 1f / maxCoC;
|
||||
passData.RcpAspect = 1f / aspect;
|
||||
passData.KernelPass = (int)Pass.BokehSmallKernel + fogBlur.kernelSize.value;
|
||||
passData.Width = width;
|
||||
passData.Height = height;
|
||||
passData.HalfWidth = halfWidth;
|
||||
passData.HalfHeight = halfHeight;
|
||||
|
||||
builder.UseTexture(source, AccessFlags.Read);
|
||||
builder.UseTexture(destination, AccessFlags.Write);
|
||||
builder.UseTexture(coc, AccessFlags.ReadWrite);
|
||||
builder.UseTexture(dof, AccessFlags.ReadWrite);
|
||||
builder.UseTexture(temp, AccessFlags.ReadWrite);
|
||||
builder.SetRenderFunc(static (PassData data, UnsafeGraphContext context) =>
|
||||
{
|
||||
Execute(data, CommandBufferHelpers.GetNativeCommandBuffer(context.cmd));
|
||||
});
|
||||
}
|
||||
|
||||
resourceData.cameraColor = destination;
|
||||
}
|
||||
|
||||
private static TextureDesc MakeColorDescriptor(
|
||||
TextureDesc source,
|
||||
int width,
|
||||
int height,
|
||||
GraphicsFormat format,
|
||||
string name)
|
||||
{
|
||||
return new TextureDesc(source)
|
||||
{
|
||||
width = width,
|
||||
height = height,
|
||||
format = format,
|
||||
name = name,
|
||||
clearBuffer = true,
|
||||
clearColor = Color.clear,
|
||||
depthBufferBits = DepthBits.None,
|
||||
msaaSamples = MSAASamples.None,
|
||||
useMipMap = false,
|
||||
autoGenerateMips = false,
|
||||
anisoLevel = 0,
|
||||
filterMode = FilterMode.Bilinear,
|
||||
discardBuffer = false
|
||||
};
|
||||
}
|
||||
|
||||
private static float CalculateMaxCoCRadius(AetheriaFogBlurKernelSize kernelSize, int screenHeight)
|
||||
{
|
||||
var radiusInPixels = (float)kernelSize * 4f + 6f;
|
||||
return Mathf.Min(0.05f, radiusInPixels / screenHeight);
|
||||
}
|
||||
|
||||
private static void Execute(PassData data, CommandBuffer cmd)
|
||||
{
|
||||
var material = data.Material;
|
||||
material.SetFloat(ShaderIds.Distance, data.Distance);
|
||||
material.SetFloat(ShaderIds.LensCoeff, data.LensCoeff);
|
||||
material.SetFloat(ShaderIds.MaxCoC, data.MaxCoC);
|
||||
material.SetFloat(ShaderIds.RcpMaxCoC, data.RcpMaxCoC);
|
||||
material.SetFloat(ShaderIds.RcpAspect, data.RcpAspect);
|
||||
material.SetTexture(ShaderIds.DoFBlurTex, data.BlurMask);
|
||||
material.SetFloat(ShaderIds.DoFBlurTexPacked, data.BlurMaskIsPackedCloud ? 1f : 0f);
|
||||
|
||||
SetMainTex(cmd, data.Source, data.Width, data.Height);
|
||||
Blitter.BlitCameraTexture(cmd, data.Source, data.CoC, material, (int)Pass.CoCCalculation);
|
||||
|
||||
SetMainTex(cmd, data.Source, data.Width, data.Height);
|
||||
material.SetTexture(ShaderIds.CoCTex, data.CoC);
|
||||
Blitter.BlitCameraTexture(cmd, data.Source, data.DoF, material, (int)Pass.DownsampleAndPrefilter);
|
||||
|
||||
SetMainTex(cmd, data.DoF, data.HalfWidth, data.HalfHeight);
|
||||
Blitter.BlitCameraTexture(cmd, data.DoF, data.Temp, material, data.KernelPass);
|
||||
|
||||
SetMainTex(cmd, data.Temp, data.HalfWidth, data.HalfHeight);
|
||||
Blitter.BlitCameraTexture(cmd, data.Temp, data.DoF, material, (int)Pass.PostFilter);
|
||||
|
||||
SetMainTex(cmd, data.Source, data.Width, data.Height);
|
||||
material.SetTexture(ShaderIds.DepthOfFieldTex, data.DoF);
|
||||
material.SetVector(ShaderIds.DepthOfFieldTexTexelSize, TexelSize(data.HalfWidth, data.HalfHeight));
|
||||
material.SetTexture(ShaderIds.CoCTex, data.CoC);
|
||||
Blitter.BlitCameraTexture(cmd, data.Source, data.Destination, material, (int)Pass.Combine);
|
||||
}
|
||||
|
||||
private static void SetMainTex(CommandBuffer cmd, TextureHandle texture, int width, int height)
|
||||
{
|
||||
cmd.SetGlobalVector(ShaderIds.MainTexTexelSize, TexelSize(width, height));
|
||||
}
|
||||
|
||||
private static Vector4 TexelSize(int width, int height)
|
||||
{
|
||||
return new Vector4(1f / width, 1f / height, width, height);
|
||||
}
|
||||
|
||||
private static class ShaderIds
|
||||
{
|
||||
internal static readonly int MainTexTexelSize = Shader.PropertyToID("_MainTex_TexelSize");
|
||||
internal static readonly int DoFBlurTex = Shader.PropertyToID("_DoFBlurTex");
|
||||
internal static readonly int DoFBlurTexPacked = Shader.PropertyToID("_DoFBlurTexPacked");
|
||||
internal static readonly int DepthOfFieldTex = Shader.PropertyToID("_DepthOfFieldTex");
|
||||
internal static readonly int DepthOfFieldTexTexelSize = Shader.PropertyToID("_DepthOfFieldTex_TexelSize");
|
||||
internal static readonly int Distance = Shader.PropertyToID("_Distance");
|
||||
internal static readonly int LensCoeff = Shader.PropertyToID("_LensCoeff");
|
||||
internal static readonly int MaxCoC = Shader.PropertyToID("_MaxCoC");
|
||||
internal static readonly int RcpMaxCoC = Shader.PropertyToID("_RcpMaxCoC");
|
||||
internal static readonly int RcpAspect = Shader.PropertyToID("_RcpAspect");
|
||||
internal static readonly int CoCTex = Shader.PropertyToID("_CoCTex");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4820e39ec20f45218b98a21714063e6a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
146
Assets/Shaders/CustomDoF/AetheriaFogBlurUrp.hlsl
Normal file
146
Assets/Shaders/CustomDoF/AetheriaFogBlurUrp.hlsl
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
#ifndef AETHERIA_FOG_BLUR_URP_INCLUDED
|
||||
#define AETHERIA_FOG_BLUR_URP_INCLUDED
|
||||
|
||||
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DynamicScalingClamping.hlsl"
|
||||
#include "Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/Common.hlsl"
|
||||
#include "DiskKernels.hlsl"
|
||||
#include "Assets/Shaders/PackFloat.cginc"
|
||||
|
||||
TEXTURE2D(_DoFBlurTex);
|
||||
float _DoFBlurTexPacked;
|
||||
|
||||
TEXTURE2D_X(_CoCTex);
|
||||
TEXTURE2D_X(_DepthOfFieldTex);
|
||||
|
||||
float4 _MainTex_TexelSize;
|
||||
float4 _DepthOfFieldTex_TexelSize;
|
||||
float _Distance;
|
||||
float _LensCoeff;
|
||||
float _MaxCoC;
|
||||
float _RcpAspect;
|
||||
|
||||
half4 FragCoC(Varyings input) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
|
||||
float2 uv = UnityStereoTransformScreenSpaceTex(input.texcoord);
|
||||
|
||||
half4 blur = SAMPLE_TEXTURE2D(_DoFBlurTex, sampler_LinearClamp, uv);
|
||||
if (_DoFBlurTexPacked > 0.5)
|
||||
{
|
||||
float distance;
|
||||
float density;
|
||||
unpack(blur.a, distance, density);
|
||||
|
||||
float farDepth = max(distance - _Distance, 0.0);
|
||||
float farCoC = saturate(farDepth * max(_LensCoeff, 0.0025));
|
||||
float fogGate = smoothstep(0.02, 0.25, density);
|
||||
return 0.5 + farCoC * fogGate * 0.5;
|
||||
}
|
||||
|
||||
return saturate(blur.r);
|
||||
}
|
||||
|
||||
half4 FragTempFilter(Varyings input) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
|
||||
return SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, UnityStereoTransformScreenSpaceTex(input.texcoord));
|
||||
}
|
||||
|
||||
half4 FragPrefilter(Varyings input) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
|
||||
float2 uv = UnityStereoTransformScreenSpaceTex(input.texcoord);
|
||||
float3 duv = _MainTex_TexelSize.xyx * float3(0.5, 0.5, -0.5);
|
||||
|
||||
float2 uv0 = uv - duv.xy;
|
||||
float2 uv1 = uv - duv.zy;
|
||||
float2 uv2 = uv + duv.zy;
|
||||
float2 uv3 = uv + duv.xy;
|
||||
|
||||
half3 c0 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, ClampUVForBilinear(uv0, _MainTex_TexelSize.xy)).rgb;
|
||||
half3 c1 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, ClampUVForBilinear(uv1, _MainTex_TexelSize.xy)).rgb;
|
||||
half3 c2 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, ClampUVForBilinear(uv2, _MainTex_TexelSize.xy)).rgb;
|
||||
half3 c3 = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, ClampUVForBilinear(uv3, _MainTex_TexelSize.xy)).rgb;
|
||||
|
||||
half coc0 = SAMPLE_TEXTURE2D_X(_CoCTex, sampler_LinearClamp, ClampUVForBilinear(uv0, _MainTex_TexelSize.xy)).r * 2.0 - 1.0;
|
||||
half coc1 = SAMPLE_TEXTURE2D_X(_CoCTex, sampler_LinearClamp, ClampUVForBilinear(uv1, _MainTex_TexelSize.xy)).r * 2.0 - 1.0;
|
||||
half coc2 = SAMPLE_TEXTURE2D_X(_CoCTex, sampler_LinearClamp, ClampUVForBilinear(uv2, _MainTex_TexelSize.xy)).r * 2.0 - 1.0;
|
||||
half coc3 = SAMPLE_TEXTURE2D_X(_CoCTex, sampler_LinearClamp, ClampUVForBilinear(uv3, _MainTex_TexelSize.xy)).r * 2.0 - 1.0;
|
||||
|
||||
half3 avg = (c0 + c1 + c2 + c3) * 0.25;
|
||||
half cocMin = min(coc0, Min3(coc1, coc2, coc3));
|
||||
half cocMax = max(coc0, Max3(coc1, coc2, coc3));
|
||||
half coc = (-cocMin > cocMax ? cocMin : cocMax) * _MaxCoC;
|
||||
|
||||
avg *= smoothstep(0.0, _MainTex_TexelSize.y * 2.0, abs(coc));
|
||||
return half4(avg, coc);
|
||||
}
|
||||
|
||||
half4 FragBlur(Varyings input) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
|
||||
float2 uv = UnityStereoTransformScreenSpaceTex(input.texcoord);
|
||||
half4 center = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, ClampUVForBilinear(uv, _MainTex_TexelSize.xy));
|
||||
|
||||
half4 acc = 0.0;
|
||||
UNITY_LOOP
|
||||
for (int si = 0; si < kSampleCount; si++)
|
||||
{
|
||||
float2 disp = kDiskKernel[si] * _MaxCoC;
|
||||
float dist = length(disp);
|
||||
float2 sampleUv = uv + float2(disp.x * _RcpAspect, disp.y);
|
||||
half4 sampleColor = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, ClampUVForBilinear(sampleUv, _MainTex_TexelSize.xy));
|
||||
|
||||
half farCoC = max(min(center.a, sampleColor.a), 0.0);
|
||||
half nearCoC = max(-sampleColor.a, 0.0);
|
||||
half margin = _MainTex_TexelSize.y * 2.0;
|
||||
half weight = max(
|
||||
saturate((farCoC - dist + margin) / margin),
|
||||
saturate((nearCoC - dist + margin) / margin));
|
||||
|
||||
acc += half4(sampleColor.rgb, 1.0) * weight;
|
||||
}
|
||||
|
||||
acc.rgb /= max(acc.a, 1e-4);
|
||||
acc.a = saturate(acc.a / max((half)kSampleCount, 1.0h));
|
||||
return acc;
|
||||
}
|
||||
|
||||
half4 FragPostBlur(Varyings input) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
|
||||
float2 uv = UnityStereoTransformScreenSpaceTex(input.texcoord);
|
||||
float4 duv = _MainTex_TexelSize.xyxy * float4(0.5, 0.5, -0.5, 0.0);
|
||||
|
||||
half4 acc = 0.0;
|
||||
acc += SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, ClampUVForBilinear(uv - duv.xy, _MainTex_TexelSize.xy));
|
||||
acc += SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, ClampUVForBilinear(uv - duv.zy, _MainTex_TexelSize.xy));
|
||||
acc += SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, ClampUVForBilinear(uv + duv.zy, _MainTex_TexelSize.xy));
|
||||
acc += SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, ClampUVForBilinear(uv + duv.xy, _MainTex_TexelSize.xy));
|
||||
return acc * 0.25;
|
||||
}
|
||||
|
||||
half4 FragCombine(Varyings input) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
|
||||
float2 uv = UnityStereoTransformScreenSpaceTex(input.texcoord);
|
||||
|
||||
half4 color = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_LinearClamp, ClampUVForBilinear(uv, _MainTex_TexelSize.xy));
|
||||
half4 dof = SAMPLE_TEXTURE2D_X(_DepthOfFieldTex, sampler_LinearClamp, ClampUVForBilinear(uv, _DepthOfFieldTex_TexelSize.xy));
|
||||
half coc = SAMPLE_TEXTURE2D_X(_CoCTex, sampler_LinearClamp, ClampUVForBilinear(uv, _MainTex_TexelSize.xy)).r;
|
||||
coc = (coc - 0.5) * 2.0 * _MaxCoC;
|
||||
|
||||
half farAlpha = smoothstep(_MainTex_TexelSize.y * 2.0, _MainTex_TexelSize.y * 4.0, coc);
|
||||
return lerp(color, half4(dof.rgb, color.a), farAlpha);
|
||||
}
|
||||
|
||||
half4 FragDebugOverlay(Varyings input) : SV_Target
|
||||
{
|
||||
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
|
||||
float2 uv = UnityStereoTransformScreenSpaceTex(input.texcoord);
|
||||
half coc = SAMPLE_TEXTURE2D_X(_CoCTex, sampler_LinearClamp, ClampUVForBilinear(uv, _MainTex_TexelSize.xy)).r;
|
||||
return half4(coc, coc, coc, 1.0);
|
||||
}
|
||||
|
||||
#endif
|
||||
7
Assets/Shaders/CustomDoF/AetheriaFogBlurUrp.hlsl.meta
Normal file
7
Assets/Shaders/CustomDoF/AetheriaFogBlurUrp.hlsl.meta
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 825f9bd701ee6b94498ac02d28fc8a3b
|
||||
ShaderIncludeImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -1,271 +1,12 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.PostProcessing;
|
||||
|
||||
namespace Aetheria.Rendering.PostProcessing
|
||||
{
|
||||
/// <summary>
|
||||
/// Convolution kernel size for the Aetheria fog blur effect.
|
||||
/// </summary>
|
||||
public enum AetheriaFogBlurKernelSize
|
||||
{
|
||||
/// <summary>
|
||||
/// Small filter.
|
||||
/// </summary>
|
||||
Small,
|
||||
|
||||
/// <summary>
|
||||
/// Medium filter.
|
||||
/// </summary>
|
||||
Medium,
|
||||
|
||||
/// <summary>
|
||||
/// Large filter.
|
||||
/// </summary>
|
||||
Large,
|
||||
|
||||
/// <summary>
|
||||
/// Very large filter.
|
||||
/// </summary>
|
||||
VeryLarge
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A volume parameter holding a <see cref="AetheriaFogBlurKernelSize"/> value.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public sealed class AetheriaFogBlurKernelSizeParameter : ParameterOverride<AetheriaFogBlurKernelSize> {}
|
||||
|
||||
/// <summary>
|
||||
/// This class holds settings for Aetheria's custom fog blur effect.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[PostProcess(typeof(AetheriaFogBlurRenderer), PostProcessEvent.BeforeStack, "Aetheria/Fog Blur", false)]
|
||||
public sealed class AetheriaFogBlur : PostProcessEffectSettings
|
||||
{
|
||||
/// <summary>
|
||||
/// The distance to the point of focus.
|
||||
/// </summary>
|
||||
[UnityEngine.Rendering.PostProcessing.Min(0.1f), Tooltip("Distance to the point of focus.")]
|
||||
public UnityEngine.Rendering.PostProcessing.FloatParameter focusDistance = new UnityEngine.Rendering.PostProcessing.FloatParameter { value = 10f };
|
||||
|
||||
/// <summary>
|
||||
/// The ratio of the aperture (known as f-stop or f-number). The smaller the value is, the
|
||||
/// shallower the depth of field is.
|
||||
/// </summary>
|
||||
[Range(0.05f, 32f), Tooltip("Ratio of aperture (known as f-stop or f-number). The smaller the value is, the shallower the depth of field is.")]
|
||||
public UnityEngine.Rendering.PostProcessing.FloatParameter aperture = new UnityEngine.Rendering.PostProcessing.FloatParameter { value = 5.6f };
|
||||
|
||||
/// <summary>
|
||||
/// The distance between the lens and the film. The larger the value is, the shallower the
|
||||
/// depth of field is.
|
||||
/// </summary>
|
||||
[Range(1f, 300f), Tooltip("Distance between the lens and the film. The larger the value is, the shallower the depth of field is.")]
|
||||
public UnityEngine.Rendering.PostProcessing.FloatParameter focalLength = new UnityEngine.Rendering.PostProcessing.FloatParameter { value = 50f };
|
||||
|
||||
/// <summary>
|
||||
/// The convolution kernel size of the bokeh filter, which determines the maximum radius of
|
||||
/// bokeh. It also affects the performance (the larger the kernel is, the longer the GPU
|
||||
/// time is required).
|
||||
/// </summary>
|
||||
[DisplayName("Max Blur Size"), Tooltip("Convolution kernel size of the bokeh filter, which determines the maximum radius of bokeh. It also affects performances (the larger the kernel is, the longer the GPU time is required).")]
|
||||
public AetheriaFogBlurKernelSizeParameter kernelSize = new AetheriaFogBlurKernelSizeParameter { value = AetheriaFogBlurKernelSize.Medium };
|
||||
|
||||
/// <summary>
|
||||
/// Returns <c>true</c> if the effect is currently enabled and supported.
|
||||
/// </summary>
|
||||
/// <param name="context">The current post-processing render context</param>
|
||||
/// <returns><c>true</c> if the effect is currently enabled and supported</returns>
|
||||
public override bool IsEnabledAndSupported(PostProcessRenderContext context)
|
||||
{
|
||||
return enabled.value
|
||||
&& SystemInfo.graphicsShaderLevel >= 35;
|
||||
}
|
||||
}
|
||||
|
||||
[UnityEngine.Scripting.Preserve]
|
||||
// TODO: Doesn't play nice with alpha propagation, see if it can be fixed without killing performances
|
||||
internal sealed class AetheriaFogBlurRenderer : PostProcessEffectRenderer<AetheriaFogBlur>
|
||||
{
|
||||
enum Pass
|
||||
{
|
||||
CoCCalculation,
|
||||
CoCTemporalFilter,
|
||||
DownsampleAndPrefilter,
|
||||
BokehSmallKernel,
|
||||
BokehMediumKernel,
|
||||
BokehLargeKernel,
|
||||
BokehVeryLargeKernel,
|
||||
PostFilter,
|
||||
Combine,
|
||||
DebugOverlay
|
||||
}
|
||||
|
||||
// Ping-pong between two history textures as we can't read & write the same target in the
|
||||
// same pass
|
||||
const int k_NumEyes = 2;
|
||||
const int k_NumCoCHistoryTextures = 2;
|
||||
readonly RenderTexture[][] m_CoCHistoryTextures = new RenderTexture[k_NumEyes][];
|
||||
int[] m_HistoryPingPong = new int[k_NumEyes];
|
||||
|
||||
// Height of the 35mm full-frame format (36mm x 24mm)
|
||||
// TODO: Should be set by a physical camera
|
||||
const float k_FilmHeight = 0.024f;
|
||||
|
||||
public AetheriaFogBlurRenderer()
|
||||
{
|
||||
for (int eye = 0; eye < k_NumEyes; eye++)
|
||||
{
|
||||
m_CoCHistoryTextures[eye] = new RenderTexture[k_NumCoCHistoryTextures];
|
||||
m_HistoryPingPong[eye] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override DepthTextureMode GetCameraFlags()
|
||||
{
|
||||
return DepthTextureMode.Depth;
|
||||
}
|
||||
|
||||
RenderTextureFormat SelectFormat(RenderTextureFormat primary, RenderTextureFormat secondary)
|
||||
{
|
||||
if (SystemInfo.SupportsRenderTextureFormat(primary))
|
||||
return primary;
|
||||
|
||||
if (SystemInfo.SupportsRenderTextureFormat(secondary))
|
||||
return secondary;
|
||||
|
||||
return RenderTextureFormat.Default;
|
||||
}
|
||||
|
||||
float CalculateMaxCoCRadius(int screenHeight)
|
||||
{
|
||||
// Estimate the allowable maximum radius of CoC from the kernel
|
||||
// size (the equation below was empirically derived).
|
||||
float radiusInPixels = (float)settings.kernelSize.value * 4f + 6f;
|
||||
|
||||
// Applying a 5% limit to the CoC radius to keep the size of
|
||||
// TileMax/NeighborMax small enough.
|
||||
return Mathf.Min(0.05f, radiusInPixels / screenHeight);
|
||||
}
|
||||
|
||||
RenderTexture CheckHistory(int eye, int id, PostProcessRenderContext context, RenderTextureFormat format)
|
||||
{
|
||||
var rt = m_CoCHistoryTextures[eye][id];
|
||||
|
||||
if (m_ResetHistory || rt == null || !rt.IsCreated() || rt.width != context.width || rt.height != context.height)
|
||||
{
|
||||
RenderTexture.ReleaseTemporary(rt);
|
||||
|
||||
rt = context.GetScreenSpaceTemporaryRT(0, format, RenderTextureReadWrite.Linear);
|
||||
rt.name = "CoC History, Eye: " + eye + ", ID: " + id;
|
||||
rt.filterMode = FilterMode.Bilinear;
|
||||
rt.Create();
|
||||
m_CoCHistoryTextures[eye][id] = rt;
|
||||
}
|
||||
|
||||
return rt;
|
||||
}
|
||||
|
||||
public override void Render(PostProcessRenderContext context)
|
||||
{
|
||||
// The coc is stored in alpha so we need a 4 channels target. Note that using ARGB32
|
||||
// will result in a very weak near-blur.
|
||||
var colorFormat = context.camera.allowHDR ? RenderTextureFormat.ARGBHalf : RenderTextureFormat.ARGB32;
|
||||
var cocFormat = SelectFormat(RenderTextureFormat.R8, RenderTextureFormat.RHalf);
|
||||
|
||||
// Material setup
|
||||
float scaledFilmHeight = k_FilmHeight * (context.height / 1080f);
|
||||
var f = settings.focalLength.value / 1000f;
|
||||
var s1 = Mathf.Max(settings.focusDistance.value, f);
|
||||
var aspect = (float)context.screenWidth / (float)context.screenHeight;
|
||||
var coeff = f * f / (settings.aperture.value * (s1 - f) * scaledFilmHeight * 2f);
|
||||
var maxCoC = CalculateMaxCoCRadius(context.screenHeight);
|
||||
|
||||
var sheet = context.propertySheets.Get(Shader.Find("Aetheria/PostProcessing/FogBlur"));
|
||||
sheet.properties.Clear();
|
||||
sheet.properties.SetFloat(Distance, s1);
|
||||
sheet.properties.SetFloat(LensCoeff, coeff);
|
||||
sheet.properties.SetFloat(MaxCoC, maxCoC);
|
||||
sheet.properties.SetFloat(RcpMaxCoC, 1f / maxCoC);
|
||||
sheet.properties.SetFloat(RcpAspect, 1f / aspect);
|
||||
|
||||
var cmd = context.command;
|
||||
cmd.BeginSample("DepthOfField");
|
||||
|
||||
// CoC calculation pass
|
||||
context.GetScreenSpaceTemporaryRT(cmd, CoCTex, 0, cocFormat, RenderTextureReadWrite.Linear);
|
||||
cmd.BlitFullscreenTriangle(BuiltinRenderTextureType.None, CoCTex, sheet, (int)Pass.CoCCalculation);
|
||||
|
||||
// CoC temporal filter pass when TAA is enabled
|
||||
if (context.IsTemporalAntialiasingActive())
|
||||
{
|
||||
float motionBlending = context.temporalAntialiasing.motionBlending;
|
||||
float blend = m_ResetHistory ? 0f : motionBlending; // Handles first frame blending
|
||||
var jitter = context.temporalAntialiasing.jitter;
|
||||
|
||||
sheet.properties.SetVector(TaaParams, new Vector3(jitter.x, jitter.y, blend));
|
||||
|
||||
int pp = m_HistoryPingPong[context.xrActiveEye];
|
||||
var historyRead = CheckHistory(context.xrActiveEye, ++pp % 2, context, cocFormat);
|
||||
var historyWrite = CheckHistory(context.xrActiveEye, ++pp % 2, context, cocFormat);
|
||||
m_HistoryPingPong[context.xrActiveEye] = ++pp % 2;
|
||||
|
||||
cmd.BlitFullscreenTriangle(historyRead, historyWrite, sheet, (int)Pass.CoCTemporalFilter);
|
||||
cmd.ReleaseTemporaryRT(CoCTex);
|
||||
cmd.SetGlobalTexture(CoCTex, historyWrite);
|
||||
}
|
||||
|
||||
// Downsampling and prefiltering pass
|
||||
context.GetScreenSpaceTemporaryRT(cmd, DepthOfFieldTex, 0, colorFormat, RenderTextureReadWrite.Default, FilterMode.Bilinear, context.width / 2, context.height / 2);
|
||||
cmd.BlitFullscreenTriangle(context.source, DepthOfFieldTex, sheet, (int)Pass.DownsampleAndPrefilter);
|
||||
|
||||
// Bokeh simulation pass
|
||||
context.GetScreenSpaceTemporaryRT(cmd, DepthOfFieldTemp, 0, colorFormat, RenderTextureReadWrite.Default, FilterMode.Bilinear, context.width / 2, context.height / 2);
|
||||
cmd.BlitFullscreenTriangle(DepthOfFieldTex, DepthOfFieldTemp, sheet, (int)Pass.BokehSmallKernel + (int)settings.kernelSize.value);
|
||||
|
||||
// Postfilter pass
|
||||
cmd.BlitFullscreenTriangle(DepthOfFieldTemp, DepthOfFieldTex, sheet, (int)Pass.PostFilter);
|
||||
cmd.ReleaseTemporaryRT(DepthOfFieldTemp);
|
||||
|
||||
// Debug overlay pass
|
||||
if (context.IsDebugOverlayEnabled(UnityEngine.Rendering.PostProcessing.DebugOverlay.DepthOfField))
|
||||
context.PushDebugOverlay(cmd, context.source, sheet, (int)Pass.DebugOverlay);
|
||||
|
||||
// Combine pass
|
||||
cmd.BlitFullscreenTriangle(context.source, context.destination, sheet, (int)Pass.Combine);
|
||||
cmd.ReleaseTemporaryRT(DepthOfFieldTex);
|
||||
|
||||
if (!context.IsTemporalAntialiasingActive())
|
||||
cmd.ReleaseTemporaryRT(CoCTex);
|
||||
|
||||
cmd.EndSample("DepthOfField");
|
||||
|
||||
m_ResetHistory = false;
|
||||
}
|
||||
|
||||
public override void Release()
|
||||
{
|
||||
for (int eye = 0; eye < k_NumEyes; eye++)
|
||||
{
|
||||
for (int i = 0; i < m_CoCHistoryTextures[eye].Length; i++)
|
||||
{
|
||||
RenderTexture.ReleaseTemporary(m_CoCHistoryTextures[eye][i]);
|
||||
m_CoCHistoryTextures[eye][i] = null;
|
||||
}
|
||||
m_HistoryPingPong[eye] = 0;
|
||||
}
|
||||
|
||||
ResetHistory();
|
||||
}
|
||||
static readonly int DepthOfFieldTemp = Shader.PropertyToID("_DepthOfFieldTemp");
|
||||
static readonly int DepthOfFieldTex = Shader.PropertyToID("_DepthOfFieldTex");
|
||||
static readonly int Distance = Shader.PropertyToID("_Distance");
|
||||
static readonly int LensCoeff = Shader.PropertyToID("_LensCoeff");
|
||||
static readonly int MaxCoC = Shader.PropertyToID("_MaxCoC");
|
||||
static readonly int RcpMaxCoC = Shader.PropertyToID("_RcpMaxCoC");
|
||||
static readonly int RcpAspect = Shader.PropertyToID("_RcpAspect");
|
||||
static readonly int CoCTex = Shader.PropertyToID("_CoCTex");
|
||||
static readonly int TaaParams = Shader.PropertyToID("_TaaParams");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,11 +4,13 @@
|
|||
#include "StdLib.hlsl"
|
||||
#include "Colors.hlsl"
|
||||
#include "DiskKernels.hlsl"
|
||||
#include "Assets/Shaders/PackFloat.cginc"
|
||||
|
||||
TEXTURE2D_SAMPLER2D(_MainTex, sampler_MainTex);
|
||||
float4 _MainTex_TexelSize;
|
||||
TEXTURE2D_SAMPLER2D(_BlitTexture, sampler_BlitTexture);
|
||||
|
||||
TEXTURE2D_SAMPLER2D(_DoFBlurTex, sampler_DoFBlurTex);
|
||||
float _DoFBlurTexPacked;
|
||||
TEXTURE2D_SAMPLER2D(_CameraDepthTexture, sampler_CameraDepthTexture);
|
||||
TEXTURE2D_SAMPLER2D(_CameraMotionVectorsTexture, sampler_CameraMotionVectorsTexture);
|
||||
|
||||
|
|
@ -28,7 +30,16 @@ half3 _TaaParams; // Jitter.x, Jitter.y, Blending
|
|||
// CoC calculation
|
||||
half4 FragCoC(VaryingsDefault i) : SV_Target
|
||||
{
|
||||
return SAMPLE_TEXTURE2D(_DoFBlurTex, sampler_DoFBlurTex, i.texcoordStereo).r;
|
||||
half4 blur = SAMPLE_TEXTURE2D(_DoFBlurTex, sampler_DoFBlurTex, i.texcoordStereo);
|
||||
if (_DoFBlurTexPacked > 0.5)
|
||||
{
|
||||
float distance;
|
||||
float density;
|
||||
unpack(blur.a, distance, density);
|
||||
return saturate(density);
|
||||
}
|
||||
|
||||
return blur.r;
|
||||
}
|
||||
|
||||
// Temporal filter
|
||||
|
|
@ -66,7 +77,7 @@ half4 FragTempFilter(VaryingsDefault i) : SV_Target
|
|||
|
||||
// Sample the history buffer with the motion vector at the closest point
|
||||
float2 motion = SAMPLE_TEXTURE2D(_CameraMotionVectorsTexture, sampler_CameraMotionVectorsTexture, UnityStereoTransformScreenSpaceTex(i.texcoord + closest.xy)).xy;
|
||||
half cocHis = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, UnityStereoTransformScreenSpaceTex(i.texcoord - motion)).r;
|
||||
half cocHis = SAMPLE_TEXTURE2D(_BlitTexture, sampler_BlitTexture, UnityStereoTransformScreenSpaceTex(i.texcoord - motion)).r;
|
||||
|
||||
// Neighborhood clamping
|
||||
half cocMin = closest.z;
|
||||
|
|
@ -83,9 +94,9 @@ half4 FragPrefilter(VaryingsDefault i) : SV_Target
|
|||
#if UNITY_GATHER_SUPPORTED
|
||||
|
||||
// Sample source colors
|
||||
half4 c_r = GATHER_RED_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoordStereo);
|
||||
half4 c_g = GATHER_GREEN_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoordStereo);
|
||||
half4 c_b = GATHER_BLUE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoordStereo);
|
||||
half4 c_r = GATHER_RED_TEXTURE2D(_BlitTexture, sampler_BlitTexture, i.texcoordStereo);
|
||||
half4 c_g = GATHER_GREEN_TEXTURE2D(_BlitTexture, sampler_BlitTexture, i.texcoordStereo);
|
||||
half4 c_b = GATHER_BLUE_TEXTURE2D(_BlitTexture, sampler_BlitTexture, i.texcoordStereo);
|
||||
|
||||
half3 c0 = half3(c_r.x, c_g.x, c_b.x);
|
||||
half3 c1 = half3(c_r.y, c_g.y, c_b.y);
|
||||
|
|
@ -108,10 +119,10 @@ half4 FragPrefilter(VaryingsDefault i) : SV_Target
|
|||
float2 uv3 = UnityStereoTransformScreenSpaceTex(i.texcoord + duv.xy);
|
||||
|
||||
// Sample source colors
|
||||
half3 c0 = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, uv0).rgb;
|
||||
half3 c1 = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, uv1).rgb;
|
||||
half3 c2 = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, uv2).rgb;
|
||||
half3 c3 = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, uv3).rgb;
|
||||
half3 c0 = SAMPLE_TEXTURE2D(_BlitTexture, sampler_BlitTexture, uv0).rgb;
|
||||
half3 c1 = SAMPLE_TEXTURE2D(_BlitTexture, sampler_BlitTexture, uv1).rgb;
|
||||
half3 c2 = SAMPLE_TEXTURE2D(_BlitTexture, sampler_BlitTexture, uv2).rgb;
|
||||
half3 c3 = SAMPLE_TEXTURE2D(_BlitTexture, sampler_BlitTexture, uv3).rgb;
|
||||
|
||||
// Sample CoCs
|
||||
half coc0 = SAMPLE_TEXTURE2D(_CoCTex, sampler_CoCTex, uv0).r * 2.0 - 1.0;
|
||||
|
|
@ -149,7 +160,7 @@ half4 FragPrefilter(VaryingsDefault i) : SV_Target
|
|||
// Bokeh filter with disk-shaped kernels
|
||||
half4 FragBlur(VaryingsDefault i) : SV_Target
|
||||
{
|
||||
half4 samp0 = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoordStereo);
|
||||
half4 samp0 = SAMPLE_TEXTURE2D(_BlitTexture, sampler_BlitTexture, i.texcoordStereo);
|
||||
|
||||
half4 bgAcc = 0.0; // Background: far field bokeh
|
||||
half4 fgAcc = 0.0; // Foreground: near field bokeh
|
||||
|
|
@ -161,7 +172,7 @@ half4 FragBlur(VaryingsDefault i) : SV_Target
|
|||
float dist = length(disp);
|
||||
|
||||
float2 duv = float2(disp.x * _RcpAspect, disp.y);
|
||||
half4 samp = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, UnityStereoTransformScreenSpaceTex(i.texcoord + duv));
|
||||
half4 samp = SAMPLE_TEXTURE2D(_BlitTexture, sampler_BlitTexture, UnityStereoTransformScreenSpaceTex(i.texcoord + duv));
|
||||
|
||||
// BG: Compare CoC of the current sample and the center sample
|
||||
// and select smaller one.
|
||||
|
|
@ -206,10 +217,10 @@ half4 FragPostBlur(VaryingsDefault i) : SV_Target
|
|||
// 9 tap tent filter with 4 bilinear samples
|
||||
const float4 duv = _MainTex_TexelSize.xyxy * float4(0.5, 0.5, -0.5, 0);
|
||||
half4 acc;
|
||||
acc = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, UnityStereoTransformScreenSpaceTex(i.texcoord - duv.xy));
|
||||
acc += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, UnityStereoTransformScreenSpaceTex(i.texcoord - duv.zy));
|
||||
acc += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, UnityStereoTransformScreenSpaceTex(i.texcoord + duv.zy));
|
||||
acc += SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, UnityStereoTransformScreenSpaceTex(i.texcoord + duv.xy));
|
||||
acc = SAMPLE_TEXTURE2D(_BlitTexture, sampler_BlitTexture, UnityStereoTransformScreenSpaceTex(i.texcoord - duv.xy));
|
||||
acc += SAMPLE_TEXTURE2D(_BlitTexture, sampler_BlitTexture, UnityStereoTransformScreenSpaceTex(i.texcoord - duv.zy));
|
||||
acc += SAMPLE_TEXTURE2D(_BlitTexture, sampler_BlitTexture, UnityStereoTransformScreenSpaceTex(i.texcoord + duv.zy));
|
||||
acc += SAMPLE_TEXTURE2D(_BlitTexture, sampler_BlitTexture, UnityStereoTransformScreenSpaceTex(i.texcoord + duv.xy));
|
||||
return acc / 4.0;
|
||||
}
|
||||
|
||||
|
|
@ -223,7 +234,7 @@ half4 FragCombine(VaryingsDefault i) : SV_Target
|
|||
// Convert CoC to far field alpha value.
|
||||
float ffa = smoothstep(_MainTex_TexelSize.y * 2.0, _MainTex_TexelSize.y * 4.0, coc);
|
||||
|
||||
half4 color = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoordStereo);
|
||||
half4 color = SAMPLE_TEXTURE2D(_BlitTexture, sampler_BlitTexture, i.texcoordStereo);
|
||||
|
||||
#if defined(UNITY_COLORSPACE_GAMMA)
|
||||
color = SRGBToLinear(color);
|
||||
|
|
@ -244,7 +255,7 @@ half4 FragCombine(VaryingsDefault i) : SV_Target
|
|||
// Debug overlay
|
||||
half4 FragDebugOverlay(VaryingsDefault i) : SV_Target
|
||||
{
|
||||
half3 color = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoordStereo).rgb;
|
||||
half3 color = SAMPLE_TEXTURE2D(_BlitTexture, sampler_BlitTexture, i.texcoordStereo).rgb;
|
||||
|
||||
// Calculate the radiuses of CoC.
|
||||
half4 src = SAMPLE_TEXTURE2D(_DepthOfFieldTex, sampler_DepthOfFieldTex, i.texcoordStereo);
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragCoC
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -25,9 +25,9 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 5.0
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragTempFilter
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -37,9 +37,9 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 5.0
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragPrefilter
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -49,10 +49,10 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragBlur
|
||||
#define KERNEL_SMALL
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -62,10 +62,10 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragBlur
|
||||
#define KERNEL_MEDIUM
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -75,10 +75,10 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragBlur
|
||||
#define KERNEL_LARGE
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -88,10 +88,10 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragBlur
|
||||
#define KERNEL_VERYLARGE
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -101,9 +101,9 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragPostBlur
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -113,9 +113,9 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragCombine
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -125,9 +125,9 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragDebugOverlay
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
|
|
@ -144,9 +144,9 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragCoC
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -156,9 +156,9 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragTempFilter
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -168,9 +168,9 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragPrefilter
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -180,10 +180,10 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragBlur
|
||||
#define KERNEL_SMALL
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -193,10 +193,10 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragBlur
|
||||
#define KERNEL_MEDIUM
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -206,10 +206,10 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragBlur
|
||||
#define KERNEL_LARGE
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -219,10 +219,10 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragBlur
|
||||
#define KERNEL_VERYLARGE
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -232,9 +232,9 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragPostBlur
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -244,9 +244,9 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragCombine
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
|
||||
|
|
@ -256,9 +256,9 @@ Shader "Aetheria/PostProcessing/FogBlur"
|
|||
|
||||
HLSLPROGRAM
|
||||
#pragma target 3.5
|
||||
#pragma vertex VertDefault
|
||||
#pragma vertex Vert
|
||||
#pragma fragment FragDebugOverlay
|
||||
#include "DepthOfField.hlsl"
|
||||
#include "AetheriaFogBlurUrp.hlsl"
|
||||
ENDHLSL
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -260,11 +260,6 @@ float2 TransformTriangleVertexToUV(float2 vertex)
|
|||
// -----------------------------------------------------------------------------
|
||||
// Default vertex shaders
|
||||
|
||||
struct AttributesDefault
|
||||
{
|
||||
float3 vertex : POSITION;
|
||||
};
|
||||
|
||||
struct VaryingsDefault
|
||||
{
|
||||
float4 vertex : SV_POSITION;
|
||||
|
|
@ -279,15 +274,19 @@ struct VaryingsDefault
|
|||
float _DepthSlice;
|
||||
#endif
|
||||
|
||||
VaryingsDefault VertDefault(AttributesDefault v)
|
||||
float2 FullScreenTriangleUV(uint vertexID)
|
||||
{
|
||||
VaryingsDefault o;
|
||||
o.vertex = float4(v.vertex.xy, 0.0, 1.0);
|
||||
o.texcoord = TransformTriangleVertexToUV(v.vertex.xy);
|
||||
return float2((vertexID << 1) & 2, vertexID & 2);
|
||||
}
|
||||
|
||||
#if UNITY_UV_STARTS_AT_TOP
|
||||
o.texcoord = o.texcoord * float2(1.0, -1.0) + float2(0.0, 1.0);
|
||||
#endif
|
||||
float4 _BlitScaleBias; // xy: scale, zw: translate
|
||||
|
||||
VaryingsDefault VertDefault(uint vertexID : SV_VertexID)
|
||||
{
|
||||
float2 uv = FullScreenTriangleUV(vertexID);
|
||||
VaryingsDefault o;
|
||||
o.vertex = float4(uv * 2.0 - 1.0, 0.0, 1.0);
|
||||
o.texcoord = uv * _BlitScaleBias.xy + _BlitScaleBias.zw;
|
||||
|
||||
o.texcoordStereo = TransformStereoScreenSpaceTex(o.texcoord, 1.0);
|
||||
|
||||
|
|
@ -300,16 +299,17 @@ float4 _UVTransform; // xy: scale, wz: translate
|
|||
float4 _PosScaleOffset; // xy: scale, wz: offset
|
||||
#endif
|
||||
|
||||
VaryingsDefault VertUVTransform(AttributesDefault v)
|
||||
VaryingsDefault VertUVTransform(uint vertexID : SV_VertexID)
|
||||
{
|
||||
float2 uv = FullScreenTriangleUV(vertexID);
|
||||
VaryingsDefault o;
|
||||
|
||||
#if STEREO_DOUBLEWIDE_TARGET
|
||||
o.vertex = float4(v.vertex.xy * _PosScaleOffset.xy + _PosScaleOffset.zw, 0.0, 1.0);
|
||||
o.vertex = float4((uv * 2.0 - 1.0) * _PosScaleOffset.xy + _PosScaleOffset.zw, 0.0, 1.0);
|
||||
#else
|
||||
o.vertex = float4(v.vertex.xy, 0.0, 1.0);
|
||||
o.vertex = float4(uv * 2.0 - 1.0, 0.0, 1.0);
|
||||
#endif
|
||||
o.texcoord = TransformTriangleVertexToUV(v.vertex.xy) * _UVTransform.xy + _UVTransform.zw;
|
||||
o.texcoord = uv * _UVTransform.xy + _UVTransform.zw;
|
||||
o.texcoordStereo = TransformStereoScreenSpaceTex(o.texcoord, 1.0);
|
||||
#if STEREO_INSTANCING_ENABLED
|
||||
o.stereoTargetEyeIndex = (uint)_DepthSlice;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue