You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When adding another outline with add_outline() to the NavigationRegion2D to create a hole via make_polygons_from_outlines(), sometimes the renderer does not create a hole and instead layers another polygon on top. This issue is somehow location-dependent, and is shown in the minimal reproduction project when the CollisionPolygon2D is placed at (-256,120) vs (360,-100) for example.
Unsure if this is necessary, but expanding the Polygon via offset_polygon() is used to create the outline in the project. I was unable to reproduce this bug without it. But I do not know if it's necessary.
Based on how the NavigationRegion2D is rendered with and without the hole, I believe this is not just a rendering issue but the hole is not actually created. As when the hole renders correctly it also is triangulated correctly, and when it doesn't the original NavigationRegion2D remains a single polygon.
Steps to reproduce
Create a NavigationRegion2D with a NavigationPolygon large enough to encompass another shape inside of it.
Create another Polygon inside of the NavigationRegion2D
Expand the Polygon via offset_polygon()
Add the Polygon vertices as an outline to the NavigationPolygon and then make_polygons_from_outlines()
Move the Polygon around until it does not render a hole correctly. This part is a bit of a mystery to me, but the minimal production project starts the Polygon in a position (-256,120) where it doesn't render correctly. Moving the Polygon to (360,-100) will cause the NavigationPolygon2D to render the hole correctly.
The make_polygons_from_outlines() function has a lot of known problems that break the navigation mesh creation easily, hence why that function is deprecated in Godot 4.2 that adds 2D navigation mesh baking.
Godot version
v4.1.2.stable.official [399c9dc]
System information
Windows 10
Issue description
When adding another outline with
add_outline()
to theNavigationRegion2D
to create a hole viamake_polygons_from_outlines()
, sometimes the renderer does not create a hole and instead layers another polygon on top. This issue is somehow location-dependent, and is shown in the minimal reproduction project when theCollisionPolygon2D
is placed at (-256,120) vs (360,-100) for example.Unsure if this is necessary, but expanding the
Polygon
viaoffset_polygon()
is used to create the outline in the project. I was unable to reproduce this bug without it. But I do not know if it's necessary.Based on how the
NavigationRegion2D
is rendered with and without the hole, I believe this is not just a rendering issue but the hole is not actually created. As when the hole renders correctly it also is triangulated correctly, and when it doesn't the originalNavigationRegion2D
remains a single polygon.Steps to reproduce
NavigationRegion2D
with aNavigationPolygon
large enough to encompass another shape inside of it.Polygon
inside of theNavigationRegion2D
Polygon
viaoffset_polygon()
Polygon
vertices as an outline to theNavigationPolygon
and thenmake_polygons_from_outlines()
Polygon
around until it does not render a hole correctly. This part is a bit of a mystery to me, but the minimal production project starts thePolygon
in a position (-256,120) where it doesn't render correctly. Moving thePolygon
to (360,-100) will cause theNavigationPolygon2D
to render the hole correctly.Minimal reproduction project
navigation_polygon_rendering.zip
The text was updated successfully, but these errors were encountered: