3
$\begingroup$

I was looking for a way to animate a procedural texture when a stumbled upon this. I was wondering if there was a way to do something similar with a Musgrave texture. As in the other post, I would not like the texture to seen as moving. I assume that there is no way to do this in Blender without using a script. The example also did not have a vector input, which I would need.

$\endgroup$
7
$\begingroup$

To seamlessly animate a moving texture you can use the same technique as described in Seamless animation loop of procedural textures but using a Musgrave texture in place of the two Voronoi. Here's the result of the Blend file from the linked answer with the Voronoi swapped out to Musgrave textures :

animated

However, for a static but animating musgrave you would need to have an additional 'dimension' of the texture that can be varied without affecting the mapping (as in the OSL solution linked to your question). OSL does not seem to provide an equivalent texture to the Musgrave node so you would either need to reconstruct it mathematically (if you know the algorithm for generating the Musgrave texture) or you need to be able to use the 3-dimensional Vector input of the existing Musgrave node to simultaneously map to your mesh while still providing a dimension to vary for the animation.

To achieve this you could simply unwrap your mesh, providing UV coordinates that can be used for the X and Y coordinates to the Musgrave texture and vary the Z coordinate. This can be achieved using the following nodes :

material

In my case I unwrapped Suzanne using a Sphere projection. Varying the Value node effectively animates the Musgrave texture by selecting a 'slice' of the XYZ texture space to map to the 2-dimensional UV space.

This can produce the following result :

result


Another alternative is to produce a musgrave-like texture by combining Noise textures to produce an output that varies similar to Musgrave fBM. By tweaking the settings we can get something very similar to Musgrave. For example, in the following image the right-hand-side is the default Musgrave texture while on the left is produced by combining two Noise textures :

comparison

To produce this we can use the following nodes :

material

This will produce a true 3D texture (rather than mapping via UV as in the previous solution) and so does not suffer from 'seams'. By animating the input vector (which effectively acts as a 'seed') we can smoothly vary the effect.

This works by taking the Object coordinates and generating two vectors - one moved in the direction of the 'seed' and the other moved in the opposite direction. By using two offsets we can remove any visible 'direction of motion' while changing the 'seed' since the two vectors effectively cancel each other out. The two vectors pass to two Noise textures - these should typically be set to the same values (in particular the Scale) but you may get some interesting results by using different settings. In order to produce the Musgrave-like range of output, we then subtract one noise from the other, one channel is extracted (so it becomes monochrome - you can optionally use the other channels which will produce a similar output (but different pattern) and this is scaled with a Math node to produce output approximately in the range -1.0 to 1.0 similar to the actual Musgrave output.

You can animate the result by varying the 'seed' vector to produce a result similar to the following :

animated

Blend file included

$\endgroup$
  • $\begingroup$ I clarified my post, as in the post that I provided I do not want the texture to appear as if it is moving. In your example, it appears as if the texture is moving upwards. $\endgroup$ – Ben Sep 4 '18 at 23:36
  • $\begingroup$ @Ben I see now. I've edited my answer - hopefully this helps. $\endgroup$ – Rich Sedman Sep 5 '18 at 6:24
  • $\begingroup$ Once again, great answer but I have it unwrapped on a sphere and it has a seam and looks distorted if I use a UV map $\endgroup$ – Ben Sep 5 '18 at 11:53
  • $\begingroup$ @Ben Can you perhaps update your question with a link to your Blend file? $\endgroup$ – Rich Sedman Sep 5 '18 at 12:46
  • 1
    $\begingroup$ @MarkusvonBroady The ‘Seed’ node is actually a re-labelled Combine XYZ node - apologies, I should have explained. $\endgroup$ – Rich Sedman Oct 19 '18 at 13:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.