Difference between revisions of "Reference:Pigment"
Jholsenback (talk | contribs) m (1 revision: Reference Migration Initial Load) |
Jholsenback (talk | contribs) m (technical correction) |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 16: | Line 16: | ||
{{#indexentry:keyword, quick_colour}} | {{#indexentry:keyword, quick_colour}} | ||
<p>The color or pattern of colors for an object is defined by a <code>pigment</code> statement. All plain textures must have a pigment. If you do not specify one the default pigment is used. The color you define is the way you want the object to look if fully illuminated. You pick the basic color inherent in the object and POV-Ray brightens or darkens it depending on the lighting in the scene. The parameter is called <code>pigment</code> because we are defining the basic color the object actually is rather than how it looks.</p> | <p>The color or pattern of colors for an object is defined by a <code>pigment</code> statement. All plain textures must have a pigment. If you do not specify one the default pigment is used. The color you define is the way you want the object to look if fully illuminated. You pick the basic color inherent in the object and POV-Ray brightens or darkens it depending on the lighting in the scene. The parameter is called <code>pigment</code> because we are defining the basic color the object actually is rather than how it looks.</p> | ||
+ | |||
+ | <p>In version 3.8 there has been a {{Change}} to the <code>pigment</code> default setting. The default setting is now <code>rgb <1,1,1></code> as opposed to the <code>rgb <0,0,0></code> value used in previous versions. Requires <code>#version 3.8;</code> or equivalent INI setting or command-line option. See also: [[Reference:Version Directive|Version Directive]].</p> | ||
+ | |||
<p>The syntax for pigment is:</p> | <p>The syntax for pigment is:</p> | ||
<pre> | <pre> | ||
Line 36: | Line 39: | ||
</pre> | </pre> | ||
− | <p>Each of the items in a pigment are optional but if they are present, they must be in the order shown. Any items after the <em> PIGMENT_IDENTIFIER</em> modify or override settings given in the identifier. If no identifier is specified then the items modify the pigment values in the current default texture. The <em>PIGMENT_TYPE</em> fall into roughly four categories. Each category is discussed the sub-sections which follow. The four categories are solid color and <code>[[Reference: | + | <p>Each of the items in a pigment are optional but if they are present, they must be in the order shown. Any items after the <em> PIGMENT_IDENTIFIER</em> modify or override settings given in the identifier. If no identifier is specified then the items modify the pigment values in the current default texture. The <em>PIGMENT_TYPE</em> fall into roughly four categories. Each category is discussed the sub-sections which follow. The four categories are solid color and <code>[[Reference:Image Map|image_map]]</code> patterns which are specific to <code>pigment</code> statements or color list patterns, color mapped patterns which use POV-Ray's wide selection of general patterns. See [[Reference:Pattern|:Patterns|Patterns]] for details about specific patterns.</p> |
− | <p>The pattern type is optionally followed by one or more pigment modifiers. In addition to general pattern modifiers such as transformations, turbulence, and warp modifiers, pigments may also have a <em>COLOR_LIST</em>, <em>PIGMENT_LIST</em>, <code>[[Reference: | + | <p>The pattern type is optionally followed by one or more pigment modifiers. In addition to general pattern modifiers such as transformations, turbulence, and warp modifiers, pigments may also have a <em>COLOR_LIST</em>, <em>PIGMENT_LIST</em>, <code>[[Reference:Color Map|color_map]]</code>, <code>[[Reference:Pigment Map|pigment_map]]</code>, and <code>quick_color</code> which are specific to pigments. See <!--<linkto "Pattern Modifiers">Pattern Modifiers</linkto>--->[[Reference:Pattern Modifiers|Pattern Modifiers]] for information on general modifiers. The pigment-specific modifiers are described in sub-sections which follow. Pigment modifiers of any kind apply only to the pigment and not to other parts of the texture. Modifiers must be specified last.</p> |
<p>A pigment statement is part of a <code>texture</code> specification. However it can be tedious to use a <code>texture</code> statement just to add a color to an object. Therefore you may attach a pigment directly to an object without explicitly specifying that it as part of a texture. For example instead of this:</p> | <p>A pigment statement is part of a <code>texture</code> specification. However it can be tedious to use a <code>texture</code> statement just to add a color to an object. Therefore you may attach a pigment directly to an object without explicitly specifying that it as part of a texture. For example instead of this:</p> | ||
<pre> | <pre> | ||
Line 47: | Line 50: | ||
</pre> | </pre> | ||
<p>Doing so creates an entire <code>texture</code> structure with default <code>normal</code> and <code>finish</code> statements just as if you had explicitly typed the full <code> texture {...}</code> around it.</p> | <p>Doing so creates an entire <code>texture</code> structure with default <code>normal</code> and <code>finish</code> statements just as if you had explicitly typed the full <code> texture {...}</code> around it.</p> | ||
+ | <p class="Note"><strong>Note:</strong> an explicit texture statement is required, if you want to layer pigments.</p> | ||
<p>Pigment identifiers may be declared to make scene files more readable and to parameterize scenes so that changing a single declaration changes many values. An identifier is declared as follows.</p> | <p>Pigment identifiers may be declared to make scene files more readable and to parameterize scenes so that changing a single declaration changes many values. An identifier is declared as follows.</p> | ||
<pre> | <pre> | ||
Line 53: | Line 57: | ||
#local IDENTIFIER = PIGMENT | #local IDENTIFIER = PIGMENT | ||
</pre> | </pre> | ||
− | <p>Where <em>IDENTIFIER</em> is | + | <p>Where <em>IDENTIFIER</em> is valid identifier name and <em>PIGMENT</em> is any valid <code>pigment</code> statement.</p> |
+ | <p>See also: <!--<linkto "Identifiers">Identifiers</linkto>--->[[Reference:Identifiers|Identifiers]] and <!--<linkto "#declare vs. #local">#declare vs. #local</linkto>--->[[Reference:Declare and Local Directives#declare vs. local|#declare vs. #local]] for additional information on identifier naming and scope.</p> | ||
+ | ==Solid Color Pigments== | ||
{{#indexentry:pigments, solid color}} | {{#indexentry:pigments, solid color}} | ||
− | |||
<p>The simplest type of pigment is a solid color. To specify a solid color you simply put a color specification inside a <code>pigment</code> statement. For example:</p> | <p>The simplest type of pigment is a solid color. To specify a solid color you simply put a color specification inside a <code>pigment</code> statement. For example:</p> | ||
<pre> | <pre> | ||
pigment { color Orange } | pigment { color Orange } | ||
</pre> | </pre> | ||
− | <p>A color specification consists of the optional keyword <code> color</code> followed by a color identifier or by a specification of the amount of red, green, blue, filtered and unfiltered transparency in the surface. See section <!--<linkto "Specifying Colors">Specifying Colors</linkto>--->[[Reference: | + | <p>A color specification consists of the optional keyword <code> color</code> followed by a color identifier or by a specification of the amount of red, green, blue, filtered and unfiltered transparency in the surface. See section <!--<linkto "Specifying Colors">Specifying Colors</linkto>--->[[Reference:Color Expressions|Specifying Colors]] for more details about colors. Any pattern modifiers used with a solid color are ignored because there is no pattern to modify.</p> |
+ | ==Color List Pigments== | ||
{{#indexentry:pigments, color list}} | {{#indexentry:pigments, color list}} | ||
− | |||
<p>There are four color list patterns: <code>checker</code>, <code>hexagon</code>, <code>brick</code> and <code>object</code>. The result is a pattern of solid colors with distinct edges rather than a blending of colors as with color | <p>There are four color list patterns: <code>checker</code>, <code>hexagon</code>, <code>brick</code> and <code>object</code>. The result is a pattern of solid colors with distinct edges rather than a blending of colors as with color | ||
mapped patterns. Each of these patterns is covered in more detail in a later section. The syntax is:</p> | mapped patterns. Each of these patterns is covered in more detail in a later section. The syntax is:</p> | ||
Line 79: | Line 84: | ||
starts and ends. The <code>brick</code> and <code>checker</code> pattern expects two colors and <code>hexagon</code> expects three. If an insufficient number of colors is specified then default colors are used.</p> | starts and ends. The <code>brick</code> and <code>checker</code> pattern expects two colors and <code>hexagon</code> expects three. If an insufficient number of colors is specified then default colors are used.</p> | ||
+ | ==Quick Color== | ||
{{#indexentry:quick_color}} | {{#indexentry:quick_color}} | ||
{{#indexentry:quick_colour}} | {{#indexentry:quick_colour}} | ||
− | + | <p>When developing POV-Ray scenes it is often useful to do low quality test runs that render faster. The <code>+Q</code> command line switch or <code>Quality</code> INI option can be used to turn off some time consuming color pattern and lighting calculations to speed things up. See <!--<linkto "Quality Settings">Quality Settings</linkto>--->[[Reference:Tracing Options#Quality Settings|Quality Settings]] for details. However all settings of <code>+Q5</code> or <code>Quality=5</code> or lower turns off pigment calculations and creates gray objects.</p> | |
− | <p>When developing POV-Ray scenes it is often useful to do low quality test runs that render faster. The <code>+Q</code> command line switch or <code>Quality</code> INI option can be used to turn off some time consuming color pattern and lighting calculations to speed things up. See <!--<linkto "Quality Settings">Quality Settings</linkto>--->[[Reference: | ||
<p>By adding a <code>quick_color</code> to a pigment you tell POV-Ray what solid color to use for quick renders instead of a patterned pigment. For example:</p> | <p>By adding a <code>quick_color</code> to a pigment you tell POV-Ray what solid color to use for quick renders instead of a patterned pigment. For example:</p> | ||
<pre> | <pre> |
Latest revision as of 17:56, 10 February 2020
The color or pattern of colors for an object is defined by a pigment
statement. All plain textures must have a pigment. If you do not specify one the default pigment is used. The color you define is the way you want the object to look if fully illuminated. You pick the basic color inherent in the object and POV-Ray brightens or darkens it depending on the lighting in the scene. The parameter is called pigment
because we are defining the basic color the object actually is rather than how it looks.
In version 3.8 there has been a Change to the pigment
default setting. The default setting is now rgb <1,1,1>
as opposed to the rgb <0,0,0>
value used in previous versions. Requires #version 3.8;
or equivalent INI setting or command-line option. See also: Version Directive.
The syntax for pigment is:
PIGMENT: pigment { [PIGMENT_IDENTIFIER] [PIGMENT_TYPE] [PIGMENT_MODIFIER...] } PIGMENT_TYPE: PATTERN_TYPE | COLOR | image_map { BITMAP_TYPE "bitmap.ext" [IMAGE_MAP_MODS...] } PIGMENT_MODIFIER: PATTERN_MODIFIER | COLOR_LIST | PIGMENT_LIST | color_map { COLOR_MAP_BODY } | colour_map { COLOR_MAP_BODY } | pigment_map { PIGMENT_MAP_BODY } | quick_color COLOR | quick_colour COLOR
Each of the items in a pigment are optional but if they are present, they must be in the order shown. Any items after the PIGMENT_IDENTIFIER modify or override settings given in the identifier. If no identifier is specified then the items modify the pigment values in the current default texture. The PIGMENT_TYPE fall into roughly four categories. Each category is discussed the sub-sections which follow. The four categories are solid color and image_map
patterns which are specific to pigment
statements or color list patterns, color mapped patterns which use POV-Ray's wide selection of general patterns. See Patterns for details about specific patterns.
The pattern type is optionally followed by one or more pigment modifiers. In addition to general pattern modifiers such as transformations, turbulence, and warp modifiers, pigments may also have a COLOR_LIST, PIGMENT_LIST, color_map
, pigment_map
, and quick_color
which are specific to pigments. See Pattern Modifiers for information on general modifiers. The pigment-specific modifiers are described in sub-sections which follow. Pigment modifiers of any kind apply only to the pigment and not to other parts of the texture. Modifiers must be specified last.
A pigment statement is part of a texture
specification. However it can be tedious to use a texture
statement just to add a color to an object. Therefore you may attach a pigment directly to an object without explicitly specifying that it as part of a texture. For example instead of this:
object { My_Object texture {pigment { color Red } } }
you may shorten it to:
object { My_Object pigment {color Red } }
Doing so creates an entire texture
structure with default normal
and finish
statements just as if you had explicitly typed the full texture {...}
around it.
Note: an explicit texture statement is required, if you want to layer pigments.
Pigment identifiers may be declared to make scene files more readable and to parameterize scenes so that changing a single declaration changes many values. An identifier is declared as follows.
PIGMENT_DECLARATION: #declare IDENTIFIER = PIGMENT | #local IDENTIFIER = PIGMENT
Where IDENTIFIER is valid identifier name and PIGMENT is any valid pigment
statement.
See also: Identifiers and #declare vs. #local for additional information on identifier naming and scope.
Solid Color Pigments
The simplest type of pigment is a solid color. To specify a solid color you simply put a color specification inside a pigment
statement. For example:
pigment { color Orange }
A color specification consists of the optional keyword color
followed by a color identifier or by a specification of the amount of red, green, blue, filtered and unfiltered transparency in the surface. See section Specifying Colors for more details about colors. Any pattern modifiers used with a solid color are ignored because there is no pattern to modify.
Color List Pigments
There are four color list patterns: checker
, hexagon
, brick
and object
. The result is a pattern of solid colors with distinct edges rather than a blending of colors as with color
mapped patterns. Each of these patterns is covered in more detail in a later section. The syntax is:
COLOR_LIST_PIGMENT: pigment {brick [COLOR_1, [COLOR_2]] [PIGMENT_MODIFIERS...] }| pigment {checker [COLOR_1, [COLOR_2]] [PIGMENT_MODIFIERS...]}| pigment { hexagon [COLOR_1, [COLOR_2, [COLOR_3]]] [PIGMENT_MODIFIERS...] }| pigment {object OBJECT_IDENTIFIER | OBJECT {} [COLOR_1, COLOR_2]}
Each COLOR_n is any valid color specification. There should be a comma between each color or the color
keyword should be used as a separator so that POV-Ray can determine where each color specification
starts and ends. The brick
and checker
pattern expects two colors and hexagon
expects three. If an insufficient number of colors is specified then default colors are used.
Quick Color
When developing POV-Ray scenes it is often useful to do low quality test runs that render faster. The +Q
command line switch or Quality
INI option can be used to turn off some time consuming color pattern and lighting calculations to speed things up. See Quality Settings for details. However all settings of +Q5
or Quality=5
or lower turns off pigment calculations and creates gray objects.
By adding a quick_color
to a pigment you tell POV-Ray what solid color to use for quick renders instead of a patterned pigment. For example:
pigment { gradient x color_map { [0.0 color Yellow] [0.3 color Cyan] [0.6 color Magenta] [1.0 color Cyan] } turbulence 0.5 lambda 1.5 omega 0.75 octaves 8 quick_color Neon_Pink }
This tells POV-Ray to use solid Neon_Pink
for test runs at quality +Q5
or lower but to use the turbulent gradient pattern for rendering at +Q6
and higher. Solid color pigments such as
pigment {color Magenta}
automatically set the quick_color
to that value. You may override this if you want. Suppose you have 10 spheres on the screen and all are yellow. If you want to identify them individually you could give each a different quick_color
. Foe example:
sphere { <1,2,3>,4 pigment { color Yellow quick_color Red } } sphere { <-1,-2,-3>,4 pigment { color Yellow quick_color Blue } }
and so on. At +Q6
or higher they will all be yellow but at +Q5
or lower each would be different colors so you could identify them.
The alternate spelling quick_colour
is also supported.