Add Noise sampling nodes to graphs

This commit is contained in:
Wojtek Figat
2022-07-31 23:43:35 +02:00
parent 2104dbc682
commit 20572c53af
6 changed files with 82 additions and 3 deletions

View File

@@ -15,6 +15,7 @@
#include "Engine/Scripting/ManagedCLR/MUtils.h"
#include "Engine/Serialization/MemoryReadStream.h"
#include "Engine/Utilities/StringConverter.h"
#include "Engine/Utilities/Noise.h"
#define RAND Random::Rand()
#define ENSURE(condition, errorMsg) if (!(condition)) { OnError(node, box, errorMsg); return; }
@@ -1052,6 +1053,22 @@ void VisjectExecutor::ProcessGroupTools(Box* box, Node* node, Value& value)
case 29:
value = tryGetValue(node->GetBox(0), Value::Zero);
break;
// Noises
case 30:
value = Noise::PerlinNoise((Float2)tryGetValue(node->GetBox(0)));
break;
case 31:
value = Noise::SimplexNoise((Float2)tryGetValue(node->GetBox(0)));
break;
case 32:
value = Noise::WorleyNoise((Float2)tryGetValue(node->GetBox(0)));
break;
case 33:
value = Noise::VoronoiNoise((Float2)tryGetValue(node->GetBox(0)));
break;
case 34:
value = Noise::CustomNoise((Float3)tryGetValue(node->GetBox(0)));
break;
default:
break;
}