Shaders: noise and wave distortion now work uniformly instead of diagonally
Previously Noise and Wave texture nodes would use noise functions within a [0,1] range for distortion effects. We either add or subtract noise from coordinates, never do both at same time. This led to the texture drastically shifting on the diagonal axis of a plane / cube. This behavior makes the Distortion input hard to control or animate. Capabilities of driving it with other texture are also limited, diagonal shifting is very apparent. This was fixed by offsetting the noise function to a signed range and making it zero-centered. This way noise is uniformly added and subtracted from coordinates. Texture pattern sticks to main coordinates which makes it way easier to control. This change is not strictly backwards compatible, there is versioning to ensure the scale of the distortion remains similar, but the particular pattern can be a little different. Differential Revision: https://developer.blender.org/D6177
This commit is contained in:

committed by
Brecht Van Lommel

parent
9c1134015c
commit
074c00f9d6
@@ -33,7 +33,7 @@ ccl_device_noinline_cpu float svm_wave(NodeWaveType type,
|
||||
n = len(p) * 20.0f;
|
||||
|
||||
if (distortion != 0.0f)
|
||||
n += distortion * fractal_noise_3d(p * dscale, detail);
|
||||
n += distortion * (fractal_noise_3d(p * dscale, detail) * 2.0f - 1.0f);
|
||||
|
||||
if (profile == NODE_WAVE_PROFILE_SIN) {
|
||||
return 0.5f + 0.5f * sinf(n);
|
||||
|
Reference in New Issue
Block a user