libmaterial - Making Material Files

Material File Format

The general file format is a series of chunks separated by [foo]-style
tags.  For example:

Name: Oak

# a comment
texture: oak.jpg

Comments have a # as the first non-blank character on the line.  Each
chunk has its own internal format.  Unknown chunks are ignored, but
are still copied into modified-versions of the texture.

Here is an sample fully-featured material:
Name: Oak-493
Artist: Jeff Dubrule 
License: GPL

A dark oak with shades of mahogony.  Useful as a school desk texture
as there is a tic-tac-toe game carved into it.

color: 0.6  0.2  0.2  1.0
image: wood13.jpg
resize: 256x256
shininess: 0.2

The 'defaults' chunk sets up the default texture environment.  When
animated textures are permitted, [frame 5], etc. tags will define
frame-specific modifications to the default texture environment.

Here are the currently-used tags (unknown tags will be preserved, but ignored):

  color: The background colour for the material: By having a grayscale
      rock-face image, you can easily create both red rocks and beige
      rocks without making a new image simply by changing the color.
      The format is 'RGBA', where A=1.0 is opaque.
  resize: use imlib to resize the texture to WIDTHxHEIGHT dimensions.
      If this tag is not used, it is assumed that the texture is of
      the appropriate dimensions for the graphics system in use
      (OpenGL assumes that all texture dimensions are powers of 2, for
  shininess: Adjusts how "shiny" the material is: this is simulated by
      adjusting the specular and diffuse reflection properties, and
      (not implemented yet) adjusting the level of environment
  image: pathname of the texture map to use.

Image files may be in any format supported by imlib, currently: PPM,
PGM, TIFF, PNG, XPM, JPEG, EIM, and several others.
Hosted at