<!-- Converted by db4-upgrade version 1.0 -->

<article xmlns="http://docbook.org/ns/docbook" version="5.0">
  <info><title>Assigning More Material Properties to a Goblet</title>
    

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../books/en/tutorial_series_authors.xml" xpointer="Intro_MGED_Tutorial_Series_II_authors"/>

    <legalnotice>
       <para>Approved for public release; distribution is unlimited</para>
   </legalnotice>
  </info>

    <para xml:id="goblet_material_properties2_overviewlist">
      In this lesson, you will:
      <itemizedlist mark="bullet">
	<listitem>
	  <para>Use the specular and diffuse reflectivity options of the plastic shader.</para>
	</listitem>
	<listitem>
	  <para>Assign values to the refractive index of the plastic shader.</para>
	</listitem>
	<listitem>
	  <para>Assign values to the shininess option of the plastic shader.</para>
	</listitem>
	<listitem>
	  <para>Assign values to the extinction option of the plastic shader.</para>
	</listitem>
	<listitem>
	  <para>Experiment with various combinations of plastic shader options.</para>
	</listitem>
      </itemizedlist>
    </para>
    
    <para xml:id="goblet_material_properties2_intro1">
      Open the goblet.g database using whichever method you prefer. Go to the
      Edit menu and select Combination Editor.  Select basin1.r.
    </para>
    
    <para xml:id="goblet_material_properties2_intro2">
      In the last lesson, we assigned values for two shader
      attributes-transparency and mirror reflectance. In this lesson, we will
      assign values for still other shader properties. When the plastic shader
      is selected for region basin1.r, eight attribute entry boxes currently
      appear in the Combination Editor. These boxes contain either the values
      that the user has previously set (e.g., those we previously set for
      transparency and mirror reflectance) or the default values that the
      raytracer will use if no others are specified. When any of these values is
      modified, the change can be seen in braces in the shader string box and in
      the appropriate attribute entry boxes, as indicated by the arrows in the
      following example:

      <informalfigure>
	<mediaobject>
	  <imageobject>
	    <imagedata align="center" fileref="../../lessons/en/images/mged08_goblet_combeditor.png" format="PNG"/>
	  </imageobject>
	  <caption>
	    <para>
	      The Combination Editor
	    </para>
	  </caption>
	</mediaobject>
      </informalfigure>

    </para>

    <note xml:id="goblet_material_properties2_intro3">
      <para>
	Note that in <application>BRL-CAD</application> versions prior to 5.2, the default values are    
	used, but they are not displayed in the shader attribute boxes.       
      </para>
    </note>
   
    <para xml:id="goblet_material_properties2_intro4">
      In this example, the shader entry box indicates that the transparency (tr)
      is set at .5 and the mirror reflectance (re) is set at .45. The eight
      abbreviations currently used in the shader entry box are as follows:

    <informaltable>
      <tgroup cols="4">
	<tbody>
	  <row>
	    <entry>tr - transparency</entry>
	    <entry>sp - specular reflectivity</entry>
	    <entry>ri - refractive index</entry>
	    <entry>ex - extinction</entry>
	  </row>
	  <row>
	    <entry>re - mirror reflectance</entry>
	    <entry>di - diffuse reflectivity</entry>
	    <entry>sh - shininess</entry>
	    <entry>em - emission</entry>
	  </row>
	</tbody>
      </tgroup>
    </informaltable>
    </para>
  
    <section xml:id="goblet_specular_diffuse"><info><title>Specular and Diffuse Reflectivity</title></info>
      
      <para>
	When light reflects off of a shiny surface, it produces two types of
	reflections. The most noticeable highlights are caused by specular
	reflectivity. The rest of the surface produces diffuse reflectivity. The
	shinier (or glossier) the surface is, such as on a crystal vase, the more
	specular reflectivity that is produced. The duller the surface is, such as
	with a wall painted with flat paint, the more diffuse reflectivity that is
	produced. A model of the relationship between these reflectivities is
	shown in the following illustration:
      
      <informalfigure>
	<mediaobject>
	  <imageobject>
	    <imagedata align="center" fileref="../../lessons/en/images/mged08_spec_vs_diff_reflectivity.png" format="PNG"/>
	  </imageobject>
	  <caption>
	    <para>
	      Specular vs. Diffuse Reflectivity Model
	    </para>
	  </caption>
	</mediaobject>
      </informalfigure>

      </para>

      <para>
	As seen in the illustration, diffuse reflectivity shows an object's color
	by reflecting ambient light off the object. The upper left ball exhibits
	the maximum value for diffuse reflectivity (1.0), and as a result, its
	surface color is uniform.
      </para>
      
      <para>
	Specular reflectivity, on the other hand, reflects the color of a light
	source. The lowest right ball, with the maximum value for specular
	reflectivity (1.0), shows a white light source being reflected off the
	surface of the ball.
      </para>
      
      <para>
	The range for both specular and diffuse reflectivity is 0.0 through 1.0.
	However, combined values for these are typically equal to 1.0. Remember,
	if you are going to set values for one of these attributes, you need to
	assign a corresponding value to the complementary attribute so that the
	combination of the values equals 1.0.
      </para>
    </section>
    
    <section xml:id="goblet_refractive_index"><info><title>Refractive Index</title></info>
      
      
      <para>
	When light passes through one medium (e.g., air) into another medium
	(e.g., water), it bends from its original path. The degree to which the
	light bends is called the refractive index. The more dissimilar the media
	are, the greater the degree of refraction that will occur. For example,
	sunlight passing through a diamond will bend more than the same sunlight
	through optical glass. The diamond would have a higher refractive index
	(approximately 2.42) whereas optical glass would have a lower refractive
	index (approximately 1.71).
      </para>
      
      <para>
	The range of index of refraction for <application>MGED</application> is 1.0 (the index for air) or
	greater. This parameter is only useful for materials that have a
	transparency greater than 0. The following drawing of sunlight passing
	through water shows how refraction works.
            
      <informalfigure>
	<mediaobject>
	  <imageobject>
	    <imagedata align="center" fileref="../../lessons/en/images/mged08_refractive_index.png" format="PNG"/>
	  </imageobject>
	  <caption>
	    <para>
	      A Ray of Sunlight Passing Through a Body of Water
	    </para>
	  </caption>
	</mediaobject>
      </informalfigure>
      </para>
    </section>
    
    <section xml:id="goblet_shininess"><info><title>Shininess</title></info>
      
      <para>
	The shininess of an object affects the size of the specular component of
	the plastic shader. The shinier an object's surface is, the smaller the
	reflection of the light source on the object's surface will be. The range
	for shininess is typically an integer value from 1 to 10.
      </para>
    </section>
    
    <section xml:id="goblet_extinction"><info><title>Extinction</title></info>
      
      <para>
	The term extinction applies to the transmissive component of the plastic
	shader, and it indicates the amount of light absorbed by the object's
	material. The default value is 0.0, and the range can be any nonnegative
	number. Using this attribute can dramatically impact other attributes of
	the shader, especially the refractive index.
      </para>
    </section>
    
    <section xml:id="goblet_emission"><info><title>Emission</title></info>
      
      <para>
	Emission is a relatively new feature that has been added to the <application>BRL-CAD</application>
	package. It concerns the amount of artificial brightness of the object.
      </para>
    </section>
    
    <section xml:id="goblet_shader_attributes"><info><title> Applying Attributes of the Plastic Shader to the Goblet</title></info>
      
      <para>
	Now that you understand the various attributes of the plastic shader, it
	is time to experiment with how they affect the final product-the goblet
	you created in the previous two lessons. You have already assigned values
	for transparency and mirror reflectance. Now add the attributes of
	specular reflectivity and diffuse reflectivity to basin1.r. Once you see
	how these two attributes affect your design, add the refractive index,
	then shininess and extinction. You might want to capture some of these
	changes so that you can refer to them later, when you are creating other
	models using the plastic shader. Remember to click Apply in the
	Combination Editor to actually incorporate the changes.
      </para>
      
      <para>
	As you change the values for the attributes of the plastic shader, you
	will notice that some changes do not significantly alter the design. This
	is because there are a variety of ways to produce a particular look on an
	object. The following are two examples of the goblet with various values
	of the plastic attributes (which do create a noticeable difference)
	applied to basin1.r.
      
      <informalfigure>
	<mediaobject>
	  <imageobject>
	    <imagedata align="center" fileref="../../lessons/en/images/mged08_goblet_reflectivity_1.png" format="PNG"/>
	  </imageobject>
	  <caption>
	    <para>
	      Goblet Assigned .9 for Specular Reflectivity and .1 for Diffuse Reflectivity
	    </para>
	  </caption>
	</mediaobject>
      </informalfigure>
	
      <informalfigure>
	<mediaobject>
	  <imageobject>
	    <imagedata align="center" fileref="../../lessons/en/images/mged08_goblet_reflectivity_2.png" format="PNG"/>
	  </imageobject>
	  <caption>
	    <para>
	      Same Goblet Also Assigned a Value of .5 for Extinction
	    </para>
	  </caption>
	</mediaobject>
      </informalfigure>

      </para>
      
      <para>
	By the time you have finished experimenting with changing attributes of
	the plastic shader, your Combination Editor window might look something
	like this:
	
      <informalfigure>
	<mediaobject>
	  <imageobject>
	    <imagedata align="center" fileref="../../lessons/en/images/mged08_comb_editor_window_mater_prop.png" format="PNG"/>
	  </imageobject>
	  <caption>
	    <para>
	      The Combination Editor Window
	    </para>
	  </caption>
	</mediaobject>
      </informalfigure>
      </para>
      
      <para>
	Notice that while the shader string entry box reflects the values set by
	the user in the attribute entry boxes (e.g., the Transparency of .5), it
	does not reflect the default values (e.g., the Shininess of 10).
      </para>
    </section>
    
    <section xml:id="goblet_material_properties2_review"><info><title>Review</title></info>
      
      <para>
	In this lesson, you:
	<itemizedlist mark="bullet">
	  <listitem>
	    <para>Used the specular reflectivity and diffuse reflectivity options of the plastic shader.</para>
	  </listitem>
	  <listitem>
	    <para>Assigned values to the refractive index of the plastic shader.</para>
	  </listitem>
	  <listitem>
	    <para>Assigned values to the shininess option of the plastic shader.</para>
	  </listitem>
	  <listitem>
	    <para>Assigned values to the extinction option of the plastic shader.</para>
	  </listitem>
	  <listitem>
	    <para>Experimented with various combinations of plastic shader options.</para>
	  </listitem>
	</itemizedlist>
      </para>
    </section>

  </article>
