temporal effects

This commit is contained in:
2026-05-02 19:23:03 +10:00
parent 2a0eea936d
commit 1d9bf151ce
13 changed files with 786 additions and 7 deletions

View File

@@ -45,6 +45,21 @@ struct ShaderParameterValue
std::string enumValue;
};
enum class TemporalHistorySource
{
None,
Source,
PreLayerInput
};
struct TemporalSettings
{
bool enabled = false;
TemporalHistorySource historySource = TemporalHistorySource::None;
unsigned requestedHistoryLength = 0;
unsigned effectiveHistoryLength = 0;
};
struct ShaderPackage
{
std::string id;
@@ -56,6 +71,7 @@ struct ShaderPackage
std::filesystem::path shaderPath;
std::filesystem::path manifestPath;
std::vector<ShaderParameterDefinition> parameters;
TemporalSettings temporal;
std::filesystem::file_time_type shaderWriteTime;
std::filesystem::file_time_type manifestWriteTime;
};
@@ -74,6 +90,10 @@ struct RuntimeRenderState
unsigned inputHeight = 0;
unsigned outputWidth = 0;
unsigned outputHeight = 0;
bool isTemporal = false;
TemporalHistorySource temporalHistorySource = TemporalHistorySource::None;
unsigned requestedTemporalHistoryLength = 0;
unsigned effectiveTemporalHistoryLength = 0;
};
class RuntimeHost
@@ -100,6 +120,8 @@ public:
void SetCompileStatus(bool succeeded, const std::string& message);
void SetSignalStatus(bool hasSignal, unsigned width, unsigned height, const std::string& modeName);
void SetDeckLinkOutputStatus(const std::string& modelName, bool supportsInternalKeying, bool supportsExternalKeying,
bool keyerInterfaceAvailable, bool externalKeyingRequested, bool externalKeyingActive, const std::string& statusMessage);
void SetPerformanceStats(double frameBudgetMilliseconds, double renderMilliseconds);
void AdvanceFrame();
@@ -111,6 +133,8 @@ public:
const std::filesystem::path& GetUiRoot() const { return mUiRoot; }
const std::filesystem::path& GetRuntimeRoot() const { return mRuntimeRoot; }
unsigned short GetServerPort() const { return mServerPort; }
unsigned GetMaxTemporalHistoryFrames() const { return mConfig.maxTemporalHistoryFrames; }
bool ExternalKeyingEnabled() const { return mConfig.enableExternalKeying; }
void SetServerPort(unsigned short port);
bool AutoReloadEnabled() const { return mAutoReloadEnabled; }
@@ -120,6 +144,19 @@ private:
std::string shaderLibrary = "shaders";
unsigned short serverPort = 8080;
bool autoReload = true;
unsigned maxTemporalHistoryFrames = 4;
bool enableExternalKeying = false;
};
struct DeckLinkOutputStatus
{
std::string modelName;
bool supportsInternalKeying = false;
bool supportsExternalKeying = false;
bool keyerInterfaceAvailable = false;
bool externalKeyingRequested = false;
bool externalKeyingActive = false;
std::string statusMessage;
};
struct LayerPersistentState
@@ -156,6 +193,7 @@ private:
std::vector<std::string> GetStackPresetNamesLocked() const;
std::string MakeSafePresetFileStem(const std::string& presetName) const;
JsonValue SerializeParameterValue(const ShaderParameterDefinition& definition, const ShaderParameterValue& value) const;
std::string TemporalHistorySourceToString(TemporalHistorySource source) const;
LayerPersistentState* FindLayerById(const std::string& layerId);
const LayerPersistentState* FindLayerById(const std::string& layerId) const;
std::string GenerateLayerId();
@@ -186,6 +224,7 @@ private:
double mFrameBudgetMilliseconds;
double mRenderMilliseconds;
double mSmoothedRenderMilliseconds;
DeckLinkOutputStatus mDeckLinkOutputStatus;
unsigned short mServerPort;
bool mAutoReloadEnabled;
std::chrono::steady_clock::time_point mStartTime;