Boat Attack使用了Universal RP的许多新图形功能,可以用于探索 Universal RP 的使用方式和技巧。
您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

42 行
1.6 KiB

using System;
namespace UnityEngine.Rendering.Universal
{
public enum FilmGrainLookup
{
Thin1,
Thin2,
Medium1,
Medium2,
Medium3,
Medium4,
Medium5,
Medium6,
Large01,
Large02,
Custom
}
[Serializable, VolumeComponentMenu("Post-processing/FilmGrain")]
public sealed class FilmGrain : VolumeComponent, IPostProcessComponent
{
[Tooltip("The type of grain to use. You can select a preset or provide your own texture by selecting Custom.")]
public FilmGrainLookupParameter type = new FilmGrainLookupParameter(FilmGrainLookup.Thin1);
[Tooltip("Amount of vignetting on screen.")]
public ClampedFloatParameter intensity = new ClampedFloatParameter(0f, 0f, 1f);
[Tooltip("Controls the noisiness response curve based on scene luminance. Higher values mean less noise in light areas.")]
public ClampedFloatParameter response = new ClampedFloatParameter(0.8f, 0f, 1f);
[Tooltip("A tileable texture to use for the grain. The neutral value is 0.5 where no grain is applied.")]
public NoInterpTextureParameter texture = new NoInterpTextureParameter(null);
public bool IsActive() => intensity.value > 0f && (type.value != FilmGrainLookup.Custom || texture.value != null);
public bool IsTileCompatible() => true;
}
[Serializable]
public sealed class FilmGrainLookupParameter : VolumeParameter<FilmGrainLookup> { public FilmGrainLookupParameter(FilmGrainLookup value, bool overrideState = false) : base(value, overrideState) { } }
}