Follow-up of 6194e67e68 - Separated the part that computed triangles normals and lighting inside the fragment shader into a separate shader mm_gouraud, which is only used for the multi-material painting gizmo.

This commit is contained in:
Lukáš Hejl 2021-10-15 18:34:31 +02:00
parent 912f73d79c
commit b45675b4e1
10 changed files with 179 additions and 84 deletions

View file

@ -126,7 +126,7 @@ public:
virtual bool gizmo_event(SLAGizmoEventType action, const Vec2d& mouse_position, bool shift_down, bool alt_down, bool control_down);
protected:
void render_triangles(const Selection& selection, const bool use_polygon_offset_fill = true) const;
virtual void render_triangles(const Selection& selection, bool use_polygon_offset_fill = true) const;
void render_cursor() const;
void render_cursor_circle() const;
void render_cursor_sphere(const Transform3d& trafo) const;
@ -176,6 +176,14 @@ protected:
Right
};
struct ClippingPlaneDataWrapper
{
std::array<float, 4> clp_dataf;
std::array<float, 2> z_range;
};
ClippingPlaneDataWrapper get_clipping_plane_data() const;
private:
bool is_mesh_point_clipped(const Vec3d& point, const Transform3d& trafo) const;
void update_raycast_cache(const Vec2d& mouse_position,