Difference between revisions of "Reference:Bitmap Modifiers"
Jholsenback (talk | contribs) m (1 revision: Reference Migration Initial Load) |
Jholsenback (talk | contribs) m (version addition) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 7: | Line 7: | ||
three types of bitmaps.</p> | three types of bitmaps.</p> | ||
+ | ==The once Option== | ||
{{#indexentry:once, bitmap modifier}} | {{#indexentry:once, bitmap modifier}} | ||
{{#indexentry:bitmap modifier, once}} | {{#indexentry:bitmap modifier, once}} | ||
− | |||
<p>Normally there are an infinite number of repeating image maps, bump maps | <p>Normally there are an infinite number of repeating image maps, bump maps | ||
or material maps created over every unit square of the x-y-plane like tiles. | or material maps created over every unit square of the x-y-plane like tiles. | ||
Line 27: | Line 27: | ||
</pre> | </pre> | ||
+ | ==The map_type Option== | ||
{{#indexentry:map_type, bitmap modifier}} | {{#indexentry:map_type, bitmap modifier}} | ||
{{#indexentry:bitmap modifier, map_type}} | {{#indexentry:bitmap modifier, map_type}} | ||
− | + | <p>The default projection of the image onto the x-y-plane is called a <em>planar map type</em>. This option may be changed by adding the <code>map_type</code> keyword followed by an integer number specifying the way to wrap the image around the object.</p> | |
− | <p>The default projection of the image onto the x-y-plane is called a <em> | + | |
− | planar map type</em>. This option may be changed by adding the <code> | + | <ul> |
− | map_type</code> keyword followed by an integer number specifying the way to | + | <li>A <code>map_type 0</code> gives the default planar mapping already described.</li> |
− | wrap the image around the object.</p> | + | <li>A <code>map_type 1</code> gives a spherical mapping. It assumes that the object is a sphere of any size sitting at the origin. The y-axis is the north/south pole of the spherical mapping. The top and bottom edges of the image just touch the pole regardless of any scaling. The left edge of the image begins at the positive x-axis and wraps the image around the sphere from west to east in a -y-rotation. The image covers the sphere exactly once. The <code>once</code> keyword has no meaning for this mapping type.</li> |
− | < | + | <li>With <code>map_type 2</code> you get a cylindrical mapping. It assumes that a cylinder of any diameter lies along the y-axis. The image wraps around the cylinder just like the spherical map but the image remains one unit tall from y=0 to y=1. This band of color is repeated at all heights unless the <code>once</code> keyword is applied.</li> |
− | A <code>map_type 0</code> gives the default planar mapping already | + | <li>A <code>map_type 5</code> gives a torus or donut shaped mapping. It assumes that a torus of major radius one sits at the origin in the x-z-plane. The image is wrapped around similar to spherical or cylindrical maps. However the top and bottom edges of the map wrap over and under the torus where they meet each other on the inner rim.</li> |
− | described.</ | + | <li>Types 3 and 4 are still under development.</li> |
− | < | + | <li>A <code>map_type 7</code> {{New}} in version 3.8 produces an <em>angular</em> shaped mapping to be used with light probes.</li> |
− | A <code>map_type 1</code> gives a spherical mapping. It assumes that the | + | </ul> |
− | object is a sphere of any size sitting at the origin. The y-axis is the | ||
− | north/south pole of the spherical mapping. The top and bottom edges of the | ||
− | image just touch the pole regardless of any scaling. The left edge of the | ||
− | image begins at the positive x-axis and wraps the image around the sphere | ||
− | from west to east in a -y-rotation. The image covers the sphere exactly once. | ||
− | The <code>once</code> keyword has no meaning for this mapping type.</ | ||
− | < | ||
− | With <code>map_type 2</code> you get a cylindrical mapping. It assumes that | ||
− | a cylinder of any diameter lies along the y-axis. The image wraps around the | ||
− | cylinder just like the spherical map but the image remains one unit tall from | ||
− | y=0 to y=1. This band of color is repeated at all heights unless the <code> | ||
− | once</code> keyword is applied.</ | ||
− | < | ||
− | |||
− | assumes that a torus of major radius one sits at the origin in the x-z-plane. | ||
− | The image is wrapped around similar to spherical or cylindrical maps. However | ||
− | the top and bottom edges of the map wrap over and under the torus where they | ||
− | meet each other on the inner rim.</ | ||
− | < | ||
− | Types 3 and 4 are still under development.</ | ||
<p class="Note"><strong>Note:</strong> The <code>map_type</code> option may also be applied to <code> | <p class="Note"><strong>Note:</strong> The <code>map_type</code> option may also be applied to <code> | ||
bump_map</code> and <code>material_map</code> statements.</p> | bump_map</code> and <code>material_map</code> statements.</p> | ||
Line 74: | Line 55: | ||
</pre> | </pre> | ||
+ | ==The interpolate Option== | ||
{{#indexentry:interpolate, bitmap modifier}} | {{#indexentry:interpolate, bitmap modifier}} | ||
{{#indexentry:bitmap modifier, interpolate}} | {{#indexentry:bitmap modifier, interpolate}} | ||
− | |||
<p>Adding the <code>interpolate</code> keyword can smooth the jagged look of a bitmap. When POV-Ray checks a color for an image map or a bump amount for a bump map, it often checks a point that is not directly on top of one pixel but sort of between several differently colored pixels. Interpolations return an in-between value so that the steps between the pixels in the map will look smoother.</p> | <p>Adding the <code>interpolate</code> keyword can smooth the jagged look of a bitmap. When POV-Ray checks a color for an image map or a bump amount for a bump map, it often checks a point that is not directly on top of one pixel but sort of between several differently colored pixels. Interpolations return an in-between value so that the steps between the pixels in the map will look smoother.</p> | ||
<p> | <p> |
Latest revision as of 10:33, 26 June 2017
A bitmap modifier is a modifier used inside an image_map
,
bump_map
or material_map
to specify how the 2-D
bitmap is to be applied to the 3-D surface. Several bitmap modifiers apply to
specific kinds of maps and they are covered in the appropriate sections. The
bitmap modifiers discussed in the following sections are applicable to all
three types of bitmaps.
The once Option
Normally there are an infinite number of repeating image maps, bump maps
or material maps created over every unit square of the x-y-plane like tiles.
By adding the once
keyword after a file name you can eliminate
all other copies of the map except the one at (0,0) to (1,1). In image maps,
areas outside this unit square are treated as fully transparent. In bump
maps, areas outside this unit square are left flat with no normal
modification. In material maps, areas outside this unit square are textured
with the first texture of the texture list.
For example:
image_map { gif "mypic.gif" once }
The map_type Option
The default projection of the image onto the x-y-plane is called a planar map type. This option may be changed by adding the map_type
keyword followed by an integer number specifying the way to wrap the image around the object.
- A
map_type 0
gives the default planar mapping already described. - A
map_type 1
gives a spherical mapping. It assumes that the object is a sphere of any size sitting at the origin. The y-axis is the north/south pole of the spherical mapping. The top and bottom edges of the image just touch the pole regardless of any scaling. The left edge of the image begins at the positive x-axis and wraps the image around the sphere from west to east in a -y-rotation. The image covers the sphere exactly once. Theonce
keyword has no meaning for this mapping type. - With
map_type 2
you get a cylindrical mapping. It assumes that a cylinder of any diameter lies along the y-axis. The image wraps around the cylinder just like the spherical map but the image remains one unit tall from y=0 to y=1. This band of color is repeated at all heights unless theonce
keyword is applied. - A
map_type 5
gives a torus or donut shaped mapping. It assumes that a torus of major radius one sits at the origin in the x-z-plane. The image is wrapped around similar to spherical or cylindrical maps. However the top and bottom edges of the map wrap over and under the torus where they meet each other on the inner rim. - Types 3 and 4 are still under development.
- A
map_type 7
New in version 3.8 produces an angular shaped mapping to be used with light probes.
Note: The map_type
option may also be applied to
bump_map
and material_map
statements.
For example:
sphere{<0,0,0>,1 pigment{ image_map { gif "world.gif" map_type 1 } } }
The interpolate Option
Adding the interpolate
keyword can smooth the jagged look of a bitmap. When POV-Ray checks a color for an image map or a bump amount for a bump map, it often checks a point that is not directly on top of one pixel but sort of between several differently colored pixels. Interpolations return an in-between value so that the steps between the pixels in the map will look smoother.
Although interpolate
is legal in material maps, the color index is interpolated before the texture is chosen. It does not interpolate the final color as you might hope it would. In general, interpolation of material maps serves no useful purpose but this may be fixed in future versions.
There are currently three types of interpolation: interpolate 2
gives bilinear interpolation, interpolate 3
gives bicubic, and interpolate 4
gives normalized distance.
For example:
image_map { gif "mypic.gif" interpolate 2 }
The default is no interpolation. Normalized distance is the slowest, bilinear does a better job of picking the between color, and arguably, bicubic interpolation is a slight improvement, however it is subject to over-sharpening at some color borders. Normally bilinear is used.
If your map looks jagged, try using interpolation instead of going to a higher resolution image. The results can be very good.