您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
54 行
1.7 KiB
54 行
1.7 KiB
using System;
|
|
|
|
namespace UnityEngine.Experimental.Rendering
|
|
{
|
|
public enum PackingRules
|
|
{
|
|
Exact,
|
|
Aggressive
|
|
};
|
|
|
|
[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class | AttributeTargets.Enum)]
|
|
public class GenerateHLSL : System.Attribute
|
|
{
|
|
public PackingRules packingRules;
|
|
public bool needAccessors; // Whether or not to generate the accessors
|
|
public bool needParamDefines; // Wheter or not to generate define for each parameters of the struc
|
|
public int paramDefinesStart; // Start of the generated define
|
|
|
|
public GenerateHLSL(PackingRules rules = PackingRules.Exact, bool needAccessors = true, bool needParamDefines = false, int paramDefinesStart = 1)
|
|
{
|
|
packingRules = rules;
|
|
this.needAccessors = needAccessors;
|
|
this.needParamDefines = needParamDefines;
|
|
this.paramDefinesStart = paramDefinesStart;
|
|
}
|
|
}
|
|
|
|
[AttributeUsage(AttributeTargets.Field)]
|
|
public class SurfaceDataAttributes : System.Attribute
|
|
{
|
|
public enum Semantic
|
|
{
|
|
None,
|
|
Normal,
|
|
Tangent,
|
|
Opacity,
|
|
AmbientOcclusion,
|
|
BakeDiffuseLighting,
|
|
}
|
|
|
|
public string displayName { get; private set; }
|
|
public int priority { get; private set; }
|
|
public int[] filter { get; private set; }
|
|
public Semantic semantic { get; private set; }
|
|
|
|
public SurfaceDataAttributes(string _displayName = "", int _priority = 0, int[] _filter = null, Semantic _semantic = Semantic.None)
|
|
{
|
|
displayName = _displayName;
|
|
priority = _priority;
|
|
filter = _filter;
|
|
semantic = _semantic;
|
|
}
|
|
}
|
|
}
|