Blender V5.3
gabor.h File Reference
#include "kernel/svm/node_types.h"
#include "kernel/svm/util.h"
#include "util/hash.h"

Go to the source code of this file.

Macros

#define IMPULSES_COUNT   8

Functions

ccl_device float2 compute_2d_gabor_kernel (const float2 position, const float frequency, const float orientation)
ccl_device float compute_2d_gabor_standard_deviation ()
ccl_device float2 compute_2d_gabor_noise_cell (float2 cell, const float2 position, const float frequency, const float isotropy, const float base_orientation)
ccl_device float2 compute_2d_gabor_noise (const float2 coordinates, const float frequency, const float isotropy, const float base_orientation)
ccl_device float2 compute_3d_gabor_kernel (const float3 position, const float frequency, const float3 orientation)
ccl_device float compute_3d_gabor_standard_deviation ()
ccl_device float3 compute_3d_orientation (const float3 orientation, const float isotropy, const float4 seed)
ccl_device float2 compute_3d_gabor_noise_cell (float3 cell, const float3 position, const float frequency, const float isotropy, const float3 base_orientation)
ccl_device float2 compute_3d_gabor_noise (const float3 coordinates, const float frequency, const float isotropy, const float3 base_orientation)
ccl_device_noinline void svm_node_tex_gabor (ccl_private float *ccl_restrict stack, const ccl_global SVMNodeTexGabor &ccl_restrict node)

Macro Definition Documentation

◆ IMPULSES_COUNT

#define IMPULSES_COUNT   8

Definition at line 36 of file gabor.h.

Function Documentation

◆ compute_2d_gabor_kernel()

ccl_device float2 compute_2d_gabor_kernel ( const float2 position,
const float frequency,
const float orientation )

◆ compute_2d_gabor_noise()

ccl_device float2 compute_2d_gabor_noise ( const float2 coordinates,
const float frequency,
const float isotropy,
const float base_orientation )

◆ compute_2d_gabor_noise_cell()

ccl_device float2 compute_2d_gabor_noise_cell ( float2 cell,
const float2 position,
const float frequency,
const float isotropy,
const float base_orientation )

◆ compute_2d_gabor_standard_deviation()

ccl_device float compute_2d_gabor_standard_deviation ( )

Computes the approximate standard deviation of the zero mean normal distribution representing the amplitude distribution of the noise based on Equation (9) in the original Gabor noise paper. For simplicity, the Hann window is ignored and the orientation is fixed since the variance is orientation invariant. We start integrating the squared Gabor kernel with respect to x:

\int_{-\infty}^{-\infty} (e^{- \pi (x^2 + y^2)} cos(2 \pi f_0 x))^2 dx

Which gives:

\frac{(e^{2 \pi f_0^2}-1) e^{-2 \pi y^2 - 2 pi f_0^2}}{2^\frac{3}{2}}

Then we similarly integrate with respect to y to get:

\frac{1 - e^{-2 \pi f_0^2}}{4}

Secondly, we note that the second moment of the weights distribution is 0.5 since it is a fair Bernoulli distribution. So the final standard deviation expression is square root the integral multiplied by the impulse density multiplied by the second moment.

Note however that the integral is almost constant for all frequencies larger than one, and converges to an upper limit as the frequency approaches infinity, so we replace the expression with the following limit:

\lim_{x \to \infty} \frac{1 - e^{-2 \pi f_0^2}}{4}

To get an approximation of 0.25.

Definition at line 112 of file gabor.h.

References ccl_device, compute_2d_gabor_standard_deviation(), IMPULSES_COUNT, and sqrtf.

◆ compute_3d_gabor_kernel()

ccl_device float2 compute_3d_gabor_kernel ( const float3 position,
const float frequency,
const float3 orientation )

◆ compute_3d_gabor_noise()

ccl_device float2 compute_3d_gabor_noise ( const float3 coordinates,
const float frequency,
const float isotropy,
const float3 base_orientation )

◆ compute_3d_gabor_noise_cell()

ccl_device float2 compute_3d_gabor_noise_cell ( float3 cell,
const float3 position,
const float frequency,
const float isotropy,
const float3 base_orientation )

◆ compute_3d_gabor_standard_deviation()

ccl_device float compute_3d_gabor_standard_deviation ( )

◆ compute_3d_orientation()

ccl_device float3 compute_3d_orientation ( const float3 orientation,
const float isotropy,
const float4 seed )

◆ svm_node_tex_gabor()