Merge pull request #34726 from nekomatata/polygon2d-antialiasing-fix
Fixed antialiasing option for Polygon2D with concave/hollow shapes
This commit is contained in:
@ -1033,7 +1033,11 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
|
||||
#ifdef GLES_OVER_GL
|
||||
if (polygon->antialiased) {
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
_draw_generic_indices(GL_LINE_STRIP, polygon->indices.ptr(), polygon->count, polygon->points.size(), polygon->points.ptr(), polygon->uvs.ptr(), polygon->colors.ptr(), polygon->colors.size() == 1);
|
||||
if (polygon->antialiasing_use_indices) {
|
||||
_draw_generic_indices(GL_LINE_STRIP, polygon->indices.ptr(), polygon->count, polygon->points.size(), polygon->points.ptr(), polygon->uvs.ptr(), polygon->colors.ptr(), polygon->colors.size() == 1);
|
||||
} else {
|
||||
_draw_generic(GL_LINE_LOOP, polygon->points.size(), polygon->points.ptr(), polygon->uvs.ptr(), polygon->colors.ptr(), polygon->colors.size() == 1);
|
||||
}
|
||||
glDisable(GL_LINE_SMOOTH);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -901,7 +901,11 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
|
||||
#ifdef GLES_OVER_GL
|
||||
if (polygon->antialiased) {
|
||||
glEnable(GL_LINE_SMOOTH);
|
||||
_draw_generic_indices(GL_LINE_STRIP, polygon->indices.ptr(), polygon->count, polygon->points.size(), polygon->points.ptr(), polygon->uvs.ptr(), polygon->colors.ptr(), polygon->colors.size() == 1);
|
||||
if (polygon->antialiasing_use_indices) {
|
||||
_draw_generic_indices(GL_LINE_STRIP, polygon->indices.ptr(), polygon->count, polygon->points.size(), polygon->points.ptr(), polygon->uvs.ptr(), polygon->colors.ptr(), polygon->colors.size() == 1);
|
||||
} else {
|
||||
_draw_generic(GL_LINE_LOOP, polygon->points.size(), polygon->points.ptr(), polygon->uvs.ptr(), polygon->colors.ptr(), polygon->colors.size() == 1);
|
||||
}
|
||||
glDisable(GL_LINE_SMOOTH);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user