Difference between revisions of "Reference:Average Pattern"
Jholsenback (talk | contribs) m (1 revision: Reference Migration Initial Load) |
Jholsenback (talk | contribs) m (version changes) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 40: | Line 40: | ||
PIGMENT_MAP_ENTRY</em>. They are not notational symbols denoting optional | PIGMENT_MAP_ENTRY</em>. They are not notational symbols denoting optional | ||
parts. The brackets surround each entry in the <code>pigment_map</code>.</p> | parts. The brackets surround each entry in the <code>pigment_map</code>.</p> | ||
− | <p> | + | <p>In <em>previous</em> versions there <em>had</em> to be from 2 to 256 entries in the map. A {{Change}} in version 3.8 has removed the upper restriction.</p> |
− | |||
<p> | <p> | ||
For example</p> | For example</p> | ||
Line 64: | Line 63: | ||
pattern. The perturbed normals are then weighted, added and normalized.</p> | pattern. The perturbed normals are then weighted, added and normalized.</p> | ||
<p> | <p> | ||
− | See the sections [[Reference:Pigment Map|Pigment Maps and Pigment Lists]], [[Reference:Normal Map|Normal Maps and Normal Lists]], [[Reference:Patterned Textures#Texture Maps|Texture Maps]], and [[Reference: | + | See the sections [[Reference:Pigment Map|Pigment Maps and Pigment Lists]], [[Reference:Normal Map|Normal Maps and Normal Lists]], [[Reference:Patterned Textures#Texture Maps|Texture Maps]], and [[Reference:Density#Density Maps and Density Lists|Density Maps and Density Lists]] for more information.</p> |
Latest revision as of 10:33, 30 June 2017
Technically average
is not a pattern type but it is listed here
because the syntax is similar to other patterns. Typically a pattern type specifies
how colors or normals are chosen from a pigment_map
,
texture_map
, density_map
, or normal_map
, however average
tells POV-Ray to
average together all of the patterns you specify. Average was originally
designed to be used in a normal statement with a normal_map
as a
method of specifying more than one normal pattern on the same surface.
However average may be used in a pigment statement with a
pigment_map
or in a texture statement with a texture_map
or media density with density_map
to average colors too.
When used with pigments, the syntax is:
AVERAGED_PIGMENT: pigment { pigment_map { PIGMENT_MAP_ENTRY... } } PIGMENT_MAP_ENTRY: [ [Weight] PIGMENT_BODY ]
Where Weight
is an optional float value that
defaults to 1.0 if not specified. This weight value is the relative weight
applied to that pigment. Each PIGMENT_BODY is anything which can be
inside a pigment{...}
statement. The pigment
keyword and {}
braces need not be specified.
Note: The []
brackets are part of the actual
PIGMENT_MAP_ENTRY. They are not notational symbols denoting optional
parts. The brackets surround each entry in the pigment_map
.
In previous versions there had to be from 2 to 256 entries in the map. A Change in version 3.8 has removed the upper restriction.
For example
pigment { average pigment_map { [1.0 Pigment_1] [2.0 Pigment_2] [0.5 Pigment_3] } }
All three pigments are evaluated. The weight values are multiplied by the
resulting color. They are then divided by the total of the weights which, in
this example is 3.5. When used with texture_map
or
density_map
it works the same way.
When used with a normal_map
in a normal statement, multiple
copies of the original surface normal are created and are perturbed by each
pattern. The perturbed normals are then weighted, added and normalized.
See the sections Pigment Maps and Pigment Lists, Normal Maps and Normal Lists, Texture Maps, and Density Maps and Density Lists for more information.