您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
75 行
2.5 KiB
75 行
2.5 KiB
using UnityEngine.Rendering;
|
|
|
|
namespace UnityEngine.Experimental.Rendering.HDPipeline
|
|
{
|
|
public partial class Hair : RenderPipelineMaterial
|
|
{
|
|
//-----------------------------------------------------------------------------
|
|
// SurfaceData
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Main structure that store the user data (i.e user input of master node in material graph)
|
|
[GenerateHLSL(PackingRules.Exact, false, true, 2570)]
|
|
public struct SurfaceData
|
|
{
|
|
[SurfaceDataAttributes("Diffuse Color", false, true)]
|
|
public Vector3 diffuseColor;
|
|
[SurfaceDataAttributes("Specular Occlusion")]
|
|
public float specularOcclusion;
|
|
|
|
[SurfaceDataAttributes("Normal", true)]
|
|
public Vector3 normalWS;
|
|
[SurfaceDataAttributes("Smoothness")]
|
|
public float perceptualSmoothness;
|
|
|
|
[SurfaceDataAttributes("Ambient Occlusion")]
|
|
public float ambientOcclusion;
|
|
|
|
// MaterialId dependent attribute
|
|
|
|
// standard
|
|
[SurfaceDataAttributes("Tangent", true)]
|
|
public Vector3 tangentWS;
|
|
[SurfaceDataAttributes("Anisotropy")]
|
|
public float anisotropy; // anisotropic ratio(0->no isotropic; 1->full anisotropy in tangent direction)
|
|
|
|
[SurfaceDataAttributes("FrontFacing")]
|
|
public bool isFrontFace;
|
|
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// BSDFData
|
|
//-----------------------------------------------------------------------------
|
|
|
|
[GenerateHLSL(PackingRules.Exact, false, true, 2600)]
|
|
public struct BSDFData
|
|
{
|
|
[SurfaceDataAttributes("", false, true)]
|
|
public Vector3 diffuseColor;
|
|
|
|
public Vector3 fresnel0;
|
|
|
|
public float specularOcclusion;
|
|
|
|
[SurfaceDataAttributes("", true)]
|
|
public Vector3 normalWS;
|
|
public float perceptualRoughness;
|
|
public float roughness;
|
|
|
|
public int materialId;
|
|
|
|
// MaterialId dependent attribute
|
|
|
|
[SurfaceDataAttributes("", true)]
|
|
public Vector3 tangentWS;
|
|
[SurfaceDataAttributes("", true)]
|
|
public Vector3 bitangentWS;
|
|
public float roughnessT;
|
|
public float roughnessB;
|
|
public float anisotropy;
|
|
|
|
public bool isFrontFace; //
|
|
};
|
|
}
|
|
}
|