2022-06-18 16:21:46 +02:00
|
|
|
#ifndef MM_NOISE_H
|
|
|
|
#define MM_NOISE_H
|
2022-06-16 15:29:08 +02:00
|
|
|
|
2022-06-18 16:21:46 +02:00
|
|
|
#include "../mm_node.h"
|
|
|
|
#include "../mm_node_universal_property.h"
|
2022-06-16 15:29:08 +02:00
|
|
|
|
2022-06-18 16:21:46 +02:00
|
|
|
class MMNoise : public MMNode {
|
|
|
|
GDCLASS(MMNoise, MMNode);
|
2022-06-16 15:29:08 +02:00
|
|
|
|
2022-06-18 16:21:46 +02:00
|
|
|
public:
|
|
|
|
Ref<MMNodeUniversalProperty> get_image();
|
|
|
|
void set_image(const Ref<MMNodeUniversalProperty> &val);
|
2022-06-16 15:29:08 +02:00
|
|
|
|
2022-06-18 16:21:46 +02:00
|
|
|
int get_grid_size() const;
|
|
|
|
void set_grid_size(const int val);
|
2022-06-16 15:29:08 +02:00
|
|
|
|
2022-06-18 16:21:46 +02:00
|
|
|
float get_density() const;
|
|
|
|
void set_density(const float val);
|
2022-06-16 15:29:08 +02:00
|
|
|
|
2022-06-18 16:21:46 +02:00
|
|
|
void _init_properties();
|
|
|
|
void _register_methods(MMGraphNode *mm_graph_node);
|
|
|
|
Color _get_value_for(const Vector2 &uv, const int pseed);
|
|
|
|
void _render(const Ref<MMMaterial> &material);
|
2022-06-16 15:29:08 +02:00
|
|
|
|
2022-06-18 16:21:46 +02:00
|
|
|
MMNoise();
|
|
|
|
~MMNoise();
|
2022-06-16 15:29:08 +02:00
|
|
|
|
2022-06-18 16:21:46 +02:00
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
2022-06-16 15:29:08 +02:00
|
|
|
|
2022-06-18 16:21:46 +02:00
|
|
|
//tool
|
|
|
|
//export(MMNodeUniversalProperty)
|
|
|
|
Ref<MMNodeUniversalProperty> image;
|
|
|
|
//export(int)
|
|
|
|
int grid_size = 16;
|
|
|
|
//export(float)
|
|
|
|
float density = 0.5;
|
2022-06-16 15:29:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|