These shaders rely on one of the texture space mapping functions above to produce the coord texture vertex, and produce a color for that vertex. Shaders that produce 2D mappings only use the x and y components of the texture vertex.
Most of these return colors. Since colors can be assigned to scalar parameters of other shaders, the shaders can be used in conjunction with blending shaders that select colors from a color spread based on a map scalar. This interacts with the fading and smoothing parameters of the texture shaders.
Look up a texture image in the half-open interval [0, 1). Points outside this interval are mapped to R=G=B=A=0.
color "mib_texture_lookup" ( color texture "tex", vector "coord")
This is basically a front-end to the mi_lookup_color_texture family of shader interface functions.
color "mib_texture_lookup2" ( color texture "tex", scalar "factor")
An alternative to mib_texture_lookup. This uses the first set of texture coordinates in state instead of getting them as a connected parameter.
Lookup of texture image using elliptical filtering.
color "mib_texture_filter_lookup" ( color texture "tex", vector "coord", scalar "eccmax", scalar "maxminor", scalar "disc_r", boolean "bilinear", integer "space", shader "remap")
The shader calls mi_texture_filter_project with the given space parameter to obtain three corresponding points in raster and texture space. These three texture coordinates are remapped by calling the specified remap shader; the actual texture coordinate for remapping is passed as the fourth argument of mi_call_shader_x (which means that the called shader must be designed to check its fourth argument). The remapping shader must use it instead of the provided texture coordinate vector in the shader parameters.
The projection transformation matrix required by the filtered texture lookup is calculated by calling the mi_texture_filter_transform shader interface function, using the three raster space and remapped texture space coordinates. The translation component in the matrix is set to coord. Note that the projection transformation is always calculated for the current raster position, but it is possible to translate the ellipse in texture space using coord. This is useful for bump mapping.
This is basically a front-end to the mi_lookup_filter_color_texture family of shader interface functions. The elliptical filter parameter bilinear is set to false in mib_texture_filter_lookup, for circle_radius the default value is used. If the projection matrix cannot be calculated properly, or the texture is a shader instead of an image, or the reflection level is not zero, nonfiltered texture lookup is used.
Divide the unit cube into eight subcubes, each with a separate RGBA color. The width of the left, bottom, and front part is programmable, allowing the use of this shader for generating stripes and two- or three-dimensional checkerboards. This function is also useful for preview shaderball scenes.
color "mib_texture_checkerboard" ( vector "coord", scalar "xsize", scalar "ysize", scalar "zsize", color "color000", color "color001", color "color010", color "color011", color "color100", color "color101", color "color110", color "color111")
Draw a disc with programmable diameter into the unit square, and draw a sphere with programmable diameter into the unit cube. The foreground and background colors are programmable.
color "mib_texture_polkadot" ( vector "coord", scalar "radius", color "fgcolor", color "bgcolor")
color "mib_texture_polkasphere" ( vector "coord", scalar "radius", color "fgcolor", color "bgcolor")
Create a turbulent scalar pattern in a unit cube. One, two, or all three texture vector components may be computed in polar coordinates, causing spherical mapping.
scalar "mib_texture_turbulence" ( vector "coord", scalar "spacing", scalar "strength", scalar "power", integer "iteration", integer "polar_dim")
Create cosine waves in U, V, and W directions, each with a programmable amplitude. (Frequency and offset can be controlled using a texture remapping base shader.) The result is a grayscale color, R=G=B=A, that can be remapped using a color map base shader. Its range is [o-s ... o+s] if s is the sum of the amplitudes and o is the offset.
color "mib_texture_wave" ( vector "coord", scalar "amplitude_x", scalar "amplitude_y", scalar "amplitude_z", scalar "offset")
Copyright (©) 1986-2009 by mental images GmbH