4
$\begingroup$

I would like to know if it's possible to get something periodic only through the parameters of the musgrave node with cycles.

sorry if my question isn't clear, here is an example of what I'm doing: http://i.stack.imgur.com/Se6uq.png

the brick texture node is periodic, I mean f(0)=f(2*pi) while the Musgrave texture gives something with a discontinuity. Honestly I don't think it's possible to solve this problem trough musgrave node in general case, because I guess it uses a pseudo random generator and when you code a such thing you search to avoid periodicity.

$\endgroup$
  • 1
    $\begingroup$ Images as to what you mean by periodic in this context would help. $\endgroup$ – Ray Mairlot Nov 6 '14 at 17:55
  • $\begingroup$ What are you meaning by periodic? $\endgroup$ – BlendingJake Nov 6 '14 at 18:27
  • $\begingroup$ musgrave at x must be equal at x+L for any x value and for one L given. $\endgroup$ – The Unholy Metal Machine Nov 6 '14 at 18:38
  • $\begingroup$ What part of the musgrave? If it is the output then you should be able to use a math node set to add. Then add musgrave and L. $\endgroup$ – BlendingJake Nov 6 '14 at 19:03
  • $\begingroup$ @bob-Masterofblackmagic Add some more specifics to the question, an image of what you want or whatever you have tried would also be useful. $\endgroup$ – iKlsR Nov 6 '14 at 20:59
5
$\begingroup$

The reason for the 'join' in the resultant texture is due to the discontinuities (edges) in the mapping into texture space and the solution is to change your mapping to join the edges to make the musgrave continuous. In order to visualise this, consider how the polar coordinates are currently being mapped into texture space.

The polar mapping can be considered as having the following marked boundaries (ABCD) :

radial

In 'texture space' the marked boundaries map to the edges of a square (or rectangular) region as follows :

plane

Note how the point A in the radial texture maps to the edge A in texture space - effectively compressing the texture down to a point in the centre. Edge B is stretched around the circumference while C and D are at the discontinuity of the texture and correspond to opposite edges of the plane in texture space.

The discontinuity is caused by edges C and D not corresponding to the same region in texture space. Therefore, the solution is to change the mapping to wrap those edges around so that they do coincide - ie, change the mapping in texture space to a cylinder rather than a plane :

cylinder

Now, crosing the C-D boundary in polar coordinates does not produce a discontinuity since the C-D boundary in texture space correspond to the same region.

To achieve this was can use the following nodes :

planar to cylindrical nodes

This takes the output from the Radial texture (which varies from 0.0 to 1.0 as to coordinate moves around the centre) can converts it to Y/Z coordinates around the circumference of the cylinder in texture space shown in the above diagram. Note that since 0.0 and 1.0 map to the same location the mapping becomes cyclic, thereby hiding the join.

To make this more versatile we can add in two offsets - one to offset along the axis of the cylinder (to allow the texture to be animated into/out-of the centre) and one to offset the 'rotation' - and one to adjust the radius of the cylinder, controlling the density of the texure around the centre point to produce the following material :

full material

One limitation of using a Gradient texture is that the output is always between the range 0.0 and 1.0 - beyond a certain distance the output does not change. To address this we can simply replace the Gradient with maths nodes to calculate the distance directly (ie, sqrt(x^2 + y^2)).

full material with proper distance

This can produce the following result :

animated

Blend file included

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ Your explanation about the texture space is very interesting. Thank you! $\endgroup$ – The Unholy Metal Machine Oct 5 '18 at 11:36

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.