30
$\begingroup$

It's possible to animate a change noise texture by animating the texture coordinates with a mapping node or by animating the texture space, however this only works on one axis at a time (on the other axes the texture will appear to be sliding across the object's surface).

For example, the top face has the desired effect but the other faces appear to be moving/sliding upwards:

Even with all three axes location and rotation animated it still appears to be sliding rather than statically changing.

enter image description here

Is there some way to make each face appear like the top face in the first gif but still be seamlessly blended with the other faces? This should work for other shapes as well.

In other words, I'm looking for a way to animate the "seed" of the texture.

$\endgroup$

3 Answers 3

44
$\begingroup$

You can not animate the seed of a 3D gradient noise texture because it´s usually all fixed in a permutation table. What you are basically looking for are 4D gradient noise textures.

Why do 3D gradient noise textures not work? Imagine a 3D procedural texture as a continuous grid in space containing colour or intensity values at any node. Also imagine your mesh inside this grid. For simplicity imagine that every point on the surface of the mesh gets the colour of the nearest point of the grid assigned to it. Now imagine moving the grid or the manifold mesh. Eventually the points will move along the normal of a few faces but they can usually not move along the normals of all faces at a given time. And if they don´t move perfectly along a normal they will slide along the surface.

To overcome this limitation we need to add a dimension which we can then animate.

So how can we do this in blender/cycles?

We can program it ourselves in OSL(Open Shading Language). First we need the code for our 4D texture shader (e.g. a very simple one):

#include "stdosl.h"

shader simple_noise_texture4d(
float Scale = 1.0,
float Time = 0.0,
output color Color = 0.0
)
{
    Color = noise( "uperlin", P * Scale, Time );
}

Use the internal text editor and name the above text block e.g. noise.osl. We use the builtin noise function with 4D unsigned perlin noise. The 4th component named Time will be used to animate the texture. Scale is used to scale the texture as usual. The output is named Color. For more information see the OSL specification osl-languagespec.pdf.

Edit: By the way, there already exists a script template "Noise" in the text editor called noise.osl. I didn´t know this by the time I posted this answer. It provides some more 4D noise algorithms.

Important

On the render tab of the properties panel enable "Open Shading Language". The Open Shading Language checkbox will only be available with CPU render mode.

Then add a material to the object as usual and add a script node and set the shader script to "noise.osl". Click the "Update shader.." button next to the shader name input. Use the output colour e.g. as input colour for a Diffuse BSDF shader.

enter image description here

Now Time can be animated as usual.

enter image description here

For more complex noise just edit the OSL code accordingly.

$\endgroup$
6
  • 3
    $\begingroup$ Excellent answer! +1 for OSL exposure ;-) $\endgroup$
    – Matt
    Commented Apr 1, 2014 at 21:11
  • $\begingroup$ @hawkenfox make sure you are using "Cycles Render" in the engine dropdown menu. $\endgroup$
    – user2859
    Commented Jan 30, 2016 at 12:36
  • $\begingroup$ @ user2859 Was on "Cycles Render" but the problem was that I need to use CPU render mode and not GPU for OSL check box to be available. $\endgroup$
    – hawkenfox
    Commented Jan 30, 2016 at 16:42
  • $\begingroup$ @hawkenfox Oh, of course OSL only works on CPU for now. Thanks for the edit. $\endgroup$
    – user2859
    Commented Jan 31, 2016 at 10:48
  • $\begingroup$ This is exactly what I am trying to achieve too but I render my scenes with the GPU. Is there the same shader which does not use Open Shading Language (CPU only) ? $\endgroup$
    – GeoffCoope
    Commented Feb 21, 2017 at 11:44
12
$\begingroup$

If using the objects UV's is not a firm requirement you can use the following setup to animate noise. Conceptually, this is like placing the object 'within' the 3D texture and then moving that texture. It's seamless across the faces. Using the i shortcut to set keyframes for Location, Rotation, and Scale is quick and works well. enter image description here

EDIT:here's the animated .gif enter image description here

$\endgroup$
3
  • $\begingroup$ Could you upload a gif of how this looks? The second gif in my answer is made by animating the location and rotation, but you can still tell the texture is sliding.. $\endgroup$
    – gandalf3
    Commented Mar 29, 2014 at 19:04
  • $\begingroup$ Unfortunately this seems to have the same problem as the second gif in my question, where the texture seems to "slide" across the surface of the object. $\endgroup$
    – gandalf3
    Commented Apr 1, 2014 at 20:10
  • $\begingroup$ yeah, I know. I did not understand your question properly. The other answer given is really nice. I didn't know that could be done. I almost deleted this answer but decided to leave it since several people seem to think it's also useful to them. I prefer the other solution as well. $\endgroup$ Commented Apr 1, 2014 at 20:32
4
$\begingroup$

Since version 2.82 there is a dropdown to enable the W parameter in the following textures:

  • Voronoi
  • Musgrave
  • Noise
  • White Noise

enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .