enable rtt dtor, default values for <text> node, dual-brush wip, more brush options

This commit is contained in:
2019-02-14 02:08:29 +01:00
parent 8ad005de8b
commit 999723dd14
26 changed files with 998 additions and 389 deletions

View File

@@ -6,22 +6,29 @@
class Brush
{
public:
Brush() = default;
Brush(const Brush& brush) = default;
//Brush() = default;
//Brush(const Brush& brush) = default;
std::string m_name;
std::shared_ptr<Texture2D> m_tip_texture;
std::string m_brush_path;
std::string m_brush_thumb_path;
std::string m_stencil_path;
std::shared_ptr<Texture2D> m_tip_texture;
std::shared_ptr<Texture2D> m_dual_texture;
std::string m_dual_path;
std::string m_dual_thumb_path;
std::shared_ptr<Texture2D> m_stencil_texture;
//uint16_t m_tex_id = 0;
//uint16_t m_tex_stencil_id = const_hash("data/paper.jpg");
std::string m_stencil_path;
std::string m_stencil_thumb_path;
glm::vec4 m_tip_color{0, 0, 0, 1};
float m_tip_size = 0;
float m_tip_spacing = 0;
float m_tip_flow = 0;
float m_tip_opacity = 0;
float m_tip_angle = 0;
float m_tip_angle_delay = 0;
float m_tip_mix = 0;
float m_tip_stencil = 0;
float m_tip_wet = 0;
@@ -32,9 +39,6 @@ public:
bool m_tip_angle_follow = false;
bool m_tip_flow_pressure = false;
bool m_tip_size_pressure = false;
bool m_tip_hue_pressure = false;
bool m_tip_sat_pressure = false;
bool m_tip_val_pressure = false;
float m_jitter_scale = 0;
float m_jitter_angle = 0;
float m_jitter_spread = 0;
@@ -43,7 +47,27 @@ public:
float m_jitter_sat = 0;
float m_jitter_val = 0;
int m_blend_mode = 0;
bool m_tip_invert = false;
bool m_tip_flipx = false;
bool m_tip_flipy = false;
bool m_tex_enabled = false;
bool m_dual_enabled = false;
int m_dual_blend_mode = 0;
bool m_dual_randflip = false;
float m_dual_size = 0;
float m_dual_spacing = 0;
float m_dual_scatter = 0;
bool m_dual_scatter_axis = false;
bool m_dual_invert = false;
bool m_dual_flipx = false;
bool m_dual_flipy = false;
bool m_tip_randflipx = false;
bool m_tip_randflipy = false;
float m_tip_aspect = 0.5;
bool load_texture(const std::string& path, const std::string& thumb);
bool load_dual(const std::string& path, const std::string& thumb);
bool load_stencil(const std::string& path);
bool load();
};
@@ -53,6 +77,7 @@ struct StrokeSample
glm::vec3 col = { 0, 0, 0 };
glm::vec3 pos = { 0, 0, 0 };
glm::vec3 origin = { 0, 0, 0 };
glm::vec2 scale = { 1, 1 };
float size = 0;
float flow = 0;
float angle = 0;
@@ -110,9 +135,9 @@ public:
bool m_filter_points = true;
Camera m_camera;
std::shared_ptr<Brush> m_brush;
cbuffer<float, 3> m_direction;
cbuffer<float, 10> m_pressure_buff;
cbuffer<glm::vec3, 3> m_hsv_jitter;
cbuffer<float> m_direction{ 1 };
cbuffer<float> m_pressure_buff{ 10 };
cbuffer<glm::vec3> m_hsv_jitter{ 3 };
StrokeSample m_prev_sample;
std::vector<Keypoint> m_keypoints;
std::vector<std::pair<glm::vec3, float>> m_hold_points;