docs.unity3d.com
    Show / Hide Table of Contents

    Class PreviewSurfaceSample

    The following is based on the Pixar specification found here: https://graphics.pixar.com/usd/docs/UsdPreviewSurface-Proposal.html

    Inheritance
    Object
    SampleBase
    ShaderSample
    PreviewSurfaceSample
    UnityPreviewSurfaceSample
    Inherited Members
    ShaderSample.id
    ShaderSample.GetInputParameters()
    ShaderSample.GetInputTextures()
    SampleBase.Free()
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: USD.NET.Unity
    Syntax
    [Serializable]
    [UsdSchema("Shader")]
    public class PreviewSurfaceSample : ShaderSample

    Constructors

    PreviewSurfaceSample()

    Declaration
    public PreviewSurfaceSample()

    Fields

    clearcoat

    Second specular lobe amount. The color is white.

    Declaration
    [InputParameter("_Clearcoat")]
    public Connectable<float> clearcoat
    Field Value
    Type Description
    Connectable<Single>

    clearcoatRoughness

    Roughness for the second specular lobe.

    Declaration
    [InputParameter("_ClearcoatRoughness")]
    public Connectable<float> clearcoatRoughness
    Field Value
    Type Description
    Connectable<Single>

    diffuseColor

    When using metallic workflow this is interpreted as albedo.

    Declaration
    [InputParameter("_DiffuseColor")]
    public Connectable<Vector3> diffuseColor
    Field Value
    Type Description
    Connectable<Vector3>

    displacement

    Displacement in the direction of the normal.

    Declaration
    [InputParameter("_Displacement")]
    public Connectable<float> displacement
    Field Value
    Type Description
    Connectable<Single>

    emissiveColor

    Emissive component.

    Declaration
    [InputParameter("_EmissiveColor")]
    public Connectable<Vector3> emissiveColor
    Field Value
    Type Description
    Connectable<Vector3>

    ior

    Index of Refraction to be used for translucent objects.

    Declaration
    [InputParameter("_Ior")]
    public Connectable<float> ior
    Field Value
    Type Description
    Connectable<Single>

    metallic

    Use 1 for metallic surfaces and 0 for non-metallic.

    • If metallic is 1.0, then F0(reflectivity at 0 degree incidence) will be derived from ior( (1-ior)/(1+ior) )^2, then multiplied by Albedo; while edge F90 reflectivity will simply be the Albedo. (As an option, you can set ior to 0 such that F0 becomes equal to F90 and thus the Albedo).

    • If metallic is 0.0, then Albedo is ignored; F0 is derived from ior and F90 is white. In between, we interpolate.

    Declaration
    [InputParameter("_Metallic")]
    public Connectable<float> metallic
    Field Value
    Type Description
    Connectable<Single>

    normal

    Expects normal in tangent space [(-1,-1,-1), (1,1,1)] This means your texture reader implementation should provide data to this node that is properly scaled and ready to be consumed as a tangent space normal.

    Declaration
    [InputParameter("_Normal")]
    public Connectable<Vector3> normal
    Field Value
    Type Description
    Connectable<Vector3>

    occlusion

    Extra information about the occlusion of different parts of the mesh that this material is applied to. Occlusion only makes sense as a surface-varying signal, and pathtracers will likely choose to ignore it. An occlusion value of 0.0 means the surface point is fully occluded by other parts of the surface, and a value of 1.0 means the surface point is completely unoccluded by other parts of the surface.

    Declaration
    [InputParameter("_Occlusion")]
    public Connectable<float> occlusion
    Field Value
    Type Description
    Connectable<Single>

    opacity

    When opacity is 1.0 then the prim is fully opaque, if it is smaller than 1.0 then the prim is translucent, when it is 0 the prim is transparent.

    Declaration
    [InputParameter("_Opacity")]
    public Connectable<float> opacity
    Field Value
    Type Description
    Connectable<Single>

    opacityThreshold

    The opacityThreshold input is useful for creating geometric cut-outs based on the opacity input.

    Declaration
    [InputParameter("_OpacityThreshold")]
    public Connectable<float> opacityThreshold
    Field Value
    Type Description
    Connectable<Single>
    Remarks

    A value of 0.0 indicates that no masking is applied to the opacity input, while a value greater than 0.0 indicates that rendering of the surface is limited to the areas where the opacity is greater than that value. A classic use of opacityThreshold is to create a leaf from an opacity input texture, in that case the threshold determines the parts of the opacity texture that will be fully transparent and not receive lighting. Note that when opacityThreshold is greater than zero, then opacity modulates the presence of the surface, rather than its transparency - pathtracers might implement this as allowing ((1 - opacity) * 100) % of the rays that do intersect the object to instead pass through it unhindered, and rasterizers may interpret opacity as pixel coverage. Thus, opacityThreshold serves as a switch for how the opacity input is interpreted; this "translucent or masked" behavior is common in engines and renderers, and makes the UsdPreviewSurface easier to interchange. It does imply, however, that it is not possible to faithfully recreate a glassy/translucent material that also provides an opacity-based mask... so no single-polygon glass leaves.

    outputs

    Declaration
    [UsdNamespace("outputs")]
    public PreviewSurfaceSample.Outputs outputs
    Field Value
    Type Description
    PreviewSurfaceSample.Outputs

    roughness

    Roughness for the specular lobe. The value ranges from 0 to 1, which goes from a perfectly specular surface at 0.0 to maximum roughness of the specular lobe. This value is usually squared before use with a GGX or Beckmann lobe.

    Declaration
    [InputParameter("_Roughness")]
    public Connectable<float> roughness
    Field Value
    Type Description
    Connectable<Single>

    specularColor

    Specular color to be used. This is the color at 0 incidence. Edge color is assumed white. Transition between the two colors according to Schlick fresnel approximation.

    Declaration
    [InputParameter("_SpecularColor")]
    public Connectable<Vector3> specularColor
    Field Value
    Type Description
    Connectable<Vector3>

    useSpecularWorkflow

    This node can fundamentally operate in two modes : Specular workflow where you provide a texture/value to the "specularColor" input. Or, Metallic workflow where you provide a texture/value to the "metallic" input. Depending on the 0 or 1 value of this parameter, the following parameters are conditionally enabled.

    Declaration
    [InputParameter("_UseSpecularWorkflow")]
    public Connectable<int> useSpecularWorkflow
    Field Value
    Type Description
    Connectable<Int32>
    Back to top
    Copyright © 2023 Unity Technologies
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on Thursday, October 19, 2023