File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -400,15 +400,15 @@ void Noise::resizeNoiseBuf(bool is3d)
400
400
float ofactor;
401
401
402
402
// maximum possible spread value factor
403
- ofactor = ( float )( 1 << ( np->octaves - 1 ) );
403
+ ofactor = pow (np-> lacunarity , np->octaves - 1 );
404
404
405
405
// noise lattice point count
406
406
// (int)(sz * spread * ofactor) is # of lattice points crossed due to length
407
407
// + 2 for the two initial endpoints
408
408
// + 1 for potentially crossing a boundary due to offset
409
- nlx = (int )(sx * ofactor / np->spread .X ) + 3 ;
410
- nly = (int )(sy * ofactor / np->spread .Y ) + 3 ;
411
- nlz = is3d ? (int )(sz * ofactor / np->spread .Z ) + 3 : 1 ;
409
+ nlx = (int )ceil (sx * ofactor / np->spread .X ) + 3 ;
410
+ nly = (int )ceil (sy * ofactor / np->spread .Y ) + 3 ;
411
+ nlz = is3d ? (int )ceil (sz * ofactor / np->spread .Z ) + 3 : 1 ;
412
412
413
413
delete[] noise_buf;
414
414
try {
You can’t perform that action at this time.
0 commit comments