您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
38 行
1.2 KiB
38 行
1.2 KiB
using UnityEngine.Rendering;
|
|
using UnityEngine.Experimental.Rendering.HDPipeline;
|
|
using System.Collections.Generic;
|
|
using System;
|
|
|
|
|
|
namespace UnityEngine.Experimental.Rendering.HDPipeline
|
|
{
|
|
abstract public class SkyRenderer
|
|
{
|
|
abstract public void Build();
|
|
abstract public void Cleanup();
|
|
abstract public void RenderSky(BuiltinSkyParameters builtinParams, SkyParameters skyParameters);
|
|
abstract public bool IsSkyValid(SkyParameters skyParameters);
|
|
|
|
virtual public bool IsParameterValid(SkyParameters skyParameters) { return false; }
|
|
virtual public Type GetSkyParameterType() { return typeof(SkyParameters); }
|
|
}
|
|
|
|
abstract public class SkyRenderer<ParameterType> : SkyRenderer
|
|
where ParameterType : SkyParameters
|
|
{
|
|
override public bool IsParameterValid(SkyParameters skyParameters)
|
|
{
|
|
return GetParameters(skyParameters) != null;
|
|
}
|
|
|
|
override public Type GetSkyParameterType()
|
|
{
|
|
return typeof(ParameterType);
|
|
}
|
|
|
|
protected ParameterType GetParameters(SkyParameters parameters)
|
|
{
|
|
return parameters as ParameterType;
|
|
}
|
|
}
|
|
}
|