Happy fxh how to use FBM defines

He there i try to use the happy. fxh noise file and am wondering how I use the fbm defines

   #define FBM(name, basis, p, persistence, lacunarity, octaves)               \
float sum##name = 0.0;                                                  \
float amp##name = 1.0;                                                  \
float totalAmp##name = 0.0;                                             \
float freq##name = 1.0;                                                 \
for(int i##name=0; i##name <= octaves; i##name++)                       \
{                                                                       \
    sum##name += basis((p+i##name*27.3) * freq##name) * amp##name;      \
    totalAmp##name += abs(amp##name);                                   \
    amp##name *= persistence;                                           \
    freq##name *= lacunarity;                                           \
}                                                                       \

float name = sum##name/totalAmp##name

I tried it like this float2 bla = FBM(perlinFBM, perlin, i.uv, 0.5, 2, 3); but it does not compile are there any examples for usage?

Thanks.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.