Implement raytraced lightmap

This commit is contained in:
2019-01-09 23:32:10 +01:00
parent 3dde1e1083
commit 9787175b13
12 changed files with 240 additions and 28 deletions

View File

@@ -9,11 +9,12 @@
#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 };
enum class ShadeMode : uint8_t { Transparent, Flat, Solid, Textured };
NodeSliderH* m_groud_opacity;
NodeSliderH* m_groud_value;
@@ -29,9 +30,14 @@ public:
NodeSliderH* m_hm_lyaw;
NodeSliderH* m_hm_lpitch;
NodeButton* m_render;
NodeButton* m_commit;
HeightmapPlane m_hm_plane;
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;
@@ -41,4 +47,5 @@ public:
float get_height() const;
float get_offset() const;
void draw_heightmap(const glm::mat4& proj, const glm::mat4& camera) const;
void bake_uvs();
};