From BlenderWiki

Jump to: navigation, search

Animating Materials

Before reading this page, you should know about Blender’s materials – if not, read this chapter first!

Animated materials can be a very powerful tool, for many different purposes. For example, you can use them to simulate the color changes of a chameleon’s skin, a video screen lighting up, the surface of a river or lake, a light lighting up (with an halo material), etc., etc.

The possibilities are nearly unlimited (or would be, if all material settings were animateable – for example, there is no Ipo curve for the Glossiness of raytraced reflection/transparency, which would enable the simulation of condensation spreading over a mirror or window…).

However, there’s one point you should grasp. Two different things are gathered in this Ipo type:

  • Real material settings (like diffuse/specular/mirror colors, alpha, etc.).
  • And texture mapping settings (i.e. where and to what is mapped a given texture).

This can be a disturbing point, as no visual distinction is made between both, but whereas the first Ipos curves are always shown for the active material, the second ones are specific to the material’s texture slots (or channel), which means that there can be up to eighteen of each of these. As we saw in the Ipo window pages, you control which texture slot’s Ipos are visible with the small numeric field, to the right of the Ipo type selector, in the header of the Ipo Curve Editor window (0 means first slot, etc.).

Note that these “texture mapping” stuff also applies to Lamp and World Ipo types, as these can also use several textures.

There is another point that might be tricky: many material properties can be modified by its textures (through the Map To settings). Hence, you can animate them both directly via Ipo curves, and indirectly via either texture mapping (in the same Material Ipo curves), or texture itself (with the Texture Ipo curves). This features many possibilities, but might also be a bit complex to manage, sometimes…

Let’s also mention another indirect material animation, or more precisely, texture mapping animation. Indeed, when you use e.g. another Object’s texture coordinates as input mapping, by transforming this “controller” object, you will animate the mapping of your texture – this might be a very powerful technique to animate e.g. water flowing down a twisted river!

Finally, a word about materials using nodes: unlike texture or compositing ones, there is no Time input node for materials, so you can’t animate material nodes!

Options

There’s quite a lot of material Ipos – and even though, they do not cover all material settings! First, we have material ones:

R, G, B
These curves control the diffuse color of the material (values range in [0.0, 1.0]).
Remember that these settings can also be controlled by some textures…
SpecR, SpecG, SpecB
These curves control the specular color of the material (values range in [0.0, 1.0]).
Remember that these settings can also be controlled by some textures…
MirR, MirG, MirB
These curves control the mirror color of the material (values range in [0.0, 1.0]).
Remember that these settings can also be controlled by some textures…
Ref
This controls the reflection value of the diffuse shader (value ranges in [0.0, 1.0]).
Remember that this setting can also be controlled by some textures…
Alpha
This controls the transparency of the material (value ranges in [0.0, 1.0]).
Remember that this setting can also be controlled by some textures…
Emit
This controls the quantity of light emitted by the material (value ranges in [0.0, 2.0]).
Remember that this setting can also be controlled by some textures…
Amb
This controls the quantity of ambient light received by the material (value ranges in [0.0, 1.0]).
Remember that this setting can also be controlled by some textures…
Spec
This controls the specularity value of the specular shader (value ranges in [0.0, 1.0]).
Remember that this setting can also be controlled by some textures…
Hard
This controls the hardness of the specular shader (for those which use it, value ranges in [1.0, 511.0]).
With halo material, this controls the hardness of the halo (value ranges in [1.0, 127.0]).
Note that even though the Ipo curve is standard, the controlled value is an integer one…
Remember that this setting can also be controlled by some textures…
SpTra
This controls the SpecTra raytraced transparency setting, which makes specular areas opaque (value ranges in [0.0, 1.0]).
Ior
This controls the index of refraction of raytraced transparency (value ranges in [1.0, 3.0]). With this, you can transform glass in diamond!
Mode
This is an integer (discrete) Ipo curve, that enables a different feature for each strictly positive value (this seems to me more like a test/debug feature, as it always enables only one of these at a time – not very useful…):
  • 1 enables the Traceable option.
  • 2 enables the Shadow option.
  • 3 enables the Shadeless option.
  • 4 enables the Wire option.
  • 5 enables the VCol Light option.
  • 6 enables the Halo option.
  • 7 enables the ZTransp option.
  • 8 enables the VCol Paint option.
  • 9 enables the ZInvert option.
  • 10 enables the Env option.
  • 11 enables the OnlyShadow option.
  • 12 enables the TexFace option.
  • 13 seems to enable nothing (bad luck!).
  • 14 enables the OnlyCast option.
  • 15 enables the No Mist option.
  • 16 seems to enable nothing.
  • 17 enables the Radio option.
  • 18 enables the Ray Transp option.
  • 19 enables the Ray Mirror option.
  • 20 enables the TraShadow option.
  • 21 enables the Colorband option.
  • 22 seems to enable nothing.
  • 23 enables the Bias option.
  • 24 enables the Full Osa option.
  • 25 seems to enable nothing.
  • 26 enables the ShadBuf option.
  • 27 enables the Tangent option.
  • 28 seems to enable nothing.
  • 29 enables the Exclusive option (lighting group).
  • 30 enables the A option (use alpha in TexFace).
  • 31 seems to enable nothing, and is the last possible value.
