The SML3d project is a collection of libraries that support programming real-time 3D graphic applications in Standard ML using the OpenGL library. The current version of the library is based on OpenGL 2.1, but we expect to radically revise the design to better fit with the 3.x and 4.x versions of the API.

Libraries

The following components of the SML3d project are fairly complete and functional:

SML3d

The SML3d library (sml3d.mlb) is the core library that provides access to OpenGL, as well as support for common graphics types and operations, such as vectors, matrices, quaternions, cameras, and view frustums. It is currently based on the OpenGL 2.1 API, but we plan to move to a design that is compatible with the OpenGL 4.x API in the near future.

GLUT

The GLUT (GL Utility) library is a portable library for the system specific aspects of a 3d graphics application. It includes support for creating windows and handling keyboard and mouse input.

Image I/O

The Image I/O library provides support for reading and writing a number of common image-file formats.

Movie generation

The movie generation library provides support for generating MPEG4 and x264 encoded videos from an SML3d application. This library requires that mencoder (part of the mplayer system) be installed.

Object-file loaders

There are several libraries for loading some common 3D object-file formats. These include Wavefront obj and mtl files, MD3 files, and MD5 files.

OpenAL

This library provides an SML API for the OpenAL 1.1 library for sound as well as some support for loading WAV files.

OpenCL

The OpenCL library provides an SML interface to the host-side OpenCL API. The OpenCL library is also distributed as a standalone library in a separate download.

Raw data

The raw-data library handles the interface to arrays of scalar C types (e.g., arrays of unsigned 16-bit integers). These arrays are used to implement vertex buffers, textures, and images for OpenGL, as well as to implement the memory objects used in the OpenCL library.

In progress

These libraries are not quite ready for prime time.

Particles

To support particle systems, we are developing a combinator library for specifying particle systems in a declarative style. These combinators can either be interpreted on the CPU or compiled to run on the GPU as either GLSL or OpenCL code. The design of the combinators is inspired by the Particle System API developed by David McAllister.

Shaders

We are working on a combinator library for specifying shaders in a modular way. These shaders will be compiled to GLSL code on the fly.

Planned libraries

SDL

This library will provide an alternative to GLUT, based on SDL, for handling the window-system and input aspects of an application.

Mesh

Character animation