Skip to content

Commit

Permalink
Update to FastNoise2 0.10.0-alpha and fix some blueprint meta tags
Browse files Browse the repository at this point in the history
  • Loading branch information
DoubleDeez committed Jun 10, 2023
1 parent 269054d commit ce5b007
Show file tree
Hide file tree
Showing 15 changed files with 165 additions and 109 deletions.
Binary file modified Binaries/ThirdParty/FastNoise2/Linux/libFastNoise.so
Binary file not shown.
Binary file modified Binaries/ThirdParty/FastNoise2/Linux/libFastNoiseD.so
Binary file not shown.
Binary file modified Binaries/ThirdParty/FastNoise2/Mac/libFastNoise.dylib
Binary file not shown.
Binary file modified Binaries/ThirdParty/FastNoise2/Mac/libFastNoiseD.dylib
Binary file not shown.
Binary file modified Binaries/ThirdParty/FastNoise2/Win64/FastNoise.dll
Binary file not shown.
Binary file modified Binaries/ThirdParty/FastNoise2/Win64/FastNoiseD.dll
Binary file not shown.
Binary file modified Binaries/ThirdParty/FastNoise2/Win64/FastNoiseD.pdb
Binary file not shown.
Binary file modified Source/ThirdParty/FastNoise2/Win64/Debug/FastNoiseD.lib
Binary file not shown.
Binary file modified Source/ThirdParty/FastNoise2/Win64/Release/FastNoise.lib
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace FastNoise
groups.push_back( "Coherent Noise" );

description =
"Smooth gradient noise from N dimensional simplex grid\n"
"Smooth gradient noise from an N dimensional simplex grid\n"
"Developed by Ken Perlin in 2001";
}
};
Expand All @@ -45,8 +45,32 @@ namespace FastNoise
groups.push_back( "Coherent Noise" );

description =
"Smooth gradient noise from N dimensional simplex honeycomb grid\n"
"Developed by K.jpg in 2014";
"Smooth gradient noise from an N dimensional simplex grid, alternate implementation\n"
"Developed by K.jpg in 2019";
}
};
#endif

class OpenSimplex2S : public virtual Generator
{
public:
FASTSIMD_LEVEL_SUPPORT(FastNoise::SUPPORTED_SIMD_LEVELS);
const Metadata& GetMetadata() const override;
};

#ifdef FASTNOISE_METADATA
template<>
struct MetadataT<OpenSimplex2S> : MetadataT<Generator>
{
SmartNode<> CreateNode(FastSIMD::eLevel) const override;

MetadataT()
{
groups.push_back("Coherent Noise");

description =
"Smoother gradient noise from an N dimensional simplex grid\n"
"Developed by K.jpg in 2017";
}
};
#endif
Expand Down
7 changes: 5 additions & 2 deletions Source/ThirdParty/FastNoise2/include/FastNoise/SmartNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,13 @@ namespace FastNoise
friend class SmartNode;

explicit SmartNode( T* ptr ) :
mReferenceId( SmartNodeManager::GetReference( ptr ) ),
mReferenceId( ptr ? SmartNodeManager::GetReference( ptr ) : SmartNodeManager::kInvalidReferenceId ),
mPtr( ptr )
{
SmartNodeManager::IncReference( mReferenceId );
if( mReferenceId != SmartNodeManager::kInvalidReferenceId )
{
SmartNodeManager::IncReference( mReferenceId );
}
}

void Release()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ UFastNoise2OpenSimplex2Generator* UFastNoise2BlueprintLibrary::MakeOpenSimplex2G
return NewObject<UFastNoise2OpenSimplex2Generator>();
}

UFastNoise2OpenSimplex2SGenerator* UFastNoise2BlueprintLibrary::MakeOpenSimplex2SGenerator()
{
return NewObject<UFastNoise2OpenSimplex2SGenerator>();
}

UFastNoise2CellularValueGenerator* UFastNoise2BlueprintLibrary::MakeCellularValueGenerator(UFastNoise2GeneratorBase* JitterModifierSource, float JitterModifierValue, EFastNoise2DistanceFunction DistanceFunction, int32 ValueIndex)
{
UFastNoise2CellularValueGenerator* Gen = NewObject<UFastNoise2CellularValueGenerator>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void UFastNoise2EncodedNodeTreeGenerator::PostInitProperties()
}
}

