pandemonium_engine/modules/material_maker/nodes/sdf3d/sdf3d_render.h

43 lines
1.2 KiB
C++
Raw Normal View History

2022-06-17 12:25:33 +02:00
#ifndef MM_SDF3D_RENDER_H
#define MM_SDF3D_RENDER_H
2022-06-16 15:29:08 +02:00
2022-06-17 12:25:33 +02:00
#include "../mm_node.h"
#include "../mm_node_universal_property.h"
2022-06-16 15:29:08 +02:00
2022-06-17 12:25:33 +02:00
class MMSdf3dRender : public MMNode {
GDCLASS(MMSdf3dRender, MMNode);
2022-06-16 15:29:08 +02:00
2022-06-17 12:25:33 +02:00
public:
Ref<MMNodeUniversalProperty> get_input();
void set_input(const Ref<MMNodeUniversalProperty> &val);
2022-06-16 15:29:08 +02:00
2022-06-17 12:25:33 +02:00
Ref<MMNodeUniversalProperty> get_out_height_map();
void set_out_height_map(const Ref<MMNodeUniversalProperty> &val);
2022-06-16 15:29:08 +02:00
2022-06-17 12:25:33 +02:00
Ref<MMNodeUniversalProperty> get_out_normal_map();
void set_out_normal_map(const Ref<MMNodeUniversalProperty> &val);
2022-06-16 15:29:08 +02:00
2022-06-17 12:25:33 +02:00
Ref<MMNodeUniversalProperty> get_out_color_map();
void set_out_color_map(const Ref<MMNodeUniversalProperty> &val);
2022-06-16 15:29:08 +02:00
2022-06-17 12:25:33 +02:00
void _init_properties();
void _register_methods(MMGraphNode *mm_graph_node);
void _render(const Ref<MMMaterial> &material);
Color _get_value_for(const Vector2 &uv, const int pseed);
Vector2 sdf3d_raymarch(const Vector2 &uv);
Vector3 sdf3d_normal(const Vector3 &p);
2022-06-16 15:29:08 +02:00
2022-06-17 12:25:33 +02:00
MMSdf3dRender();
~MMSdf3dRender();
2022-06-16 15:29:08 +02:00
2022-06-17 12:25:33 +02:00
protected:
static void _bind_methods();
2022-06-16 15:29:08 +02:00
2022-06-17 12:25:33 +02:00
Ref<MMNodeUniversalProperty> input;
Ref<MMNodeUniversalProperty> out_height_map;
Ref<MMNodeUniversalProperty> out_normal_map;
Ref<MMNodeUniversalProperty> out_color_map;
2022-06-16 15:29:08 +02:00
};
#endif