Gabor Procedural Texture Node

Hi All

I’ve resurrected a very old patch for Gabor noise and added an implementation for Geo Nodes too.

This is based on an older patch D287 by jarope which is based on the OSL version of this noise.

Patch: https://developer.blender.org/D3495

Shadertoy: Shader - Shadertoy BETA

Video about Gabor noise: https://www.youtube.com/watch?v=1_Ss2dUvaW8

It would be helpful to get feedback on the patch, test builds are available here:
Blender Builds - blender.org (Look for D3495, normal warnings about test builds apply!!)

image

Gabor noise works by splatting kernels in a grid of cells. These splats are added together to produce the noise. Gabor can be expensive depending on the number of splats or impulses. Gabor noise also exhibits artifacts at the edge of the splats.

There are a lot of parameters exposed. I feel that it is not easy to remove or reduce these as it limits the possibilist too much.

Brief notes on parameters, excluding obvious ones like vector and scale etc

Type: Unsigned/Signed > Outputs noise in [0:1] and [-1:1] ranges.
Mode: Isotropic/Anisotropic/Hybrid > Allows noise to be controlled using a direction and magnitude vector.
Kernel: Gabor/Ring/Cross/Square/Wave/Phasor > Type of kernel used to calculate the noise. Similar to Distance metric in Voronoi noise. The names for Ring/Cross/Square/Wave are purely arbitrary.
[Removed] Seed: Controls the random start point.
Periodic: Repeats the grid for periodic patterns across the texture space. This can be tileable but it is not guaranteed depending on other parameters.
Detail: Additive noise, each additional octave is calculated with a higher frequency and added to the base noise. Can be expensive.
Bandwidth: Controls the amount of kernel detail that is passed through.
Impulses: Controls the amount of kernel splats, high values are slower to compute.
Frequency: Kernel shape frequency, higher values provides more detail.
Phase: Controls the phase of the kernel signal.
Phase Weight: This controls the Phase randomisation.
Randomness: Like with Voronoi, this controls the position used within the cell. When set to zero, the noise is more regular in appearance.
Variance: Controls the amount of random rotation used for each splat.
Rotation: Controls the base rotation used for each splat.
Direction: For Anisotropic and Hybrid noise, this controls the direction and rotation of the splats. The magnitude of the vector controls the strength.

Notes:

  • Rotation and Variance are used together to create directional patterns of noise.
  • Frequency, Bandwidth and Direction are closely linked. All can affect the frequency of the noise pattern.
  • Phase, Rotation and Variance are converted into radians within the noise. These inputs could be degrees.

Final notes:

  • I’m not skilled in writing SIMD to speed this up. It will work much like Voronoi as far as performace goes but it is not the cheapest noise.
  • Patch acceptance is not guaranteed. If there is good feedback then I will ask for it to be reviewed.
  • I work on Blender in my spare time, this means that development can be slow.
  • Have fun!
45 Likes

Many many thanks for this very useful and powerful noise texture!
Seems to work pretty nicely already here. I already had a lot of fun with both the shader node and the geometry node.

Only thing (bug) I noticed is that while it’s missing from the shader properties menu (or whatever that is called):

it’s available two times in the SHIFT+A menu in the shader editor:

I hope this will land in master soon as it offers nice details that are hard to achieve with the existing noises.

2 Likes

Thanks. I’ll fix these.

2 Likes

I personally would love having new noise types and this one seems very versatile.

4 Likes

The node is missing from the surface shader menu because the node defaults to float output. You’ll notice musgrave is missing too.

2 Likes

For now it seems to have a lot of inconsistency with other procedural nodes, notably it’s missing the 1D-4D switch, the octave/detail is a variable float instead of an int in other nodes that have it and none of the other nodes have an exposed seed value. Also i’m fairly sure a conversion into a -1 :1 range can be easily done with two math nodes (x * 2 - 1).
This is just my observation, please let me know if there any reasons for the things i’ve mentioned.

  • Other dimensions like 1D, 4D might be possible, not really looked into that. I’d rather focus on the 3D version and then add others if possible.
  • Octave/Detail - this can be changed. Noted.
  • The conversion range is a nice UI (keep node trees small) thing but this is a candidate for removal to simplify the node. I have a patch for the Noise node to add this but it looks like it will be rejected.
  • Seed is likely to be removed too.

I really liked the node. It would definitely be very helpful in procedural texturing. so I’m looking forward to her getting into the master. The only thing I noticed was incomprehensible scars that are visible at close proximity. I don’t know if it’s bad, or if it’s the way it should be.


2 Likes

This is one of the downsides of Gabor noise. There can be artefacts at close proximity and also with some high frequencies. I’ve not been able to solve these.

2 Likes

I think that even with this limitation this is great addition to rather limited noise palette we have.

I found another issue beside the low Impulse mentioned above. I don’t know if this is the limitation or something that can be improved. With very high scale and high frequency I would assume all detail to be small, but as shown below the pattern is not uniform:

@Charlie should the artists post their fun with Gabor Noise here or maybe it would be better to have dedicated thread on BA, to not pollute Cycles Development thread there?

3 Likes

Hello. I never met Gabor noise before and I do not know how it should work. So some my assumptions can be strange/wrong.

I tested it. It gives interesting patterns and i wish it will appear in Blender.
I’ve found, that Rotation is float and it works only as Z-rotation. So I can’t control it much for steep surfaces (or I need to use UV/2D) to rotate around normals. will be great to have vec3 rotation may be or even 4D: 3d vector as axis and float angle. It called Axis Angle in blender (objects have such type of rotation)

Also Wave mode differs from all others by grain size very much. So as user I would prefer scale modifier inside, to have approximately same grain size

4 Likes

Per this paper, artifacts at the splat boundaries can be eliminated by using a windowing function on the truncated Gaussian kernel, or a continuous Gaussian approximation. I’ve tried the function they list in my own OSL implementation of Gabor noise and it worked quite well, with only a small visual difference from a true Gaussian kernel.

(I should note that most of the other critiques in that paper apply only to the original Gabor noise and not the filtered solid noise that most implementations are based upon)

3 Likes

Try Anisotropic and the Direction input for wrapping on surfaces.

Wave is different so would need to be adjusted.

3 Likes

This is good info. Is your windowed implementation available? I can incorporate it.

1 Like

Low pulses will show these artefacts. It’s good to see what people do with the noise so I don’t mind if they are posted here.

1 Like

Hmm, I did quick check and even with Impulses set to 16 and beyond these low-frequency patches are still present.
Will post some test here then. Thanks!

Sure, here’s the OSL script. The other big change from the built-in OSL Gabor noise is that I added a radial anisotropic mode.

gabor_noise.osl

1 Like

Awesome, I’ll take a look at this. Thank you.

1 Like

New build available.

  • Remove Octaves and replace with Detail
  • Remove Seed
  • Change Weight to Phase Weight
  • Tweak Wave kernel frequency
  • Use gaussian provided by Lee Bruemmer (improves artefacts) - thanks
  • Simplify code and further tidy up
22 Likes

Looks pretty interesting!