83 lines
2.2 KiB
C#
83 lines
2.2 KiB
C#
using System;
|
|
using XCEngine;
|
|
using XCEngine.Rendering;
|
|
|
|
namespace XCEngine.Rendering.Universal
|
|
{
|
|
public class UniversalRendererData : ScriptableRendererData
|
|
{
|
|
public UniversalMainSceneData mainScene;
|
|
public ScriptableRendererFeature[] rendererFeatures;
|
|
|
|
public UniversalRendererData()
|
|
{
|
|
mainScene = UniversalMainSceneData.CreateDefault();
|
|
rendererFeatures =
|
|
CreateDefaultRendererFeatures();
|
|
}
|
|
|
|
protected override ScriptableRenderer CreateRenderer()
|
|
{
|
|
return new UniversalRenderer(this);
|
|
}
|
|
|
|
protected override ScriptableRendererFeature[] CreateRendererFeatures()
|
|
{
|
|
return rendererFeatures ??
|
|
Array.Empty<ScriptableRendererFeature>();
|
|
}
|
|
|
|
protected override string GetPipelineRendererAssetKey()
|
|
{
|
|
return "BuiltinForward";
|
|
}
|
|
|
|
protected override string GetRenderSceneSetupPolicyAssetKey()
|
|
{
|
|
return "BuiltinDefaultSceneSetup";
|
|
}
|
|
|
|
protected override string GetCameraFrameStandalonePassAssetKey(
|
|
CameraFrameStage stage)
|
|
{
|
|
switch (stage)
|
|
{
|
|
case CameraFrameStage.ShadowCaster:
|
|
return "BuiltinShadowCaster";
|
|
default:
|
|
return base
|
|
.GetCameraFrameStandalonePassAssetKey(
|
|
stage);
|
|
}
|
|
}
|
|
|
|
protected override string
|
|
GetDirectionalShadowExecutionPolicyAssetKey()
|
|
{
|
|
return "BuiltinDirectionalShadow";
|
|
}
|
|
|
|
internal UniversalMainSceneData GetMainSceneInstance()
|
|
{
|
|
if (mainScene == null)
|
|
{
|
|
mainScene =
|
|
UniversalMainSceneData.CreateDefault();
|
|
}
|
|
|
|
return mainScene;
|
|
}
|
|
|
|
private static ScriptableRendererFeature[]
|
|
CreateDefaultRendererFeatures()
|
|
{
|
|
return new ScriptableRendererFeature[]
|
|
{
|
|
new BuiltinGaussianSplatRendererFeature(),
|
|
new BuiltinVolumetricRendererFeature()
|
|
};
|
|
}
|
|
}
|
|
}
|
|
|