Material Definitions

Stefan Farestam farestam at ORION.CERFACS.FR
Sat Mar 2 11:16:57 AEST 1991





   I finally got around to summarize the response that I received from
   my postings on material definitions. At the end of this mail there
   is a list of all the materials that I've been able to gather up to
   date. They are accompagnied by a shell script that will rewrite the
   list in a form more convenient for program inclusion, and that can
   be adjusted to rewrite the definitions in whatever which way you like
   (hopefully).

      It was pointed out that material definitions are rather worthless
   since the look of a material depends on things like the gamma correction,
   the age of the color guns et.c., why the definitions below are only
   to be considered as approximations.

      As to getting more interesting results than the simple lighting
   models can produce, it was remarked that texture mapping has a lot to
   offer

      For those interested in color definitions, take a look in
   /usr/lib/X11/rgb.txt.

     A major part of the definitions below were found in
   /usr/people/4Dgifts/src/sphere/light.c.

     For those who wish to play around with their own materials try
   /usr/people/4Dgifts/tutorials/online/light
   (Go to /usr/people/4Dgifts/tutorials and type make all).

   Special thanks go to :

      Mark Surles	<surles at cs.unc.edu>
      Loki Jorgenson	<loki at nazgul.physics.mcgill.ca>
      David Marks	<marks at AIVAX.RADC.AF.MIL>
      Rob Sears		<sears at sgi.physics.lsa.umich.edu>
      Jill Huchital	<jill at caboose.csd.sgi.com>


   Hope this might be of avail for someone, and if you do have any
   other materials laying around then I would be much grateful if you
   dropped me a mail.

   Thanks,

          Stefan Farestam


_________________________________________________________________________



Name	CyanPlastic

	Ambient      0.000   0.100   0.060
	Diffuse      0.000   0.510   0.510
	Specular     0.502   0.502   0.502
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   40.000

Name	WhitePlastic

	Ambient      0.000   0.000   0.000
	Diffuse      0.550   0.550   0.550
	Specular     0.700   0.700   0.700
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   30.000

Name	GreyPlastic

	Ambient      0.000   0.000   0.000
	Diffuse      0.150   0.150   0.150
	Specular     0.600   0.600   0.600
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   30.000

Name	YellowPlastic

	Ambient      0.000   0.000   0.000
	Diffuse      0.500   0.500   0.000
	Specular     0.600   0.600   0.500
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   30.000

Name	RedPlastic

	Ambient      0.000   0.000   0.000
	Diffuse      0.500   0.000   0.000
	Specular     0.600   0.600   0.600
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   30.000

Name	GreenPlastic

	Ambient      0.000   0.000   0.000
	Diffuse      0.100   0.350   0.100
	Specular     0.550   0.550   0.450
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   30.000

Name	PinkPlastic

	Ambient      0.100   0.000   0.060
	Diffuse      0.471   0.000   0.196
	Specular     0.502   0.502   0.502
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   40.000

Name	Lavpolstone

	Ambient      0.100   0.000   0.120
	Diffuse      0.330   0.040   0.370
	Specular     0.590   0.590   0.940
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   54.650

Name	Brownpolstone

	Ambient      0.100   0.100   0.000
	Diffuse      0.208   0.040   0.000
	Specular     0.627   0.627   0.627
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   60.000

Name	Lapis

	Ambient      0.000   0.000   0.900
	Diffuse      0.010   0.010   0.180
	Specular     0.540   0.540   0.730
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   44.060

Name	ShinyBronze

	Ambient      0.100   0.000   0.020
	Diffuse      0.300   0.120   0.060
	Specular     0.545   0.545   0.275
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   70.000

Name	RedRubber

	Ambient      0.000   0.000   0.050
	Diffuse      0.700   0.040   0.050
	Specular     0.500   0.500   0.500
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   10.000

Name	Tan

	Ambient      0.740   0.680   0.190
	Diffuse      0.740   0.680   0.190
	Specular     1.000   1.000   1.000
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess    5.000

Name	Brass

	Ambient      0.350   0.250   0.100
	Diffuse      0.650   0.500   0.350
	Specular     0.000   0.000   0.000
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess    5.000

Name	ShinyBrass

	Ambient      0.250   0.150   0.000
	Diffuse      0.650   0.500   0.350
	Specular     0.600   0.600   0.000
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   10.000

