gltf-loader: High level GlTF loader

[ graphics, library, mit, program ] [ Propose Tags ]


Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS],,,
Dependencies base (>=4.11 && <10), binary, bytestring, gltf-codec, gltf-loader, linear, microlens, microlens-platform, optparse-simple, rio (>=, unordered-containers [details]
License MIT
Copyright 2022 Sean Gillespie
Author Sean D Gillespie
Revised Revision 1 made by sgillespie at 2022-11-28T03:22:13Z
Category Graphics
Home page
Bug tracker
Source repo head: git clone
Uploaded by sgillespie at 2022-11-28T03:18:22Z
Executables gltf-loader
Downloads 216 total (15 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2022-11-28 [all 1 reports]

Readme for gltf-loader-

[back to package description]

Haskell GlTF Loader

pipeline status

A high level GlTF loader


In order to build or install you will need

  • GHC (Tested on 9.0.2)
  • Stack (Tested on 2.7.5)


Build the project

stack setup
stack build

Run the tests (if desired)

stack test

API Documentation

To build the documentation, run

stack haddock

API Examples

Use fromFile or fromBytestring to load a GlTF scene

import Text.GLTF.Loader (fromFile)

-- ...
-- Load a GLTF scene from a file
loadGltfFile :: IO (Either Errors Gltf)
loadGltfFile = fromFile "./cube.gltf"

Then you can, for example, get all the vertices:

getVertices :: Gltf -> [V3 Float]
getVertices gltf = concatMap getVertices' (gltf ^. _meshes)
  where getVertices' mesh = concatMap (^. _meshPrimitivePositions) (mesh ^. _meshPrimitives)


This includes a CLI utility to inspect GlTF files

gltf-loader --help


Currently, only geometries and PBR materials are supported, but we hope to support the majority of GlTF features:

  • Animations
  • Asset
  • Cameras
  • Images
  • Materials
    • PBR Metallic Roughness
    • Textures
  • Meshes
    • Positions
    • Indices
    • Normals
    • Texture Coordinates
  • Nodes
  • Samplers
  • Skins


Sean Gillespie


This project is largely based on by Alexander Bondarenko


This project is licensed under the MIT License. See LICENSE