@@ -282,14 +282,16 @@ namespace FastNoise
282282
283283 void SetSource ( SmartNodeArg<> gen ) { this ->SetSourceMemberVariable ( mSource , gen ); }
284284 void SetStepCount ( float stepCount ) { mStepCount = stepCount; mStepCountRecip = 1 / stepCount; }
285- void SetSmoothness ( float smoothness ) { mSmoothness = smoothness; if ( mSmoothness != 0 .0f ) mSmoothnessRecip = 1 + 1 / smoothness; }
285+
286+ void SetSmoothness ( float smoothness ) { mSmoothness = smoothness; if ( smoothness != 0 .0f ) mSmoothnessRecip = 1 + 1 / smoothness; }
287+ void SetSmoothness ( SmartNodeArg<> gen ) { this ->SetSourceMemberVariable ( mSmoothness , gen ); }
286288
287289 protected:
288290 GeneratorSource mSource ;
291+ HybridSource mSmoothness = 0 .0f ;
292+ float mSmoothnessRecip = 0 .0f ;
289293 float mStepCount = 1 .0f ;
290294 float mStepCountRecip = 1 .0f ;
291- float mSmoothness = 0 .0f ;
292- float mSmoothnessRecip = 0 .0f ;
293295 };
294296
295297#ifdef FASTNOISE_METADATA
@@ -303,7 +305,7 @@ namespace FastNoise
303305 groups.push_back ( " Modifiers" );
304306 this ->AddGeneratorSource ( " Source" , &Terrace::SetSource );
305307 this ->AddVariable ( { " Step Count" , " Increasing the step count reduces the size of each step" }, 1 .0f , &Terrace::SetStepCount );
306- this ->AddVariable ( { " Smoothness" , " How smooth the transitions between steps are" }, 0 .0f , &Terrace::SetSmoothness );
308+ this ->AddHybridSource ( { " Smoothness" , " How smooth the transitions between steps are" }, 0 .0f , &Terrace::SetSmoothness , &Terrace::SetSmoothness );
307309
308310 description =
309311 " Cuts the input value into steps to give a terraced terrain effect" ;
0 commit comments