111 lines
2.7 KiB
C#
111 lines
2.7 KiB
C#
using XCEngine;
|
|
|
|
namespace XCEngine.Rendering
|
|
{
|
|
public abstract class ScriptableRenderPipelineAsset : RenderPipelineAsset
|
|
{
|
|
private int m_runtimeResourceVersion = 1;
|
|
|
|
protected ScriptableRenderPipelineAsset()
|
|
{
|
|
}
|
|
|
|
internal void ReleaseRuntimeResourcesInstance()
|
|
{
|
|
ReleaseRuntimeResources();
|
|
}
|
|
|
|
internal void ConfigureCameraFramePlanInstance(
|
|
ScriptableRenderPipelinePlanningContext context)
|
|
{
|
|
ConfigureCameraFramePlan(context);
|
|
}
|
|
|
|
internal bool ConfigureRenderSceneSetupInstance(
|
|
RenderSceneSetupContext context)
|
|
{
|
|
return ConfigureRenderSceneSetup(context);
|
|
}
|
|
|
|
internal bool ConfigureDirectionalShadowExecutionStateInstance(
|
|
DirectionalShadowExecutionContext context)
|
|
{
|
|
return ConfigureDirectionalShadowExecutionState(
|
|
context);
|
|
}
|
|
|
|
internal int GetRuntimeResourceVersionInstance()
|
|
{
|
|
SynchronizeRuntimeResourceVersion();
|
|
return m_runtimeResourceVersion;
|
|
}
|
|
|
|
protected virtual ScriptableRenderPipeline CreatePipeline()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
protected virtual void ConfigureCameraRenderRequest(
|
|
CameraRenderRequestContext context)
|
|
{
|
|
}
|
|
|
|
protected virtual void ConfigureCameraFramePlan(
|
|
ScriptableRenderPipelinePlanningContext context)
|
|
{
|
|
}
|
|
|
|
protected virtual bool ConfigureRenderSceneSetup(
|
|
RenderSceneSetupContext context)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
protected virtual bool ConfigureDirectionalShadowExecutionState(
|
|
DirectionalShadowExecutionContext context)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
protected virtual FinalColorSettings GetDefaultFinalColorSettings()
|
|
{
|
|
return FinalColorSettings.CreateDefault();
|
|
}
|
|
|
|
private protected virtual bool UsesNativeCameraFramePlanBaseline()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
private protected virtual bool UsesNativeCameraFramePlanBaselineContextual(
|
|
int rendererIndex)
|
|
{
|
|
return UsesNativeCameraFramePlanBaseline();
|
|
}
|
|
|
|
protected virtual void ReleaseRuntimeResources()
|
|
{
|
|
}
|
|
|
|
protected virtual void SynchronizeRuntimeResourceVersion()
|
|
{
|
|
}
|
|
|
|
protected void SetDirty()
|
|
{
|
|
ReleaseRuntimeResources();
|
|
|
|
unchecked
|
|
{
|
|
++m_runtimeResourceVersion;
|
|
}
|
|
|
|
if (m_runtimeResourceVersion <= 0)
|
|
{
|
|
m_runtimeResourceVersion = 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|