Difference between revisions of "Reference:User Defined Pattern"

From POV-Wiki
Jump to navigation Jump to search
(initial creation)
 
m (clean up and addition)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<p>{{New}} in version 3.7.1 new special pigment pattern <code>user_defined</code> has been added to define the pigment color directly in terms of a set of functions. More to follow ...</p>
+
<p>{{New}} in version 3.8 a special pigment pattern <code>user_defined</code> has been added to define the pigment color directly in terms of a set of functions.</p>
 +
 
 +
<p>The syntax is a follows:</p>
 +
 
 +
<pre>
 +
pigment {
 +
  user_defined {
 +
    function { RED_FUNCTION },
 +
    function { GREEN_FUNCTION },
 +
    function { BLUE_FUNCTION },
 +
    function { FILTER_FUNCTION },
 +
    function { TRANSMIT_FUNCTION }
 +
    }
 +
  }
 +
</pre>
 +
 
 +
<p>Each function is <em>optional</em>, in which case the corresponding component is set to 0. For example, the following sets the color to <code>rgbft &lt;x,y,0,0,z&gt;</code>:</p>
 +
 
 +
<pre>
 +
pigment {
 +
  user_defined {
 +
    function { x },
 +
    function { y },
 +
    ,,
 +
    function { z }
 +
    }
 +
  }
 +
</pre>
 +
 
 +
<p>The pattern is similar to <code>[[Reference:Image Map|image_map]]</code> in that it directly specifies <em>colors</em> rather than using a <code>[[Reference:Color Map|color_map]]</code> or <code>[[Reference:Pigment Map|pigment_map]]</code>.</p>
 +
<p>The user defined pattern functionality also extends to density blocks, of course using only the red, green and blue function values. See also: [[Reference:Density|Density]]</p>

Latest revision as of 10:55, 28 February 2018

New in version 3.8 a special pigment pattern user_defined has been added to define the pigment color directly in terms of a set of functions.

The syntax is a follows:

pigment {
  user_defined {
    function { RED_FUNCTION },
    function { GREEN_FUNCTION },
    function { BLUE_FUNCTION },
    function { FILTER_FUNCTION },
    function { TRANSMIT_FUNCTION }
    }
  }

Each function is optional, in which case the corresponding component is set to 0. For example, the following sets the color to rgbft <x,y,0,0,z>:

pigment {
  user_defined {
    function { x },
    function { y },
    ,,
    function { z }
    }
  }

The pattern is similar to image_map in that it directly specifies colors rather than using a color_map or pigment_map.

The user defined pattern functionality also extends to density blocks, of course using only the red, green and blue function values. See also: Density