Materials in Oolite

From Elite Wiki
Revision as of 12:29, 28 June 2007 by Ahruman (talk | contribs) (New page: :<small>This section applies to Oolite 1.69 and later.</small> Traditionally, the surface appearance of ships in Oolite has been defined entirely by textures specified in the ship’s mode...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This section applies to Oolite 1.69 and later.

Traditionally, the surface appearance of ships in Oolite has been defined entirely by textures specified in the ship’s model file and the smooth attribute. Test release 1.67 added support for shaders, and test release 1.69 expands this to a more flexible material model. Under the new model, the texture file names in model files have been repurposed as material keys. A material key specifies an entry in the ship’s material dictionary, specified in the ship’s shipdata.plist entry. For backwards compatibility, if no material of a given name is found, a material is generated using the material key as a diffuse texture name – providing the same functionality as previous versions of Oolite.

The materials and shaders dictionary

The material dictionary is actually specified as two separate dictionaries in the shipdata.plist entry. The first is called materials, the second shaders. If shader support is available and enabled, the entries in shaders are used in preference to those in materials. Otherwise, shaders is ignored. The entries in the two dictionaries take exactly the same form, however; it is possible to specify a shader in the materials dictionary, and it will simply be ignored if shader support is not available. The rest of this article shall refer to the merged materials and shaders dictionaries as “the material dictionary”.

Material attributes dictionaries

The material dictionary is a property list dictionary whose keys are material keys as defined above, and whose values are material attribute dictionaries. The entries currently supported in a material attribute dictionary are:

Material attribues
Name Type Description
diffuse_map texture specifier A texture specifying the basic colour of the material. This is a “normal” texture, the same as you get without a material dictionary.
diffuse colour specifier Overall diffuse colour of the ship. If both diffuse and diffuse_map are specified, the texture is “dyed” with this colour.

Under construction, will continue this evening. -Ahruman 12:29, 28 June 2007 (BST)