Name	Pewter

	Ambient      0.000   0.000   0.000
	Diffuse      0.600   0.550   0.650
	Specular     0.900   0.900   0.950
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   10.000

Name	Silver

	Ambient      0.400   0.400   0.400
	Diffuse      0.300   0.300   0.300
	Specular     0.900   0.900   0.950
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   30.000

Name	Gold

	Ambient      0.400   0.200   0.000
	Diffuse      0.900   0.500   0.000
	Specular     0.700   0.700   0.000
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   10.000

Name	ShinyGold

	Ambient      0.400   0.200   0.000
	Diffuse      0.900   0.500   0.000
	Specular     0.900   0.900   0.000
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   20.000

Name	Plaster

	Ambient      0.200   0.200   0.200
	Diffuse      0.950   0.950   0.950
	Specular     0.000   0.000   0.000
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess    1.000

Name	Rubber

	Ambient      0.000   0.000   0.000
	Diffuse      0.000   0.000   0.000
	Specular     0.500   0.500   0.500
	Emission     0.000   0.000   0.000
	Alpha        1.000
	Shininess   30.000


_________________________________________________________________________



#!/bin/sh

# Put this in a file with the name of ma
# cat file | ma  (where file contains the definitions above)

awk '

BEGIN {first = "TRUE"}

   {
   if ($1 == "Name")
      {
      if (first == "FALSE")
         {
#-----------------------------------------------------------------------
# This version reprints the original form

#         printf("\nName\t%s\n\n", name);
#         printf("\t%-10s%8.3f%8.3f%8.3f\n", "Ambient",   a_r, a_g, a_b) ;
#         printf("\t%-10s%8.3f%8.3f%8.3f\n", "Diffuse",   d_r, d_g, d_b) ;
#         printf("\t%-10s%8.3f%8.3f%8.3f\n", "Specular",  s_g, s_g, s_b) ;
#         printf("\t%-10s%8.3f%8.3f%8.3f\n", "Emission",  e_r, e_g, e_b) ;
#         printf("\t%-10s%8.3f\n",           "Alpha",     alpha        ) ;
#         printf("\t%-10s%8.3f\n",           "Shininess", shininess    ) ;

#-----------------------------------------------------------------------
# This version reprints the material in a fashion suitable for
# direct use in a program

         printf("\nfloat\tMat%s[] = {\n", name) ;
         printf("\t%-10s%8.3f,%8.3f,%8.3f,\n", "AMBIENT,",  a_r, a_g, a_b) ;
         printf("\t%-10s%8.3f,%8.3f,%8.3f,\n", "DIFFUSE,",  d_r, d_g, d_b) ;
         printf("\t%-10s%8.3f,%8.3f,%8.3f,\n", "SPECULAR,", s_g, s_g, s_b) ;
         printf("\t%-10s%8.3f,%8.3f,%8.3f,\n", "EMISSION,", e_r, e_g, e_b) ;
         printf("\t%-10s%8.3f,\n",             "ALPHA,",     alpha       ) ;
         printf("\t%-10s%8.3f,\n",             "SHININESS,", shininess   ) ;
         printf("\tLMNULL\n};\n") ;
         }

      name  = $2      ;
      first = "FALSE" ;

      amb_r = 0; dif_r = 0; spe_r = 0; emi_r = 0;
      amb_g = 0; dif_g = 0; spe_g = 0; emi_g = 0;
      amb_b = 0; dif_b = 0; spe_b = 0; emi_b = 0;

      shininess = 0; alpha = 1;
      }
   else if ($1 == "Ambient"  )  {a_r = $2;  a_g = $3; a_b = $4;}
   else if ($1 == "Diffuse"  )  {d_r = $2;  d_g = $3; d_b = $4;}
   else if ($1 == "Specular" )  {s_r = $2;  s_g = $3; s_b = $4;}
   else if ($1 == "Emission" )  {e_r = $2;  e_g = $3; e_b = $4;}
   else if ($1 == "Alpha"    )  {alpha     = $2 }
   else if ($1 == "Shininess")  {shininess = $2 }
   }'


_________________________________________________________________________



   .................................................................   
 .             Stefan Farestam    <farestam at cerfacs.fr>              .
.   __ __  __ _  _ _                                                  .
.  /  |_ )|_ /_\/ (          European Centre for Research and         .
 . \_ |__\| /   \__)    Advanced Training in Scientific Computation  .
   .................................................................  



More information about the Comp.sys.sgi mailing list