HaSize
This controls the halo size of halo materials (value ranges in [0.0, 100.0]).
Translu
This controls the translucency of the material (value ranges in [0.0, 1.0]).
Remember that this setting can also be controlled by some textures…
RayMir
This controls the raytraced reflection intensity (value ranges in [0.0, 1.0]).
Remember that this setting can also be controlled by some textures…
FresMir
This controls the fresnel power for raytraced reflection (value ranges in [0.0, 5.0]).
FresMirI
This controls the fresnel blending factor for raytraced reflection (value ranges in [1.0, 5.0]).
FresTra
This controls the fresnel power for raytraced transparency (value ranges in [0.0, 5.0]).
FresTraI
This controls the fresnel blending factor for raytraced transparency (value ranges in [1.0, 5.0]).
TraGlow
This controls the Add value of halos, for halo material (value ranges in [0.0, 1.0]).

Below, there are the texture mapping Ipos, specific to each texture slot/channel of the material (selected by the small counter to the right of the type selector):

OfsX, OfsY, OfsZ
These curves control the offset in the mapping of the texture (values range in [-10.0, 10.0]).
Note that the Z offset is only useful with 3D textures, e.g. Blender’s procedural ones – as you’ll see in the examples below.
SizeX, SizeY, SizeZ
These curves control the scaling of the mapped texture (values range in [-100.0, 100.0]).
Again, Z size is only meaningful with 3D textures!
TexR, TexG, TexB
These curves control the color used to colorize non-RGB textures (the one found in the Map To panel, values range in [0.0, 1.0]).
DefVar
This controls the DVar value (i.e. default value for reflection, specularity, … – in fact, most properties a texture might be mapped to, except diffuse color! Value ranges in [0.0, 1.0]).
Col
This controls the influence of the texture over the diffuse color of the material (value ranges in [0.0, 1.0]).
Nor
This controls the level of bump mapping generated by the texture (value ranges in [0.0, 25.0]).
Var
This controls the influence of the texture over all other properties it is mapped to (i.e. except Col, Nor and Disp… Value ranges in [0.0, 1.0]).
Disp
This controls how much the texture deforms the underlying mesh, along its normals (value ranges in [0.0, 1.0]). It’s a sort of simplified Displace modifier.

Example

As an illustration, we’ll create a simple “psychedelic” background. This obviously won’t demonstrate all possibilities of material animation – but I think this would need at least a whole book!

Add a plane and a camera, such that the plane faces the camera and covers the whole view.

Add a material to the plane. As we won’t use any light, set its Emit value to 1.0.

Create Ipo curves for R, G and B, with a few random control points, all in the [0.0, 1.0] range. Manage to have three different length between the first and last keyframes, and enable the Cyclic extend mode (E2 NumPad). This way, with the three curves cycling over various periods, you’ll get a never-the-same color animation! Unless you want to get a “time-tileable” animation, in which case you should manage to get exactly the same color at start and end… You can also create an Emit Ipo curve, e.g. to create a fade in/out…

Now, let’s add a bit of fun in this plain colored background. Add a texture to the material and, in the Texture sub-context, select a procedural texture (DistortedNoise, for example, but any one will work – follow your taste!), and set it to your liking.

Back in the Material sub-context, choose to what you want to map the texture – for this example, I chose to map it to diffuse color in Difference mode, in a first texture channel, and to emit value in Multiply mode, in a second texture channel.

Finally, animate the Z offset of the mapping of both channels (define a first OfsZ Ipo curve, and use the copy/paste buttons to exactly copy it to the second texture channel’s Ipo). Here again, you can either have two different values for start and end, or the same if you want a cyclic animation…

Usually, you will create a slow, linear variation of the Z offset (i.e. a straight curve with low gradient), e.g. a decay of 1.0 over 500 to 1000 frames, but the only way to find the good value is to make preview renders!

You should get something similar to what shown below. You can download the blend file File:ManAnimationTechsMaterialExPshychedelic.blend.