Tech ENABLE_GL_CORE_PROFILE - Thick lines shader enhanced to render dashed lines
Fixed conflicts while rebase with master
This commit is contained in:
parent
94305e5912
commit
914a66e2c3
17 changed files with 169 additions and 27 deletions
src/slic3r/GUI
|
@ -112,6 +112,17 @@ void GLModel::Geometry::add_vertex(const Vec3f& position, const Vec3f& normal)
|
|||
vertices.emplace_back(normal.z());
|
||||
}
|
||||
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
void GLModel::Geometry::add_vertex(const Vec4f& position)
|
||||
{
|
||||
assert(format.vertex_layout == EVertexLayout::P4);
|
||||
vertices.emplace_back(position.x());
|
||||
vertices.emplace_back(position.y());
|
||||
vertices.emplace_back(position.z());
|
||||
vertices.emplace_back(position.w());
|
||||
}
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
|
||||
void GLModel::Geometry::add_index(unsigned int id)
|
||||
{
|
||||
indices.emplace_back(id);
|
||||
|
@ -249,6 +260,9 @@ size_t GLModel::Geometry::vertex_stride_floats(const Format& format)
|
|||
case EVertexLayout::P3: { return 3; }
|
||||
case EVertexLayout::P3T2: { return 5; }
|
||||
case EVertexLayout::P3N3: { return 6; }
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
case EVertexLayout::P4: { return 4; }
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
default: { assert(false); return 0; }
|
||||
};
|
||||
}
|
||||
|
@ -262,6 +276,9 @@ size_t GLModel::Geometry::position_stride_floats(const Format& format)
|
|||
case EVertexLayout::P3:
|
||||
case EVertexLayout::P3T2:
|
||||
case EVertexLayout::P3N3: { return 3; }
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
case EVertexLayout::P4: { return 4; }
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
default: { assert(false); return 0; }
|
||||
};
|
||||
}
|
||||
|
@ -274,7 +291,12 @@ size_t GLModel::Geometry::position_offset_floats(const Format& format)
|
|||
case EVertexLayout::P2T2:
|
||||
case EVertexLayout::P3:
|
||||
case EVertexLayout::P3T2:
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
case EVertexLayout::P3N3:
|
||||
case EVertexLayout::P4: { return 0; }
|
||||
#else
|
||||
case EVertexLayout::P3N3: { return 0; }
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
default: { assert(false); return 0; }
|
||||
};
|
||||
}
|
||||
|
@ -336,7 +358,12 @@ bool GLModel::Geometry::has_position(const Format& format)
|
|||
case EVertexLayout::P2T2:
|
||||
case EVertexLayout::P3:
|
||||
case EVertexLayout::P3T2:
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
case EVertexLayout::P3N3:
|
||||
case EVertexLayout::P4: { return true; }
|
||||
#else
|
||||
case EVertexLayout::P3N3: { return true; }
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
default: { assert(false); return false; }
|
||||
};
|
||||
}
|
||||
|
@ -348,7 +375,12 @@ bool GLModel::Geometry::has_normal(const Format& format)
|
|||
case EVertexLayout::P2:
|
||||
case EVertexLayout::P2T2:
|
||||
case EVertexLayout::P3:
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
case EVertexLayout::P3T2:
|
||||
case EVertexLayout::P4: { return false; }
|
||||
#else
|
||||
case EVertexLayout::P3T2: { return false; }
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
case EVertexLayout::P3N3: { return true; }
|
||||
default: { assert(false); return false; }
|
||||
};
|
||||
|
@ -362,7 +394,12 @@ bool GLModel::Geometry::has_tex_coord(const Format& format)
|
|||
case EVertexLayout::P3T2: { return true; }
|
||||
case EVertexLayout::P2:
|
||||
case EVertexLayout::P3:
|
||||
#if ENABLE_GL_CORE_PROFILE
|
||||
case EVertexLayout::P3N3:
|
||||
case EVertexLayout::P4: { return false; }
|
||||
#else
|
||||
case EVertexLayout::P3N3: { return false; }
|
||||
#endif // ENABLE_GL_CORE_PROFILE
|
||||
default: { assert(false); return false; }
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue