Skip to content

Commit

Permalink
Revert to faster coord value function
Browse files Browse the repository at this point in the history
  • Loading branch information
Auburn committed Apr 6, 2024
1 parent 11e368c commit a52ec75
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/FastNoise/Generators/Utils.inl
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ namespace FastNoise
int32v hash = seed;
hash ^= (primedPos ^ ...);

#if 1
hash *= hash * int32v( 0x27d4eb2d );
return FS::Convert<float>( hash ) * float32v( -1.0f / (float)INT_MIN );

#else // More accurate bounding but slower
int32v zeroCase = hash >> 8;
hash *= hash * int32v( 0x27d4eb2d );
Expand All @@ -230,6 +235,7 @@ namespace FastNoise
float32v sign = FS::Cast<float>( hash & int32v( -2147483648 ) );
return FS::InvMasked( zeroCase == int32v( 0x7FFFFF ), f32 | sign );
#endif
}

FS_FORCEINLINE static float32v Lerp( float32v a, float32v b, float32v t )
Expand Down

0 comments on commit a52ec75

Please sign in to comment.