MATER(nged)

NAME

mater - Assigns shader parameters, RGB color, and inheritance to an existing combination.

SYNOPSIS

mater [-s] {combination} [shader_parameters [RGB [inheritance]]]

mater {-d} {source}

mater {-d} {clear}

mater {-d} {import} [-v] {file.density}

mater {-d} {export} {file.density}

mater {-d} {validate} {file.density}

mater {-d} {get} [--tol <tolerance>] [--id [[>|<][=]id]|[id pattern]] [--density [[>|<][=]val] [--name pattern] [pattern]

mater {-d} {set} {id,density,name}

mater {-d} {map} {--ids-from-names} {-d density_file} {-m map_file} [density_file] [map_file]

mater {-d} {map} {--names-from-ids} [density_file]

DESCRIPTION

In its default mode, mater assigns shader parameters, RGB color, and inheritance to an existing combination. The information may be included on the command line; otherwise the user will be prompted for it. Some available shaders are:

  • bump — bump maps.

  • bwtexture — black and white texture maps.

  • camo — camouflage.

  • checker — checkerboard design.

  • cloud — 2D Geoffrey Gardner style cloud texture map.

  • envmap — environment mapping.

  • fakestar — a fake star pattern.

  • fbmbump — fbm noise applied to surface normal.

  • fbmcolor — fbm noise applied to color.

  • fire — flames simulated with turbulence noise.

  • glass — Phong shader with values set to simulate glass.

  • gravel — turbulence noise applied to color and surface normal.

  • light — light source.

  • marble — marble texture.

  • mirror — Phong shader with values set to simulate mirror.

  • plastic — Phong shader with values set to simulate plastic.

  • rtrans — random transparency.

  • scloud — 3D cloud shader.

  • spm — spherical texture maps.

  • stack — allows stacking of shaders.

  • stxt — shape texture mapping.

  • texture — full color texture mapping.

  • turbump — turbulence noise applied to surface normals.

  • turcolor — turbulence noise applied to color.

  • wood — wood texture.

DENSITY DATABASE MANIPULATION

In the event the .g file has an internal density database defined (or the user wishes to define such a database) the mater command provides a number of options.

To import a density file into the .g file, use the import subcommand. By default this will update and append to an existing database if present. If the -v is added, a validation will be performed on the specified density file before import. To completely replace any pre-existing definitions in the database, first run the clear subcommand. To write out the current density definitions to a file use the export subcommand.

To simply test a density file for validity without attempting to import it, use the validate subcommand. The source subcommand will report where commands using density information will draw their data from - if data is present in the .g file the current database name will be returned, otherwise the system path to the currently active .density file will be returned.

For manipulation of subsets of the data, the get and set subcommands are provided. get will return either one or a set of tuples matching the provided patterns. For density matching a tolerance may be specified to allow for approximate matches. The glob style of pattern matching is supported.

DENSITY DATABASE MANIPULATION - MAPPING MODE

The map mode of operation uses density information (either from a file or from the current database) to syncronize the material_id and material_name properties of objects. The --ids-from-names mode will use material_name properties, perform a lookup on the density database to find a corresponding id number, and update the material_id. If an optional mapping file is supplied, the name lookup will also find id assignments based on the name equivalencies specified by the map.

For situations where a file has material_id attributes but no names, the --names-from-ids option will use density information to assign material_name attributes to those objects whose material_id values are present. It will also update existing material_name values.

EXAMPLES

The example shows the use of the mater command to assign shader parameters, color, and inheritance to a region.

Example 1. Assigning shader parameters, color, and inheritance to a region.

mged> mater region1 "plastic {tr 0.5 re 0.2}" 210 100 100 0

Sets region1 to use the plastic shader with 50% transparency, 20% reflectivity, a base color of (210 100 100), and inheritance set to 0.

Example 2. Importing Density Data

mged> mater -d import /home/user/.density

After this operation, the density valued defined in /home/user/.density are now stored in the .g file.

Example 3. Viewing Density Data

mged> mater -d get --name *Rubber\*

Lists all density entries with a material name containing "Rubber".

Example 4. Names from IDs

mged> mater -d map --names-from-ids /home/user/.density

Assigns material_name names from a density file assuming existing material_id attributes.

Example 5. IDs from Names

mged> mater -d map --ids-from-names /home/user/.density /home/user/mapping_file

Assigning or updating material_id attributes based on material_name attribute values, density file names, and mapping file associations.

AUTHOR

BRL-CAD Team

This software is Copyright (c) 1989-2021 by the United States Government as represented by U.S. Army Research Laboratory.

BUG REPORTS

Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org