Skip to content

Simplex Noise 2D Gradient returns both a noise value and a gradient #22

Description

@bleppie

snoise_grad returns a float3 that has the gradient in xy and the noise value in z. The current shader-graph function, SimplexNoise2DGradient_float, returns the x component of the gradient as the noise value and ignores the rest. The gradient is useful for a lot of operations, so I would recommend changing the function to:

void SimplexNoise2DGradient_float(float2 input, out float Out, out float2 Grad)
{
float3 all = snoise_grad(input);
Out = all.z;
Grad = all.xy;
}

And change the corresponding subgraph accordingly to outut both a value and a gradient.

Thanks for putting this all together, great package!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions