Class BuiltInMaterialGenerator
Converts glTF materials to Unity materials for the Built-in Render Pipeline
Implements
Inherited Members
Namespace: GLTFast.Materials
Assembly: glTFast.dll
Syntax
public class BuiltInMaterialGenerator : MaterialGenerator, IMaterialGenerator
Methods
GenerateDefaultMaterial(bool)
Creates a fallback material to be assigned to nodes without a material.
Declaration
protected override Material GenerateDefaultMaterial(bool pointsSupport = false)
Parameters
Type | Name | Description |
---|---|---|
bool | pointsSupport | If true, material has to support meshes with points topology |
Returns
Type | Description |
---|---|
Material | fallback material |
Overrides
GenerateMaterial(MaterialBase, IGltfReadable, bool)
Converts a glTF material into a Unity Material. gltfMaterial might reference textures, which can be queried from gltf.
Declaration
public override Material GenerateMaterial(MaterialBase gltfMaterial, IGltfReadable gltf, bool pointsSupport = false)
Parameters
Type | Name | Description |
---|---|---|
MaterialBase | gltfMaterial | Source glTF material |
IGltfReadable | gltf | Interface to a loaded glTF's resources (e.g. textures) |
bool | pointsSupport | If true, material has to support meshes with points topology. |
Returns
Type | Description |
---|---|
Material | Generated Unity Material |
Overrides
SetAlphaModeBlend(Material)
Configures material for alpha blending.
Declaration
public static void SetAlphaModeBlend(Material material)
Parameters
Type | Name | Description |
---|---|---|
Material | material | Target material |
SetAlphaModeMask(Material, float)
Configures material for alpha masking.
Declaration
public static void SetAlphaModeMask(Material material, float alphaCutoff)
Parameters
Type | Name | Description |
---|---|---|
Material | material | Target material |
float | alphaCutoff | Threshold value for alpha masking |
SetAlphaModeTransparent(Material)
Configures material for transparency.
Declaration
public static void SetAlphaModeTransparent(Material material)
Parameters
Type | Name | Description |
---|---|---|
Material | material | Target material |
SetOpaqueMode(Material)
Configures material to be opaque.
Declaration
public static void SetOpaqueMode(Material material)
Parameters
Type | Name | Description |
---|---|---|
Material | material | Target material |