English

Multitexture

    Bitmanagement Feature Labs
 

Multitexture Lab

A Multitexture texture is composed of layers of textures (generally 2 or 3), each with a blending mode.

There are also other parameters (enable transparency, color, etc). The underlaying Material may have an effect as well. In here, a white diffuseColor is used.

In the example, there are only two layers. As it is sometimes difficult to define the look of two textures being blendend, this examples tries to help you finding the correct blending. You can also try your own textures by drag&dropping on one of the two layers' squares (in the scene).

The modes available (underlined ones are directly exportable from 3dsmax):
- MODULATE: multiplies the texture color with the current color (Arg1 * Arg2).
- MODULATE2X: multiplies the components of the arguments, and shift the products to the left 1 bit (effectively multiplying them by 2) for brightening.
- MODULATE4X: multiplies the components of the arguments, and shift the products to the left 2 bits (effectively multiplying them by 4) for brightening.
- ADD: adds the components of the arguments (Arg1 + Arg2).
- ADDSIGNED: adds the components of the arguments with a –0.5 bias, making the effective range of values from –0.5 through 0.5.
- ADDSIGNED2X: adds the components of the arguments with a –0.5 bias, and shift the products to the left 1 bit.
- SUBTRACT: subtracts the components of the second argument from those of the first argument (Arg1 -Arg2).
- ADDSMOOTH: adds the first and second arguments, then subtract their product from the sum (Arg1 + Arg2 - Arg1*Arg2 == Arg1 + (1-Arg1)*Arg2).
- BLENDDIFFUSEALPHA: linearly blends this layer, using the interpolated alpha from each vertex (Arg1*(Alpha) + Arg2*(1-Alpha)).
- BLENDTEXTUREALPHA: linearly blends this layer, using the alpha from this stage's texture (Arg1*(Alpha) + Arg2*(1-Alpha)).
- BLENDFACTORALPHA: linearly blends this layer, using the alpha factor from the MultiTexture node (Arg1*(Alpha) + Arg2*(1-Alpha)).
- BLENDCURRENTALPHA: linearly blends this layer, using the alpha taken from the previous texture stage (Arg1*(Alpha) + Arg2*(1-Alpha)).
- BLENDTEXTUREALPHAPM: linearly blends a layer that uses a premultiplied alpha (Arg1 + Arg2*(1-Alpha)).
- PREMODULATE: modulates this layer with the next texture stage.
- MODULATEALPHA_ADDCOLOR: modulates the color of the second argument, using the alpha of the first argument; then add the result to argument one (Arg1.RGB + Arg1.A*Arg2.RGB).
- MODULATEINVALPHA_ADDCOLOR: similar to MODULATEALPHA_ADDCOLOR, but uses the inverse of the alpha of the first argument ((1-Arg1.A)*Arg2.RGB + Arg1.RGB).
- MODULATEINVCOLOR_ADDALPHA: similar to MODULATECOLOR_ADDALPHA, but uses the inverse of the color of the first argument ((1-Arg1.RGB)*Arg2.RGB + Arg1.A).
- OFF: disables the layer.
- SELECTARG1: uses color argument 1.
- SELECTARG2 REPLACE: uses color argument 2.
- DOTPRODUCT3: modulates the components of each argument (as signed components), add their products, then replicate the sum to all color channels, including alpha. This can do either diffuse or specular bump mapping with correct input. Performs the function (Arg1.R*Arg2.R + Arg1.G*Arg2.G + Arg1.B*Arg2.B) where each component has been scaled and offset to make it signed. The result is replicated into all four (including alpha) channels.

There are also 2 others, for bump mapping:
- BUMPENVMAP: perform per-pixel bump mapping, using the environment map in the next texture stage, without luminance (for color operations only).
- BUMPENVMAPLUMINANCE: perform per-pixel bump mapping, using the environment map in the next texture stage, with luminance (for color operations only).


A mode may be prefixed with one argument operator:
- (default) : the second argument color (ARG2) is the color from the previous rendering stage (DIFFUSE i.e. color after Material & Lighting for first stage).
- DIFFUSE_ : the texture argument is the diffuse color interpolated from vertex components during Gouraud shading.
- SPECULAR_ : the texture argument is the specular color interpolated from vertex components during Gouraud shading.
- FACTOR_ : the texture argument is the factor (color, alpha) from the MultiTexture node.


After the Argument operator, mode may be prefixed with 0 or multiple of the following modifier operators:
- COMPLEMENT_ : invert the argument so that, if the result of the argument were referred to by the variable x, the value would be 1.0 minus x.
- ALPHAREPLICATE_ : replicate the alpha information to all color channels before the operation completes.
- COMPLEMENT2_ : invert argument 2 so that, if the result of the argument were referred to by the variable x, the value would be 1.0 minus x.
- ALPHAREPLICATE2_ : replicate the alpha of argument 2 information to all color channels before the operation completes.
 

Click and drag the cube if you want to rotate it.
Examples:
Can have transparency

LAYER 1
Blending mode:
Complement:
Texture:

LAYER 2
Blending mode:
Complement:
Texture: