Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Commit

Permalink
Fixed cellular value/distance error
Browse files Browse the repository at this point in the history
  • Loading branch information
Auburn committed May 7, 2017
1 parent cb3f40b commit 19e070f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions FastNoiseSIMD/FastNoiseSIMD_internal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1611,7 +1611,7 @@ static SIMDf VECTORCALL FUNC(CellularValue##distanceFunc##Single)(SIMDi seed, SI
\
xd = SIMDf_MUL_ADD(xd, invMag, xcf);\
yd = SIMDf_MUL_ADD(yd, invMag, ycf);\
zd = SIMDf_MUL_ADD(zd, invMag, SIMDf_SUB(SIMDf_CONVERT_TO_FLOAT(zc), z));\
zd = SIMDf_MUL_ADD(zd, invMag, zcf);\
\
SIMDf newCellValue = SIMDf_MUL(SIMDf_NUM(hash2Float), SIMDf_CONVERT_TO_FLOAT(hash));\
SIMDf newDistance = distanceFunc##_DISTANCE(xd, yd, zd);\
Expand Down Expand Up @@ -1809,7 +1809,7 @@ static SIMDf VECTORCALL FUNC(CellularDistance##distanceFunc##Single)(SIMDi seed,
\
xd = SIMDf_MUL_ADD(xd, invMag, xcf);\
yd = SIMDf_MUL_ADD(yd, invMag, ycf);\
zd = SIMDf_MUL_ADD(zd, invMag, SIMDf_SUB(SIMDf_CONVERT_TO_FLOAT(zc), z));\
zd = SIMDf_MUL_ADD(zd, invMag, zcf);\
\
SIMDf newDistance = distanceFunc##_DISTANCE(xd, yd, zd);\
\
Expand Down Expand Up @@ -1963,10 +1963,6 @@ CELLULAR_LOOKUP_SINGLE(Euclidean)
CELLULAR_LOOKUP_SINGLE(Manhattan)
CELLULAR_LOOKUP_SINGLE(Natural)

CELLULAR_DISTANCE2CAVE_SINGLE(Euclidean)
CELLULAR_DISTANCE2CAVE_SINGLE(Manhattan)
CELLULAR_DISTANCE2CAVE_SINGLE(Natural)

#undef Natural_DISTANCE
#define Natural_DISTANCE(_x, _y, _z) SIMDf_MUL(Euclidean_DISTANCE(_x,_y,_z), Manhattan_DISTANCE(_x,_y,_z))

Expand All @@ -1985,6 +1981,10 @@ CELLULAR_DISTANCE2_MULTI(Distance2Sub)
CELLULAR_DISTANCE2_MULTI(Distance2Div)
CELLULAR_DISTANCE2_MULTI(Distance2Mul)

CELLULAR_DISTANCE2CAVE_SINGLE(Euclidean)
CELLULAR_DISTANCE2CAVE_SINGLE(Manhattan)
CELLULAR_DISTANCE2CAVE_SINGLE(Natural)

#define CELLULAR_MULTI(returnFunc)\
switch(m_cellularDistanceFunction)\
{\
Expand Down

0 comments on commit 19e070f

Please sign in to comment.