Difference between revisions of "Reference:Material"

From POV-Wiki
Jump to navigation Jump to search
m (1 revision: Initial Load (TF))
 
m (canonicalize a version number)
 
(3 intermediate revisions by one other user not shown)
Line 2: Line 2:
 
{{#indexentry:material, object modifier}}
 
{{#indexentry:material, object modifier}}
 
{{#indexentry:object modifier, material}}
 
{{#indexentry:object modifier, material}}
<p>One of the changes in POV-Ray 3.1 was the removal of several items from <code>
+
<p>One of the changes in POV-Ray v3.1 was the removal of several items from <code>
 
texture { finish{</code>...<code>} }</code> and to move them to the new <code>
 
texture { finish{</code>...<code>} }</code> and to move them to the new <code>
 
interior</code> statement. The <code>[[Reference:Halo|:halo|halo]]</code> statement, formerly part of
 
interior</code> statement. The <code>[[Reference:Halo|:halo|halo]]</code> statement, formerly part of
Line 9: Line 9:
 
<p>
 
<p>
 
This split was deliberate and purposeful (see
 
This split was deliberate and purposeful (see
<!--<linkto "Why are Interior and Media Necessary?">Why are Interior and Media Necessary?</linkto>--->[[Reference:Interior#Why_are_Interior_and_Media_Necessary.3F|Why are Interior and Media Necessary?]])
+
<!--<linkto "Why are Interior and Media Necessary?">Why are Interior and Media Necessary?</linkto>--->[[Reference:Interior#Why are Interior and Media Necessary?|Why are Interior and Media Necessary?]])
 
however beta testers pointed out that it made it difficult to  
 
however beta testers pointed out that it made it difficult to  
 
entirely describe the surface properties and interior of an object in one  
 
entirely describe the surface properties and interior of an object in one  
Line 56: Line 56:
  
 
<p class="Note"><strong>Note:</strong> The <code>material</code> statement has nothing to do with the
 
<p class="Note"><strong>Note:</strong> The <code>material</code> statement has nothing to do with the
<code>[[Reference:Patterned_Textures#Material_Maps|:material_map|material_map]]</code> statement. A <code>material_map</code> is <em>
+
<code>[[Reference:Patterned Textures#Material Maps|:material_map|material_map]]</code> statement. A <code>material_map</code> is <em> not</em> a way to create patterned material. See [[Reference:Patterned Textures#Material Maps|Material Maps]] for explanation of this unrelated, yet similarly named, older feature.</p>
not</em> a way to create patterned material. See <!--<linkto "Material Maps">Material Maps</linkto>--->[[Reference:Patterned_Textures#Material_Maps|Material Maps]]
 
for explanation of this unrelated, yet similarly named, older feature.</p>
 

Latest revision as of 14:47, 9 June 2021

One of the changes in POV-Ray v3.1 was the removal of several items from texture { finish{...} } and to move them to the new interior statement. The halo statement, formerly part of texture, is now renamed media and made a part of the interior.

This split was deliberate and purposeful (see Why are Interior and Media Necessary?) however beta testers pointed out that it made it difficult to entirely describe the surface properties and interior of an object in one statement that can be referenced by a single identifier in a texture library.

The result is that we created a wrapper around texture and interior which we call material.

The syntax is:

MATERIAL:
  material { [MATERIAL_IDENTIFIER][MATERIAL_ITEMS...] }
MATERIAL_ITEMS:
  TEXTURE | INTERIOR_TEXTURE | INTERIOR | TRANSFORMATIONS

For example:

#declare MyGlass=material{ texture{ Glass_T } interior{ Glass_I }}
object { MyObject material{ MyGlass}}

Internally, the material is not attached to the object. The material is just a container that brings the texture and interior to the object. It is the texture and interior itself that is attached to the object. Users should still consider texture and interior as separate items attached to the object.

The material is just a bucket to carry them. If the object already has a texture, then the material texture is layered over it. If the object already has an interior, the material interior fully replaces it and the old interior is destroyed. Transformations inside the material affect only the textures and interiors which are inside the material{} wrapper and only those textures or interiors specified are affected. For example:

object {
  MyObject
    material {
      texture { MyTexture }
      scale 4         //affects texture but not object or interior
      interior { MyInterior }
      translate 5*x   //affects texture and interior, not object
      }
  }

Note: The material statement has nothing to do with the material_map statement. A material_map is not a way to create patterned material. See Material Maps for explanation of this unrelated, yet similarly named, older feature.