"Fossies" - the Fresh Open Source Software Archive

Member "brlcad-7.32.4/doc/notes/mater.txt" (29 Jul 2021, 5388 Bytes) of package /linux/misc/brlcad-7.32.4.tar.bz2:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 Date:     Tue, 18 Aug 87 2:51:13 EDT
    2 From:     Phil Dykstra <phil@BRL.ARPA>
    3 Subject:  Re:  material properties library
    4 
    5 The only thing that MGED knows about materials is:
    6  (1) how to change a regions material name and its parameter string.
    7  (2) The "color" of a region.
    8 
    9 This information is interpreted by the application working with the model.
   10 The "materials" that the RT raytracer knows about are listed below.
   11 
   12 [I should point out that the whole issue of materials is still being
   13 worked on, so this message represents a snap shot of how things look
   14 now - and is the first time any of this has been described outside of
   15 the source code!  Things may/will change.]
   16 
   17 Setting a material from mged might look like this:
   18 
   19 	mged> mater region.r plastic
   20 	Was [old material and parameters]
   21 	Parameter string? sh=2 tr=0.1
   22 	Override material color (y|n)[n]? y
   23 	R G B (0..255)? 0 255 0
   24 
   25 This would make region.r green plastic with a shininess of 2 and
   26 a transparency of 10%.
   27 
   28 The model db/world.g uses four of the materials described below:
   29 glass, mirror, clouds, and testmap.  An image computed from this
   30 database is in pix/world.pix.
   31 
   32 -------------
   33 light
   34 	inten		1000 lumens
   35 	fract		(-1) computed later
   36 	angle		180 degrees
   37 	shadows		1
   38 	infinite	0
   39 	invisible	0
   40 
   41 The light material property makes this region a source of illumination.
   42 The color of the light is the region color given.  Normally all sources
   43 of illumination are totaled and each is made to contribute a fraction
   44 of 1/N to the total scaled illumination (where N is the number of lights).
   45 If fract is set, a light can be made to contribute more or less than
   46 its "fair share".  Lights can be restricted to shine over a limited angle.
   47 "Angle" is one half of the total angle of illumination; all directions by
   48 default.  The direction is down the -Z axis of the light's local coordinate
   49 system.  If "shadows" is set to zero, that light will not cast shadows.
   50 This allows for fill lights without the expense of firing shadow rays
   51 during the ray trace.
   52 
   53 Infinite means to treat the light as if it were infinitely distant
   54 in the direction from the origin toward the light.  This gives you
   55 planer illumination wavefronts.  If invisible is set, the light will
   56 not appear as a solid in the model, though it does still cast light.
   57 
   58 If any region in a model has the light property, RT will turn off its
   59 "implicit" invisible lights (one by default).  A significant default
   60 ambient term (-A option) will remain (30%!).
   61 -------------
   62 			plastic		mirror		glass
   63 	shine/sh	10		4		4
   64 	specular/sp	0.7		0.6		0.7
   65 	diffuse/di	0.3		0.4		0.3
   66 	transmit/tr	0		0		0.8
   67 	reflect/re	0		0.75		0.1
   68 	ri		1.0		1.65		1.65
   69 
   70 These are all instances of the phong shader.  Plastic is the
   71 default material; mirror and glass simply set up some initial
   72 parameter values to approximate those materials.
   73 sh is the exponent of the cosine.
   74 sp/di set the relative amounts of each component.
   75 tr/re determine how much energy comes from refracted and reflected rays.
   76  (1-(tr+re)) comes from specular and diffuse if > 0.
   77 ri is the refractive index.
   78 See any graphics book for phong shading.
   79 -------------
   80 cloud
   81 	thresh		0.35
   82 	range		0.3
   83 
   84 Puts Geoffrey Gardner 2D style clouds on an object.   Thresh is the
   85 level (from 0 to 1) below which the cloud pattern is all blue.
   86 Range is the range over which it transitions from grey to white.
   87 -------------
   88 spm
   89 	file		[no default]
   90 	w		512
   91 
   92 Places the named "spherical texture map" onto an object.  This
   93 is a format which preserves roughly equal pixel size over the
   94 surface of a sphere.  w is the number of pixels around the
   95 "equator."  You need some extra software to generate these.
   96 See rt/spm.c
   97 -------------
   98 texture
   99 	transp		[none]
  100 	file
  101 	w		512
  102 	n		w
  103 	fw		w
  104 
  105 This texture maps (actually colors) a surface with the given
  106 "pix" file (RGB image).  w and n are the width and number of lines
  107 of the image (default 512x512).  fw sets the file width is different
  108 than the image size (old and arcane).  transp is sort of a
  109 "chroma key" color.  If set, the surface becomes transparent
  110 wherever that color would appear.
  111 --------------
  112 bump
  113 
  114 	[see texture]
  115 
  116 Applies a bump map to a surface.  The "u" perturbation comes from
  117 the "red" channel of the input file, the "v" from the "blue."
  118 You need to put the horizontal and vertical gradients of an
  119 image into these two channels.  This can be done with pix-bw3,
  120 bwfilter, and bw3-pix.  This is still very preliminary.
  121 --------------
  122 checker
  123 	a		white
  124 	b		black
  125 
  126 Maps a checkerboard pattern onto a surface with squares that are
  127 10 meters in size.  The two colors are a and b.  Usually put on a
  128 halfspace (half).
  129 --------------
  130 testmap
  131 
  132 For debugging.  Ramps the red value from off to on as the "u" coord
  133 of a texture map varies from 0 to 1, and the blue value a with the
  134 "v" coordinate.
  135 --------------
  136 fakestar
  137 
  138 Puts random multi-colored dots on a black background.
  139 Use at your own risk.
  140 --------------
  141 stack
  142 
  143 	[semicolon separated material commands]
  144 
  145 This "material" is used to apply several materials or shaders to
  146 a single surface.  For example
  147 
  148 	stack texture file=file.pix; glass;
  149 
  150 would make a glass material whose color is mapped on from the
  151 given file.  The stacker allows for bumpy mirrors and glass,
  152 shaded textures, etc.  This too is very preliminary and currently
  153 suffers from a 72 character limit.
  154 --------------
  155 
  156 Other shaders are in the works, such as Cook-Torrance.
  157 Hope this helps.
  158 
  159 - Phil