'\" t
.\"     Title: MATER
.\"    Author: [see the "AUTHOR" section]
.\" Generator: DocBook XSL-NS Stylesheets v1.76.1 <http://docbook.sf.net/>
.\"      Date: 04/13/2022
.\"    Manual: BRL-CAD User Commands
.\"    Source: BRL-CAD
.\"  Language: English
.\"
.TH "MATER" "nged" "04/13/2022" "BRL\-CAD" "BRL\-CAD User Commands"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
mater \- Assigns shader parameters, RGB color, and inheritance to an existing combination\&.
.SH "SYNOPSIS"
.HP \w'\fBmater\fR\ 'u
\fBmater\fR [\-s] {\fIcombination\fR} [shader_parameters\ [RGB\ [inheritance]]]
.HP \w'\fBmater\fR\ 'u
\fBmater\fR {\-d} {source}
.HP \w'\fBmater\fR\ 'u
\fBmater\fR {\-d} {clear}
.HP \w'\fBmater\fR\ 'u
\fBmater\fR {\-d} {import} [\-v] {\fIfile\&.density\fR}
.HP \w'\fBmater\fR\ 'u
\fBmater\fR {\-d} {export} {\fIfile\&.density\fR}
.HP \w'\fBmater\fR\ 'u
\fBmater\fR {\-d} {validate} {\fIfile\&.density\fR}
.HP \w'\fBmater\fR\ 'u
\fBmater\fR {\-d} {get} [\-\-tol\ <tolerance>] [\-\-id\ \fI[[>|<][=]id]|[id\ pattern]\fR] [\-\-density\ \fI[[>|<][=]val\fR] [\-\-name\ \fIpattern\fR] [\fIpattern\fR]
.HP \w'\fBmater\fR\ 'u
\fBmater\fR {\-d} {set} {\fIid,density,name\fR}
.HP \w'\fBmater\fR\ 'u
\fBmater\fR {\-d} {map} {\-\-ids\-from\-names} {\-d\ \fIdensity_file\fR} {\-m\ \fImap_file\fR} [\fIdensity_file\fR] [\fImap_file\fR]
.HP \w'\fBmater\fR\ 'u
\fBmater\fR {\-d} {map} {\-\-names\-from\-ids} [\fIdensity_file\fR]
.SH "DESCRIPTION"
.PP
In its default mode,
\fBmater\fR
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:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
bump \-\- bump maps\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
bwtexture \-\- black and white texture maps\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
camo \-\- camouflage\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
checker \-\- checkerboard design\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
cloud \-\- 2D Geoffrey Gardner style cloud texture map\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
envmap \-\- environment mapping\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
fakestar \-\- a fake star pattern\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
fbmbump \-\- fbm noise applied to surface normal\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
fbmcolor \-\- fbm noise applied to color\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
fire \-\- flames simulated with turbulence noise\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
glass \-\- Phong shader with values set to simulate glass\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
gravel \-\- turbulence noise applied to color and surface normal\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
light \-\- light source\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
marble \-\- marble texture\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
mirror \-\- Phong shader with values set to simulate mirror\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
plastic \-\- Phong shader with values set to simulate plastic\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
rtrans \-\- random transparency\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
scloud \-\- 3D cloud shader\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
spm \-\- spherical texture maps\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
stack \-\- allows stacking of shaders\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
stxt \-\- shape texture mapping\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
texture \-\- full color texture mapping\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
turbump \-\- turbulence noise applied to surface normals\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
turcolor \-\- turbulence noise applied to color\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
wood \-\- wood texture\&.
.RE
.SH "DENSITY DATABASE MANIPULATION"
.PP
In the event the \&.g file has an internal density database defined (or the user wishes to define such a database) the
\fBmater\fR
command provides a number of options\&.
.PP
To import a density file into the \&.g file, use the
\fBimport\fR
subcommand\&. By default this will update and append to an existing database if present\&. If the
\fB\-v\fR
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
\fBclear\fR
subcommand\&. To write out the current density definitions to a file use the
\fBexport\fR
subcommand\&.
.PP
To simply test a density file for validity without attempting to import it, use the
\fBvalidate\fR
subcommand\&. The
\fBsource\fR
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\&.
.PP
For manipulation of subsets of the data, the
\fBget\fR
and
\fBset\fR
subcommands are provided\&.
\fBget\fR
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\&.
.SH "DENSITY DATABASE MANIPULATION - MAPPING MODE"
.PP
The
\fBmap\fR
mode of operation uses density information (either from a file or from the current database) to syncronize the
\fBmaterial_id\fR
and
\fBmaterial_name\fR
properties of objects\&. The
\fB\-\-ids\-from\-names\fR
mode will use
\fBmaterial_name\fR
properties, perform a lookup on the density database to find a corresponding id number, and update the
\fBmaterial_id\fR\&. If an optional mapping file is supplied, the name lookup will also find id assignments based on the name equivalencies specified by the map\&.
.PP
For situations where a file has
\fBmaterial_id\fR
attributes but no names, the
\fB\-\-names\-from\-ids\fR
option will use density information to assign
\fBmaterial_name\fR
attributes to those objects whose
\fBmaterial_id\fR
values are present\&. It will also update existing
\fBmaterial_name\fR
values\&.
.SH "EXAMPLES"
.PP
The example shows the use of the
\fBmater\fR
command to assign shader parameters, color, and inheritance to a region\&.
.PP
\fBExample\ \&1.\ \&Assigning shader parameters, color, and inheritance to a region.\fR
.PP
mged> \fBmater region1 "plastic {tr 0\&.5 re 0\&.2}" 210 100 100 0 \fR
.RS 4
Sets
\fIregion1\fR
to use the plastic shader with 50% transparency, 20% reflectivity, a base color of (210 100 100), and inheritance set to 0\&.
.RE
.PP
\fBExample\ \&2.\ \&Importing Density Data\fR
.PP
mged> \fBmater \-d import /home/user/\&.density\fR
.RS 4
After this operation, the density valued defined in /home/user/\&.density are now stored in the \&.g file\&.
.RE
.PP
\fBExample\ \&3.\ \&Viewing Density Data\fR
.PP
mged> \fBmater \-d get \-\-name \e*Rubber\e*\fR
.RS 4
Lists all density entries with a material name containing "Rubber"\&.
.RE
.PP
\fBExample\ \&4.\ \&Names from IDs\fR
.PP
mged> \fBmater \-d map \-\-names\-from\-ids /home/user/\&.density\fR
.RS 4
Assigns
\fBmaterial_name\fR
names from a density file assuming existing
\fBmaterial_id\fR
attributes\&.
.RE
.PP
\fBExample\ \&5.\ \&IDs from Names\fR
.PP
mged> \fBmater \-d map \-\-ids\-from\-names /home/user/\&.density /home/user/mapping_file \fR
.RS 4
Assigning or updating
\fBmaterial_id\fR
attributes based on
\fBmaterial_name\fR
attribute values, density file names, and mapping file associations\&.
.RE
.SH "AUTHOR"
.PP
BRL\-CAD Team
.SH "BUG REPORTS"
.PP
Reports of bugs or problems should be submitted via electronic mail to
devs@brlcad\&.org
