这是一个使用 Unity HDRP DXR 的startup Unity 项目,使用了 Unity 的实时光线追踪ray tracing功能。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

47 行
2.0 KiB

//-----------------------------------------------------------------------------
// Configuration
//-----------------------------------------------------------------------------
namespace UnityEngine.Rendering.HighDefinition
{
[GenerateHLSL(PackingRules.Exact)]
public enum HDShadowFilteringQuality
{
Low = 0,
Medium = 1,
High = 2,
}
[GenerateHLSL(PackingRules.Exact)]
public enum ShaderOptions
{
CameraRelativeRendering = 1, // Rendering sets the origin of the world to the position of the primary (scene view) camera
PreExposition = 1,
PrecomputedAtmosphericAttenuation = 0, // Precomputes atmospheric attenuation for the directional light on the CPU, which makes it independent from the fragment's position, which is faster but wrong
#if ENABLE_RAYTRACING
Raytracing = 1,
#else
Raytracing = 0,
#endif
#if ENABLE_VR
XrMaxViews = 2, // Used for single-pass rendering (with fast path in vertex shader code when forced to 2)
#else
XrMaxViews = 1,
#endif
AreaLights = 1,
DeferredShadowFiltering = HDShadowFilteringQuality.Medium
};
// Note: #define can't be use in include file in C# so we chose this way to configure both C# and hlsl
// Changing a value in this enum Config here require to regenerate the hlsl include and recompile C# and shaders
public class ShaderConfig
{
public static int s_CameraRelativeRendering = (int)ShaderOptions.CameraRelativeRendering;
public static int s_PreExposition = (int)ShaderOptions.PreExposition;
public static int s_XrMaxViews = (int)ShaderOptions.XrMaxViews;
public static int s_PrecomputedAtmosphericAttenuation = (int)ShaderOptions.PrecomputedAtmosphericAttenuation;
public static int s_AreaLights = (int)ShaderOptions.AreaLights;
public static HDShadowFilteringQuality s_DeferredShadowFiltering = (HDShadowFilteringQuality)ShaderOptions.DeferredShadowFiltering;
}
}