53 lines
1.4 KiB
C++
53 lines
1.4 KiB
C++
#pragma once
|
|
#include "node.h"
|
|
#include "node_stroke_preview.h"
|
|
#include "node_slider.h"
|
|
#include "brush.h"
|
|
#include "node_checkbox.h"
|
|
#include "node_combobox.h"
|
|
#include "node_image_texture.h"
|
|
#include "node_button.h"
|
|
#include "shape.h"
|
|
#include "image.h"
|
|
#include "nanort.h"
|
|
|
|
class NodePanelGrid : public Node
|
|
{
|
|
public:
|
|
enum class ShadeMode : uint8_t { Transparent, Flat, Solid, Textured };
|
|
|
|
NodeSliderH* m_groud_opacity;
|
|
NodeSliderH* m_groud_value;
|
|
NodeSliderH* m_groud_resolution;
|
|
NodeSliderH* m_groud_offset;
|
|
NodeImageTexture* m_hm_preview;
|
|
NodeButton* m_hm_load;
|
|
NodeButton* m_hm_clear;
|
|
NodeButton* m_hm_reload;
|
|
NodeComboBox* m_hm_shading;
|
|
NodeSliderH* m_hm_height;
|
|
NodeSliderH* m_hm_wireframe;
|
|
NodeSliderH* m_hm_lyaw;
|
|
NodeSliderH* m_hm_lpitch;
|
|
NodeButton* m_render;
|
|
NodeButton* m_commit;
|
|
HeightmapPlane m_hm_plane;
|
|
Sphere m_sphere;
|
|
Image m_hm_image;
|
|
Texture2D m_texture;
|
|
Sampler m_sampler_linear;
|
|
std::string m_file_path;
|
|
nanort::BVHAccel<float> m_rt_accel;
|
|
bool m_rt_dirty = true;;
|
|
ShadeMode m_shade_mode{ ShadeMode::Transparent };
|
|
|
|
virtual Node* clone_instantiate() const override;
|
|
virtual void clone_finalize(Node* dest) const override;
|
|
virtual void init() override;
|
|
void init_controls();
|
|
float get_height() const;
|
|
float get_offset() const;
|
|
void draw_heightmap(const glm::mat4& proj, const glm::mat4& camera) const;
|
|
void bake_uvs();
|
|
};
|