void UFastNoise2EncodedNodeTreeGenerator::SetEncodedNodeTree(FString InValue)
void UFastNoise2EncodedNodeTreeGenerator::SetEncodedNodeTree(const FString& InValue)
{
EncodedNodeTree = InValue;
ResetGenerator();
Expand Down Expand Up @@ -227,7 +227,7 @@ FastNoise::SmartNode<FastNoise::Generator> UFastNoise2SineWaveGenerator::InitGen

//////////////////////////////////////////////////////////////////////////

void UFastNoise2PositionOutputGenerator::SetData(FVector4 InMultipliers, FVector4 InOffsets)
void UFastNoise2PositionOutputGenerator::SetData(const FVector4& InMultipliers, const FVector4& InOffsets)
{
check(PositionOutputGeneratorInst.get());
Offsets = InOffsets;
Expand All @@ -237,12 +237,12 @@ void UFastNoise2PositionOutputGenerator::SetData(FVector4 InMultipliers, FVector
PositionOutputGeneratorInst->Set<FastNoise::Dim::W>(InMultipliers.W, InOffsets.W);
}

void UFastNoise2PositionOutputGenerator::SetMultipliers(FVector4 InMultipliers)
void UFastNoise2PositionOutputGenerator::SetMultipliers(const FVector4& InMultipliers)
{
SetData(InMultipliers, Offsets);
}

void UFastNoise2PositionOutputGenerator::SetOffsets(FVector4 InOffsets)
void UFastNoise2PositionOutputGenerator::SetOffsets(const FVector4& InOffsets)
{
SetData(Multipliers, InOffsets);
}
Expand Down Expand Up @@ -272,7 +272,7 @@ void UFastNoise2DistanceToPointGenerator::SetDistanceFunction(EFastNoise2Distanc
DistanceToPointGeneratorInst->SetDistanceFunction(FFastNoise2Helpers::ConvertUnrealToFastNoiseDistanceFunction(InDistanceFunction));
}

void UFastNoise2DistanceToPointGenerator::SetScale(FVector4 InScale)
void UFastNoise2DistanceToPointGenerator::SetScale(const FVector4& InScale)
{
check(DistanceToPointGeneratorInst.get());
Scale = InScale;
Expand Down Expand Up @@ -324,6 +324,14 @@ FastNoise::SmartNode<FastNoise::Generator> UFastNoise2OpenSimplex2Generator::Ini

//////////////////////////////////////////////////////////////////////////

FastNoise::SmartNode<FastNoise::Generator> UFastNoise2OpenSimplex2SGenerator::InitGenerator()
{
OpenSimplex2SGeneratorInst = FastNoise::New<FastNoise::OpenSimplex2S>();
return OpenSimplex2SGeneratorInst;
}

//////////////////////////////////////////////////////////////////////////

void UFastNoise2CellularGeneratorBase::SetJitterModifierSource(UFastNoise2GeneratorBase* InSource)
{
if (InSource != nullptr)
Expand Down Expand Up @@ -1023,7 +1031,7 @@ void UFastNoise2DomainOffsetGenerator::SetOffsetSources(UFastNoise2GeneratorBase
}
}

void UFastNoise2DomainOffsetGenerator::SetOffsetValues(FVector4 InValue)
void UFastNoise2DomainOffsetGenerator::SetOffsetValues(const FVector4& InValue)
{
check(DomainOffsetGeneratorInst.get());
Offsets = InValue;
Expand Down Expand Up @@ -1051,7 +1059,7 @@ void UFastNoise2DomainRotateGenerator::SetSource(UFastNoise2GeneratorBase* InSou
}
}

void UFastNoise2DomainRotateGenerator::SetRotation(FRotator InValue)
void UFastNoise2DomainRotateGenerator::SetRotation(const FRotator& InValue)
{
check(DomainRotateGeneratorInst.get());
Rotation = InValue;
Expand Down Expand Up @@ -1218,7 +1226,7 @@ void UFastNoise2DomainAxisScaleGenerator::SetSource(UFastNoise2GeneratorBase* In
}
}

void UFastNoise2DomainAxisScaleGenerator::SetScale(FVector4 InValue)
void UFastNoise2DomainAxisScaleGenerator::SetScale(const FVector4& InValue)
{
check(DomainAxisScaleGeneratorInst.get());
Scale = InValue;
Expand Down
Loading

0 comments on commit ce5b007

Please sign in to comment.