Commit 10140b28 authored by Grégoire Duvauchelle's avatar Grégoire Duvauchelle Committed by LAMBERT Jean-charles
Browse files

Fix outline bug

parent e66d2fc8
......@@ -24,6 +24,12 @@ void main()
vec4 centerWorld = model_view_matrix*vec4(point_center, 1);
vec4 billboard_vertex_pos = centerWorld + vec4(relativePos, 1);
vpos = proj_matrix*billboard_vertex_pos;
if (second_pass){
float outline_width = 2; //px
vec2 normal = -normalize(relativePos.xy);
vec2 offset = normal / screen_dims * outline_width * vpos.w;
vpos.xy += offset;
}
}
else {
angle = 2*PI/nb_vertices*gl_VertexID-PI/4;
......
......@@ -339,7 +339,7 @@ bool CPointset::isNameVisible() {
return m_is_name_visible;
}
void CPointset::setFillratio(float fill_ratio) {
m_fill_ratio = fill_ratio < 0 ? 0 : fill_ratio > 1 ? 1 : fill_ratio; //clamp
m_fill_ratio = fill_ratio < 0 ? 0 : fill_ratio >= 1 ? 0.9999 : fill_ratio; //clamp
}
float CPointset::getFillratio() const {
return m_fill_ratio;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment