MATER(nged)

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

πŸ“… published 7.44.0, from nixpkgs unstable

🌸 NAME 🌸

okay so bestie, this is MATER(nged) from the BRL-CAD User Commands corner, and the main character is the mater command. It assigns shader parameters, RGB color, and inheritance to an existing combination. That's the whole NAME vibe. Periodt. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

Here's the exact shape of the command, no cap:

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]
bestie, we are preserving the brackets and spacing exactly as printed, even when they look like they're doing a little too much. 😭

✨ 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.

that's the shader menu, bestie β€” no gatekeeping, all 24 of them are right there. 🫢


🧚 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.

  • import β€” 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.
  • clear β€” To completely replace any pre-existing definitions in the database, first run the clear subcommand.
  • export β€” To write out the current density definitions to a file use the export subcommand.
  • validate β€” To simply test a density file for validity without attempting to import it, use the validate subcommand.
  • source β€” 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.
  • get and set β€” 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.

lowkey iconic how get can pull one tuple or a whole little squad of them, matching patterns and tolerance and all that. πŸ’–


🌈 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.
dash check, bestie: the synopsis uses --ids-from-names and --names-from-ids with two hyphens, while the mapping prose and examples on this page show a long dash (β€”ids-from-names, β€”names-from-ids). We kept both exactly as printed, so copy-paste with care. πŸ’…

πŸ“ 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.

slay β€” one line and the region's whole material vibe is updated. πŸ”₯

πŸ¦‹ 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. View Full Density Table

mged> mater -d get \*

Lists all entries in the density table.

🧚 Example 4. View Name-Specific Density Data

mged> mater -d get β€”name \*Rubber\*

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

πŸ’œ Example 5. 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 6. 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


πŸ’€ BUG REPORTS πŸ’€

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


πŸ’– cute little footer sign-off, bestie: the source/version line is BRL-CAD, the page is MATER(nged), and there's no date on this footer β€” so that's the whole sendoff. πŸŽ€βœ¨

πŸ“¦ where this page comes from