2026-04-19 02:38:48 +08:00
|
|
|
using XCEngine;
|
|
|
|
|
using XCEngine.Rendering;
|
|
|
|
|
|
2026-04-19 14:11:25 +08:00
|
|
|
namespace XCEngine.Rendering.Universal
|
2026-04-19 00:05:29 +08:00
|
|
|
{
|
|
|
|
|
public abstract class ScriptableRendererFeature
|
|
|
|
|
{
|
2026-04-20 01:14:37 +08:00
|
|
|
private bool m_disposed;
|
|
|
|
|
|
2026-04-19 00:05:29 +08:00
|
|
|
protected ScriptableRendererFeature()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool isActive { get; set; } = true;
|
|
|
|
|
|
2026-04-20 01:14:37 +08:00
|
|
|
internal void ReleaseRuntimeResourcesInstance()
|
|
|
|
|
{
|
|
|
|
|
if (m_disposed)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ReleaseRuntimeResources();
|
|
|
|
|
m_disposed = true;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-19 00:05:29 +08:00
|
|
|
public virtual void Create()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void ConfigureCameraRenderRequest(
|
2026-04-19 15:20:34 +08:00
|
|
|
CameraRenderRequestContext context)
|
2026-04-19 00:05:29 +08:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public virtual void AddRenderPasses(
|
|
|
|
|
ScriptableRenderer renderer,
|
|
|
|
|
RenderingData renderingData)
|
|
|
|
|
{
|
|
|
|
|
}
|
2026-04-19 16:17:38 +08:00
|
|
|
|
|
|
|
|
protected bool HasDirectionalShadow(
|
|
|
|
|
CameraRenderRequestContext context)
|
|
|
|
|
{
|
|
|
|
|
return context != null &&
|
|
|
|
|
InternalCalls
|
|
|
|
|
.Rendering_CameraRenderRequestContext_GetHasDirectionalShadow(
|
|
|
|
|
context.nativeHandle);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void ClearDirectionalShadow(
|
|
|
|
|
CameraRenderRequestContext context)
|
|
|
|
|
{
|
|
|
|
|
if (context == null)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InternalCalls
|
|
|
|
|
.Rendering_CameraRenderRequestContext_ClearDirectionalShadow(
|
|
|
|
|
context.nativeHandle);
|
|
|
|
|
}
|
2026-04-20 01:14:37 +08:00
|
|
|
|
|
|
|
|
protected virtual void ReleaseRuntimeResources()
|
|
|
|
|
{
|
|
|
|
|
}
|
2026-04-19 00:05:29 +08:00
|
|
|
}
|
|
|
|
|
}
|
2026-04-19 02:38:48 +08:00
|
|
|
|