improve brush preview
This commit is contained in:
@@ -6,13 +6,28 @@
|
||||
|
||||
class NodeStrokePreview : public NodeBorder
|
||||
{
|
||||
struct StrokeFrame
|
||||
{
|
||||
glm::vec4 col;
|
||||
float pressure;
|
||||
std::array<vertex_t, 4> shapes;
|
||||
glm::vec4 m_mixer_rect;
|
||||
};
|
||||
|
||||
RTT m_rtt;
|
||||
RTT m_rtt_mixer;
|
||||
Texture2D m_tex; // blending tmp texture
|
||||
Texture2D m_tex_dual;
|
||||
Texture2D m_tex_background;
|
||||
Sampler m_sampler;
|
||||
Sampler m_sampler_brush;
|
||||
BrushMesh m_mesh;
|
||||
DynamicShape m_brush_shape;
|
||||
public:
|
||||
std::shared_ptr<Brush> m_brush;
|
||||
std::shared_ptr<Brush> m_dual_brush;
|
||||
Stroke m_stroke;
|
||||
Stroke m_dual_stroke;
|
||||
std::vector<glm::vec2> m_bez_points;
|
||||
virtual Node* clone_instantiate() const override;
|
||||
virtual void clone_copy(Node* dest) const override;
|
||||
@@ -21,6 +36,10 @@ public:
|
||||
void init_controls();
|
||||
virtual void restore_context() override;
|
||||
virtual void clear_context() override;
|
||||
void stroke_draw_mix(const glm::vec2& bb_min, const glm::vec2& bb_sz);
|
||||
// return rect {origin, size}
|
||||
glm::vec4 stroke_draw_samples(std::array<vertex_t, 4>& P, Texture2D& blend_tex);
|
||||
std::vector<StrokeFrame> stroke_draw_compute(Stroke& stroke) const;
|
||||
void draw_stroke();
|
||||
virtual void draw() override;
|
||||
virtual void handle_resize(glm::vec2 old_size, glm::vec2 new_size) override;
|
||||
|
||||
Reference in New Issue
Block a user