Node: Gabor Noise Texture #110802

Open
Charlie Jolly wants to merge 68 commits from CharlieJolly/blender:gabor into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 4 additions and 12 deletions
Showing only changes of commit 1f8517f17a - Show all commits

View File

@ -118,14 +118,8 @@ vec3 gabor_kernel(GaborParams gp, float freq, vec3 omega, float phi, vec3 positi
/* Set omega (angular frequency) and phi (phase) for the impulse. Unlike reference papers,
* Anisotropic is not normalised to provide additional artistic control. */
GaborParams gabor_sample(GaborParams gp,
vec3 cell,
vec3 rand_position,
float orand,
float orand2,
float prand,
inout vec3 omega,
out float phi)
GaborParams gabor_sample(
GaborParams gp, float orand, float orand2, float prand, out vec3 omega, out float phi)
{
float pvar = mix(0.0, prand * 2.0 - 1.0, gp.phase_variance);
phi = M_2PI * pvar + gp.phase;
@ -170,8 +164,7 @@ vec3 gabor_cell_3d(GaborParams gp, vec3 cell, vec3 cell_position, int seed)
float phi;
vec3 rand_values = hash_vec4_to_vec3(vec4(cell, float(seed + (num_impulses + i) * 1259)));
gabor_sample(
gp, cell, rand_position, rand_values.x, rand_values.y, rand_values.z, omega, phi);
gabor_sample(gp, rand_values.x, rand_values.y, rand_values.z, omega, phi);
const float g = (1.0 + M_EPI) * (exp(-M_PI * dv) - M_EPI);
sum += gabor_kernel(gp, gp.base_frequency, omega, phi, kernel_position, g);
}
@ -203,8 +196,7 @@ vec3 gabor_cell_2d(GaborParams gp, vec3 cell, vec3 cell_position, int seed)
float phi;
vec3 rand_values = hash_vec4_to_vec3(vec4(cell, float(seed + (num_impulses + i) * 1259)));
gabor_sample(
gp, cell, rand_position, rand_values.x, rand_values.y, rand_values.z, omega, phi);
gabor_sample(gp, rand_values.x, rand_values.y, rand_values.z, omega, phi);
const float g = (1.0 + M_EPI) * (exp(-M_PI * dv) - M_EPI);
sum += gabor_kernel(gp, gp.base_frequency, omega, phi, kernel_position, g);
}