mikaxyz/elm-gltf/4.0.1

NOTE: the latest version is 5.0.0

Gltf.Material

A material as defined in the glTF specification.

= Material
{ name : Maybe String
, index : Index
, pbrMetallicRoughness : PbrMetallicRoughness
, normalTexture : Maybe Texture
, normalTextureScale : Float
, occlusionTexture : Maybe Texture
, occlusionTextureStrength : Float
, emissiveTexture : Maybe Texture
, emissiveFactor : Vec3
, doubleSided : Bool
, alphaMode : AlphaMode
}

A material assigned to a Mesh contained in a Node. Use the properties/textures in the material to render it.

type Index
= Index Int

The index of the material.

type Texture
= Texture
{ index : TextureIndex
, texCoord : Int
, extensions : Maybe TextureExtensions
}

Any data associated with a texture

type alias TextureIndex =
TextureIndex

Use this to get a textureWithIndex

= Opaque
| Mask Float
| Blend

AlphaMode of the material to convert to a WebGL.Settings.Setting)

{ baseColorFactor : Vec4
, baseColorTexture : Maybe Texture
, metallicFactor : Float
, roughnessFactor : Float
, metallicRoughnessTexture : Maybe Texture
}

The Material PBR Metallic Roughness of the material.

textureIndex : Texture -> TextureIndex

Texture index from Texture