- add standalone pass asset factories for camera frame stages\n- let managed pipeline assets declare stage pass asset keys\n- make universal renderer data explicitly own the builtin shadow caster stage
101 lines
2.4 KiB
C#
101 lines
2.4 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 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 FinalColorSettings GetDefaultFinalColorSettings()
|
|
{
|
|
return FinalColorSettings.CreateDefault();
|
|
}
|
|
|
|
protected virtual string GetPipelineRendererAssetKey()
|
|
{
|
|
return string.Empty;
|
|
}
|
|
|
|
protected virtual string GetPipelineRendererAssetKeyContextual(
|
|
int rendererIndex)
|
|
{
|
|
return GetPipelineRendererAssetKey();
|
|
}
|
|
|
|
protected virtual string GetCameraFrameStandalonePassAssetKey(
|
|
CameraFrameStage stage)
|
|
{
|
|
return string.Empty;
|
|
}
|
|
|
|
protected virtual string
|
|
GetCameraFrameStandalonePassAssetKeyContextual(
|
|
CameraFrameStage stage,
|
|
int rendererIndex)
|
|
{
|
|
return GetCameraFrameStandalonePassAssetKey(
|
|
stage);
|
|
}
|
|
|
|
protected virtual void ReleaseRuntimeResources()
|
|
{
|
|
}
|
|
|
|
protected virtual void SynchronizeRuntimeResourceVersion()
|
|
{
|
|
}
|
|
|
|
protected void SetDirty()
|
|
{
|
|
ReleaseRuntimeResources();
|
|
|
|
unchecked
|
|
{
|
|
++m_runtimeResourceVersion;
|
|
}
|
|
|
|
if (m_runtimeResourceVersion <= 0)
|
|
{
|
|
m_runtimeResourceVersion = 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|