terminal-3d-graphics: A terminal 3D rasteriser with textures, portals, and baked lighting

[ graphics, library, program ] [ Propose Tags ] [ Report a vulnerability ]

Simple multi-module Haskell terminal 3D engine. Can be used as a library or compiled to a demo executable.


[Skip to Readme]

Modules

  • Terminal3D

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.2.0.0
Dependencies array (>=0.5.7 && <0.6), base (>=4.20.0 && <4.21), bytestring (>=0.12.1 && <0.13), comonad (>=5.0.10 && <5.1), deepseq (>=1.5.0 && <1.6), parallel (>=3.3.0 && <3.4), process (>=1.6.19 && <1.7), terminal-3d-graphics, transformers (>=0.6.1 && <0.7) [details]
License Unlicense
Author Larz Piechocki
Maintainer LarzPiechocki@gmail.com
Uploaded by LarzP123 at 2026-10-11T15:16:32Z
Category Graphics
Home page https://github.com/LarzP123/terminal-3d-graphics
Bug tracker https://github.com/LarzP123/terminal-3d-graphics/issues
Source repo head: git clone https://github.com/LarzP123/terminal-3d-graphics
Distributions
Executables t3d
Downloads 3 total (3 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2026-10-11 [all 2 reports]

Readme for terminal-3d-graphics-0.2.0.0

[back to package description]

Terminal3DGraphics

This is a little 3D engine written in Haskell that draws straight into your terminal. You can walk around the scene with keyboard input, and it all renders in true-colour using ANSI half-block characters (▀), which lets each character cell show two stacked "pixels". This works on both Linux and Windows and also exports as a library if anyone wants to make custom 3D worlds.

Demo Portal World with Recursive Portal

Demo Chess World in Low Resolution

Demo Rainbow World

Features

  • Movement around the worlds is done via entering keys on the keyboard and pressing enter.
  • Allows for Portals with recursive views through
  • Allows for selections of post processing and super sampling anti-aliasing
  • Has multiple demo worlds
  • Translations are selectable in the program
  • Allows customizable screen size
  • Pipelines auto-build versions for X64 Linux and Windows

Building the demo

To build with Cabal and have it actually run quickly

cabal build all
cabal run t3d

To run with the interpreter

ghci -isrc -iapp -package parallel -package bytestring -package transformers -package array -package deepseq -package comonad -package process app/Main.hs
:main

Using as a library

Add to your your-project.cabal:

build-depends: terminal-3d-graphics

Then in your Haskell source:

import Terminal3D
import Control.Monad.Trans.State (evalStateT)

main :: IO ()
main = do
    tex <- readBMP "myTexture.bmp"
    let tris   = cubeFormer (texWallFormer tex)
        lights = [Ray (Vec3 0.5 1 0.5), Ambient 0.3]
        world  = World (map (bakeLight lights) tris) Nothing
    evalStateT (loop world) def